/* Holdout — a field notebook for everyday preparedness. All assets are local. */
:root {
  color-scheme: light;
  --bg: #f5f6f2; --panel: #fff; --ink: #202f29; --muted: #6c7770; --line: #e1e6de;
  --accent: #466e38; --accent-ink: #fff; --warn: #9b651d; --bad: #b84936; --good: #466e38;
  --chip: #eef2e9; --shadow: 0 4px 24px #24332705; --nav: #182c26; --radius: 18px;
  --hero-bg: #eaf0df; --hero-ink: #263c29; --hero-muted: #617155; --hero-line: #d9e2cc;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15201b; --panel: #1f2d25; --ink: #eaf0e6; --muted: #a5b3a8; --line: #35463a;
  --accent: #b3cf84; --accent-ink: #18251a; --warn: #dfb66f; --bad: #f2917e; --good: #b3cf84;
  --chip: #2b3b2d; --shadow: none;
    --hero-bg: #293b2b; --hero-ink: #eaf0e6; --hero-muted: #b7c7ae; --hero-line: #42583c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15201b; --panel: #1f2d25; --ink: #eaf0e6; --muted: #a5b3a8; --line: #35463a;
    --accent: #b3cf84; --accent-ink: #18251a; --warn: #dfb66f; --bad: #f2917e; --good: #b3cf84;
    --chip: #2b3b2d; --shadow: none;
    --hero-bg: #293b2b; --hero-ink: #eaf0e6; --hero-muted: #b7c7ae; --hero-line: #42583c;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.6 "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif; }
body { padding-left: 242px; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: clamp(27px, 3vw, 39px); line-height: 1.2; letter-spacing: -1.3px; font-weight: 650; margin-bottom: 12px; }
h2 { font-size: 21px; line-height: 1.35; letter-spacing: -.5px; margin-bottom: 14px; }
h3 { font-size: 16px; line-height: 1.4; margin: 4px 0 14px; }
h4 { font-size: 14px; margin: 16px 0 8px; }
p { margin-bottom: 14px; }
.small { font-size: 12px; } .muted, .src { color: var(--muted); }
.ui-icon { width: 22px; height: 22px; flex: none; vertical-align: middle; }
.skip-link { position: fixed; top: -80px; left: 260px; z-index: 6000; padding: 12px 20px; background: var(--panel); border-radius: 10px; }
.skip-link:focus { top: 10px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
#main:focus { outline: none; }
.top { position: fixed; inset: 0 auto 0 0; width: 242px; z-index: 1600; background: var(--nav); color: #c2cec6; padding: 30px 16px 20px; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 12px 26px; color: #fff; text-decoration: none; }
.brand b { font-size: 29px; font-weight: 700; line-height: 1.2; letter-spacing: -1.4px; }
.brand-dot { color: #bad389; }
.brand small { display: block; margin-top: 5px; font-size: 8px; letter-spacing: 1.7px; color: #a6b6aa; }
.logo { display: grid; place-items: center; width: 44px; height: 44px; flex: none; }
.logo img { width: 100%; height: 100%; display: block; object-fit: contain; }
.logo .mark-on-dark { display: none; }
:root[data-theme="dark"] .logo .mark-on-light { display: none; } :root[data-theme="dark"] .logo .mark-on-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo .mark-on-light { display: none; } :root:not([data-theme="light"]) .logo .mark-on-dark { display: block; } }
.logo .ui-icon { width: 27px; height: 27px; }
#tabs { display: flex; flex-direction: column; gap: 3px; }
.nav-label { color: #98aba0; font-size: 9px; font-weight: 600; letter-spacing: 1.8px; padding: 18px 14px 8px; }
#tabs button { display: flex; align-items: center; gap: 12px; border: 0; padding: 11px 14px; min-height: 43px; border-radius: 10px; background: transparent; color: #c4d0c7; text-align: left; font-size: 12px; }
#tabs button:hover { background: #ffffff09; color: #fff; }
#tabs button.on { background: #ccde9b; color: #213426; font-weight: 650; }
#tabs .ui-icon { width: 19px; height: 19px; }
.nav-tag { margin-left: auto; font-size: 7px; letter-spacing: .8px; padding: 2px 4px; border: 1px solid #66816a; border-radius: 4px; }
.sidebar-bottom { margin-top: auto; padding: 30px 12px 0; font-size: 10px; color: #a6b6aa; }
.sidebar-bottom > span { display: block; }
.local-status { padding-bottom: 6px; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #8fad64; flex: none; margin-right: 5px; }
.is-offline .workspace-status .status-dot { background: var(--warn); }
.workspace-bar { height: 76px; border-bottom: 1px solid var(--line); padding: 0 40px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.breadcrumb { color: var(--muted); font-size: 12px; } .breadcrumb span { margin: 0 12px; opacity: .45; } .breadcrumb b { color: var(--ink); font-weight: 550; }
.workspace-status { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.planbadge { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; margin-left: 12px; font-size: 10px; }
.planbadge.pro { color: var(--accent); background: var(--chip); }
main { width: 100%; max-width: 1390px; margin: 0 auto; padding: 34px 40px 20px; }
.page-intro { margin-bottom: 30px; } .page-intro > p:last-child { margin-bottom: 0; font-size: 13px; }
.eyebrow { color: var(--accent); font-size: 9px; letter-spacing: 2px; font-weight: 700; margin-bottom: 9px; }
.tab { display: none; } .tab.on { display: block; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.grid > .card { margin-bottom: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; } .row.end { justify-content: flex-end; margin-top: 18px; }
label { display: inline-flex; gap: 8px; align-items: center; margin: 5px 12px 5px 0; max-width: 100%; flex-wrap: wrap; font-size: 13px; }
label > select, label > input { min-width: 0; }
label.chk { display: flex; align-items: flex-start; }
input, select, textarea { color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; max-width: 100%; min-height: 40px; }
input[type=number] { width: 6em; font-variant-numeric: tabular-nums; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; min-height: 0; flex: none; margin: 3px 0; }
input[type=file][hidden] { display: none; }
textarea { width: 100%; min-height: 110px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 9px; padding: 9px 15px; font-size: 12px; font-weight: 600; min-height: 40px; margin: 3px 0; text-decoration: none; }
.btn:hover { filter: brightness(.93); } .btn.ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn.on { background: var(--warn); border-color: var(--warn); color: var(--panel); }
.btn.file { cursor: pointer; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--accent); padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.danger, .kpi.bad-t { color: var(--bad) !important; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); margin-top: 20px; }
.kpis > div { padding: 16px; border-radius: 12px; background: var(--bg); }
.kpi { font-size: 32px; font-weight: 650; letter-spacing: -1px; line-height: 1.3; font-variant-numeric: tabular-nums; margin: 6px 0; }
.kpi small { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.bar { height: 6px; background: var(--chip); border-radius: 5px; overflow: hidden; margin: 12px 0; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--bad); }
.chip { display: inline-block; padding: 3px 9px; border-radius: 6px; background: var(--chip); color: var(--ink); font-size: 10px; margin: 2px; }
.chip.essentiel, .chip.crit1 { background: #fbe7e1; color: #8d3f30; }
.chip.recommandé, .chip.crit2 { background: #f8eed8; color: #826224; }
.chip.optionnel, .chip.crit3 { background: #e4edf6; color: #3c6083; }
.chip.auto { background: var(--accent); color: var(--accent-ink); }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; } tr:hover td { background: var(--bg); }
td.num, th.num { text-align: right; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
ul.check { list-style: none; padding: 0; margin: 0; } ul.check li { padding: 5px 0; } ul.check label { align-items: flex-start; margin: 0; }
.alert { border-left: 3px solid var(--warn); padding: 12px 15px; background: var(--chip); border-radius: 8px; margin: 10px 0; font-size: 12px; }
.alert.bad, .alertcard { border-left: 3px solid var(--bad); }
.src { font-size: 10px; margin-top: 16px; } .src a { color: var(--muted); }
.foot { max-width: 1390px; margin: 0 auto; padding: 10px 40px 30px; font-size: 10px; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
details summary { cursor: pointer; font-weight: 600; padding: 5px 0; }
.modal-wrap { position: fixed; inset: 0; z-index: 5000; background: #101f2399; backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 22px; padding: 26px; width: min(480px, 100%); max-height: 90dvh; overflow: auto; box-shadow: 0 24px 80px #0003; }
.modal label.field { display: block; margin: 14px 0 6px; } .modal input { width: 100%; }
.envsel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.envchip { font-size: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: 7px 12px; }
.envchip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.envpanel, .packbox { background: var(--chip); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.envblock h4 { margin: 12px 0 5px; } .envblock ul { margin: 0 0 8px; padding-left: 18px; }
.envcard { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; } .envcard summary { list-style: none; }
.calcout { margin: 12px 0; } .calc .row label { flex: 1 1 200px; } .calc select { min-width: 0; }
.sitgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 10px; }
.sit { display: flex; gap: 10px; align-items: center; text-align: left; padding: 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); min-height: 66px; font-size: 12px; }
.sit:hover { background: var(--bg); border-color: var(--accent); } .sit span { font-size: 21px; }
.sit.on { background: var(--chip); border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.sitpanel { border-left: 3px solid var(--bad); } .steps li { margin: 12px 0; } .steps label { display: inline; margin: 0; }
.steps input:checked + span { text-decoration: line-through; color: var(--muted); }
.callbtn { display: inline-flex; flex-direction: column; align-items: center; min-width: 84px; padding: 12px 16px; border-radius: 11px; background: var(--chip); color: var(--bad); border: 1px solid var(--line); text-decoration: none; }
.callbtn:hover { border-color: var(--bad); } .callbtn b { font-size: 21px; } .callbtn span { font-size: 10px; }
.sel { user-select: all; font-variant-numeric: tabular-nums; } .pos { font-variant-numeric: tabular-nums; }
.stchip { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; font-weight: 700; font-size: 12px; }
.stchip.ok { background: var(--good); color: var(--accent-ink); } .stchip.part { background: var(--warn); color: var(--panel); } .stchip.miss { background: var(--bad); color: var(--panel); } .stchip.na { background: var(--chip); color: var(--muted); }
tr.st-na td { opacity: .5; } table.audit td:first-child { width: 30px; }
.welcome { border-color: var(--accent); background: var(--chip); }
.plans { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin-bottom: 20px; }
.plan { text-align: center; position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.plan .price { font-size: 38px; font-weight: 700; font-variant-numeric: tabular-nums; } .plan.best { border: 2px solid var(--accent); }
.plan .badge { background: var(--accent); color: var(--accent-ink); font-size: 10px; padding: 4px 12px; border-radius: 6px; } .plan .btn { margin-top: auto; }
.locknote { background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; font-size: 12px; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; } fieldset.plain[disabled] { opacity: .55; }
.bagicon { font-size: 26px; } .bagcard.bag-survie { border-top: 3px solid var(--warn); } .bagcard.bag-evac { border-top: 3px solid var(--accent); }
/* Dashboard */
.now-hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; background: var(--hero-bg); border-color: var(--hero-line); padding: 27px 30px; }
.now-hero h2 { color: var(--hero-ink); font-size: 26px; margin-bottom: 7px; }
.now-hero p { color: var(--hero-muted); font-size: 12px; margin-bottom: 0; }
.hero-symbol { width: 65px; height: 65px; color: var(--accent); border: 1px solid var(--hero-line); border-radius: 50%; display: grid; place-items: center; }
.hero-symbol .ui-icon { width: 35px; height: 35px; }
.hero-date { font-size: 10px; text-transform: capitalize; margin-bottom: 10px; color: var(--hero-muted); }
.now-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0 28px; }
.metric { margin: 0; padding: 20px; position: relative; }
.metric-top { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); }
.metric-top .ui-icon { background: var(--chip); border-radius: 8px; padding: 7px; width: 35px; height: 35px; color: var(--accent); }
.metric .kpi { margin: 12px 0 4px; font-size: 35px; } .metric .small { font-size: 10px; }
.metric .bar { margin-bottom: 0; }
.now-columns { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; } .section-heading h3 { margin: 0; } .section-heading .ui-icon { color: var(--accent); width: 19px; height: 19px; }
.section-caption { font-size: 11px; color: var(--muted); margin-bottom: 20px; }
.map-preview { min-height: 170px; position: relative; border-radius: 12px; overflow: hidden; background: #e4e9d8 url('../icons/terrain.svg') center/cover; margin: 18px 0; }
.map-preview::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, #253d1722, transparent); }
.preview-pin { position: absolute; top: 42%; left: 48%; color: #36502f; background: #fff; border: 7px solid #fff; border-radius: 50%; box-shadow: 0 0 0 7px #ffffff60; z-index: 1; }
.preview-label { position: absolute; bottom: 12px; left: 12px; z-index: 1; background: #ffffffdf; padding: 4px 8px; border-radius: 5px; font-size: 9px; color: #3b5035; }
.map-preview-card .btn { width: 100%; }
.position-card .pos { font-size: 12px; margin-top: 12px; } .position-card .btn { width: 100%; }
.quick-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); padding: 13px 0; text-align: left; font-size: 12px; }
.quick-link:last-child { border-bottom: 0; } .quick-link .ui-icon { width: 17px; color: var(--accent); }
/* Map fills the viewport; app navigation is replaced by a return button. */
body.map-mode { padding: 0; overflow: hidden; }
.map-mode .top, .map-mode .workspace-bar, .map-mode .page-intro, .map-mode .foot, .map-mode #bottombar { display: none !important; }
.map-mode main { max-width: none; padding: 0; margin: 0; }
.map-mode #tab-map { position: fixed; inset: 0; z-index: 1700; }
.maplayout { position: relative; width: 100%; height: 100vh; height: 100dvh; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; background: #c5d5da; z-index: 0; }
.map-topbar { position: absolute; top: calc(20px + env(safe-area-inset-top, 0px)); left: max(20px, env(safe-area-inset-left, 0px)); right: max(20px, env(safe-area-inset-right, 0px)); z-index: 1100; display: flex; justify-content: space-between; align-items: center; gap: 12px; pointer-events: none; }
.map-topbar > * { pointer-events: auto; }
.map-control { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 15px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 12px; box-shadow: 0 4px 18px #24332714; font-size: 12px; font-weight: 600; }
.map-control:hover { background: var(--chip); } .map-control.icon-only { width: 44px; padding: 10px; }
.map-title { display: flex; align-items: center; gap: 8px; padding: 12px 18px; background: var(--panel); border-radius: 12px; box-shadow: 0 4px 18px #24332714; font-size: 12px; }
.map-offline-label { font-size: 10px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.map-actions { display: flex; gap: 8px; }
.map-drawer { position: absolute; right: max(20px, env(safe-area-inset-right, 0px)); top: calc(80px + env(safe-area-inset-top, 0px)); bottom: calc(30px + env(safe-area-inset-bottom, 0px)); width: 370px; z-index: 1100; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 60px #23372826; }
.drawer-heading { padding: 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.drawer-heading h2 { margin: 0; font-size: 18px; } .drawer-heading .eyebrow { font-size: 8px; margin-bottom: 5px; }
.mappanel { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 20px 20px; }
.mappanel summary { font-size: 12px; } .mappanel label { font-size: 11px; } .mappanel .small { font-size: 11px; }
.mappanel .packbox { padding: 10px; } .mappanel .btn { font-size: 11px; }
.mappanel i, .leaflet-control-layers i.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 5px 3px 0 0; flex: none; }
.map-hint { position: absolute; bottom: calc(30px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 900; padding: 7px 13px; background: var(--panel); border-radius: 8px; font-size: 10px; color: var(--muted); pointer-events: none; max-width: 70%; text-align: center; }
.map-hint span { margin: 0 7px; } .options-open .map-hint { display: none; }
.leaflet-top.leaflet-left { top: calc(78px + env(safe-area-inset-top, 0px)); left: max(10px, env(safe-area-inset-left, 0px)); }
.leaflet-bottom { bottom: env(safe-area-inset-bottom, 0px); }
.leaflet-control-layers, .leaflet-bar, .leaflet-control.north-arrow { border: 1px solid var(--line) !important; border-radius: 11px; box-shadow: 0 4px 18px #24332714; background: var(--panel); color: var(--ink); }
.leaflet-bar a { background: var(--panel); color: var(--ink); width: 42px; height: 42px; line-height: 42px; border-bottom-color: var(--line); }
.leaflet-bar a:hover { background: var(--chip); } .leaflet-bar a:first-child { border-radius: 10px 10px 0 0; } .leaflet-bar a:last-child { border-radius: 0 0 10px 10px; }
.leaflet-control-layers-toggle { width: 44px; height: 44px; }
.leaflet-control-layers-expanded { padding: 14px; max-height: calc(100dvh - 210px); max-width: calc(100vw - 40px); overflow: auto; }
.leaflet-control-layers label { font-size: 11px; } .leaflet-control-layers input { padding: 0; }
.options-open .leaflet-bottom.leaflet-right { right: 400px; }
.leaflet-control-attribution { max-width: min(70vw, 700px); font-size: 9px; background: #ffffffdf !important; color: #3b5035; }
.leaflet-control-attribution a { color: #365a29; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--ink); }
.leaflet-popup-content { font-size: 12px; } .leaflet-control.north-arrow { padding: 6px; line-height: 0; }
.leaflet-control.north-arrow svg { display: block; width: 24px; height: 34px; }
.zones { padding-left: 18px; font-size: 11px; }
.place-label { background: #ffffffc9; border: 0; box-shadow: none; padding: 0 3px; font-size: 11px; color: #222; } .place-label::before { display: none; }
.my-pin span { display: block; width: 18px; height: 18px; border-radius: 50% 50% 50% 0; border: 2px solid #fff; transform: rotate(-45deg); box-shadow: 0 0 2px #000; }
table.tags td { padding: 1px 4px; font-size: 11px; border: 0; } .blend-multiply { mix-blend-mode: multiply; }
#bottombar { display: none; }
.sheet-wrap { position: fixed; inset: 0; z-index: 2000; background: #101f2380; backdrop-filter: blur(4px); display: flex; align-items: flex-end; }
.sheet { width: 100%; background: var(--panel); border-radius: 24px 24px 0 0; padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sheet-heading { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .sheet-heading h2 { margin: 0; }
.sheet > button { font-size: 10px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 16px 6px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sheet > button .ui-icon { color: var(--accent); }
@media (min-width: 1600px) { main { padding-top: 45px; } .page-intro { margin-bottom: 36px; } }
@media (max-width: 1100px) {
  body { padding-left: 215px; } .top { width: 215px; padding-left: 12px; padding-right: 12px; }
  main { padding: 28px 24px 20px; } .workspace-bar { padding: 0 24px; } .foot { padding-left: 24px; padding-right: 24px; }
  .nav-tag { display: none; } .now-columns { grid-template-columns: minmax(0, 1.3fr) minmax(240px, 1fr); }
  .now-metrics { gap: 10px; } .metric { padding: 16px; } .metric .kpi { font-size: 29px; }
}
@media (max-width: 800px), (max-height: 500px) and (orientation: landscape) {
  body { padding-left: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .top { position: relative; inset: auto; width: 100%; height: calc(74px + env(safe-area-inset-top, 0px)); padding: calc(15px + env(safe-area-inset-top, 0px)) 20px 15px; overflow: visible; }
  .brand { padding: 0; gap: 10px; } .brand b { font-size: 25px; } .brand small { font-size: 7px; letter-spacing: 1.5px; margin-top: 3px; } .logo { width: 38px; height: 38px; }
  #tabs, .sidebar-bottom { display: none; } .workspace-bar { height: 45px; padding: 0 20px; } .breadcrumb { font-size: 10px; } .breadcrumb > span { margin: 0 6px; }
  .workspace-status { font-size: 9px; } .workspace-status .status-dot { display: none; } .planbadge { margin-left: 4px; padding: 3px 7px; font-size: 9px; }
  main { padding: 25px 20px 10px; } .page-intro { margin-bottom: 22px; } h1 { font-size: 29px; letter-spacing: -.9px; } .page-intro > p:last-child { font-size: 12px; }
  .card { padding: 20px; border-radius: 15px; } .grid { gap: 16px; } .foot { padding: 10px 20px 24px; }
  .now-columns { grid-template-columns: 1fr; } .now-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .now-side > .card { margin: 0; }
  .now-side > .quick-card { grid-column: 1 / -1; } .now-metrics { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .now-hero { padding: 22px; } .now-hero h2 { font-size: 23px; } .hero-symbol { width: 52px; height: 52px; } .hero-symbol .ui-icon { width: 28px; }
  #bottombar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1600; background: var(--panel); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
  #bottombar button { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); padding: 6px 2px; font-size: 9px; border-radius: 10px; min-height: 48px; }
  #bottombar button.on { color: var(--accent); background: var(--chip); font-weight: 700; } #bottombar .nav-tag { display: none; }
  .map-topbar { top: calc(12px + env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); gap: 8px; }
  .map-title { padding: 12px 10px; font-size: 11px; } .map-offline-label { display: none; } .map-title .status-dot { margin-right: 0; }
  .map-control { padding: 10px; font-size: 11px; } #mapBack > span:last-child { display: none; } #mapBack { width: 44px; }
  .map-drawer { right: 12px; left: 12px; width: auto; max-height: 70dvh; top: auto; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
  .options-open .leaflet-bottom.leaflet-right { right: 0; } .options-open .leaflet-bottom { visibility: hidden; }
  .map-hint { display: none; } .leaflet-top.leaflet-left { top: calc(68px + env(safe-area-inset-top, 0px)); left: 2px; }
  .leaflet-control-attribution { font-size: 8px; max-width: 75vw; max-height: 48px; overflow: auto; }
  .hide-sm { display: none; } th, td { padding: 10px 7px; }
  .skip-link { left: 15px; }
}
@media (max-width: 480px) {
  main { padding: 23px 16px 8px; } .workspace-bar { padding: 0 16px; } .breadcrumb { display: none; } .workspace-status { width: 100%; } .planbadge { margin-left: auto; }
  h1 { font-size: 27px; } .card { padding: 18px; } .now-hero { gap: 12px; } .now-hero h2 { font-size: 21px; }
  .hero-symbol { width: 42px; height: 42px; } .hero-symbol .ui-icon { width: 24px; } .now-side { grid-template-columns: 1fr; }
  .now-side > .quick-card { grid-column: auto; } .sitgrid { grid-template-columns: repeat(2, 1fr); } .sit { font-size: 11px; padding: 11px; gap: 8px; }
  .callbtn { min-width: 72px; padding: 10px; } .callbtn b { font-size: 19px; } .sheet { grid-template-columns: repeat(3, 1fr); }
  .map-title { gap: 5px; font-size: 10px; } .map-actions { gap: 6px; } #mapPanelToggle > span:last-child { display: none; } #mapPanelToggle { width: 44px; }
}
html.native body { overscroll-behavior-y: none; }
@media (min-width: 801px) and (min-height: 501px) { html.native .top { padding-top: calc(30px + env(safe-area-inset-top, 0px)); } html.native .workspace-bar { padding-top: env(safe-area-inset-top, 0px); height: calc(76px + env(safe-area-inset-top, 0px)); } }
@media (prefers-reduced-motion: no-preference) { .tab.on:not(#tab-map) { animation: reveal .22s ease-out; } @keyframes reveal { from { opacity: .5; transform: translateY(5px); } to { opacity: 1; transform: none; } } }
@media print {
  body { padding: 0; background: #fff; color: #000; } .top, .workspace-bar, .page-intro, .foot, .btn, .noprint, #bottombar, .sheet-wrap { display: none !important; }
  main { padding: 0; } .tab { display: block !important; page-break-after: always; } #tab-map { display: none !important; } .card { box-shadow: none; break-inside: avoid; }
}

/* Compte : écran de connexion obligatoire (js/account.js), bandeau et carte du profil */
.auth-gate { position: fixed; inset: 0; z-index: 6000; background: var(--bg); overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: max(32px, env(safe-area-inset-top)) 16px 32px; }
.auth-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); margin: auto 0; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 18px; } .auth-brand .logo { width: 52px; height: 52px; }
.auth-card h2 { margin-bottom: 8px; }
.auth-card label.field { display: block; margin: 14px 0 6px; font-weight: 600; } .auth-card input:not([type=checkbox]) { width: 100%; }
.auth-card label.chk { gap: 8px; margin-top: 16px; }
.auth-submit { width: 100%; margin-top: 18px; min-height: 44px; }
.auth-providers { display: grid; gap: 10px; margin: 18px 0 6px; } .auth-providers .btn { width: 100%; min-height: 44px; }
.auth-apple { background: #000; border-color: #000; color: #fff; }
:root[data-theme="dark"] .auth-apple { background: #fff; border-color: #fff; color: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-apple { background: #fff; border-color: #fff; color: #000; } }
.auth-gsi { min-height: 44px; display: flex; justify-content: center; }
.auth-gsi iframe { color-scheme: light; } /* cadre Google clair : sinon fond blanc opaque en mode sombre */
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0 8px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--chip); border-radius: 10px; padding: 4px; margin: 14px 0 4px; }
.auth-tabs button { border: 0; background: transparent; color: var(--ink); border-radius: 7px; padding: 8px; font-weight: 600; min-height: 40px; }
.auth-tabs button[aria-selected="true"] { background: var(--panel); box-shadow: 0 1px 4px #0000001f; }
.auth-error { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border-radius: 9px; padding: 10px 12px; margin: 14px 0 0; }
.auth-code { font: 600 20px/1.5 ui-monospace, "Cascadia Mono", Menlo, monospace; letter-spacing: .06em; text-align: center; background: var(--chip); border: 1px dashed var(--line); border-radius: 12px; padding: 16px; user-select: all; overflow-wrap: anywhere; }
.auth-net { margin: 18px 0 0; }
.auth-spinner { width: 34px; height: 34px; margin: 18px auto 4px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: authspin .9s linear infinite; }
@keyframes authspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .auth-spinner { animation-duration: 3s; } }
.account-banner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: color-mix(in srgb, var(--warn) 14%, var(--panel)); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 18px; font-size: 13px; }
#accountCard .pill { font-size: 11px; background: var(--chip); border-radius: 999px; padding: 3px 10px; }
#accountCard h3 { margin: 0; } #accountCard .row + .row { margin-top: 10px; }
@media (max-width: 480px) { .auth-card { padding: 20px; } .auth-code { font-size: 17px; } }

/* ---------- Téléphone et tablette ----------
   Tableaux : mots coupés seulement en dernier recours (sinon une colonne peut tomber à une lettre de large). */
table { overflow-wrap: break-word; word-break: normal; }
.tablewrap { -webkit-overflow-scrolling: touch; }
/* Écrans tactiles : champs à 16 px (en dessous, Safari zoome sur iPhone au toucher), cases et zones tactiles plus grandes. */
@media (pointer: coarse), (max-width: 800px) {
  input, select, textarea { font-size: 16px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
  button.link { min-height: 40px; display: inline-flex; align-items: center; }
  .envchip { min-height: 40px; }
  details > summary { min-height: 40px; display: list-item; padding: 9px 0; }
  .planbadge { min-height: 40px; padding: 4px 12px; }
}
/* Petits écrans : tailles de texte minimales lisibles. */
@media (max-width: 800px), (max-height: 500px) and (orientation: landscape) {
  .small, .src, .src a, .alert, .section-caption, .metric .small { font-size: 12px; }
  .chip { font-size: 11px; padding: 3px 8px; }
  th { font-size: 11px; letter-spacing: .5px; }
  .eyebrow { font-size: 11px; letter-spacing: 1.5px; }
  .brand small { font-size: 9px; }
  .workspace-status, .planbadge { font-size: 11px; }
  #bottombar button { font-size: 11px; }
  .metric-top { font-size: 12px; }
  .sit { font-size: 13px; }
  .page-intro > p:last-child { font-size: 14px; }
  .map-title { font-size: 12px; }
}
/* Téléphone en paysage : barre du bas plus basse, pour garder de la hauteur au contenu. */
@media (max-height: 500px) and (orientation: landscape) {
  #bottombar { padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px)); padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
  #bottombar button { flex-direction: row; justify-content: center; min-height: 44px; gap: 8px; }
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  .top { height: auto; padding-top: max(10px, env(safe-area-inset-top, 0px)); padding-bottom: 10px; padding-left: max(20px, env(safe-area-inset-left, 0px)); }
  main { padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
  .map-drawer { max-height: calc(100dvh - 90px); top: calc(70px + env(safe-area-inset-top, 0px)); left: auto; width: min(420px, 60vw); }
}
/* Téléphone : chaque ligne de tableau devient une fiche (classes posées par UI.stackTables, js/ui.js).
   Titre de la fiche : case à cocher + colonne principale ; champs chiffrés (quantité, poids, prix) côte à côte. */
@media (max-width: 640px) {
  table.stack, table.stack tbody { display: block; width: 100%; }
  table.stack tr.stack-head { display: none; }
  table.stack tr { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.stack tr:last-child { border-bottom: 0; } table.stack tr:hover td { background: none; }
  table.stack td { flex: 1 1 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 2px 0; border: 0; text-align: right; min-width: 0; }
  table.stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: 0 1 auto; }
  table.stack td.td-check { flex: 0 0 auto; padding-top: 1px; }
  table.stack td.td-main { flex: 1 1 calc(100% - 44px); display: block; text-align: left; font-size: 14px; font-weight: 600; padding-bottom: 6px; }
  table.stack td.td-main::before { display: none; }
  table.stack td.td-main .small, table.stack td.td-main .chip { font-weight: 400; }
  table.stack td.num:has(input) { flex: 1 1 calc(33% - 12px); flex-direction: column; align-items: stretch; text-align: left; gap: 4px; }
  table.stack td.num:has(input) input { width: 100%; }
  table.stack td.td-act { justify-content: flex-end; }
  table.stack td.td-full { display: block; text-align: left; }
  table.stack td:empty { display: none; }
  table.stack .hide-sm { display: flex; }
  .tablewrap { overflow-x: visible; }
}
/* Boutons d'une ligne (✕, « suppr. ») : zone tactile d'au moins 44 px. */
@media (pointer: coarse), (max-width: 800px) {
  td button.link, td .btn { min-width: 44px; min-height: 44px; justify-content: center; }
  .hero-date { font-size: 12px; } .preview-label { font-size: 11px; } .plan .badge { font-size: 12px; }
}
