:root {
  --navy: #001f45;
  --navy-soft: #0d2f57;
  --ink: #061f3d;
  --muted: #5d6a7d;
  --panel: #ffffff;
  --paper: #f7f8f8;
  --line: #d9dfe6;
  --gold: #c99a43;
  --gold-soft: #fff6e3;
  --green: #2f6b4f;
  --green-soft: #e7f0ea;
  --red: #a83d3d;
  --blue: #285f7b;
  --shadow: 0 22px 55px rgba(0, 31, 69, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(0, 31, 69, .72) 0%, rgba(0, 31, 69, .42) 42%, rgba(0, 31, 69, .14) 100%),
    linear-gradient(rgba(0, 31, 69, .08), rgba(0, 31, 69, .36) 320px, rgba(247, 248, 248, .98) 321px),
    url("trail-hero-golden-hour.png") center top/cover no-repeat;
  background-color: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

body.embed-mode {
  min-height: auto;
  background: transparent;
}

button, input, select, textarea { font: inherit; }
h1, h2, h3, p { margin: 0; }

.topbar {
  min-height: 214px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 34px clamp(18px, 5vw, 72px) 28px;
  color: white;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 7vw, 78px);
  font-weight: 400;
  line-height: .95;
  letter-spacing: 0;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(31px, 4vw, 54px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: 0;
  color: var(--navy);
}

.top-subtitle {
  max-width: 520px;
  margin-top: 12px;
  color: rgba(255, 255, 255, .86);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
}

.eyebrow {
  display: inline-block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.tabs {
  display: flex;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(0, 31, 69, .26);
  backdrop-filter: blur(12px);
}

.tab, .mini, .icon-btn, .primary, .secondary {
  border: 0;
  cursor: pointer;
  border-radius: 0;
  min-height: 42px;
}

.tab {
  padding: 12px 18px;
  color: white;
  background: transparent;
  font-weight: 800;
}

.tab.is-active {
  color: var(--navy);
  background: white;
}

main { padding: 0 clamp(18px, 5vw, 72px) 58px; }
.view { display: none; }
.view.is-active { display: block; }

body.embed-mode .topbar,
body.embed-mode .site-footer,
body.embed-mode #chat,
body.embed-mode #admin {
  display: none !important;
}

body.embed-mode main {
  padding: 0;
}

body.embed-mode #booking {
  display: block;
}

body.embed-mode .booking-grid {
  gap: 16px;
}

body.embed-mode .panel {
  border-color: #e3e7eb;
  box-shadow: none;
}

.booking-grid, .chat-layout, .guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.34fr) minmax(330px, .72fr);
  gap: 22px;
  align-items: start;
}

.guide-layout {
  grid-template-columns: minmax(0, 1fr);
}

.booking-calendar-panel {
  min-width: 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(310px, .74fr) minmax(0, 1.26fr);
  gap: 22px;
  align-items: start;
}

.admin-layout.is-single-column {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(217, 223, 230, .86);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 34px);
}

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

.status-pill, .badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  border: 1px solid rgba(201, 154, 67, .5);
  background: var(--gold-soft);
  color: #76551c;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.notice {
  padding: 15px 16px;
  border-left: 3px solid var(--gold);
  background: #fbf8f0;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.5;
  font-weight: 700;
}

.notice.subtle {
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  background: #f8f9fb;
  color: var(--muted);
  margin-top: 14px;
}

.booking-intro {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 16px;
  align-items: start;
  margin: 3px 0 22px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.55;
}

.booking-intro span {
  display: block;
  height: 2px;
  margin-top: 13px;
  background: var(--gold);
}

.rule-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}

.rule-strip span {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid #dfe4ea;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.admin-section-tab {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-weight: 900;
  cursor: pointer;
}

.admin-section-tab.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.admin-tab-content.is-hidden {
  display: none;
}

