/* KHC web admin — mobile first (375px), the site's graphite tokens, system fonts (strict CSP: no web fonts). */
:root {
  --bg: #111318; --surface: #181b21; --surface-2: #1f232b; --ink: #dfe2e6; --ink-strong: #f4f5f7;
  --muted: #98a1ad; --line: #2a2f38; --line-strong: #3a4150; --accent: #f07b3c; --accent-ink: #f68d55;
  --accent-contrast: #16181d; --ok: #4fbf7f; --warn: #e5b53c; --bad: #e5604c;
  --radius: 12px; --tap: 44px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* Author display rules (.sheet flex, .tabs grid) would otherwise beat the UA [hidden] rule. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); min-height: 100vh; overflow-x: hidden; }
a { color: var(--accent-ink); }
h1, h2, h3 { color: var(--ink-strong); line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.1rem; margin-top: 24px; } h3 { font-size: 1rem; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.92em; word-break: break-all; }
.env-banner { background: var(--warn); color: #1a1a1a; text-align: center; font-weight: 700; font-size: 0.85rem; padding: 4px 8px; letter-spacing: 0.04em; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(17,19,24,0.94); border-bottom: 1px solid var(--line); }
.topbar-title { font-weight: 700; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view { overflow-wrap: anywhere; padding: 16px; padding-bottom: calc(88px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; color: var(--muted); text-decoration: none; font-size: 0.75rem; gap: 2px; }
.tabs a.active { color: var(--accent-ink); }
.tab-icon { font-size: 1.25rem; line-height: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
a.card { display: block; color: inherit; text-decoration: none; }
a.card:active { background: var(--surface-2); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row > * { min-width: 0; }
.row > .pill { flex: 0 0 auto; }
/* Card footers (id · date / seats): wrap whole items to a second line instead of splitting an id. */
.row.meta { flex-wrap: wrap; row-gap: 2px; }
.row.meta > * { white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: clamp(1.25rem, 6vw, 1.6rem); color: var(--ink-strong); }
a.stat { display: block; color: inherit; text-decoration: none; }
a.stat:active { background: var(--surface-2); }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--line-strong); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(79,191,127,0.4); }
.pill.warn { color: var(--warn); border-color: rgba(229,181,60,0.4); }
.pill.bad { color: var(--bad); border-color: rgba(229,96,76,0.4); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink-strong); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn.danger { color: var(--bad); border-color: rgba(229,96,76,0.5); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.btns .btn { flex: 1 1 auto; }
label { display: block; font-weight: 600; margin: 14px 0 6px; color: var(--ink-strong); }
input, textarea, select { width: 100%; min-height: var(--tap); font: inherit; font-size: 16px; color: var(--ink-strong); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search { margin-bottom: 12px; }
.segmented { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.segmented .btn { flex: 1 0 auto; padding: 0 10px; font-size: 0.875rem; }
.segmented .btn.active { border-color: var(--accent); color: var(--accent-ink); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; font: 0.85rem/1.4 var(--mono); white-space: pre-wrap; word-break: break-word; }
.secret { font: 700 1.15rem/1.3 var(--mono); color: var(--ink-strong); background: var(--surface-2); border: 1px dashed var(--accent); border-radius: 10px; padding: 14px; text-align: center; overflow-wrap: anywhere; user-select: all; } /* breaks at the hyphens, not mid-group */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,0.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet-panel { width: 100%; max-width: 560px; background: var(--surface); border-top-left-radius: 18px; border-top-right-radius: 18px; border: 1px solid var(--line); padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.toast { pointer-events: none; position: fixed; left: 16px; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 30; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; color: var(--ink-strong); text-align: center; }
.toast.bad { border-color: var(--bad); }
.list-empty { text-align: center; padding: 24px 0; color: var(--muted); }
.hero { text-align: center; padding: 40px 0; }
.hero img { width: 72px; height: 72px; margin-bottom: 16px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
