:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --surface: #f5f5f5;
  --accent: #1a4d38;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --ease: 150ms ease-out;
  --radius: 4px;
  --radius-card: 6px;
  --shadow: 0 8px 24px rgba(10, 10, 10, 0.12);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --ink: #f5f5f5;
    --muted: #8a8a8a;
    --line: #262626;
    --surface: #141414;
    --accent: #1a4d38;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --surface: #f5f5f5;
  --accent: #1a4d38;
  --shadow: 0 8px 24px rgba(10, 10, 10, 0.12);
  color-scheme: light;
}

:root[data-theme="light"] .logo-light { display: block; }
:root[data-theme="light"] .logo-dark { display: none; }

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --ink: #f5f5f5;
  --muted: #8a8a8a;
  --line: #262626;
  --surface: #141414;
  --accent: #1a4d38;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 40px; }
h2 { font-size: 28px; }
h3 { font-size: 20px; }
p { margin: 0; max-width: 65ch; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
input, textarea, select { cursor: text; }
select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono, .meta, code, kbd {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.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;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  min-height: 64px;
}
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 32px; width: auto; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

.tab {
  background: none; border: 0; padding: 8px 0;
  font-size: 16px; font-weight: 500; flex: none;
  border-bottom: 1px solid transparent;
}
.tab:hover { color: var(--accent); }
.tab[aria-current="page"] { border-bottom-color: var(--ink); color: var(--ink); }

.nav-search { flex: 1; min-width: 0; }
.nav-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  background: var(--bg);
  font-size: 14px;
}
.nav-search input:hover { border-color: var(--ink); }

.plus {
  width: 32px; height: 32px; border-radius: var(--radius);
  background: var(--ink); color: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex: none; margin-left: auto;
  position: relative;
  font-size: 0; line-height: 0;
  transition: background var(--ease), color var(--ease);
}
.plus::before,
.plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.plus::before { width: 12px; height: 2px; }
.plus::after { width: 2px; height: 12px; }
.plus:hover { background: var(--accent); color: #fff; }

.bell {
  position: relative; display: grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
  text-decoration: none; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
}
.bell:hover { border-color: var(--ink); }
.unread {
  position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff;
  font-family: var(--mono); font-size: 10px; min-width: 16px; height: 16px;
  border-radius: 8px; display: grid; place-items: center; padding: 0 4px;
}
.notes { list-style: none; padding: 0; margin: 24px 0; }
.note { border-bottom: 1px solid var(--line); padding: 12px 0; }
.note a { color: inherit; text-decoration: none; }
.note.unread strong { box-shadow: inset 3px 0 0 var(--accent); padding-left: 8px; }
.banner { background: var(--ink); color: var(--bg); text-align: center; padding: 8px 12px; font-size: 14px; }
table.grid { width: 100%; border-collapse: collapse; margin: 16px 0; }
table.grid th, table.grid td { border: 1px solid var(--line); padding: 8px; text-align: left; font-size: 13px; }
.mono.small { font-family: var(--mono); font-size: 12px; }
.stats-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.policy { max-width: 640px; }

.acct { display: flex; gap: 8px; align-items: center; position: relative; }
.avatar {
  width: 32px; height: 32px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font-weight: 700; font-size: 12px;
  font-family: var(--mono); display: grid; place-items: center; padding: 0; line-height: 1;
}
.avatar:hover { border-color: var(--ink); color: var(--ink); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; display: grid; gap: 4px; z-index: 20; box-shadow: var(--shadow);
}
.menu[hidden] { display: none; }
.menu a, .menu button {
  width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 12px; font-size: 14px; border-radius: var(--radius);
}
.menu a:hover, .menu button:hover { background: var(--surface); color: var(--ink); }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 14px;
}
.nav-toggle:hover { border-color: var(--ink); color: var(--ink); }
.nav-drawer {
  display: none;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 16px;
}
.nav-drawer a, .nav-drawer button {
  display: block; width: 100%; text-align: left;
  padding: 12px 0; border: 0; background: none;
  border-bottom: 1px solid var(--line); font-size: 16px;
}
.nav-drawer[hidden] { display: none; }

.help-overlay {
  position: fixed; inset: 0; background: rgba(10, 10, 10, 0.45);
  z-index: 30; display: grid; place-items: center; padding: 24px;
}
.help-overlay[hidden] { display: none; }
.help-card {
  background: var(--bg); color: var(--ink); max-width: 520px; width: 100%;
  max-height: min(88vh, 720px); overflow: auto;
  border-radius: var(--radius-card); padding: 24px;
  display: grid; gap: 12px; border: 1px solid var(--line);
}
.help-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.help-body { display: grid; gap: 12px; }
.help-body h3 { font-size: 16px; margin-top: 8px; }
.help-body p { color: var(--muted); }