.admin-setup-card {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.admin-setup-card strong {
  display: block;
  color: var(--navy);
  font-size: 18px;
}

.admin-setup-card small {
  color: var(--muted);
  line-height: 1.4;
}

.settings-form {
  display: grid;
  gap: 14px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.availability-editor textarea {
  min-height: 150px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.guide-admin-card {
  background: #fbfcfd;
}

.guide-settings-grid {
  grid-template-columns: 1fr 1fr 1fr;
}

.guide-roster,
.guide-open-rides,
.guide-application-list {
  display: grid;
  gap: 10px;
}

.guide-roster-item,
.guide-open-ride,
.guide-application-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.guide-application-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.guide-roster-item strong,
.guide-open-ride strong,
.guide-application-item strong {
  display: block;
  color: var(--navy);
}

.guide-roster-item small,
.guide-open-ride small,
.guide-application-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.guide-staffing {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fbfcfd;
}

.guide-staffing > strong {
  color: var(--navy);
}

.guide-ride-card {
  background: #fff;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stack { display: grid; gap: 14px; }

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 13px 13px;
  outline-color: var(--gold);
}

textarea { resize: vertical; }

.rider-details-block {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  padding: 14px;
}

.rider-details-block strong {
  display: block;
  color: var(--navy);
  font-size: 16px;
}

.rider-details-block small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.rider-details {
  display: grid;
  gap: 12px;
}

.rider-card {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
}

.rider-card legend {
  padding: 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.field-row.compact {
  gap: 10px;
}

.ride-summary {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: stretch;
  margin-top: 16px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  padding: 12px;
}

.ride-summary-media {
  min-height: 104px;
  background-size: cover;
  background-position: center;
}

.ride-summary strong,
.ride-summary span,
.ride-summary small {
  display: block;
}

.ride-summary strong {
  color: var(--navy);
  font-size: 18px;
}

.ride-summary span {
  margin-top: 3px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ride-summary p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.45;
}

.ride-summary small,
#discountCodeField small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.groupon-code-field.is-hidden,
#discountCodeField.is-hidden {
  display: none;
}

.groupon-code-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.groupon-code-field small.error {
  color: var(--red);
}

.calendar-shell {
  margin-top: 22px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: white;
}

.calendar-head {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  text-align: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--navy);
  color: white;
}

.calendar-head strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
}

.icon-btn {
  font-size: 31px;
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, .55);
}

.icon-btn:disabled {
  opacity: .38;
  cursor: not-allowed;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(98px, 1fr));
  gap: 1px;
  background: var(--line);
}

.day-col {
  min-height: 360px;
  background: #fff;
  padding: 11px;
}

.day-label {
  min-height: 48px;
  font-weight: 900;
  font-size: 13px;
  color: var(--navy);
}

.day-label span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.slot {
  width: 100%;
  min-height: 47px;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #c9d7e3;
  background: #f4f8fb;
  color: var(--navy);
  font-weight: 900;
  text-align: left;
}

.slot small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.slot:hover {
  border-color: var(--gold);
  background: #fffaf0;
}

.slot.is-selected {
  outline: 3px solid rgba(201, 154, 67, .28);
  background: var(--gold-soft);
  border-color: var(--gold);
}

.slot.is-closed {
  background: #f2f4f6;
  border-color: #e1e5e9;
  color: #8c95a0;
  cursor: not-allowed;
}

.slot.is-limited {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: #73531b;
}

.empty-day {
  min-height: 44px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.primary {
  color: white;
  background: var(--navy);
  padding: 13px 18px;
  font-weight: 900;
}

.primary:hover { background: var(--navy-soft); }

.secondary, .mini {
  border: 1px solid var(--line);
  background: white;
  color: var(--navy);
  padding: 11px 15px;
  font-weight: 900;
}

a.mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  text-decoration: none;
}

.secondary:hover, .mini:hover {
  border-color: var(--gold);
  background: #fffaf0;
}

.mini {
  min-height: 36px;
  padding: 8px 11px;
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.metrics div {
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--line);
  background: #fbfcfd;
}

.metrics span {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1;
  color: var(--navy);
}

.metrics small {
  color: var(--muted);
  font-weight: 800;
}

.integration-grid { display: grid; gap: 11px; }

.integration-grid > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.integration-grid > .calendar-card { grid-template-columns: 1fr; }
.integration-grid > .embed-card { grid-template-columns: 1fr; }
.integration-grid strong { color: var(--navy); }

.integration-grid small {
  color: var(--muted);
  line-height: 1.4;
}

.embed-card textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
  background: #fbfcfd;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-list-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fbfcfd;
}

.admin-list-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.admin-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini.danger-outline {
  color: #8b1d1d;
  border-color: #efb9b9;
  background: #fff;
}

.embed-breakpoint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.embed-breakpoint-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fbfcfd;
}

.embed-breakpoint-card textarea {
  min-height: 130px;
  background: #fff;
}

.closed-days-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.closed-day-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: #fbfcfd;
}

.closed-day-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mini.danger {
  color: #8b1d1d;
  border-color: #e7b5b5;
  background: #fff7f7;
}

.compact-label { margin-top: 6px; }

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.request-list { display: grid; gap: 13px; }

.request-card {
  border: 1px solid var(--line);
  background: white;
  padding: 16px;
}

.request-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
}

.request-card h3 {
  margin: 0 0 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--navy);
}

.request-card p {
  color: var(--muted);
  line-height: 1.46;
  font-weight: 700;
}

