:root {
  color-scheme: light;
  --bg: #f4f6f7;
  --panel: #ffffff;
  --ink: #172126;
  --muted: #65737d;
  --line: #d9e1e5;
  --soft: #eef3f4;
  --accent: #116a67;
  --accent-dark: #0c504e;
  --warn: #9a5b00;
  --bad: #9b1c31;
  --ok: #19734d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11181b;
  --panel: #182226;
  --ink: #ecf3f2;
  --muted: #a5b4b8;
  --line: #314248;
  --soft: #213035;
  --accent: #35a29b;
  --accent-dark: #62c7c1;
  --warn: #f1b968;
  --bad: #f08aa0;
  --ok: #78d9a9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body.public-auth {
  background: var(--bg);
}

body.public-auth .app-frame {
  display: none;
}

.public-landing {
  min-height: 100vh;
  background: var(--bg);
}

body.public-auth .public-landing {
  display: grid;
  grid-template-rows: auto 1fr;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 18px clamp(18px, 5vw, 64px);
}

.landing-nav strong {
  display: block;
  font-size: 24px;
}

.landing-actions,
.landing-cta,
.event-home-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(38px, 8vw, 92px) 0;
}

.landing-hero h1 {
  max-width: 760px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1;
}

.landing-copy {
  max-width: 680px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.landing-cta {
  margin-top: 24px;
}

.landing-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.landing-panel article {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  padding: 0 0 12px;
}

.landing-panel article:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.landing-panel span {
  color: var(--muted);
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  background: #c6d1d5;
  color: #526168;
  cursor: not-allowed;
}

:root[data-theme="dark"] button:disabled {
  background: #2d3a3f;
  color: #91a1a6;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background: #10191d;
  border-color: #3a4d54;
  color: #f4fbfa;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: #8fa2a8;
  opacity: 1;
}

:root[data-theme="dark"] select option {
  background: #10191d;
  color: #f4fbfa;
}

input,
select {
  min-height: 38px;
  padding: 7px 9px;
}

textarea {
  min-height: 168px;
  resize: vertical;
  padding: 10px;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.1;
}

h2 {
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.15;
}

h3 {
  font-size: 17px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.app-frame {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 20px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 22px 18px;
}

.brand-block {
  display: grid;
  gap: 10px;
}

.status-pill {
  justify-self: start;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  color: var(--muted);
  background: #f9fbfb;
  white-space: nowrap;
  font-size: 13px;
}

.status-pill.ready {
  color: var(--ok);
  border-color: #acd8c5;
  background: #eef9f3;
}

.status-pill.mock {
  color: var(--warn);
  border-color: #f0cd92;
  background: #fff7e8;
}

.status-pill[hidden] {
  display: none;
}

.nav-list {
  display: grid;
  gap: 16px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 38px;
  width: 100%;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 0 12px;
}

.nav-item:hover,
.nav-item.active {
  background: var(--soft);
  color: var(--accent-dark);
}

.nav-item.quiet {
  color: var(--muted);
}

.sidebar-note {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-note strong {
  color: var(--ink);
}

.app-version-footer {
  align-self: end;
  margin-top: auto;
}

.auth-card {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
}

.context-card {
  display: grid;
  gap: 8px;
  border: 1px solid #b9ddd6;
  border-radius: 8px;
  background: #eef9f7;
  padding: 12px;
}

:root[data-theme="dark"] .context-card,
:root[data-theme="dark"] .station-runtime-header,
:root[data-theme="dark"] .event-card.active,
:root[data-theme="dark"] .session-row.active,
:root[data-theme="dark"] .pilot-check-item.done {
  background: #17322f;
}

.context-card span {
  color: var(--muted);
  font-size: 13px;
}

.context-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-grid {
  grid-template-columns: minmax(320px, 0.75fr) minmax(360px, 1fr);
}

.billing-summary-panel {
  align-content: start;
}

.billing-provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}

.billing-provider-row span {
  color: var(--muted);
  font-size: 13px;
}

.billing-provider-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.billing-provider-options button {
  width: auto;
}

.billing-provider-options button.active {
  background: var(--accent);
  color: #fff;
}

.billing-offer-list {
  display: grid;
  gap: 12px;
}

.billing-offer-list article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--soft) 55%, var(--panel));
  padding: 14px;
}