.btn {
  border: 1px solid var(--line); background: var(--bg); border-radius: var(--radius);
  padding: 8px 16px; font-weight: 500; font-size: 14px;
  display: inline-block; transition: border-color var(--ease), background var(--ease), color var(--ease);
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.approve { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.home { padding: 64px 0 48px; max-width: 720px; }
.home h1 { font-size: 40px; margin-bottom: 16px; }
.askbox {
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  gap: 12px;
  background: var(--bg);
}
.askbox textarea {
  border: 0; background: transparent; resize: none;
  font-size: 20px; min-height: 64px; outline: none; width: 100%;
  caret-color: var(--ink); line-height: 1.4;
}
.askbox .row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.examples {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  margin-top: 16px; font-size: 14px; max-width: none;
}
.examples a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.examples a:hover { color: var(--accent); }

.tabs {
  display: flex; flex-wrap: nowrap; gap: 0; overflow-x: auto;
  border-bottom: 1px solid var(--line); margin: 0 -4px;
}
.tabs a, .tabs button {
  flex: none; background: none; border: 0;
  padding: 12px 12px 10px; font-size: 14px; color: var(--muted);
  border-bottom: 1px solid transparent; margin-bottom: -1px;
  white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--accent); }
.tabs a[aria-pressed="true"],
.tabs a[aria-current="page"],
.tabs button[aria-pressed="true"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 14px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line);
}
.field-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.type-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.type-pick[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.block { display: grid; gap: 16px; padding-block: 32px; }
.blockhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.linkbtn {
  background: none; border: 0; padding: 0; color: var(--muted); font-size: 14px;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.linkbtn:hover { color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  display: grid;
  gap: 8px;
  align-content: start;
  background: var(--bg);
  min-width: 0;
  overflow: hidden;
  min-height: 148px;
  transition: border-color var(--ease);
}
.card:hover { border-color: var(--ink); color: var(--ink); }
.card h3 {
  font-size: 16px; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card p {
  font-size: 14px; color: var(--muted); max-width: none;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1;
  overflow: hidden; overflow-wrap: anywhere;
}
.kind {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.kind-wrap { display: grid; gap: 4px; }
.hint { font-size: 12px; color: var(--muted); max-width: 48ch; font-weight: 400; }
.kind.has-tip {
  position: relative;
  cursor: help;
  display: inline-block;
}
.kind.has-tip .tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 6;
  width: 240px;
  padding: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.4;
  box-shadow: var(--shadow);
}
.kind.has-tip:hover .tip, .kind.has-tip:focus .tip, .kind.has-tip:focus-visible .tip { display: block; }
.card .stats {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stats { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.ok { color: var(--accent); font-weight: 500; }

.chart { border-top: 1px solid var(--line); }
.chart-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.chart-row:hover { color: var(--ink); }
.chart-row .n { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.chart-row h3 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-row .kind { margin-bottom: 4px; }
.chart-row p { font-size: 14px; color: var(--muted); max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-row .meta { font-size: 12px; color: var(--muted); white-space: nowrap; }

.banner {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.drop {
  border: 1px dashed var(--ink);
  border-radius: var(--radius-card);
  padding: 32px 16px;
  text-align: center;
  background: var(--bg);
  display: grid;
  gap: 12px;
  justify-items: center;
}
.drop textarea {
  min-height: 160px; border: 0; background: transparent;
  width: 100%; resize: vertical; font-size: 16px; text-align: left;
}
.drop.guessing .mark { animation: antpulse 160ms ease-out infinite alternate; }
.mark { width: 40px; height: 40px; }
.mark img { width: 40px; height: 40px; }

@keyframes antpulse {
  from { opacity: 1; }
  to { opacity: 0.35; }
}

details.more { color: var(--muted); font-size: 14px; }
details.more summary { cursor: pointer; }
.pagehead { display: grid; gap: 8px; padding-top: 32px; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.dash-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  display: grid;
  gap: 8px;
}
.dash-stat .n {
  font-family: var(--font);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.dash-list { border-top: 1px solid var(--line); }
.dash-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.dash-row:hover { color: var(--ink); }
.dash-row h3 { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row p { font-size: 14px; color: var(--muted); max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row .kind { margin-bottom: 4px; }
.dash-row .meta { font-size: 12px; color: var(--muted); white-space: nowrap; }

.pricing { display: grid; gap: 24px; padding-block: 48px; max-width: 920px; }
.plan-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.plan-badge {
  position: absolute; bottom: -6px; right: -6px;
  font-size: 9px; font-family: var(--mono); font-weight: 500;
  background: var(--accent); color: #fff; padding: 1px 4px; border-radius: 2px;
}
.avatar { position: relative; }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.upgrade-panel {
  border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 16px; display: grid; gap: 12px; max-width: 520px;
}
.wait { color: var(--accent); }
.faq h4 { margin: 16px 0 4px; font-size: 16px; }
.plan-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.plan-card-pro { border-color: var(--ink); }
.plan-price { font-size: 20px; font-weight: 500; margin: 0; }
.plan-price .n {
  font-family: var(--font);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.plan-price .u { color: var(--muted); font-size: 14px; font-weight: 400; }
.btn.pro { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.pro:hover { filter: brightness(1.08); color: #fff; }
.plan-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); }
.plan-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.plan-table th, .plan-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  max-width: 28ch;
}
.plan-table th[scope="row"] { font-weight: 500; color: var(--ink); max-width: 22ch; }
.plan-table thead th { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 500; }
.plan-table tbody tr:last-child th,
.plan-table tbody tr:last-child td { border-bottom: 0; }

.item { display: grid; gap: 24px; padding-block: 48px; max-width: 680px; }
.item h1 { font-size: 40px; max-width: 20ch; }
.byline { font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lede { font-size: 16px; color: var(--ink); }
.content {
  font-size: 14px; white-space: pre-wrap; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 16px; overflow-x: auto; line-height: 1.6; max-width: none;
}
.content.mono { font-family: var(--mono); font-size: 13px; }
.panel { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field[hidden] { display: none; }
.field label { font-size: 12px; font-weight: 500; color: var(--muted); }
.field input, .field textarea, .field select {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 12px; background: var(--bg); width: 100%;
}
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--ink); }
.field textarea { min-height: 120px; resize: vertical; }
#summary { min-height: 72px; max-height: 96px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.vote { display: flex; gap: 8px; flex-wrap: wrap; }
.vote button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.comments { display: grid; gap: 24px; padding-top: 8px; }
.comment { display: grid; gap: 8px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.comment .who { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.comment.reply { margin-left: 24px; }
.warn, .notice, .earn {
  font-size: 14px; color: var(--muted); padding: 0; background: none; border: 0;
}

.upload { max-width: 640px; display: grid; gap: 16px; padding-block: 48px; }
.upload form { display: grid; gap: 16px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 8px 16px; border-radius: var(--radius); font-size: 14px; z-index: 10;
}
footer {
  margin-top: 64px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--mono);
}
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }
.empty {
  padding: 48px 16px; text-align: center; color: var(--muted);
  display: grid; gap: 16px; justify-items: center;
}
.empty .mark { margin-bottom: 8px; }
.preview-img { width: 100%; height: 200px; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.auth { max-width: 400px; margin: 48px 0; display: grid; gap: 16px; }
.status { font-size: 14px; min-height: 1.2em; }
.status.error { color: var(--accent); }
.hl-tag { color: var(--ink); font-weight: 500; }
.hl-attr { color: var(--muted); }

.lost { padding: 96px 0; display: grid; gap: 16px; justify-items: start; max-width: 480px; }
.lost h1 { font-size: 28px; }

.sk {
  background: var(--surface);
  border-radius: var(--radius);
  min-height: 16px;
}
.sk-line { height: 16px; width: 100%; }
.sk-title { height: 28px; width: 60%; margin-bottom: 16px; }
.sk-ask { height: 120px; width: min(720px, 100%); }
.sk-card { height: 148px; border: 1px solid var(--line); background: var(--bg); }
.load {
  padding: 48px 0;
  display: grid;
  gap: 16px;
  justify-items: start;
}
.load .mark { animation: antpulse 180ms ease-out infinite alternate; }

@media (max-width: 768px) {
  .wrap { padding: 0 16px 48px; }
  .acct { display: none; }
  .nav-toggle { display: inline-grid; }
  .nav-drawer:not([hidden]) { display: block; }
  .plus { margin-left: 0; }
  .grid { grid-template-columns: 1fr 1fr; }
  .home { padding-top: 32px; }
  .home h1, .item h1 { font-size: 28px; }
  .chart-row { grid-template-columns: 40px minmax(0, 1fr); }
  .chart-row .meta { grid-column: 2; }
  .dash-stats { grid-template-columns: 1fr; }
  .dash-row { grid-template-columns: minmax(0, 1fr); }
  .dash-row .meta { grid-column: 1; }
  .plan-cols { grid-template-columns: 1fr; }
  .plan-cols-3 { grid-template-columns: 1fr; }
  .plan-table th, .plan-table td { max-width: none; }
}

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
}

@media (min-width: 1440px) {
  .wrap { max-width: 1200px; }
}

iframe.screen {
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--line);
  background: var(--surface);
}
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
