:root {
  --brand: #1a5f9e;
  --ink: #142033;
  --muted: #5b6b7c;
  --bg: #f3f6fa;
  --card: #ffffff;
  --line: #d7e0ea;
  --ok: #1f7a4c;
  --bad: #a12626;
  --warn: #9a6b00;
  --surface: #f7fafc;
  --input-bg: #ffffff;
  --page-top: #eef3f8;
  --glow: #ffffff;
  --progress-track: #e7eef6;
  --side: #e7eef6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--brand) 18%, var(--glow)), transparent),
    linear-gradient(180deg, var(--page-top), var(--bg));
  min-height: 100vh;
}
a { color: var(--brand); }
.site-header, .site-footer, .container { width: min(1040px, calc(100% - 2rem)); margin-inline: auto; }
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.75rem 1rem;
  padding: 1.25rem 0;
}
.brand { font-weight: 700; font-size: 1.2rem; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 0.5rem; }
.brand-mark { height: 28px; width: auto; display: block; }
nav { display: flex; gap: 0.85rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
nav a { text-decoration: none; }
.btn {
  display: inline-block;
  background: var(--brand);
  color: white !important;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  font: inherit;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.linkish { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; }
.inline { display: inline; margin: 0; }
.landing-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1024 / 434;
  overflow: hidden;
  background: #1b1422;
}
.landing-hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.landing-hero h1 {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 5.5%;
  margin: 0;
  width: max-content;
  max-width: 92%;
  transform: translateX(-50%);
  text-align: center;
  color: #2a1733;
  font-size: clamp(1.25rem, 2.7vw, 2.85rem);
  font-weight: 560;
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-shadow:
    0 1px 0 rgba(255, 248, 240, 0.7),
    0 10px 28px rgba(255, 228, 210, 0.45);
  clip-path: inset(0 100% 0 0);
  opacity: 0;
  transition: clip-path 1.05s cubic-bezier(.16, .84, .3, 1), opacity 0.45s ease;
  pointer-events: none;
}
.landing-hero h1.on {
  clip-path: inset(0 0 0 0);
  opacity: 1;
}
html[data-theme="dark"] .landing-hero h1 {
  color: #f7f2ea;
  text-shadow:
    0 1px 2px rgba(8, 10, 24, 0.65),
    0 10px 28px rgba(6, 8, 20, 0.45);
}
.hero { padding: 2rem 0 1rem; }
.section-block { padding: 0.5rem 0 1.75rem; }
.section-block h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 0.35rem; }
.steps {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}
.steps li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}
.steps .step-num {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.35rem;
}
.steps strong { display: block; margin-bottom: 0.35rem; }
.steps p { margin: 0; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--muted); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; margin: 0.2rem 0 0.8rem; }
.lede { font-size: 1.15rem; max-width: 38rem; color: var(--muted); }
.cta-row { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; align-items: center; }
.cta-row form { margin: 0; }
.page-head .cta-row { margin-top: 0; }
.destination-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; }
.destination-grid li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.destination-grid.compact li { border-radius: 10px; padding: 0.8rem; }
.tag { font-size: 0.8rem; }
.tag.muted, .muted, .help { color: var(--muted); }
.soon { opacity: 0.72; }
.panel, .auth-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  margin: 1rem 0 2rem;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.profile-grid .panel { margin: 0; }
.profile-grid h2 { margin-top: 0; }
.profile-grid h3 { margin: 1.1rem 0 0.35rem; font-size: 1.05rem; }
@media (max-width: 960px) {
  .profile-grid { grid-template-columns: 1fr; }
}
.billing-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: var(--surface);
}
.billing-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.billing-card h3 { margin: 0.2rem 0 0.45rem; }
.billing-price { font-size: 1.6rem; margin: 0.15rem 0; line-height: 1.1; }
.billing-price span { font-size: 0.95rem; color: var(--muted); }
.billing-card form { margin: 0; }
dialog.modal {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
  background: var(--card);
  color: var(--ink);
  max-width: 26rem;
  width: calc(100% - 2rem);
}
dialog.modal::backdrop { background: rgba(20, 32, 51, 0.5); }
dialog.modal h2 { margin-top: 0; }
.modal-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; }
.page-head h1, .page-head h2 { margin: 0; }
.banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0 0 1.25rem;
  border: 1px solid var(--line);
  background: var(--card);
}
.banner p { margin: 0; }
.banner.warning {
  background: color-mix(in srgb, var(--warn) 16%, var(--card));
  border-color: color-mix(in srgb, var(--warn) 50%, var(--line));
}
body.app-body { background: var(--bg); }
.app-shell {
  display: grid;
  grid-template-columns: 13.25rem minmax(0, 1fr);
  min-height: 100vh;
}
.app-side {
  display: flex;
  flex-direction: column;
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 1.15rem 0.75rem 0.85rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.app-side .brand { margin: 0 0.45rem 1rem; font-size: 1.05rem; }
.app-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.15rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.app-nav .nav-label {
  margin: 0.85rem 0.45rem 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.app-nav .nav-label:first-child { margin-top: 0; }
.app-nav a, .app-logout button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
  cursor: pointer;
}
.nav-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-nav a[aria-current="page"] {
  background: var(--card);
  color: var(--brand);
  font-weight: 500;
}
.app-logout {
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
}
.app-main {
  min-width: 0;
  padding: 1.25rem 1.5rem 2rem;
}
.app-footer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.app-footer p { margin: 0.35rem 0; }
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-side {
    position: static;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .app-nav { flex-direction: row; flex-wrap: wrap; overflow: visible; }
  .app-nav .nav-label { width: 100%; }
  .app-nav a, .app-logout button { width: auto; }
  .app-logout { width: 100%; }
}
.subnav { display: flex; gap: 0.9rem; flex-wrap: wrap; margin: 0.2rem 0 0; }
.subnav a { text-decoration: none; }
.subnav a.current { font-weight: 700; text-decoration: underline; }
.limit-input { width: 6.5rem; }
.input, select, textarea, input[type="date"], input[type="number"], input[type="text"], input[type="password"], input[type="email"] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--input-bg);
  color: var(--ink);
}
.grid-2, .grid-3, .grid-4 { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
.data { width: 100%; border-collapse: collapse; }
.data th, .data td { text-align: left; padding: 0.55rem 0.35rem; border-bottom: 1px solid var(--line); font-size: 0.95rem; vertical-align: top; }
.data tr.click-row { position: relative; cursor: pointer; }
.data tr.click-row:hover td { background: var(--surface); }
.data tr.click-row .row-hit { position: absolute; inset: 0; z-index: 1; }
.data tr.click-row td.row-action { position: relative; z-index: 2; width: 1%; white-space: nowrap; }
.linkish.danger { color: var(--bad); }
.tiny { font-size: 0.8rem; margin-top: 0.15rem; }

.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.results-toolbar h2 { margin: 0; }
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.view-btn {
  border: 0;
  background: transparent;
  font: inherit;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  color: var(--muted);
}
.view-btn.active {
  background: var(--brand);
  color: white;
}
.offer-picker { margin: 1.1rem 0 0.75rem; }
.offer-picker-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}
.offer-picker-head h3 { margin: 0; font-size: 1.05rem; }
.offer-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
}
.offer-tile {
  border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--line));
  border-radius: 10px;
  background: var(--card);
  color: var(--brand);
  text-align: left;
  padding: 0.85rem 0.9rem;
  font: inherit;
  cursor: pointer;
  min-height: 5.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.offer-tile strong { font-size: 1.05rem; line-height: 1.25; }