.billing-offer-list span {
  color: var(--muted);
}

.access-user-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.access-user-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.access-user-row.protected {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
}

.access-user-main {
  display: grid;
  gap: 8px;
}

.access-user-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.access-user-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
}

.access-user-row .meta {
  color: var(--muted);
  font-size: 13px;
}

.access-protected-note {
  color: var(--muted);
  font-size: 13px;
}

.badge.neutral {
  background: var(--soft);
  color: var(--muted);
  border-color: var(--line);
}

.support-state-panel {
  margin-top: 12px;
}

.support-state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.support-state-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
}

.support-state-grid strong {
  display: block;
  font-size: 20px;
}

.policy-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
}

.policy-footer-links a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.policy-footer-links a:hover {
  color: var(--accent);
}

.policy-page {
  display: grid;
  gap: 14px;
  width: min(760px, calc(100vw - 32px));
  margin: 40px auto;
  color: var(--text);
}

.policy-page h1,
.policy-page h2,
.policy-page p {
  margin: 0;
}

.policy-page h1 {
  font-size: 34px;
}

.policy-page h2 {
  margin-top: 12px;
  font-size: 20px;
}

.policy-page a {
  color: var(--accent);
}

.access-user-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.access-user-actions button {
  min-height: 34px;
}

.auth-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.auth-card > div {
  display: none;
}

.auth-card button {
  white-space: nowrap;
}

.top-utility-bar {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.icon-only,
.icon-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  width: 38px;
  height: 38px;
  padding: 0;
}

.icon-action {
  border-radius: 10px;
  color: var(--ink);
}

.icon-action.icon-active {
  color: var(--accent-dark);
}

.icon-action.icon-completed {
  color: var(--ok);
}

.icon-action.icon-draft {
  color: var(--warn);
}

.icon-action.icon-archive {
  color: var(--muted);
}

.icon-action.icon-delete {
  color: #fff;
}

.icon-action .ui-icon {
  width: 19px;
  height: 19px;
}

.top-utility-bar .icon-only {
  min-width: 32px;
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--muted);
}

.top-utility-bar .icon-only:hover,
.top-utility-bar .icon-only:focus-visible {
  background: var(--soft);
  color: var(--ink);
}

.top-utility-bar .icon-only:disabled {
  background: transparent;
  color: var(--muted);
  opacity: 0.55;
}

.top-utility-bar .theme-toggle .ui-icon,
.landing-actions .theme-toggle .ui-icon {
  width: 22px;
  height: 22px;
}

