/* Héliora — thème futuriste & écologique (sombre par défaut, clair au choix) */
:root {
  --bg: #04121a;
  --bg2: #071c26;
  --card: rgba(16, 44, 56, 0.62);
  --card2: rgba(22, 60, 74, 0.55);
  --line: rgba(120, 255, 220, 0.14);
  --line2: rgba(120, 255, 220, 0.28);
  --txt: #e8fbf6;
  --mut: #9fc3c0;
  --dim: #6f9796;
  --acc: #3df5b0;
  --acc2: #25c8f0;
  --sun: #ffc94a;
  --sun2: #ff9f2e;
  --red: #ff5c7a;
  --warn: #ffb547;
  --ok: #3df5b0;
  --glass-blur: 14px;
  --r: 18px;
  --r2: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font2: 'Sora', 'Inter', system-ui, sans-serif;
  --plus: #ff4d5e; --minus: #20262b; --ac-l: #a0522d; --ac-n: #2f7cf6; --pe: #8fd14f; --data: #b58cff;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #eef7f4; --bg2: #e2f1ec; --card: rgba(255, 255, 255, 0.82); --card2: rgba(240, 250, 247, 0.9);
  --line: rgba(10, 80, 70, 0.14); --line2: rgba(10, 80, 70, 0.28); --txt: #06262b; --mut: #3d6662; --dim: #6b8d8a;
  --acc: #009e6b; --acc2: #0089b3; --sun: #d98b00; --sun2: #e06a00; --red: #d62845; --warn: #b86e00; --ok: #009e6b;
  --shadow: 0 8px 30px rgba(6, 40, 40, 0.12); --minus: #20262b;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--txt); background: var(--bg);
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(37, 200, 240, 0.16), transparent 60%),
    radial-gradient(800px 500px at -10% 30%, rgba(61, 245, 176, 0.10), transparent 60%),
    radial-gradient(700px 400px at 60% 110%, rgba(255, 201, 74, 0.08), transparent 60%);
  background-attachment: fixed; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
