:root {
  color-scheme: light;
  --color-white: #fff;
  --color-black: #000;
  --color-gray-50: #fafafa;
  --color-gray-70: #f6f6f6;
  --color-gray-100: #fff;
  --color-gray-200: #e6e6e6;
  --color-gray-300: #cecece;
  --color-gray-400: #b5b5b5;
  --color-gray-500: #9d9d9d;
  --color-gray-600: #848484;
  --color-gray-700: #6c6c6c;
  --color-gray-800: #535353;
  --color-gray-900: #3b3b3b;
  --color-primary-1000: #222;
  --color-red-50: #fff1f1;
  --color-red-500: #ef4444;
  --color-red-700: #b91c1c;
  --color-blue-500: #2d73ff;
  --color-blue-700: #1d4ed8;
  --color-green-500: #31e4aa;
  --color-green-700: #0f7353;
  --color-amber-50: #fffbeb;
  --color-amber-500: #f59e0b;
  --color-amber-700: #92400e;
  --background: var(--color-gray-50);
  --foreground: var(--color-primary-1000);
  --card: var(--color-white);
  --card-foreground: var(--color-primary-1000);
  --popover: var(--color-white);
  --popover-foreground: var(--color-primary-1000);
  --primary: var(--color-primary-1000);
  --primary-foreground: var(--color-gray-100);
  --secondary: rgba(0, 0, 0, .04);
  --secondary-foreground: var(--color-primary-1000);
  --muted: rgba(0, 0, 0, .04);
  --muted-foreground: var(--color-gray-700);
  --accent: rgba(0, 0, 0, .04);
  --accent-foreground: var(--color-primary-1000);
  --destructive: var(--color-red-500);
  --destructive-foreground: var(--color-red-700);
  --info: var(--color-blue-500);
  --info-foreground: var(--color-blue-700);
  --success: var(--color-green-500);
  --success-foreground: var(--color-green-700);
  --warning: var(--color-amber-500);
  --warning-foreground: var(--color-amber-700);
  --border: rgba(0, 0, 0, .08);
  --input: rgba(0, 0, 0, .1);
  --ring: var(--color-gray-400);
  --sidebar: var(--color-gray-70);
  --sidebar-foreground: var(--color-gray-700);
  --sidebar-primary: var(--color-primary-1000);
  --sidebar-primary-foreground: var(--color-gray-100);
  --sidebar-accent: rgba(0, 0, 0, .04);
  --sidebar-accent-foreground: var(--color-primary-1000);
  --sidebar-border: rgba(0, 0, 0, .06);
  --sidebar-ring: var(--color-gray-400);
  --radius: .625rem;
  --font-sans: Geist, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body { position: relative; isolation: isolate; min-height: 100%; margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-sans); font-synthesis: none; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: .5rem; font-size: clamp(1.75rem, 7vw, 2.25rem); line-height: 1.12; letter-spacing: -.03em; }
h2 { margin-bottom: .5rem; font-size: 1.25rem; line-height: 1.25; letter-spacing: -.02em; }
h3 { margin-bottom: .375rem; font-size: 1rem; line-height: 1.35; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

.ui-card { border: 1px solid var(--border); border-radius: calc(var(--radius) + .25rem); background: var(--card); color: var(--card-foreground); }
.ui-button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px; border: 1px solid var(--input); border-radius: var(--radius); padding: .625rem .875rem; background: var(--background); color: var(--foreground); font-size: .875rem; font-weight: 600; line-height: 1; }
.ui-button-default { border-color: var(--primary); background: var(--primary); color: var(--primary-foreground); }
.ui-button-ghost, .ui-button-link { border-color: transparent; background: transparent; }
.ui-button-link { justify-content: flex-start; padding-inline: 0; text-decoration: underline; text-underline-offset: 3px; }
.ui-badge { display: inline-flex; align-items: center; width: fit-content; min-height: 26px; border-radius: 999px; padding: .25rem .625rem; background: var(--secondary); color: var(--secondary-foreground); font-size: .75rem; font-weight: 600; line-height: 1; }
.ui-alert { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.ui-alert.warning { border-color: color-mix(in srgb, var(--warning) 28%, transparent); background: var(--color-amber-50); color: var(--warning-foreground); }
.ui-nav-tabs { border-bottom: 1px solid var(--border); }
.ui-nav-tab { position: relative; border: 0; background: transparent; color: var(--muted-foreground); }
.ui-nav-tab[aria-pressed="true"] { color: var(--foreground); }
.ui-nav-tab[aria-pressed="true"]::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--primary); content: ""; }

