/* AI course page (/cities/<city>/plan/). The opening (hero, no-JS note) is Gunsan's templates/assets/plan.css with the same
   values; the form, the progress, the result and the map follow doc/mockup/phase5-chat/plan-form.html and plan-result.html
   with the tokens of style.css (--sea, --ink, --hair, --r-s ...). Everything Leaflet positions goes through CSSOM; no rule
   here needs an inline style attribute (strict nonce CSP). Touch targets are 44px or more except the map pins (30px). */
.trp { --trp-r: 24px; --trp-card: #fff; --pln-ok: #1D7A46; --pln-err: #A11A20; --pln-warn-bg: #FFF8E1; --pln-warn-line: #E6C452; --pln-flag-bg: #FFF4C2; --pln-flag-line: #C9A400; --pln-flag-ink: #5B4600; }
.trp :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.trp .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--r-pill); background: var(--sea); color: #fff; font-weight: 700; border: 0; text-decoration: none; cursor: pointer; }
.trp .btn:hover { background: var(--sea-hi); }
.trp .btn.pln-sec { background: #fff; color: var(--sea-deep); box-shadow: inset 0 0 0 1.5px var(--g2); }
.trp .btn.pln-sec:hover { background: var(--g0); color: var(--sea-deep); }
.trp .btn:disabled { opacity: .55; cursor: not-allowed; }
.trp .btn.pln-sm { min-height: 44px; padding: 0 16px; font-size: 14.5px; }

/* ---------------------------------------------------------------- the opening */
.trp-hero { background: radial-gradient(120% 90% at 85% 10%, var(--tint2) 0%, var(--g0) 45%, #fff 100%); padding: clamp(28px, 6vw, 72px) 0 clamp(24px, 4vw, 48px); overflow: hidden; }
.trp-hero-in { display: grid; gap: 24px; align-items: center; }
@media (min-width: 900px) { .trp-hero-in { grid-template-columns: 1.1fr .9fr; } }
.trp-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 6px 14px 6px 8px; border-radius: var(--r-pill); background: #fff; color: var(--sea-deep); font-size: 14px; font-weight: 700; box-shadow: var(--shadow-1); }
.trp-hero h1 { font-size: clamp(30px, 5.2vw, 52px); line-height: 1.18; letter-spacing: -.03em; margin: 0 0 16px; color: var(--ink); word-break: keep-all; }
.trp-lede { font-size: clamp(16px, 1.6vw, 18px); line-height: 1.65; color: var(--ink-2); max-width: 36em; margin: 0 0 20px; word-break: keep-all; }
.trp-lede b { color: var(--sea-deep); }
.trp-promise { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.trp-promise li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 6px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .85); color: var(--ink); font-size: 14px; font-weight: 700; box-shadow: inset 0 0 0 1px var(--hair); }
.trp-start { min-height: 52px; font-size: 17px; }
.trp-hero-art { position: relative; min-height: 260px; }
@media (min-width: 900px) { .trp-hero-art { min-height: 360px; } }
.trp-blob { position: absolute; inset: 8% 6%; border-radius: 46% 54% 52% 48% / 52% 44% 56% 48%; background: linear-gradient(140deg, #fff 0%, var(--tint) 60%, var(--tint2) 100%); box-shadow: var(--shadow-2); }
.trp-hero-mascot { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); display: block; }
.trp-hero-mascot img { width: clamp(150px, 22vw, 200px); height: auto; }
.trp-nojs { padding: 16px var(--m); background: var(--sand); border-radius: var(--r-s); }

/* ---------------------------------------------------------------- the form */
.pln-form { padding-top: 32px; padding-bottom: 8px; max-width: 860px; }
.pln-fs { border: 1px solid var(--hair); border-radius: var(--r-s); padding: 14px 16px 16px; margin: 0 0 14px; min-width: 0; background: #fff; }
.pln-fs > legend { padding: 0 8px; font-weight: 700; font-size: 16px; color: var(--ink); }
.pln-hint { font-size: 13.5px; line-height: 1.5; color: var(--ink-3); margin: 0 0 8px; }
.pln-fld { display: grid; gap: 4px; margin: 0 0 12px; min-width: 0; }
.pln-fld > label, .pln-fld > .pln-lb { font-size: 14px; font-weight: 700; color: var(--ink); }
.pln-in, .pln-sel { min-height: 44px; border: 1px solid var(--ink-3); border-radius: 10px; padding: 0 12px; background: #fff; color: var(--ink); width: 100%; max-width: 320px; font: inherit; }
.pln-in.pln-s { max-width: 120px; }
textarea.pln-in { padding: 10px 12px; min-height: 96px; max-width: none; resize: vertical; }
.pln-in[aria-invalid="true"], .pln-sel[aria-invalid="true"] { border-color: var(--pln-err); border-width: 2px; }
.pln-row { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: flex-start; }
.pln-opts { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.pln-opt { position: relative; display: inline-flex; }
.pln-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.pln-opt span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--hair); border-radius: var(--r-pill); background: #fff; font-size: 15px; color: var(--ink); }
.pln-opt input:checked + span { background: var(--tint2); border-color: var(--sea); color: var(--sea-deep); font-weight: 700; }
.pln-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.pln-opt input:disabled { cursor: not-allowed; }
.pln-opt input:disabled + span { color: var(--ink-3); background: var(--bg-2); border-style: dashed; }
.pln-err { display: flex; gap: 6px; align-items: flex-start; margin: 2px 0 0; color: var(--pln-err); font-size: 13.5px; font-weight: 700; }
.pln-err::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--pln-err); color: #fff; font-size: 12px; }
.pln-cnt { font-size: 12.5px; color: var(--ink-3); text-align: right; }
.pln-sum-err { border: 2px solid var(--pln-err); border-radius: var(--r-s); background: #FFF5F5; padding: 10px 14px; margin: 0 0 14px; font-size: 14.5px; }
.pln-sum-err ul { margin: 4px 0 0; padding-left: 1.2em; list-style: disc; }
.pln-sum-err a { color: var(--pln-err); }
.pln-go { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.pln-fine { font-size: 13px; line-height: 1.55; color: var(--ink-3); margin: 8px 0 0; }

/* ---------------------------------------------------------------- progress */
.pln-work { padding-top: 24px; padding-bottom: 24px; max-width: 860px; }
.pln-work h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.03em; }
.pln-steps { display: grid; gap: 8px; margin: 14px 0; padding: 0; list-style: none; counter-reset: pln-s; }
.pln-steps li { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--hair); border-radius: var(--r-s); font-size: 15px; color: var(--ink-3); background: #fff; }
.pln-steps li::before { counter-increment: pln-s; content: counter(pln-s); display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-2); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pln-steps li.done { color: var(--ink); }
.pln-steps li.done::before { content: "\2713"; background: var(--pln-ok); color: #fff; }
.pln-steps li.now { border-color: var(--sea); background: var(--tint); color: var(--ink); font-weight: 700; }
.pln-steps li.now::before { background: var(--sea-hi); color: #fff; }

/* ---------------------------------------------------------------- notices and errors */
.pln-banner { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--pln-warn-line); border-radius: var(--r-s); background: var(--pln-warn-bg); padding: 12px 14px; font-size: 14.5px; margin: 0 0 12px; }
.pln-banner b { white-space: nowrap; }
.pln-box { border: 1px dashed var(--ink-3); border-radius: var(--r-s); padding: 18px; background: var(--bg-2); }
.pln-box h2 { font-size: 18px; margin: 0 0 6px; }
.pln-box ul { list-style: disc; padding-left: 1.2em; margin: 8px 0 12px; font-size: 14.5px; }
.pln-fail { border: 1px solid #F0B6B9; background: #FFF5F5; border-radius: var(--r-s); padding: 12px 14px; font-size: 14.5px; color: #7A1519; }
.pln-fail p { margin: 0; }
.pln-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }

/* ---------------------------------------------------------------- the result */
.pln-res { padding-top: 28px; padding-bottom: 48px; max-width: 860px; }
.pln-res h2.pln-title { font-size: clamp(24px, 3.4vw, 30px); letter-spacing: -.035em; line-height: 1.25; margin: 0; }
.pln-sumtx { margin: 6px 0 14px; color: var(--ink-2); line-height: 1.65; }
.pln-ai { display: inline-block; margin-left: 6px; background: var(--pln-flag-bg); color: var(--pln-flag-ink); border: 1px dashed var(--pln-flag-line); border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 700; letter-spacing: 0; vertical-align: middle; }
.pln-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; padding: 0; border: 0; }
.pln-tab { min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--hair); background: #fff; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.pln-tab[aria-pressed="true"] { background: var(--tint2); border-color: var(--sea); color: var(--sea-deep); font-weight: 700; }
.pln-mapbox { border: 1px solid var(--hair); border-radius: var(--r-s); overflow: hidden; background: #E8EEF6; }
.pln-map { position: relative; height: 380px; isolation: isolate; background: #E8EEF6; }
.pln-mapcap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 6px 12px; background: #fff; border-top: 1px solid var(--hair); font-size: 12.5px; color: var(--ink-2); }
.pln-mapcap strong { font-weight: 700; color: var(--ink); }
.pln-mapcap a { color: var(--link); text-decoration: underline; text-underline-offset: .18em; }
.pln-mapbox .leaflet-control-attribution a { text-decoration: underline; text-underline-offset: .18em; }
.pln-mapnote { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.plan-pin-wrap { background: transparent; border: 0; }
.plan-pin { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sea-hi); color: #fff; border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .35); font: 700 14px/1 var(--font); font-variant-numeric: tabular-nums; }
.plan-pin-wrap:focus-visible .plan-pin { outline: 3px solid var(--focus); outline-offset: 2px; }
.pln-day { margin-top: 22px; }
.pln-day > h3 { font-size: 18px; letter-spacing: -.03em; margin: 0 0 8px; }
.pln-stops { list-style: none; margin: 0; padding: 0; }
.pln-stops > li { display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--hair); }
.pln-no { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sea-hi); color: #fff; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.pln-nm { margin: 0; font-weight: 700; font-size: 16.5px; }
.pln-nm a { color: var(--link); }
.pln-role { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 6px; background: var(--bg-2); color: var(--ink-2); font-size: 12.5px; font-weight: 400; line-height: 20px; }
.pln-tm { margin: 0; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink-3); }
.pln-why { margin: 2px 0 0; font-size: 14.5px; color: var(--ink-2); }
.pln-flag { display: inline-block; padding: 0 8px; border-radius: 6px; background: var(--pln-flag-bg); border: 1px solid var(--pln-flag-line); color: var(--pln-flag-ink); font-size: 12px; font-weight: 700; line-height: 20px; margin: 4px 6px 0 0; letter-spacing: 0; }
.pln-stops > li.pln-leg { display: block; border-top: 0; padding: 2px 0 2px 46px; font-size: 13.5px; color: var(--ink-3); }
.pln-fees { margin-top: 20px; border: 1px solid var(--hair); border-radius: var(--r-s); padding: 12px 16px; }
.pln-fees h3 { font-size: 16px; margin: 0 0 6px; }
.pln-fees table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.pln-fees th, .pln-fees td { padding: 5px 0; text-align: left; border-top: 1px solid var(--hair); font-weight: 400; }
.pln-fees td { text-align: right; font-variant-numeric: tabular-nums; }
.pln-fees tr.pln-total th, .pln-fees tr.pln-total td { font-weight: 700; }
.pln-cap { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-3); }
.pln-warns { margin-top: 14px; border: 1px solid var(--pln-warn-line); background: var(--pln-warn-bg); border-radius: var(--r-s); padding: 10px 16px; }
.pln-warns h3 { font-size: 15px; margin: 0; }
.pln-warns ul { list-style: disc; padding-left: 1.2em; font-size: 14.5px; margin: 4px 0 0; }
.pln-link { width: 100%; max-width: 560px; }
.pln-status { font-size: 14px; color: var(--pln-ok); font-weight: 700; }

@media (max-width: 599px) {
  .pln-map { height: 300px; }
  .pln-fs { padding: 12px; }
  .pln-in, .pln-sel { max-width: none; }
  .pln-in.pln-s { max-width: 120px; }
  .pln-go .btn, .pln-acts .btn { flex: 1 1 100%; }
}

@media print {
  .mast, .foot, .skip-link, .trp-hero, .trp-nojs, .pln-form, .pln-work, .pln-acts, .pln-tabs, .trp-fallback { display: none !important; }
  .pln-map { height: 300px; }
  .pln-day { break-inside: avoid; }
}

/* the progress and the result slot are in the server HTML; `hidden` keeps them out until used (no class display wins) */
.pln-work[hidden], .pln-res[hidden] { display: none; }

/* Result editing: per-stop actions, the edit-in-words box, the notice above the submit button (P5-N9). */
.pln-notice { margin: 4px 0 12px; }
.pln-notice a, .pln-free a { color: inherit; text-decoration: underline; text-underline-offset: .18em; }
.pln-stopacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pln-act { min-height: 44px; min-width: 44px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: #fff; color: var(--sea-deep); font: 700 14px/1 var(--font); box-shadow: inset 0 0 0 1.5px var(--g2); cursor: pointer; }
.pln-act:hover:not(:disabled) { background: var(--g0); }
.pln-act[aria-pressed="true"] { background: var(--tint2); box-shadow: inset 0 0 0 1.5px var(--sea); }
.pln-act:disabled { opacity: .55; cursor: not-allowed; }
.pln-free { margin-top: 20px; border: 1px solid var(--hair); border-radius: var(--r-s); padding: 12px 16px; }
.pln-free h3 { font-size: 16px; margin: 0 0 6px; }
.pln-editst { min-height: 1.4em; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--pln-ok); }
.pln-fail h2 { font-size: 17px; margin: 0 0 6px; }
@media print { .pln-stopacts, .pln-free, .pln-editst { display: none !important; } }
