@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/inter-latin-800-normal.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --void: #08090d;
  --card: #0f1117;
  --cyan: #06b6d4;
  --violet: #8b5cf6;
  --amber: #f59e0b;
  --emerald: #10b981;
  --rose: #f43f5e;
  --text: #e4e4e7;
  --muted: #a1a1aa;
  --faint: #71717a;
  --line: rgba(255, 255, 255, 0.08);
  --glass: rgba(15, 17, 23, 0.82);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--void); }
html { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
html[lang="ko"] { font-family: Inter, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; }
html[lang="ja"] { font-family: Inter, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif; }
html[lang="zh-CN"], html[lang="zh"] { font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
html, body, button, input, textarea { font-family: inherit; }
body {
  margin: 0;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(1100px 560px at 8% -12%, rgba(6, 182, 212, 0.14), transparent 56%),
    radial-gradient(900px 520px at 92% 0%, rgba(139, 92, 246, 0.1), transparent 54%),
    var(--void);
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: #67e8f9; }
:focus-visible {
  outline: 2px solid rgba(6, 182, 212, 0.8);
  outline-offset: 3px;
}

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
main { position: relative; z-index: 1; padding-bottom: 96px; }

.hero { padding: 48px 0 18px; max-width: 760px; }
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--amber); box-shadow: 0 0 10px var(--amber); }
h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.lede { margin: 16px 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.7; overflow-wrap: anywhere; }
.support { margin: 12px 0 0; color: var(--faint); font-size: 0.98rem; line-height: 1.65; overflow-wrap: anywhere; }
.prose p, .prose li, .faq .answer { overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  color: var(--muted);
}
.badge.warn {
  border-color: rgba(245, 158, 11, 0.3);
  color: #fde68a;
  background: rgba(245, 158, 11, 0.08);
}
.badge.emph {
  border-color: rgba(6, 182, 212, 0.28);
  color: #a5f3fc;
  background: rgba(6, 182, 212, 0.08);
}

.panel {
  border: 1px solid var(--line);
  background: rgba(15, 17, 23, 0.72);
  border-radius: 24px;
  padding: 20px;
}
.panel + .panel, .stack > * + * { margin-top: 16px; }
.workspace { margin-top: 8px; }

.tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--line);
  width: max-content;
  max-width: 100%;
  flex-wrap: wrap;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
}
.tab[aria-selected="true"] {
  background: rgba(255,255,255,.08);
  color: #fff;
}

