/* Photo Live — shared light/dark design tokens. Photos and OBS are never recolored. */
:root {
  color-scheme: light;
  --paper: #f4f5ef; --ink: #263229; --muted: #657062; --card: #fcfdf8;
  --surface: #edf0e8; --line: #d9dfd4; --sage: #536d4f; --copper: #9d6841;
  --inverse: #f8faf4; --glass-nav: rgba(244,245,239,.88);
  --wash: rgba(127,151,113,.12); --danger: #b23c36;
  --radius: 22px; --shadow: 0 16px 48px rgba(37,51,34,.045);
  --positive-bg: #e5eee0; --positive: #416237;
  --warning-bg: #f4ead7; --warning: #79561d;
  --error-bg: #f7e6e3; --error: #a43c32;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0c0e0d; --ink: #f1f3ee; --muted: #a3aaa4; --card: #151917;
  --surface: #1c231e; --line: #303a32; --sage: #b4c9a5; --copper: #d0aa82;
  --inverse: #172019; --glass-nav: rgba(12,14,13,.9);
  --wash: rgba(113,144,99,.1); --danger: #e38b80;
  --shadow: 0 16px 48px rgba(0,0,0,.12);
  --positive-bg: #202f23; --positive: #b4cda8;
  --warning-bg: #322c20; --warning: #e0c091;
  --error-bg: #342422; --error: #efa79c;
}
body, button, input, select, textarea {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { background: radial-gradient(ellipse at 85% 0%,var(--wash),transparent 50%),var(--paper); color: var(--ink); }
h1,h2,h3 { font-weight: 300; letter-spacing: -.045em; }
h1 { line-height: 1.04; } h2 { line-height: 1.15; } h3 { line-height: 1.2; }
strong,b { font-weight: 500; }
html :is(.eyebrow,.microcopy,.back-link,.button,label,.tag,.live-pill,.event-tab-button,.landing-admin-link,.collection-tabs button,.gallery-filter-tabs button) { font-weight: 400; }
.eyebrow { letter-spacing: .13em; font-size: 10px; color: var(--muted); }
html :is(.button,.language-switcher,.theme-switcher,.landing-admin-link) { box-shadow: none; }
html .button { border-radius: 999px; min-height: 42px; }
html .button.primary { background: var(--ink); color: var(--inverse); border-color: var(--ink); }
html .button.secondary,html .button.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
html .button.danger { background: var(--error-bg); color: var(--error); border-color: var(--error); }
html .button:hover { filter: brightness(.96); }
html .text-button,html .text-link { color: var(--sage); font-weight: 500; }
html label { color: var(--ink); }
html input:not([type=range]):not([type=checkbox]),html select,html textarea { background: var(--surface); color: var(--ink); border-color: var(--line); }
html input::placeholder,html textarea::placeholder { color: var(--muted); opacity: 1; }
html input[type=checkbox],html input[type=range] { accent-color: var(--sage); }
html :is(a,button,input,select,textarea,summary):focus-visible { outline: 2px solid var(--sage); outline-offset: 4px; }
html .panel { box-shadow: none; border-color: var(--line); }
html .topbar { padding-inline: max(24px,calc((100vw - 1320px)/2)); background: var(--glass-nav); border-color: var(--line); backdrop-filter: blur(18px); }
.brand { font-weight: 400; letter-spacing: -.03em; }
html .brand-mark { background: var(--ink); color: var(--inverse); border-radius: 12px; font-weight: 400; box-shadow: none; }
html .brand-logo-frame { background: transparent; }
.theme-switcher { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.theme-switcher button { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.theme-switcher button > span:first-child { font-size: 17px; line-height: 1; }
html .theme-switcher button[aria-pressed="true"],html .language-switcher a[aria-current="true"] { background: var(--ink); color: var(--inverse); }
html .language-switcher { background: var(--card); }
.display-preferences { position: fixed; z-index: 30; bottom: 16px; left: 20px; display: flex; align-items: center; gap: 8px; }
html .live-pill { background: var(--surface); border-color: var(--line); color: var(--ink); }
html .dashboard-menu { background: var(--glass-nav); box-shadow: none; top: 84px; }
html .dashboard-menu-item { min-height: 62px; }
html .dashboard-menu-icon { background: var(--surface); color: var(--muted); }
html .dashboard-menu-item:hover { background: var(--surface); color: var(--ink); }
html .dashboard-menu-item[aria-selected="true"],html .dashboard-menu-item.create[aria-selected="true"] { background: var(--ink); color: var(--inverse); box-shadow: none; }
html .dashboard-menu-item[aria-selected="true"] .dashboard-menu-icon { background: transparent; color: inherit; }
html .dashboard-menu-item strong { font-weight: 400; }
html .event-tab-navigation { background: var(--glass-nav); }
html .event-tab-button:hover { background: var(--surface); }
html .event-tab-button[aria-selected="true"] { background: var(--ink); color: var(--inverse); }
html .event-tab-menu-toggle { background: var(--card); }
html .dashboard-view-heading h2 { font-size: clamp(26px,3vw,38px); }
html .event-grid { gap: 22px; }
.event-card { position: relative; isolation: isolate; overflow: hidden; }
html .event-card { min-height: 380px; padding: 18px; background: var(--surface); }
.event-card-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.event-card-placeholder { position: absolute; inset: 0; display: grid; place-items: start end; padding: 40px; font-size: 140px; font-weight: 200; color: var(--sage); opacity: .18; background: radial-gradient(at 90% 0%,var(--wash),transparent 65%); }
.event-card-body { position: relative; margin-top: auto; padding: 20px; border-radius: 20px; }
html .event-card h3 { margin: 0 0 8px; font-size: 28px; overflow-wrap: anywhere; }
.event-card-body > p { margin: 0 0 22px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.event-card-top { position: relative; align-self: flex-start; padding: 8px 12px; border-radius: 999px; background: var(--card); flex-wrap: wrap; }
html .event-meta { padding-top: 15px; margin-top: 14px; }
html .event-meta strong { font-size: 32px; font-weight: 300; }
html .event-card.archived { opacity: 1; }
/* Polished glass: a modest tint, local blur and a fine reflective rim. */
html .polished-glass,html .gallery-caption,html .gallery-header.has-cover .gallery-header-actions {
  background: radial-gradient(ellipse at 0 0,rgba(255,255,255,.19),transparent 68%),linear-gradient(130deg,rgba(255,255,255,.09),transparent 55%),rgba(19,29,24,.20);
  border: 1px solid rgba(255,255,255,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35),inset 0 -1px 0 rgba(255,255,255,.08),0 12px 32px rgba(0,0,0,.13);
  backdrop-filter: blur(9px) saturate(145%); -webkit-backdrop-filter: blur(9px) saturate(145%);
  color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.65);
}
html .polished-glass :is(p,span,small,strong,b,.eyebrow),html .polished-glass .event-card-schedule { color: #fff; }
html .polished-glass :is(.event-meta,.landing-card-footer) { border-color: rgba(255,255,255,.25); color: #fff; }
.event-card.has-cover::after,.landing-gallery-card.has-cover::after { content: ""; position: absolute; inset: 30% 0 0; background: linear-gradient(transparent,rgba(0,0,0,.5)); z-index: -1; pointer-events: none; }
html .event-card-schedule { background: transparent; font-size: 11px; }
.direct-overview { display: grid; }
.direct-cover { position: relative; min-height: 400px; max-height: 540px; height: 38vw; border-radius: 24px; overflow: hidden; background: #172019; }
.direct-cover > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.direct-cover-caption { position: absolute; bottom: 24px; left: 24px; max-width: calc(100% - 48px); width: 370px; padding: 24px; border-radius: 22px; display: grid; gap: 12px; }
.direct-cover-caption strong { font-size: 27px; font-weight: 300; overflow-wrap: anywhere; }
.direct-cover-caption > span:last-child { font-size: 11px; }
.direct-waiting { padding: 55px 24px; border: 1px dashed var(--line); border-radius: 24px; text-align: center; background: var(--wash); }
.direct-waiting .pulse-ring { margin-bottom: 24px; }
.direct-waiting h2 { font-size: 32px; }
html .direct-cover[hidden],html .direct-waiting[hidden] { display: none; }
html .gallery-analytics-panel { padding: 34px; gap: 30px; }
.gallery-analytics-heading h2 { font-size: clamp(28px,3vw,40px); }
html .analytics-range-picker,html .system-metrics-range { background: var(--surface); }
html .analytics-range-picker button,html .system-metrics-range button { font-weight: 400; }
html .analytics-range-picker button[aria-pressed="true"],html .system-metrics-range button[aria-pressed="true"] { background: var(--ink); color: var(--inverse); }
html .analytics-total-grid { gap: 32px; }
html .analytics-total-grid article { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 0 26px; column-gap: 12px; }
html .analytics-total-grid strong { font-size: clamp(46px,6vw,76px); font-weight: 200; letter-spacing: -.055em; }
html .analytics-total-grid article > span:last-child { font-size: 12px; margin-top: 12px; }
html .analytics-dot { width: 6px; height: 6px; }
html .analytics-dot.visitors { background: var(--sage); }
html .analytics-dot.downloads { background: var(--copper); }
html .landing-shell,html .auth-shell { background: radial-gradient(ellipse at 85% 0,var(--wash),transparent 50%),var(--paper); }
html .landing-brand strong { font-weight: 400; }
html .landing-admin-link { border-color: var(--line); background: var(--card); }
html .landing-hero { padding: 70px 0 76px; }
html .landing-hero h1 { font-size: clamp(52px,7.7vw,106px); line-height: 1.02; letter-spacing: -.055em; }
html .landing-hero h1 em { font-family: inherit; font-weight: 300; font-style: normal; color: var(--sage); }
html .landing-intro > p { font-size: 15px; }
html :is(.landing-galleries,.landing-footer) { border-color: var(--line); }
html .landing-gallery-card { position: relative; isolation: isolate; border-color: var(--line); background: var(--card); box-shadow: none; }
html .landing-gallery-card.has-cover { min-height: 430px; display: flex; align-items: flex-end; padding: 16px; }
.landing-gallery-card.has-cover .landing-card-media { position: absolute; inset: 0; height: 100%; z-index: -2; }
html .landing-card-body { width: 100%; border-radius: 20px; }
html .landing-card-body h3 { min-height: 0; margin: 0 0 28px; font-size: 30px; }
html .landing-card-placeholder { background: radial-gradient(at 80% 0,var(--wash),transparent 60%),var(--surface); color: var(--ink); }
html .landing-card-placeholder > span:not(.landing-lock) { font-family: inherit; font-weight: 200; color: var(--sage); }
html .landing-lock,html .landing-lock:before { border-color: var(--sage); }
html .landing-live-badge { background: rgba(20,29,23,.6); color: #fff; font-weight: 400; backdrop-filter: blur(9px); }
html .landing-private-badge { font-weight: 400; }
html .landing-empty { background: var(--wash); border-color: var(--line); padding: 28px; }
html .landing-footer { padding-bottom: 60px; }
html .gallery-shell { max-width: 1600px; margin: auto; padding-bottom: 100px; }
.gallery-header { position: relative; isolation: isolate; gap: 30px; }
.gallery-hero-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.gallery-hero-cover[hidden] { display: none; }
html .gallery-header.has-cover { min-height: 410px; padding: 34px; margin-bottom: 28px; border-radius: 24px; overflow: hidden; color: #fff; }
.gallery-header.has-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg,rgba(0,0,0,.6),transparent 90%); z-index: -1; }
.gallery-header.has-cover .gallery-identity .eyebrow { color: #fff; }
.gallery-header.has-cover h1 { text-shadow: 0 2px 16px rgba(0,0,0,.35); }
html .gallery-header.has-cover .gallery-header-actions { border-radius: 22px; padding: 22px; }
html .gallery-header.has-cover :is(.gallery-counter > strong,.gallery-own-favorites) { color: #fff; }
html .gallery-header.has-cover :is(.live-pill,.slideshow-link,.gallery-social-link) { background: rgba(13,24,17,.3); color: #fff; border-color: rgba(255,255,255,.25); }
html .gallery-header h1 { font-size: clamp(36px,5vw,66px); overflow-wrap: anywhere; }
html .collection-tabs button,html .gallery-filter-tabs button { background: var(--card); color: var(--muted); border-color: var(--line); }
html .collection-tabs button.active,html .gallery-filter-tabs button.active { background: var(--ink); color: var(--inverse); border-color: var(--ink); }
html .final-gallery-link { background: var(--sage); color: var(--inverse); box-shadow: none; font-weight: 400; }
html .gallery-social-link { background: var(--card); border-color: var(--line); color: var(--ink); }
html .gallery-grid { gap: 14px; }
html .gallery-item { border-radius: 16px; }
/* Secondary administration views share the same neutral surfaces. */
html :is(.auth-card,.admin-photo-card,.camera-source-card,.collection-admin-row,.grading-card,.watermark-settings,.telegram-master-option,.telegram-chat-choice,.reaction-option-group,.reaction-public-option,.face-search-card,.face-search-dropzone,.health-metric,.system-metrics-current-grid article,.health-queue-row,.health-queue-detail dl,.gallery-visibility-settings,.gallery-export-panel,.gallery-share-card,.template-copy-list,.event-template-panel) { background: var(--card); color: var(--ink); border-color: var(--line); }
html :is(.share-url,.manual-upload-dropzone,.photo-filter-modes,.photo-filter-modes button,.photo-alert-toggle,.photo-source,.admin-note-preview,.watermark-preview,.smart-exposure-summary,.face-search-privacy,.face-search-status,.face-search-form,.note-admin-summary,.favorite-admin-summary,.tag,.storage-bar) { background-color: var(--surface); color: var(--muted); border-color: var(--line); }
html :is(.photo-filter-modes button.active,.photo-filter-modes button[aria-pressed="true"],.photo-alert-toggle[aria-pressed="true"]) { background: var(--ink); color: var(--inverse); }
html :is(.field-notes,.connection-card.accent) { background: var(--surface); color: var(--ink); border-color: var(--line); }
html :is(.field-notes,.connection-card.accent) :is(.eyebrow,.microcopy,dt) { color: var(--muted); }
html .connection-card.accent dl div { border-color: var(--line); }
html :is(.empty-state,.archive-section,.danger-zone,.face-search-dialog) { border-color: var(--line); }
html :is(.schedule-detail,.event-card-paused,.archive-state-pill) { background: var(--surface); color: var(--muted); }
html :is(.alert.success,.health-alert.healthy,.health-status-pill[data-status="healthy"],.photo-visibility,.telegram-state.enabled) { background: var(--positive-bg); color: var(--positive); }
html :is(.alert.warning,.health-alert.warning,.health-status-pill[data-status="warning"],.processing-state.paused,.health-queue-row[data-status="processing"]) { background: var(--warning-bg); color: var(--warning); }
html :is(.alert.error,.health-alert.critical,.health-status-pill[data-status="critical"],.telegram-last-error,.health-queue-row[data-status="failed"]) { background: var(--error-bg); color: var(--error); }
html :is(.health-queue-meta em,.health-queue-detail dl > div:first-child dd) { color: inherit; }
html .photo-status.ready { color: var(--positive); }
html .photo-visibility.off { background: var(--surface); color: var(--muted); }
html :is(.lightbox-nav,#lightbox-close) { background: #f4f5ef; color: #263229; }
html .face-search-close { color: var(--ink); }
@supports not (backdrop-filter: blur(9px)) {
  html .polished-glass,html .gallery-caption,html .gallery-header.has-cover .gallery-header-actions { background: rgba(19,29,24,.8); }
}
@media (max-width: 980px) {
  html .gallery-header.has-cover { align-items: flex-start; flex-direction: column; justify-content: flex-end; }
  html .landing-hero { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  html .topbar { padding: 0 12px; gap: 8px; }
  .topbar .brand { min-width: 0; max-width: 38%; font-size: 12px; overflow: hidden; }
  .topbar .brand-mark { flex-shrink: 0; width: 30px; height: 30px; font-size: 12px; }
  .topbar .brand-logo-frame { display: none; }
  .topbar .theme-label { display: none; }
  .topbar .theme-switcher button { padding: 0 7px; min-width: 28px; }
  .topbar-actions { gap: 4px; }
  html .topbar-actions .button { padding: 0 8px; font-size: 10px; }
  html .dashboard-menu { top: 70px; grid-template-columns: repeat(2,minmax(0,1fr)); margin-inline: 0; border: 1px solid var(--line); border-radius: 16px; padding: 5px; gap: 4px; }
  html .dashboard-menu-item { min-height: 56px; padding: 6px; gap: 5px; grid-template-columns: 28px minmax(0,1fr) auto; }
  html .dashboard-menu-icon { width: 26px; height: 30px; }
  .dashboard-menu-item strong { font-size: 11px; }
  .dashboard-menu-item small { font-size: 9px; }
  html .event-tab-list { background: var(--card); }
  html .gallery-analytics-panel { padding: 22px 18px; }
  html .analytics-total-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
  html .analytics-total-grid strong { font-size: 46px; }
  html .analytics-total-grid article { grid-template-columns: 1fr; gap: 10px; }
  html .analytics-total-grid article > span:last-child { grid-column: 1; font-size: 11px; }
  html .analytics-dot { grid-row: auto; }
  html .analytics-chart-shell { min-height: 280px; }
  html .event-card { min-height: 380px; }
  .direct-cover { height: 440px; min-height: 0; }
  .direct-cover-caption { left: 16px; bottom: 16px; max-width: calc(100% - 32px); padding: 22px; }
  html .landing-hero { padding: 50px 0; }
  html .landing-hero h1 { font-size: clamp(48px,13.8vw,76px); }
  html .landing-brand strong { display: block; font-size: 13px; }
  html .landing-gallery-card.has-cover { min-height: 420px; }
  html .gallery-header.has-cover { padding: 22px; min-height: 500px; }
  html .gallery-header.has-cover .gallery-header-actions { padding: 16px; width: 100%; }
  html .gallery-grid { gap: 8px; }
  html .gallery-counter { flex-wrap: wrap; gap: 12px; }
  .display-preferences { left: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html *,html *::before,html *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.direct-overview { grid-template-columns: minmax(0,1.7fr) minmax(280px,1fr); gap: 24px; align-items: stretch; }
.direct-overview .camera-sources-panel { padding: 26px; margin: 0; min-width: 0; }
.direct-overview .camera-sources-panel h2 { font-size: 27px; }
.direct-overview .camera-source-list { grid-template-columns: 1fr; max-height: 340px; overflow-y: auto; }
.direct-overview .camera-source-title { flex-wrap: wrap; }
.direct-overview .camera-sources-panel .section-heading { margin-top: 0; align-items: start; }
html .direct-cover { height: 470px; }
html :is(.telegram-event-options,.telegram-summary-option,.telegram-setup-card,.telegram-test-card,.telegram-history-card,.telegram-chat-results,.processing-state.bypassed) { background: var(--surface); color: var(--ink); }
html .telegram-chat-choice.selected { background: var(--surface); border-color: var(--sage); }
@media (max-width: 900px) { .direct-overview { grid-template-columns: 1fr; } }
html .watermark-settings select { background: var(--surface); color: var(--ink); border-color: var(--line); }
html .face-index-metrics > div { background: var(--surface); color: var(--ink); }
html .template-copy-list span { background: var(--surface); color: var(--muted); }
html :is(.gallery-selection-tools,.gallery-own-favorites,.face-search-admin-form,.face-search-close) { background: var(--card); color: var(--ink); border-color: var(--line); }
html .gallery-filter-tabs button { border-radius: 999px; }
html .gallery-header.has-cover .gallery-own-favorites { background: rgba(13,24,17,.3); }
html .gallery-own-favorites.active { color: var(--error); background: var(--error-bg); }
html .gallery-header.has-cover .gallery-own-favorites.active { color: #ffc9cf; }
html .gallery-favorite-button:not(.active),html .gallery-public-reactions span { background: rgba(19,29,24,.25); backdrop-filter: blur(9px) saturate(145%); -webkit-backdrop-filter: blur(9px) saturate(145%); font-weight: 400; }
html .lightbox-note-form label { color: rgba(255,255,255,.85); }
html .lightbox-note-form textarea { background: rgba(255,255,255,.08); color: #fff; }
html .lightbox-note-actions .text-button { color: #ffaaa1; }
html .lightbox-note-actions .button { background: #f4f5ef; color: #263229; }
.direct-cover::after { content: ""; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent,rgba(0,0,0,.45)); pointer-events: none; }
.direct-cover-caption { z-index: 1; }
:root { --accent: var(--sage); }
html :is(.note-admin-summary,.favorite-admin-summary,.face-search-dialog) { background: var(--card); color: var(--ink); }
html .admin-note-preview p { color: var(--muted); }
html :is(.note-admin-metrics div,.favorite-admin-metrics div) { border-color: var(--line); }
html :is(.event-lifecycle-panel.archived,.archived-import-state) { background: var(--warning-bg); color: var(--warning); border-color: var(--line); }
html .event-card.archived { background: var(--surface); min-height: 380px; }
html .event-card.archived h3 { color: inherit; }
html .archive-section summary strong { background: var(--surface); }
html .photo-filter-panel { background: var(--card); }
html .photo-filter-inputs select { background: var(--surface); }
html .photo-filter-modes span { background: var(--surface); color: var(--ink); }
html .photo-filter-modes button.active span { background: transparent; color: var(--inverse); }
/* Collection movement and bulk actions retain contrast in both themes. */
html .bulk-photo-toolbar { background: var(--card); color: var(--ink); border-color: var(--line); }
html .bulk-photo-actions button { background: var(--ink); color: var(--inverse); font-weight: 400; }
html .bulk-photo-actions button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
html .bulk-photo-actions button.danger { background: var(--error-bg); color: var(--error); border-color: var(--error); }
html .bulk-move-target select { background: var(--surface); color: var(--ink); }
html .photo-select-checkbox:checked + span::after { color: #172019; }
