/* Toki design tokens (docs/spec/21 §5.4): dense, neutral, one cyan accent. */
:root {
  --toki-ink: #0f172a;
  --toki-ink-soft: #475569;
  --toki-bg: #ffffff;
  --toki-surface: #f8fafc;
  --toki-line: #e2e8f0;
  --toki-accent: #0e7490;
  --toki-on-accent: #ffffff;
  --toki-chip: #ecfeff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --toki-ink: #e6edf3;
    --toki-ink-soft: #9aa7b4;
    --toki-bg: #0b0f14;
    --toki-surface: #121821;
    --toki-line: #222c38;
    --toki-accent: #22d3ee;
    --toki-on-accent: #0b0f14;
    --toki-chip: #0f2a31;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 15px; line-height: 1.6; color: var(--toki-ink); background: var(--toki-bg);
  -webkit-text-size-adjust: 100%;
}
a { color: var(--toki-accent); }
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
:focus-visible { outline: 2px solid var(--toki-accent); outline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -0.18em; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--toki-bg); padding: 8px 12px; }

.top {
  position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--toki-bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--toki-line);
  padding-top: env(safe-area-inset-top);
}
.top-row, .tabs, .filter, .timeline, .foot { max-width: 640px; margin: 0 auto; padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); }
.top-row { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 6px; }
.logo { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.logo a { color: var(--toki-ink); text-decoration: none; }
.logo a::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; background: var(--toki-accent); vertical-align: 2px; }
.tagline { margin: 0; font-size: 12px; color: var(--toki-ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.density { border: 1px solid var(--toki-line); background: transparent; border-radius: 999px; padding: 4px 10px; font-size: 12px; min-height: 32px; }
.density[aria-pressed="true"] { background: var(--toki-accent); color: var(--toki-on-accent); border-color: var(--toki-accent); }

.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
  border: 0; border-bottom: 3px solid transparent; background: none; font-weight: 600; color: var(--toki-ink-soft);
}
.tab.on { color: var(--toki-ink); border-bottom-color: var(--toki-accent); }
.count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--toki-accent); color: var(--toki-on-accent); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.filter { display: flex; align-items: center; gap: 8px; padding-top: 6px; padding-bottom: 8px; font-size: 13px; }
.filter[hidden] { display: none; }
.filter .clear { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; border: 1px solid var(--toki-line); background: var(--toki-surface); border-radius: 999px; padding: 4px 10px; min-height: 32px; }

.pill-wrap { position: sticky; top: calc(110px + env(safe-area-inset-top)); z-index: 9; height: 0; display: flex; justify-content: center; }
.new-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 8px 16px; min-height: 40px;
  border: 0; border-radius: 999px; background: var(--toki-accent); color: var(--toki-on-accent); font-weight: 700;
  box-shadow: 0 4px 14px rgb(0 0 0 / 18%);
}
.new-pill[hidden] { display: none; }

.timeline { padding-bottom: 8px; }
.posts { list-style: none; margin: 0; padding: 0; }
.post { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--toki-line); outline: none; }
.post:focus-visible { box-shadow: inset 3px 0 0 var(--toki-accent); background: var(--toki-surface); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #fff; }
.c0 { background: #0e7490; } .c1 { background: #7c3aed; } .c2 { background: #b45309; } .c3 { background: #be123c; }
.c4 { background: #15803d; } .c5 { background: #1d4ed8; } .c6 { background: #a21caf; } .c7 { background: #4d7c0f; }
.c8 { background: #9f1239; } .c9 { background: #0369a1; } .c10 { background: #6d28d9; } .c11 { background: #c2410c; }
.body { min-width: 0; }
.head { display: flex; align-items: center; gap: 8px; }
.org { border: 0; background: none; padding: 0; font-weight: 700; text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org:hover { text-decoration: underline; }
.watch {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px;
  border: 1px solid var(--toki-line); border-radius: 999px; background: transparent; font-size: 12px; color: var(--toki-ink-soft);
}
.watch.on { color: var(--toki-accent); border-color: var(--toki-accent); font-weight: 700; }
.when { margin: 2px 0 4px; font-size: 13px; color: var(--toki-ink-soft); font-variant-numeric: tabular-nums; }
.kinds { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.kind { padding: 0 6px; border-radius: 4px; border: 1px solid var(--toki-line); font-size: 11px; line-height: 18px; }
.title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.title a { color: var(--toki-ink); text-decoration: none; }
.title a:hover { text-decoration: underline; }
.lead { margin: 4px 0 0; overflow-wrap: anywhere; }
.figs { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; }
.fig { padding: 3px 8px; border-radius: 6px; background: var(--toki-chip); font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fig-label { color: var(--toki-ink-soft); }
.tags { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 6px 0 0; }
.tag { border: 0; background: none; padding: 2px 0; color: var(--toki-accent); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-top: 8px; font-size: 13px; color: var(--toki-ink-soft); }
.read a { margin-right: 8px; font-weight: 600; }
.src { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.act { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--toki-ink-soft); }
.act:hover { background: var(--toki-surface); color: var(--toki-ink); }

.line { display: flex; align-items: center; gap: 10px; padding: 10px 0; color: var(--toki-accent); font-size: 12px; font-weight: 700; }
.line::before, .line::after { content: ""; flex: 1; height: 1px; background: var(--toki-accent); }

.compact .lead, .compact .figs, .compact .tags { display: none; }
.compact .post { padding: 10px 0; }

.status { padding: 16px 0; color: var(--toki-ink-soft); font-size: 13px; text-align: center; }
.foot { padding-top: 16px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--toki-line); font-size: 12px; color: var(--toki-ink-soft); }
.foot p { margin: 0 0 8px; }
.link-btn, .unmute { border: 0; background: none; padding: 2px 4px; color: var(--toki-accent); text-decoration: underline; font-size: 12px; }
.keys { display: none; }
@media (hover: hover) and (pointer: fine) { .keys { display: block; } }
.static { padding: 16px 0; }
.static li { margin-bottom: 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 30; transform: translate(-50%, 12px);
  padding: 10px 16px; border-radius: 8px; background: var(--toki-ink); color: var(--toki-bg); font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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