@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,600;1,700&display=swap');

:root {
  --ink: #132a25;
  --muted: #60726d;
  --line: #dce6df;
  --paper: #f7f7f2;
  --card: #ffffff;
  --acid: #d8ff66;
  --mint: #66d5ad;
  --orange: #ff8656;
  --shadow: 0 18px 55px rgba(17, 45, 39, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; background: radial-gradient(circle at 86% 3%, rgba(216, 255, 102, 0.18), transparent 23rem), var(--paper); color: var(--ink); font-family: Manrope, Arial, sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(100%, 820px); margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 20px 26px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 49px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; letter-spacing: .075em; font-size: 10px; line-height: 1.04; }
.brand strong, .brand small { display: block; font-weight: 800; }
.brand small { font-size: 8px; color: #5e766d; letter-spacing: .175em; margin-top: 3px; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; background: var(--ink); color: var(--acid); clip-path: polygon(50% 0, 100% 27%, 100% 73%, 50% 100%, 0 73%, 0 27%); font-size: 22px; font-family: Arial, sans-serif; }
.vehicle-pill, .step-chip, .confidence-chip { border: 1px solid rgba(19,42,37,.15); border-radius: 999px; color: #496057; font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .055em; padding: 8px 10px; white-space: nowrap; }

.hero { isolation: isolate; margin-bottom: 39px; max-width: 720px; min-height: 238px; overflow: hidden; padding: 16px 18px 18px 0; position: relative; }
.hero > :not(.hero-vehicle) { position: relative; z-index: 1; }
.hero-vehicle { background: radial-gradient(ellipse at 60% 55%, rgba(102,213,173,.34), transparent 26%), linear-gradient(135deg, transparent 28%, rgba(216,255,102,.22) 28% 31%, transparent 31% 48%, rgba(57,113,94,.15) 48% 51%, transparent 51%); border-radius: 50%; height: 300px; opacity: .7; pointer-events: none; position: absolute; right: -140px; top: -43px; transform: rotate(-12deg); width: 535px; z-index: 0; }
.eyebrow { color: #67917f; font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 500; letter-spacing: .125em; line-height: 1.3; margin: 0 0 9px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(39px, 8vw, 66px); letter-spacing: -.058em; line-height: .98; margin-bottom: 18px; }
h1 em { color: #39715e; font-family: 'Playfair Display', Georgia, serif; font-weight: 600; letter-spacing: -.052em; }
.hero-copy { color: #52665f; font-size: 14px; line-height: 1.72; max-width: 560px; margin-bottom: 20px; }
.quick-facts { display: flex; gap: 13px; flex-wrap: wrap; color: #66766f; font-family: 'DM Mono', monospace; font-size: 10px; }
.quick-facts span { border-left: 1px solid #b8c9bf; padding-left: 11px; }
.quick-facts b { color: var(--ink); font-size: 12px; }

.planner-card, .vehicle-card, .result-panel, .settings-card, .map-card { background: var(--card); box-shadow: var(--shadow); }
.planner-card, .vehicle-card { border-radius: 20px; padding: 27px; position: relative; z-index: 3; }
.vehicle-card { margin-bottom: 17px; }
.section-heading { align-items: flex-start; display: flex; justify-content: space-between; gap: 16px; margin-bottom: 25px; }
.section-heading h2 { font-size: 21px; letter-spacing: -.04em; line-height: 1.1; margin: 0; }
.step-chip { background: #f8faf7; font-size: 9px; padding: 8px 9px; }
.field-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 24px; }
.vehicle-selector { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.vehicle-selector select { background: #f6f8f5; border: 1px solid #e7ede8; border-radius: 9px; color: #2c4f42; font-size: 12px; font-weight: 600; height: 46px; outline: 0; padding: 0 9px; width: 100%; }
.custom-vehicle-fields { background: #f8fbf8; border: 1px solid #e1ece4; border-radius: 12px; display: grid; gap: 12px; padding: 13px; }
.custom-vehicle-fields [hidden] { display: none; }
.custom-vehicle-fields > .field:last-child > input { background: #fff; border: 1px solid #e7ede8; border-radius: 9px; color: var(--ink); height: 46px; outline: 0; padding: 0 13px; width: 100%; }
.custom-vehicle-fields > .field:last-child > input:focus { border-color: #66b999; box-shadow: 0 0 0 3px rgba(102, 213, 173, .16); }
.field { color: #375248; display: grid; font-size: 11px; font-weight: 700; gap: 7px; letter-spacing: -.01em; }
.field b { color: #609681; font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .07em; }
.field small { color: #87948f; font-size: 9px; font-weight: 500; line-height: 1.4; }
.soc-input, .inline-unit { align-items: center; background: #f6f8f5; border: 1px solid #e7ede8; border-radius: 9px; display: flex; height: 46px; overflow: hidden; }
.soc-input:focus-within, .inline-unit:focus-within, .location-input:focus-within, select:focus { border-color: #66b999; box-shadow: 0 0 0 3px rgba(102, 213, 173, .16); outline: 0; }
.soc-input input, .inline-unit input { background: transparent; border: 0; color: var(--ink); font-size: 18px; font-weight: 700; height: 100%; min-width: 0; outline: 0; padding: 0 9px 0 14px; width: 100%; }
.soc-input span, .inline-unit span { color: #80a08f; font-family: 'DM Mono', monospace; font-size: 12px; padding-right: 14px; }
.inline-unit.is-calculated { background: #edf3ee; }
.inline-unit.is-calculated input { color: #4d685e; cursor: default; }

.route-fields { position: relative; }
.location-field { position: relative; z-index: 2; }
.location-field + .location-field { margin-top: 19px; }
.location-field label { color: #375248; display: block; font-size: 11px; font-weight: 700; margin: 0 0 7px; }
.location-input { align-items: center; background: #fff; border: 1px solid #dce8df; border-radius: 10px; display: flex; height: 52px; transition: border .2s, box-shadow .2s; }
.location-input input { background: transparent; border: 0; color: var(--ink); font-size: 13px; min-width: 0; outline: 0; padding: 0 10px; width: 100%; }
.location-input input::placeholder { color: #a1afa8; }
.route-line { border-left: 1px dashed #bed7ca; height: 18px; left: 20px; position: absolute; top: 72px; }
.location-button { background: transparent; border: 0; color: #4f8c75; font-size: 23px; height: 100%; line-height: 1; padding: 0 14px; }
.location-button:hover { color: #183b31; }
.suggestions { background: #fff; border: 1px solid #dce8df; border-radius: 10px; box-shadow: 0 12px 25px rgba(23, 53, 43, .12); list-style: none; margin: 4px 0 0; max-height: 205px; overflow: auto; padding: 5px; position: absolute; width: 100%; z-index: 6; }
.suggestions:empty { display: none; }
.suggestions button { background: transparent; border: 0; border-radius: 7px; color: #344d43; display: block; font-size: 11px; line-height: 1.4; padding: 9px; text-align: left; width: 100%; }
.suggestions button:hover, .suggestions button:focus { background: #eff7f1; outline: 0; }
.form-notice { color: #8a6860; font-size: 10px; line-height: 1.5; margin: 12px 0 15px; min-height: 15px; }
.form-notice[data-state="ok"] { color: #468169; }
.form-notice[data-state="loading"] { color: #598270; }
.primary-button { align-items: center; background: var(--ink); border: 0; border-radius: 10px; color: #fff; display: flex; font-size: 13px; font-weight: 700; justify-content: space-between; min-height: 54px; padding: 0 18px; transition: background .2s, transform .2s; width: 100%; }
.primary-button:hover { background: #20483c; transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }

.map-card { border-radius: 0 0 20px 20px; margin: -9px 9px 31px; min-height: 240px; overflow: hidden; position: relative; z-index: 1; }
#map { height: 300px; min-height: 240px; width: 100%; }
.map-status { align-items: center; background: linear-gradient(120deg, #d9ebdf, #edf2df); color: #587064; display: flex; font-family: 'DM Mono', monospace; font-size: 10px; height: 300px; justify-content: center; letter-spacing: .04em; position: absolute; text-align: center; width: 100%; z-index: 2; }
.map-status.is-hidden { display: none; }

.result-panel { border-radius: 20px; margin-bottom: 17px; overflow: hidden; padding: 27px; }
.simple-result-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
.simple-result-grid article { background: #f5f8f2; border-radius: 13px; min-width: 0; padding: 16px 14px; }
.simple-result-grid .battery-left { background: #173e32; }
.simple-result-grid span { color: #72847d; display: block; font-size: 9px; font-weight: 700; line-height: 1.4; }
.simple-result-grid strong { color: #173e32; display: block; font-family: 'Playfair Display', serif; font-size: clamp(25px, 5vw, 34px); letter-spacing: -.065em; line-height: 1.1; margin-top: 7px; }
.simple-result-grid .battery-left span { color: rgba(238,247,239,.72); }
.simple-result-grid .battery-left strong { color: var(--acid); }
.simple-result-grid .battery-left.is-low-battery { background: #fff1df; border: 1px solid #e6a04c; }
.simple-result-grid .battery-left.is-low-battery span { color: #8e5b21; }
.simple-result-grid .battery-left.is-low-battery strong { color: #a55d14; }
.simple-result-grid .battery-left.is-unreachable { background: #7f2c30; border: 1px solid #a64246; }
.simple-result-grid .battery-left.is-unreachable span { color: rgba(255,239,235,.78); }
.simple-result-grid .battery-left.is-unreachable strong { color: #fff0e8; }
.arrival-warning { background: #fff1df; border-left: 3px solid #dd8d2c; border-radius: 7px; color: #87531e; font-size: 10px; font-weight: 700; line-height: 1.5; margin: 13px 0 0; padding: 9px 10px; }
.arrival-warning.is-unreachable { background: #fde9e7; border-left-color: #bc4c4f; color: #8b3639; }
.simple-result-note { color: #71837a; font-size: 10px; line-height: 1.5; margin: 15px 1px 0; }
.return-stats { border-top: 1px solid #e2ebe4; margin-top: 20px; padding-top: 20px; }
.return-stats .eyebrow { margin-bottom: 6px; }
.return-stats h3 { font-size: 18px; letter-spacing: -.04em; margin-bottom: 13px; }
.find-chargers-button { background: #eff7f1; border: 1px solid #b9d9c6; border-radius: 10px; color: #256145; font-size: 12px; font-weight: 700; margin-top: 20px; min-height: 48px; padding: 0 15px; width: 100%; }
.find-chargers-button:hover { background: #e4f3e8; }
.find-chargers-button:disabled { cursor: wait; opacity: .65; }
.charger-panel { border-top: 1px solid #e2ebe4; margin-top: 20px; padding-top: 20px; }
.charger-heading { align-items: flex-start; display: flex; gap: 14px; justify-content: space-between; }
.charger-heading .eyebrow { margin-bottom: 6px; }
.charger-heading h3 { font-size: 18px; letter-spacing: -.04em; margin: 0; }
.charger-count { background: #e7f5eb; border-radius: 999px; color: #427a62; font-family: 'DM Mono', monospace; font-size: 9px; font-weight: 500; padding: 7px 9px; white-space: nowrap; }
.charger-status { color: #71837a; font-size: 10px; line-height: 1.5; margin: 10px 0 12px; }
.charger-endpoint { background: #f5f8f2; border: 1px solid #e2ebe4; border-radius: 10px; display: grid; gap: 4px; padding: 11px 12px; }
.charger-origin { margin-bottom: 9px; }
.charger-destination { margin-top: 10px; }
.charger-endpoint span { color: #67917f; font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: .09em; }
.charger-endpoint strong { color: #24483b; font-size: 11px; line-height: 1.4; }
.charger-list { display: grid; gap: 8px; }
.charger-list article { border: 1px solid #e2ebe4; border-radius: 11px; padding: 12px; }
.charger-list strong { color: #173e32; display: block; font-size: 12px; line-height: 1.35; }
.charger-list p { color: #71837a; font-size: 10px; line-height: 1.45; margin: 4px 0 0; }
.charger-list small { color: #4d8770; display: block; font-family: 'DM Mono', monospace; font-size: 8px; line-height: 1.45; margin-top: 7px; }
.charger-list a { color: #257250; display: inline-block; font-size: 9px; font-weight: 700; margin-top: 8px; text-decoration: none; }
.more-chargers-button { background: #fff; border: 1px solid #b9d9c6; border-radius: 9px; color: #256145; font-size: 11px; font-weight: 700; margin-top: 10px; min-height: 43px; padding: 0 13px; width: 100%; }
.more-chargers-button:hover { background: #eff7f1; }

.settings-card { border: 1px solid #e3ebe4; border-radius: 16px; box-shadow: none; margin-bottom: 17px; overflow: hidden; }
.settings-toggle { align-items: center; background: #fff; border: 0; color: var(--ink); display: flex; justify-content: space-between; min-height: 70px; padding: 14px 17px; text-align: left; width: 100%; }
.settings-toggle > span:first-child { align-items: center; display: flex; gap: 11px; }
.settings-toggle .eyebrow { font-size: 8px; margin-bottom: 3px; }
.settings-toggle b { font-size: 12px; }
.tiny-gear { background: #edf8f1; border-radius: 50%; color: #4b966f; display: grid; font-size: 15px; height: 32px; place-items: center; width: 32px; }
.toggle-chevron { color: #6b887c; font-size: 20px; transition: transform .2s; }
.settings-toggle[aria-expanded="true"] .toggle-chevron { transform: rotate(180deg); }
.settings-content { border-top: 1px solid #e6ede7; padding: 16px; }
.settings-intro { color: #71837a; font-size: 10px; line-height: 1.55; margin-bottom: 15px; }
.settings-grid { display: grid; gap: 13px; grid-template-columns: 1fr 1fr; }
.settings-grid .field { font-size: 10px; }
.settings-grid select { background: #f6f8f5; border: 1px solid #e7ede8; border-radius: 8px; color: #2c4f42; font-size: 11px; font-weight: 600; height: 42px; outline: 0; padding: 0 9px; width: 100%; }
.settings-grid .inline-unit { height: 42px; }
.settings-grid .inline-unit input { font-size: 15px; }
.settings-grid .field small { margin-top: -2px; }

.data-note { align-items: flex-start; border-left: 2px solid #9dccb1; color: #61766d; display: flex; font-size: 10px; gap: 9px; line-height: 1.6; margin: 23px 5px 0; padding: 2px 10px; }
.data-note p { margin: 0; }
.data-note b { color: #3e5d51; }
.data-note a { color: #257250; font-weight: 700; text-decoration: none; }
.data-dot { background: #82be9f; border-radius: 50%; flex: 0 0 auto; height: 6px; margin-top: 5px; width: 6px; }
footer { color: #8a9690; font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: .02em; line-height: 1.6; margin: 0 auto; max-width: 820px; padding: 0 25px max(25px, env(safe-area-inset-bottom)); text-align: center; }
footer p { margin: 0; }

@media (min-width: 700px) {
  .app-shell { padding-top: 29px; }
  .topbar { margin-bottom: 63px; }
  .hero { min-height: 270px; padding-top: 29px; }
  .hero-vehicle { right: -50px; top: -48px; width: 590px; }
  .planner-card, .vehicle-card, .result-panel { padding: 33px; }
  .route-fields { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
  .location-field + .location-field { margin-top: 0; }
  .route-line { border-left: 0; border-top: 1px dashed #bed7ca; height: 0; left: calc(50% - 8px); top: 57px; width: 16px; }
  .map-card { margin-left: 14px; margin-right: 14px; }
  #map, .map-status { height: 340px; }
  .settings-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 380px) {
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .planner-card, .vehicle-card, .result-panel { padding: 21px; }
  .hero { min-height: 218px; }
  .hero-vehicle { right: -180px; top: -34px; width: 490px; }
  .simple-result-grid { gap: 7px; }
  .simple-result-grid article { padding: 13px 9px; }
}
