/* Verity — AI content detector. Clean, light, professional (document tool aesthetic). */
:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-d: #1d4ed8;
  --ai: #e11d48;      /* AI-written = red-ish */
  --ai-soft: #fee2e2;
  --human: #059669;   /* human = green */
  --mid: #d97706;     /* mixed = amber */
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --radius: 16px;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; line-height: 1.5;
}
a { color: var(--brand); }
.grad { color: var(--brand); }

/* ---------- top bar ---------- */
#topbar { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar-inner { max-width: 860px; margin: 0 auto; padding: 12px 18px; display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
.brand { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--ink); }
.brand i { color: var(--brand); width: 22px; height: 22px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 12px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.pill i { width: 17px; height: 17px; }
.pill:hover { border-color: var(--brand); }
.ghost-pill { color: var(--brand-d); border-color: #dbeafe; background: #eff6ff; }

/* ---------- layout ---------- */
#app { max-width: 860px; margin: 0 auto; padding: 26px 18px 80px; }
.hero { text-align: center; margin: 18px 0 22px; }
.h-title { font-size: clamp(1.9rem, 5vw, 2.7rem); font-weight: 800; letter-spacing: -.03em; margin: 0 0 10px; }
.h-sub { color: var(--muted); max-width: 560px; margin: 0 auto; font-size: 1.02rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 8px; margin: 0 auto 16px; max-width: 420px; }
.tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 10px; border: 1px solid var(--line); background: #fff; border-radius: 12px; font-weight: 600; font-size: .93rem; color: var(--muted); cursor: pointer; }
.tab i { width: 17px; height: 17px; }
.tab.on { color: var(--brand-d); border-color: var(--brand); background: #eff6ff; }
.soon { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: #f1f5f9; color: var(--muted); padding: 2px 6px; border-radius: 999px; }

/* ---------- editor ---------- */
.editor-card { padding: 6px; overflow: hidden; }
#input { width: 100%; min-height: 260px; resize: vertical; border: 0; outline: none; padding: 18px; font: inherit; font-size: 1.02rem; line-height: 1.7; color: var(--ink); background: transparent; }
#input::placeholder { color: #94a3b8; }
.editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.counters { color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums; }
.counters .dot { margin: 0 5px; opacity: .5; }
.counters .limit { margin-left: 7px; opacity: .8; }
.counters .limit.over { color: var(--ai); font-weight: 700; opacity: 1; }
.foot-actions { display: flex; align-items: center; gap: 12px; }

.cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: #fff; border: 0; border-radius: 11px; padding: 11px 18px; font-weight: 700; font-size: .95rem; cursor: pointer; box-shadow: 0 4px 14px rgba(37,99,235,.28); }
.cta:hover { background: var(--brand-d); }
.cta:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.cta i { width: 18px; height: 18px; }
.cta.big { width: 100%; padding: 14px; font-size: 1rem; margin-top: 6px; }
.cta i[data-lucide="loader"] { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ghost { background: none; border: 0; cursor: pointer; }
.link { color: var(--muted); font-weight: 600; font-size: .88rem; padding: 4px; }
.link:hover { color: var(--brand); }
.pill.wide { width: 100%; justify-content: center; margin-top: 8px; }

.disclaimer, .est-note { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: .84rem; margin: 12px 4px 0; }
.disclaimer i, .est-note i { width: 15px; height: 15px; flex: none; margin-top: 2px; color: #94a3b8; }

/* ---------- section heading + editor actions ---------- */
.section-h { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; margin: 4px 2px 12px; }
.editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 4px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.foot-note { color: var(--muted); font-size: .82rem; }
.editor-actions { display: flex; align-items: center; gap: 12px; padding: 8px 16px 14px; flex-wrap: wrap; }
.editor-actions .grow { flex: 1; }
.btn-2 { display: inline-flex; align-items: center; gap: 7px; background: #fff; color: var(--brand-d); border: 1px solid #dbeafe; border-radius: 11px; padding: 10px 15px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.btn-2:hover { background: #eff6ff; }
.btn-2 i { width: 17px; height: 17px; }
#wordCount.over { color: var(--ai); font-weight: 700; }
.file-info { display: flex; align-items: center; gap: 8px; padding: 10px 16px 14px; font-size: .86rem; color: #334155; }
.file-info i { width: 16px; height: 16px; flex: none; }
.file-info.ok i { color: var(--human); }
.file-info.err { color: var(--ai); }
.file-info .trunc { color: var(--muted); font-weight: 500; }

/* ---------- gauge card (circular % + AI/Human metrics) ---------- */
.gauge-card { margin-top: 20px; padding: 26px 22px; display: flex; flex-direction: column; align-items: center; }
.gauge-wrap { position: relative; width: 200px; height: 200px; }
.gauge-svg { width: 200px; height: 200px; display: block; }
.g-track { fill: none; stroke: #eef2f7; stroke-width: 16; }
.g-prog { fill: none; stroke: #cbd5e1; stroke-width: 16; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.7,.2,1), stroke .3s; }
.g-prog.hi { stroke: var(--ai); }
.g-prog.mid { stroke: var(--mid); }
.g-prog.lo { stroke: var(--human); }
.gauge-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gc-ph { color: var(--muted); font-size: .95rem; font-weight: 600; line-height: 1.35; }
.gc-val { line-height: 1; }
.gc-val #gaugeNum { font-size: 3.4rem; font-weight: 800; letter-spacing: -.03em; }
.gc-pct { font-size: 1.6rem; font-weight: 800; color: var(--muted); }
.gc-lbl { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 4px; }
.verdict-badge { margin-top: 16px; font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; padding: 7px 16px; border-radius: 999px; }
.verdict-badge.v-hi { color: var(--ai); background: var(--ai-soft); }
.verdict-badge.v-lo { color: var(--human); background: #d1fae5; }
.verdict-badge.v-mid { color: var(--mid); background: #fef3c7; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin-top: 20px; }
.metric { border: 1px solid var(--line); border-radius: 13px; padding: 16px; text-align: center; background: #f8fafc; }
.m-num { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.metric.ai .m-num { color: var(--ai); }
.metric.human .m-num { color: var(--human); }
.m-lbl { font-size: .8rem; font-weight: 600; color: var(--muted); margin-top: 6px; }

/* ---------- result detail ---------- */
.result-card { padding: 22px; margin-top: 20px; }
.summary { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: .96rem; color: #334155; margin-bottom: 20px; }

.highlight-block { margin-top: 6px; }
.hl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.hl-head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.hl-key { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.hl-swatch { width: 26px; height: 13px; border-radius: 4px; background: var(--ai-soft); border: 1px solid #fecaca; display: inline-block; }
.rendered { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; font-size: 1rem; line-height: 1.85; color: #1e293b; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.rendered mark { background: var(--ai-soft); color: #991b1b; padding: 1px 2px; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hl-empty { color: var(--muted); font-size: .9rem; margin: 10px 2px 0; }
.support-line { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 18px; }

/* ---------- plagiarism coming soon ---------- */
.coming-soon { text-align: center; padding: 44px 26px; }
.cs-icon { width: 60px; height: 60px; margin: 0 auto 16px; border-radius: 16px; background: #eff6ff; display: grid; place-items: center; }
.cs-icon i { width: 28px; height: 28px; color: var(--brand); }
.coming-soon h2 { margin: 0 0 10px; font-size: 1.4rem; }
.coming-soon p { color: var(--muted); max-width: 460px; margin: 0 auto 20px; }
.coming-soon .cta { margin: 0 auto; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(15,23,42,.5); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
@media (min-width: 640px) { .modal { align-items: center; padding: 20px; } }
.sheet { position: relative; background: #fff; width: 100%; max-width: 460px; border-radius: 20px 20px 0 0; padding: 26px 22px 30px; box-shadow: 0 -8px 40px rgba(0,0,0,.2); max-height: 92vh; overflow: auto; }
@media (min-width: 640px) { .sheet { border-radius: 20px; } }
.sheet-x { position: absolute; top: 14px; right: 14px; background: #f1f5f9; border: 0; border-radius: 999px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.sheet-x i { width: 18px; height: 18px; }
.sheet h2 { margin: 0 0 6px; font-size: 1.3rem; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.fld { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; font: inherit; font-size: 1rem; margin: 12px 0; outline: none; }
.fld:focus { border-color: var(--brand); }

/* paywall */
.pro-badge { display: inline-flex; align-items: center; gap: 6px; background: #eff6ff; color: var(--brand-d); font-weight: 700; font-size: .82rem; padding: 5px 12px; border-radius: 999px; margin-bottom: 12px; }
.pro-badge i { width: 15px; height: 15px; }
.pay-h { font-size: 1.35rem; margin: 0 0 14px; letter-spacing: -.02em; }
.pro-feats { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 9px; }
.pro-feats li { display: flex; align-items: center; gap: 9px; font-size: .95rem; color: #334155; }
.pro-feats i { width: 18px; height: 18px; color: var(--human); flex: none; }
.plan-list { display: flex; flex-direction: column; gap: 10px; }
.opt { position: relative; display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 13px; padding: 14px 16px; cursor: pointer; }
.opt.sel { border-color: var(--brand); background: #f5f9ff; }
.opt .radio { width: 20px; height: 20px; border-radius: 999px; border: 2px solid #cbd5e1; flex: none; }
.opt.sel .radio { border-color: var(--brand); background: radial-gradient(circle at center, var(--brand) 0 6px, #fff 7px); }
.opt .oi { flex: 1; }
.on1 { font-weight: 700; }
.ob1 { font-size: .84rem; color: var(--muted); }
.price { text-align: right; font-weight: 800; font-size: 1.1rem; }
.price small { display: block; font-weight: 500; font-size: .74rem; color: var(--muted); }
.badge { position: absolute; top: -9px; right: 14px; background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.trial-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 4px; padding: 12px 14px; background: #f8fafc; border-radius: 12px; }
.trial-t { font-weight: 700; font-size: .92rem; }
.trial-s { font-size: .8rem; color: var(--muted); }
.switch { width: 46px; height: 27px; border-radius: 999px; background: #cbd5e1; border: 0; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 999px; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--human); }
.switch.on::after { transform: translateX(19px); }
.pay-fine { text-align: center; color: var(--muted); font-size: .82rem; margin: 12px 0 6px; }
.pay-fine.free { color: var(--human); font-weight: 600; }
.pay-sheet .link, .sheet .link { display: block; margin: 4px auto 0; text-align: center; }

/* account */
.acct-stat { background: #f8fafc; border: 1px solid var(--line); border-radius: 13px; padding: 16px; text-align: center; margin: 14px 0; }
.acct-stat .big { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; color: var(--brand-d); }
.acct-stat .lbl { color: var(--muted); font-size: .85rem; }
.usage { margin: 4px 0 14px; }
.usage-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; color: #334155; font-weight: 600; margin-bottom: 6px; }
.usage-pages { color: var(--muted); font-weight: 500; }
.usage-bar { height: 10px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.usage-bar i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 999px; transition: width .6s ease; }
.usage-bar i.hi { background: var(--ai); }
.hist-head { font-weight: 700; font-size: .9rem; margin: 20px 0 8px; color: #334155; }
.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist { display: flex; align-items: stretch; gap: 6px; }
.hopen { flex: 1; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: pointer; text-align: left; }
.hpc { font-weight: 800; font-size: .95rem; width: 46px; text-align: center; color: var(--mid); }
.hpc.hi { color: var(--ai); }
.hpc.lo { color: var(--human); }
.hi .ho, .hopen .ho { font-weight: 700; font-size: .9rem; }
.hopen .hi { flex: 1; }
.hd { font-size: .78rem; color: var(--muted); }
.hgo { color: #cbd5e1; }
.hgo i { width: 18px; height: 18px; }
.hrm { background: #fff; border: 1px solid var(--line); border-radius: 11px; width: 40px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.hrm i { width: 16px; height: 16px; }
.hrm:hover { color: var(--ai); border-color: #fecaca; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: .9rem; font-weight: 500; max-width: 90vw; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
