:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-muted: #e9efed;
  --text: #14201d;
  --text-muted: #5c6d68;
  --line: #d4ddda;
  --primary: #0f766e;
  --idle: #548078;
  --active: #0f766e;
  --ending: #a15c00;
  --overtime: #b42318;
  --paused: #536176;
  --radius: 14px;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100dvh; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
button { font: inherit; }
.skip-link { position: fixed; left: 1rem; top: 1rem; z-index: 10; padding: .75rem 1rem; background: var(--text); color: white; border-radius: 8px; transform: translateY(calc(-100% - 2rem)); }
.skip-link:focus { transform: translateY(0); }
.topbar, main, footer { width: min(1480px, calc(100% - 40px)); margin-inline: auto; }
.topbar { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 5px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.04em; line-height: 1.1; }
.sync-state { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-muted); font-size: 14px; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ending); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ending) 13%, transparent); }
.sync-state.online .sync-dot { background: var(--active); box-shadow: 0 0 0 4px color-mix(in srgb, var(--active) 13%, transparent); }
.sync-state.stale .sync-dot, .sync-state.error .sync-dot { background: var(--overtime); box-shadow: 0 0 0 4px color-mix(in srgb, var(--overtime) 13%, transparent); }
main { padding-block: 24px 40px; }
.login-panel { max-width: 760px; margin: 8vh auto; padding: clamp(24px, 5vw, 48px); display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 18px 60px rgba(25, 53, 43, .1); }
.login-panel h2 { margin: 8px 0; font-size: clamp(1.7rem, 4vw, 2.5rem); }.login-panel p { color: var(--text-muted); line-height: 1.6; }
.login-form { display: grid; gap: 14px; }.login-form label { display: grid; gap: 6px; color: #33443e; font-weight: 650; }
.login-form input { min-height: 48px; padding: 0 13px; border: 1px solid #aebdb7; border-radius: 10px; font: inherit; background: #fff; }.login-form input:focus { outline: 3px solid rgba(30, 121, 87, .2); border-color: #1e7957; }
.login-form button { min-height: 48px; border: 0; border-radius: 10px; background: #176b4d; color: #fff; font: inherit; font-weight: 750; cursor: pointer; }.login-form button:hover { background: #10563d; }.login-error { margin: 0; color: #a13931 !important; font-weight: 650; }
.summary { display: flex; align-items: center; gap: 8px 24px; padding: 11px 14px; border-block: 1px solid var(--line); }
.metric { min-width: 0; display: inline-flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.metric span { color: var(--text-muted); font-size: 13px; font-weight: 650; }
.metric strong { font-size: 22px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric:nth-child(1) strong { color: var(--active); }
.metric:nth-child(2) strong { color: var(--idle); }
.metric:nth-child(3) strong { color: var(--ending); }
.metric:nth-child(4) strong { color: var(--paused); }
.metric small { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 18px 2px; color: var(--text-muted); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-mark { width: 9px; height: 9px; border-radius: 3px; background: var(--idle); }
.legend-mark.active { background: var(--active); }.legend-mark.ending { background: var(--ending); }.legend-mark.overtime { background: var(--overtime); }.legend-mark.paused { background: var(--paused); }
.board { display: grid; gap: 28px; }
.group-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.group-header h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.group-header span { color: var(--text-muted); font-size: 13px; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 10px; }
.table-card { position: relative; min-height: 178px; display: flex; flex-direction: column; padding: 13px 14px; overflow: hidden; border: 1px solid #ccd8d4; border-radius: var(--radius); background: #edf3f1; box-shadow: 0 6px 18px rgba(29, 63, 54, .035); }
.table-card[data-state="active"] { border-color: #b6d8d2; background: #e0f1ed; }.table-card[data-state="ending"] { border-color: #ead09e; background: #fff3da; }.table-card[data-state="overtime"] { border-color: #efb6b1; background: #fde9e7; }.table-card[data-state="paused"] { border-color: #c7cdd8; background: #e9ecf2; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.table-name { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.state-label { flex: none; min-height: 22px; padding: 2px 22px 2px 0; display: inline-flex; align-items: center; color: var(--text-muted); font-size: 11px; font-weight: 750; }
[data-state="active"] .state-label { color: #075e57; } [data-state="ending"] .state-label { color: #824900; } [data-state="overtime"] .state-label { color: #912018; } [data-state="paused"] .state-label { color: #3f4b5d; }
.status-beacon { position: absolute; top: 14px; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; }
.status-beacon.verified { color: #2f7d32; animation: beacon-breathe 2.8s ease-in-out infinite; }
.status-beacon.unverified { color: #b64645; animation: beacon-breathe 1.4s ease-in-out infinite; }
.status-beacon.idle { color: var(--idle); }
.timer { margin: 10px 0 2px; font-variant-numeric: tabular-nums; font-size: clamp(26px, 3vw, 32px); font-weight: 760; letter-spacing: -.045em; }
.timer-caption, .details { color: var(--text-muted); font-size: 12px; }
.session-schedule { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 3px 9px; color: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.card-meta { min-height: 20px; margin-top: 7px; display: flex; align-items: center; gap: 7px; overflow: hidden; }
.voucher { flex: none; padding: 3px 7px; border-radius: 6px; font-size: 11px; font-weight: 750; }.voucher.verified { background: #e3f2df; color: #285d24; }.voucher.pending { background: #f4eee4; color: #765b30; }
.details { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-note { margin: 6px 0 0; padding: 5px 7px; display: -webkit-box; overflow: hidden; border-left: 3px solid #91aaa2; border-radius: 0 7px 7px 0; background: rgba(255,255,255,.52); color: #40534c; font-size: 11px; line-height: 1.35; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }.session-note b { margin-right: 6px; color: var(--primary); }
.reservation { margin-top: auto; padding-top: 8px; color: var(--ending); font-size: 11px; font-weight: 650; }
.countdown-progress { width: 100%; height: 4px; margin-top: auto; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.72); }
.countdown-progress span { display: block; height: 100%; border-radius: inherit; background: var(--active); transition: width .4s linear; }
[data-state="ending"] .countdown-progress span { background: var(--ending); }
[data-state="overtime"] .countdown-progress span { background: var(--overtime); }
[data-state="paused"] .countdown-progress span { background: var(--paused); }
.notice { min-height: 78px; margin-bottom: 18px; padding: 15px 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.notice.error { border-color: #f4b8b3; background: #fff7f6; }
.notice strong, .notice p { margin: 0; }.notice p { margin-top: 3px; color: var(--text-muted); font-size: 13px; }
.notice button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--text); color: white; cursor: pointer; }
.notice button:active { transform: translateY(1px); }
.skeleton { background: linear-gradient(90deg, #e4eae8 25%, #f3f6f5 50%, #e4eae8 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 9px; }
.skeleton.title { width: 120px; height: 20px; margin-bottom: 12px; }.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }.skeleton.card { height: 158px; }
footer { min-height: 66px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: 12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, white); outline-offset: 3px; }
[hidden] { display: none !important; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes beacon-breathe { 0%, 100% { opacity: .65; box-shadow: 0 0 0 0 currentColor; } 50% { opacity: 1; box-shadow: 0 0 0 6px transparent; } }
@media (max-width: 900px) { .summary { gap: 8px 18px; }.table-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }
@media (max-width: 760px) { .topbar, main, footer { width: min(100% - 24px, 1480px); }.topbar { min-height: 92px; }.metric strong { font-size: 20px; }.table-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.skeleton-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .login-panel { grid-template-columns: 1fr; margin: 24px auto; gap: 18px; } }
@media (max-width: 600px) {
  .topbar { align-items: flex-start; padding-block: 20px; }.sync-state { padding: 8px; }.sync-state #sync-label { max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .summary { justify-content: space-between; gap: 5px; padding: 9px 2px; }
  .metric { display: grid; justify-items: center; gap: 3px; }
  .metric span { font-size: 10px; }
  .metric strong { grid-row: 1; font-size: 18px; }
  .table-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .table-card { min-height: 164px; padding: 9px 8px; border-radius: 10px; }
  .card-head { min-width: 0; flex-direction: column; gap: 1px; }.table-name { max-width: calc(100% - 14px); overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }.state-label { min-height: 18px; padding: 0; font-size: 9px; }.status-beacon { top: 10px; right: 9px; width: 7px; height: 7px; }
  .timer { margin-top: 7px; font-size: clamp(17px, 5vw, 22px); white-space: nowrap; }.timer-caption { font-size: 9px; }
  .session-schedule { margin-top: 5px; display: grid; gap: 1px; font-size: 8px; }.card-meta { margin-top: 5px; align-items: flex-start; flex-direction: column; gap: 3px; }.voucher { padding: 2px 5px; font-size: 8px; }.details { max-width: 100%; font-size: 8px; }
  .session-note { margin-top: 5px; padding: 4px 5px; font-size: 9px; }.session-note b { display: none; }.reservation { padding-top: 5px; font-size: 8px; }
  .group-header { position: sticky; top: 0; z-index: 2; padding: 8px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
