:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --on-accent: #ffffff;
  --nav: rgba(255, 255, 255, 0.72);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lift: 0 12px 40px rgba(0, 0, 0, 0.12);
  --green: #1a7f3c;
  --blue: #0066cc;
  --orange: #b25a00;
  --purple: #6e3fd1;
  --gray: #5f5f66;
  --red: #c9252d;
  --radius: 22px;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-soft: #101012;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #86868b;
    --line: #424245;
    --line-soft: #2c2c2e;
    --accent: #2997ff;
    --accent-hover: #47a6ff;
    --on-accent: #ffffff;
    --nav: rgba(22, 22, 23, 0.72);
    --shadow: none;
    --shadow-lift: 0 12px 40px rgba(0, 0, 0, 0.6);
    --green: #4cd471;
    --blue: #5eb0ff;
    --orange: #ffa94d;
    --purple: #b79bff;
    --gray: #a1a1a6;
    --red: #ff6961;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-soft);
  color: var(--text);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

h1, h2, h3, .display {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-wrap: balance;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, textarea { font: inherit; letter-spacing: inherit; color: inherit; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

[hidden] { display: none !important; }

/* ---- navigation */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }

.nav-links {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  flex: none;
  padding: 6px 14px;
  border-radius: 980px;
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }

/* ---- page */

main { outline: none; min-height: calc(100vh - 53px); }

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 22px 120px;
  animation: rise 0.5s var(--ease);
}
.page.narrow { max-width: 760px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

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

.hero { text-align: center; margin-bottom: 56px; }

.eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.eyebrow.accent { color: var(--accent); }

.hero h1 {
  font-size: clamp(38px, 6.4vw, 64px);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.hero .lead {
  margin: 18px auto 0;
  max-width: 600px;
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.4;
  color: var(--text-2);
}

.hero .actions { margin-top: 28px; justify-content: center; }

.section-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 56px 0 20px;
}

.muted { color: var(--text-2); }
.small { font-size: 14px; line-height: 1.43; letter-spacing: -0.016em; }
.tiny { font-size: 12px; line-height: 1.35; letter-spacing: -0.01em; }

/* ---- buttons */

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: 980px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 17px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s var(--ease), opacity 0.2s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; }

.btn.secondary {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.btn.secondary:hover { background: var(--accent); color: var(--on-accent); }

.btn.large { min-height: 52px; padding: 14px 30px; font-size: 19px; }
.btn.small { min-height: 36px; padding: 6px 16px; font-size: 14px; }

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
}
.link:hover { text-decoration: underline; }
.link.quiet { color: var(--text-2); font-size: 14px; }
.link.danger { color: var(--red); }
.link.chevron::after { content: " ›"; }

/* ---- cards */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

a.card { display: block; color: inherit; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); }
a.card:hover { text-decoration: none; transform: scale(1.012); box-shadow: var(--shadow-lift); }

.card h2, .card h3 { letter-spacing: -0.02em; font-weight: 600; }
.card h3 { font-size: 21px; line-height: 1.2; }

.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 28px;
  font-size: 15px;
  box-shadow: var(--shadow);
}
.banner::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--orange); }

