:root {
  --bg: #f6f5f2; --surface: #fff; --surface-2: #f0eee9; --text: #1d1c1a; --muted: #6b6862;
  --border: #e3e0d9; --accent: #d9622b; --accent-ink: #fff; --accent-soft: #fbe7dc; --link: #a6461a;
  --warn-bg: #fff6e0; --warn-ink: #6b4b00; --ok: #1f7a3d; --bad: #b3261e;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 8px 24px rgb(0 0 0 / .06); --radius: 14px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412; --surface: #1d1c1a; --surface-2: #262522; --text: #ecebe7; --muted: #a09d96;
    --border: #33312d; --accent: #ef7d45; --accent-ink: #1a0d05; --accent-soft: #3a2418; --link: #f39a6c;
    --warn-bg: #2d2614; --warn-ink: #e8cf8f; --ok: #6fd08f; --bad: #ff8a80;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .3);
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 960px; margin: 0 auto; padding: 28px 16px 48px; }
a { color: var(--link); }
h1, h2 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; margin-bottom: 8px; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.top { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; border-radius: 11px; flex: none; background: var(--accent) url("/static/icon.svg") center / 100% no-repeat; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
main { margin-top: 22px; display: grid; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card.center { padding: 40px 24px; }
.card.center p { max-width: 460px; margin-left: auto; margin-right: auto; }
.latest { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; border-top: 4px solid var(--accent); }
.eyebrow { display: block; text-transform: uppercase; font-size: .72rem; letter-spacing: .08em; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.hello { font-size: 1.15rem; margin: 0; }
.notice { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-size: .88rem; }
.ok { color: var(--ok); font-weight: 600; }
.error { color: var(--bad); font-weight: 600; }
.steps { margin: 0; padding-left: 1.3em; }
.steps li { margin: 6px 0; }

button, .btn {
  font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); padding: 8px 16px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button:hover, .btn:hover { border-color: var(--muted); }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; font-size: 1.05rem; padding: 12px 26px; border-radius: 12px; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { padding: 4px 10px; font-size: .82rem; }
.btn.danger { color: var(--bad); }
.btn.disabled { opacity: .6; cursor: not-allowed; }
.card.center form { margin: 22px 0 14px; }

input, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; width: 100%; }
textarea { resize: vertical; }
.feedback { display: grid; gap: 10px; justify-items: start; }
.feedback label { font-weight: 500; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; margin-top: 8px; }
.grid-form label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.grid-form .wide, .grid-form .check { grid-column: 1 / -1; }
.grid-form .check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: .9rem; }
.grid-form .check input { width: auto; }
.grid-form button { justify-self: start; }
.inline { display: inline; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-family: var(--mono); font-size: .85rem; }
.created { border-top: 4px solid var(--ok); }

.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .75rem; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.state { font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.state.joined { background: var(--accent-soft); color: var(--link); }
.state.opened { color: var(--ok); }
.state.expired, .state.revoked { color: var(--muted); text-decoration: line-through; }
.fb { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fb li { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; }
.fb p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .latest { grid-template-columns: 1fr; }
  .latest .btn.primary { width: 100%; }
  .grid-form { grid-template-columns: 1fr; }
}