.design-mode-control {
  align-items: center;
  grid-auto-flow: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.design-mode-control select {
  width: auto;
  min-height: 32px;
  border-radius: 999px;
  padding: 4px 28px 4px 10px;
  font-size: 12px;
}

.ui-icon {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.user-menu-name {
  min-height: 32px;
  background: transparent;
  color: var(--ink);
  padding: 0;
}

.user-menu-name:hover,
.user-menu-name:focus-visible {
  background: transparent;
  color: var(--accent-dark);
  text-decoration: underline;
}

.restore-event-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.workspace {
  min-width: 0;
  padding: 24px clamp(18px, 4vw, 42px) 42px;
}

.top-account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

body.design-welcome {
  --bg: #eee8dc;
  --panel: #fbf7ef;
  --ink: #2f2924;
  --muted: #81766b;
  --line: #ded4c5;
  --soft: #f5eee5;
  --accent: #cf5d36;
  --accent-dark: #a94224;
  background: radial-gradient(circle at 50% 12%, #f8f3eb 0, #eee8dc 42%, #e5ded2 100%);
}

:root[data-theme="dark"] body.design-welcome {
  --bg: #18130f;
  --panel: #211b16;
  --ink: #f4ece1;
  --muted: #b8aa9b;
  --line: #3a3028;
  --soft: #2b231d;
  --accent: #d96a40;
  --accent-dark: #f19b78;
  background: radial-gradient(circle at 50% 8%, #2a211b 0, #17120f 45%, #0f0d0b 100%);
}

body.design-welcome:not(.station-link-mode) .app-frame {
  grid-template-columns: 1fr;
}

body.design-welcome:not(.station-link-mode) .sidebar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 58px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(18px);
  padding: 10px clamp(18px, 4vw, 42px);
}

body.design-welcome .brand-block {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.design-welcome .brand-block::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--accent);
  box-shadow: inset 0 0 0 6px color-mix(in srgb, #fff 22%, transparent);
}

body.design-welcome .brand-block .eyebrow,
body.design-welcome .brand-block .status-pill,
body.design-welcome .context-card,
body.design-welcome .nav-group .eyebrow {
  display: none;
}

body.design-welcome .brand-block h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  letter-spacing: -0.01em;
}

body.design-welcome .nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

body.design-welcome .nav-group {
  display: contents;
}

body.design-welcome .nav-item {
  width: auto;
  min-height: 31px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 0 12px;
}

body.design-welcome .nav-item:hover,
body.design-welcome .nav-item.active {
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  color: var(--accent);
}

body.design-welcome .nav-item.quiet {
  opacity: 0.6;
}

body.design-welcome .workspace {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding-top: 30px;
}

body.design-welcome .top-account-bar {
  position: fixed;
  top: 12px;
  right: clamp(18px, 4vw, 42px);
  z-index: 7;
  margin: 0;
}

body.design-welcome .top-account-bar > div:first-child,
body.design-welcome .top-utility-bar > div {
  display: none;
}

body.design-welcome .top-utility-bar {
  gap: 8px;
  margin: 0;
}

body.design-welcome .top-utility-bar .icon-only,
body.design-welcome .user-menu-name {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

body.design-welcome .user-menu-name {
  max-width: 110px;
  overflow: hidden;
  padding: 0 10px;
  text-overflow: ellipsis;
}

body.design-welcome #view-events > .page-header,
body.design-welcome #view-monitor > .page-header,
body.design-welcome #liveMetrics,
body.design-welcome .event-home-panel {
  display: none;
}

.station-link-mode .sidebar,
.station-link-mode #view-events,
.station-link-mode #view-attendees,
.station-link-mode #view-enrolment,
.station-link-mode #view-monitor,
.station-link-mode #view-prototype,
.station-link-mode .station-admin-panel {
  display: none;
}

.station-link-mode .app-frame {
  grid-template-columns: 1fr;
}

.station-link-mode .workspace {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.station-link-gate {
  display: grid;
  gap: 14px;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}

.station-link-gate[hidden],
.station-link-unlocked .station-link-gate {
  display: none;
}

.station-link-mode #view-camera {
  display: none;
}

.station-link-mode.station-link-unlocked #view-camera {
  display: grid;
}

.access-banner {
  display: grid;
  gap: 4px;
  border: 1px solid #f0cd92;
  border-radius: 8px;
  background: #fff7e8;
  color: var(--warn);
  margin-bottom: 18px;
  padding: 14px 16px;
}

:root[data-theme="dark"] .access-banner {
  background: #302515;
}

.access-banner[hidden] {
  display: none;
}

.access-banner span {
  color: #745024;
}

.organisation-setup {
  display: grid;
  gap: 16px;
  max-width: 720px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
}

.organisation-setup h2,
.organisation-setup p {
  margin: 0;
}

.organisation-setup p {
  color: var(--muted);
}

.organisation-setup[hidden] {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

.view.locked {
  display: none;
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.monitor-grid {
  align-items: start;
}

.event-create-panel,
.event-list-panel,
.session-panel,
.pilot-checklist-panel,
.event-home-panel {
  grid-column: 1 / -1;
}

.event-controls,
.event-create-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.event-controls {
  grid-template-columns: minmax(0, 1fr);
}

.event-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.event-filter-row input {
  min-width: 180px;
}

.event-create-grid.compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.dev-sync-panel[hidden] {
  display: none;
}

.event-card-list,
.session-list,
.operations-list,
.pilot-checklist,
.roster-list {
  display: grid;
  gap: 10px;
}

.event-card,
.session-row,
.operation-row,
.roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.event-card.active {
  border-color: #9bd2c8;
  background: #eef9f7;
}

.event-card {
  cursor: pointer;
}

.event-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.compact-action {
  min-width: 72px;
  padding: 8px 10px;
}

.field-label-row {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
}

.field-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--accent-dark);
  cursor: help;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  position: relative;
  top: -0.55em;
}

.field-help:hover,
.field-help.active {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
}

.help-popover {
  position: fixed;
  z-index: 30;
  max-width: min(320px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.2);
  color: var(--ink);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}

.help-popover[hidden] {
  display: none;
}

.icon-danger {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.session-row {
  cursor: pointer;
}

.session-row.active {
  border-color: #9bd2c8;
  background: #eef9f7;
}

.pilot-progress {
  overflow: hidden;
  border-radius: 999px;
  height: 8px;
  background: var(--soft);
  margin-bottom: 12px;
}

.pilot-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 180ms ease;
}

.pilot-check-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
}

.pilot-check-item.done {
  border-color: #9bd2c8;
  background: #eef9f7;
}

.pilot-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff4df;
  color: var(--warn);
  font-weight: 800;
}