.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: min(100%, 420px); padding: 1.5rem; }
.brand-lockup { display: inline-flex; align-items: center; gap: .625rem; color: var(--foreground); }
.brand-symbol { display: inline-flex; width: 32px; height: 32px; flex: 0 0 auto; }
.brand-symbol svg { display: block; width: 100%; height: 100%; }
.brand-word { font-size: 1rem; font-weight: 700; letter-spacing: -.025em; }
.auth-card > .brand-lockup { margin-bottom: 3.5rem; }
.auth-card h1 { max-width: 13ch; margin-bottom: .75rem; }
.lede { max-width: 65ch; margin-bottom: 1.5rem; color: var(--muted-foreground); line-height: 1.55; }
.lede strong { color: var(--foreground); font-weight: 600; }
.field { display: grid; gap: .5rem; margin-bottom: 1rem; }
.field label { font-size: .875rem; font-weight: 600; }
.field input, .field textarea, .field select { width: 100%; min-height: 44px; border: 1px solid var(--input); border-radius: var(--radius); background: var(--background); padding: .625rem .75rem; color: var(--foreground); }
.field textarea { min-height: 112px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ring); outline: 3px solid color-mix(in srgb, var(--ring) 25%, transparent); }
.primary-button, .secondary-button, .quiet-button, .danger-button { min-height: 44px; border-radius: var(--radius); padding: .625rem .875rem; font-weight: 600; }
.primary-button { width: 100%; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-foreground); }
.secondary-button { border: 1px solid var(--input); background: var(--background); color: var(--foreground); }
.quiet-button { border: 1px solid transparent; background: transparent; color: var(--foreground); }
.danger-button { border: 1px solid color-mix(in srgb, var(--destructive) 24%, transparent); background: var(--color-red-50); color: var(--destructive-foreground); }
.error-message { min-height: 22px; margin: .75rem 0 0; color: var(--destructive-foreground); font-size: .875rem; line-height: 1.45; }

