:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #eef2f7;
  font-synthesis: none;
  --navy: #16243d;
  --blue: #2e67d1;
  --green: #138a5b;
  --amber: #b46700;
  --red: #b73535;
  --line: #d7dfeb;
  --muted: #657187;
  --surface: #ffffff;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #e9eef6 0, #f7f9fc 260px); }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-header {
  display: flex; align-items: center; gap: 13px; padding: calc(18px + env(safe-area-inset-top)) 18px 22px;
  background: var(--navy); color: white; box-shadow: 0 8px 24px rgba(22,36,61,.16);
}
.brand-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 25px; font-weight: 800; background: white; color: var(--navy); }
.eyebrow { font-size: 13px; opacity: .78; letter-spacing: .03em; }
h1 { margin: 2px 0 0; font-size: 22px; line-height: 1.2; }
h2 { margin: 0 0 15px; font-size: 18px; }
.page-shell { width: min(100%, 640px); margin: 0 auto; padding: 16px 14px calc(34px + env(safe-area-inset-bottom)); }
.card { background: var(--surface); border: 1px solid rgba(215,223,235,.86); border-radius: 19px; padding: 18px; margin-bottom: 13px; box-shadow: 0 7px 20px rgba(39,55,85,.055); }
.status-card { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.status-label, .date-text { display: block; color: var(--muted); font-size: 13px; }
.clock-text { display: block; font-size: 29px; letter-spacing: .03em; color: var(--navy); line-height: 1.2; }
label { display: block; font-size: 14px; font-weight: 650; margin: 13px 0 7px; }
input, select { width: 100%; min-height: 49px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; background: #fff; color: #172033; outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,103,209,.12); }
.pin-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.button { border: 0; border-radius: 12px; min-height: 47px; padding: 11px 15px; font-weight: 750; cursor: pointer; }
.button:disabled { opacity: .48; cursor: not-allowed; }
.button-primary { background: var(--blue); color: #fff; }
.button-secondary { background: #e9effa; color: #1b4e9d; }
.button-ghost { background: #f1f4f8; color: #3b4659; }
.button-small { min-height: 49px; padding-inline: 14px; }
.button-full { width: 100%; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.button-row .button:last-child:nth-child(3) { grid-column: 1 / -1; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.section-heading h2 { margin-bottom: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border-radius: 999px; background: #e5f4ec; color: #08764b; font-size: 12px; font-weight: 750; white-space: nowrap; }
.badge-muted { background: #eef1f5; color: #667085; }
.badge-warning { background: #fff1d8; color: #985400; }
.badge-error { background: #fde7e7; color: #9c2929; }
.camera-frame { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 16px; background: #10141c; border: 1px solid #202b3b; }
.camera-frame video, .camera-frame img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-placeholder { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 8px; color: #cbd4e1; padding: 24px; }
.camera-symbol { font-size: 44px; }
.help-text { margin: 9px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.location-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.location-grid > div { border: 1px solid var(--line); border-radius: 12px; padding: 11px; }
.location-grid span { display: block; color: var(--muted); font-size: 12px; }
.location-grid strong { display: block; margin-top: 3px; }
.event-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.event-button { border: 1px solid transparent; border-radius: 15px; min-height: 92px; padding: 13px 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; font-weight: 800; cursor: pointer; }
.event-button:active { transform: translateY(1px); }
.event-icon { font-size: 26px; line-height: 1; }
.event-in { background: #e5f6ee; color: #08744b; border-color: #caeadc; }
.event-break { background: #fff1da; color: #995400; border-color: #f1dfbd; }
.event-return { background: #eaf0ff; color: #315aaf; border-color: #d7e1fa; }
.event-out { background: #fdeaea; color: #a52f2f; border-color: #f4d2d2; }
.notice { border-radius: 14px; padding: 13px 15px; margin-bottom: 13px; font-size: 14px; line-height: 1.5; }
.notice-error { background: #fdeaea; border: 1px solid #f2cece; color: #902929; }
.result-card { display: flex; align-items: flex-start; gap: 13px; border-width: 2px; }
.result-card.success { border-color: #b9e3d0; background: #f3fbf7; }
.result-card.error { border-color: #f0c6c6; background: #fff7f7; }
.result-icon { width: 39px; height: 39px; border-radius: 50%; display: grid; place-items: center; background: #138a5b; color: white; font-size: 22px; font-weight: 800; flex: 0 0 auto; }
.result-card.error .result-icon { background: var(--red); }
.result-card p { margin: 4px 0; line-height: 1.45; }
.result-card small { color: var(--muted); overflow-wrap: anywhere; }
.privacy-note { color: #737e90; font-size: 11.5px; line-height: 1.5; padding: 2px 8px; text-align: center; }
.loading-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(8,14,24,.78); backdrop-filter: blur(4px); color: white; display: flex; flex-direction: column; gap: 9px; align-items: center; justify-content: center; text-align: center; padding: 25px; }
.loading-overlay span { font-size: 13px; opacity: .78; }
.spinner { width: 44px; height: 44px; border: 4px solid rgba(255,255,255,.25); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
.hidden { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 390px) {
  .page-shell { padding-inline: 10px; }
  .card { padding: 15px; border-radius: 16px; }
  .event-button { min-height: 86px; font-size: 13px; }
  h1 { font-size: 20px; }
}