.request-card code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--navy);
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.groupon-verification {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  margin-left: 4px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.groupon-verification.valid {
  border-color: rgba(47, 107, 79, .35);
  background: var(--green-soft);
  color: var(--green);
}

.groupon-verification.invalid {
  border-color: rgba(168, 61, 61, .35);
  background: #fff1f1;
  color: var(--red);
}

.groupon-verification.manual_review {
  border-color: rgba(201, 154, 67, .5);
  background: var(--gold-soft);
  color: #76551c;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.danger { color: white; background: var(--red); }
.warn { color: white; background: var(--gold); }
.info { color: white; background: var(--blue); }

.chat-log {
  height: 430px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  background: #fbfcfd;
}

.message {
  max-width: 78%;
  padding: 12px 13px;
  line-height: 1.45;
  font-weight: 700;
}

.message.bot {
  background: #eef4f8;
  color: var(--navy);
}

.message.user {
  justify-self: end;
  background: var(--navy);
  color: white;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.muted {
  color: var(--muted);
  line-height: 1.48;
  margin-bottom: 16px;
  font-weight: 700;
}

.admin-rider-list {
  margin: 10px 0;
}

.admin-rider-list strong {
  color: var(--navy);
}

.admin-rider-list ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.admin-rider-list li {
  margin: 3px 0;
  color: var(--muted);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(440px, calc(100vw - 40px));
  padding: 13px 15px;
  background: var(--navy);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: .18s ease;
  font-weight: 800;
}

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

.site-footer {
  padding: 0 clamp(18px, 5vw, 72px) 34px;
  display: flex;
  justify-content: flex-end;
}

.admin-footer-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-footer-link:hover {
  color: var(--navy);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 38, 74, .48);
  z-index: 20;
}

.modal.is-open {
  display: flex;
}

.modal-panel {
  position: relative;
  width: min(420px, 100%);
  padding: 28px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-panel h2 {
  margin: 0 0 18px;
  color: var(--navy);
  font-family: Georgia, serif;
  font-size: 31px;
  line-height: 1.08;
}

.modal-copy {
  margin: -7px 0 18px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.submission-panel {
  width: min(520px, 100%);
}

.submission-summary {
  border: 1px solid var(--line);
  background: #fbfcfd;
  padding: 14px;
  margin: 0 0 16px;
}

.submission-summary p {
  margin: 0 0 7px;
  color: var(--muted);
  font-weight: 800;
}

.submission-summary p:last-child {
  margin-bottom: 0;
}

.submission-summary strong {
  color: var(--navy);
  font-size: 17px;
}

.next-steps {
  margin: 16px 0;
  padding: 14px;
  border-left: 4px solid var(--gold);
  background: #f8f3e9;
}

.next-steps strong {
  display: block;
  color: var(--navy);
  margin-bottom: 8px;
}

.next-steps ol {
  margin: 0;
  padding-left: 20px;
}

.next-steps li {
  margin: 5px 0;
  color: var(--muted);
  font-weight: 800;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--navy);
}

.form-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.form-note.error {
  color: #9f1d1d;
}

@media (max-width: 980px) {
  .topbar { align-items: stretch; flex-direction: column; }
  .booking-grid, .admin-layout, .chat-layout, .guide-layout { grid-template-columns: 1fr; }
  .request-panel { order: -1; }
  .booking-calendar-panel { order: 2; }
  .calendar-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .slot-grid {
    min-width: 940px;
    grid-template-columns: repeat(7, minmax(132px, 1fr));
  }
  .day-col { min-height: 250px; }
}

@media (max-width: 640px) {
  body {
    background:
      linear-gradient(rgba(0, 31, 69, .68), rgba(0, 31, 69, .34) 220px, rgba(247, 248, 248, .98) 221px),
      url("trail-hero-golden-hour.png") 58% top/auto 240px no-repeat;
    background-color: var(--paper);
  }
  .topbar {
    min-height: 190px;
    padding-bottom: 18px;
  }
  h1 { font-size: 42px; }
  h2 { font-size: 30px; }
  .top-subtitle {
    max-width: 320px;
    font-size: 14px;
    line-height: 1.35;
  }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 11px 10px; }
  .field-row, .metrics, .integration-grid > div, .settings-grid, .guide-roster-item, .guide-open-ride, .guide-application-item, .embed-breakpoint-grid { grid-template-columns: 1fr; }
  .admin-list-item header {
    display: grid;
  }
  .ride-summary {
    grid-template-columns: 1fr;
  }
  .ride-summary-media {
    min-height: 150px;
  }
  main { padding-inline: 14px; }
  .booking-grid { gap: 14px; }
  .slot-grid {
    min-width: 840px;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
  }
  .day-col {
    min-height: 230px;
    padding: 9px;
  }
  .calendar-shell { margin-top: 14px; }
  .calendar-head {
    position: sticky;
    left: 0;
    min-width: calc(100vw - 28px);
  }
  .slot {
    min-height: 42px;
    padding: 8px;
    font-size: 13px;
  }
  .slot small { font-size: 11px; }
  .panel { padding: 17px; }
  .panel-head { margin-bottom: 12px; }
  .notice {
    padding: 12px;
    margin-bottom: 14px;
    font-size: 13px;
  }
  .chat-input { grid-template-columns: 1fr; }
  .booking-intro { grid-template-columns: 34px 1fr; }
}
