/* Commented. Direction comes from the founders' whitepaper: cobalt #2447F5 on white, navy #111833 for the
   public hero, a light band header, left navigation, serif display headings for an editorial feel, and the
   eleven interest colors used only as labeled chips. System fonts: no downloads, readable everywhere. */

:root {
  --ink: #0f172a;
  --navy: #111833;
  --muted: #475569;
  --line: #d6deec;
  --line-strong: #b8c4d9;
  --bg: #ffffff;
  --surface: #f6f8fc;
  --band: #eef2ff;
  --cobalt: #2447f5;
  --cobalt-dark: #1a35c4;
  --ok: #0f766e;
  --ok-tint: #e5f7f3;
  --warn: #92400e;
  --warn-tint: #fff3d6;
  --danger: #b4233d;
  --danger-tint: #fff0f3;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", Charter, "Bitstream Charter", Georgia, "Times New Roman", serif;
  --r: 8px;
  --r-lg: 12px;
  --focus: 0 0 0 3px #ffffff, 0 0 0 5px var(--cobalt);
  --side: 232px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 1rem/1.55 var(--sans); color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; }
a { color: var(--cobalt); text-underline-offset: 2px; }
a:hover { color: var(--cobalt-dark); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); }
h2 { font-size: 1.3rem; margin-top: 1.75rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r); z-index: 100; }
.skip:focus { left: 8px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--band); border-bottom: 1px solid var(--line); min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; margin-right: auto; min-height: 44px; }
.brand { flex-shrink: 0; }
.brand-logo { display: block; flex: none; width: 119px; height: 28px; }
.topsearch { display: none; flex: 0 1 340px; }
.topsearch input { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--ink); border-radius: var(--r); cursor: pointer; }
.icon-btn:hover { background: #e0e7ff; }
.create-btn { flex: none; }
.topbar .signin-btn { display: none; }

/* Shell */
.shell { display: block; }
.sidenav { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(84vw, 300px); background: #fff; border-right: 1px solid var(--line); padding: 16px 12px 24px; overflow-y: auto; transform: translateX(-102%); transition: transform .2s ease; visibility: hidden; }
.sidenav.open { transform: none; visibility: visible; }
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(15, 23, 42, .45); }
.navlist { list-style: none; margin: 0 0 8px; padding: 0; }
.navlist a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r); color: #334155; font-weight: 600; text-decoration: none; }
.navlist a:hover { background: var(--surface); color: var(--ink); }
.navlist a[aria-current="page"] { background: var(--band); color: var(--cobalt); }
.navhead { margin: 18px 12px 6px; font-size: .78rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.navjoin { display: grid; gap: 8px; margin-top: 16px; padding: 0 4px; }
.signout { margin: 12px 12px 0; }
main { display: block; padding: 20px 16px 48px; min-width: 0; outline: none; }

@media (min-width: 640px) {
  .topsearch { display: block; }
  .search-link { display: none; }
  .topbar .signin-btn { display: inline-flex; }
  main { padding: 28px 28px 56px; }
}
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .brand { margin-right: 24px; width: calc(var(--side) - 24px); }
  .topsearch { margin-right: auto; }
  .shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
  .sidenav { position: sticky; top: 60px; height: calc(100vh - 60px); width: auto; transform: none; visibility: visible; transition: none; z-index: 1; }
  .scrim { display: none !important; }
  main { padding: 32px 40px 64px; max-width: 1080px; }
}

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--r); border: 1px solid transparent; font: 600 .95rem/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f0b8c3; }
.btn-danger:hover { background: var(--danger-tint); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .88rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn[aria-pressed="true"] { background: var(--band); border-color: var(--cobalt); color: var(--cobalt); }
.btn[aria-busy="true"] { cursor: progress; }
@media (pointer: coarse) { .btn-sm, a.chip { min-height: 44px; } .meta a, .linkbtn { display: inline-flex; align-items: center; min-height: 44px; }
  h2 > a, h3 > a, a.session-link { display: inline-block; padding-block: 11px; margin-block: -11px; } }
.linkbtn { background: none; border: 0; padding: 0; color: var(--cobalt); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; min-height: 44px; }
.inline-form { display: inline; margin: 0; }

label, .label { display: block; font-weight: 600; margin: 0 0 6px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; margin: 2px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=date],
input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; color: var(--ink); font: inherit;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--cobalt); }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
.field { margin: 0 0 18px; }
.field-error { color: var(--danger); font-size: .9rem; margin: 6px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; min-height: 44px; padding-top: 10px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--cobalt); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin: 0 0 18px; }
legend { font-weight: 700; padding: 0 6px; }
.grid-2 { display: grid; gap: 0 16px; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 0 12px; }
@media (min-width: 700px) { .grid-3 { grid-template-columns: 2fr 2fr 1fr; } }
.wp-row + .wp-row { border-top: 1px dashed var(--line); padding-top: 8px; }
@media (min-width: 700px) { .wp-row + .wp-row { border-top: 0; padding-top: 0; } }

