:root {
  color-scheme: light;
  --paper: #eee8df;
  --card: #fcf8f1;
  --ink: #251d27;
  --muted: #665d65;
  --line: #d8cecb;
  --action: #792f4b;
  --action-ink: #fff9fa;
  --soft: #eee1e8;
  --success: #29533f;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #a34f73; outline-offset: 3px; }
a { color: inherit; }
p, h1, h2, h3 { margin: 0; }
p { line-height: 1.55; }
h1, h2 { letter-spacing: -.035em; }
h1 { font-size: clamp(1.85rem, 7vw, 2.5rem); line-height: 1.15; }
h2 { font-size: 1.24rem; }

.shell { max-width: 510px; min-height: 100dvh; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; margin-bottom: 17px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.04rem; text-decoration: none; }
.mark { width: 19px; height: 19px; border: 2px solid currentColor; border-radius: 50%; position: relative; }
.mark::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--action); }
.mast-user { text-align: right; font-size: .83rem; color: var(--muted); line-height: 1.4; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 19px; padding: 19px; margin-bottom: 13px; }
.stack { display: flex; flex-direction: column; gap: 13px; }
.tight { gap: 8px; }
.muted { color: var(--muted); font-size: .89rem; }
.header-card { padding: 22px 20px; }
.header-card .muted { margin-top: 8px; }
.entry { background: #f8f1ed; border-top: 4px solid var(--action); padding: 23px 20px; }
.split { display: flex; gap: 9px; align-items: center; justify-content: space-between; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.primary, .secondary, .ghost { border-radius: 11px; min-height: 48px; padding: 10px 13px; font-weight: 650; border: 1px solid transparent; }
.primary { background: var(--action); color: var(--action-ink); }
.secondary { background: var(--soft); color: var(--ink); }
.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.small { font-size: .85rem; min-height: 36px; padding: 6px 10px; }
.wide { width: 100%; }
.field { display: grid; gap: 6px; font-size: .91rem; font-weight: 650; }
input:not([type=checkbox]), select { width: 100%; min-height: 48px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font-size: 16px; }
.code-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; }
.tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px; padding: 4px; background: var(--soft); border-radius: 13px; }
.tab { border: 0; min-height: 43px; color: var(--muted); border-radius: 9px; background: transparent; font-weight: 700; }
.tab[aria-pressed=true] { background: var(--card); color: var(--ink); }
.error, .status { padding: 10px 13px; line-height: 1.45; border-radius: 10px; font-size: .9rem; }
.error { color: #8c233b; background: #f9e5e9; }
.status { color: var(--success); background: #e7eee6; }
.table { min-height: 145px; }
.seats { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; }
.seat { display: grid; align-content: center; gap: 3px; min-height: 57px; text-align:center; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 4px; font-weight: 750; }
.seat span { font-size: .69rem; color: var(--muted); font-weight: 500; }
.seat.ready { background: #e5ede4; color: var(--success); border-color: #a6baa5; }
.seat[aria-pressed=true], .seat.mine { background: var(--action); color: var(--action-ink); border-color: var(--action); }
.seat.mine span, .seat[aria-pressed=true] span { color: #fff4f8; }
.seat.dead { opacity: .64; }
.consent { display: flex; align-items: start; gap: 9px; line-height: 1.45; font-size: .87rem; }
.consent input { width: 19px; height: 19px; accent-color: var(--action); flex: 0 0 19px; margin: 1px 0 0; }
.identity { background: #33283a; color: #fff6f2; border-color: #33283a; }
.identity .muted { color: #dfd2e0; }
.identity-name { font-size: 1.55rem; font-weight: 780; }
.identity .secondary { background: #e9dfea; color: #33283a; }
.identity .ghost { color: white; border-color: #8c7a90; }
.status-line { font-size: .88rem; color: var(--muted); font-weight: 600; }
.notices { margin: 0; padding-left: 20px; line-height: 1.5; }
.notices li + li { margin-top: 6px; }
.notification { padding: 9px 11px; background: #f1ddb3; color: #45331e; border-radius: 10px; font-weight: 650; font-size: .89rem; }
.night {
  color-scheme: dark;
  --paper: #25202c; --card: #332d3d; --ink: #fff5ef; --muted: #d0c4d5; --line: #65586c;
  --action: #e7a6be; --action-ink: #3b1529; --soft: #4b4054; --success: #c7ebd0;
}
.night .status, .night .seat.ready { background: #294a3a; color: #d2f5d6; border-color: #709a80; }
.night .error { background: #562b3e; color: #ffe2ed; }
.night .seat.mine span, .night .seat[aria-pressed=true] span { color: #40192c; }
.toast-area { position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 2; margin-top: 9px; }
@media (min-width: 550px) { .shell { padding-inline: 23px; } }
