:root {
  --ink: #162339;
  --muted: #6f7b8e;
  --soft: #9aa5b5;
  --line: #e6eaf0;
  --paper: #ffffff;
  --canvas: #f3f5f8;
  --navy: #10233d;
  --navy-2: #173452;
  --teal: #0e917f;
  --teal-dark: #087566;
  --teal-soft: #e6f6f3;
  --amber: #e69b2d;
  --amber-soft: #fff4df;
  --blue: #3678cf;
  --blue-soft: #eaf2fc;
  --violet: #7358c8;
  --violet-soft: #f0edfb;
  --shadow: 0 16px 42px rgba(24, 38, 57, .08);
  --radius: 18px;
  font-family: "Manrope", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.topbar {
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0d1e34;
  color: white;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--teal); box-shadow: 0 8px 20px rgba(14,145,127,.3); }
.brand-mark svg { width: 26px; height: 26px; stroke-width: 2.4; }
.brand-copy { display: flex; align-items: baseline; gap: 9px; }
.brand-copy strong { font-size: 21px; letter-spacing: .16em; }
.brand-copy small { color: #91a1b5; font-size: 12px; letter-spacing: .07em; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.api-status { display: flex; align-items: center; gap: 8px; color: #b6c2d1; font-size: 12px; }
.api-status i { width: 8px; height: 8px; border-radius: 99px; background: #7f8b99; box-shadow: 0 0 0 4px rgba(127,139,153,.12); }
.api-status.live i { background: #42c9a9; box-shadow: 0 0 0 4px rgba(66,201,169,.13); }
.api-status.demo i { background: #f4b548; box-shadow: 0 0 0 4px rgba(244,181,72,.13); }
.ghost-button, .text-button, .secondary-button, .close-button { border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.ghost-button { color: #dde5ef; height: 40px; padding: 0 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: rgba(255,255,255,.04); font-size: 13px; }
.ghost-button:hover { background: rgba(255,255,255,.09); }
.ghost-button svg, .text-button svg, .secondary-button svg { width: 17px; height: 17px; }

.fuel-price-strip { min-height: 58px; padding: 9px max(28px,calc((100vw - 1624px) / 2)); display: flex; align-items: center; gap: 26px; border-bottom: 1px solid #dfe5ea; background: #fff; box-shadow: 0 4px 14px rgba(16,35,61,.035); }
.fuel-price-title { min-width: 190px; display: flex; align-items: center; gap: 10px; }
.fuel-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: #b47418; background: var(--amber-soft); }
.fuel-icon svg { width: 19px; height: 19px; }
.fuel-price-title > div { display: flex; flex-direction: column; gap: 2px; }
.fuel-price-title strong { font-size: 12px; }
.fuel-price-title small { color: var(--soft); font-size: 8px; }
.fuel-prices { display: flex; align-items: center; gap: 9px; }
.fuel-prices > span { min-width: 118px; padding: 7px 11px; display: flex; align-items: baseline; gap: 5px; border: 1px solid #ece7dc; border-radius: 9px; background: #fffaf2; }
.fuel-prices small { color: #8f7857; font-size: 8px; }
.fuel-prices strong { color: #9a5e0d; font-size: 14px; }
.fuel-prices em { color: #a79378; font-size: 7px; font-style: normal; }
.fuel-source { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.fuel-source a { color: var(--muted); font-size: 9px; text-decoration: none; }
.fuel-source a:hover { color: var(--teal); text-decoration: underline; }
.fuel-source button { height: 30px; padding: 0 9px; display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; color: var(--muted); font-size: 9px; }
.fuel-source button:hover { color: var(--teal); border-color: #b7d7d1; }
.fuel-source button:disabled { opacity: .55; cursor: wait; }
.fuel-source button svg { width: 13px; height: 13px; }

.workspace { max-width: 1680px; min-height: calc(100vh - 130px); margin: 0 auto; display: grid; grid-template-columns: 428px 1fr; }
.calculator-panel { padding: 30px 30px 48px; background: var(--paper); border-right: 1px solid var(--line); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 6px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.panel-heading h1, .result-toolbar h2, .dialog-header h2 { margin: 0; font-size: 23px; line-height: 1.3; letter-spacing: -.02em; }
.draft-pill { margin-top: 4px; padding: 5px 9px; border-radius: 99px; color: #8792a0; background: #f2f4f7; font-size: 11px; }

.form-section { padding: 24px 0; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.section-title > span { color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.section-title h2 { margin: 0; font-size: 14px; }
.collapsible-form-section > summary { margin: 0; list-style: none; cursor: pointer; user-select: none; }
.collapsible-form-section > summary::-webkit-details-marker { display: none; }
.collapsible-form-section > summary .collapse-hint { margin-left: auto; color: var(--soft); font-size: 9px; font-weight: 500; }
.collapsible-form-section > summary .collapse-hint::before { content: "点击展开"; }
.collapsible-form-section[open] > summary .collapse-hint::before { content: "点击收起"; }
.collapsible-form-section > summary svg { width: 16px; height: 16px; color: var(--soft); transition: transform .2s ease; }
.collapsible-form-section[open] > summary { margin-bottom: 16px; }
.collapsible-form-section[open] > summary svg { transform: rotate(180deg); }
.route-inputs { position: relative; }
.location-field { min-height: 61px; display: flex; align-items: center; gap: 13px; padding: 8px 42px 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; transition: .2s ease; }
.location-field:first-child { margin-bottom: 10px; }
.location-field:focus-within { border-color: rgba(14,145,127,.48); box-shadow: 0 0 0 3px rgba(14,145,127,.08); background: white; }
.location-dot, .line-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 99px; box-shadow: 0 0 0 4px rgba(14,145,127,.1); }
.location-dot.start, .line-dot.start { background: var(--teal); }
.location-dot.end, .line-dot.end { background: var(--amber); box-shadow: 0 0 0 4px rgba(230,155,45,.12); }
.input-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.input-copy small, .select-field > span, .number-field > span, .text-field > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.input-copy input { width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 600; }
.route-line { position: absolute; width: 1px; height: 19px; left: 18px; top: 56px; border-left: 1px dashed #b4beca; z-index: 2; }
.swap-button { position: absolute; right: 10px; top: 51px; width: 31px; height: 31px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--muted); z-index: 3; box-shadow: 0 4px 12px rgba(20,35,54,.08); }
.swap-button:hover { color: var(--teal); border-color: #bcded7; }
.swap-button svg { width: 17px; height: 17px; transform: rotate(90deg); }
.field-hint { margin-top: 9px; display: flex; align-items: center; gap: 6px; color: var(--soft); font-size: 10px; }
.field-hint svg { width: 14px; height: 14px; }
.route-service-field { margin-top: 12px; }
.route-service-field > small, .number-field > small { color: var(--soft); font-size: 9px; line-height: 1.45; }
.route-history { margin-top: 13px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; }
.route-history[hidden] { display: none; }
.route-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.route-history-heading > span { display: flex; align-items: baseline; gap: 7px; }
.route-history-heading strong { font-size: 10px; }
.route-history-heading small { color: var(--soft); font-size: 8px; }
.route-history-heading button { padding: 2px 4px; border: 0; background: none; color: var(--soft); font-size: 8px; }
.route-history-heading button:hover { color: #a24d4d; }
.route-history-list { margin-top: 7px; display: flex; flex-direction: column; gap: 5px; }
.route-history-item { width: 100%; min-width: 0; padding: 7px 8px; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; background: white; color: var(--muted); text-align: left; }
.route-history-item:hover { border-color: #bee0da; background: var(--teal-soft); color: var(--teal-dark); }
.route-history-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.route-history-item i { color: var(--soft); font-size: 9px; font-style: normal; }

.strategy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.strategy-option input { position: absolute; opacity: 0; pointer-events: none; }
.strategy-card { min-height: 92px; padding: 13px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; text-align: center; transition: .18s ease; }
.strategy-card svg { width: 22px; height: 22px; margin-bottom: 2px; color: #7b8796; }
.strategy-card strong { font-size: 12px; }
.strategy-card small { color: var(--soft); font-size: 9px; }
.strategy-option input:checked + .strategy-card { border-color: var(--teal); background: var(--teal-soft); box-shadow: 0 0 0 1px var(--teal) inset; }
.strategy-option input:checked + .strategy-card svg, .strategy-option input:checked + .strategy-card strong { color: var(--teal-dark); }

.field-row { display: grid; gap: 10px; margin-top: 10px; }
.field-row:first-of-type { margin-top: 0; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.select-field, .number-field, .text-field { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.select-field select, .number-field > div, .text-field input { width: 100%; height: 43px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; color: var(--ink); font-size: 12px; transition: .2s ease; }
.select-field select { padding: 0 31px 0 11px; appearance: none; background-image: linear-gradient(45deg,transparent 50%,#8a95a4 50%),linear-gradient(135deg,#8a95a4 50%,transparent 50%); background-position: calc(100% - 15px) 18px,calc(100% - 11px) 18px; background-size: 4px 4px,4px 4px; background-repeat: no-repeat; }
.number-field > div { display: flex; align-items: center; overflow: hidden; }
.number-field input { width: 100%; min-width: 0; height: 100%; padding: 0 4px 0 11px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; font-weight: 700; }
.number-field em { flex: 0 0 auto; padding-right: 9px; color: var(--soft); font-size: 9px; font-style: normal; white-space: nowrap; }
.select-field select:focus, .number-field > div:focus-within, .text-field input:focus { outline: 0; border-color: rgba(14,145,127,.5); box-shadow: 0 0 0 3px rgba(14,145,127,.07); background-color: white; }
.switch-row { margin-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.basic-rate-field { margin-top: 12px; }
.basic-rate-field > small { color: var(--soft); font-size: 9px; line-height: 1.45; }
.switch-row > span { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.switch-row strong { font-size: 12px; }
.switch-row small { color: var(--soft); font-size: 9px; line-height: 1.45; }
.switch-row input { position: absolute; opacity: 0; }
.switch-row i { width: 40px; height: 23px; flex: 0 0 auto; padding: 3px; border-radius: 99px; background: #d8dde4; transition: .2s ease; }
.switch-row i::after { content: ""; display: block; width: 17px; height: 17px; border-radius: 99px; background: white; box-shadow: 0 1px 4px rgba(15,30,49,.22); transition: .2s ease; }
.switch-row input:checked + i { background: var(--teal); }
.switch-row input:checked + i::after { transform: translateX(17px); }

.advanced-section { margin: 0; border-bottom: 1px solid var(--line); }
.advanced-section summary { padding: 17px 0; display: flex; align-items: center; gap: 8px; list-style: none; font-size: 12px; font-weight: 700; cursor: pointer; }
.advanced-section summary::-webkit-details-marker { display: none; }
.advanced-section summary span { color: var(--soft); font-size: 9px; font-weight: 500; }
.advanced-section summary svg { width: 16px; height: 16px; margin-left: auto; transition: .2s ease; }
.advanced-section[open] summary svg { transform: rotate(180deg); }
.advanced-content { padding-bottom: 18px; }
.advanced-content .number-field em { padding-right: 7px; }
.text-field input { padding: 0 11px; outline: 0; }

.calculate-button { height: 50px; padding: 0 19px; border: 0; border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--teal); color: white; font-size: 13px; font-weight: 700; box-shadow: 0 10px 24px rgba(14,145,127,.22); transition: .2s ease; }
#calculatorForm > .calculate-button { width: 100%; margin-top: 24px; }
.calculate-button:hover { background: var(--teal-dark); transform: translateY(-1px); }
.calculate-button:disabled { opacity: .6; cursor: wait; transform: none; }
.calculate-button svg { width: 19px; height: 19px; }

.result-area { min-width: 0; padding: 31px 36px 40px; }
.result-toolbar { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.result-toolbar h2 span { margin-left: 8px; color: var(--soft); font-size: 11px; font-weight: 500; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.text-button { height: 38px; padding: 0 11px; color: var(--muted); font-size: 11px; }
.text-button:hover { color: var(--teal); }
.secondary-button { height: 39px; padding: 0 14px; border: 1px solid #d9dee6; border-radius: 10px; background: white; color: var(--ink); font-size: 11px; font-weight: 700; box-shadow: 0 5px 12px rgba(17,35,56,.04); }
.secondary-button:hover { border-color: #b7d7d1; color: var(--teal-dark); }

.notice-banner { min-height: 43px; margin-bottom: 14px; padding: 9px 13px; display: flex; align-items: center; gap: 9px; border: 1px solid #f1d79c; border-radius: 11px; background: var(--amber-soft); color: #75501c; font-size: 11px; }
.notice-banner svg { width: 17px; height: 17px; flex: 0 0 auto; }
.notice-banner span { flex: 1; }
.notice-banner button { border: 0; background: none; color: #98631b; font-size: 11px; font-weight: 700; text-decoration: underline; }
.calibration-trigger { color: var(--teal-dark); font-weight: 700; }
.calibration-banner { min-height: 60px; margin-bottom: 14px; padding: 11px 13px; display: flex; align-items: center; gap: 11px; border: 1px solid #bde0da; border-radius: 12px; background: var(--teal-soft); color: #155f55; }
.calibration-banner[hidden] { display: none; }
.calibration-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: white; color: var(--teal); }
.calibration-icon svg { width: 19px; height: 19px; }
.calibration-banner > div { min-width: 0; flex: 1; }
.calibration-banner strong { display: block; font-size: 11px; }
.calibration-banner p { margin: 2px 0 0; color: #38786f; font-size: 9px; }
.calibration-banner small { margin-top: 3px; display: block; color: #9b5f11; font-size: 9px; font-weight: 700; }
.calibration-banner button { height: 32px; padding: 0 10px; flex: 0 0 auto; border: 1px solid #9bcfc6; border-radius: 8px; background: white; color: var(--teal-dark); font-size: 9px; font-weight: 700; }

.map-card, .metric-card, .detail-card { background: white; border: 1px solid rgba(224,229,236,.9); border-radius: var(--radius); box-shadow: var(--shadow); }
.map-card { overflow: hidden; }
.map-meta { height: 0; position: relative; z-index: 5; }
.source-badge, .route-tag { position: absolute; top: 16px; display: inline-flex; align-items: center; border-radius: 99px; backdrop-filter: blur(8px); font-size: 10px; font-weight: 700; }
.source-badge { left: 17px; padding: 7px 10px; gap: 7px; background: rgba(255,255,255,.92); box-shadow: 0 5px 18px rgba(22,35,57,.09); }
.source-badge i { width: 7px; height: 7px; border-radius: 99px; background: var(--amber); }
.source-badge.live i { background: var(--teal); }
.route-tag { right: 17px; padding: 7px 11px; background: rgba(16,35,61,.9); color: white; }
.map-stage { height: 330px; position: relative; overflow: hidden; background: linear-gradient(145deg,#f3f8f7 0%,#edf3f4 42%,#f7f5ef 100%); }
.map-grid, .route-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-grid { color: rgba(98,133,133,.07); }
.land-line { fill: none; stroke: rgba(114,147,147,.12); stroke-width: 16; }
.land-line.line-b { stroke-width: 11; }
.land-line.thin { stroke-width: 3; stroke-dasharray: 4 9; }
.route-shadow { fill: none; stroke: rgba(7,61,62,.16); stroke-width: 13; }
.route-path { fill: none; stroke: var(--teal); stroke-width: 6; stroke-dasharray: 1 0; filter: drop-shadow(0 2px 3px rgba(8,117,102,.22)); }
.route-path.loading { stroke-dasharray: 10 9; animation: routeFlow 1s linear infinite; }
@keyframes routeFlow { to { stroke-dashoffset: -38; } }
.map-marker { position: absolute; z-index: 4; display: flex; align-items: center; gap: 8px; transform: translate(-16px,-16px); transition: left .35s ease, top .35s ease; }
.map-marker > span { width: 32px; height: 32px; display: grid; place-items: center; border: 3px solid white; border-radius: 99px 99px 99px 5px; transform: rotate(-45deg); background: var(--teal); color: white; font-size: 11px; font-weight: 800; box-shadow: 0 5px 13px rgba(16,35,61,.2); }
.map-marker > span::first-letter { transform: rotate(45deg); }
.map-marker > div { max-width: 180px; padding: 7px 10px; display: flex; flex-direction: column; border-radius: 8px; background: rgba(255,255,255,.94); box-shadow: 0 5px 17px rgba(17,35,56,.1); }
.map-marker small { color: var(--soft); font-size: 8px; }
.map-marker strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.start-marker { left: 14%; top: 76%; }
.end-marker { left: 84%; top: 23%; }
.end-marker > span { background: var(--amber); }
.map-link { position: absolute; right: 16px; bottom: 15px; z-index: 4; height: 32px; padding: 0 10px; display: flex; align-items: center; gap: 6px; border: 1px solid rgba(217,224,229,.9); border-radius: 8px; background: rgba(255,255,255,.9); color: var(--muted); text-decoration: none; font-size: 9px; box-shadow: 0 4px 12px rgba(18,34,53,.06); }
.map-link:hover { color: var(--teal); }
.map-link svg { width: 14px; height: 14px; }
.map-loading { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(240,246,245,.86); backdrop-filter: blur(4px); }
.map-loading[hidden] { display: none; }
.map-loading span { width: 35px; height: 35px; border: 3px solid rgba(14,145,127,.16); border-top-color: var(--teal); border-radius: 99px; animation: spin .8s linear infinite; }
.map-loading p { margin: 12px 0 3px; font-size: 13px; font-weight: 700; }
.map-loading small { color: var(--soft); font-size: 9px; }
@keyframes spin { to { transform: rotate(360deg); } }
.route-lineup { min-height: 70px; padding: 13px 17px; display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line); }
.route-lineup > div:not(.route-road) { display: flex; align-items: center; gap: 9px; min-width: 0; }
.route-lineup p { margin: 0; display: flex; min-width: 0; flex-direction: column; }
.route-lineup p small { color: var(--soft); font-size: 8px; }
.route-lineup p strong { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.route-lineup > svg { width: 20px; flex: 0 0 auto; color: #9aa6b5; }
.route-road { margin-left: auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 9px; }

.metrics-grid { margin-top: 15px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.metric-card { min-height: 117px; padding: 18px; display: flex; align-items: flex-start; gap: 13px; box-shadow: 0 9px 25px rgba(24,38,57,.055); }
.metric-icon { width: 37px; height: 37px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; }
.metric-icon svg { width: 20px; height: 20px; }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.teal { color: var(--teal); background: var(--teal-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.violet { color: var(--violet); background: var(--violet-soft); }
.metric-card > div { min-width: 0; }
.metric-card small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.metric-card strong { font-size: 22px; line-height: 1; letter-spacing: -.04em; }
.metric-card em { margin-left: 3px; color: var(--muted); font-size: 9px; font-style: normal; }
.metric-card p { margin: 8px 0 0; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }

.detail-grid { margin-top: 15px; display: grid; grid-template-columns: minmax(0,1.05fr) minmax(360px,.95fr); gap: 15px; }
.detail-card { min-height: 310px; padding: 23px; }
.card-title, .quote-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.card-title h3, .quote-top h3 { margin: 0; font-size: 16px; }
.card-title > span { padding: 5px 8px; border-radius: 7px; background: #f2f5f7; color: var(--muted); font-size: 9px; }
.breakdown-list { margin-top: 19px; display: flex; flex-direction: column; gap: 14px; }
.breakdown-item { display: grid; grid-template-columns: 87px 1fr 66px; align-items: center; gap: 11px; }
.breakdown-name { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.breakdown-name i { width: 7px; height: 7px; border-radius: 99px; background: var(--teal); }
.breakdown-track { height: 5px; overflow: hidden; border-radius: 99px; background: #edf0f3; }
.breakdown-track i { display: block; height: 100%; border-radius: 99px; background: var(--teal); transition: width .35s ease; }
.breakdown-value { text-align: right; font-size: 10px; font-weight: 700; }
.breakdown-item:nth-child(2) .breakdown-name i, .breakdown-item:nth-child(2) .breakdown-track i { background: var(--amber); }
.breakdown-item:nth-child(3) .breakdown-name i, .breakdown-item:nth-child(3) .breakdown-track i { background: var(--blue); }
.breakdown-item:nth-child(4) .breakdown-name i, .breakdown-item:nth-child(4) .breakdown-track i { background: var(--violet); }
.breakdown-item:nth-child(5) .breakdown-name i, .breakdown-item:nth-child(5) .breakdown-track i { background: #7b8795; }
.cost-total { margin-top: 19px; padding-top: 17px; display: flex; align-items: center; justify-content: space-between; border-top: 1px dashed #dce1e7; }
.cost-total span { color: var(--muted); font-size: 10px; }
.cost-total strong { font-size: 18px; }

.quote-card { position: relative; overflow: hidden; color: white; background: linear-gradient(145deg,#10233d 0%,#173b50 100%); border-color: transparent; }
.quote-card::after { content: ""; position: absolute; width: 280px; height: 280px; right: -115px; bottom: -155px; border: 44px solid rgba(52,195,170,.07); border-radius: 99%; }
.quote-card .eyebrow { color: #6fd6c4; }
.tax-badge { position: relative; z-index: 1; padding: 6px 9px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: rgba(255,255,255,.06); color: #c5d0dc; font-size: 9px; }
.tax-badge b { color: white; }
.quote-price { margin-top: 20px; display: flex; align-items: flex-start; }
.quote-price small { margin: 7px 7px 0 0; color: #8fa0b4; font-size: 18px; }
.quote-price strong { font-size: clamp(40px,4vw,52px); line-height: 1; letter-spacing: -.04em; }
.quote-unit { margin: 8px 0 18px 29px; color: #8fa0b4; font-size: 9px; }
.quote-unit b { color: #dbe4ec; }
.quote-formula { position: relative; z-index: 1; padding: 13px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 9px; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; background: rgba(255,255,255,.04); }
.quote-formula div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.quote-formula span { color: #899bad; font-size: 8px; }
.quote-formula strong { font-size: 10px; white-space: nowrap; }
.quote-formula i { color: #728598; font-size: 10px; font-style: normal; }
.basic-reference { position: relative; z-index: 1; margin-top: 11px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-left: 2px solid #63d0bd; border-radius: 0 8px 8px 0; background: rgba(99,208,189,.08); }
.basic-reference > div { display: flex; flex-direction: column; gap: 2px; }
.basic-reference span { color: #91a8b8; font-size: 8px; }
.basic-reference strong { color: #7ce0ce; font-size: 13px; }
.basic-reference p { margin: 0; color: #8195a7; text-align: right; font-size: 8px; }
.basic-reference.disabled { border-left-color: #66798b; background: rgba(137,155,173,.07); }
.basic-reference.disabled strong { color: #a7b6c4; }
.quote-note { position: relative; z-index: 1; margin-top: 15px; display: flex; align-items: flex-start; gap: 7px; color: #8395a8; font-size: 8px; line-height: 1.55; }
.quote-note svg { width: 13px; height: 13px; flex: 0 0 auto; }
.result-footer { margin-top: 17px; display: flex; align-items: center; justify-content: flex-end; gap: 22px; color: var(--soft); font-size: 8px; }
.result-footer b { color: var(--muted); font-weight: 600; }

.settings-dialog { width: min(520px,calc(100vw - 30px)); padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 28px 80px rgba(8,22,38,.32); }
.settings-dialog::backdrop { background: rgba(8,20,34,.62); backdrop-filter: blur(3px); }
.dialog-header { padding: 23px 24px 18px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.close-button { width: 34px; height: 34px; border-radius: 9px; color: var(--muted); }
.close-button:hover { background: #f2f4f6; }
.close-button svg { width: 18px; height: 18px; }
.dialog-body { padding: 23px 24px; }
.key-field > div { height: 44px; display: flex; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.key-field > div:focus-within { border-color: rgba(14,145,127,.5); box-shadow: 0 0 0 3px rgba(14,145,127,.07); background: white; }
.key-field > div input { height: 100%; border: 0; background: transparent; box-shadow: none; }
.key-field > div button { padding: 0 12px; border: 0; background: none; color: var(--teal); font-size: 10px; }
.key-field > small { color: var(--soft); font-size: 9px; }
.api-mode-field { margin-top: 22px; display: flex; flex-direction: column; gap: 9px; }
.api-mode-field > span { color: var(--muted); font-size: 11px; font-weight: 600; }
.api-mode-field label { min-height: 65px; padding: 12px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.api-mode-field label:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.api-mode-field input { position: absolute; opacity: 0; }
.api-mode-field i { width: 17px; height: 17px; display: grid; place-items: center; border: 1.5px solid #afb8c4; border-radius: 99px; }
.api-mode-field i::after { content: ""; width: 9px; height: 9px; border-radius: 99px; background: transparent; }
.api-mode-field input:checked + i { border-color: var(--teal); }
.api-mode-field input:checked + i::after { background: var(--teal); }
.api-mode-field div { display: flex; flex-direction: column; gap: 3px; }
.api-mode-field strong { font-size: 12px; }
.api-mode-field small { color: var(--soft); font-size: 9px; }
.settings-tip { margin-top: 18px; padding: 12px; display: flex; align-items: flex-start; gap: 9px; border-radius: 10px; background: var(--amber-soft); color: #72501e; }
.settings-tip svg { width: 17px; height: 17px; flex: 0 0 auto; }
.settings-tip p { margin: 0; font-size: 9px; line-height: 1.6; }
.settings-tip strong { display: block; font-size: 10px; }
.dialog-footer { padding: 16px 24px 22px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.dialog-footer .calculate-button { height: 43px; box-shadow: none; }

.calibration-dialog { width: min(900px,calc(100vw - 30px)); max-height: min(92vh,860px); }
.calibration-dialog form { min-height: 0; display: flex; flex-direction: column; }
.calibration-body { min-height: 0; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; background: #f7f9fb; }
.calibration-step { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.dedicated-device-step { grid-column: 1 / -1; border-color: #b9ddd6; background: linear-gradient(135deg,#f1fbf9,#fff 62%); }
.dedicated-device-status { margin-top: 14px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 10px; }
.dedicated-device-status > div { display: flex; flex-direction: column; gap: 3px; }
.dedicated-device-status b { font-size: 11px; color: var(--ink); }
.dedicated-device-status small { font-size: 9px; color: var(--soft); }
.dedicated-device-status small.success { color: var(--teal-dark); font-weight: 700; }
.dedicated-device-status small.error { color: #a24141; font-weight: 700; }
.dedicated-device-status .calculate-button { width: auto; height: 39px; padding-inline: 18px; box-shadow: none; }
.dedicated-pairing { margin-top: 13px; padding: 12px; display: flex; align-items: center; gap: 14px; border-radius: 11px; background: white; border: 1px solid #dce8e5; }
.dedicated-pairing[hidden] { display: none; }
.dedicated-pairing img { width: 112px; height: 112px; object-fit: contain; border: 1px solid var(--line); border-radius: 9px; }
.dedicated-pairing > div { display: flex; flex-direction: column; gap: 7px; }
.dedicated-pairing b { font-size: 11px; }
.dedicated-pairing strong { color: var(--teal-dark); font-size: 23px; letter-spacing: .14em; }
.dedicated-pairing small,.dedicated-pairing a { color: var(--soft); font-size: 9px; }
.dedicated-route-results { margin-top: 14px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.dedicated-route-results[hidden] { display: none; }
.dedicated-route-card { padding: 13px; display: flex; flex-direction: column; gap: 7px; border: 1px solid #dce3e8; border-radius: 11px; background: #fff; }
.dedicated-route-card.selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(14,145,127,.1); }
.dedicated-route-card h4 { margin: 0; font-size: 12px; }
.dedicated-route-card .route-metric { color: var(--muted); font-size: 10px; font-weight: 700; }
.dedicated-route-card .route-cost { color: var(--teal-dark); font-size: 9px; line-height: 1.55; }
.dedicated-route-card label { display: flex; align-items: center; gap: 5px; color: #8b5d10; font-size: 9px; }
.dedicated-route-card input { width: 72px; padding: 6px; border: 1px solid #e0c47d; border-radius: 7px; }
.dedicated-route-card button { margin-top: auto; }
.save-dedicated-results { margin-top: 12px; width: 100%; }
.save-dedicated-results[hidden],.dedicated-device-status [hidden] { display: none; }
.automation-warning { margin: 11px 0 0; color: #80651f; font-size: 8px; line-height: 1.55; }
.confirm-step { grid-column: 1 / -1; }
.step-heading { display: flex; align-items: flex-start; gap: 10px; }
.step-heading > span { min-width: 23px; height: 23px; padding: 0 7px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 99px; background: var(--teal); color: white; font-size: 9px; font-weight: 800; }
.step-heading > div { display: flex; flex-direction: column; gap: 3px; }
.step-heading strong { font-size: 12px; }
.step-heading small { color: var(--soft); font-size: 9px; line-height: 1.45; }
.route-chip { margin-top: 14px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; border-radius: 9px; background: #f4f6f8; }
.route-chip b { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.route-chip i { color: var(--teal); font-style: normal; }
.phone-handoff { margin-top: 13px; display: grid; grid-template-columns: 118px 1fr; align-items: center; gap: 14px; }
.phone-handoff > img { width: 118px; height: 118px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: white; object-fit: contain; }
.phone-handoff > div { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.phone-handoff .secondary-button { width: 100%; }
.text-link-button { height: 35px; display: grid; place-items: center; border-radius: 9px; color: var(--teal-dark); background: var(--teal-soft); font-size: 10px; font-weight: 700; text-decoration: none; }
.phone-handoff small { color: var(--soft); font-size: 8px; line-height: 1.45; }
.phone-handoff small.success { color: var(--teal-dark); font-weight: 700; }
.phone-handoff small.error { color: #a24141; }
.screenshot-drop { min-height: 91px; margin-top: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1px dashed #bec8d3; border-radius: 10px; color: var(--muted); background: #fafbfc; cursor: pointer; }
.screenshot-drop:hover { border-color: var(--teal); background: var(--teal-soft); }
.screenshot-drop input { position: absolute; opacity: 0; pointer-events: none; }
.screenshot-drop svg { width: 22px; height: 22px; color: var(--teal); }
.screenshot-drop span { font-size: 10px; font-weight: 700; }
.screenshot-drop small { color: var(--soft); font-size: 8px; }
.screenshot-preview { height: 88px; margin: 10px 0 0; overflow: hidden; position: relative; border: 1px solid var(--line); border-radius: 9px; background: #eef2f5; }
.screenshot-preview img { width: 100%; height: 100%; object-fit: contain; }
.screenshot-preview figcaption { position: absolute; left: 7px; bottom: 6px; padding: 3px 6px; border-radius: 5px; background: rgba(13,30,52,.78); color: white; font-size: 7px; }
.recognize-button { width: 100%; margin-top: 10px; }
.recognize-button:disabled { opacity: .5; cursor: not-allowed; }
.ocr-status { min-height: 14px; margin: 8px 0 0; color: var(--soft); font-size: 8px; line-height: 1.5; }
.ocr-status.success { color: var(--teal-dark); font-weight: 700; }
.ocr-status.error { color: #a24141; }
.calibration-values { margin-top: 15px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.duration-input { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto !important; }
.calibration-auto { margin-top: 14px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.calibration-auto input { accent-color: var(--teal); }
.record-note { margin-top: 12px; padding: 9px 10px; display: flex; align-items: flex-start; gap: 7px; border-radius: 8px; color: #77613d; background: var(--amber-soft); font-size: 8px; line-height: 1.55; }
.record-note svg { width: 14px; height: 14px; flex: 0 0 auto; }
.mac-amap-step { grid-column: 1 / -1; border-color: #a9d8d0; background: linear-gradient(140deg,#ffffff 0%,#f2fbf9 100%); }
.recommended-heading > span { background: #087566; }
.mac-helper-flow { margin-top: 14px; padding: 10px 12px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 9px; background: rgba(255,255,255,.8); }
.mac-helper-flow > div { display: flex; align-items: center; gap: 7px; color: #3d655f; font-size: 9px; font-weight: 700; }
.mac-helper-flow b { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 99px; color: white; background: var(--teal); font-size: 8px; }
.mac-helper-flow > i { color: #8ab9b1; font-style: normal; }
.mac-helper-actions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; }
.mac-helper-actions > a { text-decoration: none; }
.mac-helper-actions .calculate-button { width: 100%; height: 39px; box-shadow: none; }
.amap-clipboard-fallback { width: 100%; margin-top: 9px; padding: 9px 10px; resize: vertical; border: 1px dashed #b9c7d1; border-radius: 8px; color: var(--ink); background: rgba(255,255,255,.75); font: 9px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace; }
.amap-clipboard-fallback:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,145,127,.08); }
.amap-clipboard-fallback[hidden] { display: none; }
.amap-import-status { margin: 8px 0 0; color: var(--soft); font-size: 8px; line-height: 1.5; }
.amap-import-status.success { color: var(--teal-dark); font-weight: 700; }
.amap-import-status.error { color: #a24141; }
.amap-route-mismatch { margin-top: 9px; padding: 8px 10px; border-radius: 8px; color: #8a5611; background: var(--amber-soft); font-size: 8px; line-height: 1.5; }
.amap-option-list { margin-top: 10px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.amap-option-list[hidden] { display: none; }
.amap-option { min-height: 79px; padding: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; border: 1px solid #dce3e8; border-radius: 10px; background: white; text-align: left; }
.amap-option:hover { border-color: #9acfc5; }
.amap-option.selected { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(14,145,127,.1); background: #effaf8; }
.amap-option strong { font-size: 10px; }
.amap-option span { color: var(--muted); font-size: 9px; }
.amap-option small { color: #96701f; font-size: 8px; }

.toast { position: fixed; left: 50%; bottom: 30px; z-index: 50; padding: 10px 15px; display: flex; align-items: center; gap: 8px; border-radius: 10px; background: #10233d; color: white; font-size: 11px; box-shadow: 0 12px 35px rgba(9,24,41,.25); opacity: 0; transform: translate(-50%,20px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.toast.error { background: #9b3d3d; }
.toast svg { width: 15px; height: 15px; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 390px 1fr; }
  .calculator-panel { padding-inline: 24px; }
  .result-area { padding-inline: 24px; }
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .map-marker > div { display: none; }
}

@media (max-width: 860px) {
  .topbar { position: static; padding-inline: 18px; }
  .brand-copy small, .api-status { display: none; }
  .workspace { display: block; }
  .calculator-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .result-area { padding: 28px 18px 40px; }
  .result-toolbar { align-items: flex-start; }
  .route-road { display: none; }
  .fuel-price-strip { padding-inline: 18px; flex-wrap: wrap; gap: 8px 15px; }
  .fuel-price-title { min-width: 170px; }
  .fuel-source { margin-left: 0; }
  .calibration-body { grid-template-columns: 1fr; }
  .confirm-step { grid-column: auto; }
  .calibration-values { grid-template-columns: 1fr 1fr; }
  .amap-option-list { grid-template-columns: 1fr; }
  .dedicated-route-results { grid-template-columns: 1fr; }
  .dedicated-device-status { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar { height: 64px; }
  .fuel-price-strip { padding-block: 10px; }
  .fuel-price-title { width: 100%; }
  .fuel-prices { width: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .fuel-prices > span { min-width: 0; padding-inline: 7px; flex-wrap: wrap; }
  .fuel-source { width: 100%; justify-content: flex-end; }
  .brand-mark { width: 38px; height: 38px; }
  .ghost-button { padding: 0 10px; font-size: 0; }
  .ghost-button svg { width: 18px; height: 18px; }
  .calculator-panel { padding: 24px 18px 36px; }
  .strategy-card { padding-inline: 5px; }
  .result-toolbar { display: block; }
  .toolbar-actions { margin-top: 13px; justify-content: flex-end; }
  .map-stage { height: 250px; }
  .route-lineup { gap: 9px; }
  .route-lineup p strong { max-width: 110px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 108px; padding: 14px 12px; gap: 9px; }
  .metric-icon { width: 32px; height: 32px; }
  .metric-card strong { font-size: 18px; }
  .detail-card { padding: 19px; }
  .two-columns { grid-template-columns: 1fr; }
  .breakdown-item { grid-template-columns: 76px 1fr 57px; }
  .quote-formula { gap: 5px; padding-inline: 9px; }
  .result-footer { align-items: flex-end; flex-direction: column; gap: 5px; }
  .calibration-trigger { width: 100%; justify-content: flex-end; }
  .calibration-dialog { width: calc(100vw - 18px); max-height: 95vh; }
  .calibration-dialog .dialog-header, .calibration-dialog .dialog-body, .calibration-dialog .dialog-footer { padding-inline: 16px; }
  .phone-handoff { grid-template-columns: 100px 1fr; }
  .phone-handoff > img { width: 100px; height: 100px; }
  .calibration-values { grid-template-columns: 1fr; }
  .mac-helper-flow { align-items: stretch; flex-direction: column; }
  .mac-helper-flow > i { display: none; }
  .mac-helper-actions { grid-template-columns: 1fr; }
  .calibration-banner { align-items: flex-start; flex-wrap: wrap; }
  .calibration-banner button { margin-left: 45px; }
}

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: white; }
  .topbar, .fuel-price-strip, .calculator-panel, .toolbar-actions, .notice-banner, .calibration-banner, .map-link { display: none !important; }
  .workspace { display: block; max-width: none; }
  .result-area { padding: 0; }
  .result-toolbar { margin-bottom: 12px; }
  .map-stage { height: 235px; }
  .metrics-grid, .detail-grid { break-inside: avoid; }
  .metric-card, .map-card, .detail-card { box-shadow: none; }
  .detail-grid { grid-template-columns: 1.05fr .95fr; }
  .detail-card { min-height: 285px; }
}
