:root {
  color-scheme: light;
  --bg: #f4f4f2; --surface: #fcfcfb; --surface-2: #efeee9; --border: #dedcd5;
  --text: #0b0b0b; --text-2: #52514e; --muted: #7a7972;
  --accent: #2a78d6; --accent-ink: #ffffff;
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --bad: #d03b3b;
  --good-ink: #006300; --bad-ink: #a32626; --warn-ink: #7a5300;
  --radius: 10px; --shadow: 0 1px 2px rgb(0 0 0 / 6%);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211; --surface: #1a1a19; --surface-2: #242422; --border: #34332f;
    --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8e86;
    --accent: #3987e5; --good-ink: #5fd15f; --bad-ink: #ff8a8a; --warn-ink: #ffcf66;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #242422; --border: #34332f;
  --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8e86;
  --accent: #3987e5; --good-ink: #5fd15f; --bad-ink: #ff8a8a; --warn-ink: #ffcf66;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 14px 0 6px; }
.sub { color: var(--text-2); margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
nav.side { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 10px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; }
nav.side .brand { font-weight: 700; font-size: 16px; padding: 4px 10px 14px; }
nav.side a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text); }
nav.side a:hover { background: var(--surface-2); text-decoration: none; }
nav.side a.on { background: var(--surface-2); font-weight: 600; }
nav.side .grow { flex: 1; }
.count { background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 11px; padding: 0 7px; min-width: 18px; text-align: center; }
main { padding: 24px 28px 60px; max-width: 1240px; width: 100%; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.tile .label { color: var(--text-2); font-size: 12px; }
.tile .value { font-size: 24px; font-weight: 650; margin-top: 2px; }
.tile .delta { font-size: 12px; margin-top: 2px; }
.up { color: var(--good-ink); } .down { color: var(--bad-ink); }

button, .btn { font: inherit; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
button:hover { background: var(--surface-2); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--bad-ink); border-color: var(--bad); }
button:disabled { opacity: .55; cursor: default; }
button.chip { border-radius: 999px; padding: 3px 11px; font-size: 13px; }
button.chip.on { background: var(--text); color: var(--surface); border-color: var(--text); }
input, textarea, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
input[type=text], input[type=number], input[type=password], input:not([type]) { min-width: 0; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
label.field input, label.field textarea, label.field select { font-size: 14px; color: var(--text); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.good { color: var(--good-ink); border-color: var(--good); }
.badge.bad { color: var(--bad-ink); border-color: var(--bad); }
.shot { width: 100%; max-width: 420px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.check { display: inline-flex; align-items: center; gap: 6px; }
.note { margin: 0; font-size: 12px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); color: var(--text-2); }
.note.good { color: var(--good-ink); border-color: var(--good); }
.note.warn { color: var(--warn-ink); border-color: var(--warn); }
.badge.warn { color: var(--warn-ink); border-color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.good { background: var(--good); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }

.post { border-left: 3px solid var(--border); }
.post.good { border-left-color: var(--good); } .post.bad { border-left-color: var(--bad); } .post.warn { border-left-color: var(--warn); }
.post.digest { border-left-color: var(--accent); }
.post .meta { color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.post h2 { margin: 6px 0; }
.md p { margin: 0 0 8px; } .md ul { margin: 0 0 8px; padding-left: 20px; } .md h2, .md h3 { margin: 12px 0 4px; font-size: 14px; }
.chat { display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 9px 12px; border-radius: 10px; max-width: 92%; white-space: normal; }
.msg.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.msg.assistant { align-self: flex-start; background: var(--surface-2); }
.typing { color: var(--muted); font-style: italic; }

.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.asset { padding: 0; overflow: hidden; display: flex; flex-direction: column; color: var(--text); }
.asset:hover { text-decoration: none; border-color: var(--accent); }
.asset img, .asset .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--surface-2); display: block; }
.asset .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.asset .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset .stats { color: var(--text-2); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { width: 120px; height: 120px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; color: var(--text-2); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

.chart { width: 100%; height: auto; display: block; color: var(--accent); }
.chart .grid line { stroke: var(--border); }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .hit:hover + .tip, .chart .hit:hover { opacity: 1; }
.chart-tip { position: fixed; pointer-events: none; background: var(--text); color: var(--surface); padding: 4px 8px; border-radius: 6px; font-size: 12px; z-index: 50; }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: 10px; max-width: 420px; z-index: 60; box-shadow: 0 4px 18px rgb(0 0 0 / 25%); }
.toast.bad { background: var(--bad); color: #fff; }
dialog { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); padding: 18px; max-width: 520px; width: calc(100% - 32px); }
dialog::backdrop { background: rgb(0 0 0 / 40%); }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
pre { background: var(--surface-2); padding: 10px; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.login { max-width: 360px; margin: 12vh auto; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  nav.side { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; }
  nav.side .brand, nav.side .grow { display: none; }
  nav.side a { white-space: nowrap; }
  main { padding: 16px; }
  .feed-layout, .g2, .g3, .g4 { grid-template-columns: 1fr; }
}
.chart .pt { stroke: var(--surface); stroke-width: 2px; }

[hidden] { display: none !important; }
/* "Sign in with Roblox": a connector-style button, the Roblox mark then the words */
.btn.connector { display: flex; align-items: center; justify-content: center; gap: 10px; height: 42px; font-weight: 600; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.btn.connector:hover { background: var(--surface-2); text-decoration: none; }
.btn.connector[hidden] { display: none; }
