:root {
  --brand: #0e5e5a;
  --brand-2: #13827c;
  --brand-deep: #073b39;
  --brand-tint: #e6f2f1;
  --cta: #ff7a59;
  --cta-d: #f25f3a;
  --ink: #14202b;
  --ink-2: #33424f;
  --muted: #5b6b78;
  --line: #e3e8e6;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --soft: #eff3f2;
  --plag: #e5484d;
  --plag-bg: #fde2e2;
  --partial: #d98a00;
  --partial-bg: #fff0cc;
  --rw: #0e9f6e;
  --rw-bg: #d7f5e8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(7, 59, 57, .06), 0 12px 32px rgba(7, 59, 57, .08);
  --display: Fraunces, Georgia, serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font-family: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: #9fe3d9; margin-bottom: 14px;
}
.eyebrow.dark { color: var(--brand-2); margin-bottom: 8px; }

/* ---------- Header ---------- */
.topbar { position: absolute; inset: 0 0 auto 0; z-index: 30; }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 17px; color: #fff; white-space: nowrap; }
.brand.small { color: #fff; font-family: var(--display); font-size: 18px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: #d4ebe8; text-decoration: none; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; padding: 120px 0 72px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .08) 1px, transparent 0) 0 0 / 22px 22px,
    radial-gradient(1000px 500px at 85% 0%, #1b8a83 0%, transparent 60%),
    linear-gradient(160deg, var(--brand-deep) 0%, var(--brand) 100%);
}
.hero-grid { display: grid; grid-template-columns: 1fr 520px; gap: 56px; align-items: center; }
.hero h1 { font-family: var(--display); font-weight: 600; font-size: 52px; line-height: 1.08; letter-spacing: -1px; margin: 0 0 18px; }
.hero h1 em { font-style: italic; color: #ffb59f; }
.lead { color: #cfe6e3; font-size: 17px; max-width: 520px; margin: 0 0 30px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; gap: 28px; }
.hero-points li { border-left: 2px solid rgba(255, 255, 255, .25); padding-left: 14px; }
.hero-points b { display: block; font-family: var(--display); font-size: 30px; line-height: 1.1; }
.hero-points span { font-size: 13px; color: #b5d6d2; }

.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.input-card { color: var(--ink); padding: 22px; border: 0; box-shadow: 0 30px 60px rgba(0, 0, 0, .25); }

.stepper { list-style: none; padding: 0; margin: 0 0 18px; display: flex; gap: 6px; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px; border-radius: 10px; background: var(--soft); }
.stepper i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: #fff; border: 1px solid var(--line); }
.stepper li.on { background: var(--brand-tint); color: var(--brand); }
.stepper li.on i { background: var(--brand); color: #fff; border-color: var(--brand); }
.stepper li.done i { background: var(--rw); color: #fff; border-color: var(--rw); }

.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab { border: 0; background: none; padding: 10px 2px; margin-right: 22px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 200px; border: 1.5px dashed #b9cbc8; border-radius: var(--radius); cursor: pointer;
  color: var(--muted); text-align: center; padding: 20px; background: #fafcfb; transition: .15s;
}
.dz-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; margin-bottom: 4px; }
.dropzone strong { color: var(--ink); font-size: 15px; font-weight: 600; }
.dropzone u { color: var(--brand); text-underline-offset: 3px; }
.dropzone span { font-size: 12.5px; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand-2); background: var(--brand-tint); }

.file-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; max-height: 210px; overflow: auto; }
.file-list li { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; }
.file-list .ext { flex: none; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: #fff; color: var(--brand); text-transform: uppercase; border: 1px solid var(--line); }
.file-list .meta { flex: 1; min-width: 0; }
.file-list .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list small { color: var(--muted); }

textarea#textInput {
  width: 100%; min-height: 200px; resize: vertical; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; font: inherit; font-size: 14.5px; color: var(--ink); outline: none; background: #fafcfb;
}
textarea#textInput:focus { border-color: var(--brand-2); background: #fff; }
.textarea-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); padding: 6px 2px 0; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; font-size: 15px; line-height: 1; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }

.switch { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; margin: 16px 0; }
.switch input { display: none; }
.slider { flex: none; width: 38px; height: 22px; background: #cfd8d6; border-radius: 99px; position: relative; transition: .2s; }
.slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::after { left: 19px; }
.engine-info { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 14px; padding: 11px 18px; border-radius: 12px; text-decoration: none; transition: .15s;
}
.btn-cta { background: var(--cta); color: #fff; }
.btn-cta:hover { background: var(--cta-d); }
.btn-block { width: 100%; padding: 15px; font-size: 15.5px; }
.btn-dark { background: var(--brand); color: #fff; }
.btn-dark:hover { background: var(--brand-deep); }
.btn-ghost { background: var(--soft); color: var(--ink); }
.btn-ghost:hover { background: #e3eae8; }
.btn-outline { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-outline:hover { background: var(--brand-tint); }
.btn-sm { padding: 9px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

.alert { margin-top: 12px; background: #fff1ee; border: 1px solid #ffcfc2; color: #a2341a; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.alert.warn { background: #fff8e6; border-color: #f7dc9b; color: #7a5200; }

/* ---------- Progress ---------- */
.progress-section { margin-top: -28px; position: relative; z-index: 2; }
.progress-section .panel { padding: 20px 22px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.progress-head h2 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 0; }
.progress-head span { font-family: var(--display); font-weight: 600; font-size: 26px; color: var(--brand); }
.prog-row { padding: 10px 0; border-top: 1px solid var(--line); }
.prog-row:first-child { border-top: 0; }
.prog-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; margin-bottom: 6px; }
.prog-top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-top span { color: var(--muted); flex: none; }
.bar { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand-2); border-radius: 99px; transition: width .3s; }
.bar.rw i { background: var(--rw); }

/* ---------- Results ---------- */
.results { margin-top: 40px; }
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.doc-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.doc-tab { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px; max-width: 260px; color: var(--ink-2); }
.doc-tab span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-tab.active { border-color: var(--brand); color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.doc-tab .pct { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--soft); flex: none; }
.pct.hi { background: var(--plag-bg); color: #a3171c; }
.pct.mid { background: var(--partial-bg); color: #7a4d00; }
.pct.lo { background: var(--rw-bg); color: #0b6b4b; }

.result-grid { display: grid; grid-template-columns: 1fr 330px; gap: 18px; align-items: start; }
.summary { padding: 20px; position: sticky; top: 16px; }
.score-row { display: flex; align-items: center; gap: 16px; }
.gauge { position: relative; width: 120px; height: 120px; flex: none; }
.gauge svg { transform: rotate(-90deg); }
.gauge .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge .val b { font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1; }
.gauge .val small { font-size: 11px; color: var(--muted); margin-top: 3px; }
.mini-stats { display: grid; gap: 8px; flex: 1; }
.mini-stats div { border-left: 3px solid var(--line); padding: 2px 0 2px 10px; font-size: 12px; color: var(--muted); }
.mini-stats b { display: block; font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--ink); line-height: 1.2; }
.mini-stats .u { border-color: var(--rw); }
.mini-stats .a { border-color: var(--brand-2); }
.counts { font-size: 13px; display: grid; gap: 6px; margin: 18px 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.counts div { display: flex; justify-content: space-between; color: var(--ink-2); }
.downloads { display: grid; gap: 6px; margin-bottom: 8px; }
.downloads .btn { justify-content: flex-start; }
.downloads .btn-cta { justify-content: center; }
.summary h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin: 18px 0 8px; }
.sources { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.sources li { font-size: 13px; background: var(--soft); border-radius: 10px; padding: 8px 10px; }
.sources a, .sources .t { font-weight: 600; word-break: break-word; display: block; color: var(--brand); }
.sources .t { color: var(--ink); }
.sources small { color: var(--muted); }

.doc-card { padding: 0; overflow: hidden; }
.doc-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 7px 12px; font-weight: 600; font-size: 13px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.seg button.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.plag { background: var(--plag); } .dot.partial { background: var(--partial); } .dot.rw { background: var(--rw); }
.doc-status { font-size: 13px; color: var(--brand); padding: 10px 18px; background: var(--brand-tint); }
.doc-status:empty { display: none; }
.doc-text { padding: 26px 34px 34px; font-family: Georgia, "Times New Roman", serif; font-size: 16.5px; line-height: 1.9; max-height: 80vh; overflow: auto; color: #222; }
.doc-text p { margin: 0 0 16px; }
.s { border-radius: 3px; padding: 1px 0; transition: background .15s; }
.s.pending { color: #a3b0b7; }
.s.plag { background: var(--plag-bg); box-shadow: inset 0 -2px 0 var(--plag); cursor: pointer; }
.s.partial { background: var(--partial-bg); box-shadow: inset 0 -2px 0 var(--partial); cursor: pointer; }
.s.rw { background: var(--rw-bg); box-shadow: inset 0 -2px 0 var(--rw); cursor: pointer; }
.s.kept { cursor: pointer; text-decoration: underline dotted #b9c4c2; }
.s.plag:hover { background: #fbcaca; } .s.partial:hover { background: #ffe39e; } .s.rw:hover { background: #bdeed8; }
.s.focus { outline: 2px solid var(--brand); outline-offset: 2px; }
mark.plag { background: var(--plag-bg); } mark.partial { background: var(--partial-bg); } mark.rw { background: var(--rw-bg); }

/* ---------- Drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(7, 30, 29, .4); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: #fff; z-index: 50;
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.15);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 20px; }
.drawer-body { padding: 18px 20px; overflow: auto; }
.label-row { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 6px; }
.pill.plag { background: var(--plag-bg); color: #a3171c; } .pill.partial { background: var(--partial-bg); color: #7a4d00; } .pill.unique { background: var(--rw-bg); color: #0b6b4b; }
.d-original { background: var(--soft); border-left: 3px solid var(--plag); padding: 12px 14px; border-radius: 0 10px 10px 0; font-family: Georgia, serif; font-size: 15px; margin: 12px 0; }
.d-source { font-size: 13px; margin-bottom: 16px; word-break: break-word; color: var(--muted); }
.d-source a, .d-source b { font-weight: 600; color: var(--brand); }
.d-ev-meta { margin-top: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.d-ev { margin: 6px 0 0; padding: 8px 10px; border-left: 3px solid var(--brand); background: rgba(0,0,0,.03); color: var(--text, #1d2b33); font-size: 13px; line-height: 1.5; max-height: 160px; overflow: auto; }
.d-label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.d-label span { font-weight: 500; color: var(--muted); }
#dRewrite { width: 100%; border: 1px solid var(--line); border-left: 3px solid var(--rw); border-radius: 0 10px 10px 0; padding: 12px; font-family: Georgia, serif; font-size: 15px; resize: vertical; outline: none; background: #f6fcf9; }
#dRewrite:focus { border-color: var(--rw); }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.drawer-actions .btn:disabled { opacity: .6; cursor: progress; }
.d-msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; background: #fff1ee; border: 1px solid #ffcfc2; color: #a2341a; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; width: max-content; max-width: calc(100% - 32px); background: #0b3b38; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.s.saved { animation: saved-flash 2.4s ease-out; }
@keyframes saved-flash { 0%, 40% { background: #9fe6c6; } 100% { background: var(--rw-bg); } }

/* ---------- Marketing sections ---------- */
.section-head { max-width: 640px; margin-bottom: 28px; }
.section-head h2, .faq h2 { font-family: var(--display); font-weight: 600; font-size: 36px; line-height: 1.15; letter-spacing: -.5px; margin: 0; }
.features { margin-top: 80px; padding: 72px 0; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.feature { background: #fff; padding: 26px; }
.f-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); }
.feature h3 { font-size: 16px; margin: 16px 0 6px; }
.feature p { font-size: 14px; color: var(--muted); margin: 0; }

.how { padding-top: 72px; padding-bottom: 20px; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: s; }
.timeline li { position: relative; padding: 22px 24px 0 0; border-top: 2px solid var(--line); }
.timeline li::before { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--bg); }
.timeline span { font-family: var(--display); font-size: 14px; color: var(--cta); font-weight: 600; }
.timeline h3 { margin: 4px 0 4px; font-size: 17px; }
.timeline p { margin: 0; font-size: 14px; color: var(--muted); }

.faq { padding-top: 72px; padding-bottom: 80px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; }
.faq-list details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); margin: 10px 0 0; font-size: 14.5px; }
.footer { background: var(--brand-deep); color: #a9cdc9; font-size: 13px; padding: 26px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero h1 { font-size: 44px; }
  .lead { max-width: 640px; }
  .result-grid { grid-template-columns: 1fr; }
  .summary { position: static; order: -1; }
}
@media (max-width: 860px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .timeline { grid-template-columns: 1fr 1fr; row-gap: 28px; }
  .faq { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 600px) {
  .hero { padding: 100px 0 56px; }
  .hero h1 { font-size: 34px; }
  .lead { font-size: 15.5px; }
  .hero-points { gap: 18px; }
  .hero-points b { font-size: 24px; }
  .input-card { padding: 16px; }
  .stepper li { font-size: 0; justify-content: center; }
  .stepper i { font-size: 11px; }
  .feature-grid, .timeline { grid-template-columns: 1fr; }
  .section-head h2, .faq h2 { font-size: 28px; }
  .doc-text { padding: 18px; font-size: 15.5px; }
  .legend { display: none; }
  .score-row { flex-direction: column; align-items: stretch; }
  .gauge { margin: 0 auto; }
}

/* ---------- Add-ons: check tabs, grammar & AI views ---------- */
:root { --gram: #2f6fde; --gram-bg: #e4edfd; --ai: #8b3fd9; --ai-bg: #efe3fb; --mixed: #c06bd6; --mixed-bg: #f8eefb; }
.mode-tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.mode-tabs button { border: 0; background: none; padding: 10px 14px; font: inherit; font-weight: 700; font-size: 13.5px; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.mode-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.mt-v { font-size: 11.5px; font-weight: 700; background: var(--soft); color: var(--ink-2); padding: 2px 8px; border-radius: 999px; }
.mt-v:empty { display: none; }
.mode-tabs button.active .mt-v { background: var(--brand-tint); color: var(--brand); }
.dot.gram { background: var(--gram); } .dot.ai { background: var(--ai); } .dot.mixed { background: var(--mixed); }
.dot.stale { background: #fff; border: 2px dotted #93a3ad; width: 11px; height: 11px; }

.s.gram { background: var(--gram-bg); cursor: pointer; }
.s.gram:hover { background: #d2e1fb; }
mark.gerr { background: none; color: inherit; text-decoration: underline wavy; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
mark.gerr.spelling { text-decoration-color: #e5484d; }
mark.gerr.grammar { text-decoration-color: var(--gram); }
mark.gerr.punctuation { text-decoration-color: #d98a00; }
.s.stale { cursor: pointer; text-decoration: underline dotted #93a3ad; text-underline-offset: 4px; }
.s.ai-ai { background: var(--ai-bg); box-shadow: inset 0 -2px 0 var(--ai); cursor: pointer; }
.s.ai-mixed { background: var(--mixed-bg); box-shadow: inset 0 -2px 0 var(--mixed); cursor: pointer; }
.s.ai-ai:hover { background: #e4cff8; } .s.ai-mixed:hover { background: #f1dcf6; }
.pbadge { font-family: var(--sans); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; vertical-align: 2px; white-space: nowrap; }
.pbadge.ai { background: var(--ai); color: #fff; } .pbadge.mixed { background: var(--mixed-bg); color: #7d2e93; } .pbadge.human { background: var(--rw-bg); color: #0b6b4b; }

.pill.gram { background: var(--gram-bg); color: #1d4fa8; }
.pill.ai-ai { background: var(--ai-bg); color: #5f1fa3; } .pill.ai-mixed { background: var(--mixed-bg); color: #7d2e93; } .pill.ai-human { background: var(--rw-bg); color: #0b6b4b; }
.d-original.gram { border-left-color: var(--gram); }
.d-original.ai { border-left-color: var(--ai); }
.g-issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.g-issues li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; color: var(--ink-2); }
.g-issues s { color: #a3171c; } .g-issues b { color: #0b6b4b; }
.g-issues small { flex-basis: 100%; color: var(--muted); }
.gtype { font-size: 11px; font-weight: 700; text-transform: capitalize; padding: 1px 7px; border-radius: 5px; background: var(--soft); }
.gtype.spelling { background: var(--plag-bg); color: #a3171c; } .gtype.grammar { background: var(--gram-bg); color: #1d4fa8; } .gtype.punctuation { background: var(--partial-bg); color: #7a4d00; }
.mini-stats .g-spelling { border-color: var(--plag); } .mini-stats .g-grammar { border-color: var(--gram); } .mini-stats .g-punctuation { border-color: var(--partial); }
.not-run { background: var(--soft); border-radius: 12px; padding: 16px; margin-bottom: 14px; font-size: 13.5px; color: var(--ink-2); }
.not-run p { margin: 0 0 10px; }
.disclaimer { font-size: 12px; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 10px 12px; margin: 10px 0 0; line-height: 1.5; }
.switch small { font-weight: 500; color: var(--muted); }

/* Final-text view: every accepted change, coloured by where it came from */
.s.rw-g { background: var(--gram-bg); box-shadow: inset 0 -2px 0 var(--gram); }
.s.rw-h { background: var(--ai-bg); box-shadow: inset 0 -2px 0 var(--ai); }
.dot.rw-g { background: var(--gram); } .dot.rw-h { background: var(--ai); }
.s.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 40% { outline: 3px solid var(--brand); outline-offset: 2px; } 100% { outline: 3px solid transparent; outline-offset: 2px; } }

/* Plan line under the scan button, and the upgrade link in alerts */
.plan-info { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 6px; }
.plan-info b { color: var(--ink); }
.plan-info a, .alert-link, .switch small a { color: var(--brand); font-weight: 600; }
.nav a.nav-signup { background: var(--cta); color: #fff; }
.nav a.nav-signup:hover { background: var(--cta-d); }

/* Site footer (homepage and every public page) */
.site-footer { background: var(--brand-deep); color: #a9cdc9; font-size: 14px; padding: 44px 0 22px; }
.site-footer a { color: #d4ebe8; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.sf-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 28px; }
.sf-grid > div { display: grid; gap: 8px; align-content: start; }
.sf-grid h4 { margin: 0 0 4px; color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.sf-brand p { margin: 6px 0 0; max-width: 36ch; }
.sf-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 32px; padding-top: 18px; font-size: 13px; }
@media (max-width: 760px) { .sf-grid { grid-template-columns: 1fr 1fr; } .sf-brand { grid-column: 1 / -1; } }

/* Mobile menu (homepage .nav and public pages .acct-nav share it) */
.nav-toggle { position: relative; z-index: 41; border-radius: 10px; }
.nav-toggle span { transition: transform .2s, opacity .2s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  body .nav, body .acct-nav {
    display: none; position: absolute; z-index: 40; top: 64px; left: 12px; right: 12px; margin: 0;
    flex-direction: column; align-items: stretch; justify-content: flex-start; flex-wrap: nowrap; gap: 2px; padding: 10px;
    background: var(--brand-deep); border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, .35); animation: navIn .16s ease-out;
  }
  body.nav-open .nav, body.nav-open .acct-nav { display: flex; }
  body .nav a, body .acct-nav a { padding: 13px 14px; border-radius: 12px; font-size: 15.5px; margin: 0; }
  body .nav a.nav-signup, body .acct-nav a.nav-cta { text-align: center; margin: 6px 0 0; padding: 13px; }
}
@keyframes navIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }