:root {
  color-scheme: light;
  --ink: #10231f;
  --muted: #66746d;
  --paper: #f4f7ef;
  --band: #e4ece0;
  --panel: #ffffff;
  --line: #cfddd2;
  --green: #168447;
  --green-soft: #e1f3e8;
  --clay: #e05f2f;
  --amber: #d9961a;
  --blue: #24778b;
  --charcoal: #0f1f1b;
  --moss: #2fb86f;
  --shadow: 0 20px 60px rgba(8, 24, 18, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(16, 35, 31, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 35, 31, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.dialog-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 96px;
  padding: 6px clamp(18px, 4vw, 52px);
  background: rgba(244, 247, 239, 0.94);
  border-bottom: 2px solid rgba(16, 35, 31, 0.18);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: min(52vw, 520px);
  max-width: min(58vw, 620px);
}

.brand-logo {
  display: block;
  width: auto;
  height: clamp(76px, 8vw, 88px);
  max-width: min(58vw, 620px);
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 8px 18px rgba(8, 24, 18, 0.18));
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.top-nav a {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--muted);
  font-weight: 800;
}

.top-nav a:hover {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: clamp(22px, 4vw, 52px);
  min-height: calc(100vh - 76px);
  padding: clamp(36px, 8vw, 96px) clamp(18px, 4vw, 52px);
  overflow: hidden;
  background: #0b1714;
  color: #fff;
}

.hero-art {
  position: absolute;
  inset: 0;
  opacity: 0.78;
  pointer-events: none;
  background:
    linear-gradient(112deg, rgba(7, 18, 15, 0.98), rgba(10, 32, 24, 0.68) 48%, rgba(7, 18, 15, 0.95)),
    radial-gradient(circle at 76% 20%, rgba(47, 184, 111, 0.34), transparent 30%),
    radial-gradient(circle at 20% 76%, rgba(224, 95, 47, 0.22), transparent 24%),
    repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 32px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: auto, auto, 72px 72px, 72px 72px;
}

.ridge {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 0;
  height: 42%;
  clip-path: polygon(0 62%, 12% 49%, 24% 61%, 37% 32%, 50% 55%, 63% 28%, 76% 50%, 88% 36%, 100% 58%, 100% 100%, 0 100%);
  background: rgba(223, 238, 229, 0.14);
}

.ridge-two {
  bottom: -8%;
  height: 34%;
  background: rgba(193, 60, 31, 0.24);
  transform: scaleX(1.1);
}

.trail-line {
  position: absolute;
  right: 12%;
  bottom: 0;
  width: 28%;
  height: 80%;
  transform: skewX(-10deg);
  border-left: 7px solid rgba(255, 255, 255, 0.16);
  border-right: 2px solid rgba(255, 255, 255, 0.08);
}

.hero-content,
.today-panel {
  position: relative;
  z-index: 1;
}

.hero-content {
  align-self: end;
  max-width: 860px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--clay);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f3c875;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(58px, 11vw, 138px);
  line-height: 0.88;
  letter-spacing: 0;
  text-shadow: 0 8px 0 rgba(47, 184, 111, 0.18);
}

h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 19px;
}

.lede {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(19px, 2.2vw, 27px);
  line-height: 1.28;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.button,
.segment,
.text-button,
.icon-button {
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 900;
}

.button:hover {
  border-color: var(--green);
}

.button.primary {
  border-color: var(--clay);
  background: linear-gradient(135deg, var(--clay), #8f2715);
  color: #fff;
}

.button.full {
  width: 100%;
}

.today-panel {
  align-self: end;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  background: rgba(13, 18, 17, 0.68);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.today-panel h2 {
  margin-bottom: 16px;
  font-size: 24px;
}

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

.today-item {
  padding: 12px;
  border-left: 4px solid var(--clay);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.13);
}

.today-item strong,
.today-item span {
  display: block;
}

.today-item span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--charcoal);
  color: #fff;
}

.stats div {
  padding: 24px clamp(18px, 4vw, 52px);
  border-right: 1px solid var(--line);
}

.stats div:last-child {
  border-right: 0;
}

.stats strong {
  display: block;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.95;
}

.stats span {
  color: rgba(255, 255, 255, 0.66);
  font-weight: 800;
}

.workspace {
  padding: clamp(38px, 6vw, 78px) clamp(18px, 4vw, 52px);
}

.workspace.muted {
  background: var(--band);
}

.bulletin-board {
  display: none;
  gap: 8px;
  padding: 12px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.bulletin-board.has-bulletins {
  display: grid;
}

.bulletin-item {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  padding: 9px 12px;
  border-left: 4px solid var(--blue);
  border-radius: 3px;
  background: #eef4f4;
  font-weight: 800;
}

.bulletin-item.warning {
  border-left-color: var(--amber);
  background: #f8ecd2;
}

.bulletin-item.success {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.bulletin-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.refresh-marker {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.today-panel .refresh-marker {
  margin: -8px 0 14px;
  color: rgba(255, 255, 255, 0.68);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 6px;
  min-width: min(420px, 100%);
}

.field.compact {
  min-width: 170px;
}

.field span,
.toggle span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  color: var(--ink);
}

.field input,
.field select {
  min-height: 44px;
}

.field textarea {
  min-height: 112px;
  padding-top: 10px;
  resize: vertical;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.segmented {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.segment {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 900;
}

.segment.active {
  border-color: var(--clay);
  background: var(--clay);
  color: #fff;
}

.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
}

.results-panel,
.operations-panel,
.card,
.venue-card,
.source-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(24, 35, 31, 0.04);
}

.results-panel {
  overflow: hidden;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #101414;
  color: #fff;
}

.text-button {
  border: 0;
  background: transparent;
  color: #f0b37a;
  font-weight: 900;
}

.event-list {
  display: grid;
}

.event-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(193, 60, 31, 0.08), transparent 20%),
    var(--panel);
}

