:root {
  color-scheme: dark;
  --navy: #101827;
  --navy-2: #141d2d;
  --slate: #2e3c52;
  --slate-2: #37465d;
  --panel: #111a29;
  --panel-2: #182337;
  --line: #2b3950;
  --line-soft: rgba(225, 230, 245, .09);
  --text: #f3f3fb;
  --muted: #9aa5ba;
  --muted-2: #717e95;
  --purple: #a35df1;
  --pink: #f16cb2;
  --orange: #ffad72;
  --mint: #6ed6b1;
  --red: #ff7e91;
  --radius: 20px;
  --text-scale: 1;
  font-family: 'DM Sans', Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; font-size: calc(20px * var(--text-scale, 1)); }
body { margin: 0; min-width: 320px; min-height: 100vh; min-height: 100svh; color: var(--text); background: var(--slate); overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
a { color: inherit; }
#root { min-height: 100vh; min-height: 100svh; padding: 0; }
.app-shell { width: 100%; min-height: 100vh; min-height: 100svh; margin: 0; display: grid; grid-template-columns: 286px minmax(0, 1fr); background: var(--slate); border-radius: 0; overflow: hidden; box-shadow: none; }
.sidebar { background: var(--navy); padding: 28px 18px 22px; display: flex; flex-direction: column; min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand-mark { height: 43px; width: 43px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--purple), var(--pink) 64%, var(--orange)); box-shadow: 0 8px 24px rgba(181, 87, 219, .25); color: white; }
.brand-mark .icon { width: 22px; height: 22px; }
.brand-name { font-family: Manrope, sans-serif; font-size: 1.125rem; line-height: 1; font-weight: 800; letter-spacing: 1.2px; }
.brand-sub { font-size: 0.5rem; color: #77839b; letter-spacing: 1.7px; margin-top: 5px; text-transform: uppercase; }
.nav-label { padding: 10px 13px 9px; color: #6e7b93; font-size: 0.5625rem; font-weight: 800; letter-spacing: 1.7px; text-transform: uppercase; }
.nav-list { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; width: 100%; gap: 12px; padding: 12px 13px; border: 0; border-radius: 12px; color: #a5aec0; background: transparent; text-align: left; font-size: 0.75rem; font-weight: 600; transition: background .16s ease, color .16s ease, transform .16s ease; }
.nav-item .icon { flex: 0 0 auto; color: #929db2; }
.nav-item:hover { background: rgba(255,255,255,.055); color: white; }
.nav-item.active { color: #fff; background: linear-gradient(100deg, #9d59ec 0%, #ed69b7 63%, #ffab70 100%); box-shadow: 0 8px 22px rgba(198, 89, 207, .18); }
.nav-item.active .icon { color: white; }
.nav-item.disabled { color: #5b6578; cursor: default; }
.nav-item.disabled .icon { color: #596377; }
.nav-item.disabled:hover { background: transparent; }
.soon-label { margin-left: auto; border: 1px solid rgba(143, 153, 175, .2); background: rgba(125, 138, 160, .08); color: #68748a; border-radius: 6px; padding: 3px 5px; font-size: 0.4375rem; line-height: 1; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
.sidebar-foot { margin-top: auto; padding: 17px 11px 0; color: #66728a; font-size: 0.5625rem; line-height: 1.6; }
.sidebar-foot .foot-status { display: flex; align-items: center; gap: 7px; color: #8e9ab0; margin-bottom: 7px; }
.led { display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: var(--mint); box-shadow: 0 0 0 3px rgba(110,214,177,.1); }
.main { min-width: 0; padding: 30px clamp(20px, 2.3vw, 38px) 42px; background: var(--slate); }
.topbar { min-height: 67px; margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.eyebrow { color: #d28aef; font-size: 0.5rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
h1 { font: 800 clamp(1.4375rem, 2.2vw, 1.9375rem)/1.13 Manrope, sans-serif; letter-spacing: -.9px; margin: 0; color: #f5f4fb; }
.subhead { color: #a4aec1; font-size: 0.6875rem; margin: 6px 0 0; line-height: 1.55; }
.top-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.local-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 99px; background: rgba(17, 25, 40, .72); border: 1px solid rgba(205, 213, 233, .09); color: #b5bdd0; font-size: 0.5625rem; white-space: nowrap; }
.icon { display: block; flex-shrink: 0; }
.icon-btn { width: 37px; height: 37px; padding: 0; border: 1px solid rgba(212, 220, 239, .1); background: rgba(15, 24, 39, .8); color: #aeb7cb; border-radius: 11px; display: grid; place-items: center; line-height: 0; }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn:hover { background: #1b2940; color: #fff; }
.mobile-menu { display: none; }
.mobile-menu .close-glyph { display: none; }
.sidebar-close { display: none; margin-left: auto; }
.sidebar-backdrop { display: none; }
.topbar-copy { min-width: 0; }
.page { display: grid; gap: 17px; animation: pageIn .22s ease; }
@keyframes pageIn { from { opacity: .55; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.grid-two { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(285px, .9fr); gap: 17px; align-items: stretch; }
.grid-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.card { min-width: 0; background: var(--panel); border: 1px solid rgba(214, 222, 242, .055); border-radius: var(--radius); box-shadow: 0 9px 28px rgba(11, 17, 29, .12); }
.card-inner { padding: 20px 21px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.card-title { font: 700 0.875rem/1.3 Manrope, sans-serif; margin: 0; color: #f2f2fa; letter-spacing: -.25px; }
.card-desc { color: #7f8ba2; margin: 5px 0 0; font-size: 0.5625rem; line-height: 1.6; }
.card-kicker { font-size: 0.5rem; font-weight: 800; color: #c18bfa; letter-spacing: 1.65px; text-transform: uppercase; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 6px 8px; background: rgba(172, 104, 243, .12); color: #d1a5fb; border: 1px solid rgba(174, 113, 242, .14); border-radius: 8px; font-size: 0.5rem; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.pill.mint { background: rgba(91, 207, 165, .1); border-color: rgba(91, 207, 165, .17); color: #83dfbc; }
.pill.orange { background: rgba(255, 173, 114, .1); border-color: rgba(255, 173, 114, .17); color: #ffbd91; }
.pill.muted { background: rgba(135, 148, 172, .08); color: #8995aa; border-color: rgba(135, 148, 172, .14); }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px 12px; }
.field { min-width: 0; }
.field label, .field-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #aab4c8; font-size: 0.5625rem; font-weight: 650; margin-bottom: 7px; }
.field label small, .field-label small { color: #697791; font-size: 0.5rem; font-weight: 500; }
.input-wrap { position: relative; }
.input, .select, .textarea { width: 100%; min-width: 0; min-height: 39px; height: auto; border: 1px solid #35435b; border-radius: 10px; outline: none; padding: 8px 11px; background: #222e43; color: #f0f2fb; font-size: 0.6875rem; font-weight: 650; transition: border .15s ease, box-shadow .15s ease; }
.input:focus, .select:focus, .textarea:focus { border-color: #b56bf0; box-shadow: 0 0 0 3px rgba(181, 107, 240, .12); }
.input::placeholder, .textarea::placeholder { color: #68758c; }
.input[readonly] { opacity: .75; }
.select { appearance: none; padding-right: 31px; min-height: 39px; }
.select-wrap:after { content: ''; position: absolute; pointer-events: none; width: 7px; height: 7px; right: 13px; top: 14px; border-right: 1.5px solid #8793aa; border-bottom: 1.5px solid #8793aa; transform: rotate(45deg); }
.textarea { height: auto; min-height: 75px; padding: 10px 11px; resize: vertical; }
.suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #8190aa; font-size: 0.5rem; pointer-events: none; }
.range-block { border-top: 1px solid var(--line-soft); margin-top: 18px; padding-top: 17px; }
.range-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.range-head strong { color: #bec7d8; font-size: 0.625rem; }
.range-head span { color: #d794f0; font-size: 0.5625rem; font-weight: 750; }
.range-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.range-value { display: flex; justify-content: space-between; align-items: center; color: #7f8ca4; font-size: 0.5rem; margin-bottom: 9px; }
.range-value strong { color: #f1f0f9; font-size: 0.6875rem; }
input[type=range] { width: 100%; appearance: none; height: 5px; border-radius: 9px; background: #394760; outline: none; accent-color: var(--pink); }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 15px; height: 15px; border: 3px solid #fff; background: var(--pink); border-radius: 50%; box-shadow: 0 0 0 3px rgba(234, 113, 197, .16); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 10px; height: 10px; border: 3px solid #fff; background: var(--pink); border-radius: 50%; box-shadow: 0 0 0 3px rgba(234, 113, 197, .16); cursor: pointer; }
.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 13px; }
.preset { border: 1px solid #36435a; border-radius: 7px; padding: 6px 9px; color: #aab4c9; background: #1a263a; font-size: 0.5rem; font-weight: 700; }
.preset:hover, .preset.active { border-color: #b56bf0; color: #eccbff; background: #243049; }
.result-card { padding: 22px 22px 18px; min-height: 100%; background: radial-gradient(circle at 92% 6%, rgba(152, 83, 232, .2), transparent 35%), linear-gradient(145deg, #121b2b, #111827 73%); border: 1px solid rgba(212, 212, 243, .08); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; position: relative; }
.result-card:after { content: ''; position: absolute; right: -126px; bottom: -145px; width: 260px; height: 260px; border: 1px solid rgba(211, 174, 248, .07); border-radius: 50%; box-shadow: 0 0 0 24px rgba(208, 180, 239, .016), 0 0 0 48px rgba(208, 180, 239, .012); pointer-events: none; }
.result-amount { margin: 12px 0 0; font: 800 clamp(2.5rem, 4vw, 3.625rem)/1 Manrope, sans-serif; letter-spacing: -2.5px; color: #fbf9ff; }
.result-amount .currency { color: #e58fc8; font-size: .52em; vertical-align: 14px; margin-right: 2px; }
.result-caption { color: #8e9bb2; font-size: 0.5625rem; margin-top: 8px; }
.battery-box { border: 1px solid #344057; border-radius: 13px; background: rgba(255,255,255,.035); padding: 12px; margin-top: 20px; position: relative; z-index: 1; }
.battery-box-head, .battery-box-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.battery-box-head span { color: #8b96aa; font-size: 0.5rem; text-transform: uppercase; font-weight: 800; letter-spacing: 1.25px; }
.battery-box-head strong { color: #eab3fa; font: 800 0.875rem Manrope, sans-serif; }
.battery-track { height: 8px; background: #303d53; border-radius: 99px; overflow: hidden; margin-top: 11px; }
.battery-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--purple), var(--pink), var(--orange)); box-shadow: 0 0 13px rgba(224, 112, 215, .22); transition: width .18s ease; }
.battery-box-foot { margin-top: 8px; color: #737f95; font-size: 0.5rem; }
.result-divider { border: 0; border-top: 1px solid var(--line-soft); width: 100%; margin: 17px 0 15px; }
.result-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 12px; position: relative; z-index: 1; }
.result-stat span { display: block; color: #7f8ca3; font-size: 0.5rem; margin-bottom: 5px; }
.result-stat strong { display: block; color: #f0edf9; font-size: 0.9375rem; font-weight: 750; }
.result-stat small { color: #78849a; font-size: 0.5rem; margin-left: 3px; }
.result-actions { display: grid; gap: 8px; margin-top: auto; padding-top: 18px; position: relative; z-index: 1; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 38px; padding: 9px 13px; border: 1px solid transparent; border-radius: 10px; font-size: 0.625rem; font-weight: 800; transition: transform .15s ease, filter .15s ease, border .15s ease; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.07); }
.btn-primary { color: white; background: linear-gradient(100deg, #995ce8, #e66db5 66%, #ffaa73); box-shadow: 0 7px 18px rgba(177, 91, 205, .17); }
.btn-secondary { color: #dce0ed; background: #202c41; border-color: #39465c; }
.btn-quiet { color: #aab4c9; background: transparent; border-color: #39465c; }
.btn-danger { color: #ffacb7; background: rgba(240, 105, 133, .09); border-color: rgba(240, 105, 133, .2); }
.btn-small { min-height: 30px; padding: 6px 9px; border-radius: 8px; font-size: 0.5rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-height: 105px; padding: 16px 17px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.metric-label { color: #8591a7; font-size: 0.5rem; font-weight: 750; }
.metric-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: rgba(164, 93, 241, .15); color: #c99afa; }
.metric-icon.pink { background: rgba(241, 108, 178, .13); color: #f28ac2; }
.metric-icon.orange { background: rgba(255, 173, 114, .13); color: #ffb983; }
.metric-icon.mint { background: rgba(110, 214, 177, .12); color: #86e2c1; }
.metric-value { font: 800 1.375rem Manrope, sans-serif; color: #f2f0fa; letter-spacing: -.8px; margin-top: 6px; }
.metric-sub { color: #758199; font-size: 0.5rem; margin-top: 3px; }
.chart-wrap { width: 100%; min-width: 0; }
.chart-bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: end; min-height: 175px; padding: 9px 4px 0; border-bottom: 1px dashed #48546a; background: repeating-linear-gradient(to bottom, transparent 0, transparent 42px, rgba(170,180,205,.07) 43px, transparent 44px); }
.chart-col { display: flex; height: 166px; flex-direction: column; justify-content: end; align-items: center; gap: 7px; min-width: 0; }
.chart-bar { width: min(30px, 72%); min-height: 3px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #fa80bf, #9059ed); box-shadow: 0 0 15px rgba(162, 89, 240, .15); position: relative; }
.chart-bar:after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle, rgba(255,193,119,.75) 1px, transparent 1.6px) 0 0/7px 7px; opacity: .7; }
.chart-month { color: #8995aa; font-size: 0.5rem; }
.chart-value { color: #b6bfd0; font-size: 0.5rem; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 13px; color: #8995aa; font-size: 0.5rem; }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--purple); }
.legend-dot.pink { background: var(--pink); }
.legend-dot.orange { background: var(--orange); }
.legend-dot.mint { background: var(--mint); }
.tariff-list { display: grid; gap: 9px; }
.tariff-row { padding: 11px 12px; border: 1px solid #2c3a51; border-radius: 11px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #151f31; }
.tariff-row.best { border-color: rgba(110, 214, 177, .42); background: rgba(110, 214, 177, .07); }
.tariff-name { display: flex; align-items: center; gap: 9px; color: #e0e2ee; font-size: 0.625rem; font-weight: 700; }
.tariff-meta { color: #78869e; font-size: 0.5rem; margin-top: 4px; }
.tariff-price { text-align: right; color: #f5f2fb; font-size: 0.8125rem; font-weight: 800; white-space: nowrap; }
.tariff-price small { display: block; color: #7d8aa1; font-size: 0.5rem; font-weight: 500; margin-top: 3px; }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 600px; border-collapse: collapse; }
.data-table th { text-align: left; padding: 0 11px 10px; color: #78869d; text-transform: uppercase; letter-spacing: .8px; font-size: 0.4375rem; font-weight: 800; }
.data-table td { padding: 12px 11px; border-top: 1px solid var(--line-soft); color: #aeb8ca; font-size: 0.5625rem; vertical-align: middle; }
.data-table td:first-child { color: #f0eff8; font-weight: 700; }
.data-table .amount { color: #e0a0f4; font-weight: 800; white-space: nowrap; }
.data-table .actions { white-space: nowrap; text-align: right; }
.empty-state { border: 1px dashed #3a4960; border-radius: 13px; padding: 24px 18px; text-align: center; color: #8290a6; font-size: 0.5625rem; line-height: 1.7; }
.empty-state strong { display: block; color: #cbd2e0; font-size: 0.6875rem; margin-bottom: 5px; }
.empty-icon { margin: 0 auto 10px; width: 37px; height: 37px; border-radius: 12px; background: rgba(166, 99, 239, .12); color: #c28ef3; display: grid; place-items: center; }
.vehicle-card { padding: 17px; display: flex; flex-direction: column; gap: 12px; }
.vehicle-top { display: flex; align-items: flex-start; gap: 12px; }
.vehicle-visual { width: 47px; height: 47px; border-radius: 13px; display: grid; place-items: center; color: #e1b0ff; background: linear-gradient(140deg, rgba(157,92,238,.25), rgba(241,108,178,.17)); flex: 0 0 auto; }
.vehicle-name { font: 750 0.8125rem Manrope, sans-serif; color: #f2effa; }
.vehicle-meta { color: #7d8aa1; font-size: 0.5rem; margin-top: 4px; }
.vehicle-specs { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.vehicle-spec strong { display: block; font-size: 0.75rem; color: #f1eff9; }
.vehicle-spec span { display: block; font-size: 0.4375rem; color: #77849b; margin-top: 3px; }
.vehicle-card.active-vehicle { border-color: rgba(198, 113, 241, .45); box-shadow: inset 0 0 0 1px rgba(198, 113, 241, .08); }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px; border: 1px solid rgba(164, 111, 231, .18); background: rgba(164, 111, 231, .07); border-radius: 11px; color: #aeb8cc; font-size: 0.5625rem; line-height: 1.55; }
.notice .icon { color: #c594f1; flex: 0 0 auto; }
.coming-card { min-height: 160px; padding: 21px; border: 1px dashed #414d63; border-radius: 17px; background: rgba(15, 24, 39, .44); opacity: .72; }
.coming-card .icon-big { width: 42px; height: 42px; border-radius: 13px; background: #273247; color: #778299; display: grid; place-items: center; margin-bottom: 15px; }
.coming-card h3 { margin: 0; color: #9aa4b7; font: 700 0.8125rem Manrope, sans-serif; }
.coming-card p { color: #737f95; font-size: 0.5rem; line-height: 1.6; max-width: 320px; }
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(7, 11, 20, .73); backdrop-filter: blur(8px); z-index: 50; }
.modal { width: min(100%, 610px); max-height: min(88vh, 830px); overflow: auto; background: #131d2d; border: 1px solid #3b4960; border-radius: 19px; padding: 21px; box-shadow: 0 25px 80px rgba(0,0,0,.36); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 17px; }
.modal-title { margin: 0; font: 750 1rem Manrope, sans-serif; }
.modal-sub { color: #8793a9; font-size: 0.5625rem; margin: 5px 0 0; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 15px; margin-top: 18px; }
.toast { position: fixed; right: 24px; bottom: 22px; z-index: 60; padding: 12px 15px; border: 1px solid #465570; border-radius: 11px; background: #172337; color: #f0eff8; font-size: 0.625rem; box-shadow: 0 14px 42px rgba(0,0,0,.3); transform: translateY(12px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: none; }
.hidden { display: none !important; }
.muted { color: #8793a9; }
.text-right { text-align: right; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.gap-10 { display: grid; gap: 10px; }
.inline-note { font-size: 0.5rem; color: #78869e; line-height: 1.55; }
.two-col-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.scale-ends { display: flex; justify-content: space-between; color: #7f8ca4; font-size: 0.5rem; margin-top: 6px; }
.text-scale-block { border-top: 1px solid var(--line-soft); margin-top: 16px; padding-top: 16px; }
.split-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.split-box { background: #172235; border: 1px solid #2e3c52; border-radius: 11px; padding: 13px; }
.split-box strong { display: block; font: 800 1.125rem Manrope, sans-serif; margin-top: 6px; color: #f3effa; }
.split-box span { color: #8290a6; font-size: 0.5rem; }
.progress-line { height: 7px; background: #303d53; overflow: hidden; border-radius: 99px; }
.progress-line span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--pink), var(--orange)); border-radius: inherit; }
@media (max-width: 1250px) {
  #root { padding: 0; }
  .app-shell { width: 100%; min-height: 100vh; min-height: 100svh; grid-template-columns: 238px minmax(0, 1fr); }
  .main { padding-left: 22px; padding-right: 22px; }
  .grid-two { grid-template-columns: minmax(0, 1.3fr) minmax(260px, .9fr); }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  body.nav-open { overflow: hidden; }
  body.nav-open .mobile-menu .menu-glyph { display: none; }
  body.nav-open .mobile-menu .close-glyph { display: block; }
  .app-shell { width: 100%; min-height: 100vh; min-height: 100svh; grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .sidebar {
    position: fixed; z-index: 40; top: 0; bottom: 0; left: 0;
    width: min(300px, 86vw); align-items: stretch;
    padding: max(18px, env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
    transform: translateX(-105%); transition: transform .22s ease;
    box-shadow: 24px 0 50px rgba(0,0,0,.35); overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 35; border: 0; padding: 0; margin: 0;
    width: 100%; height: 100%; background: rgba(7, 11, 20, .58); opacity: 0; pointer-events: none;
    transition: opacity .22s ease; cursor: pointer;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .brand { width: 100%; padding: 0 4px 24px; }
  .sidebar-close { display: grid; }
  .mobile-menu { display: grid; flex: 0 0 auto; }
  .icon-btn { width: 42px; height: 42px; }
  .main { padding: 22px 18px 34px; padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .grid-two { grid-template-columns: 1fr; }
  .result-card { min-height: 0; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vehicle-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { width: min(100%, 610px); }
}
@media (max-width: 650px) {
  #root { padding: 0; }
  .app-shell { border-radius: 0; }
  .main { padding: 16px 14px 28px; padding-bottom: max(28px, env(safe-area-inset-bottom)); }
  .topbar { align-items: flex-start; margin-bottom: 15px; gap: 10px; }
  .topbar-left { gap: 9px; align-items: flex-start; }
  .top-actions .local-pill { font-size: 0; padding: 11px; }
  .top-actions .local-pill .pill-text { display: none; }
  .grid-two, .grid-three { grid-template-columns: 1fr; }
  .field-grid, .modal-grid, .two-col-fields { grid-template-columns: 1fr; }
  .range-grid { grid-template-columns: 1fr; gap: 14px; }
  .card-inner { padding: 16px; }
  .metric-grid { gap: 9px; }
  .metric-card { padding: 13px; min-height: 92px; }
  .metric-value { font-size: 1.1875rem; }
  .chart-bars { min-height: 155px; gap: 7px; }
  .chart-col { height: 148px; }
  .chart-value { font-size: 0.4375rem; }
  .modal-backdrop { padding: 12px; align-items: end; }
  .modal { width: 100%; max-height: min(92svh, 830px); padding: 16px; border-radius: 18px 18px 12px 12px; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1 1 auto; }
  .btn-row .btn { flex: 1 1 auto; }
  .toast { left: 13px; right: 13px; bottom: max(13px, env(safe-area-inset-bottom)); text-align: center; }
  .data-table { min-width: 520px; }
}
@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.25rem; }
  .top-actions { gap: 5px; }
  .subhead { display: none; }
}
