:root {
  color-scheme: light dark;
  --bg: oklch(.965 .012 90); --card: oklch(.995 .004 90); --ink: oklch(.25 .03 300); --muted: oklch(.48 .03 300);
  --line: oklch(.87 .015 300); --accent: oklch(.47 .19 285); --on-accent: oklch(.99 .01 90); --danger: oklch(.50 .2 25);
  --insider: oklch(.72 .16 90); --justone: oklch(.55 .18 260); --ito: oklch(.68 .18 30); --ikyd: oklch(.65 .22 355);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(.19 .02 300); --card: oklch(.24 .025 300); --ink: oklch(.95 .01 90); --muted: oklch(.74 .03 300);
    --line: oklch(.36 .03 300); --accent: oklch(.78 .13 285); --on-accent: oklch(.19 .02 300); --danger: oklch(.74 .16 25);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 Kanit, sans-serif; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
.top, .tabs, main { width: min(100%, 900px); margin: 0 auto; padding: 0 16px; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding-top: calc(16px + env(safe-area-inset-top)); }
.top h1 { flex: 1 0 100%; font-size: 32px; font-weight: 700; line-height: 1.2; }
.back { order: -1; font-size: 15px; }
.who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 15px; }
button { min-height: 44px; padding: 8px 16px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; font-weight: 500; }
button:hover:not(:disabled) { border-color: var(--ink); }
button:disabled { opacity: .45; cursor: default; }
button.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
button.quiet { min-height: 36px; padding: 4px 12px; border-width: 1px; font-size: 14px; }
button.danger { color: var(--danger); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tabs { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; padding-bottom: 4px; }
.tabs button { display: flex; flex-direction: column; align-items: flex-start; flex: none; line-height: 1.25; }
.tabs small { font-size: 12px; font-weight: 400; color: var(--muted); }
.tabs [aria-current] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.tabs [aria-current] small { color: inherit; opacity: .75; }
main { display: grid; gap: 16px; padding-top: 16px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.panel, .card { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 16px; min-width: 0; }
.panel h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.card { border-top: 6px solid var(--game); }
.card h3 { font-size: 18px; font-weight: 700; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card p { color: var(--muted); font-size: 14px; }
.big { font-size: 40px; font-weight: 700; line-height: 1.2; color: var(--ink) !important; font-variant-numeric: tabular-nums; }
.big small { font-size: 15px; font-weight: 400; color: var(--muted); }
.live { color: var(--ink) !important; font-weight: 500; }
.live::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: oklch(.68 .19 150); }
.g-insider { --game: var(--insider); } .g-justone { --game: var(--justone); } .g-ito { --game: var(--ito); } .g-ikyd { --game: var(--ikyd); }
.dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: var(--game); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px 8px 0; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { font-size: 13px; font-weight: 500; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
.empty, .hint, .count { color: var(--muted); font-size: 15px; }
.summary { display: grid; gap: 10px; }
.meter { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; }
.meter p { grid-column: 1; }
.meter progress { grid-column: 1; width: 100%; height: 8px; accent-color: var(--game); }
.meter button { grid-column: 2; grid-row: 1 / 3; }
.add { display: grid; gap: 10px; }
.add label { font-size: 20px; font-weight: 700; }
textarea, input[type=search] { width: 100%; min-width: 0; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--bg); }
textarea { resize: vertical; min-height: 88px; }
.add button { justify-self: start; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; }
.tools input { flex: 1 1 200px; min-height: 44px; }
.seg { display: flex; }
.seg button { border-radius: 0; margin-left: -2px; padding: 8px 12px; font-weight: 400; }
.seg button:first-child { border-radius: 12px 0 0 12px; margin-left: 0; }
.seg button:last-child { border-radius: 0 12px 12px 0; }
.seg [aria-pressed=true] { position: relative; border-color: var(--ink); background: var(--ink); color: var(--bg); }
.count { margin: 12px 0 4px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .text { min-width: 0; overflow-wrap: anywhere; }
.tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.tags:empty { display: none; }
.tag { min-height: 32px; padding: 2px 10px; border: 1px solid var(--game); border-radius: 999px; background: color-mix(in oklch, var(--game) 16%, var(--card)); font-size: 13px; font-weight: 400; }
.locked h2 { color: var(--danger); }
.locked p + p { margin-top: 8px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: 0 6px 24px #0004; }
.toast button { min-height: 36px; padding: 2px 12px; border-color: currentColor; background: transparent; color: inherit; }
@media (min-width: 640px) { .rows li { grid-template-columns: 1fr auto auto; } .tags { grid-column: 2; grid-row: 1; justify-content: flex-end; } .rows .danger { grid-column: 3; } .top h1 { flex: 0 0 auto; order: -1; } .back { order: 0; } .who { text-align: right; } }
