:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --card: #fff;
  --text: #1a2332;
  --muted: #4f5a6d;
  --line: #d8e0ea;
  --accent: #c62828;
  --soft: #fdeaea;
  --navy: #1a2332;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.55 "Segoe UI",
    system-ui,
    sans-serif;
}
/* Shared River City CPR header; keep the brand light in both appearances. */
.shell {
  width: min(calc(100% - 48px), 1180px);
  margin-inline: auto;
}
.topbar {
  background: #1a2332;
  color: rgb(255 255 255 / 72%);
  font-size: 12px;
}
.topbar .shell {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
header {
  background: #fff;
  color: #1a2332;
  border-bottom: 1px solid #d8e0ea;
  box-shadow: 0 2px 8px rgb(0 0 0 / 5%);
}
.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 8px;
}
header .quiet {
  background: #fff;
  color: #1a2332;
  border-color: #d8e0ea;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
}
.brand .river {
  color: #c62828;
}
.brand img {
  flex-shrink: 0;
  object-fit: contain;
}
.brand-subtitle {
  display: block;
  font-size: 13px;
  color: #4f5a6d;
}
main {
  max-width: 1220px;
  margin: auto;
  padding: 24px 20px 48px;
}
h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.16;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 14px;
}
h2 {
  font-size: 23px;
  line-height: 1.3;
  margin: 0 0 18px;
}
p {
  margin: 0 0 16px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 17px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 650;
}
button:hover {
  filter: brightness(0.93);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.quiet {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--text);
}
textarea {
  resize: vertical;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 16px;
}
label input,
label select,
label textarea {
  display: block;
  margin-top: 6px;
}
input[type="radio"],
input[type="checkbox"] {
  width: 21px;
  height: 21px;
  min-height: 21px;
  flex: 0 0 21px;
  margin: 2px 0;
  accent-color: var(--accent);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 450;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 18px;
  padding: 12px 14px;
  display: flex;
  gap: 20px;
}
legend {
  font-weight: 600;
}
.check:last-child {
  margin-bottom: 0;
}
.card {
  background: var(--card);
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 7px;
  box-shadow: 0 4px 18px rgb(0 0 0 / 7%);
  margin-bottom: 24px;
}
.narrow {
  max-width: 580px;
  margin: 28px auto;
}
.layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: start;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-bottom: 24px;
  padding: 32px;
  border-radius: 7px;
  background: #1a2332;
  color: #fff;
}
.intro p {
  color: #dbe6f4;
}
.intro h1,
.login-heading h1 {
  font-weight: 800;
  letter-spacing: -0.035em;
}
.intro .eyebrow,
.login-heading .eyebrow {
  color: #ffb3b3 !important;
}
.intro-copy,
.intro .badge {
  position: relative;
  z-index: 1;
}
.intro .badge {
  color: #fff;
  border-color: rgb(255 255 255 / 35%);
}
.hero-watermark {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: -40px;
  width: 300px;
  opacity: 0.12;
  filter: grayscale(1) brightness(1.2) contrast(1.15);
  transform: translateY(-50%);
  pointer-events: none;
}
#login-panel {
  overflow: hidden;
  padding: 0;
}
.login-heading {
  position: relative;
  overflow: hidden;
  padding: 28px;
  background: #1a2332;
  color: #fff;
}
.login-heading > :not(.hero-watermark) {
  position: relative;
  z-index: 1;
}
.login-heading h1 {
  font-size: clamp(28px, 4vw, 36px);
}
.login-heading p:last-child {
  color: #dbe6f4;
  margin-bottom: 0;
}
#login-form {
  padding: 26px 28px 0;
}
#login-form > button {
  width: 100%;
}
.login-hint {
  padding: 20px 28px 28px;
  margin: 0;
}
.layout > aside.card {
  border-top-color: #63c3e9;
}
#reports-panel > .card + .card {
  border-top-color: #63c3e9;
}
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent) !important;
  font-weight: 750;
  margin-bottom: 10px;
}
.badge {
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 8px 15px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}
nav {
  display: flex;
  gap: 8px;
  margin: 8px 0 24px;
  overflow: auto;
}
nav button {
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}
nav button[aria-current] {
  background: var(--navy);
  color: #fff;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.hint,
.optional {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.hint {
  line-height: 1.6;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
#swap {
  margin: -3px 0 14px;
}
#notice:not(:empty) {
  border: 1px solid var(--accent);
  background: var(--soft);
  color: var(--text);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 20px;
}
#account {
  display: flex;
  align-items: center;
  gap: 14px;
}
#who {
  font-size: 14px;
}
.report-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filters {
  display: grid;
  grid-template-columns: 110px 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.filters button {
  margin-bottom: 16px;
}
.totals {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
  margin: 10px 0 18px;
}
.totals strong {
  display: block;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}
.trip-item {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  break-inside: avoid;
}
.trip-item h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
.trip-item p {
  margin: 0 0 9px;
  overflow-wrap: anywhere;
}
.trip-item .miles {
  font-weight: 750;
}
.trip-item .actions {
  margin-top: 14px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.destination {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}
.destination strong {
  display: block;
}
#map {
  height: 340px;
  min-width: 200px;
  margin: 14px 0;
}
#map-status {
  margin-top: 14px;
}
.suggestions:empty {
  display: none;
}
.suggestions {
  margin-top: -8px;
  margin-bottom: 16px;
}
.suggestions button {
  display: block;
  text-align: left;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  width: 100%;
  font-size: 14px;
  border-radius: 0;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 8px;
  padding: 10px;
  background: #fff;
  color: #111;
  z-index: 99;
}
:focus-visible {
  outline: 3px solid #1382ac;
  outline-offset: 3px;
}
footer {
  background: #1a2332;
  color: rgb(255 255 255 / 72%);
  font-size: 13px;
}
.footer-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 20px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.footer-brand strong span {
  color: #ff8f8f;
}
footer p {
  margin: 0;
}
#network {
  display: block;
}
[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  main {
    padding: 16px 14px 32px;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .intro {
    display: block;
  }
  .badge {
    display: inline-block;
    margin-bottom: 12px;
  }
  .row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filters button {
    align-self: end;
  }
  .shell {
    width: calc(100% - 28px);
  }
  .topbar .shell > span:last-child {
    display: none;
  }
  .header-inner {
    min-height: 72px;
    gap: 12px;
  }
  .brand img {
    width: 44px;
    height: 44px;
  }
  .intro {
    padding: 24px;
  }
  .intro .hero-watermark {
    width: 240px;
    right: -90px;
  }
  .footer-inner {
    flex-wrap: wrap;
  }
  .login-heading {
    padding: 24px;
  }
  #login-form {
    padding: 24px 24px 0;
  }
  .login-hint {
    padding: 20px 24px 24px;
  }
  .brand strong {
    font-size: 16px;
  }
  #account {
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
  }
  #account button {
    padding: 7px 10px;
    min-height: 44px;
  }
  .card {
    border-radius: 7px;
  }
  .narrow {
    margin: 16px auto;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f1726;
    --card: #162133;
    --text: #f4f7fb;
    --muted: #c2cad7;
    --line: #34445a;
    --accent: #ff8f8f;
    --soft: #3a2028;
  }
  button {
    color: #161e2b;
  }
  .quiet {
    color: var(--text);
  }
  nav button[aria-current] {
    background: #dbe6f4;
    color: #162133;
  }
  .suggestions button {
    color: var(--text);
  }
  header {
    color-scheme: light;
  }
  header button {
    background: #fff;
    color: #1a2332;
    border-color: #d8e0ea;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media print {
  body {
    background: white;
    color: black;
    font-size: 11pt;
  }
  header {
    padding: 0 0 15px;
  }
  main {
    max-width: none;
    padding: 0;
  }
  .topbar,
  .hero-watermark,
  .intro,
  nav,
  footer,
  #notice,
  #account,
  .actions,
  .filters,
  #trip-panel,
  #destinations-panel,
  .trip-item button {
    display: none !important;
  }
  #reports-panel {
    display: block !important;
  }
  .card {
    box-shadow: none;
    border: 0;
    padding: 0;
    margin: 20px 0;
  }
  .trip-item {
    border-color: #bbb;
  }
  .totals {
    border-color: #aaa;
  }
  .hint {
    color: #333;
  }
  table {
    font-size: 10pt;
  }
  a {
    color: black;
  }
}
@media (max-width: 700px) {
  nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
  }
  nav button {
    white-space: normal;
    font-size: 14px;
    padding: 10px 6px;
    line-height: 1.3;
  }
}
@page {
  margin: 14mm;
}
@media print {
  :root {
    color-scheme: light;
    --card: #fff;
    --text: #000;
    --muted: #333;
    --line: #aaa;
  }
  .card,
  header {
    background: #fff;
    color: #000;
  }
  .eyebrow {
    color: #333 !important;
  }
  .table-wrap {
    overflow: visible;
  }
  thead {
    display: table-header-group;
  }
}
#enable-maps,
#route {
  margin-bottom: 18px;
}

@media print {
  .header-inner {
    width: 100%;
    min-height: 0;
    padding: 0;
  }
  .card {
    border: 0;
  }
}