.pilot-check-item.done .pilot-check-icon {
  background: #eaf7f0;
  color: var(--ok);
}

.enrollment-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.enrollment-thumbs img,
.thumb-more {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  background: var(--soft);
}

.thumb-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.session-row .actions {
  flex-wrap: nowrap;
}

.operation-row {
  align-items: flex-start;
}

.operation-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  min-width: min(420px, 50%);
}

.operation-times span {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 0.85rem;
}

.operation-times strong {
  color: var(--ink);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.attempt-snapshot {
  width: 100%;
  max-height: 220px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  background: var(--soft);
}

.match-debug {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  padding: 8px;
}

.match-debug img {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
}

.empty-state {
  display: grid;
  gap: 4px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: var(--panel);
}

.empty-state strong {
  color: var(--ink);
}

.panel {
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  min-width: 0;
}

.welcome-event-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.42fr);
  gap: clamp(20px, 4vw, 46px);
  align-items: end;
  min-height: 470px;
  padding: clamp(38px, 7vw, 78px) clamp(18px, 4vw, 58px);
}

.welcome-event-home[hidden],
.welcome-monitor[hidden],
.welcome-station-confirm[hidden] {
  display: none;
}

.welcome-hero-copy {
  display: grid;
  gap: 18px;
  max-width: 730px;
}

.welcome-kicker,
.welcome-section-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.welcome-hero-copy h2,
.welcome-monitor-rail h2,
.welcome-station-confirm h2 {
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 0.94;
}

.welcome-hero-copy p,
.welcome-station-confirm p {
  max-width: 520px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.welcome-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.welcome-step {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 8px;
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 92%, #fff);
  color: var(--ink);
  padding: 18px;
  text-align: left;
}

.welcome-step:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--panel);
}

.welcome-step-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  color: var(--accent);
}

.welcome-step-number {
  position: absolute;
  top: 18px;
  right: 18px;
  color: color-mix(in srgb, var(--muted) 45%, transparent);
  font-size: 26px;
  font-weight: 800;
}

