/* Existing functional component states; visual system in design.css. */
    :root {
      color-scheme: light dark;
      --bg: #fafaf9;
      --surface: #ffffff;
      --surface-soft: #f5f5f4;
      --ink: #0f172a;
      --muted: #526073;
      --faint: #78716c;
      --line: #e7e5e4;
      --line-strong: #d6d3d1;
      --emerald: #059669;
      --emerald-dark: #047857;
      --emerald-soft: #ecfdf5;
      --amber: #d97706;
      --amber-soft: #fffbeb;
      --red: #dc2626;
      --red-soft: #fef2f2;
      --shadow: 0 18px 50px rgba(15, 23, 42, .08);
      --shadow-sm: 0 2px 14px rgba(15, 23, 42, .06);
      --radius-xl: 28px;
      --radius-lg: 18px;
      --radius-md: 12px;
    }
    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; scroll-padding-top: 88px; }
    body {
      margin: 0;
      background: var(--bg);
      color: var(--ink);
      font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 16px;
      line-height: 1.55;
      text-rendering: optimizeLegibility;
    }
    button, textarea, input { font: inherit; }
    a { color: inherit; }
    button, a { -webkit-tap-highlight-color: transparent; }
    button:focus-visible, a:focus-visible, textarea:focus-visible, summary:focus-visible {
      outline: 3px solid color-mix(in srgb, var(--emerald) 35%, transparent);
      outline-offset: 2px;
    }
    .nav-shell {
      position: sticky;
      top: 0;
      z-index: 30;
      border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
      background: color-mix(in srgb, var(--bg) 88%, transparent);
      backdrop-filter: blur(14px);
    }
    .nav {
      width: min(1180px, calc(100% - 40px));
      height: 72px;
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 26px;
    }
    .brand {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      text-decoration: none;
      font-weight: 760;
      letter-spacing: -.025em;
      white-space: nowrap;
    }
    .brand-mark {
      width: 29px;
      height: 29px;
      display: grid;
      place-items: center;
      background: var(--ink);
      color: var(--bg);
      border-radius: 8px 8px 8px 2px;
      font-size: 13px;
      letter-spacing: -.05em;
    }
    .nav-links { display: flex; align-items: center; gap: 24px; margin-left: auto; }
    .nav-links a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 610; }
    .nav-links a:hover { color: var(--ink); }
    .language-toggle {
      display: inline-grid;
      grid-template-columns: 1fr 1fr;
      padding: 3px;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      background: var(--surface-soft);
    }
    .lang-option {
      min-width: 38px;
      min-height: 32px;
      padding: 4px 9px;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      font-size: 12px;
      font-weight: 740;
    }
    .lang-option.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
    .sample-language-note { margin: 10px 0 0; color: var(--faint); font-size: 12px; }
    .admin-only[hidden] { display: none !important; }
    .critical-chip { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
    .keyword-impact { margin-left: 5px; padding-left: 6px; border-left: 1px solid currentColor; font-size: 10px; font-weight: 800; opacity: .88; }
    .button {
      border: 1px solid transparent;
      border-radius: 10px;
      min-height: 44px;
      padding: 11px 17px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      cursor: pointer;
      font-weight: 700;
      text-decoration: none;
      transition: background .18s ease, border-color .18s ease, transform .18s ease;
    }
    .button:active { transform: translateY(1px); }
    .button-primary { color: white; background: var(--emerald); box-shadow: 0 7px 18px color-mix(in srgb, var(--emerald) 22%, transparent); }
    .button-primary:hover { background: var(--emerald-dark); }
    .button-secondary { color: var(--ink); background: var(--surface); border-color: var(--line-strong); }
    .button-secondary:hover { border-color: var(--faint); background: var(--surface-soft); }
    .button-quiet { color: var(--muted); background: transparent; border-color: var(--line); }
    .button-quiet:hover { color: var(--ink); background: var(--surface-soft); }
    .button-sm { min-height: 40px; padding: 9px 14px; font-size: 14px; }
    .button-lg { min-height: 52px; padding: 14px 21px; }
    .button:disabled { opacity: .58; cursor: not-allowed; transform: none; }
    .hero {
      width: min(1080px, calc(100% - 40px));
      margin: 0 auto;
      padding: 92px 0 78px;
      text-align: center;
    }
    .hero-kicker {
      color: var(--emerald-dark);
      font-weight: 760;
      font-size: 14px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 20px;
    }
    .hero-kicker::before { content: ""; width: 22px; height: 2px; background: var(--emerald); }
    h1 {
      max-width: 860px;
      margin: 0 auto;
      font-size: clamp(44px, 7vw, 76px);
      line-height: .99;
      letter-spacing: -.062em;
      font-weight: 790;
    }
    .hero-copy {
      max-width: 690px;
      margin: 26px auto 0;
      color: var(--muted);
      font-size: clamp(17px, 2vw, 20px);
    }
    .hero-actions { display: flex; justify-content: center; gap: 12px; margin-top: 32px; }
    .proof-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 38px; }
    .proof-chip {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 8px 12px;
      color: var(--muted);
      font-size: 13px;
      box-shadow: var(--shadow-sm);
    }
    .proof-chip strong { color: var(--ink); }
    .section { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 92px 0; }
    .section-heading { max-width: 690px; margin-bottom: 34px; }
    .section-heading.center { text-align: center; margin-left: auto; margin-right: auto; }
    .eyebrow { color: var(--emerald-dark); font-weight: 740; font-size: 13px; letter-spacing: .04em; margin: 0 0 10px; }
    h2 { margin: 0; font-size: clamp(32px, 4vw, 48px); line-height: 1.08; letter-spacing: -.045em; }
    .section-heading p { margin: 14px 0 0; color: var(--muted); font-size: 17px; }
    .analyzer-frame {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--radius-xl);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    .analyzer-topbar {
      padding: 17px 22px;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      color: var(--muted);
      font-size: 13px;
    }
    .local-note { display: inline-flex; gap: 8px; align-items: center; }
    .local-note::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 4px color-mix(in srgb, var(--emerald) 12%, transparent); }
    .analyzer-grid { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); min-height: 740px; }
    .input-panel { padding: 26px; border-right: 1px solid var(--line); }
    .result-panel { padding: 26px; background: color-mix(in srgb, var(--surface-soft) 52%, var(--surface)); }
    .field + .field { margin-top: 20px; }
    .field-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
    .field-header label { font-weight: 730; font-size: 14px; }
    .counter { color: var(--faint); font-size: 12px; white-space: nowrap; }
    textarea {
      display: block;
      width: 100%;
      min-height: 240px;
      resize: vertical;
      padding: 15px 16px;
      border: 1px solid var(--line-strong);
      border-radius: var(--radius-md);
      background: var(--surface);
      color: var(--ink);
      line-height: 1.5;
      font-size: 13px;
      transition: border-color .18s ease, box-shadow .18s ease;
    }
    textarea::placeholder { color: var(--faint); }
    textarea:focus { border-color: var(--emerald); box-shadow: 0 0 0 4px color-mix(in srgb, var(--emerald) 10%, transparent); outline: none; }
    .tool-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
    .analyze-button { flex: 1 1 190px; }
    .upload-wrap.loading { pointer-events: none; opacity: .65; }
    .input-message { min-height: 23px; margin: 10px 0 0; color: var(--muted); font-size: 13px; }
    .input-message.error { color: var(--red); }
    .empty-state { min-height: 690px; display: grid; place-items: center; text-align: center; color: var(--muted); }
    .empty-inner { max-width: 360px; }
    .empty-visual {
      width: 120px; height: 120px; margin: 0 auto 24px; border-radius: 50%;
      border: 1px dashed var(--line-strong); display: grid; place-items: center; position: relative;
    }
    .empty-visual::before { content: ""; width: 70px; height: 70px; border-radius: 50%; border: 8px solid var(--line); }
    .empty-visual span { position: absolute; font-size: 15px; font-weight: 760; color: var(--faint); }
    .empty-state h3 { color: var(--ink); font-size: 21px; margin: 0 0 8px; letter-spacing: -.02em; }
    .empty-state p { margin: 0; }
    .scan-state { min-height: 690px; display: none; place-items: center; text-align: center; }
    .scan-state.active { display: grid; }
    .scanner { width: 210px; height: 250px; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 20px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
    .scanner .line { height: 8px; border-radius: 4px; background: var(--line); margin: 11px 0; }
    .scanner .line:nth-child(2) { width: 62%; }
    .scanner .line:nth-child(4) { width: 80%; }
    .scan-beam { position: absolute; inset-inline: 0; height: 3px; background: var(--emerald); box-shadow: 0 0 16px var(--emerald); animation: scan 1.15s ease-in-out infinite alternate; }
    @keyframes scan { from { top: 24px; } to { top: 222px; } }
    .scan-state p { color: var(--muted); margin: 20px 0 0; }
    .dots span { animation: blink 1.1s infinite; opacity: .2; }
    .dots span:nth-child(2){ animation-delay: .2s; } .dots span:nth-child(3){ animation-delay: .4s; }
    @keyframes blink { 50% { opacity: 1; } }
    #results { display: none; }
    #results.active { display: block; }
    .result-card {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--radius-lg);
      padding: 20px;
      margin-bottom: 14px;
      opacity: 0;
      transform: translateY(8px);
    }
    #results.active .result-card { animation: reveal .36s ease forwards; }
    #results.active.no-reveal .result-card { opacity: 1; transform: none; animation: none; }
    #results.active .result-card:nth-child(2){animation-delay:.08s} #results.active .result-card:nth-child(3){animation-delay:.15s} #results.active .result-card:nth-child(4){animation-delay:.22s} #results.active .result-card:nth-child(5){animation-delay:.29s}
    @keyframes reveal { to { opacity: 1; transform: translateY(0); } }
    .score-card { padding: 0; border: 0; background: transparent; }
    .lens-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; }
    .lens-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
    .lens-card-machine { border-color: color-mix(in srgb, var(--emerald) 30%, var(--line)); }
    .lens-card-human { border-color: color-mix(in srgb, var(--amber) 28%, var(--line)); }
    .lens-score-row { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; margin: 14px 0 16px; }
    .lens-label { margin: 0; font-size: 18px; letter-spacing: -.025em; }
    .simulation-label { display: inline-flex; margin-top: 4px; color: var(--faint); font-size: 10px; font-weight: 760; }
    .lens-note { margin: 0; color: var(--muted); font-size: 12px; }
    .lens-metrics { border-top: 1px solid var(--line); padding-top: 2px; }
    .gauge { width: 180px; height: 180px; position: relative; display: grid; place-items: center; }
    .lens-gauge { width: 108px; height: 108px; }
    .lens-gauge .gauge-value strong { font-size: 32px; }
    .gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
    .gauge-track, .gauge-progress { fill: none; stroke-width: 10; }
    .gauge-track { stroke: var(--line); }
    .gauge-progress { stroke: var(--emerald); stroke-linecap: round; stroke-dasharray: 339.292; stroke-dashoffset: 339.292; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.75,.2,1), stroke .2s ease; }
    .gauge-value { position: absolute; text-align: center; line-height: 1; }
    .gauge-value strong { display: block; font-size: 48px; letter-spacing: -.06em; }
    .gauge-value span { color: var(--faint); font-size: 12px; }
    .score-copy .verdict { margin: 0 0 7px; font-size: 26px; letter-spacing: -.03em; }
    .score-copy p { margin: 0; color: var(--muted); font-size: 14px; }
    .status-pill { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 760; margin-bottom: 10px; background: var(--emerald-soft); color: var(--emerald-dark); }
    .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
    .card-head h3 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
    .card-head span { color: var(--faint); font-size: 12px; }
    .metric { margin-top: 15px; }
    .metric:first-child { margin-top: 0; }
    .metric-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 13px; }
    .metric-line strong { font-size: 13px; }
    .metric-score { font-weight: 760; font-variant-numeric: tabular-nums; }
    .bar { height: 7px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 7px 0 5px; }
    .bar > span { display: block; width: 0; height: 100%; background: var(--emerald); border-radius: inherit; transition: width .8s ease; }
    .metric-tip { color: var(--muted); font-size: 12px; margin: 0; }
    .check-list { display: grid; gap: 8px; margin-top: 14px; }
    .check-item { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: start; color: var(--muted); font-size: 12px; }
    .check-item span:last-child { color: var(--faint); font-variant-numeric: tabular-nums; }
    .parseability-tip { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
    .evidence-note { margin: 14px auto 0; max-width: 920px; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
    .evidence-note strong { color: var(--ink); }
    .evidence-note a { color: var(--emerald-dark); text-underline-offset: 2px; }
    .knockout-note { display: grid; grid-template-columns: 24px 1fr; gap: 10px; }
    .knockout-note .suggestion-index { background: var(--red-soft); color: var(--red); }
    .missing-keywords-card { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, var(--line)); }
    .missing-keywords-card .card-head { margin-bottom: 17px; }
    .missing-keywords-card .card-head h3 { max-width: 72%; font-size: 18px; line-height: 1.35; }
    .chip-list { display: flex; gap: 7px; flex-wrap: wrap; }
    .keyword-chip { background: var(--amber-soft); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 22%, transparent); border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 650; }
    .all-good { color: var(--emerald-dark); font-size: 13px; }
    .suggestion { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
    .suggestion:first-of-type { border-top: 0; padding-top: 0; }
    .suggestion:last-child { padding-bottom: 0; }
    .suggestion-index { width: 24px; height: 24px; border-radius: 7px; background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
    .suggestion p { margin: 0; color: var(--muted); font-size: 12px; }
    .suggestion strong { color: var(--ink); display: block; font-size: 13px; margin-bottom: 3px; }
    .draft-preview { max-height: 230px; overflow: auto; white-space: pre-wrap; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.55; background: var(--surface-soft); padding: 13px; border-radius: 10px; }
    mark { background: color-mix(in srgb, var(--emerald) 18%, transparent); color: var(--emerald-dark); border-radius: 3px; padding: 0 2px; }
    .improve-card { border-color: color-mix(in srgb, var(--emerald) 35%, var(--line)); }
    .improve-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
    .improve-intro h3 { margin: 0 0 4px; font-size: 18px; }
    .improve-intro p { margin: 0; color: var(--muted); font-size: 13px; }
    .improve-editor { display: none; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
    .improve-editor.active { display: block; }
    .improve-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
    .improve-editor-head h4 { margin: 0; font-size: 15px; }
    .improve-editor textarea { min-height: 360px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
    .improve-actions, .export-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
    .improve-hint { margin: 9px 0 0; color: var(--faint); font-size: 11px; }
    .language-banner { margin: 0 0 14px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line)); border-radius: 10px; background: var(--amber-soft); color: var(--ink); font-size: 12px; }
    .ai-card { border-color: color-mix(in srgb, var(--emerald) 28%, var(--line)); }
    .ai-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
    .ai-card-head h3 { margin: 0 0 4px; font-size: 18px; }
    .ai-card-head p { margin: 0; color: var(--muted); font-size: 13px; }
    .beta-tag { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: var(--emerald-soft); color: var(--emerald-dark); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
    .rewrite-paths { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; margin: 16px 0; }
    .rewrite-path { padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
    .rewrite-path strong { display: block; font-size: 13px; }
    .rewrite-path span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
    .ai-settings { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
    .privacy-note { margin: 10px 0 0; color: var(--faint); font-size: 11px; }
    .ai-action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
    .ai-status { color: var(--muted); font-size: 12px; }
    .ai-status.error { color: var(--red); }
    .ai-error-details { margin-top: 9px; padding: 0; border: 0; }
    .ai-error-details[hidden] { display: none; }
    .ai-error-details summary { padding: 4px 26px 4px 0; color: var(--red); font-size: 12px; font-weight: 700; }
    .ai-error-details summary::after { top: -1px; right: 4px; font-size: 18px; }
    .ai-error-details pre { margin: 7px 0 0; max-height: 210px; overflow: auto; white-space: pre-wrap; word-break: break-word; padding: 11px 12px; border-radius: 9px; background: var(--red-soft); color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.55; }
    .ai-spinner { width: 15px; height: 15px; border: 2px solid color-mix(in srgb, currentColor 28%, transparent); border-top-color: currentColor; border-radius: 50%; animation: ai-spin .72s linear infinite; }
    @keyframes ai-spin { to { transform: rotate(360deg); } }
    .hr-review-card { border-color: color-mix(in srgb, var(--amber) 32%, var(--line)); overflow-anchor: none; }
    .hr-review-launch { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
    .hr-review-launch h3 { margin: 0 0 3px; font-size: 18px; }
    .hr-review-caption { margin: 0; color: var(--muted); font-size: 12px; }
    .hr-review-status { min-height: 18px; margin: 9px 0 0; color: var(--muted); font-size: 12px; }
    .hr-review-status.error { color: var(--red); }
    .hr-review-loading { display: grid; gap: 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
    .hr-review-loading[hidden] { display: none; }
    .hr-review-skeleton { height: 42px; border-radius: 9px; background: linear-gradient(90deg, var(--surface-soft) 25%, color-mix(in srgb, var(--line) 72%, var(--surface)) 50%, var(--surface-soft) 75%); background-size: 220% 100%; animation: hr-shimmer 1.25s ease-in-out infinite; }
    .hr-review-skeleton:nth-child(2) { width: 93%; }
    .hr-review-skeleton:nth-child(3) { width: 97%; }
    .hr-review-skeleton:nth-child(4) { width: 89%; }
    @keyframes hr-shimmer { to { background-position: -220% 0; } }
    .hr-review-output { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); transition: opacity .18s ease; }
    .hr-review-card.is-updating .hr-review-output { opacity: .52; }
    .hr-review-output h4 { margin: 0 0 10px; font-size: 15px; }
    .hr-dimension-list { display: grid; gap: 16px; margin-bottom: 20px; }
    .hr-dimension { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
    .hr-dimension:last-child { padding-bottom: 0; border-bottom: 0; }
    .hr-dimension .metric { margin: 0; }
    .hr-dimension-comment { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
    .hr-dimension-evidence { margin: 5px 0 0; color: var(--faint); font-size: 11px; }
    .hr-review-quote { position: relative; margin: 0; padding: 17px 18px 17px 42px; border-radius: 12px; background: var(--surface-soft); color: var(--ink); font-size: 13px; }
    .hr-review-quote::before { content: "“"; position: absolute; left: 15px; top: 8px; color: var(--amber); font-family: Georgia, serif; font-size: 34px; line-height: 1; }
    .hr-review-meta { margin: 12px 1px 0; color: var(--faint); font-size: 10px; }
    .ai-output { display: none; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
    .ai-output.active { display: block; }
    .ai-output pre { margin: 0; max-height: min(70vh, 680px); overflow: auto; white-space: pre-wrap; word-break: break-word; padding: 14px; border-radius: 10px; background: var(--surface-soft); color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.6; }
    .ai-truncation-note { margin: 8px 0 0; color: var(--faint); font-size: 11px; }
    .ai-truncation-note[hidden] { display: none; }
    .ai-error-details.success summary { color: var(--muted); }
    .ai-error-details.success pre { background: var(--surface-soft); }
    .ai-output-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
    .email-send-panel { display: none; margin-top: 12px; padding: 14px; border-top: 1px solid var(--line); background: var(--surface-soft); }
    .email-send-panel.active { display: block; }
    .email-send-panel h4 { margin: 0 0 4px; font-size: 14px; }
    .email-send-panel p { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
    .email-send-status { min-height: 18px; margin: 9px 0 0; color: var(--muted); font-size: 12px; }
    .email-send-status.success { color: var(--emerald-dark); font-weight: 700; }
    .email-send-status.error { color: var(--red); }
    .rewrite-diff { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
    .rewrite-diff h4 { margin: 0 0 12px; font-size: 15px; }
    .diff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .diff-pane { min-width: 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--surface-soft); }
    .diff-pane-title { display: block; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 760; }
    .diff-text { max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; padding: 13px; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.65; }
    .diff-insert { background: color-mix(in srgb, var(--emerald) 23%, transparent); color: var(--emerald-dark); border-radius: 3px; text-decoration: none; }
    .diff-delete { background: color-mix(in srgb, var(--red) 17%, transparent); color: var(--red); border-radius: 3px; text-decoration: line-through; text-decoration-thickness: 1px; }
    .diff-note { margin: 10px 1px 0; color: var(--muted); font-size: 11px; }
    .review-comparison { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
    .review-comparison h4 { margin: 0 0 10px; font-size: 15px; }
    .review-compare-list { display: grid; gap: 8px; }
    .review-compare-state { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
    .review-compare-state p { margin: 0; color: var(--muted); font-size: 12px; }
    .review-compare-state.error { border-color: color-mix(in srgb, var(--red) 28%, var(--line)); background: var(--red-soft); }
    .review-compare-state.error p { color: var(--red); }
    .review-after-skeleton { width: 48px; height: 12px; border-radius: 99px; background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--line-strong) 70%, var(--surface)) 50%, var(--line) 75%); background-size: 220% 100%; animation: hr-shimmer 1.25s ease-in-out infinite; }
    .review-compare-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 9px; background: var(--surface-soft); font-size: 12px; }
    .review-compare-row strong { font-size: 12px; }
    .review-before { color: var(--faint); }
    .review-after { color: var(--ink); font-weight: 780; }
    .review-delta { min-width: 52px; text-align: right; color: var(--muted); font-weight: 760; }
    .review-delta.positive { color: var(--emerald-dark); }
    .review-delta.negative { color: var(--red); }
    .ai-score-result { margin-top: 14px; }
    .ai-score-result .score-delta { margin-bottom: 10px; }
    .ai-score-result .score-delta:last-of-type { margin-bottom: 0; }
    .keyword-coverage-delta .delta-title { grid-column: 1 / -1; color: var(--ink); font-size: 13px; font-weight: 760; }
    .keyword-coverage-delta .delta-score strong { font-size: 24px; letter-spacing: -.025em; }
    .ai-sync-note { margin: 9px 2px 0; color: var(--faint); font-size: 11px; }
    .score-delta { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 14px; padding: 18px 20px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 14px; }
    .score-delta.delta-positive { background: var(--emerald-soft); border-color: color-mix(in srgb, var(--emerald) 22%, transparent); }
    .score-delta.delta-negative { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 24%, transparent); }
    .delta-score { text-align: center; }
    .delta-score span { display: block; color: var(--muted); font-size: 11px; font-weight: 720; }
    .delta-score strong { display: block; font-size: 34px; line-height: 1.1; letter-spacing: -.045em; }
    .delta-arrow { color: var(--emerald-dark); font-size: 25px; }
    .delta-badge { justify-self: end; padding: 7px 10px; border-radius: 999px; background: var(--faint); color: #fff; font-size: 12px; font-weight: 800; white-space: nowrap; }
    .delta-positive .delta-badge { background: var(--emerald); }
    .delta-negative .delta-badge { background: var(--red); }
    .delta-hint { grid-column: 1 / -1; margin: 0; color: var(--red); font-size: 12px; }
    .history-strip { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
    .history-item { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; }
    .export-card h3 { margin: 0 0 4px; font-size: 17px; }
    .export-card > p { margin: 0; color: var(--muted); font-size: 12px; }
    .email-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
    .email-row input { min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); }
    .email-row input:focus { border-color: var(--emerald); box-shadow: 0 0 0 4px color-mix(in srgb, var(--emerald) 10%, transparent); outline: none; }
    .email-send-privacy { margin: 8px 0 0 !important; color: var(--faint) !important; font-size: 11px !important; }
    .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-xl); overflow: hidden; }
    .step { background: var(--surface); padding: 34px; min-height: 250px; }
    .step-num { color: var(--emerald-dark); font-size: 13px; font-weight: 800; }
    .step h3 { margin: 50px 0 8px; font-size: 25px; letter-spacing: -.035em; }
    .step p { color: var(--muted); margin: 0; }
    .faq-list { max-width: 820px; margin: 0 auto; border-top: 1px solid var(--line); }
    details { border-bottom: 1px solid var(--line); }
    summary { cursor: pointer; list-style: none; padding: 23px 42px 23px 0; font-weight: 720; position: relative; }
    summary::-webkit-details-marker { display: none; }
    summary::after { content: "+"; position: absolute; right: 5px; top: 20px; font-size: 23px; color: var(--faint); font-weight: 400; transition: transform .2s ease; }
    details[open] summary::after { transform: rotate(45deg); }
    details p { margin: -7px 0 23px; color: var(--muted); max-width: 700px; }
    footer { border-top: 1px solid var(--line); }
    .footer-inner { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 44px; display: flex; justify-content: space-between; gap: 28px; color: var(--muted); font-size: 12px; }
    .footer-inner p { margin: 0; max-width: 740px; }
    .footer-inner a { color: var(--ink); text-underline-offset: 3px; }
    .feedback-trigger {
      position: fixed;
      right: max(18px, env(safe-area-inset-right));
      bottom: max(18px, env(safe-area-inset-bottom));
      z-index: 45;
      min-height: 42px;
      padding: 9px 15px;
      border: 1px solid color-mix(in srgb, var(--emerald) 38%, var(--line));
      border-radius: 999px;
      background: var(--surface);
      color: var(--ink);
      box-shadow: 0 8px 28px rgba(15, 23, 42, .14);
      cursor: pointer;
      font-weight: 730;
      font-size: 13px;
    }
    .feedback-trigger:hover { border-color: var(--emerald); color: var(--emerald-dark); }
    .feedback-backdrop {
      position: fixed;
      inset: 0;
      z-index: 60;
      display: none;
      align-items: flex-end;
      justify-content: flex-end;
      padding: 18px max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom));
      background: rgba(15, 23, 42, .38);
    }
    .feedback-backdrop.active { display: flex; }
    .feedback-dialog {
      width: min(420px, 100%);
      max-height: min(720px, calc(100vh - 36px));
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: var(--radius-lg);
      background: var(--surface);
      box-shadow: var(--shadow);
      padding: 22px;
    }
    .feedback-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
    .feedback-head h2 { margin: 0; font-size: 24px; line-height: 1.15; letter-spacing: -.03em; }
    .feedback-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
    .feedback-close {
      flex: 0 0 auto;
      width: 38px;
      height: 38px;
      border: 1px solid var(--line);
      border-radius: 9px;
      background: var(--surface-soft);
      color: var(--muted);
      cursor: pointer;
      font-size: 22px;
      line-height: 1;
    }
    .feedback-close:hover { color: var(--ink); border-color: var(--line-strong); }
    .feedback-field + .feedback-field { margin-top: 15px; }
    .feedback-field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 730; }
    .feedback-field textarea { min-height: 138px; }
    .feedback-field select, .feedback-field input {
      display: block;
      width: 100%;
      min-height: 44px;
      padding: 10px 12px;
      border: 1px solid var(--line-strong);
      border-radius: 9px;
      background: var(--surface);
      color: var(--ink);
    }
    .feedback-field select:focus, .feedback-field input:focus {
      border-color: var(--emerald);
      box-shadow: 0 0 0 4px color-mix(in srgb, var(--emerald) 10%, transparent);
      outline: none;
    }
    .feedback-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
    .feedback-status { min-height: 20px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }
    .feedback-status.success { color: var(--emerald-dark); font-weight: 700; }
    .feedback-status.error { color: var(--red); }
    body.feedback-open { overflow: hidden; }
    .mobile-analyze { display: none; }
    @media (max-width: 900px) {
      .nav-links a:not(.nav-cta) { display: none; }
      .analyzer-grid { grid-template-columns: 1fr; }
      .input-panel { border-right: 0; border-bottom: 1px solid var(--line); }
      .result-panel { min-height: 600px; }
      .lens-grid { grid-template-columns: 1fr; }
      .gauge { width: 150px; height: 150px; }
      .lens-gauge { width: 108px; height: 108px; }
      .steps { grid-template-columns: 1fr; }
      .step { min-height: auto; }
      .step h3 { margin-top: 26px; }
    }
    @media (max-width: 620px) {
      body { padding-right: 30px; }
      .nav { width: min(100% - 28px, 1180px); height: 64px; }
      .brand-mark { display: none; }
      .nav-links { gap: 8px; }
      .lang-option { min-width: 34px; min-height: 30px; padding: 3px 7px; }
      .nav-cta { padding: 9px 12px; min-height: 40px; font-size: 13px; }
      .hero { width: min(100% - 28px, 1080px); padding: 66px 0 55px; }
      h1 { font-size: clamp(42px, 14vw, 64px); }
      .hero-actions { flex-direction: column; }
      .hero-actions .button { width: 100%; }
      .proof-row { justify-content: flex-start; }
      .proof-chip { text-align: left; }
      .section { width: min(100% - 28px, 1180px); padding: 68px 0; }
      .analyzer-frame { border-radius: 18px; }
      .analyzer-topbar { padding: 14px 16px; align-items: flex-start; }
      .analyzer-topbar > span:last-child { display: none; }
      .input-panel, .result-panel { padding: 16px; }
      textarea { min-height: 215px; }
      .tool-row .button, .upload-wrap { flex: 1 1 100%; width: 100%; }
      .lens-score-row { grid-template-columns: 92px 1fr; text-align: left; }
      .lens-gauge { width: 88px; height: 88px; margin: 0; }
      .lens-gauge .gauge-value strong { font-size: 27px; }
      .card-head { align-items: flex-start; }
      .improve-intro { align-items: flex-start; flex-direction: column; }
      .improve-intro .button { width: 100%; }
      .improve-editor-head { align-items: flex-start; }
      .improve-actions .button, .export-actions .button, .ai-output-actions .button { flex: 1 1 100%; width: 100%; }
      .ai-card-head { flex-direction: column; }
      .rewrite-paths { grid-template-columns: 1fr; }
      .diff-grid { grid-template-columns: 1fr; }
      .review-compare-row { grid-template-columns: minmax(0, 1fr) auto auto; }
      .review-delta { grid-column: 2 / -1; }
      .review-compare-state { align-items: stretch; flex-direction: column; }
      .review-compare-state .button { width: 100%; }
      .ai-action-row .button { width: 100%; }
      .hr-review-launch { align-items: stretch; flex-direction: column; }
      .hr-review-launch .button { width: 100%; }
      .score-delta { grid-template-columns: 1fr auto 1fr; }
      .delta-badge { grid-column: 1 / -1; justify-self: center; }
      .email-row { grid-template-columns: 1fr; }
      .email-row .button { width: 100%; }
      .step { padding: 23px; }
      .footer-inner { flex-direction: column; }
      .feedback-trigger {
        right: 0;
        bottom: max(16px, env(safe-area-inset-bottom));
        min-width: 26px;
        min-height: 58px;
        padding: 7px 4px;
        border-right: 0;
        border-radius: 9px 0 0 9px;
        writing-mode: vertical-rl;
        text-orientation: mixed;
      }
      .feedback-backdrop { padding: 10px max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)); }
      .feedback-dialog { max-height: calc(100vh - 20px); padding: 18px; }
      .feedback-actions .button { width: 100%; }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    }

/* skills-dictionary note under keyword groups */
.dict-note {
  font-size: 12px;
  line-height: 1.6;
  opacity: .62;
  margin: 10px 2px 0;
}