.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .9rem; margin: 20px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.btn-discord { background: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752c4; color: #fff; }

/* Notices */
.notice { border-radius: var(--r); padding: 12px 14px; margin: 0 0 16px; border: 1px solid; }
.notice p { margin: 0; }
.notice-info { background: var(--band); border-color: #c7d2fe; }
.notice-ok { background: var(--ok-tint); border-color: #9fdccd; }
.notice-error { background: var(--danger-tint); border-color: #f0b8c3; }
.notice-warn { background: var(--warn-tint); border-color: #f3d38c; }

/* Page heads and text */
.pagehead { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.pagehead h1 { margin: 0; }
.pagehead .lead { margin: 6px 0 0; }
.pagehead-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 64ch; }
.kicker { margin: 0 0 4px; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--cobalt); }
.meta { color: var(--muted); font-size: .9rem; margin: 0; }
.meta > * + *::before { content: "·"; margin: 0 6px; color: var(--line-strong); }
.prose { max-width: 70ch; }
.prose p { margin: 0 0 1rem; }
.page-narrow { max-width: 640px; }
.display { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }

/* Cards, lists */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.card + .card { margin-top: 12px; }
.item h3 { margin: 0 0 4px; font-size: 1.05rem; }
.item h3 a { color: var(--ink); text-decoration: none; }
.item h3 a:hover { color: var(--cobalt); text-decoration: underline; }
.item-text { margin: 0 0 6px; color: #334155; }
.stack > * + * { margin-top: 12px; }
.cols { display: grid; gap: 20px; }
@media (min-width: 900px) { .cols { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.section { margin-top: 28px; }
.section > h2:first-child { margin-top: 0; }
.rowlist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rowlist > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); font-weight: 600; }
dl.facts dd { margin: 0; }

/* Chips and tags */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 6px; background: var(--tint, var(--band)); color: var(--accent, var(--cobalt)); font-size: .85rem; font-weight: 600; text-decoration: none; border: 1px solid transparent; }
a.chip:hover { border-color: var(--accent); color: var(--accent); }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: .78rem; font-weight: 700; background: var(--surface); color: #334155; border: 1px solid var(--line); }
.tag-fiction { background: var(--warn-tint); color: var(--warn); border-color: #f3d38c; }
.tag-ok { background: var(--ok-tint); color: var(--ok); border-color: #9fdccd; }
.tag-staff { background: var(--navy); color: #fff; border-color: var(--navy); }
.tag-danger { background: var(--danger-tint); color: var(--danger); border-color: #f0b8c3; }

/* Tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 18px; scrollbar-width: thin; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--cobalt); border-bottom-color: var(--cobalt); }

/* Filters row */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 18px; }
.filters .field { margin: 0; min-width: 160px; flex: 1 1 160px; }
.filters .field-q { flex: 2 1 240px; }

/* Avatars and people */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 10px; background: var(--band); color: var(--cobalt); font-weight: 800; }
.avatar-sm { width: 28px; height: 28px; font-size: .75rem; border-radius: 7px; }
.avatar-md { width: 40px; height: 40px; font-size: .9rem; }
.avatar-lg { width: 76px; height: 76px; font-size: 1.6rem; border-radius: 16px; }
.person { display: flex; gap: 10px; align-items: center; }
.userlink { font-weight: 600; color: var(--ink); text-decoration: none; }
.userlink:hover { color: var(--cobalt); text-decoration: underline; }

/* Empty, pager */
.empty { border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 20px; color: var(--muted); }
.empty-title { color: var(--ink); font-weight: 700; margin: 0 0 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.pager-num { color: var(--muted); font-size: .9rem; }

/* Home */
.hero { background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 32px 22px; margin: 0 0 24px; }
.hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); margin: 0 0 12px; }
.hero p { color: #cfd6ee; max-width: 56ch; font-size: 1.1rem; }
.hero .btn-ghost { background: transparent; color: #fff; border-color: #6b78a8; }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.discord-band { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; margin: 0 0 28px; padding: 18px 20px; border: 1px solid #d5d9fb; border-radius: var(--r-lg); background: #f1f2fe; }
.discord-band-logo { color: #5865f2; align-self: start; margin-top: 2px; }
.discord-band h2 { margin: 0 0 4px; font-size: 1.15rem; }
.discord-band p { margin: 0; color: var(--muted); }
.discord-band .btn-discord { grid-column: 1 / -1; justify-self: start; }
.discord-live { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px !important; color: var(--ink) !important; font-weight: 600; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #23a55a; box-shadow: 0 0 0 3px rgba(35, 165, 90, .2); }
@media (min-width: 640px) { .discord-band { grid-template-columns: auto 1fr auto; } .discord-band .btn-discord { grid-column: auto; } }
@media (prefers-reduced-motion: no-preference) { .live-dot { animation: cm-pulse 2.4s ease-in-out infinite; } }
@keyframes cm-pulse { 50% { box-shadow: 0 0 0 6px rgba(35, 165, 90, .08); } }
@media (min-width: 900px) { .hero { padding: 44px 40px; } }
.path { display: grid; gap: 12px; }
@media (min-width: 760px) { .path { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.path .card { display: flex; flex-direction: column; }
.path .card p:last-child { margin-top: auto; }

/* Onboarding */
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; flex-wrap: wrap; }
.steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); color: var(--muted); font-weight: 600; font-size: .9rem; border: 1px solid var(--line); }
.steps li[aria-current="step"] { background: var(--band); color: var(--cobalt); border-color: #c7d2fe; }
.steps li.done { color: var(--ok); }
.choice { display: block; border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 16px; background: #fff; }
.choice + .choice { margin-top: 12px; }
.choice-rec { border-color: var(--cobalt); }

.interest-grid { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 12px 0 18px; padding: 0; list-style: none; }
@media (min-width: 600px) { .interest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .interest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.icard { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; min-height: 76px; border: 1.5px solid var(--line-strong); border-radius: var(--r-lg); background: #fff; cursor: pointer; font-weight: 400; margin: 0; }
.icard input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.icard .box { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: #fff; margin-top: 2px; }
.icard .box svg { opacity: 0; }
.icard .swatch { flex: none; width: 14px; height: 14px; border-radius: 4px; margin-top: 6px; background: var(--accent); }
.icard .iname { display: block; font-weight: 700; color: var(--ink); }
.icard .iinc { display: block; color: var(--muted); font-size: .9rem; }
.icard:hover { border-color: var(--accent); }
.icard:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.icard:has(input:checked) .box { background: var(--accent); border-color: var(--accent); }
.icard:has(input:checked) .box svg { opacity: 1; }
.icard:has(input:focus-visible) { box-shadow: var(--focus); }
.icard[hidden] { display: none; }

/* Discussion threads */
.thread-post { border-left: 2px solid var(--line); padding: 4px 0 4px 14px; margin: 12px 0 0; }
.thread-post .thread-post { margin-left: 4px; }
@media (min-width: 640px) { .thread-post .thread-post { margin-left: 10px; } }
.thread-post.is-update { border-left-color: var(--cobalt); }
.post-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .9rem; color: var(--muted); }
.post-body { margin: 6px 0; overflow-wrap: anywhere; }
.post-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.post-removed { color: var(--muted); font-style: italic; }
.continue { display: inline-block; margin-top: 8px; font-weight: 600; }

/* Research and news */
.versionbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 16px; }
.cite { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; overflow-wrap: anywhere; }
.diff-del { background: var(--danger-tint); text-decoration: line-through; }
.diff-ins { background: var(--ok-tint); }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 16px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--cobalt); }
.source-type { font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.src-primary { color: #0f766e; }
.src-reporting { color: #2447f5; }
.src-analysis { color: #6d28d9; }
.src-opinion { color: #92400e; }

/* Profile */
.profile-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.profile-head .who { flex: 1 1 260px; }
.profile-head h1 { margin: 0; }
.badge-verified { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--ok-tint); color: var(--ok); font-size: .8rem; font-weight: 700; }
.rep { list-style: none; margin: 0; padding: 0; }
.rep li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rep .num { font-weight: 800; font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 700; font-size: .82rem; }

/* Footer */
.sitefoot { border-top: 1px solid var(--line); padding: 20px 16px 32px; color: var(--muted); font-size: .9rem; }
.foot-brand { display: inline-flex; margin-bottom: 4px; }
.foot-brand img { display: block; }
.sitefoot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
.sitefoot a { color: var(--muted); display: inline-flex; min-height: 44px; align-items: center; }
@media (min-width: 1024px) { .sitefoot { padding-left: calc(var(--side) + 40px); } }

/* In-place updates */
.cm-leaving { transition: opacity .18s ease, transform .18s ease; opacity: 0; transform: translateY(-4px); }
.cm-entering { animation: cm-in .22s ease; }
@keyframes cm-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
