*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --red: #d70818;
  --red-2: #ff293a;
  --ink: #050506;
  --ink-2: #101114;
  --ink-3: #1a1d22;
  --panel: #121418;
  --panel-2: #1c2026;
  --text: #f8f7f2;
  --muted: #b3b7ba;
  --muted-2: #7c8389;
  --line: rgba(255,255,255,0.14);
  --line-strong: rgba(255,255,255,0.24);
  --green: #2ecf74;
  --green-soft: rgba(46,207,116,0.14);
  --amber: #e1ad42;
  --amber-soft: rgba(225,173,66,0.16);
  --blue: #55b7d4;
  --blue-soft: rgba(85,183,212,0.15);
  --shadow: 0 22px 64px rgba(0,0,0,0.28);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --ink: #f8f8f5;
  --ink-2: #ffffff;
  --ink-3: #eceeea;
  --panel: #ffffff;
  --panel-2: #f0f1ed;
  --text: #111317;
  --muted: #5e666d;
  --muted-2: #7c858d;
  --line: rgba(8,10,14,0.12);
  --line-strong: rgba(8,10,14,0.22);
  --shadow: 0 18px 54px rgba(28,28,28,0.12);
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: "Barlow", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.site-header,
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px clamp(18px, 4vw, 56px);
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center 30%;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.brand-word {
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-word span,
.kicker,
.modal-kicker {
  color: var(--red-2);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.4vw, 28px);
  color: var(--muted);
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.nav a {
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
}

.header-actions,
.hero-actions,
.modal-actions,
.row-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-button,
.button,
.mini-button,
.chip-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.icon-button {
  width: 42px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: var(--text);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.button,
.mini-button,
.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.button {
  min-width: 0;
  padding: 0 16px;
}

.button-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 12px 30px rgba(215,8,24,0.22);
}

.button-secondary {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: none;
}

.button-danger {
  background: rgba(215,8,24,0.14);
  color: var(--red-2);
  box-shadow: none;
}

.button:hover,
.icon-button:hover,
.mini-button:hover,
.chip-button:hover {
  transform: translateY(-1px);
  border-color: var(--red-2);
}

.hero {
  position: relative;
  min-height: clamp(540px, 76svh, 760px);
  overflow: hidden;
  display: grid;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #090909;
}

:root[data-theme="light"] .hero {
  background: #f8f8f6;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.4;
  filter: saturate(1.08) contrast(1.08);
}

:root[data-theme="light"] .hero-bg {
  opacity: 0.22;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5,5,6,0.96) 0%, rgba(5,5,6,0.76) 44%, rgba(5,5,6,0.22) 100%),
    linear-gradient(0deg, rgba(5,5,6,0.86) 0%, rgba(5,5,6,0) 42%);
  pointer-events: none;
}

:root[data-theme="light"] .hero::after {
  background:
    linear-gradient(90deg, rgba(248,248,246,0.96) 0%, rgba(248,248,246,0.78) 44%, rgba(248,248,246,0.16) 100%),
    linear-gradient(0deg, rgba(248,248,246,0.86) 0%, rgba(248,248,246,0) 42%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 64px 0 72px;
}

.kicker,
.modal-kicker,
label,
.section-label {
  margin: 0 0 10px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: clamp(4rem, 14vw, 9.5rem);
  line-height: 0.84;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

h2,
h3 {
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 28px;
  color: #e7e8e4;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 500;
}

:root[data-theme="light"] .hero-copy {
  color: #202226;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: min(780px, 100%);
  margin-top: 38px;
}

.point {
  padding-top: 13px;
  border-top: 3px solid var(--red);
}

.point strong {
  display: block;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  text-transform: uppercase;
}

.point span,
.muted,
.form-note,
.connection-line {
  color: var(--muted);
}

.section {
  padding: clamp(52px, 7vw, 86px) clamp(18px, 4vw, 56px);
}

.section-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 5vw, 3.65rem);
  line-height: 0.96;
}

.section-heading p {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.03rem;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 310px);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink-2);
}

.search-row input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.meet-list,
.workflow-grid,
.station-grid,
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.meet-card,
.workflow-card,
.panel,
.station-card,
.event-card,
.call-card,
.director-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.meet-card,
.workflow-card,
.station-card,
.director-card {
  padding: 18px;
}

.meet-card {
  display: grid;
  gap: 16px;
}

.meet-card header,
.card-header,
.group-header,
.event-row,
.call-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.meet-card h3,
.station-card h3 {
  margin-bottom: 4px;
  font-size: 1.52rem;
  line-height: 1;
}

.status-pill,
.call-badge,
.lock-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 9px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-active,
.badge-first,
.lock-open {
  background: var(--green-soft);
  color: var(--green);
}

.badge-second {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-third {
  background: rgba(215,8,24,0.18);
  color: var(--red-2);
}

.badge-pending,
.status-draft,
.status-archived,
.lock-closed {
  background: var(--panel-2);
  color: var(--muted);
}

.empty-state,
.loading-block {
  padding: 32px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel);
}

.empty-state {
  display: none;
}

.workflow {
  background: var(--ink-3);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.step {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 900;
}

.workflow-card h3 {
  margin-bottom: 8px;
  font-size: 1.45rem;
}

.workflow-card p,
.setup-panel li,
.station-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.director-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
  gap: clamp(24px, 5vw, 54px);
  align-items: center;
}

