
    :root {
      --primary: #4CAF50;
      --primary-hover: #45a049;
      --bg: #f9f9f9;
      --border: #ccc;
      --text: #333;
    }
    html {
      overflow-x: hidden;
    }
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      max-width: none;
      margin: 0;
      padding: 0;
      overflow-x: hidden;
      background: #f0f2f5;
      color: var(--text);
      /* ダブルタップズームを抑制し、タップの反応を良くする */
      touch-action: manipulation;
    }
    .furoshiki-app {
      box-sizing: border-box;
      max-width: 840px;
      margin: 0 auto;
      padding: 20px;
    }
    h1 {
      text-align: center;
      font-size: 1.8rem;
      margin-bottom: 5px;
      color: #2c3e50;
      font-weight: 800;
    }
    .app-subtitle {
      text-align: center;
      color: #555;
      font-size: 0.95rem;
      margin-top: 0;
      margin-bottom: 25px;
      line-height: 1.5;
      font-weight: 500;
    }

    .info-banner {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 15px;
      border-radius: 8px;
      margin-bottom: 15px;
      font-size: 0.95rem;
      line-height: 1.5;
      box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    .security-banner {
      background-color: #e3f2fd;
      border-left: 5px solid #2196f3;
      color: #0d47a1;
    }
    .feature-banner {
      background-color: #fff8e1;
      border-left: 5px solid #ffb300;
      color: #795548;
      margin-bottom: 20px;
    }
    .info-banner .icon {
      font-size: 1.8rem;
      flex-shrink: 0;
    }
    .info-banner strong {
      display: inline-block;
      margin-bottom: 3px;
    }

    #drop-zone {
      border: 3px dashed var(--border);
      border-radius: 12px;
      padding: 40px 20px;
      text-align: center;
      background: #fff;
      cursor: pointer;
      transition: all 0.3s ease;
      margin-bottom: 20px;
      box-shadow: 0 4px 6px rgba(0,0,0,0.05);
      /* タップ時のハイライトを無効化 */
      -webkit-tap-highlight-color: transparent;
    }
    #drop-zone:hover {
      border-color: #999;
      background: #fafafa;
    }
    #drop-zone.dragover {
      background: #e8f5e9;
      border-color: var(--primary);
    }
    #drop-zone p {
      margin: 0;
      color: #666;
      font-size: 1.1rem;
      line-height: 1.5;
    }
    #drop-zone .icon {
      font-size: 3rem;
      margin-bottom: 10px;
      display: block;
    }

    .settings-panel {
      background: #fff;
      padding: 15px 20px;
      border-radius: 12px;
      margin-bottom: 20px;
      box-shadow: 0 2px 4px rgba(0,0,0,0.05);
      display: flex;
      align-items: flex-end;
      gap: 15px;
      flex-wrap: wrap;
    }
    .setting-group {
      display: flex;
      flex-direction: column;
      flex-grow: 1;
      min-width: 150px;
    }
    .setting-group label {
      font-weight: bold;
      color: #444;
      font-size: 0.95rem;
      margin-bottom: 5px;
    }
    .settings-panel select {
      padding: 12px 15px;
      border: 1px solid var(--border);
      border-radius: 8px;
      font-size: 1rem;
      flex-grow: 1;
      background-color: #fff;
      /* iPhone標準のスタイルを少しリセット */
      -webkit-appearance: none;
      appearance: none;
      background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
      background-repeat: no-repeat;
      background-position: right 10px center;
      background-size: 1em;
      padding-right: 40px;
      cursor: pointer;
    }
    .settings-panel select:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
    }
    .settings-panel select:disabled {
      background-color: #f0f0f0;
      color: #999;
      cursor: not-allowed;
    }

    #preview-list {
      list-style: none;
      padding: 0;
      margin: 0 0 30px 0;
      display: grid;
      /* PCでは140px〜、スマホではメディアクエリで調整 */
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 15px;
    }
    .preview-item {
      position: relative;
      background: #fff;
      border-radius: 10px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
      overflow: hidden;
      cursor: grab;
      aspect-ratio: 3/4; /* A4比率に近い縦長 */
      transition: transform 0.2s;
    }
    .preview-item:hover {
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    .preview-item:active {
      cursor: grabbing;
    }
    .preview-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      pointer-events: none;
    }
    .delete-btn {
      position: absolute;
      top: 8px;
      right: 8px;
      background: rgba(220, 53, 69, 0.9);
      color: white;
      border: none;
      border-radius: 50%;
      width: 32px;
      height: 32px;
      font-size: 18px;
      line-height: 1;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10;
      transition: background 0.2s;
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    .delete-btn:hover {
      background: rgba(200, 35, 51, 1);
    }
    .page-number {
      position: absolute;
      bottom: 8px;
      left: 8px;
      background: rgba(0,0,0,0.65);
      color: white;
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 12px;
      font-weight: bold;
      pointer-events: none;
    }

    .actions {
      display: flex;
      justify-content: center;
      gap: 15px;
      padding-bottom: 40px;
      flex-wrap: wrap;
    }
    .action-btn {
      padding: 15px 25px;
      font-size: 1.1rem;
      font-weight: bold;
      border-radius: 30px;
      cursor: pointer;
      box-shadow: 0 4px 8px rgba(0,0,0,0.2);
      transition: all 0.2s ease;
      width: 100%;
      max-width: 250px;
      border: none;
    }
    .action-btn:active:not(:disabled) {
      transform: scale(0.98);
    }
    .action-btn:disabled {
      background: #ccc !important;
      color: #fff !important;
      border-color: #ccc !important;
      cursor: not-allowed;
      box-shadow: none;
    }
    #preview-btn {
      background: #fff;
      color: var(--primary);
      border: 2px solid var(--primary);
    }
    #generate-btn {
      background: var(--primary);
      color: white;
      border: 2px solid var(--primary);
    }

    #toast {
      visibility: hidden;
      min-width: 250px;
      margin-left: -125px;
      background-color: #333;
      color: #fff;
      text-align: center;
      border-radius: 8px;
      padding: 16px;
      position: fixed;
      z-index: 10001;
      left: 50%;
      bottom: 30px;
      font-size: 0.9rem;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      opacity: 0;
      transition: opacity 0.3s, bottom 0.3s, visibility 0.3s;
    }
    #toast.show {
      visibility: visible;
      opacity: 1;
      bottom: 50px;
    }

    .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.7);
      z-index: 1000;
      justify-content: center;
      align-items: center;
      padding: 20px;
      box-sizing: border-box;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    .modal.show {
      display: flex;
      opacity: 1;
    }
    .modal-content {
      background: #fff;
      border-radius: 12px;
      width: 100%;
      max-width: 900px;
      height: 90%;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      box-shadow: 0 10px 25px rgba(0,0,0,0.5);
      transform: translateY(20px);
      transition: transform 0.3s ease;
    }
    .modal.show .modal-content {
      transform: translateY(0);
    }
    .modal-header {
      padding: 15px 20px;
      border-bottom: 1px solid var(--border);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #f8f9fa;
    }
    .modal-header h2 {
      margin: 0;
      font-size: 1.2rem;
      color: #333;
    }
    .close-btn {
      background: none;
      border: none;
      font-size: 1.8rem;
      line-height: 1;
      cursor: pointer;
      color: #666;
      transition: color 0.2s;
    }
    .close-btn:hover {
      color: #000;
    }
    .modal-body {
      flex-grow: 1;
      padding: 0;
      background: #525659;
      position: relative;
      overflow: hidden;
    }
    #pdf-preview-container {
      width: 100%;
      height: 100%;
      overflow-y: auto;
      padding: 20px;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 20px;
    }
    .pdf-page-canvas {
      max-width: 100%;
      height: auto;
      box-shadow: 0 4px 10px rgba(0,0,0,0.3);
      background: white;
    }
    .modal-footer {
      padding: 15px 20px;
      border-top: 1px solid var(--border);
      text-align: right;
      background: #f8f9fa;
    }
    .download-btn {
      background: var(--primary);
      color: white;
      border: none;
      padding: 10px 20px;
      font-size: 1rem;
      font-weight: bold;
      border-radius: 8px;
      cursor: pointer;
      transition: background 0.2s;
    }
    .download-btn:hover {
      background: var(--primary-hover);
    }

    .sortable-ghost {
      opacity: 0.4;
      background-color: #f4f4f4;
    }

    #loading-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(255,255,255,0.85);
      z-index: 9999;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      backdrop-filter: blur(2px);
    }
    .spinner {
      border: 5px solid #f3f3f3;
      border-top: 5px solid var(--primary);
      border-radius: 50%;
      width: 50px;
      height: 50px;
      animation: spin 1s linear infinite;
      margin-bottom: 15px;
    }
    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }

    .tool-credits {
      margin-top: 40px;
      padding-top: 20px;
      border-top: 1px solid var(--border);
      text-align: center;
      font-size: 0.85rem;
      color: #666;
      line-height: 1.6;
    }
    .tool-credits a {
      color: var(--primary);
      text-decoration: none;
    }
    .tool-credits a:hover {
      text-decoration: underline;
    }
    .tool-credits .security-note {
      font-weight: bold;
      color: #2c3e50;
      margin-bottom: 10px;
    }
    .site-footer {
      margin-top: 0;
      margin-left: 0;
      width: 100%;
      padding: 0;
      border-top: 0;
      text-align: left;
      font-size: 11px;
      color: #82908a;
      background: #18211f;
      line-height: 1.5;
    }
    .site-footer .footer-inner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      width: min(1120px, calc(100% - 40px));
      min-height: 64px;
      margin: 0 auto;
      padding: 14px 0;
    }
    .site-footer .footer-copy,
    .site-footer .footer-links {
      display: flex;
      align-items: center;
      gap: 20px;
    }
    .site-footer .footer-links a {
      color: #c1cdc6;
      text-decoration: underline;
      text-underline-offset: 3px;
    }
    .site-footer .footer-links a:hover,
    .site-footer .footer-links a:focus-visible {
      color: #fff;
    }

    .info-section {
      background: #fff;
      padding: 25px 30px;
      border-radius: 12px;
      box-shadow: 0 4px 6px rgba(0,0,0,0.05);
      margin-bottom: 40px;
      line-height: 1.7;
    }
    .info-section h2 {
      font-size: 1.25rem;
      color: #2c3e50;
      border-bottom: 3px solid var(--primary);
      padding-bottom: 8px;
      margin-top: 0;
      margin-bottom: 15px;
      display: inline-block;
    }
    .info-section h2:not(:first-child) {
      margin-top: 35px;
    }
    .info-section ol {
      padding-left: 20px;
      margin: 0;
      color: #444;
    }
    .info-section li {
      margin-bottom: 12px;
    }
    .info-section p {
      color: #555;
      font-size: 0.95rem;
      margin: 0 0 10px 0;
    }
    .info-section p:last-child {
      margin-bottom: 0;
    }
    .info-section .disclaimer-text {
      font-size: 0.9rem;
      color: #666;
      background: #f8f9fa;
      padding: 15px;
      border-radius: 8px;
      border: 1px solid #eee;
    }

    @media (max-width: 760px) {
      .site-footer .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        width: min(100% - 28px, 600px);
      }
      .site-footer .footer-copy,
      .site-footer .footer-links {
        flex-wrap: wrap;
        gap: 6px 14px;
      }
    }

    @media (max-width: 600px) {
      body {
        padding: 10px;
      }
      h1 {
        font-size: 1.3rem;
        margin-top: 10px;
      }
      .info-banner {
        font-size: 0.85rem;
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
      }
      .info-banner .icon {
        font-size: 1.5rem;
        display: none;
      }
      #drop-zone {
        padding: 30px 10px;
      }
      #drop-zone p {
        font-size: 1rem;
      }
      .settings-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
      }
      .setting-group {
        min-width: 100%;
      }
      .settings-panel select {
        max-width: 100%;
      }
      #preview-list {
        grid-template-columns: repeat(2, 1fr);
      }
      .delete-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
      }
      .action-btn {
        max-width: 100%;
        border-radius: 12px;
      }
      .modal {
        padding: 10px;
      }
      .modal-content {
        height: 95%;
      }
      .info-section {
        padding: 20px 15px;
      }
      .info-section h2 {
        font-size: 1.15rem;
      }
    }