.empty {
  text-align: center;
  padding: 72px 24px;
  color: var(--text-2);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.empty h3 { color: var(--text); font-size: 24px; margin-bottom: 8px; }
.empty .actions { justify-content: center; margin-top: 24px; }

/* ---- pills */

.pills { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  --c: var(--gray);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  white-space: nowrap;
}
.pill .k { font-weight: 400; opacity: 0.85; }
.pill.green { --c: var(--green); }
.pill.blue { --c: var(--blue); }
.pill.orange { --c: var(--orange); }
.pill.purple { --c: var(--purple); }
.pill.red { --c: var(--red); }

/* ---- topics */

.topic { display: flex; flex-direction: column; gap: 16px; }
.topic h3 { font-size: 24px; line-height: 1.17; }
.topic .summary { color: var(--text-2); }

.topic.featured { padding: 44px; gap: 20px; margin-bottom: 20px; }
.topic.featured h3 { font-size: clamp(30px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.025em; }
.topic.featured .summary { font-size: 19px; line-height: 1.42; max-width: 720px; }

.verdict { border-top: 1px solid var(--line-soft); padding-top: 16px; display: grid; gap: 14px; }
.topic.featured .verdict { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.verdict dt { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.verdict dd { margin: 0; font-size: 15px; line-height: 1.4; }
.verdict dl { margin: 0; }

.reco { font-size: 15px; line-height: 1.4; }
.reco strong { font-weight: 600; }

.sources { display: flex; flex-wrap: wrap; gap: 8px; }
.source {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  max-width: 100%;
  padding: 5px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
}
.source:hover { text-decoration: none; background: color-mix(in srgb, var(--text) 9%, transparent); }
.source .date { color: var(--text-2); white-space: nowrap; }
.source .unverified { color: var(--orange); }

details.more > summary {
  cursor: pointer;
  list-style: none;
  color: var(--accent);
  font-size: 15px;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: " ›"; }
details.more[open] > summary::after { content: " ⌄"; }
details.more > summary:hover { text-decoration: underline; }
details.more > :not(summary) { margin-top: 14px; }

.topic .actions { margin-top: auto; padding-top: 4px; }

/* ---- forms */

textarea, input[type="text"], input[type="password"], input[type="datetime-local"] {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { display: block; resize: vertical; line-height: 1.5; min-height: 180px; }
textarea:focus, input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
::placeholder { color: var(--text-3); }

label.field { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 8px; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span {
  display: block;
  padding: 7px 18px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s;
}
.segmented input:checked + span { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14); }
.segmented input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); }

/* ---- opinion */

.question {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.028em;
  margin-bottom: 16px;
}
.focus { text-align: left; }
.focus .context { margin-bottom: 36px; }
.focus .answer { margin-top: 32px; }
.focus .answer textarea { min-height: 240px; font-size: 19px; }
.focus .actions { margin-top: 24px; }

.understood { font-size: 21px; line-height: 1.4; min-height: 150px; }

.block { margin-top: 36px; }
.block h4 { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--text-2); }

ul.clean { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ul.clean li { padding-left: 20px; position: relative; }
ul.clean li::before { content: ""; position: absolute; left: 4px; top: 0.62em; width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); }

blockquote {
  margin: 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--line);
  font-size: 19px;
  line-height: 1.4;
}
.quotes { display: grid; gap: 14px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.list { display: grid; gap: 14px; }
.list .card { padding: 22px 26px; }
.list .card h3 { font-size: 19px; margin: 8px 0 4px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- draft */

.draft-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .draft-layout { grid-template-columns: 1fr; } }

.post { padding: 0; overflow: hidden; }
.post-head { display: flex; align-items: center; gap: 12px; padding: 22px 28px 0; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #a1a1a6, #6e6e73); }
.post-body { padding: 18px 28px 28px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 17px; line-height: 1.55; }
.post-body.article { white-space: normal; }
.post-title { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; padding: 22px 28px 0; }
.post textarea { border: 0; border-radius: 0; min-height: 420px; padding: 18px 28px 28px; font-size: 17px; line-height: 1.55; box-shadow: none !important; }
.post input.title-input { border: 0; border-radius: 0; padding: 22px 28px 0; font-size: 30px; font-weight: 700; box-shadow: none !important; }
.post-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 28px; border-top: 1px solid var(--line-soft); }
.count.over { color: var(--red); font-weight: 600; }

.side { display: grid; gap: 16px; }
.side .card { padding: 22px; }
.side h3 { font-size: 17px; margin-bottom: 10px; }
.side .btn { width: 100%; }
.side .stack { display: grid; gap: 10px; margin-top: 14px; }

.claims { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.claims li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: 14px; line-height: 1.4; }
.dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--c, var(--gray)); }
.dot.supported { --c: var(--green); }
.dot.unsupported { --c: var(--orange); }
.dot.contradicted { --c: var(--red); }
.claims .note { color: var(--text-2); margin-top: 2px; }