.welcome-step span:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.welcome-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.welcome-actions button {
  min-height: 44px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 22%, transparent);
}

.welcome-event-snapshot {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 24px 80px rgba(63, 49, 38, 0.14);
  padding: 18px;
}

.welcome-event-snapshot strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1;
}

.welcome-snapshot-metrics,
.welcome-monitor-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.welcome-snapshot-metrics div,
.welcome-monitor-counts div {
  display: grid;
  gap: 2px;
}

.welcome-snapshot-metrics strong,
.welcome-monitor-counts strong {
  font-family: inherit;
  font-size: 24px;
}

.welcome-snapshot-metrics span,
.welcome-monitor-counts span,
.welcome-event-snapshot small {
  color: var(--muted);
  font-size: 12px;
}

.welcome-progress-track {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--soft);
}

.welcome-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.welcome-monitor {
  display: grid;
  grid-template-columns: minmax(230px, 0.33fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.16);
  min-height: 560px;
}

.welcome-monitor-rail {
  display: grid;
  align-content: start;
  gap: 16px;
  border-right: 1px solid var(--line);
  padding: 28px 24px;
}

.welcome-monitor-rail h2 {
  font-size: clamp(32px, 4vw, 48px);
}

.welcome-monitor-rail p {
  color: var(--muted);
}

.welcome-donut {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--panel) 0 54%, transparent 55%),
    conic-gradient(var(--ok) var(--progress), color-mix(in srgb, var(--line) 70%, transparent) 0);
}

.welcome-donut strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1;
}

.welcome-donut span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.welcome-station-summary {
  display: grid;
  gap: 10px;
  list-style: none;
  padding: 0;
}

.welcome-station-summary li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.welcome-station-summary li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  margin-top: 6px;
}

.welcome-station-summary span {
  flex: 1;
}

.welcome-arrivals {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 26px;
}

.welcome-arrivals-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.welcome-arrival-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.welcome-arrival-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 156px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--soft) 60%, var(--panel));
  padding: 18px 12px;
  text-align: center;
}

.welcome-arrival-card span,
.welcome-arrival-card small,
.welcome-arrival-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.welcome-arrival-card em {
  opacity: 0.78;
}

