/* Same palette and type as the study page (study.html / review.html) and the
   extension's side panel, so the whole flow reads as one product. */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #e8effd;
  --ok: #2563eb;
  --ok-soft: #e8effd;
  --warn: #8a6d23;
  --warn-soft: #f3efe4;
  --err: #9b2c2c;
  --err-soft: #f7e9e7;
  --code: #f1f5f9;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.topbar .inner {
  max-width: 760px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
}
.mark {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 600; font-size: 13px;
}
.org { font-size: 14px; line-height: 1.3; }
.org b { display: block; font-weight: 600; }
.org span { color: var(--ink-3); font-size: 13px; }

main { max-width: 760px; margin: 0 auto; padding: 32px 20px 64px; }
main.narrow { max-width: 560px; }

h1 { font-size: 24px; line-height: 1.3; margin: 0 0 6px; font-weight: 600; }
h2 { font-size: 18px; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 16px; margin: 0 0 4px; font-weight: 600; }
p { margin: 0 0 12px; }
.lede { font-size: 16px; color: var(--ink-3); margin-bottom: 20px; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }

.pid-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--code); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--ink-2);
}
.pid-chip code { font-weight: 600; color: var(--ink); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; margin: 16px 0; box-shadow: var(--shadow);
}

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0 4px; }
.fact { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.fact .k { font-size: 13px; color: var(--ink-3); }
.fact .v { font-weight: 600; font-size: 16px; margin-top: 2px; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li { padding: 6px 0 6px 26px; position: relative; color: var(--ink-2); }
ul.clean li b { color: var(--ink); font-weight: 600; }
ul.yes li::before, ul.no li::before {
  position: absolute; left: 0; top: 6px; font-weight: 700; width: 18px; text-align: center;
}
ul.yes li::before { content: "✓"; color: var(--ok); }
ul.no li::before  { content: "✕"; color: var(--err); }

ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
ol.steps > li {
  counter-increment: s; position: relative;
  padding: 0 0 22px 48px; margin: 0;
}
ol.steps > li:last-child { padding-bottom: 0; }
ol.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
ol.steps > li::after {
  content: ""; position: absolute; left: 14.5px; top: 32px; bottom: 4px;
  width: 1px; background: var(--line);
}
ol.steps > li:last-child::after { display: none; }
ol.steps h3 { margin-bottom: 4px; }
ol.steps p { color: var(--ink-2); margin-bottom: 8px; }

code, .kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em; background: var(--code); border-radius: 5px; padding: 1px 6px;
}
.copyrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copyrow code { padding: 7px 10px; font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--accent); border-radius: 8px;
  padding: 9px 16px; font: inherit; font-size: 15px; font-weight: 500;
  text-decoration: none; cursor: pointer; transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--accent); filter: none; }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn.block { width: 100%; }