.offer-tile .offer-sub { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.offer-tile.active {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}
.offer-tile.active .offer-sub { color: color-mix(in srgb, white 82%, var(--brand)); }
.offer-tile.all-tile { border-style: dashed; color: var(--ink); }
.offer-tile.all-tile.active { color: white; border-style: solid; }

.results-filters { margin: 1rem 0 0.5rem; }
.results-filter-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.results-filter-meta p { margin: 0; }
.day-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  background: color-mix(in srgb, var(--brand) 8%, var(--card));
}
.sort-btn {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
  padding: 0;
}
.sort-btn.sorted { color: var(--brand); }

#results-explorer[data-view="table"] [data-panel="calendar"],
#results-explorer[data-view="calendar"] [data-panel="table"] {
  display: none;
}
#results-explorer[data-view="calendar"] [data-panel="calendar"] {
  display: block;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.cal-nav h3 { margin: 0; font-size: 1.15rem; }
.cal-nav .btn.secondary {
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
  min-width: 2.5rem;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
}
.cal-weekday {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
  padding: 0.25rem;
}
.cal-cell {
  min-height: 5.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.4rem;
  text-align: left;
  font: inherit;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: var(--ink);
}
.cal-cell.empty {
  background: transparent;
  border-color: transparent;
  min-height: 0;
}
.cal-cell.has-results {
  cursor: pointer;
  background: color-mix(in srgb, var(--brand) 10%, var(--card));
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
}
.cal-cell.has-results:hover {
  border-color: var(--brand);
}
.cal-cell.focused {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.cal-daynum { font-weight: 700; font-size: 0.95rem; }
.cal-count, .cal-price { font-size: 0.78rem; line-height: 1.2; }
.cal-price { color: var(--brand); font-weight: 600; }
.cal-day-detail {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.cal-day-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.75rem;
  display: grid;
  gap: 0.45rem;
}
.cal-day-list li {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
@media (max-width: 720px) {
  .cal-cell { min-height: 4.2rem; padding: 0.3rem; }
  .cal-count, .cal-price { font-size: 0.7rem; }
}
.status { text-transform: capitalize; font-weight: 600; }
.btn.danger { background: var(--bad); }
.status.succeeded { color: var(--ok); }
.status.cancelled { color: var(--muted); }
.status.failed { color: var(--bad); }
.status.running, .status.pending { color: var(--warn); }
.progress { height: 10px; background: var(--progress-track); border-radius: 999px; overflow: hidden; }
.progress .bar { height: 100%; background: var(--brand); transition: width 0.3s ease; }
.error { color: var(--bad); }
.site-footer { padding: 2rem 0 3rem; color: var(--muted); font-size: 0.85rem; }
.site-footer p { margin: 0.35rem 0; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.auth-card { max-width: 480px; }
.brand-logo { max-height: 48px; width: auto; display: block; margin-bottom: 0.75rem; }
.messages { list-style: none; padding: 0; }
.messages li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.8rem; margin: 0.5rem 0; }
.errorlist { color: var(--bad); padding-left: 1.1rem; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.plan-grid article { border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem; background: var(--surface); }
.plan-grid h2, .plan-grid h3 { margin-top: 0; font-size: 1.05rem; }
.plan-grid ul { margin: 0 0 1rem; padding-left: 1.1rem; }
.price { font-size: 2rem; margin: 0.2rem 0 0.6rem; line-height: 1; }
.price span { font-size: 0.95rem; color: var(--muted); }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.row-actions form { display: inline-flex; gap: 0.35rem; align-items: center; margin: 0; }
.row-actions label { display: inline-flex; gap: 0.4rem; align-items: center; }
.row-actions select.input { width: auto; }
.theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.theme-label { margin: 0; font-weight: 700; }
.theme-row .help { margin: 0.2rem 0 0; }
label.switch {
  position: relative;
  display: inline-block;
  width: 3.1rem;
  height: 1.75rem;
  margin: 0;
  flex: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.switch-track {
  position: absolute;
  inset: 0;
  background: var(--line);
  border-radius: 999px;
  pointer-events: none;
  transition: background 0.15s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  width: 1.35rem;
  height: 1.35rem;
  left: 0.2rem;
  top: 0.2rem;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(1.35rem); }
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.summary { white-space: pre-wrap; font-family: inherit; background: var(--surface); border-radius: 10px; padding: 0.75rem; }
.legal h1 { margin-top: 0; }
html[data-theme="dark"] {
  --ink: #e8eef6;
  --muted: #a9b7c7;
  --bg: #0e1620;
  --card: #172433;
  --line: #314457;
  --ok: #8fd0a8;
  --bad: #f0a8a8;
  --warn: #e6c36a;
  --surface: #121c28;
  --input-bg: #101820;
  --page-top: #121b27;
  --glow: #0e1620;
  --progress-track: #243444;
  --side: #121c28;
  color-scheme: dark;
}
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 1rem 0; }
label { display: block; margin: 0.35rem 0; }
