:root { --ink:#18211f; --muted:#5b6762; --line:#d9dfdb; --ground:#f5f6f3; --panel:#fff; --accent:#2e6b5a; --accent-soft:#dcebe5; --bad:#a63a2e;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { --ink:#e4e9e6; --muted:#98a39d; --line:#2b3430; --ground:#111513; --panel:#181e1b; --accent:#76c2a8; --accent-soft:#1e3a31; --bad:#e57d6f; color-scheme: dark; } }
* { box-sizing: border-box; }
/* Layout rules below set display; the hidden attribute must still win. */
[hidden] { display: none !important; }
body { margin:0; background:var(--ground); color:var(--ink); font:14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.bar { display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; padding:10px 16px; border-bottom:1px solid var(--line); background:var(--panel); }
.brand span { color:var(--muted); font-weight:400; }
.session { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.muted { color:var(--muted); }
.link { color:var(--accent); }
select, input, button, .button { font:inherit; color:inherit; border:1px solid var(--line); border-radius:4px; padding:5px 10px; background:var(--panel); }
button, .button { cursor:pointer; text-decoration:none; }
.button { background:var(--accent); color:#fff; border-color:var(--accent); display:inline-block; padding:8px 16px; }
.ghost:hover, .button:hover { filter:brightness(1.05); }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.signin { max-width:480px; margin:64px auto; padding:0 16px; display:flex; flex-direction:column; gap:12px; }
.error { color:var(--bad); }
.app { display:grid; grid-template-columns: 220px minmax(0,1fr); min-height: calc(100vh - 52px); }
.app.with-detail { grid-template-columns: 220px minmax(0,1fr) minmax(320px, 36%); }
.side { border-right:1px solid var(--line); padding:12px 16px; background:var(--panel); }
.side h2 { font-size:12px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:16px 0 6px; }
.side ul { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
.side li button { width:100%; display:flex; justify-content:space-between; border:0; background:none; padding:5px 8px; text-align:left; }
.side li button[aria-current="true"] { background:var(--accent-soft); color:var(--accent); }
.side .count { font-family:var(--mono); color:var(--muted); font-variant-numeric:tabular-nums; }
.module { display:flex; justify-content:space-between; align-items:center; padding:3px 0; gap:8px; }
.main { padding:12px 16px; min-width:0; display:flex; flex-direction:column; gap:10px; }
.toolbar { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.toolbar h1 { font-size:18px; margin:0; }
.table-wrap { overflow-x:auto; border:1px solid var(--line); background:var(--panel); }
table { border-collapse:collapse; width:100%; font-size:13px; }
th, td { text-align:left; padding:6px 10px; border-bottom:1px solid var(--line); white-space:nowrap; max-width:280px; overflow:hidden; text-overflow:ellipsis; }
th { color:var(--muted); font-weight:600; font-size:12px; background:var(--ground); }
tbody tr { cursor:pointer; }
tbody tr:hover { background:var(--accent-soft); }
.pager { display:flex; gap:12px; align-items:center; }
.detail { border-left:1px solid var(--line); background:var(--panel); padding:12px 16px; overflow:auto; max-height:calc(100vh - 52px); }
.detail-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.detail h2 { font-size:16px; margin:0; }
pre { font:12px/1.5 var(--mono); background:var(--ground); padding:10px; overflow:auto; white-space:pre-wrap; word-break:break-word; }
ol { padding-left:18px; font-size:13px; display:flex; flex-direction:column; gap:4px; }
.toast { position:fixed; bottom:16px; left:50%; transform:translateX(-50%); background:var(--ink); color:var(--ground); padding:8px 14px; border-radius:4px; max-width:calc(100% - 32px); }
@media (max-width: 800px) { .app, .app.with-detail { grid-template-columns: 1fr; } .side { border-right:0; border-bottom:1px solid var(--line); } }

.invites { display:flex; flex-direction:column; gap:6px; padding:10px 16px; background:var(--accent-soft); border-bottom:1px solid var(--line); }
.invites .row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.invite-form { display:flex; flex-wrap:wrap; gap:8px; align-items:end; margin:10px 0; }
.invite-form label { display:flex; flex-direction:column; gap:2px; font-size:12px; color:var(--muted); }
.invite-link { font:12px var(--mono); word-break:break-all; background:var(--ground); padding:8px; }
table.members td, table.members th { white-space:normal; }
ul.plain { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:4px; font-size:13px; }
.danger { color:var(--bad); }
