:root {
  color-scheme: light;
  --bg: #f3f5f0;
  --panel: #ffffff;
  --ink: #17211d;
  --muted: #66716b;
  --line: #dbe1d8;
  --green: #23715d;
  --blue: #235c80;
  --gold: #a66a20;
  --red: #a63232;
  --shadow: 0 18px 46px rgba(27, 38, 33, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 44px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  height: 34px;
  width: 34px;
}

.header-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.last-updated {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  white-space: nowrap;
}

main {
  padding-bottom: 42px;
}

.hero-band {
  display: grid;
  min-height: 310px;
  overflow: hidden;
  position: relative;
}

.hero-band::after {
  background: linear-gradient(90deg, rgba(8, 18, 15, 0.74), rgba(8, 18, 15, 0.2));
  content: "";
  inset: 0;
  position: absolute;
}

.hero-band img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.hero-copy {
  align-self: end;
  color: #fff;
  max-width: 760px;
  padding: 42px clamp(18px, 5vw, 56px);
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  font-size: clamp(3rem, 7vw, 5.7rem);
  letter-spacing: 0;
  line-height: 0.95;
  margin: 4px 0 12px;
}

.hero-copy p {
  margin: 0;
}

.eyebrow {
  color: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 5px;
  text-transform: uppercase;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  margin: 18px auto 0;
  max-width: 1280px;
  padding: 0 clamp(14px, 3vw, 28px);
}

.video-panel,
.control-panel,
.weather-panel,
.notice-panel,
.events-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
  padding: 18px;
}

.events-panel {
  grid-column: 1 / -1;
}

.section-heading {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading h2 {
  font-size: 1.35rem;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

.status-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  min-height: 28px;
  padding: 5px 10px;
  white-space: nowrap;
}

.status-pill.open,
.status-pill.online {
  background: rgba(35, 113, 93, 0.12);
  color: var(--green);
}

.status-pill.closed {
  background: rgba(35, 92, 128, 0.13);
  color: var(--blue);
}

.status-pill.alert,
.status-pill.error {
  background: rgba(166, 50, 50, 0.12);
  color: var(--red);
}

.status-pill.muted {
  background: #eef1ed;
  color: var(--muted);
}

.video-mount {
  aspect-ratio: 16 / 9;
  background: #111;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.video-mount img,
.video-mount iframe,
.video-mount video {
  border: 0;
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.hidden {
  display: none !important;
}

.gate-meter {
  background: #e6ebe5;
  border-radius: 999px;
  height: 12px;
  margin: 6px 0 18px;
  overflow: hidden;
}

.gate-meter span {
  background: var(--green);
  display: block;
  height: 100%;
  transition: width 280ms ease, background 280ms ease;
  width: 50%;
}

.action-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
}

.command-button,
.icon-button {
  border: 1px solid var(--line);
  cursor: pointer;
}

.command-button {
  align-items: center;
  background: #f7f9f5;
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  gap: 10px;
  justify-content: center;
  min-height: 64px;
}

.command-button span {
  align-items: center;
  background: #fff;
  border-radius: 999px;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.command-button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.command-button:disabled,
.icon-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.icon-button {
  align-items: center;
  background: #fff;
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.state-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.state-list div {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-top: 10px;
}

.state-list dt {
  color: var(--muted);
}

.state-list dd {
  font-weight: 700;
  margin: 0;
  text-align: right;
}

.weather-layout {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: auto 1fr;
}

.temperature {
  color: var(--blue);
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
}

.weather-description {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0 0 5px;
}

.subtle {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.notice-list {
  display: grid;
  gap: 10px;
}

.notice {
  border-left: 4px solid var(--gold);
  padding: 8px 0 8px 12px;
}

.notice.alert {
  border-left-color: var(--red);
}

.notice h3 {
  font-size: 1rem;
  margin: 0 0 4px;
}

.notice p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  font-size: 0.95rem;
}

.toast {
  background: #17211d;
  border-radius: 8px;
  bottom: 18px;
  box-shadow: var(--shadow);
  color: #fff;
  left: 50%;
  max-width: min(520px, calc(100vw - 28px));
  padding: 12px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 50;
}

@media (max-width: 920px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-band {
    min-height: 260px;
  }
}

@media (max-width: 560px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .last-updated {
    white-space: normal;
  }

  .action-grid,
  .weather-layout {
    grid-template-columns: 1fr;
  }

  .temperature {
    font-size: 3.2rem;
  }
}