.callout {
  border-radius: 12px; padding: 14px 16px; font-size: 15px; margin: 16px 0;
  border: 1px solid transparent;
}
.callout.info { background: var(--accent-soft); color: var(--ink); }
.callout.warn { background: var(--warn-soft); color: var(--ink); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.callout.ok   { background: var(--ok-soft); color: var(--ink); }
.callout.err  { background: var(--err-soft); color: var(--ink); }
.callout b { font-weight: 700; }

.status {
  display: flex; align-items: center; gap: 12px;
  border: 1px dashed var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 18px;
}
.status .dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); flex-shrink: 0;
}
.status.waiting .dot { animation: pulse 1.4s ease-in-out infinite; background: var(--warn); }
.status.ready { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.status.ready .dot { background: var(--ok); }
.status .grow { flex: 1; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* Welcome progress list */
.checks { list-style: none; padding: 0; margin: 18px 0 0; }
.checks li {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-top: 1px solid var(--line); color: var(--ink-3);
}
.checks li:first-child { border-top: none; }
.checks .ic {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  border: 2px solid var(--line);
}
.checks li.active { color: var(--ink); }
.checks li.active .ic { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.checks li.done { color: var(--ink); }
.checks li.done .ic { background: var(--ok); border-color: var(--ok); color: #fff; }
.checks li.failed .ic { background: var(--err); border-color: var(--err); color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-icon {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 14px; background: var(--accent); color: #fff;
}
.center { text-align: center; }
.center .hero-icon { margin-left: auto; margin-right: auto; }

footer.site {
  max-width: 760px; margin: 0 auto; padding: 0 20px 40px;
  font-size: 13px; color: var(--ink-3);
}
footer.site a { color: var(--ink-2); }
a { color: var(--accent); }
.hidden { display: none !important; }

@media (max-width: 640px) {
  h1 { font-size: 25px; }
  .facts { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .status.waiting .dot, .checks li.active .ic { animation: none; }
}

/* consent */
.agree { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 12px; font-size: 15px; cursor: pointer; }
.agree input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.consent-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.consent-scroll:focus { outline: 2px solid var(--accent-soft); }
.consent-doc ol, .consent-doc ul { padding-left: 22px; margin: 14px 0 6px; }
.consent-doc ol li p { color: var(--ink); font-weight: 600; margin: 0; }
.consent-doc p, .consent-doc li { color: var(--ink-2); font-size: 15px; }
.consent-doc p strong { color: var(--ink); }
.policy h2 { margin-top: 22px; }
.policy li { margin: 4px 0; color: var(--ink-2); }

/* v9.9: the consent form, readable on the page (no inner scroll box) */
.consent-doc.cf { font-size: 16px; line-height: 1.65; }
.consent-doc.cf p, .consent-doc.cf li { color: var(--ink-2); font-size: 16px; }
.cf-head { text-align: center; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 16px; }
.cf-head p { margin: 2px 0; color: var(--ink-3) !important; font-size: 14px !important; }
.cf-head p:nth-child(-n+3) strong { letter-spacing: .04em; font-size: 13px; color: var(--ink-3); }
.cf-head p:nth-child(4) { margin-top: 12px; color: var(--ink) !important; font-size: 17px !important; }
.consent-doc.cf ol { list-style: none; padding: 0; margin: 26px 0 8px; counter-reset: none; }
.consent-doc.cf ol li p { font-size: 18px !important; color: var(--ink) !important; font-weight: 600; }
.consent-doc.cf ol li p strong { font-weight: 600; }
.consent-doc.cf ol[start]::before { content: none; }
.cf-key { background: var(--accent-soft); border: 1px solid #c7d7f8; border-radius: 12px; padding: 4px 18px 8px; margin: 18px 0 8px; }
.cf-key ol { margin-top: 12px !important; }
.cf-statement { background: var(--code); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-top: 22px; }
.cf-statement p strong { color: var(--ink); }
.consent-wrap { max-width: 720px; }
.agree-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 18px; box-shadow: 0 -6px 20px rgba(16,24,40,.06); margin-top: 16px; }
.agree-card .agree { margin: 0 0 10px; }

/* v9.9.3: short consent form in a small scroll box, compact text */
.consent-scroll { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 18px; background: #fff; }
.consent-doc.cf, .consent-doc.cf p, .consent-doc.cf li { font-size: 14px !important; line-height: 1.55; }
.consent-doc.cf p { margin: 0 0 10px; }
.consent-doc.cf .cf-head { padding-bottom: 8px; margin-bottom: 10px; }
.consent-doc.cf .cf-head p { font-size: 12.5px !important; margin: 0 0 2px; }
.consent-doc.cf .cf-head p:nth-child(4) { margin-top: 0; font-size: 12.5px !important; }
.consent-doc.cf .cf-key { padding: 8px 12px 0; margin: 0 0 10px; border-radius: 8px; }
.consent-doc.cf .cf-statement { padding: 10px 12px 0; margin-top: 4px; border-radius: 8px; }
.consent-dl { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.policy h3 { margin: 18px 0 6px; font-size: 16px; }
/* v9.12: withdraw button */
.btn.danger{background:var(--err,#b42318);border-color:var(--err,#b42318);color:#fff}
