:root {
  --ink: #0b0b0b; --ink2: #52514e; --muted: #898781; --line: #e1e0d9; --surface: #fcfcfb; --card: #ffffff;
  --accent: #2a78d6; --accent-ink: #ffffff; --occupied: #fc6c85; --lunch: #d9d9d9; --head: #eaf3fa; --alert: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 15px; color: var(--ink);
  background: var(--surface); }
.topbar { display: flex; gap: 24px; align-items: center; padding: 12px 24px; background: var(--card);
  border-bottom: 1px solid var(--line); }
.brand { font-weight: 600; color: var(--ink); text-decoration: none; }
.topbar nav a { color: var(--ink2); text-decoration: none; }
.page { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; }
.foot { text-align: center; color: var(--muted); padding: 16px; }
h1 { font-size: 1.6rem; margin: 0 0 8px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.lead { color: var(--ink2); max-width: 760px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.alert { background: #fdecea; color: var(--alert); padding: 10px 14px; border-radius: 6px; }
.state { color: var(--ink2); font-style: italic; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  border-radius: 6px; padding: 8px 14px; font: inherit; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.label, .field label { display: block; font-weight: 600; margin-bottom: 4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin: 18px 0; }
.facts { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 12px 0; }
.facts div { min-width: 120px; } .facts dt { color: var(--muted); font-size: 0.85rem; } .facts dd { margin: 0; font-weight: 600; }
.warnings { color: var(--ink2); margin: 8px 0 16px; }
.inline { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline select { min-width: 320px; max-width: 100%; padding: 6px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 20px; }
.field input { width: 100%; padding: 7px 9px; border: 1px solid #c3c2b7; border-radius: 6px; font: inherit; }
.field small { display: block; color: var(--muted); margin-top: 3px; }
.field.key input { border-color: var(--accent); }
.field .err { display: block; color: var(--alert); font-size: 0.9rem; }
.actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }
table { border-collapse: collapse; }
.meta th { text-align: left; color: var(--ink2); font-weight: 600; padding: 4px 16px 4px 0; vertical-align: top; }
.meta td { padding: 4px 0; }
.scroll { overflow-x: auto; }
.tt th, .tt td { border: 1px solid #4ea3dc; padding: 6px 8px; text-align: center; font-size: 0.85rem; white-space: nowrap; }
.tt thead td { background: var(--head); } .tt th { background: var(--lunch); }
.tt td.occupied { background: var(--occupied); font-weight: 600; }
.tt td.lunch { background: var(--lunch); font-weight: 600; }
.sched th, .sched td { border: 1px solid #000; padding: 6px 10px; text-align: left; }
.sched thead th { background: var(--lunch); }
.rich { width: 100%; min-height: 300px; }
pre.source { white-space: pre-wrap; word-break: break-all; background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: 12px; font-size: 0.8rem; max-height: 70vh; overflow: auto; }
.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; }
.signout { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.who { color: var(--ink2); font-size: 0.9rem; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.msg { padding: 10px 14px; border-radius: 6px; background: #eef4fc; color: var(--ink); }
.msg.success { background: #e8f6ef; } .msg.warning { background: #fff6e0; } .msg.error { background: #fdecea; color: var(--alert); }
.narrow { max-width: 520px; }
.email-input { display: flex; align-items: stretch; border: 1px solid #c3c2b7; border-radius: 6px; overflow: hidden; background: #fff; }
.email-input input { flex: 1; border: 0; padding: 9px 10px; font: inherit; min-width: 0; }
.email-input span { background: #f0efec; color: var(--ink2); padding: 9px 10px; border-left: 1px solid #c3c2b7; }
.err { display: block; color: var(--alert); font-size: 0.9rem; margin-top: 4px; }
.titlebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack .field { margin-bottom: 14px; }
.flabel { display: block; font-weight: 600; margin-bottom: 4px; }
.fixed { display: block; padding: 7px 0; }
table.list { width: 100%; background: var(--card); border: 1px solid var(--line); }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.list thead tr.head th { background: #f0efec; white-space: nowrap; }
table.list thead button { background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; padding: 0; color: var(--ink); }
table.list thead th[aria-sort="ascending"] button::after { content: " \25B2"; font-size: 0.7em; }
table.list thead th[aria-sort="descending"] button::after { content: " \25BC"; font-size: 0.7em; }
table.list tr.filters td { padding: 4px 6px; background: #fafaf8; }
table.list tr.filters input { width: 100%; min-width: 80px; padding: 5px 7px; border: 1px solid #c3c2b7; border-radius: 4px; font: inherit; font-size: 0.85rem; }
table.list tbody tr:hover { background: #f7fafe; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 600px) { .topbar { padding: 10px 16px; flex-wrap: wrap; } .inline select { min-width: 0; width: 100%; } .signout { margin-left: 0; } }