label { display: block; margin: 14px 0 8px; color: var(--muted); font-size: 13px; }
textarea, input[type="url"] {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.35);
  padding: 14px 16px;
}
textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.55;
}
.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  color: var(--faint);
  font-size: 13px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.samples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ghost, .primary, .quiet {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 10px 16px;
  background: rgba(255,255,255,.04);
}
.primary {
  background: linear-gradient(135deg, rgba(6,182,212,.2), rgba(139,92,246,.24));
  border-color: rgba(6,182,212,.35);
  color: #fff;
  font-weight: 650;
}
.quiet { background: transparent; color: var(--muted); }
.note { margin: 12px 0 0; color: var(--faint); font-size: 13px; line-height: 1.55; }
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.status { margin: 0; min-height: 1.4em; color: var(--muted); font-size: 14px; flex: 1; }
.status.error { color: #fda4af; }
.confidence-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.short-banner {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  color: #fde68a;
  font-size: 14px;
  line-height: 1.5;
}
.signal-list { display: grid; gap: 12px; }
.signal-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}
.signal-name { color: var(--text); font-size: 14px; }
.signal-level { color: #fff; font-size: 13px; }
.signal-pct { color: var(--faint); font-size: 12px; min-width: 2.6em; text-align: right; }
.signal-track {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.signal-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(6,182,212,.85), rgba(139,92,246,.8));
}
.signal-low .signal-fill { background: rgba(161, 161, 170, 0.7); }
.signal-moderate .signal-fill { background: rgba(245, 158, 11, 0.85); }
.signal-high .signal-fill { background: rgba(244, 63, 94, 0.8); }
.signal-human.signal-high .signal-fill { background: rgba(16, 185, 129, 0.85); }
#results[data-label="strong_ai"] .verdict,
#results[data-verdict="AI_GENERATED"] .verdict { border-color: rgba(244, 63, 94, 0.28); }
#results[data-label="mixed"] .verdict,
#results[data-verdict="AI_ASSISTED"] .verdict { border-color: rgba(245, 158, 11, 0.32); }
#results[data-label="likely_human"] .verdict,
#results[data-label="mostly_human"] .verdict,
#results[data-verdict="HUMAN"] .verdict { border-color: rgba(16, 185, 129, 0.3); }
#results[data-label="uncertain"] .verdict,
#results[data-verdict="ABSTAIN"] .verdict { border-color: rgba(161, 161, 170, 0.28); }
.stats-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}
#stats-card summary {
  cursor: pointer;
  color: #fff;
  font-weight: 650;
}
.url-row { margin-top: 8px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.file-row { margin-top: 12px; }

#results { margin-top: 18px; display: grid; gap: 16px; }
.verdict {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 48%),
    rgba(15, 17, 23, 0.8);
}
.verdict-kicker { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.verdict h2 { margin: 8px 0 0; color: #fff; font-size: clamp(1.6rem, 4vw, 2.4rem); }
.verdict-enum { margin-top: 6px; color: var(--faint); font-size: 12px; letter-spacing: 0.08em; }
.verdict p { margin: 12px 0 0; color: var(--muted); line-height: 1.65; }
#results[data-verdict="AI_GENERATED"] .verdict { border-color: rgba(244, 63, 94, 0.28); }
#results[data-verdict="AI_ASSISTED"] .verdict { border-color: rgba(245, 158, 11, 0.32); }
#results[data-verdict="HUMAN"] .verdict { border-color: rgba(16, 185, 129, 0.3); }
#results[data-verdict="ABSTAIN"] .verdict { border-color: rgba(161, 161, 170, 0.28); }

.meter-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.meter-track {
  margin-top: 14px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(16,185,129,.35), rgba(245,158,11,.35), rgba(244,63,94,.4));
  overflow: hidden;
  position: relative;
}
.meter-fill {
  height: 100%;
  width: 0;
  background: rgba(8, 9, 13, 0.35);
  box-shadow: inset -2px 0 0 #fff;
}
.meter-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
}

.para-count { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.para-list { display: grid; gap: 10px; }
.para {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(0,0,0,.22);
}
.para-human { border-left-color: rgba(16, 185, 129, 0.8); background: rgba(16, 185, 129, 0.05); }
.para-ai_assisted { border-left-color: rgba(245, 158, 11, 0.85); background: rgba(245, 158, 11, 0.06); }
.para-ai_generated { border-left-color: rgba(244, 63, 94, 0.8); background: rgba(244, 63, 94, 0.06); }
.para-abstain, .para-uncertain { border-left-color: rgba(161, 161, 170, 0.7); }
.para-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.para-index { color: var(--faint); font-size: 12px; }
.para-badge {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 3px 8px;
  color: var(--muted);
}
.para-score { color: #e4e4e7; font-size: 12px; }
.para p { margin: 0; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.para-note { margin-top: 8px !important; color: var(--faint); font-size: 13px; }

.prose h2 { margin: 0 0 10px; color: #fff; font-size: 1.35rem; }
.prose p, .prose li { color: var(--muted); line-height: 1.7; }
.prose ul { margin: 8px 0 0; padding-left: 18px; list-style: disc; }
.related {
  display: grid;
  gap: 12px;
}
@media (min-width: 720px) {
  .related { grid-template-columns: 1fr 1fr; }
}
.related a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  color: inherit;
  background: rgba(15,17,23,.6);
}
.related a:hover { border-color: rgba(6,182,212,.35); }
.related strong { display: block; color: #fff; margin-bottom: 6px; }

.faq { margin-top: 28px; }
.faq h2 { color: #fff; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item > button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #fff;
  padding: 16px 0;
  font-weight: 650;
}
.faq-item .answer { display: none; color: var(--muted); padding: 0 0 16px; line-height: 1.65; }
.faq-item.open .answer { display: block; }

.mock-banner {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.1);
  color: #fde68a;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}

@media (max-width: 640px) {
  .url-row { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
  textarea { min-height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Local-first escape hatch next to the remote-analysis notice, and result copy */
.note-link { font-weight: 600; white-space: nowrap; }
.note-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 4px; }
.verdict-actions { margin-top: 12px; }
