    /* ============================================================
       PimPhid — design tokens
       System type, quiet neutrals, one accent. Depth from materials,
       not from borders and gradients.
       ============================================================ */
    :root {
      color-scheme: light;
      --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Sukhumvit Set", "Thonburi", "IBM Plex Sans Thai", "Segoe UI", system-ui, sans-serif;
      --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Sukhumvit Set", "Thonburi", "IBM Plex Sans Thai", "Segoe UI", system-ui, sans-serif;

      --bg: #f5f5f7;
      --surface: #ffffff;
      --surface-subtle: #fbfbfd;
      --surface-hover: #f2f2f4;
      --surface-glass: rgba(251, 251, 253, 0.72);
      --fill: rgba(118, 118, 128, 0.12);
      --fill-strong: rgba(118, 118, 128, 0.2);
      --fill-faint: rgba(118, 118, 128, 0.06);
      --seg-track: rgba(232, 232, 237, 0.86);

      --text-main: #1d1d1f;
      --text-secondary: #424245;
      --text-muted: #6e6e73;
      --placeholder: #a1a1a6;

      --border: rgba(0, 0, 0, 0.08);
      --border-strong: rgba(0, 0, 0, 0.14);

      --primary: #0071e3;
      --primary-hover: #0077ed;
      --primary-press: #006edb;
      --primary-soft: rgba(0, 113, 227, 0.08);
      --link: #0066cc;

      --success: #248a3d;
      --success-bg: rgba(52, 199, 89, 0.1);
      --warning: #b25000;
      --warning-bg: rgba(255, 159, 10, 0.12);
      --danger: #d70015;
      --danger-bg: rgba(255, 59, 48, 0.08);

      --radius-lg: 22px;
      --radius-md: 14px;
      --radius: 14px;
      --radius-sm: 10px;

      --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
      --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
      --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
      --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
      --thumb-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);

      --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
      --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
      --focus: 0 0 0 4px rgba(0, 113, 227, 0.28);
    }

    [data-theme="dark"] {
      color-scheme: dark;
      --bg: #000000;
      --surface: #1c1c1e;
      --surface-subtle: #161618;
      --surface-hover: #2c2c2e;
      --surface-glass: rgba(22, 22, 24, 0.72);
      --fill: rgba(118, 118, 128, 0.24);
      --fill-strong: rgba(118, 118, 128, 0.36);
      --fill-faint: rgba(118, 118, 128, 0.14);
      --seg-track: rgba(44, 44, 46, 0.86);

      --text-main: #f5f5f7;
      --text-secondary: #d2d2d7;
      --text-muted: #98989d;
      --placeholder: #6e6e73;

      --border: rgba(255, 255, 255, 0.1);
      --border-strong: rgba(255, 255, 255, 0.18);

      --primary: #0a84ff;
      --primary-hover: #1a8cff;
      --primary-press: #0077ed;
      --primary-soft: rgba(10, 132, 255, 0.16);
      --link: #2997ff;

      --success: #30d158;
      --success-bg: rgba(48, 209, 88, 0.14);
      --warning: #ffb340;
      --warning-bg: rgba(255, 159, 10, 0.16);
      --danger: #ff6961;
      --danger-bg: rgba(255, 69, 58, 0.16);

      --shadow-xs: none;
      --shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.04);
      --shadow-md: 0 0 0 1px rgba(255, 255, 255, 0.05);
      --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
      --thumb-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
      --focus: 0 0 0 4px rgba(10, 132, 255, 0.4);
    }

    /* ============================================================ Base */
    * { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
    body {
      font-family: var(--font);
      font-size: 17px;
      line-height: 1.53;
      letter-spacing: -0.012em;
      background: var(--bg);
      color: var(--text-main);
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      transition: background-color 0.3s ease, color 0.3s ease;
    }
    ::selection { background: rgba(0, 113, 227, 0.22); }
    button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
    button { -webkit-tap-highlight-color: transparent; }
    :focus { outline: none; }
    :focus-visible { box-shadow: var(--focus); border-radius: 10px; }
    code {
      font-family: ui-monospace, "SF Mono", Menlo, monospace;
      font-size: 0.88em;
      background: var(--fill-faint);
      padding: 1px 6px;
      border-radius: 6px;
    }
    a { color: var(--link); }
    svg { flex-shrink: 0; }

    /* ============================================================ Navigation (material bar) */
    .navbar {
      position: sticky;
      top: 0;
      z-index: 100;
      background: var(--surface-glass);
      backdrop-filter: saturate(180%) blur(20px);
      -webkit-backdrop-filter: saturate(180%) blur(20px);
      border-bottom: 1px solid var(--border);
    }
    .nav-container {
      max-width: 1080px;
      height: 52px;
      margin: 0 auto;
      padding: 0 22px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .brand-logo {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      font-family: var(--font-display);
      font-size: 19px;
      font-weight: 600;
      letter-spacing: -0.022em;
      color: var(--text-main);
      text-decoration: none;
    }
    .brand-mark {
      width: 26px;
      height: 26px;
      border-radius: 7px;
      background: var(--text-main);
      color: var(--bg);
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .brand-mark svg { width: 15px; height: 15px; }
    .brand-logo .free-badge {
      font-size: 12px;
      font-weight: 500;
      letter-spacing: 0;
      color: var(--text-muted);
    }
    .nav-actions { display: flex; align-items: center; gap: 8px; }
    .nav-links { display: none; }
    .cmd-palette-trigger {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      height: 32px;
      padding: 0 10px 0 12px;
      border: none;
      border-radius: 9px;
      background: var(--fill-faint);
      color: var(--text-muted);
      font-size: 13px;
      cursor: pointer;
      transition: background-color 0.2s ease, color 0.2s ease;
    }
    .cmd-palette-trigger:hover { background: var(--fill); color: var(--text-main); }
    .kbd-pill {
      font-size: 11px;
      font-weight: 500;
      letter-spacing: 0.02em;
      color: var(--text-muted);
      padding: 1px 6px;
      border-radius: 5px;
      background: var(--surface);
      box-shadow: inset 0 0 0 1px var(--border);
    }
    .btn-icon {
      width: 32px;
      height: 32px;
      border: none;
      border-radius: 9px;
      background: transparent;
      color: var(--text-secondary);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background-color 0.2s ease;
    }
    .btn-icon:hover { background: var(--fill-faint); }
    .btn-icon:active { transform: scale(0.94); }
    .btn-icon svg { width: 18px; height: 18px; }
    @media (max-width: 560px) {
      .brand-logo .free-badge { display: none; }
      .cmd-palette-trigger { display: none; }
    }

    /* ============================================================ Layout */
    .container {
      max-width: 1080px;
      width: 100%;
      margin: 0 auto;
      padding: 0 22px 24px;
      display: flex;
      flex-direction: column;
      gap: 16px;
      flex: 1;
    }

    /* ============================================================ Hero */
    .hero-header {
      text-align: center;
      padding: 44px 0 14px;
    }
    .nw { display: inline-block; white-space: nowrap; }
    h1 {
      font-family: var(--font-display);
      font-size: clamp(32px, 4.6vw, 48px);
      line-height: 1.08;
      font-weight: 700;
      letter-spacing: -0.028em;
      color: var(--text-main);
      max-width: 820px;
      margin: 0 auto 12px;
    }
    p.subtitle {
      font-size: clamp(17px, 2vw, 21px);
      line-height: 1.45;
      letter-spacing: -0.016em;
      color: var(--text-muted);
      max-width: 640px;
      margin: 0 auto;
      text-wrap: pretty;
    }
    .badge-privacy {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 14px;
      font-size: 14px;
      color: var(--text-muted);
    }
    .badge-privacy svg { width: 14px; height: 14px; color: var(--success); }
    @media (max-width: 640px) {
      .hero-header { padding: 28px 0 8px; }
      .badge-privacy { font-size: 13px; text-align: left; align-items: flex-start; }
      .badge-privacy svg { margin-top: 3px; }
    }

    /* ============================================================ Tool switcher (segmented control) */
    .feature-tabs {
      position: relative;
      display: flex;
      gap: 0;
      width: fit-content;
      max-width: 100%;
      margin: 8px auto 12px;
      padding: 3px;
      border-radius: 13px;
      background: var(--seg-track);
      overflow-x: auto;
      scrollbar-width: none;
      scroll-behavior: smooth;
      position: sticky;
      top: 62px;
      z-index: 50;
      backdrop-filter: saturate(180%) blur(20px);
      -webkit-backdrop-filter: saturate(180%) blur(20px);
    }
    .feature-tabs::-webkit-scrollbar { display: none; }
    .seg-thumb {
      position: absolute;
      top: 3px;
      bottom: 3px;
      left: 0;
      width: 0;
      border-radius: 10px;
      background: var(--surface);
      box-shadow: var(--thumb-shadow);
      transition: transform 0.45s var(--ease-spring), width 0.45s var(--ease-spring);
      z-index: 0;
      pointer-events: none;
    }
    [data-theme="dark"] .seg-thumb { background: #636366; }
    .feature-tab-btn {
      position: relative;
      z-index: 1;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      height: 36px;
      padding: 0 16px;
      border: none;
      border-radius: 10px;
      background: transparent;
      color: var(--text-secondary);
      font-size: 14px;
      font-weight: 500;
      white-space: nowrap;
      cursor: pointer;
      transition: color 0.2s ease, transform 0.15s ease;
    }
    .feature-tab-btn svg { width: 16px; height: 16px; opacity: 0.75; }
    .feature-tab-btn:hover { color: var(--text-main); }
    .feature-tab-btn:active { transform: scale(0.97); }
    .feature-tab-btn.active { color: var(--text-main); font-weight: 600; }
    .feature-tab-btn.active svg { opacity: 1; color: var(--primary); }
    .no-thumb .feature-tab-btn.active { background: var(--surface); box-shadow: var(--thumb-shadow); }
    .wow-pill { display: none; }
    @media (max-width: 860px) {
      .feature-tabs { width: 100%; justify-content: flex-start; top: 58px; }
      .toolbar > .mode-group { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
      .toolbar > .mode-group::-webkit-scrollbar { display: none; }
      .feature-tab-btn { padding: 0 14px; }
    }

    /* ============================================================ Tool sections */
    .tab-section { display: none; flex-direction: column; gap: 14px; }
    .tab-section.active { display: flex; animation: sectionIn 0.36s var(--ease-out); }
    @keyframes sectionIn {
      from { opacity: 0; transform: translateY(6px); }
      to { opacity: 1; transform: none; }
    }

    /* Options row: no box, just a calm row of controls */
    .toolbar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 12px 16px;
      padding: 2px 2px;
      background: transparent;
      border: none;
      box-shadow: none;
    }
    .options-group {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px 14px;
      font-size: 14px;
    }
    .options-group > label:not(.checkbox-label) { font-size: 14px !important; color: var(--text-muted) !important; }

    /* Inner segmented controls */
    .mode-group {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 2px;
      padding: 2px;
      border-radius: 10px;
      background: var(--fill);
    }
    .mode-btn {
      height: 30px;
      padding: 0 12px;
      border: none;
      border-radius: 8px;
      background: transparent;
      color: var(--text-secondary);
      font-size: 13px;
      font-weight: 500;
      white-space: nowrap;
      cursor: pointer;
      transition: background-color 0.25s var(--ease-out), color 0.2s ease, box-shadow 0.25s var(--ease-out), transform 0.15s ease;
    }
    .mode-btn:hover:not(.active) { color: var(--text-main); }
    .mode-btn:active { transform: scale(0.97); }
    .mode-btn.active {
      background: var(--surface);
      color: var(--text-main);
      font-weight: 600;
      box-shadow: var(--thumb-shadow);
    }
    [data-theme="dark"] .mode-btn.active { background: #636366; }

    /* Pop-up buttons */
    .select-control {
      -webkit-appearance: none;
      appearance: none;
      height: 32px;
      padding: 0 30px 0 12px;
      border: none;
      border-radius: 9px;
      background-color: var(--surface);
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' viewBox='0 0 10 14'%3E%3Cpath d='M2 5l3-3 3 3M2 9l3 3 3-3' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 10px center;
      box-shadow: inset 0 0 0 1px var(--border), var(--shadow-xs);
      color: var(--text-main);
      font-size: 14px;
      cursor: pointer;
      transition: box-shadow 0.2s ease;
    }
    .select-control:hover { box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-xs); }
    .select-control:focus-visible { box-shadow: inset 0 0 0 1px var(--primary), var(--focus); border-radius: 9px; }

    /* Switches */
    .checkbox-label {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      font-size: 14px;
      color: var(--text-secondary);
      cursor: pointer;
      user-select: none;
    }
    .checkbox-label input[type="checkbox"] {
      -webkit-appearance: none;
      appearance: none;
      position: relative;
      flex-shrink: 0;
      width: 38px;
      height: 23px;
      border-radius: 999px;
      background: var(--fill-strong);
      cursor: pointer;
      transition: background-color 0.25s ease;
    }
    .checkbox-label input[type="checkbox"]::before {
      content: "";
      position: absolute;
      top: 2px;
      left: 2px;
      width: 19px;
      height: 19px;
      border-radius: 50%;
      background: #ffffff;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
      transition: transform 0.35s var(--ease-spring), width 0.2s ease;
    }
    .checkbox-label input[type="checkbox"]:active::before { width: 23px; }
    .checkbox-label input[type="checkbox"]:checked { background: #34c759; }
    .checkbox-label input[type="checkbox"]:checked::before { transform: translateX(15px); }
    .checkbox-label input[type="checkbox"]:checked:active::before { transform: translateX(11px); }
    .checkbox-label input[type="checkbox"]:focus-visible { box-shadow: var(--focus); }

    /* ============================================================ Cards & panels */
    .card {
      background: var(--surface);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-md);
      overflow: hidden;
      border: none;
    }
    .grid-io { display: grid; grid-template-columns: 1fr 1fr; min-height: 340px; }
    .panel { position: relative; display: flex; flex-direction: column; padding: 20px 22px 16px; }
    .panel-input { border-right: 1px solid var(--border); }
    .grid-io > .panel:not(.panel-input) { background: var(--surface-subtle); }
    @media (max-width: 768px) {
      .grid-io { grid-template-columns: 1fr; }
      .panel-input { border-right: none !important; border-bottom: 1px solid var(--border); }
      .panel { padding: 18px 18px 14px; }
    }
    .panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 10px;
      min-height: 28px;
    }
    .panel-title {
      font-size: 13px;
      font-weight: 600;
      letter-spacing: -0.005em;
      color: var(--text-muted);
      text-transform: none;
    }
    .detected-tag {
      display: inline-flex;
      align-items: center;
      height: 24px;
      padding: 0 10px;
      border-radius: 999px;
      background: var(--fill-faint);
      color: var(--text-muted);
      font-size: 12px;
      font-weight: 500;
      white-space: nowrap;
      border: none !important;
    }

    textarea {
      width: 100%;
      height: 100%;
      min-height: 200px;
      border: none;
      outline: none;
      resize: none;
      background: transparent;
      color: var(--text-main);
      font-size: 17px;
      line-height: 1.6;
    }
    textarea:focus-visible { box-shadow: none; }
    textarea::placeholder { color: var(--placeholder); }
    .output-area {
      flex: 1;
      min-height: 200px;
      font-size: 17px;
      line-height: 1.65;
      white-space: pre-wrap;
      word-break: break-word;
      color: var(--text-main);
      border-radius: 8px;
    }
    .output-area[contenteditable="true"]:focus-visible { box-shadow: none; }
    .output-area.empty { color: var(--placeholder); user-select: none; }

    .baht-Detected-bar {
      display: none;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px 12px;
      margin-top: 12px;
      padding: 12px 14px;
      border-radius: 12px;
      background: var(--primary-soft);
      color: var(--text-secondary);
      font-size: 15px;
      animation: sectionIn 0.3s var(--ease-out);
    }
    .baht-Detected-bar strong { font-weight: 600; color: var(--text-main); }

    .email-meta-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-bottom: 12px;
      padding-bottom: 14px;
      border-bottom: 1px solid var(--border);
    }
    @media (max-width: 520px) { .email-meta-grid { grid-template-columns: 1fr; } }
    .mini-field { display: flex; flex-direction: column; gap: 5px; }
    .mini-field label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
    .mini-field input, .form-input {
      width: 100%;
      height: 36px;
      padding: 0 12px;
      border: none;
      border-radius: 10px;
      background: var(--fill-faint);
      color: var(--text-main);
      font-size: 15px;
      transition: background-color 0.2s ease, box-shadow 0.2s ease;
    }
    .mini-field input::placeholder, .form-input::placeholder { color: var(--placeholder); }
    .mini-field input:focus, .form-input:focus,
    .form-textarea:focus {
      background: var(--surface);
      box-shadow: inset 0 0 0 1px var(--primary), var(--focus);
    }

    .actions-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 12px;
      padding-top: 14px;
      border-top: 1px solid var(--border);
    }
    .char-count { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
    .btn-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }

    /* ============================================================ Buttons */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      height: 34px;
      padding: 0 16px;
      border: none;
      border-radius: 999px;
      font-size: 14px;
      font-weight: 500;
      letter-spacing: -0.01em;
      white-space: nowrap;
      text-decoration: none;
      cursor: pointer;
      transition: background-color 0.2s ease, color 0.2s ease, transform 0.12s ease, opacity 0.2s ease;
    }
    .btn:active { transform: scale(0.97); transition-duration: 0.08s; }
    .btn:focus-visible { box-shadow: var(--focus); border-radius: 999px; }
    .btn[style*="padding"] { height: 28px; padding: 0 12px !important; font-size: 13px !important; }
    .btn-secondary { background: var(--fill); color: var(--text-main); border: none !important; }
    .btn-secondary:hover { background: var(--fill-strong); }
    .btn-primary, .btn-ai, .btn-success {
      background: var(--primary);
      color: #ffffff;
      font-weight: 600;
    }
    .btn-primary:hover, .btn-ai:hover, .btn-success:hover { background: var(--primary-hover); }
    .btn-primary:active, .btn-ai:active, .btn-success:active { background: var(--primary-press); }
    .btn-ai:disabled, .btn:disabled { opacity: 0.55; cursor: progress; transform: none; }

    .samples-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--text-muted); }
    .sample-chip {
      display: inline-flex;
      align-items: center;
      height: 26px;
      padding: 0 11px;
      border: none;
      border-radius: 999px;
      background: var(--fill-faint);
      color: var(--link);
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      transition: background-color 0.2s ease;
    }
    .sample-chip:hover { background: var(--primary-soft); }

    /* ============================================================ Word formatter */
    .doc-workspace { display: grid; grid-template-columns: 1fr 1.1fr; gap: 16px; align-items: start; }
    @media (max-width: 900px) { .doc-workspace { grid-template-columns: 1fr; } }
    .doc-form-card {
      display: flex;
      flex-direction: column;
      gap: 18px;
      padding: 22px;
      background: var(--surface);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-md);
      border: none;
    }
    .upload-dropzone {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      padding: 26px 18px;
      text-align: center;
      border: 1.5px dashed var(--border-strong);
      border-radius: 16px;
      background: var(--surface-subtle);
      cursor: pointer;
      transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.3s var(--ease-spring);
    }
    .upload-dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }
    .upload-dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.015); }
    .upload-icon { color: var(--primary); margin-bottom: 4px; line-height: 0; }
    .upload-icon svg { width: 30px; height: 30px; }
    .upload-title { font-size: 15px; font-weight: 600; color: var(--text-main); }
    .upload-sub { font-size: 13px; color: var(--text-muted); max-width: 360px; }
    .file-status-box {
      display: none;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 10px 12px 10px 14px;
      border-radius: 12px;
      background: var(--success-bg);
      color: var(--success);
      font-size: 14px;
      font-weight: 500;
      border: none;
    }
    .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .form-row-4 > div { display: flex; flex-direction: column; gap: 4px; }
    @media (max-width: 520px) { .form-row-2, .form-row-4 { grid-template-columns: 1fr 1fr; } }
    .form-group { display: flex; flex-direction: column; gap: 7px; }
    .form-group > label {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 6px;
      font-size: 13px;
      font-weight: 600;
      color: var(--text-secondary);
    }
    .form-row-4 label { font-size: 12px !important; font-weight: 500; color: var(--text-muted) !important; }
    .form-group .select-control { width: 100%; }
    .form-input[type="number"] { font-variant-numeric: tabular-nums; }
    .form-textarea {
      width: 100%;
      min-height: 160px;
      padding: 12px 14px;
      border: none;
      border-radius: 12px;
      background: var(--fill-faint);
      color: var(--text-main);
      font-size: 15px;
      line-height: 1.6;
      resize: vertical;
      transition: background-color 0.2s ease, box-shadow 0.2s ease;
    }

    .preview-wrapper {
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 18px;
      border-radius: var(--radius-lg);
      background: var(--fill-faint);
      border: none;
    }
    .preview-topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
    .a4-sheet {
      position: relative;
      width: 100%;
      min-height: 620px;
      max-height: 760px;
      overflow-y: auto;
      padding: 36px 32px 32px 46px;
      background: #ffffff;
      color: #000000;
      border-radius: 4px;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.1);
      font-family: 'Sarabun', serif;
      font-size: 15px;
      line-height: 1.55;
      letter-spacing: 0;
    }
    .a4-paragraph { margin-bottom: 6px; white-space: pre-wrap; word-break: break-word; }
    .a4-meta-line { margin-bottom: 4px; text-indent: 0 !important; }
    .a4-two-col { display: flex; justify-content: space-between; margin-bottom: 4px; text-indent: 0 !important; }
    .a4-two-col > span { width: 50%; }
    .a4-heading { font-weight: 700; margin-bottom: 10px; text-indent: 0 !important; }
    .a4-section-head { font-weight: 700; margin-top: 8px; margin-bottom: 4px; text-indent: 0 !important; }

    /* ============================================================ Metrics */
    .excel-stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
    @media (max-width: 720px) { .excel-stats-bar { grid-template-columns: 1fr 1fr; } }
    .stat-metric-card {
      display: flex;
      flex-direction: column;
      gap: 2px;
      padding: 14px 16px;
      background: var(--surface) !important;
      border: none !important;
      border-radius: 16px;
      box-shadow: var(--shadow-sm);
    }
    .stat-metric-label { font-size: 12px; font-weight: 500; color: var(--text-muted) !important; line-height: 1.35; }
    .stat-metric-val {
      font-family: var(--font-display);
      font-size: 28px !important;
      font-weight: 600;
      letter-spacing: -0.02em;
      line-height: 1.2;
      color: var(--text-main);
      font-variant-numeric: tabular-nums;
      margin-top: 2px;
    }
    #humClicheVal, #humWordCountVal, #humLangVal, #detBurstVal, #detPatternCountVal { color: var(--text-main) !important; }
    #humLangVal, #detBurstVal { font-size: 19px !important; line-height: 1.45; margin-top: 6px; }
    .stat-metric-sub { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

    /* Status rows (QC + verdict) */
    .auditor-banner, .detector-verdict-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
      padding: 14px 18px;
      border: none !important;
      border-radius: 16px;
      background: var(--surface);
      box-shadow: var(--shadow-sm);
      transition: background-color 0.3s ease;
    }
    .auditor-banner-passed, .detector-verdict-banner.verdict-human { background: var(--success-bg); box-shadow: none; }
    .detector-verdict-banner.verdict-mixed { background: var(--warning-bg); box-shadow: none; }
    .detector-verdict-banner.verdict-ai { background: var(--danger-bg); box-shadow: none; }
    .auditor-title-group { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
    .auditor-title-group > span:last-child { font-size: 14px !important; font-weight: 400 !important; color: var(--text-secondary) !important; }
    .auditor-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      height: 26px;
      padding: 0 11px;
      border-radius: 999px;
      background: var(--fill);
      color: var(--text-main);
      font-size: 13px;
      font-weight: 600;
      white-space: nowrap;
    }
    .auditor-badge.passed { background: var(--success); color: #ffffff; }
    [data-theme="dark"] .auditor-badge.passed { color: #00210a; }
    .auditor-checks { display: flex; flex-wrap: wrap; gap: 6px; }
    .auditor-check-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      height: 24px;
      padding: 0 10px;
      border-radius: 999px;
      background: var(--fill-faint);
      color: var(--text-muted);
      font-size: 12px;
      font-weight: 500;
      border: none;
    }
    .auditor-check-pill.ok { background: var(--surface); color: var(--success); }
    [data-theme="dark"] .auditor-check-pill.ok { background: rgba(0, 0, 0, 0.3); }

    .forensic-bars-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 14px 18px;
      padding: 16px 18px;
      background: var(--surface);
      border: none;
      border-radius: 16px;
      box-shadow: var(--shadow-sm);
    }
    @media (max-width: 900px) { .forensic-bars-grid { grid-template-columns: 1fr 1fr; } }
    .forensic-bar-item { display: flex; flex-direction: column; gap: 7px; }
    .forensic-bar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
    .forensic-bar-top span:last-child { font-variant-numeric: tabular-nums; color: var(--text-muted); }
    .forensic-bar-track { width: 100%; height: 6px; border-radius: 999px; background: var(--fill); overflow: hidden; border: none; }
    .forensic-bar-fill { height: 100%; width: 0%; border-radius: 999px; background: var(--primary); transition: width 0.6s var(--ease-spring), background-color 0.3s ease; }

    .hl-sent {
      display: inline;
      padding: 1px 3px;
      margin-right: 2px;
      border-radius: 4px;
      line-height: 1.95;
      color: var(--text-main);
      -webkit-box-decoration-break: clone;
      box-decoration-break: clone;
    }
    .hl-sent small { font-size: 11px; color: var(--text-muted); font-weight: 600 !important; opacity: 1 !important; }
    .hl-sent-high { background: rgba(255, 59, 48, 0.14); box-shadow: inset 0 -1.5px 0 rgba(255, 59, 48, 0.55); }
    .hl-sent-medium { background: rgba(255, 159, 10, 0.16); box-shadow: inset 0 -1.5px 0 rgba(255, 159, 10, 0.6); }
    .hl-sent-low { background: rgba(52, 199, 89, 0.12); box-shadow: inset 0 -1.5px 0 rgba(52, 199, 89, 0.5); }
    .hl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); }
    .hl-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; vertical-align: 1px; }
    .evidence-tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
    .evidence-chip {
      display: inline-flex;
      align-items: center;
      height: 24px;
      padding: 0 10px;
      border-radius: 999px;
      background: var(--danger-bg);
      color: var(--danger);
      font-size: 12px;
      font-weight: 500;
      border: none;
    }
    .evidence-chip.human-chip { background: var(--success-bg); color: var(--success); }

    /* ============================================================ QR */
    .qr-workspace { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; align-items: start; }
    @media (max-width: 820px) { .qr-workspace { grid-template-columns: 1fr; } }
    .qr-preview-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 16px;
      padding: 22px;
      text-align: center;
      background: var(--surface);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-md);
      border: none;
    }
    .qr-canvas-box {
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 14px;
      background: #ffffff;
      border-radius: 18px;
      border: none;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.08);
    }
    #qrCanvas { display: block; width: 100%; max-width: 240px; height: auto; border-radius: 6px; }
    .color-Watch-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
    .color-Watch-group input[type="color"] {
      -webkit-appearance: none;
      appearance: none;
      width: 30px !important;
      height: 30px !important;
      padding: 0;
      border: none;
      border-radius: 50%;
      background: none;
      cursor: pointer;
      box-shadow: inset 0 0 0 1px var(--border-strong);
    }
    .color-Watch-group input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
    .color-Watch-group input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }
    .color-Watch-group input[type="color"]::-moz-color-swatch { border: none; border-radius: 50%; }
    .color-preset-btn {
      width: 24px;
      height: 24px;
      border: none;
      border-radius: 50%;
      cursor: pointer;
      box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border);
      transition: transform 0.25s var(--ease-spring), box-shadow 0.2s ease;
    }
    .color-preset-btn:hover { transform: scale(1.1); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border-strong); }
    .color-preset-btn:active { transform: scale(0.94); }

    /* ============================================================ Share row */
    .share-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 28px;
      padding: 18px 22px;
      background: var(--surface);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
    }
    .share-bar p { font-size: 15px; color: var(--text-secondary); }
    .share-bar p strong { color: var(--text-main); font-weight: 600; }

    /* ============================================================ Toast */
    .toast-notification {
      position: fixed;
      left: 50%;
      bottom: 28px;
      z-index: 999;
      display: flex;
      align-items: center;
      gap: 8px;
      max-width: calc(100vw - 32px);
      padding: 11px 20px;
      border-radius: 999px;
      background: rgba(29, 29, 31, 0.86);
      backdrop-filter: saturate(180%) blur(20px);
      -webkit-backdrop-filter: saturate(180%) blur(20px);
      color: #f5f5f7;
      font-size: 14px;
      font-weight: 500;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
      opacity: 0;
      transform: translate(-50%, 16px) scale(0.96);
      pointer-events: none;
      transition: opacity 0.25s ease, transform 0.5s var(--ease-spring);
    }
    [data-theme="dark"] .toast-notification { background: rgba(58, 58, 60, 0.9); }
    .toast-notification.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

    /* ============================================================ Print (unchanged behaviour) */
    @page { size: A4 portrait; margin: 0mm; }
    @media print {
      html, body { background: #ffffff !important; margin: 0 !important; padding: 0 !important; min-height: auto !important; }
      .navbar, .hero-header, .feature-tabs, #tabConverter, #tabParaphrase, #tabHumanize, #tabDetector, #tabQrcode,
      #tabGovdoc > .toolbar, .doc-form-card, .preview-topbar, .ad-placeholder, .article-section, .share-bar,
      footer, dialog, .toast-notification { display: none !important; }
      .container, #tabGovdoc, .doc-workspace, .preview-wrapper {
        display: block !important; max-width: 100% !important; width: 100% !important; margin: 0 !important;
        padding: 0 !important; border: none !important; background: transparent !important; box-shadow: none !important;
        animation: none !important;
      }
      #a4PreviewSheet {
        display: block !important; width: 210mm !important; min-height: auto !important; max-height: none !important;
        overflow: visible !important; box-shadow: none !important; border: none !important;
        padding: 25mm 20mm 20mm 30mm !important; font-size: 16pt !important; line-height: 1.45 !important;
      }
    }
    .ad-placeholder { display: none; }

    /* ============================================================ Long-form */
    .article-section {
      display: flex;
      flex-direction: column;
      gap: 14px;
      margin-top: 40px;
      padding: 8px 0 0;
      background: transparent;
      border: none;
      box-shadow: none;
      max-width: 720px;
      align-self: center;
      width: 100%;
    }
    .article-section h2 {
      font-family: var(--font-display);
      font-size: clamp(24px, 3vw, 32px);
      line-height: 1.2;
      font-weight: 700;
      letter-spacing: -0.022em;
      color: var(--text-main);
      border: none;
      padding: 0;
      margin-bottom: 4px;
      text-wrap: balance;
    }
    .article-section h3 {
      font-size: 21px;
      line-height: 1.3;
      font-weight: 600;
      letter-spacing: -0.018em;
      color: var(--text-main);
      margin-top: 22px;
    }
    .article-section p, .article-section li { font-size: 17px; line-height: 1.65; color: var(--text-secondary); }
    .article-section strong { color: var(--text-main); font-weight: 600; }
    .article-section ol, .article-section ul { display: flex; flex-direction: column; gap: 10px; margin-left: 22px; }
    .article-section li::marker { color: var(--text-muted); }

    footer {
      margin-top: 56px;
      padding: 22px;
      border-top: 1px solid var(--border);
      background: transparent;
    }
    .footer-content {
      max-width: 1080px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
      font-size: 12px;
      color: var(--text-muted);
    }
    .footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
    .footer-links button {
      border: none;
      background: none;
      color: var(--text-secondary);
      font-size: 12px;
      cursor: pointer;
      text-decoration: none;
    }
    .footer-links button:hover { text-decoration: underline; }

    /* ============================================================ Sheets / dialogs */
    dialog {
      width: min(92vw, 540px);
      max-height: 85vh;
      margin: auto;
      padding: 26px 26px 20px;
      border: none;
      border-radius: 20px;
      background: var(--surface);
      color: var(--text-main);
      box-shadow: var(--shadow-lg);
      overflow-y: auto;
    }
    dialog[open] { animation: sheetIn 0.42s var(--ease-spring); }
    dialog::backdrop { background: rgba(0, 0, 0, 0.32); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
    dialog[open]::backdrop { animation: fadeIn 0.3s ease; }
    @keyframes sheetIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    dialog h2 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
    dialog p { font-size: 15px; color: var(--text-secondary); margin-bottom: 12px; }
    dialog ul { margin: 0 0 12px 20px; font-size: 15px; color: var(--text-secondary); }
    dialog li { margin-bottom: 8px; }
    .dialog-close { display: flex; margin: 16px 0 0 auto; }
    .cmd-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
    .cmd-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 11px 12px;
      border: none;
      border-radius: 11px;
      background: transparent;
      color: var(--text-main);
      font-size: 15px;
      font-weight: 500;
      text-align: left;
      cursor: pointer;
      transition: background-color 0.15s ease;
    }
    .cmd-item:hover, .cmd-item:focus-visible { background: var(--primary); color: #ffffff; box-shadow: none; }
    .cmd-item:hover .kbd-pill, .cmd-item:focus-visible .kbd-pill { background: rgba(255, 255, 255, 0.2); color: #ffffff; box-shadow: none; }

    /* ============================================================ Accessibility preferences */
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
      .tab-section.active, dialog[open] { animation: fadeIn 0.2s ease !important; }
    }
    @media (prefers-reduced-transparency: reduce) {
      .navbar, .feature-tabs, .toast-notification { backdrop-filter: none; -webkit-backdrop-filter: none; }
      .navbar { background: var(--bg); }
    }
    @media (prefers-contrast: more) {
      :root { --border: rgba(0, 0, 0, 0.3); --text-muted: #48484a; }
      .card, .doc-form-card, .stat-metric-card, .qr-preview-card { box-shadow: inset 0 0 0 1px var(--border-strong); }
    }
  

/* consistent control shape across the site: no capsule buttons */
.btn, .btn:focus-visible, .sample-chip, .toast-notification { border-radius: 10px; }

.email-hints { margin: 8px 0 0; padding: 10px 12px 10px 28px; border-radius: 10px; background: var(--warning-bg, #fff7ed); color: var(--text-main, #1f2937); font-size: .88rem; line-height: 1.6; }
.email-hints[hidden] { display: none; }

/* ---- multi-page additions ---- */
.footer-links a { color: inherit; text-decoration: none; opacity: .8; }
.footer-links a:hover { opacity: 1; text-decoration: underline; }
.footer-content { flex-wrap: wrap; row-gap: 10px; }
.footer-tools { flex-wrap: wrap; }
.article-section .tool-list { columns: 2; column-gap: 32px; }
@media (max-width: 640px) { .article-section .tool-list { columns: 1; } }
.legal-page { max-width: 760px; margin: 0 auto; padding: 32px 20px 48px; }
.legal-page h1 { font-size: 2rem; margin-bottom: 16px; }
.legal-page h2 { font-size: 1.15rem; margin: 24px 0 8px; }
.legal-page p, .legal-page li { line-height: 1.8; }
.legal-page a { color: var(--primary); }
.nav-typing-btn, .nav-home-btn, .nav-spell-btn { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--primary); border: 1px solid currentColor; white-space: nowrap; }
@media (max-width: 480px) { .hero-header .nw { white-space: normal; } }
@media (max-width: 420px) { .nav-typing-btn, .nav-home-btn, .nav-spell-btn { padding: 4px 9px; font-size: .78rem; } .logo-sub, .brand-sub { display: none; } }
.nav-typing-btn:hover, .nav-home-btn:hover, .nav-spell-btn:hover { background: var(--primary); color: #fff; }