.welcome-avatar {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: linear-gradient(135deg, #f3a38c, #b93f2b);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.welcome-avatar.teal { background: linear-gradient(135deg, #00a8b9, #006b7c); }
.welcome-avatar.plum { background: linear-gradient(135deg, #b84791, #742b68); }
.welcome-avatar.green { background: linear-gradient(135deg, #0c9b5e, #087043); }
.welcome-avatar.rust { background: linear-gradient(135deg, #d55e34, #8a2418); }
.welcome-avatar.violet { background: linear-gradient(135deg, #7658c8, #4b348e); }
.welcome-avatar.blue { background: linear-gradient(135deg, #0aa7d8, #0873a0); }
.welcome-avatar.magenta { background: linear-gradient(135deg, #c047a8, #7d247a); }

.welcome-station-confirm {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.55fr);
  gap: clamp(20px, 5vw, 62px);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: clamp(28px, 6vw, 74px);
}

.welcome-confirm-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--soft) 66%, var(--panel));
  padding: 24px;
  text-align: center;
}

.welcome-avatar.station {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffc1a8, #f48f70);
  color: #981b2e;
  font-size: 34px;
}

.welcome-confirm-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  line-height: 1.05;
}

.welcome-confirm-card span {
  color: var(--muted);
}

.welcome-confirm-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 24, 39, 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.confirm-dialog {
  display: grid;
  gap: 14px;
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.25);
}

.confirm-dialog h2,
.confirm-dialog p {
  margin: 0;
}

.confirm-dialog:not(.requires-typed-confirmation) .confirm-typed-field {
  display: none !important;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.hint.success {
  color: var(--ok);
}

.hint.error {
  color: var(--bad);
}

.attendee-list,
.review-list,
.attendance-list,
.face-scan-list {
  display: grid;
  gap: 10px;
}

.review-list,
.attendance-list {
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}

.review-tools {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.segmented-control {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.segmented-control button {
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.segmented-control button.active {
  background: var(--accent);
  color: #fff;
}

.manual-checkin-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 10px;
  align-items: end;
}

.manual-checkin-form label:nth-of-type(3) {
  grid-column: 1 / -1;
}

.manual-checkin-form button {
  justify-self: start;
  min-width: 160px;
}

.review-correction-field {
  display: grid;
  gap: 6px;
}

.attendee-card,
.review-card,
.attendance-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel);
}

:root[data-theme="dark"] .attendee-card,
:root[data-theme="dark"] .review-card,
:root[data-theme="dark"] .attendance-card,
:root[data-theme="dark"] .metric,
:root[data-theme="dark"] .latest-result,
:root[data-theme="dark"] .face-scan-card,
:root[data-theme="dark"] .station-panel,
:root[data-theme="dark"] .station-mode-panel,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .match-debug {
  background: #142024;
  border-color: #3a4d54;
  color: #f4fbfa;
}

:root[data-theme="dark"] .attendee-card strong,
:root[data-theme="dark"] .review-card strong,
:root[data-theme="dark"] .attendance-card strong,
:root[data-theme="dark"] .metric strong {
  color: #f8fffd;
}

:root[data-theme="dark"] .meta,
:root[data-theme="dark"] .metric .meta {
  color: #b6c7cc;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge.ok {
  background: #eaf7f0;
  color: var(--ok);
}

.badge.warn {
  background: #fff4df;
  color: var(--warn);
}

.badge.bad {
  background: #fdebee;
  color: var(--bad);
}

:root[data-theme="dark"] .badge {
  border: 1px solid #3c555c;
  background: #213035;
  color: #d7e7ea;
}

:root[data-theme="dark"] .badge.ok {
  border-color: #32684f;
  background: #17382a;
  color: #91e8ba;
}

:root[data-theme="dark"] .badge.warn {
  border-color: #755424;
  background: #322512;
  color: #ffd28a;
}

:root[data-theme="dark"] .badge.bad {
  border-color: #713343;
  background: #351820;
  color: #ff9caf;
}

.camera-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  gap: 16px;
  align-items: start;
}

.station-mode-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.station-runtime-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #b9ddd6;
  border-radius: 8px;
  background: #eef9f7;
  padding: 14px 16px;
}

.station-runtime-header span:not(.badge) {
  color: var(--muted);
  font-size: 14px;
}

.station-running .station-mode-panel,
.station-running .station-device-controls {
  display: none;
}

.station-admin-panel {
  margin-bottom: 16px;
}

.station-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.inline-status {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  opacity: 1;
  transition: opacity 500ms ease, transform 500ms ease;
}

.inline-status.success {
  color: var(--ok);
}

.inline-status.error {
  color: var(--bad);
}

.inline-status.fading {
  opacity: 0;
  transform: translateY(-3px);
}

.inline-status[hidden] {
  display: none;
}

.station-mode-intro {
  display: grid;
  gap: 4px;
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.station-mode-intro span {
  color: var(--muted);
  font-size: 13px;
}

.station-option-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.station-option-row button {
  margin-left: auto;
}

.station-list {
  display: grid;
  gap: 10px;
}

.station-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.station-card.expired {
  border-color: #f1c27d;
  background: var(--panel);
}

.station-card.station-attention {
  border-color: #efb8c2;
}

.station-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.station-card button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.station-link-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.station-link {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.link-copy-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 7px;
  color: var(--muted);
}

.link-copy-icon .ui-icon {
  width: 15px;
  height: 15px;
}

.link-copy-icon.copied,
button.copied {
  background: var(--ok);
  color: #fff;
}

.station-actions {
  justify-content: start;
}

.station-actions.locked .secondary {
  opacity: 0.55;
}

.camera-box {
  overflow: hidden;
  border-radius: 8px;
  background: #10171b;
  aspect-ratio: 16 / 9;
  min-height: 360px;
}

video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.station-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.latest-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 132px;
  padding: 12px;
  background: var(--panel);
  line-height: 1.5;
}

.face-scan-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 8px;
}

.face-scan-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #10171b;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.secondary {
  background: #dfe8ea;
  color: var(--accent-dark);
}

.secondary:hover {
  background: #cbd9dd;
}

:root[data-theme="dark"] .secondary {
  background: #213035;
  color: #d7f7f4;
  border: 1px solid #3c555c;
}

:root[data-theme="dark"] .secondary:hover {
  background: #2b4248;
}

.danger {
  background: var(--bad);
}

.danger:hover {
  background: #761426;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
}

.check-row input {
  width: auto;
}

.settings-panel {
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.settings-panel .section-title {
  grid-column: 1 / -1;
}

.evaluation-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.5fr);
  gap: 8px;
}

.evaluation-form textarea {
  grid-column: 1 / -1;
  min-height: 70px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.live-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}

.metric strong {
  display: block;
  font-size: 20px;
  line-height: 1.25;
}

.wide-metric {
  grid-column: span 2;
}

.roadmap-list {
  display: grid;
  gap: 10px;
}

.roadmap-list div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel);
}

.roadmap-list strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
}

@media (max-width: 980px) {
  .landing-hero {
    grid-template-columns: 1fr;
  }

  .app-frame {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-item {
    text-align: center;
  }

  .top-account-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-card {
    justify-content: space-between;
    min-width: 0;
  }

  .content-grid,
  .camera-stage,
  .station-mode-panel,
  .station-form-grid,
  .welcome-event-home,
  .welcome-monitor,
  .welcome-station-confirm,
  .manual-checkin-form,
  .event-controls,
  .event-create-grid,
  .settings-panel,
  .metrics-grid,
  .live-metrics,
  .evaluation-form,
  .review-tools {
    grid-template-columns: 1fr;
  }

  .access-user-row {
    grid-template-columns: 1fr;
  }

  .access-user-actions {
    justify-content: flex-start;
  }

  .wide-metric {
    grid-column: auto;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    justify-content: start;
  }

  .camera-box {
    min-height: 240px;
  }

  .operation-times {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  .event-filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .event-filter-row input {
    min-width: 0;
  }

  body.design-welcome:not(.station-link-mode) .sidebar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  body.design-welcome .top-account-bar {
    position: static;
    justify-content: flex-start;
    margin-bottom: 16px;
  }

  .welcome-event-home {
    min-height: 0;
    padding: 24px 0;
  }

  .welcome-steps,
  .welcome-arrival-grid,
  .welcome-snapshot-metrics,
  .welcome-monitor-counts {
    grid-template-columns: 1fr;
  }

  .welcome-monitor {
    min-height: 0;
  }

  .welcome-monitor-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  .landing-nav,
  .landing-actions,
  .landing-cta,
  .event-home-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .landing-actions button,
  .landing-cta button,
  .event-home-actions button {
    width: 100%;
  }

  body.design-welcome .nav-list {
    align-items: stretch;
    flex-direction: column;
  }

  body.design-welcome .nav-item {
    width: 100%;
    text-align: left;
  }

  .welcome-hero-copy h2,
  .welcome-station-confirm h2 {
    font-size: 40px;
  }

  .welcome-confirm-actions {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 16px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .auth-card {
    align-items: stretch;
    flex-direction: column;
  }

  .station-card {
    grid-template-columns: 1fr;
  }

  .station-option-row button {
    margin-left: 0;
    width: 100%;
  }

  .session-row,
  .pilot-check-item,
  .operation-row,
  .event-card {
    align-items: stretch;
    flex-direction: column;
  }

  .event-row-actions {
    justify-content: start;
  }
}

