@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/montserrat-400.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/montserrat-500.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/montserrat-600.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/montserrat-700.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/montserrat-800.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --card: #ffffff;
  --ink: #1c1c1e;
  --ink-2: #6e6e73;
  --line: rgba(60,60,67,.14);
  --blue: #d8e0e7; --blue-ink: #42617e;
  --blush: #fbe3e8; --blush-ink: #9c4a5e;
  --yellow: #fdf0d5; --yellow-ink: #8a6414;
  --green: #e4f2e4; --green-ink: #3f6d3f;
  --radius: 24px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Montserrat', -apple-system, sans-serif;
  background: var(--bg); color: var(--ink);
  padding: env(safe-area-inset-top) 16px calc(110px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
}
.app-header { display: flex; align-items: center; gap: 14px; padding: 20px 4px 8px; }
.app-logo { width: 52px; height: 52px; border-radius: 14px; }
.app-title h1 { font-size: 22px; font-weight: 800; margin: 0; }
.app-title p { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.view { padding-top: 8px; }
.loading { color: var(--ink-2); text-align: center; padding: 40px 0; font-weight: 600; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin: 14px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; text-align: center; color: var(--ink); }
.section-label { font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; margin: 22px 4px 0; }

.people { display: flex; justify-content: center; gap: 28px; padding: 6px 0 2px; }
.person { text-align: center; }
.person .circle { width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; margin: 0 auto 6px; }
.person.blue .circle { background: var(--blue); color: var(--blue-ink); }
.person.blush .circle { background: var(--blush); color: var(--blush-ink); }
.person .pname { font-weight: 700; font-size: 15px; }
.person .pstate { color: var(--ink-2); font-size: 13px; font-weight: 500; }
.person.away { opacity: .55; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row .rname { font-weight: 600; font-size: 15px; }
.chip { font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: #eef0f2; color: var(--ink-2); white-space: nowrap; }
.chip.on { background: var(--yellow); color: var(--yellow-ink); }
.chip.good { background: var(--green); color: var(--green-ink); }
.chip.warn { background: var(--blush); color: var(--blush-ink); }

.cam-card { padding: 0; overflow: hidden; }
.cam-card img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; background: #e8eaec; }
.cam-card .cam-meta { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.cam-card .cam-name { font-weight: 700; font-size: 16px; }
.cam-unavailable { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; background: #eef0f2; color: var(--ink-2); font-weight: 600; font-size: 14px; padding: 0 24px; text-align: center; }

.event-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border: none; border-radius: 18px; padding: 12px; margin: 10px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); font-family: inherit; cursor: pointer; }
.event-row img { width: 84px; height: 62px; object-fit: cover; border-radius: 12px; background: #e8eaec; flex: none; }
.event-row .e-thumb-empty { width: 84px; height: 62px; border-radius: 12px; background: #eef0f2; flex: none; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.event-row .e-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.event-row .e-sub { color: var(--ink-2); font-size: 13px; font-weight: 500; margin-top: 2px; }
.detail-img { width: 100%; border-radius: 18px; display: block; }
.back-btn, .primary-btn { font-family: inherit; font-weight: 700; font-size: 15px; border: none; border-radius: 999px; padding: 12px 20px; cursor: pointer; }
.back-btn { background: #eef0f2; color: var(--ink); margin-bottom: 12px; }
.primary-btn { background: #42617e; color: #fff; width: 100%; margin-top: 10px; }
.note { color: var(--ink-2); font-size: 14px; font-weight: 500; line-height: 1.5; }
.status-line { font-weight: 600; font-size: 14px; margin-top: 12px; text-align: center; }
.empty { text-align: center; color: var(--ink-2); font-weight: 600; padding: 28px 0; }

.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.92); backdrop-filter: blur(18px) saturate(180%); -webkit-backdrop-filter: blur(18px) saturate(180%); border-radius: 999px; display: flex; gap: 2px; padding: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.12); z-index: 10; }
.tab { font-family: inherit; border: none; background: transparent; color: var(--ink-2); font-size: 11px; font-weight: 700; padding: 8px 14px; border-radius: 999px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.tab .tab-icon svg { width: 22px; height: 22px; display: block; }
.tab.active { background: var(--blue); color: var(--blue-ink); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
