:root {
  color-scheme: light;
  --paper: #f8f5ef;
  --ink: #252723;
  --muted: #7c7c73;
  --line: #e5e0d7;
  --green: #b7c7ad;
  --green-dark: #344a39;
  --orange: #d78055;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', Arial, sans-serif;
  --mono: 'DM Mono', monospace;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.topbar { height: 84px; padding: 0 7.2vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(37,39,35,.08); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 17px; font-weight: 700; letter-spacing: -.8px; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: var(--green-dark); color: #fff; font: 600 13px var(--serif); letter-spacing: -1px; }
.brand-light { color: #94968c; font-weight: 400; }
.text-link { color: #5e645b; font-size: 12px; font-weight: 600; transition: color .2s; }
.text-link:hover { color: var(--orange); }
.text-link span { padding-left: 5px; color: var(--orange); }

.booth-layout { width: min(1050px, 86vw); margin: 66px auto 57px; display: grid; grid-template-columns: .87fr 1.13fr; column-gap: 9%; align-items: center; }
.booth-intro { padding-bottom: 12px; }
.eyebrow { margin: 0; color: #82847a; font: 10px var(--mono); letter-spacing: 1.45px; }
.eyebrow-dot, .live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--orange); vertical-align: 1px; }
.booth-intro h1, .auth-panel h1, .dashboard-heading h1 { margin: 24px 0 16px; font: 500 clamp(42px, 5vw, 61px)/1.12 var(--serif); letter-spacing: -1.7px; }
.booth-intro h1 span, .auth-panel h1 span, .dashboard-heading h1 span { color: #8d9b84; font-style: italic; }
.intro-copy { max-width: 335px; color: var(--muted); font-size: 14px; line-height: 1.85; }
.steps { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.step { display: flex; align-items: center; gap: 14px; color: #696b62; font-size: 12px; }
.step-number { color: var(--orange); font: 10px var(--mono); letter-spacing: 1px; }

.booth-card { padding: 18px; border: 1px solid #e7e1d8; border-radius: 5px; background: #fffdf9; box-shadow: 0 20px 55px rgba(58,50,39,.055); }
.booth-card-top { height: 29px; display: flex; justify-content: space-between; align-items: flex-start; color: #898b82; font: 9px var(--mono); letter-spacing: 1px; }
.live-dot { width: 6px; height: 6px; margin-right: 7px; background: #94a989; }
.shot-counter { color: var(--orange); }
.camera-stage { position: relative; height: clamp(280px, 36vw, 405px); overflow: hidden; display: grid; place-items: center; background: #e6e4dc; }
.camera-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.strip-preview { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: #e6e4dc; }
.camera-placeholder { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 9px; color: #74786f; text-align: center; }
.camera-placeholder strong { color: #454940; font: 500 20px var(--serif); }
.camera-placeholder span { font-size: 11px; }
.camera-icon svg { width: 43px; height: 43px; color: #9ba397; }
.camera-overlay { position: absolute; inset: 13px; pointer-events: none; }
.corner { position: absolute; width: 18px; height: 18px; border-color: rgba(255,255,255,.72); border-style: solid; }
.corner-tl { top: 0; left: 0; border-width: 1px 0 0 1px; }
.corner-tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.corner-bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.corner-br { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.countdown { position: absolute; z-index: 3; display: grid; width: 94px; height: 94px; place-items: center; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; background: rgba(37,39,35,.2); color: white; font: 500 56px var(--serif); text-shadow: 0 2px 15px rgba(0,0,0,.25); }
.flash { position: absolute; inset: 0; z-index: 4; background: white; opacity: 0; pointer-events: none; }
.flash.is-active { animation: camera-flash .32s ease-out; }
@keyframes camera-flash { 0% { opacity: .95; } 100% { opacity: 0; } }
.booth-message { min-height: 36px; margin: 13px 2px 8px; color: #888980; font-size: 11px; line-height: 1.65; }
.booth-actions { display: flex; gap: 9px; }
.button { min-height: 46px; padding: 0 17px; border: 0; border-radius: 2px; display: inline-flex; justify-content: center; align-items: center; gap: 20px; cursor: pointer; font-size: 11px; font-weight: 600; transition: background .2s, transform .2s, opacity .2s; }
.button:disabled { cursor: wait; opacity: .65; }
.button-primary { flex: 1; background: var(--green-dark); color: white; }
.button-primary:hover:not(:disabled) { transform: translateY(-1px); background: #263b2c; }
.button-arrow { font-size: 16px; font-weight: 400; }
.button-quiet { background: #f0eee8; color: #676b62; }
.button-quiet:hover { background: #e7e4dc; }
.film-note { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: 9px; padding-top: 35px; color: #83857c; font-size: 11px; }
.film-note-icon { color: var(--orange); font-size: 16px; }
.site-footer { min-height: 61px; padding: 0 7.2vw; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(37,39,35,.08); color: #9b9b92; font: 8px var(--mono); letter-spacing: 1px; }
.footer-separator { padding: 0 6px; color: var(--orange); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: min(390px, calc(100vw - 48px)); padding: 13px 17px; transform: translateY(12px); border-radius: 3px; background: #303c31; color: white; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-visible { transform: translateY(0); opacity: 1; }
.toast.is-error { background: #8a4337; }

.admin-main { min-height: calc(100vh - 145px); }
.auth-panel { position: relative; width: min(440px, calc(100% - 40px)); margin: 76px auto; padding: 36px 43px 39px; overflow: hidden; border: 1px solid var(--line); background: #fffdf9; box-shadow: 0 20px 55px rgba(58,50,39,.04); }
.auth-decoration { position: absolute; top: -29px; right: 19px; color: rgba(183,199,173,.22); font: 700 147px/.9 var(--serif); letter-spacing: -15px; pointer-events: none; }
.auth-decoration span { color: rgba(215,128,85,.35); }
.auth-panel .eyebrow, .auth-panel h1, .auth-copy, .auth-form, .auth-footnote { position: relative; }
.auth-panel h1 { margin-top: 31px; font-size: 48px; }
.auth-copy { max-width: 310px; margin: 0 0 27px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.auth-form { display: grid; gap: 10px; }
.auth-form label { color: #55594f; font-size: 11px; font-weight: 600; }
.auth-form input { width: 100%; height: 45px; padding: 0 12px; border: 1px solid #e1ddd5; border-radius: 2px; outline: 0; background: #fff; color: var(--ink); font-size: 12px; }
.auth-form input:focus { border-color: #869a80; box-shadow: 0 0 0 3px rgba(134,154,128,.12); }
.form-error { min-height: 14px; margin: -1px 0 2px; color: #a54e3b; font-size: 11px; }
.button-full { width: 100%; }
.auth-footnote { margin: 19px 0 0; color: #97988f; font-size: 10px; text-align: center; }

.dashboard { width: min(1080px, 86vw); margin: 62px auto 70px; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; }
.dashboard-heading h1 { margin: 18px 0 9px; font-size: 48px; }
.dashboard-subtitle { margin: 0; color: var(--muted); font-size: 12px; }
.logout-button { margin-bottom: 5px; }
.stat-grid { margin-top: 35px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.stat-card { min-height: 131px; padding: 20px 22px; border: 1px solid var(--line); background: #fffdf9; }
.stat-card-accent { border-color: #d6dfd0; background: #edf1e9; }
.stat-label { display: block; color: #85877e; font: 9px var(--mono); letter-spacing: 1px; }
.stat-card strong { display: block; margin: 12px 0 4px; color: var(--green-dark); font: 500 34px var(--serif); }
.stat-card .stat-date { font-size: 20px; }
.stat-caption { color: #96978f; font-size: 10px; }
.users-section { margin-top: 42px; }
.users-heading { margin: 0 0 8px; }
.users-note { margin: 0 0 13px; color: #85877e; font-size: 11px; line-height: 1.6; }
.users-table-wrap { overflow-x: auto; border: 1px solid var(--line); background: #fffdf9; }
.users-table { width: 100%; min-width: 820px; border-collapse: collapse; text-align: left; }
.users-table th { padding: 13px 14px; border-bottom: 1px solid var(--line); color: #85877e; font: 9px var(--mono); letter-spacing: .7px; white-space: nowrap; }
.users-table td { padding: 13px 14px; border-bottom: 1px solid #eeeae3; color: #62655c; font-size: 11px; white-space: nowrap; }
.users-table tbody tr:last-child td { border-bottom: 0; }
.device-id-cell { color: var(--green-dark) !important; font-weight: 600; }
.location-link { color: #52694d; text-decoration: underline; text-decoration-color: #c4cdbd; text-underline-offset: 3px; }
.location-time { display: block; margin-top: 4px; color: #99998f; font-size: 9px; }
.location-unavailable { color: #99998f !important; }
.user-gallery-button { padding: 6px 9px; border: 1px solid #e2ded5; border-radius: 2px; background: #f8f5ef; color: #52694d; cursor: pointer; font-size: 10px; }
.user-gallery-button:hover { border-color: #b7c7ad; background: #edf1e9; }
.users-empty { padding: 23px 15px; border-top: 0; }
.users-empty p { margin: 0; color: #82847a; font-size: 11px; }
.gallery-heading { margin: 43px 0 18px; display: flex; justify-content: space-between; align-items: end; }
.gallery-heading .eyebrow { font-size: 9px; }
.gallery-heading h2 { margin: 8px 0 0; font: 500 27px var(--serif); }
.gallery-controls { display: flex; align-items: center; gap: 16px; }
.clear-device-filter { padding: 0; border: 0; background: transparent; cursor: pointer; font-size: 10px; }
.gallery-count { padding-bottom: 4px; color: #92938b; font-size: 11px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.photo-card { position: relative; overflow: hidden; border: 1px solid var(--line); background: #fffdf9; }
.photo-card-image { width: 100%; aspect-ratio: 4 / 5; display: block; object-fit: cover; background: #e8e5dd; }
.photo-card-info { min-height: 54px; padding: 7px 11px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.photo-card-meta { min-width: 0; display: grid; gap: 4px; }
.photo-card-date { color: #73756d; font-size: 10px; }
.photo-location { color: #52694d; font-size: 9px; text-decoration: underline; text-decoration-color: #c4cdbd; text-underline-offset: 2px; }
.delete-photo { width: 28px; height: 28px; border: 0; border-radius: 2px; background: transparent; color: #a17163; cursor: pointer; font-size: 16px; }
.delete-photo:hover { background: #f5e8e3; color: #9c4939; }
.dashboard-error { color: #a54e3b; font-size: 12px; }
.gallery-more-wrap { padding-top: 20px; display: flex; justify-content: center; }
.gallery-more-wrap .button { flex: 0 0 auto; min-height: 40px; }
.empty-state { padding: 60px 20px; border: 1px dashed #dcd7cc; text-align: center; }
.empty-state > span { color: var(--orange); font-size: 24px; }
.empty-state h3 { margin: 10px 0 6px; font: 500 22px var(--serif); }
.empty-state p { margin: 0 0 16px; color: #82847a; font-size: 12px; }

@media (min-width: 1500px) { .booth-layout { margin-top: 85px; } }
@media (max-width: 760px) {
  .topbar { height: 68px; padding: 0 6vw; }
  .booth-layout { width: min(510px, 88vw); margin: 46px auto 37px; grid-template-columns: 1fr; gap: 24px; }
  .booth-intro h1 { margin-top: 17px; font-size: 43px; }
  .intro-copy { margin-bottom: 0; font-size: 12px; }
  .steps { display: none; }
  .booth-card { padding: 13px; }
  .camera-stage { height: min(108vw, 390px); }
  .film-note { padding-top: 4px; font-size: 10px; }
  .site-footer { min-height: 55px; padding: 0 6vw; font-size: 7px; }
  .dashboard { width: 88vw; margin: 43px auto 54px; }
  .dashboard-heading { align-items: start; }
  .dashboard-heading h1 { font-size: 39px; }
  .dashboard-subtitle { max-width: 310px; line-height: 1.6; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card:last-child { grid-column: 1 / -1; min-height: 105px; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; }
}
@media (max-width: 460px) {
  .auth-panel { margin: 47px auto; padding: 31px 25px; }
  .auth-panel h1 { font-size: 42px; }
  .dashboard-heading { gap: 8px; }
  .dashboard-heading h1 { font-size: 34px; }
  .logout-button { min-height: 38px; padding: 0 11px; gap: 7px; font-size: 10px; }
  .stat-card { min-height: 119px; padding: 16px; }
  .stat-card strong { font-size: 29px; }
  .stat-card .stat-date { font-size: 17px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer span:last-child { text-align: right; }
}