.director-band h2 {
  margin-bottom: 14px;
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 0.95;
}

.director-band p {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.08rem;
}

.setup-panel {
  border-left: 4px solid var(--red);
  padding: 20px 0 20px 22px;
}

.setup-panel ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.setup-panel li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.setup-panel li::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-top: 8px;
  background: var(--red);
  border-radius: 50%;
}

.footer {
  padding: 34px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.68);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  width: min(620px, 100%);
  max-height: min(760px, calc(100svh - 36px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--ink-2);
  box-shadow: var(--shadow);
}

.modal-narrow {
  width: min(460px, 100%);
}

.modal-header,
.modal-body {
  padding: 22px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin-bottom: 4px;
  font-size: 2.2rem;
  line-height: 1;
}

.modal-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.modal-header .modal-kicker {
  margin-bottom: 6px;
}

.close-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
}

.form-grid,
.director-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field,
.pin-box {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: var(--muted);
  font-size: 0.95rem;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: var(--text);
  padding: 10px 12px;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  flex-wrap: wrap;
}

.toast {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--text);
}

.toast.show {
  display: block;
}

.toast.error {
  border-left-color: var(--red-2);
  background: rgba(215,8,24,0.14);
}

.app-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  width: min(360px, calc(100% - 36px));
  box-shadow: var(--shadow);
}

.app-title {
  min-width: 0;
  display: grid;
  justify-items: center;
  text-align: center;
}

.app-title span {
  max-width: min(52vw, 560px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  text-transform: uppercase;
}

.app-title small {
  color: var(--muted);
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

.status-bar {
  position: sticky;
  top: 72px;
  z-index: 20;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
  color: var(--muted);
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-bar.live {
  color: var(--green);
}

.status-bar.offline {
  color: var(--red-2);
}

.status-bar.local {
  color: var(--amber);
}

.app-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(22px, 4vw, 42px) 0 68px;
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header h1,
.panel-header h2 {
  margin-bottom: 6px;
  font-size: clamp(2.2rem, 6vw, 4.6rem);
  line-height: 0.95;
}

.panel-header p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.event-card {
  overflow: hidden;
}

.group-header {
  padding: 14px 16px;
  background: var(--panel-2);
}

.group-header h3 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.event-row {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.event-name {
  min-width: 0;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
}

.event-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.pin-panel {
  width: min(440px, 100%);
  margin: 44px auto 0;
}

.pin-box {
  gap: 14px;
}

.station-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.station-card {
  display: grid;
  gap: 12px;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.progress-bar span {
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  background: var(--green);
}

.call-grid {
  display: grid;
  gap: 12px;
}

.call-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.call-buttons {
  display: grid;
  grid-template-columns: repeat(3, 54px);
  gap: 8px;
}

.mini-button {
  min-width: 44px;
  padding: 0 10px;
  background: var(--panel-2);
  color: var(--muted);
}

.mini-button.first:not(:disabled) {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.mini-button.second:not(:disabled) {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-soft);
}

.mini-button.third:not(:disabled) {
  border-color: var(--red-2);
  color: var(--red-2);
  background: rgba(215,8,24,0.14);
}

.mini-button.sent {
  color: #07140c;
  background: var(--green);
  border-color: var(--green);
}

.mini-button.sent.second {
  color: #2c1900;
  background: var(--amber);
  border-color: var(--amber);
}

.mini-button.sent.third {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.call-card {
  padding: 14px;
}

.call-card.third-alert {
  border-color: var(--red-2);
  background: linear-gradient(90deg, rgba(215,8,24,0.18), var(--panel));
}

.badge-stack {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.completed-list,
.active-list {
  display: grid;
  gap: 10px;
}

.section-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 12px;
  color: var(--muted);
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

.section-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.director-grid {
  align-items: start;
}

.director-card {
  display: grid;
  gap: 14px;
}

.director-card h3 {
  margin-bottom: 0;
  font-size: 1.45rem;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.tab-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  padding: 12px 18px;
  cursor: pointer;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

.tab-button.active {
  background: var(--ink);
  border-color: var(--text);
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.director-grid--single {
  grid-template-columns: 1fr;
}

.station-card-announcer {
  border: 2px dashed var(--line);
}

.station-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink-2);
}

.station-editor-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.subevent-list {
  display: grid;
  gap: 8px;
}

.subevent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.chip-button {
  min-height: 36px;
  padding: 0 10px;
  background: var(--panel-2);
  color: var(--text);
}

.saved-indicator {
  min-height: 20px;
  color: var(--green);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .nav {
    display: none;
  }

  .hero-points,
  .meet-list,
  .workflow-grid,
  .director-band,
  .section-heading,
  .dashboard-grid,
  .station-grid,
  .director-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
  }

  .panel-header {
    display: grid;
  }
}

@media (max-width: 620px) {
  .site-header,
  .app-header {
    min-height: 64px;
    padding: 9px 14px;
  }

  .brand-word {
    font-size: 1.18rem;
  }

  .header-actions .button {
    display: none;
  }

  .hero-inner {
    width: min(100% - 28px, 1120px);
    padding-top: 44px;
  }

  .button {
    width: 100%;
  }

  .form-grid,
  .call-row,
  .station-editor-header,
  .subevent-row {
    grid-template-columns: 1fr;
  }

  .call-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-bar {
    top: 64px;
  }
}