:root[data-theme='light'] body { background-image: radial-gradient(900px 500px at 85% -10%, rgba(37, 200, 240, 0.14), transparent 60%), radial-gradient(800px 500px at -10% 30%, rgba(61, 245, 176, 0.14), transparent 60%); }
body::before { /* grille futuriste */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
h1, h2, h3, h4 { font-family: var(--font2); letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
a { color: var(--acc2); }
small, .mut { color: var(--mut); }
.dim { color: var(--dim); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.grad { background: linear-gradient(90deg, var(--acc), var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sun { color: var(--sun); }

/* ——— Mise en page ——— */
#app { position: relative; z-index: 1; display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
#side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(4, 18, 26, .7), rgba(4, 18, 26, .35)); backdrop-filter: blur(var(--glass-blur)); }
:root[data-theme='light'] #side { background: rgba(255, 255, 255, .6); }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 6px 22px; text-decoration: none; color: var(--txt); }
.brand img { width: 46px; height: 46px; border-radius: 13px; box-shadow: 0 0 24px rgba(61, 245, 176, .35); }
.brand b { font-family: var(--font2); font-size: 1.35rem; display: block; letter-spacing: .02em; }
.brand span { font-size: .74rem; color: var(--mut); }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.steps a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; text-decoration: none; color: var(--mut); font-size: .93rem; position: relative; }
.steps a:hover { background: var(--card2); color: var(--txt); }
.steps a.on { background: linear-gradient(90deg, rgba(61, 245, 176, .18), rgba(37, 200, 240, .08)); color: var(--txt); box-shadow: inset 0 0 0 1px var(--line2); }
.steps .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--card); font-size: 1rem; flex: none; border: 1px solid var(--line); }
.steps a.done .ic { border-color: var(--acc); box-shadow: 0 0 10px rgba(61, 245, 176, .3); }
.steps .num { font-size: .7rem; color: var(--dim); margin-left: auto; }
.side-foot { margin-top: 18px; padding: 12px 8px 0; border-top: 1px solid var(--line); display: grid; gap: 10px; }
main { padding: 26px clamp(16px, 4vw, 48px) 120px; max-width: 1200px; width: 100%; min-width: 0; }
#top { display: none; }
.screen { animation: rise .35s ease; }
.noanim .screen { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head .badge { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--acc); font-weight: 600; }
.head p { color: var(--mut); max-width: 760px; }
.navbar { position: fixed; left: 280px; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-between; gap: 10px; padding: 12px clamp(16px, 4vw, 48px) calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, transparent, var(--bg) 40%); }
.navbar .btn { min-width: 140px; }

/* ——— Cartes & grilles ——— */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; backdrop-filter: blur(var(--glass-blur)); box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card.glow { border-color: var(--line2); box-shadow: var(--shadow), 0 0 0 1px rgba(61, 245, 176, .12), 0 0 40px rgba(61, 245, 176, .08); }
.card h3 { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.sb { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ——— Chiffres clés ——— */
.kpi { padding: 14px 16px; border-radius: 16px; background: var(--card2); border: 1px solid var(--line); position: relative; overflow: hidden; min-width: 0; }
.kpi::after { content: ''; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(var(--kc, rgba(61, 245, 176, .25)), transparent 70%); }
.kpi .l { font-size: .78rem; color: var(--mut); text-transform: uppercase; letter-spacing: .06em; }
.kpi .v { font-family: var(--font2); font-size: clamp(1.3rem, 3vw, 1.75rem); font-weight: 700; margin-top: 2px; white-space: nowrap; }
.kpi .s { font-size: .82rem; color: var(--mut); }
.kpi.sun { --kc: rgba(255, 201, 74, .3); } .kpi.sun .v { color: var(--sun); }
.kpi.cy { --kc: rgba(37, 200, 240, .3); } .kpi.cy .v { color: var(--acc2); }
.kpi.gr .v { color: var(--acc); }

/* ——— Boutons ——— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card2); color: var(--txt); cursor: pointer; text-decoration: none; font-weight: 600; font-size: .95rem; transition: transform .12s, box-shadow .2s, background .2s; min-height: 44px; }
.btn:hover { box-shadow: 0 0 0 1px var(--line2), 0 6px 18px rgba(0, 0, 0, .25); }
.btn:active { transform: scale(.98); }
.btn.pri { background: linear-gradient(90deg, var(--acc), var(--acc2)); color: #032018; border: 0; box-shadow: 0 6px 24px rgba(61, 245, 176, .3); }
.btn.sunb { background: linear-gradient(90deg, var(--sun), var(--sun2)); color: #2a1600; border: 0; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 7px 12px; min-height: 36px; font-size: .85rem; }
.btn.xs { padding: 4px 9px; min-height: 30px; font-size: .8rem; }
.btn.danger { border-color: rgba(255, 92, 122, .5); color: var(--red); background: transparent; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); display: inline-grid; place-items: center; cursor: pointer; }

/* ——— Formulaires ——— */
label.f { display: grid; gap: 6px; font-size: .88rem; color: var(--mut); min-width: 0; }
label.f > span { display: flex; gap: 6px; align-items: center; }
input[type='text'], input[type='number'], input[type='search'], input[type='email'], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(3, 16, 22, .55); color: var(--txt); outline: none; min-height: 44px;
}
:root[data-theme='light'] input, :root[data-theme='light'] select, :root[data-theme='light'] textarea { background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(61, 245, 176, .18); }
input[type='range'] { width: 100%; accent-color: var(--acc); height: 32px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; background: rgba(0, 0, 0, .18); padding: 5px; border-radius: 14px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 8px 13px; border-radius: 10px; cursor: pointer; color: var(--mut); font-weight: 600; font-size: .9rem; min-height: 38px; }
.seg button.on { background: linear-gradient(90deg, rgba(61, 245, 176, .25), rgba(37, 200, 240, .18)); color: var(--txt); box-shadow: inset 0 0 0 1px var(--line2); }
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { display: grid; gap: 4px; place-items: center; text-align: center; padding: 14px 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; font-size: .88rem; color: var(--mut); min-height: 92px; }
.choice .e { font-size: 1.8rem; }
.choice.on { border-color: var(--acc); color: var(--txt); background: linear-gradient(160deg, rgba(61, 245, 176, .18), rgba(37, 200, 240, .08)); box-shadow: 0 0 18px rgba(61, 245, 176, .18); }
label.f .stepper, .row .stepper { justify-self: start; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
.stepper button { width: 38px; height: 40px; border: 0; background: var(--card2); cursor: pointer; font-size: 1.1rem; }
.stepper input { width: 64px; text-align: center; border: 0; border-radius: 0; min-height: 40px; padding: 6px; background: transparent; }

/* ——— Aides débutant ——— */
.help { border-left: 3px solid var(--acc2); background: linear-gradient(90deg, rgba(37, 200, 240, .12), transparent); padding: 12px 14px; border-radius: 0 12px 12px 0; margin: 10px 0 14px; font-size: .93rem; }
.help b { color: var(--acc2); }
.help.sunh { border-color: var(--sun); background: linear-gradient(90deg, rgba(255, 201, 74, .12), transparent); }
.help.sunh b { color: var(--sun); }
.help.okh { border-color: var(--acc); background: linear-gradient(90deg, rgba(61, 245, 176, .12), transparent); }
.help.okh b { color: var(--acc); }
body.expert .beg { display: none !important; }
body:not(.expert) .exp { display: none !important; }
.alert { padding: 12px 14px; border-radius: 12px; margin: 8px 0; font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.alert.warn { background: rgba(255, 181, 71, .12); border: 1px solid rgba(255, 181, 71, .35); }
.alert.err { background: rgba(255, 92, 122, .12); border: 1px solid rgba(255, 92, 122, .4); }
.alert.ok { background: rgba(61, 245, 176, .1); border: 1px solid rgba(61, 245, 176, .35); }
abbr[data-g] { text-decoration: underline dotted var(--acc2); text-underline-offset: 3px; cursor: help; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; border: 1px solid var(--line2); background: var(--card2); color: var(--mut); white-space: nowrap; }
.tag.g { color: var(--acc); border-color: rgba(61, 245, 176, .4); }
.tag.y { color: var(--sun); border-color: rgba(255, 201, 74, .4); }
.tag.r { color: var(--red); border-color: rgba(255, 92, 122, .4); }
.tag.b { color: var(--acc2); border-color: rgba(37, 200, 240, .4); }

/* ——— Listes produits ——— */
.prod { display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card2); margin-bottom: 10px; }
.prod.off { opacity: .45; }
.ph { width: 92px; height: 92px; border-radius: 14px; background: radial-gradient(circle at 50% 35%, #ffffff, #dfe9e7 70%); display: grid; place-items: center; overflow: hidden; position: relative; flex: none; }
.ph img, .ph svg { width: 88%; height: 88%; object-fit: contain; }
.ph .il { position: absolute; bottom: 3px; right: 4px; font-size: .55rem; color: #4a6663; background: rgba(255, 255, 255, .8); padding: 0 4px; border-radius: 4px; }
.prod h4 { margin: 0 0 2px; font-size: .98rem; font-family: var(--font); }
.prod .meta { font-size: .82rem; color: var(--mut); }
.prod .price { text-align: right; white-space: nowrap; }
.prod .price b { font-family: var(--font2); font-size: 1.1rem; display: block; }
.prod .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.group-h { display: flex; justify-content: space-between; align-items: baseline; margin: 18px 4px 8px; }
.group-h h3 { margin: 0; }
.total-bar { position: sticky; top: 8px; z-index: 5; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 18px; border-radius: 18px; background: linear-gradient(90deg, rgba(61, 245, 176, .2), rgba(37, 200, 240, .14)); border: 1px solid var(--line2); backdrop-filter: blur(16px); margin-bottom: 16px; }
.total-bar .big { font-family: var(--font2); font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; }
.gauge { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.gauge i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--acc), var(--acc2)); transition: width .4s; }
.gauge.over i { background: linear-gradient(90deg, var(--sun), var(--red)); }

/* ——— Tableaux ——— */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { color: var(--mut); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.tbl td.n, .tbl th.n { text-align: right; white-space: nowrap; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ——— Appareils ——— */
.load { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); margin-bottom: 8px; }
.load .e { font-size: 1.6rem; text-align: center; }
.load .n { font-weight: 600; font-size: .95rem; }
.load .d { font-size: .8rem; color: var(--mut); }
.load .wh { text-align: right; font-family: var(--font2); font-weight: 700; white-space: nowrap; }
.load .wh small { display: block; font-family: var(--font); font-weight: 400; font-size: .72rem; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.cat-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; text-align: left; font-size: .88rem; }
.cat-item:hover { border-color: var(--acc); }
.cat-item .e { font-size: 1.4rem; }
.cat-item small { display: block; color: var(--mut); font-size: .75rem; }
.bar-split { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.bar-split i { display: block; height: 100%; }

/* ——— Feuille (modale) ——— */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--bg2); border: 1px solid var(--line2); border-radius: 22px; padding: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); animation: rise .25s; }
.sheet .x { float: right; }
#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 99; background: var(--bg2); border: 1px solid var(--line2); padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow); opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; }

/* ——— Carte & 3D ——— */
.map { height: 380px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line2); z-index: 1; }
.leaflet-container { background: #0a2530; font-family: var(--font); }
#three { width: 100%; height: min(70vh, 620px); border-radius: 18px; overflow: hidden; border: 1px solid var(--line2); background: linear-gradient(180deg, #0b2a3a, #071a22); position: relative; touch-action: none; }
#three canvas { display: block; }
.three-legend { position: absolute; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.compass { width: 170px; height: 170px; }

/* ——— Schémas ——— */
.diagram { background: #fbfdfc; border-radius: 16px; padding: 8px; overflow: auto; border: 1px solid var(--line2); }
.diagram svg { display: block; min-width: 900px; width: 100%; height: auto; }
.diagram.beg-d svg { min-width: 760px; }
.zoomable { cursor: zoom-in; }

/* ——— Scanner ——— */
#scan { position: fixed; inset: 0; z-index: 120; background: #000; display: none; }
#scan.on { display: block; }
#scan video { width: 100%; height: 100%; object-fit: cover; }
.scan-ui { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 20px; color: #fff; }
.scan-top { width: 100%; display: flex; justify-content: space-between; }
.scan-x { width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; }
.scan-x svg { width: 24px; }
.scan-frame { width: min(78vw, 360px); aspect-ratio: 1.4; border: 3px solid var(--acc); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
#scan.hit .scan-frame { border-color: #fff; }
.scan-hint { background: rgba(0, 0, 0, .55); padding: 8px 14px; border-radius: 999px; }

/* ——— Divers ——— */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; margin-bottom: 20px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.hero .logo-big { width: min(320px, 70vw); filter: drop-shadow(0 0 40px rgba(61, 245, 176, .35)); justify-self: center; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode-card { padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; text-align: left; }
.mode-card.on { border-color: var(--acc); box-shadow: 0 0 24px rgba(61, 245, 176, .2); background: linear-gradient(160deg, rgba(61, 245, 176, .16), transparent); }
.mode-card .e { font-size: 2rem; }
.pill-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--acc); color: #032018; font-weight: 800; font-size: .8rem; flex: none; }
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--mut); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.big-days { font-family: var(--font2); font-size: clamp(3rem, 10vw, 5.5rem); font-weight: 800; line-height: 1; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.check input { width: 22px; height: 22px; accent-color: var(--acc); flex: none; margin-top: 2px; }
.room-svg { width: 100%; height: auto; background: #f4f7f6; border-radius: 16px; border: 1px solid var(--line2); }
details.acc { border: 1px solid var(--line); border-radius: 14px; background: var(--card2); margin-bottom: 10px; }
details.acc > summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 10px; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: '▾'; margin-left: auto; color: var(--mut); transition: transform .2s; }
details.acc[open] > summary::after { transform: rotate(180deg); }
details.acc > div { padding: 0 16px 14px; }
.print-only { display: none; }

/* ——— Mobile ——— */
.show-m { display: none; }
@media (max-width: 960px) {
  .show-m { display: inline; }
  .hide-m { display: none; }
  #app { grid-template-columns: 1fr; }
  #side { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 90; transform: translateX(-102%); transition: transform .25s; background: var(--bg2); }
  #side.open { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  #top { display: flex; position: sticky; top: 0; z-index: 40; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(4, 18, 26, .82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  :root[data-theme='light'] #top { background: rgba(238, 247, 244, .9); }
  #top img { width: 34px; height: 34px; border-radius: 10px; }
  #top .t { font-family: var(--font2); font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #top .t small { display: block; font-family: var(--font); font-weight: 400; font-size: .72rem; }
  main { padding: 16px 16px 120px; }
  .navbar { left: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .navbar .btn { min-width: 0; flex: 1; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero .logo-big { width: 180px; grid-row: 1; }
  .mode-cards { grid-template-columns: 1fr; }
  .prod { grid-template-columns: 72px 1fr; }
  .ph { width: 72px; height: 72px; }
  .prod .price { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; text-align: left; }
  .map { height: 320px; }
  .card { padding: 14px; }
}
@media (max-width: 420px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px; }
}

/* ——— Impression ——— */
@media print {
  #side, #top, .navbar, .no-print, #toast { display: none !important; }
  #app { display: block; }
  body { background: #fff; color: #000; }
  body::before { display: none; }
  .card { box-shadow: none; border-color: #ccc; background: #fff; break-inside: avoid; }
  .print-only { display: block; }
}
