:root {
  color-scheme: dark;
  --bg: #06101e;
  --bg-2: #08182a;
  --panel: rgba(10, 28, 49, .94);
  --panel-2: #0d223b;
  --line: rgba(151, 190, 224, .19);
  --line-strong: rgba(112, 225, 255, .42);
  --text: #f5f9fd;
  --muted: #a9bdd1;
  --muted-2: #7189a1;
  --cyan: #73e5ff;
  --blue: #238cff;
  --blue-2: #0d67d2;
  --green: #64f0bd;
  --amber: #ffca65;
  --danger: #ff8794;
  --white: #fff;
  --shadow: 0 28px 80px rgba(0, 0, 0, .3);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Native hidden state must win over component display declarations. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: radial-gradient(circle at 72% -12%, rgba(23, 128, 218, .22), transparent 34%), radial-gradient(circle at 8% 20%, rgba(32, 214, 229, .08), transparent 28%), var(--bg); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgba(115, 229, 255, .68); outline-offset: 2px; }
a { color: var(--cyan); }

.app-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 72px; padding: 12px clamp(18px, 4vw, 58px); border-bottom: 1px solid var(--line); background: rgba(4, 14, 27, .88); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(115, 229, 255, .56); border-radius: 12px; background: linear-gradient(145deg, #147ee5, #1552a5); box-shadow: 0 10px 28px rgba(21, 112, 216, .3); font-size: 11px; font-weight: 900; letter-spacing: .06em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.01em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.review-badge, .status-badge, .confidence-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(11, 35, 62, .8); font-size: 11px; font-weight: 800; letter-spacing: .02em; }

main { width: min(1680px, 100%); margin: 0 auto; padding: 0 clamp(16px, 3.2vw, 52px) 70px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); align-items: end; gap: 34px; padding: clamp(42px, 7vw, 90px) 0 clamp(30px, 5vw, 58px); }
.eyebrow { display: block; margin-bottom: 9px; color: var(--cyan); font-size: 11px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.hero h1 { max-width: 900px; margin: 0; font-size: clamp(38px, 6vw, 72px); line-height: .99; letter-spacing: -.052em; }
.hero p { max-width: 830px; margin: 20px 0 0; color: #c4d5e5; font-size: clamp(16px, 1.7vw, 20px); line-height: 1.58; }
.hero-method { justify-self: end; min-width: 280px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, rgba(15, 43, 74, .84), rgba(7, 23, 41, .92)); box-shadow: var(--shadow); }
.hero-method span, .hero-method strong, .hero-method small { display: block; }
.hero-method span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.hero-method strong { margin: 7px 0 4px; font-size: 16px; }
.hero-method small { color: var(--muted); }

.workspace { display: grid; grid-template-columns: minmax(560px, 1.08fr) minmax(450px, .92fr); align-items: start; gap: 22px; }
.planner-form { display: grid; gap: 14px; }
.form-card, .result-card { border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(155deg, rgba(14, 38, 66, .96), rgba(7, 24, 43, .98)); box-shadow: 0 16px 44px rgba(0, 0, 0, .17); }
.form-card { padding: clamp(18px, 2.5vw, 28px); }
.section-heading, .result-heading, .recommendation-top, .stop-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading > div { display: flex; align-items: center; gap: 10px; }
.section-heading h2, .result-heading h3 { margin: 0; letter-spacing: -.02em; }
.section-heading h2 { font-size: 21px; }
.step { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border: 1px solid rgba(115, 229, 255, .35); border-radius: 9px; color: var(--cyan); background: rgba(27, 137, 236, .13); font-size: 11px; font-weight: 900; }
.required-note { color: var(--muted-2); font-size: 11px; font-weight: 700; text-transform: uppercase; }

.planning-direction { margin-top: 20px; }
.planning-direction legend { margin-bottom: 9px; }
.direction-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.direction-options label { position: relative; display: block; min-width: 0; cursor: pointer; }
.direction-options input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.direction-options span { display: block; min-height: 70px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(5, 20, 36, .57); transition: border-color .18s, box-shadow .18s, background .18s; }
.direction-options strong, .direction-options small { display: block; }
.direction-options strong { font-size: 13px; }
.direction-options small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.direction-options input:checked + span { border-color: rgba(115, 229, 255, .62); background: linear-gradient(145deg, rgba(25, 122, 207, .24), rgba(8, 35, 61, .72)); box-shadow: inset 0 0 0 1px rgba(115, 229, 255, .13), 0 10px 28px rgba(0, 0, 0, .12); }
.direction-options input:focus-visible + span { outline: 3px solid rgba(115, 229, 255, .68); outline-offset: 2px; }

.location-block { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(145px, .31fr); align-items: end; gap: 12px; margin-top: 24px; }
.location-block::before { position: absolute; top: 39px; bottom: -29px; left: 16px; width: 1px; background: linear-gradient(var(--line-strong), transparent); content: ""; }
.destination-block::before { display: none; }
.location-index { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 5px; border-radius: 50%; font-size: 12px; font-weight: 900; }
.location-index.pickup { color: #001c17; background: var(--green); }
.location-index.delivery { color: #06182d; background: var(--cyan); }
.field { display: grid; gap: 7px; min-width: 0; }
.field label, .field > label { color: #d8e5f0; font-size: 12px; font-weight: 800; }
.field small { color: var(--muted-2); font-size: 11px; line-height: 1.45; }
.field input, .field select, .input-suffix { width: 100%; min-height: 46px; border: 1px solid rgba(139, 181, 219, .27); border-radius: 10px; background: #081b30; color: var(--text); transition: border-color .18s, box-shadow .18s, background .18s; }
.field input, .field select { padding: 10px 12px; }
.field select {
  height: 46px;
}
.field input:hover, .field select:hover, .input-suffix:hover { border-color: rgba(115, 229, 255, .44); }
.field input:focus, .field select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(78, 190, 234, .13); background: #09223d; outline: none; }
.field input::placeholder { color: #58728a; }
.input-suffix { display: flex; align-items: center; overflow: hidden; }
.input-suffix input { min-width: 0; border: 0; background: transparent; box-shadow: none; }
.input-suffix span { padding-right: 11px; color: var(--muted); font-size: 11px; font-weight: 800; }
.two-column, .three-column, .four-column, .five-column { display: grid; gap: 12px; margin-top: 16px; }
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.four-column { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.five-column { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.stops-list { display: grid; gap: 10px; margin: 16px 0 0 46px; }
.stop-card { padding: 15px; border: 1px solid rgba(135, 180, 219, .18); border-radius: 13px; background: rgba(5, 19, 35, .64); }
.stop-card-head { margin-bottom: 11px; }
.stop-card-head strong { font-size: 13px; }
.remove-stop { border: 0; color: #f3a2ad; background: transparent; font-size: 11px; font-weight: 800; }
.stop-grid { display: grid; grid-template-columns: minmax(200px, 1.4fr) repeat(3, minmax(115px, .6fr)); gap: 10px; }
.stop-appointment { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.stop-appointment summary { color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 800; }
.add-stop { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 13px 0 0 46px; padding: 7px 12px; border: 1px dashed rgba(115, 229, 255, .44); border-radius: 9px; color: var(--cyan); background: rgba(14, 79, 130, .1); font-size: 12px; font-weight: 800; }
.add-stop span { font-size: 18px; line-height: 1; }

.route-controls { display: flex; align-items: center; gap: 13px; margin-top: 20px; padding: 14px; border: 1px solid rgba(115, 229, 255, .17); border-radius: 13px; background: rgba(5, 19, 34, .56); }
.route-status { flex: 1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.status-badge.good { border-color: rgba(100, 240, 189, .4); color: var(--green); background: rgba(18, 112, 82, .14); }
.status-badge.warn { border-color: rgba(255, 202, 101, .45); color: var(--amber); background: rgba(126, 87, 13, .16); }
.status-badge.busy { border-color: rgba(115, 229, 255, .45); color: var(--cyan); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px; font-weight: 850; transition: transform .16s, box-shadow .16s, border-color .16s, background .16s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.button-primary { min-height: 50px; padding: 12px 19px; color: #fff; background: linear-gradient(135deg, var(--blue-2), var(--blue)); box-shadow: 0 13px 34px rgba(22, 119, 226, .25); }
.button-secondary { color: #eafbff; border-color: rgba(115, 229, 255, .36); background: linear-gradient(135deg, rgba(16, 109, 207, .75), rgba(15, 82, 151, .75)); white-space: nowrap; }
.button-quiet { color: #c7d9e9; border-color: var(--line); background: rgba(10, 31, 54, .74); }
.button-light { color: #06345c; background: #e9f8ff; }
.button-outline-light { color: #fff; border-color: rgba(255,255,255,.38); background: rgba(255,255,255,.06); }
.button-icon { font-size: 16px; }

.advanced-card { padding: 0; overflow: hidden; }
.advanced-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 82px; padding: 18px 26px; cursor: pointer; list-style: none; }
.advanced-card > summary::-webkit-details-marker { display: none; }
.advanced-card > summary > span:first-child { display: grid; grid-template-columns: 32px 1fr; align-items: center; column-gap: 10px; }
.advanced-card > summary strong { font-size: 17px; }
.advanced-card > summary small { grid-column: 2; color: var(--muted); margin-top: 2px; }
.summary-action { color: var(--cyan); font-size: 12px; font-weight: 800; }
.advanced-content { display: grid; gap: 15px; padding: 0 26px 26px; border-top: 1px solid var(--line); }
fieldset { min-width: 0; margin: 15px 0 0; padding: 0; border: 0; }
legend { margin-bottom: 11px; color: #dceaf5; font-size: 12px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.check-card, .toggle-row { display: flex; align-items: center; gap: 11px; min-height: 52px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(5, 20, 36, .57); cursor: pointer; }
.check-card input[type="checkbox"], .toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue); }
.check-card strong, .check-card small, .toggle-row strong, .toggle-row small { display: block; }
.check-card strong, .toggle-row strong { font-size: 12px; }
.check-card small, .toggle-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.check-card small {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.check-card small input {
  width: 72px;
  min-height: 40px;
  margin: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #07182b;
  font-size: 16px;
}
.toggle-row { margin: 5px 0 12px; }
.toggle-row.compact { margin-top: 16px; }
.receiver-toggle { margin-top: 16px; }
.receiver-hours { margin-top: 10px; transition: opacity .2s ease; }
.receiver-hours[aria-disabled="true"] { opacity: .48; }
.receiver-hours select:disabled, .receiver-hours input:disabled { cursor: not-allowed; }
.facility-calendar-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.facility-calendar-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(5, 20, 36, .42); }
.facility-calendar-card .toggle-row { margin: 0 0 12px; }
.facility-hours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; transition: opacity .2s ease; }
.facility-hours[aria-disabled="true"] { opacity: .48; }
.facility-hours select:disabled, .facility-hours input:disabled { cursor: not-allowed; }
.facility-hours .span-calendar { grid-column: 1 / -1; }
.holiday-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-height: 38px; color: #c9dae8; font-size: 11px; font-weight: 750; }
.holiday-check input { width: 17px; height: 17px; accent-color: var(--blue); }
.cycle-rule-field { width: min(290px, 100%); margin-top: 12px; }
.fieldset-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.route-profile { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.route-profile summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); cursor: pointer; list-style: none; font-size: 11px; }
.route-profile summary::-webkit-details-marker { display: none; }
.route-profile summary strong, .route-profile summary small { display: block; }
.route-profile summary strong { color: var(--text); font-size: 12px; }
.route-profile summary small { margin-top: 2px; }
.route-profile[open] > summary > span:last-child { color: var(--cyan); }
.form-actions { display: flex; align-items: center; gap: 10px; padding: 4px; }
.form-actions p { margin: 0 0 0 auto; color: var(--muted-2); font-size: 11px; }

.results-panel { position: sticky; top: 88px; min-height: 620px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 22px; background: linear-gradient(165deg, rgba(11, 33, 58, .98), rgba(4, 16, 30, .99)); box-shadow: var(--shadow); }
.results-empty { display: grid; justify-items: start; min-height: 620px; align-content: center; padding: clamp(28px, 5vw, 60px); background: linear-gradient(180deg, rgba(10, 42, 70, .16), transparent); }
.results-empty h2 { max-width: 410px; margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.06; letter-spacing: -.04em; }
.results-empty p { max-width: 430px; margin: 15px 0; color: var(--muted); line-height: 1.56; }
.results-empty ul { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; color: #c9dae8; font-size: 12px; }
.results-empty li::before { margin-right: 8px; color: var(--green); content: "✓"; }
.empty-orbit { position: relative; width: 72px; height: 72px; margin-bottom: 23px; border: 1px solid rgba(115, 229, 255, .22); border-radius: 50%; }
.empty-orbit::before, .empty-orbit::after { position: absolute; border: 1px solid rgba(115, 229, 255, .17); border-radius: 50%; content: ""; }
.empty-orbit::before { inset: 10px; }
.empty-orbit::after { inset: 23px; }
.empty-orbit span { position: absolute; top: 6px; left: 30px; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 20px var(--cyan); }
.results-content { display: grid; gap: 12px; padding: 12px; }
.recommendation { padding: clamp(22px, 3vw, 34px); border: 1px solid rgba(124, 231, 255, .28); border-radius: 16px; background: radial-gradient(circle at 88% 8%, rgba(81, 221, 255, .19), transparent 31%), linear-gradient(145deg, #0a3a69, #0a2446 54%, #071a32); }
.recommendation h2 { margin: 7px 0 6px; font-size: clamp(31px, 4.3vw, 52px); line-height: 1; letter-spacing: -.045em; }
.recommendation > p { margin: 0; color: #bfd6e8; font-size: 12px; }
.confidence-badge.high { border-color: rgba(100,240,189,.4); color: var(--green); }
.confidence-badge.medium { border-color: rgba(255,202,101,.45); color: var(--amber); }
.confidence-badge.low { border-color: rgba(255,135,148,.42); color: #ffabb5; }
.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.scenario-grid > div { min-width: 0; padding: 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(3, 20, 39, .46); }
.scenario-grid > div.recommended { border-color: rgba(115,229,255,.42); background: rgba(20, 116, 196, .18); }
.scenario-grid span, .scenario-grid strong { display: block; }
.scenario-grid span { margin-bottom: 5px; color: #99b6cd; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.scenario-grid strong { overflow-wrap: anywhere; font-size: 13px; }
.result-actions { display: flex; gap: 8px; margin-top: 17px; }
.result-card { padding: 18px; border-radius: 15px; box-shadow: none; }
.result-heading { margin-bottom: 13px; }
.result-heading h3 { font-size: 15px; }
.result-heading > span { max-width: 60%; overflow: hidden; color: var(--muted-2); font-size: 10px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.metric-grid > div { padding: 11px; border: 1px solid rgba(135, 180, 219, .14); border-radius: 9px; background: rgba(5, 19, 35, .54); }
.metric-grid span, .metric-grid strong { display: block; }
.metric-grid span { margin-bottom: 5px; color: var(--muted-2); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.metric-grid strong { font-size: 15px; }
.delivery-schedule-list { display: grid; gap: 10px; }
.delivery-schedule-stop { overflow: hidden; border: 1px solid rgba(135, 180, 219, .18); border-radius: 12px; background: rgba(5, 19, 35, .56); }
.delivery-schedule-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid rgba(135, 180, 219, .12); }
.delivery-sequence { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(115, 229, 255, .35); border-radius: 10px; color: var(--cyan); background: rgba(20, 116, 196, .18); font-size: 11px; font-weight: 900; }
.delivery-schedule-head > div { min-width: 0; }
.delivery-schedule-head strong, .delivery-schedule-head small { display: block; }
.delivery-schedule-head strong { font-size: 13px; }
.delivery-schedule-head small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.delivery-status { padding: 5px 7px; border: 1px solid rgba(115, 229, 255, .25); border-radius: 999px; color: var(--cyan); font-size: 8px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.delivery-status.fixed { border-color: rgba(100, 240, 189, .32); color: var(--green); }
.delivery-status.risk { border-color: rgba(255, 135, 148, .42); color: #ffabb5; }
.delivery-primary-time { padding: 13px 12px 4px; }
.delivery-primary-time span, .delivery-primary-time strong { display: block; }
.delivery-primary-time span { margin-bottom: 5px; color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.delivery-primary-time strong { color: #f0f8ff; font-size: 17px; line-height: 1.25; }
.delivery-time-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 9px 12px 12px; }
.delivery-time-grid > div { min-width: 0; padding: 9px; border: 1px solid rgba(135, 180, 219, .12); border-radius: 8px; background: rgba(3, 16, 30, .45); }
.delivery-time-grid > div.recommended { border-color: rgba(115, 229, 255, .28); background: rgba(20, 116, 196, .12); }
.delivery-time-grid span, .delivery-time-grid strong { display: block; }
.delivery-time-grid span { margin-bottom: 4px; color: var(--muted-2); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.delivery-time-grid strong { overflow-wrap: anywhere; font-size: 10px; line-height: 1.35; }
.delivery-schedule-stop footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-top: 1px solid rgba(135, 180, 219, .1); color: var(--muted); font-size: 9px; }
.delivery-schedule-stop footer strong { color: #cfe3f3; font-size: 10px; text-align: right; }
.factor-list { display: grid; gap: 7px; }
.factor-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid rgba(135, 180, 219, .1); }
.factor-row:last-child { border-bottom: 0; }
.factor-row span { color: #c4d5e3; font-size: 12px; }
.factor-row strong { color: var(--cyan); font-size: 12px; }
.timeline { position: relative; display: grid; gap: 0; padding-left: 17px; }
.timeline::before { position: absolute; top: 8px; bottom: 8px; left: 4px; width: 1px; background: rgba(115,229,255,.28); content: ""; }
.timeline-event { position: relative; display: grid; grid-template-columns: minmax(110px, .35fr) 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(135,180,219,.09); }
.timeline-event::before { position: absolute; top: 15px; left: -17px; width: 8px; height: 8px; border: 2px solid #0d2946; border-radius: 50%; background: var(--cyan); content: ""; }
.timeline-event time { color: var(--muted); font-size: 10px; }
.timeline-event strong, .timeline-event small { display: block; }
.timeline-event strong { font-size: 11px; }
.timeline-event small { margin-top: 3px; color: var(--muted-2); font-size: 9px; line-height: 1.4; }
.warning-card { border-color: rgba(255, 202, 101, .24); background: linear-gradient(145deg, rgba(69, 49, 12, .24), rgba(8, 24, 42, .98)); }
.warning-card ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.warning-card li { padding-left: 17px; color: #c8d6e2; font-size: 11px; line-height: 1.48; }
.warning-card li::before { float: left; margin-left: -17px; color: var(--amber); content: "•"; }

.methodology { display: grid; grid-template-columns: .5fr 1.5fr; gap: 28px; margin-top: 38px; padding: clamp(24px, 4vw, 46px); border: 1px solid var(--line); border-radius: 20px; background: rgba(8, 25, 44, .78); }
.methodology h2 { max-width: 380px; margin: 0; font-size: clamp(26px, 3vw, 40px); letter-spacing: -.04em; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.method-grid article { padding: 17px; border: 1px solid rgba(135, 180, 219, .15); border-radius: 13px; background: rgba(5, 18, 33, .54); }
.method-grid strong { font-size: 13px; }
.method-grid p { color: var(--muted); font-size: 11px; line-height: 1.55; }
.method-grid a { font-size: 10px; font-weight: 800; text-decoration: none; }
.decision-boundary { grid-column: 1 / -1; margin: 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.6; }
.decision-boundary strong { color: #dce8f2; }

body.embedded .app-bar,
body.embedded .methodology {
  display: none;
}

body.embedded main {
  width: 100%;
  max-width: none;
  padding: 0 14px 28px;
}

body.embedded .hero {
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 22px;
  padding: 26px 4px 22px;
}

body.embedded .hero h1 {
  max-width: 780px;
  font-size: clamp(32px, 4.5vw, 54px);
}

body.embedded .hero p {
  margin-top: 12px;
  font-size: 15px;
}

body.embedded .hero-method {
  min-width: 0;
  padding: 15px 17px;
}

body.embedded .results-panel {
  top: 14px;
}

.toast { position: absolute; right: auto; bottom: auto; z-index: 40; width: min(380px, calc(100vw - 32px)); max-width: 380px; padding: 12px 15px; border: 1px solid rgba(115,229,255,.42); border-radius: 11px; color: #eafaff; background: #0a2948; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(255,135,148,.5); background: #431a26; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .results-panel { position: static; min-height: auto; }
  .results-empty { min-height: 440px; }
  .five-column { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .review-badge { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-method { justify-self: stretch; }
  .location-block { grid-template-columns: 34px 1fr; }
  .location-block .timezone-field { grid-column: 2; }
  .stop-grid { grid-template-columns: 1fr 1fr; }
  .stop-location { grid-column: 1 / -1; }
  .four-column, .five-column { grid-template-columns: repeat(2, 1fr); }
  .methodology { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; }
  body.embedded .hero { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .app-bar { min-height: 64px; padding: 10px 14px; }
  .brand,
  .button { min-height: 44px; }
  .header-actions .button { padding: 8px 10px; font-size: 11px; }
  main { padding-inline: 11px; }
  .hero { padding-top: 34px; }
  .hero h1 { font-size: 39px; }
  .form-card { padding: 17px; border-radius: 15px; }
  .add-stop,
  .route-profile summary {
    min-height: 44px;
  }
  .field select {
    height: 46px;
  }
  .two-column, .three-column, .four-column, .five-column, .check-grid, .stop-grid, .scenario-grid, .direction-options, .facility-calendar-grid { grid-template-columns: 1fr; }
  .stops-list, .add-stop { margin-left: 0; }
  .route-controls { align-items: stretch; flex-direction: column; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions p { margin: 0; text-align: center; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .delivery-schedule-head { grid-template-columns: 34px minmax(0, 1fr); }
  .delivery-status { grid-column: 2; justify-self: start; }
  .delivery-time-grid { grid-template-columns: 1fr; }
  .timeline-event { grid-template-columns: 1fr; gap: 3px; }
  .result-actions .button { flex: 1; }
  .result-heading {
    align-items: flex-start;
  }
  .result-heading > span {
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }
  .method-grid a {
    display: flex;
    min-height: 44px;
    align-items: center;
  }
  .check-card small input {
    min-height: 44px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  :is(
    .brand,
    .button,
    .add-stop,
    .route-profile summary,
    .field input,
    .field select,
    .check-card small input,
    .method-grid a
  ) {
    min-height: 44px;
  }

  .method-grid a {
    display: flex;
    align-items: center;
  }
}

@media print {
  :root { color-scheme: light; }
  body { color: #102a43; background: #fff; }
  .app-bar, .hero, .planner-form, .methodology, .result-actions, .toast { display: none !important; }
  main { width: 100%; padding: 0; }
  .workspace { display: block; }
  .results-panel { position: static; border: 0; background: #fff; box-shadow: none; }
  .results-content { padding: 0; }
  .recommendation, .result-card { break-inside: avoid; color: #102a43; border: 1px solid #bdd0df; background: #fff; box-shadow: none; }
  .recommendation h2, .result-card h3, .metric-grid strong, .scenario-grid strong, .timeline-event strong, .delivery-schedule-head strong, .delivery-primary-time strong, .delivery-time-grid strong, .delivery-schedule-stop footer strong { color: #102a43; }
  .recommendation > p, .scenario-grid span, .result-heading > span, .metric-grid span, .timeline-event time, .timeline-event small, .warning-card li, .delivery-schedule-head small, .delivery-primary-time span, .delivery-time-grid span, .delivery-schedule-stop footer { color: #486581; }
  .scenario-grid > div, .metric-grid > div, .delivery-schedule-stop, .delivery-time-grid > div { border-color: #d8e4ec; background: #f7fafc; }
}
