:root {
  --accent: #0F766E; --accent-hover: #115E59; --accent-soft: #CCFBF1;
  --ink: #0F172A; --muted: #64748B; --line: #E2E8F0; --bg: #F8FAFC; --panel: #FFFFFF;
  --danger: #B91C1C; --warn-bg: #FEF3C7; --warn-ink: #92400E;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", Arial, sans-serif;
       color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; line-height: 1.25; }
h1 small { font-size: .9rem; color: var(--muted); font-weight: 400; }
h2 { font-size: 1.2rem; margin: 0 0 .25rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px;
       padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 1.25rem; }
.brand img { border-radius: 7px; }
.who { display: flex; align-items: center; gap: 12px; }
.who form { margin: 0; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }
.wrap.narrow { max-width: 620px; }
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 16px; color: var(--muted);
        font-size: .85rem; border-top: 1px solid var(--line); background: var(--panel); }
.foot a { color: var(--muted); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.empty { text-align: center; padding: 40px 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
       padding: 8px 16px; border: 1px solid #CBD5E1; border-radius: 8px; background: var(--panel); color: var(--ink);
       font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #F1F5F9; }
.btn:disabled { color: #94A3B8; background: #F1F5F9; border-color: var(--line); cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:disabled { background: #94A3B8; border-color: #94A3B8; color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }

.alert { background: #FEE2E2; color: var(--danger); border-radius: 8px; padding: 10px 12px; }
.warn { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 10px 12px; font-size: .9rem; }

/* login */
.login h1 { margin-top: 4px; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; }
.steps li { padding: 6px 14px; border-radius: 6px; background: var(--line); color: var(--muted); font-weight: 600; font-size: .9rem; }
.steps li b { margin-right: 4px; }
.steps li.on { background: var(--accent); color: #fff; }
.steps li.done { background: var(--accent-soft); color: var(--accent); }
label { display: block; font-weight: 600; margin: 14px 0 0; }
input:not([type=checkbox]) { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit;
        border: 1px solid #CBD5E1; border-radius: 8px; background: var(--panel); min-height: 44px; }
input:disabled { background: #F1F5F9; }
input.otp { max-width: 180px; letter-spacing: .3em; font-size: 1.3rem; text-align: center; }
.row { display: flex; gap: 8px; align-items: stretch; margin-top: 6px; }
.row input { margin-top: 0; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.notice { white-space: pre-wrap; font-size: .85rem; line-height: 1.5; max-height: 300px; overflow-y: auto;
          border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #FCFDFE; }
.notice.full { max-height: none; border: none; padding: 0; font-size: .95rem; }
.tick { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-top: 12px; }
.tick input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.cam { position: relative; background: #0F172A; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3;
       display: flex; align-items: center; justify-content: center; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camerr { color: #fff; padding: 16px; text-align: center; }

/* events */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.events { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.event { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
.event:hover { border-color: var(--accent); }
.ename { font-weight: 700; font-size: 1.1rem; }
.count { color: var(--accent); font-weight: 600; margin-top: 8px; }
.back { text-decoration: none; }
.tabs { display: inline-flex; border: 1px solid #CBD5E1; border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.tabs a { padding: 8px 16px; text-decoration: none; color: var(--ink); font-weight: 600; }
.tabs a.on { background: var(--accent); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.ph { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ph img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--line); }
.ph .dl { display: block; text-align: center; padding: 6px; font-size: .85rem; text-decoration: none; font-weight: 600; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 20px; }

@media (max-width: 560px) {
  .hide-sm { display: none; }
  h1 { font-size: 1.35rem; }
  .card { padding: 16px; }
  .row { flex-direction: column; }
  .actions .btn { flex: 1; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
