:root {
  color-scheme: light;
  --paper: #f6f4ef;
  --porcelain: #fffefa;
  --ink: #20302a;
  --forest: #29493d;
  --orange: #d85f32;
  --risk: #9d4332;
  --muted: #69736e;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(rgba(32, 48, 42, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 48, 42, .045) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button { font: inherit; }

.page-shell {
  width: min(100%, 720px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 18px calc(36px + env(safe-area-inset-bottom));
}

.masthead {
  position: relative;
  overflow: hidden;
  padding: 26px 24px 38px;
  border-radius: 6px 34px 34px 34px;
  background: var(--ink);
  color: var(--porcelain);
}

.masthead::after {
  position: absolute;
  right: -34px;
  bottom: -62px;
  color: rgba(255, 255, 255, .05);
  content: "ROUTE";
  font-family: Georgia, serif;
  font-size: 112px;
  font-style: italic;
  font-weight: 700;
}

.brand-row { display: flex; align-items: center; gap: 11px; }
.brand-mark { padding: 6px 8px; border: 1px solid rgba(255,255,255,.48); border-radius: 3px 10px 10px 10px; font-size: 12px; font-weight: 800; letter-spacing: 1px; }
.brand-name { color: rgba(255,255,255,.65); font-size: 12px; font-weight: 700; letter-spacing: 2px; }
.route-index, .eyebrow, .ledger-label { color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: 2.2px; }
.route-index { margin-top: 48px; }
.masthead h1 { position: relative; z-index: 1; max-width: 560px; margin: 14px 0 0; font-family: Georgia, "PingFang SC", serif; font-size: clamp(38px, 10vw, 68px); line-height: 1.02; }
.lead { position: relative; z-index: 1; max-width: 520px; margin: 20px 0 0; color: rgba(255,255,255,.62); font-size: 15px; line-height: 1.75; }

.route-ledger {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 14px 0 0;
  border: 1px solid rgba(32,48,42,.12);
  border-radius: 22px 22px 22px 6px;
  background: var(--porcelain);
  box-shadow: 0 16px 46px rgba(32,48,42,.08);
}

.ledger-cell { min-height: 96px; padding: 21px; border-right: 1px solid rgba(32,48,42,.09); border-bottom: 1px solid rgba(32,48,42,.09); }
.ledger-cell:nth-child(2) { border-right: 0; }
.ledger-cell--wide { grid-column: span 2; min-height: 84px; border-right: 0; border-bottom: 0; }
.ledger-label { display: block; color: #7a837f; }
.ledger-cell strong { display: block; margin-top: 14px; font-size: 20px; line-height: 1.4; }
.ledger-cell--wide strong { font-size: 15px; }

.action-panel, .fallback-panel, .error-panel {
  position: relative;
  margin-top: 18px;
  padding: 28px 24px 24px;
  border-radius: 6px 30px 30px 30px;
  background: var(--forest);
  color: var(--porcelain);
}

.fallback-panel { background: var(--porcelain); color: var(--ink); border: 1px solid rgba(32,48,42,.12); }
.error-panel { background: var(--risk); }
.action-number { position: absolute; top: 20px; right: 22px; color: rgba(255,255,255,.13); font-family: Georgia, serif; font-size: 54px; font-style: italic; }
.action-number--muted { color: rgba(32,48,42,.09); }
.action-copy { position: relative; z-index: 1; max-width: 520px; padding-right: 54px; }
.action-copy h2, .error-panel h2 { margin: 10px 0 0; font-size: 27px; }
.action-copy p:not(.eyebrow), .error-panel p:not(.eyebrow) { margin: 12px 0 0; color: rgba(255,255,255,.62); font-size: 14px; line-height: 1.7; }
.fallback-panel .action-copy p:not(.eyebrow) { color: var(--muted); }

.primary-action, .secondary-action, .text-action {
  width: 100%;
  min-height: 52px;
  margin-top: 24px;
  border: 0;
  border-radius: 5px 18px 18px 18px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 750;
}
.primary-action { background: var(--orange); color: white; }
.secondary-action { border: 1px solid rgba(32,48,42,.14); background: var(--ink); color: white; }
.text-action { min-height: 46px; margin-top: 10px; background: transparent; color: var(--forest); }
.primary-action:active, .secondary-action:active, .text-action:active { transform: scale(.985); }
.status-copy { min-height: 21px; margin: 13px 0 0; color: rgba(255,255,255,.65); font-size: 13px; line-height: 1.6; }

.risk-notice { margin-top: 18px; padding: 21px 22px; border-left: 4px solid var(--risk); background: rgba(157,67,50,.08); }
.risk-notice strong { color: var(--risk); font-size: 14px; }
.risk-notice p { margin: 9px 0 0; color: #5f6964; font-size: 13px; line-height: 1.75; }

[hidden] { display: none !important; }

@media (max-width: 380px) {
  .page-shell { padding-left: 12px; padding-right: 12px; }
  .masthead { padding-left: 20px; padding-right: 20px; }
  .ledger-cell { padding: 18px; }
}