.event-card:last-child {
  border-bottom: 0;
}

.event-date {
  display: grid;
  place-items: center;
  min-height: 78px;
  border-radius: 3px;
  background: var(--charcoal);
  color: #fff;
  text-align: center;
  font-weight: 900;
}

.event-date span {
  display: block;
  color: #f0b37a;
  font-size: 12px;
  text-transform: uppercase;
}

.event-date strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.event-main p,
.venue-card p,
.source-card p,
.trail-card p,
.helper {
  color: var(--muted);
  line-height: 1.45;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.tag,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border-radius: 3px;
  background: #edf2ec;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tag.warning {
  background: #f8ecd2;
  color: #76510e;
}

.tag.danger {
  background: #f5ddd8;
  color: var(--clay);
}

.operations-panel {
  align-self: start;
  padding: 18px;
}

.check-list {
  display: grid;
  gap: 11px;
  margin-bottom: 16px;
}

.check-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  align-items: start;
}

.check-item span:first-child {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}

.check-item strong,
.check-item small {
  display: block;
}

.check-item small {
  color: var(--muted);
  line-height: 1.35;
}

.trail-grid,
.venue-grid,
.source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.trail-card,
.venue-card,
.source-card {
  padding: 18px;
  border-top: 4px solid var(--ink);
}

.trail-card {
  display: grid;
  gap: 10px;
}

.trail-updated {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-pill.open {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.partial {
  background: #f8ecd2;
  color: #76510e;
}

.status-pill.closed {
  background: #f5ddd8;
  color: var(--clay);
}

.trail-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.trail-card h3,
.venue-card h3,
.source-card h3 {
  margin-bottom: 8px;
}

.trail-actions,
.venue-actions,
.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.small-button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.small-button:hover {
  border-color: var(--green);
}

.small-button.primary-link {
  border-color: var(--clay);
  background: var(--clay);
  color: #fff;
}

.small-button.disabled,
.button.disabled {
  border-color: #c7cfc3;
  background: #e5e9df;
  color: #7f887f;
  cursor: not-allowed;
}

.source-card {
  position: relative;
  overflow: hidden;
}

.source-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--blue);
}

.source-card.stale::before {
  background: var(--amber);
}

.source-card.error::before {
  background: var(--clay);
}

.source-editor {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f8faf5;
}

.detail-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.detail-dialog::backdrop {
  background: rgba(16, 32, 25, 0.62);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  font-size: 24px;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  font-size: 24px;
  line-height: 1;
}

#dialogBody {
  padding: 20px;
}

.detail-list {
  display: grid;
  gap: 11px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 900;
}

.detail-list dd {
  margin: 0;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.related-events {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.related-event {
  padding: 12px;
  border-left: 4px solid var(--clay);
  background: #f2f5ee;
}

.related-event strong,
.related-event span {
  display: block;
}

.related-event span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.page-hero {
  position: relative;
  padding: clamp(46px, 8vw, 92px) clamp(18px, 4vw, 52px);
  overflow: hidden;
  background:
    linear-gradient(112deg, rgba(8, 17, 15, 0.98), rgba(8, 17, 15, 0.66)),
    repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 32px);
  color: #fff;
}

.page-hero h1 {
  font-size: clamp(48px, 9vw, 112px);
}

.compact-hero {
  padding-bottom: clamp(34px, 5vw, 56px);
}

.admin-shell,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(24, 35, 31, 0.04);
}

.admin-shell {
  display: grid;
  gap: 14px;
  max-width: 720px;
  padding: 22px;
}

.admin-shell.narrow {
  max-width: 520px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
}

.admin-monitoring {
  margin-top: 16px;
}

.admin-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

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

.admin-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #f8faf5;
}

.admin-list-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-list-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(380px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 3px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px clamp(18px, 4vw, 52px);
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 1080px) {
  .hero,
  .board {
    grid-template-columns: 1fr;
  }

  .today-panel {
    align-self: stretch;
  }

  .trail-grid,
  .venue-grid,
  .source-grid,
  .admin-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header,
  .section-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .site-header {
    min-height: auto;
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .brand {
    min-width: 0;
    max-width: 100%;
  }

  .brand-logo {
    width: min(420px, 92vw);
    height: auto;
    max-height: 76px;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
  }

  .stats,
  .trail-grid,
  .venue-grid,
  .source-grid,
  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .stats div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .event-card {
    grid-template-columns: 1fr;
  }

  .event-date {
    min-height: 64px;
  }

  .detail-list div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