.versions { display: grid; gap: 8px; font-size: 14px; }
.versions details > div { white-space: pre-wrap; color: var(--text-2); margin-top: 8px; padding: 12px; border-radius: 10px; background: var(--bg-soft); max-height: 240px; overflow: auto; }

/* ---- calendar */

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-head h2 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.cal-nav { display: flex; gap: 8px; }
.round {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--text) 8%, transparent); font-size: 18px; line-height: 1;
}
.round:hover { background: color-mix(in srgb, var(--text) 14%, transparent); }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal .dow { background: var(--card); padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.cal .day { background: var(--card); min-height: 104px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.cal .day.out { background: color-mix(in srgb, var(--card) 55%, var(--bg-soft)); }
.cal .num { font-size: 14px; color: var(--text-2); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal .today .num { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal .event {
  display: block; padding: 5px 8px; border-radius: 8px; font-size: 12px; line-height: 1.3;
  color: var(--blue); background: color-mix(in srgb, var(--blue) 13%, transparent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal .event:hover { text-decoration: none; background: color-mix(in srgb, var(--blue) 22%, transparent); }
@media (max-width: 640px) {
  .cal .day { min-height: 64px; padding: 4px; }
  .cal .event { font-size: 0; padding: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-left: 9px; }
}

/* ---- analytics */

.tiles { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tile { padding: 24px; }
.tile .value { font-family: -apple-system, "SF Pro Display", "Helvetica Neue", sans-serif; font-size: 48px; line-height: 1.05; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile .label { margin-top: 6px; font-size: 14px; color: var(--text-2); }

.archive-form { display: grid; gap: 12px; }
.archive-form textarea { min-height: 120px; }

/* ---- login */

.login { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login form { width: 100%; max-width: 380px; text-align: center; display: grid; gap: 16px; }
.login h1 { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; }
.login .btn { width: 100%; }
.error { color: var(--red); font-size: 14px; min-height: 20px; }

/* ---- overlays */

.busy {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 22px;
  background: color-mix(in srgb, var(--bg-soft) 70%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  animation: fade 0.25s;
}
.busy-card { text-align: center; max-width: 420px; }
.busy-step { font-family: -apple-system, "SF Pro Display", sans-serif; font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin: 24px 0 10px; text-wrap: balance; }
.busy-hint { color: var(--text-2); font-size: 15px; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--text) 14%, transparent); border-top-color: var(--text);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }

dialog {
  width: min(480px, calc(100vw - 32px));
  border: 0; border-radius: 24px; padding: 32px;
  background: var(--card); color: var(--text);
  box-shadow: var(--shadow-lift);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog[open] { animation: rise 0.3s var(--ease); }
dialog h2 { font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 12px; }
dialog .actions { margin-top: 26px; justify-content: flex-end; }
dialog .field-group { margin-top: 20px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
  max-width: min(560px, calc(100vw - 32px));
  padding: 14px 22px; border-radius: 16px;
  background: var(--text); color: var(--bg); font-size: 15px; line-height: 1.35;
  box-shadow: var(--shadow-lift); animation: rise 0.3s var(--ease);
}

.warning {
  margin-top: 28px;
  padding: 22px 24px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--red) 8%, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 35%, transparent);
  display: grid;
  gap: 16px;
}
.warning h4 { margin: 0; font-size: 17px; font-weight: 600; color: var(--red); }
.warning .conflict { display: grid; gap: 8px; }
.warning blockquote { font-size: 16px; border-left-color: color-mix(in srgb, var(--red) 45%, transparent); }

/* ---- small screens */

@media (max-width: 640px) {
  .nav-inner { padding: 0 14px; gap: 10px; }
  .nav-links { justify-content: flex-start; }
  .nav-links a { padding: 6px 10px; }
  .page { padding: 40px 16px 96px; }
  .hero { margin-bottom: 36px; }
  .card { padding: 22px; }
  .topic.featured { padding: 26px 22px; }
  .grid { grid-template-columns: 1fr; }
  .post-head, .post-body, .post-foot, .post-title { padding-left: 20px; padding-right: 20px; }
  dialog { padding: 24px; }
}
