:root {
  --bg: #faf9f5; --panel: #ffffff; --fg: #1f1e1d; --muted: #6b6a66; --line: #e6e3da;
  --accent: #c96442; --accent-fg: #ffffff; --ok: #2f7d4f; --warn: #a3620a; --bad: #b3261e;
  --hover: #f3f1ea; --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1b19; --panel: #262523; --fg: #ecebe6; --muted: #a4a29b; --line: #3a3935;
    --accent: #e0805e; --accent-fg: #1c1b19; --ok: #6cc08b; --warn: #e0a64a; --bad: #f08a80;
    --hover: #2f2e2b; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font: 400 28px/1.2 Georgia, "Times New Roman", serif; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-weight: 600; }
.top nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.top nav a { color: var(--fg); text-decoration: none; }
.top nav form { margin: 0; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent);
  color: var(--accent-fg); font-size: 12px; text-align: center; }

.wrap { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.flash { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--ok); padding: 10px 14px; border-radius: var(--radius); }
.error { color: var(--bad); }

button, select, input, textarea { font: inherit; color: inherit; }
button { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; cursor: pointer; }
button:hover { background: var(--hover); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
button.danger { color: var(--bad); }
button.link { background: none; border: 0; padding: 0; color: var(--fg); }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.filters select { width: auto; max-width: 100%; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg a { padding: 7px 12px; color: var(--fg); text-decoration: none; background: var(--panel); }
.seg a.on { background: var(--fg); color: var(--bg); }

.group { margin-bottom: 28px; }
.group h2 .muted { font-weight: 400; }
.list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.list li + li { border-top: 1px solid var(--line); }
.item { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; color: var(--fg); text-decoration: none; }
.item:hover { background: var(--hover); }
.item .title { font-weight: 600; font-size: 16px; }
.item .desc { color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); align-items: center; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg); font-size: 12px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.narrow { max-width: 420px; margin: 24px auto; }
.card h1 { margin-bottom: 12px; }
.card h2 { margin-top: 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.secret { font-size: 18px; padding: 6px 10px; background: var(--hover); border-radius: 6px; user-select: all; }

.users { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.u { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.u.st-pending { border-left: 3px solid var(--accent); }
.u.st-blocked, .u.st-rejected { opacity: .7; }
.who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.note { font-size: 14px; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.acts form { margin: 0; }

body.viewer { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
body.viewer .top { display: none; }
.vbar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.vbar .back { font-size: 20px; text-decoration: none; color: var(--fg); }
.vtitle { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.vtitle strong, .vtitle span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vtitle span { font-size: 13px; }
.vbar .open { white-space: nowrap; font-size: 14px; }
.frame { flex: 1; width: 100%; border: 0; background: var(--bg); }