.app-shell { min-height: 100dvh; padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
.app-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 1rem 0; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--background) 92%, transparent); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); }
.app-brand { display: flex; align-items: center; gap: .625rem; min-width: 0; }
.app-brand .brand-symbol { width: 28px; height: 28px; }
.app-brand .brand-word { display: none; }
.event-name { overflow: hidden; font-size: .9375rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.role-chip { flex: 0 0 auto; }
.connection-banner { margin: .75rem 1rem 0; padding: .75rem; text-align: center; font-size: .8125rem; font-weight: 600; }
.view { width: min(100%, 920px); margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.view:focus { outline: none; }
.view-heading { margin: .25rem 0 1.5rem; }
.view-heading h1 { margin: 0; }
.view-heading p { margin: .375rem 0 0; color: var(--muted-foreground); font-size: .875rem; line-height: 1.4; }

.announcement-feed:not(:empty) { display: grid; gap: .75rem; margin-bottom: 1rem; }
.announcement { display: grid; gap: .625rem; padding: .875rem; }
.announcement p { margin: 0; line-height: 1.45; }
.announcement-type { text-transform: capitalize; }
.announcement.important { border-color: color-mix(in srgb, var(--warning) 25%, transparent); background: var(--color-amber-50); }
.announcement.urgent { border-color: color-mix(in srgb, var(--destructive) 25%, transparent); background: var(--color-red-50); }
.announcement.urgent .announcement-type { color: var(--destructive-foreground); }
.timeline { display: grid; gap: .75rem; }
.moment-card { padding: 1rem; }
.moment-card.current { border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.moment-card.next { background: var(--color-gray-70); }
.moment-card h2 { max-width: 28ch; margin-bottom: .25rem; font-size: 1.25rem; }
.moment-label { margin-bottom: .875rem; color: var(--muted-foreground); font-size: .75rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.moment-time { margin-bottom: .25rem; font-variant-numeric: tabular-nums; font-size: .875rem; font-weight: 650; }
.room-link { min-height: 44px; border: 0; background: transparent; padding: .625rem 0; color: var(--foreground); font-weight: 600; text-align: left; }

.day-tabs { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 1rem; }
.day-tab { display: grid; place-items: center; gap: .125rem; min-height: 52px; padding: .5rem .25rem; }
.day-tab span { font-size: .75rem; }
.day-tab strong { font-size: .875rem; font-weight: 600; }
.schedule-list { overflow: hidden; }
.session-row { border-bottom: 1px solid var(--border); }
.session-row:last-child { border-bottom: 0; }
.session-row summary { display: grid; grid-template-columns: 54px 1fr; gap: .75rem; min-height: 72px; padding: 1rem; list-style: none; cursor: pointer; }
.session-row summary::-webkit-details-marker { display: none; }
.session-row summary time { font-variant-numeric: tabular-nums; font-size: .875rem; font-weight: 650; }
.session-row summary span { display: grid; gap: .25rem; line-height: 1.3; }
.session-row summary strong { font-size: .9375rem; }
.session-row summary small { color: var(--muted-foreground); font-size: .8125rem; }
.session-row[open] { background: var(--color-gray-70); }
.session-detail { margin: 0; padding: 0 1rem 1rem 4.75rem; line-height: 1.5; }
.session-detail p { max-width: 65ch; }
.session-detail p:last-of-type { margin-bottom: .5rem; }

.activity-day { margin-bottom: 2rem; }
.activity-day > h2 { margin: 0 0 .75rem; font-size: 1rem; }
.activity-row { display: grid; grid-template-columns: 52px 1fr; gap: .75rem; margin-bottom: .625rem; padding: 1rem; }
.activity-row time { font-variant-numeric: tabular-nums; font-size: .875rem; font-weight: 650; }
.activity-row h3 { margin-bottom: .25rem; }
.activity-row p { max-width: 65ch; margin-bottom: .25rem; color: var(--muted-foreground); line-height: 1.45; }
.info-list { overflow: hidden; margin: 0 0 1rem; padding: 0 1rem; }
.info-list div { display: grid; grid-template-columns: minmax(100px, .85fr) 1.35fr; gap: 1rem; padding: .875rem 0; border-bottom: 1px solid var(--border); }
.info-list div:last-child { border-bottom: 0; }
.info-list dt { color: var(--muted-foreground); }
.info-list dd { margin: 0; font-weight: 600; }
.more-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.compact { width: auto; }
.install-card { margin: 1rem 0; padding: 1rem; }
.install-card h2 { font-size: 1rem; }
.install-card p { max-width: 65ch; color: var(--muted-foreground); line-height: 1.5; }

.map-surface { overflow: hidden; margin: 0 0 1rem; }
.map-frame { overflow: hidden; min-height: 280px; background: var(--card); pointer-events: none; user-select: none; }
.map-frame svg { display: block; width: 100%; height: auto; min-height: 280px; }
.map-frame svg text { font-family: var(--font-sans) !important; }
.map-surface figcaption { margin: 0; padding: .75rem 1rem; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: .8125rem; line-height: 1.45; }
.room-directory { padding: 0 1rem; border: 1px solid var(--border); border-radius: calc(var(--radius) + .25rem); background: var(--card); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.section-heading h2 { margin: 0; }
.room-directory-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 58px; padding: .75rem 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.room-directory-row:last-child { border-bottom: 0; }
.room-directory-row div { display: grid; gap: .125rem; }
.room-directory-row div span, .room-directory-row > span { color: var(--muted-foreground); }

.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.admin-head h1 { margin: 0; }
.admin-tabs { display: flex; gap: 1.25rem; overflow-x: auto; margin: 0 0 1rem; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab { flex: 0 0 auto; min-height: 44px; padding: .5rem 0; font-size: .875rem; font-weight: 600; }
.admin-panel { padding: 1rem; border: 1px solid var(--border); border-radius: calc(var(--radius) + .25rem); background: var(--card); }
.admin-panel h2 { font-size: 1.125rem; }
.admin-grid { display: grid; gap: .75rem; }
.admin-list { display: grid; margin-top: 1.25rem; }
.admin-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .75rem; padding: .875rem 0; border-top: 1px solid var(--border); }
.admin-item p { margin: .25rem 0 0; color: var(--muted-foreground); font-size: .8125rem; }
.admin-item-actions { display: flex; gap: .25rem; }
.status-note { min-height: 22px; margin: .75rem 0 0; color: var(--success-foreground); font-size: .875rem; }
.status-note.error { color: var(--destructive-foreground); }
.admin-offline { margin: 0 0 1rem; padding: .75rem; font-weight: 600; }

.ios-tab-bar { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); min-height: calc(49px + env(safe-area-inset-bottom)); padding: 3px .375rem env(safe-area-inset-bottom); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%); }
.nav-button { display: grid; place-items: center; align-content: center; gap: 2px; min-width: 0; min-height: 49px; border: 0; background: transparent; color: var(--muted-foreground); font-size: .625rem; font-weight: 500; }
.nav-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nav-button[aria-current="page"] { color: var(--foreground); font-weight: 650; }
.nav-button[aria-current="page"] svg { stroke-width: 2.25; }
.admin-trigger { position: fixed; right: 1rem; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 25; width: 44px; height: 44px; padding: 0; }
.admin-trigger svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.empty-state { padding: 1.5rem 0; color: var(--muted-foreground); line-height: 1.6; }
.loading-line { width: 100%; height: 4px; overflow: hidden; background: var(--muted); }
.loading-line::after { display: block; width: 38%; height: 100%; background: var(--primary); content: ""; animation: load 1s ease-in-out infinite alternate; }
@keyframes load { to { transform: translateX(165%); } }

@media (hover: hover) and (pointer: fine) {
  .ui-button:hover, .secondary-button:hover, .quiet-button:hover, .nav-button:hover, .ui-nav-tab:hover { background: var(--accent); color: var(--accent-foreground); }
  .ui-button-default:hover, .primary-button:hover { background: var(--color-gray-900); color: var(--primary-foreground); }
  .session-row summary:hover { background: var(--accent); }
}
@media (max-width: 410px) {
  .session-detail { padding-left: 1rem; }
  .admin-grid.two { grid-template-columns: 1fr; }
  .info-list div { grid-template-columns: 1fr; gap: .25rem; }
}
@media (min-width: 760px) {
  .app-shell { padding: 0 0 0 88px; }
  .app-header { margin-left: 88px; }
  .ios-tab-bar { top: 0; right: auto; bottom: 0; width: 88px; grid-template-columns: 1fr; grid-template-rows: repeat(5, min-content); align-content: start; gap: .25rem; padding: calc(80px + env(safe-area-inset-top)) .5rem 1rem; border-top: 0; border-right: 1px solid var(--sidebar-border); background: var(--sidebar); backdrop-filter: none; }
  .nav-button { min-height: 58px; border-radius: var(--radius); }
  .nav-button[aria-current="page"] { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); }
  .view { padding: 2.5rem clamp(2rem, 6vw, 4.5rem) 4rem; }
  .app-brand .brand-word { display: inline; }
  .event-name { padding-left: .75rem; border-left: 1px solid var(--border); }
  .admin-trigger { right: 1.5rem; bottom: 1.5rem; }
  .admin-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid .field.wide { grid-column: 1 / -1; }
  .map-frame, .map-frame svg { min-height: 500px; }
  .moment-card { padding: 1.25rem; }
  .view-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
  .view-heading p { margin-bottom: .25rem; text-align: right; }
}
@media (min-width: 980px) {
  .activity-day { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; align-items: start; }
  .activity-day > h2 { position: sticky; top: 80px; padding-top: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
