:root {
  color-scheme: light;
  --ink: #172a3b;
  --muted: #6b7b88;
  --line: #dbe3e8;
  --canvas: #f3f6f8;
  --card: #ffffff;
  --navy: #17324d;
  --blue: #1976a8;
  --blue-soft: #e6f2f8;
  --green: #2b8068;
  --green-soft: #e7f4ef;
  --orange: #c76a1c;
  --orange-soft: #fff0df;
  --red: #b53c45;
  --red-soft: #fbe9eb;
  --purple: #7550a3;
  --purple-soft: #efe9f6;
  --shadow: 0 12px 32px rgba(24, 49, 72, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: 246px; padding: 24px 17px;
  display: flex; flex-direction: column; background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 26px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--navy); background: #fff; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: #aabac8; font-size: 12px; }
.sidebar nav { display: grid; gap: 5px; }
.nav-label { margin: 19px 10px 7px; color: #8399ac; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.sidebar nav a, .sidebar nav button { min-height: 44px; padding: 0 13px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 11px; color: #cbd6df; background: transparent; cursor: pointer; text-align: left; }
.sidebar nav a:hover, .sidebar nav button:hover, .sidebar nav a.active { color: #fff; background: rgba(255,255,255,.11); }
.sidebar nav span { width: 20px; text-align: center; font-size: 18px; }
.sidebar-footer { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; background: rgba(255,255,255,.06); }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { font-size: 12px; }
.sidebar-footer small { margin-top: 3px; color: #9fb0bf; font-size: 10px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #f2b35b; box-shadow: 0 0 0 4px rgba(242,179,91,.16); }

.main-area { min-height: 100vh; margin-left: 246px; }
.topbar { min-height: 105px; padding: 23px clamp(22px, 4vw, 52px) 19px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(243,246,248,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
.topbar h1 { margin: 2px 0 0; font-size: clamp(25px, 3vw, 33px); letter-spacing: -.035em; }
.eyebrow { margin: 0; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.primary-button, .secondary-button, .danger-button, .text-button, .icon-button { border: 0; cursor: pointer; }
.primary-button { min-height: 43px; padding: 0 17px; border-radius: 11px; color: #fff; background: var(--blue); font-weight: 750; box-shadow: 0 7px 18px rgba(25,118,168,.2); }
.primary-button:hover { background: #126892; }
.secondary-button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 700; }
.secondary-button:hover { border-color: #b8c8d2; background: #f8fafb; }
.danger-button { min-height: 40px; padding: 0 14px; border-radius: 10px; color: var(--red); background: var(--red-soft); font-weight: 700; }
.text-button { padding: 7px 0; color: var(--blue); background: none; font-weight: 750; }
.icon-button { min-width: 43px; min-height: 43px; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; position: relative; }
.icon-button span { position: absolute; top: -7px; right: -5px; min-width: 19px; height: 19px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--red); font-size: 10px; font-weight: 800; }
.view { padding: 26px clamp(22px, 4vw, 52px) 70px; max-width: 1500px; margin: 0 auto; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .85fr); gap: 22px; align-items: start; }
.stack { display: grid; gap: 20px; }
.card { background: var(--card); border: 1px solid rgba(215,224,230,.9); border-radius: 17px; box-shadow: 0 4px 18px rgba(24,49,72,.035); }
.card-pad { padding: 21px; }
.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.section-header h2, .section-header h3 { margin: 0; letter-spacing: -.02em; }
.section-header h2 { font-size: 19px; }
.section-header h3 { font-size: 16px; }
.section-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.section-header a, .section-header button:not(.primary-button) { color: var(--blue); border: 0; background: none; cursor: pointer; font-size: 12px; font-weight: 750; white-space: nowrap; }

.objective { padding: 22px; color: #fff; background: linear-gradient(130deg, #17324d 0%, #24597a 100%); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.objective::after { content: ""; position: absolute; width: 200px; height: 200px; right: -70px; top: -110px; border-radius: 50%; border: 38px solid rgba(255,255,255,.07); }
.objective-head, .objective-numbers { display: flex; justify-content: space-between; gap: 18px; position: relative; z-index: 1; }
.objective h2 { margin: 4px 0 0; font-size: 17px; }
.objective-badge { padding: 7px 10px; border-radius: 20px; background: rgba(255,255,255,.14); font-size: 11px; font-weight: 750; }
.objective-numbers { margin: 22px 0 10px; align-items: end; }
.objective-numbers strong { display: block; font-size: 27px; letter-spacing: -.04em; }
.objective-numbers small { color: #bdd0df; }
.progress { height: 9px; overflow: hidden; border-radius: 8px; background: rgba(255,255,255,.15); position: relative; z-index: 1; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: #75d3bc; transition: width .3s ease; }
.objective-foot { display: flex; justify-content: space-between; margin-top: 9px; color: #bdd0df; font-size: 11px; position: relative; z-index: 1; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.stat { padding: 15px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.stat small, .stat strong { display: block; }
.stat small { color: var(--muted); font-size: 11px; }
.stat strong { margin-top: 5px; font-size: 19px; }

.action-list, .affair-list, .timeline { display: grid; gap: 9px; }
.action-row { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.action-color { align-self: stretch; min-height: 39px; border-radius: 5px; background: var(--blue); }
.type-relance-facture .action-color { background: var(--red); }
.type-relance-offre .action-color { background: var(--orange); }
.type-livraison-document .action-color { background: var(--purple); }
.type-demarrage-chantier .action-color { background: var(--green); }
.type-reception-chantier .action-color { background: #788995; }
.action-main { min-width: 0; }
.action-main strong, .action-main small { display: block; }
.action-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.action-main small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.action-buttons { display: flex; gap: 7px; }
.action-buttons button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font-size: 11px; font-weight: 750; }
.action-buttons .mail { color: #fff; border-color: var(--orange); background: var(--orange); }
.action-row.done { opacity: .6; }
.action-row.done strong { text-decoration: line-through; }

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.day { position: relative; min-height: 82px; padding: 9px; border-radius: 12px; background: #f5f7f9; border: 1px solid transparent; }
.day.today { color: #fff; background: var(--navy); }
.day { cursor: pointer; text-align: left; color: inherit; }
.day.selected { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(35, 111, 161, .14); }
.day strong, .day small { display: block; }
.day strong { font-size: 16px; }
.day small { font-size: 10px; opacity: .72; }
.day em { position: absolute; top: 7px; right: 7px; min-width: 15px; font-size: 9px; font-style: normal; font-weight: 800; text-align: center; }
.day-dots { display: block; min-height: 20px; }
.day i { display: inline-block; width: 6px; height: 6px; margin: 13px 2px 0 0; border-radius: 50%; background: var(--blue); }
.day i.orange { background: var(--orange); } .day i.red { background: var(--red); } .day i.purple { background: var(--purple); } .day i.green { background: var(--green); } .day i.gray { background: #788995; }
.week-detail { margin-top: 14px; padding: 14px; border-radius: 14px; background: #f7f9fa; border: 1px solid #e8eef1; }
.week-detail > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.week-detail > header small, .week-detail > header strong { display: block; }
.week-detail > header small { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.week-detail > header strong { margin-top: 2px; text-transform: capitalize; }
.week-agenda { display: grid; gap: 7px; }
.week-agenda-row { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 1px solid #e2e9ed; border-radius: 10px; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.week-agenda-row:hover, .week-agenda-row:focus-visible { border-color: var(--blue); }
.week-agenda-row strong, .week-agenda-row small { display: block; }
.week-agenda-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.week-agenda-time { font-size: 12px; font-weight: 800; color: var(--blue); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 17px; }
.filter-button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 18px; color: var(--muted); background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.filter-button.active { color: #fff; border-color: var(--navy); background: var(--navy); }
.affair-row { width: 100%; display: grid; grid-template-columns: 45px minmax(180px, 1.3fr) minmax(120px, .7fr) minmax(120px, .7fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; color: var(--ink); background: #fff; text-align: left; transition: transform .15s, box-shadow .15s; }
.affair-row:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(24,49,72,.07); }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--blue); background: var(--blue-soft); font-weight: 850; }
.affair-main strong, .affair-main small, .affair-cell strong, .affair-cell small { display: block; }
.affair-main small, .affair-cell small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.affair-cell strong { font-size: 13px; }
.chevron { color: #9aabb7; font-size: 22px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 13px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; }
.badge.green { color: var(--green); background: var(--green-soft); }
.badge.orange { color: var(--orange); background: var(--orange-soft); }
.badge.red { color: var(--red); background: var(--red-soft); }
.badge.gray { color: #667780; background: #edf1f3; }

.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.detail-head h2 { margin: 3px 0 6px; font-size: 27px; }
.detail-head p { margin: 0; color: var(--muted); font-size: 12px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 18px; overflow-x: auto; border-radius: 13px; background: #e8edf0; }
.tab { min-height: 38px; padding: 0 15px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; white-space: nowrap; }
.tab.active { color: var(--ink); background: #fff; box-shadow: 0 3px 9px rgba(24,49,72,.08); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .75fr); gap: 19px; align-items: start; }
.definition-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 25px; }
.definition-list div { padding-bottom: 12px; border-bottom: 1px solid #edf1f3; }
.definition-list dt { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.definition-list dd { margin: 5px 0 0; font-size: 13px; font-weight: 650; }
.mission-line, .amendment-line, .billing-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid #edf1f3; }
.mission-line:last-child, .amendment-line:last-child { border-bottom: 0; }
.mission-line small, .amendment-line small { color: var(--muted); }
.financial-summary { display: grid; gap: 9px; }
.financial-summary > div { display: flex; justify-content: space-between; gap: 12px; }
.financial-summary .total { margin-top: 5px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 17px; font-weight: 800; }
.billing-list { display: grid; gap: 11px; }
.billing-card { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(280px, 1.2fr) auto auto; gap: 18px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.billing-card > div > strong, .billing-card > div > small { display: block; }
.billing-card > div > small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.billing-card-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.billing-card-numbers span, .billing-card-numbers small, .billing-card-numbers strong { display: block; }
.billing-card-numbers small { color: var(--muted); font-size: 9px; }
.billing-card-numbers strong { margin-top: 3px; font-size: 12px; }
.billing-entry, .document-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 13px 0; border-bottom: 1px solid #edf1f3; }
.billing-entry:last-child, .document-entry:last-child { border-bottom: 0; }
.billing-entry > div > strong, .billing-entry > div > small, .document-entry > div > strong, .document-entry > div > small { display: block; }
.billing-entry > div > small, .document-entry > div > small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.billing-entry > div:nth-child(2) { text-align: right; }
.billing-entry > div:nth-child(2) .badge, .billing-entry > div:nth-child(2) strong, .billing-entry > div:nth-child(2) small { display: block; margin-left: auto; }
.billing-entry > div:nth-child(2) strong { margin-top: 5px; }
.timeline-item { padding: 13px 14px; border-left: 3px solid var(--blue); border-radius: 0 12px 12px 0; background: #f6f9fa; }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item small { margin-top: 4px; color: var(--muted); }
.warning { padding: 13px; color: #8d561b; border: 1px solid #f4d19e; border-radius: 11px; background: #fff7e9; font-size: 12px; line-height: 1.45; }

.followup-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 20px; }
.phase-legend { display: flex; flex-wrap: wrap; gap: 7px; }
.phase-legend span { padding: 6px 9px; border-radius: 15px; background: #f0f4f6; color: var(--muted); font-size: 10px; font-weight: 750; }
.phase-legend span.active { color: #fff; background: var(--navy); }
.state-key { display: grid; gap: 11px; }
.state-key div { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.state-key i { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.state-key .realise i { background: var(--green); } .state-key .reporte i { background: var(--orange); } .state-key .non-realise i { background: var(--red); } .state-key .annule i { background: #8998a2; }

.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 6px; }
.placeholder-illustration { width: 58px; height: 58px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 18px; background: var(--blue-soft); color: var(--blue); font-size: 26px; }

.modal[hidden], .sheet[hidden] { display: none; }
.modal, .sheet { position: fixed; inset: 0; z-index: 100; }
.modal-backdrop, .sheet-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(10,26,39,.5); backdrop-filter: blur(4px); }
.modal { display: grid; place-items: center; padding: 24px; }
.modal-panel { position: relative; width: min(760px, 100%); max-height: calc(100vh - 48px); overflow: auto; border-radius: 20px; background: #fff; box-shadow: 0 30px 80px rgba(8,25,38,.26); }
.modal-header { position: sticky; top: 0; z-index: 3; padding: 20px 22px 15px; display: flex; justify-content: space-between; gap: 16px; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.modal-header h2 { margin: 2px 0 0; font-size: 21px; }
.modal-body { padding: 22px; }
.modal-footer { position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
.modal-footer > div { display: flex; gap: 8px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
.step { height: 5px; border-radius: 4px; background: #dfe6ea; }
.step.active { background: var(--blue); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #435563; font-size: 11px; font-weight: 750; }
.field label span { color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #cfd9df; border-radius: 10px; color: var(--ink); background: #fff; outline: none; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(25,118,168,.1); }
.helper { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.action-main { min-width: 0; padding: 0; text-align: left; background: transparent; border: 0; color: inherit; cursor: pointer; }
.action-main:hover strong, .action-main:focus-visible strong { color: var(--blue); text-decoration: underline; }
.mission-builder { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 8px; align-items: end; margin-top: 15px; }
.mission-draft-list { display: grid; gap: 8px; margin-top: 15px; }
.mission-draft { display: grid; grid-template-columns: minmax(0, 1fr) 120px 32px; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 11px; background: #f4f7f8; }
.mission-draft input { width: 100%; min-height: 35px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; text-align: right; }
.mission-draft button { width: 30px; height: 30px; border: 0; border-radius: 8px; color: var(--red); background: var(--red-soft); cursor: pointer; }
.choice-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-top: 16px; }
.choice-card { padding: 15px; text-align: left; border: 1px solid var(--line); border-radius: 13px; background: #fff; cursor: pointer; }
.choice-card:hover, .choice-card.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(25,118,168,.08); }
.choice-card strong, .choice-card small { display: block; }
.choice-card small { margin-top: 5px; color: var(--muted); line-height: 1.4; }

.sheet { display: none; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 150; display: grid; gap: 8px; }
.toast { width: min(350px, calc(100vw - 32px)); padding: 13px 15px; border-radius: 12px; color: #fff; background: var(--navy); box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }
.toast.success { background: var(--green); } .toast.warning { color: #fff; background: var(--orange); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.mobile-nav { display: none; }

@media (max-width: 980px) {
  .sidebar { width: 208px; }
  .main-area { margin-left: 208px; }
  .dashboard-grid, .detail-grid, .followup-layout { grid-template-columns: 1fr; }
  .affair-row { grid-template-columns: 45px minmax(0, 1fr) minmax(110px, .55fr) auto; }
  .affair-row .hide-tablet { display: none; }
  .billing-card { grid-template-columns: minmax(180px, 1fr) minmax(250px, 1.2fr); }
  .billing-card > .detail-actions { justify-content: flex-start; }
}

@media (max-width: 720px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .main-area { margin-left: 0; }
  .topbar { min-height: 82px; padding: 16px 16px 12px; position: static; }
  .topbar h1 { font-size: 24px; }
  .topbar .primary-button { display: none; }
  .view { padding: 13px 14px 22px; }
  .dashboard-grid, .stack { gap: 13px; }
  .card { border-radius: 15px; }
  .card-pad { padding: 16px; }
  .objective { padding: 18px; }
  .objective-numbers { margin-top: 17px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: 1 / -1; }
  .action-row { grid-template-columns: 6px minmax(0, 1fr); }
  .action-buttons { grid-column: 2; flex-wrap: wrap; }
  .action-buttons button { flex: 1; }
  .action-buttons [data-edit-action] { flex: 0 0 38px; margin-left: auto; }
  .week-strip { gap: 5px; overflow-x: auto; }
  .day { min-width: 60px; padding: 8px; }
  .affair-row { grid-template-columns: 42px minmax(0, 1fr) auto; padding: 12px; }
  .affair-row .affair-cell { display: none; }
  .detail-head { display: grid; }
  .detail-actions { justify-content: flex-start; }
  .definition-list { grid-template-columns: 1fr; gap: 10px; }
  .modal { padding: 0; place-items: end center; }
  .modal-panel { width: 100%; max-height: 94vh; border-radius: 21px 21px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal-header, .modal-body { padding-left: 16px; padding-right: 16px; }
  .modal-footer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .form-grid, .choice-cards { grid-template-columns: 1fr; }
  .mission-builder { grid-template-columns: 1fr 100px; }
  .mission-builder button { grid-column: 1 / -1; }
  .mission-draft { grid-template-columns: minmax(0,1fr) 90px 30px; }
  .billing-card { grid-template-columns: 1fr; gap: 12px; }
  .billing-card-numbers { gap: 8px; }
  .billing-entry, .document-entry { grid-template-columns: minmax(0, 1fr) auto; }
  .billing-entry > button, .document-entry > button { grid-column: 1 / -1; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 60; min-height: calc(67px + env(safe-area-inset-bottom)); padding: 8px 12px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
  .mobile-nav a, .mobile-nav button { min-height: 48px; display: grid; place-items: center; gap: 1px; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
  .mobile-nav span { font-size: 19px; }
  .mobile-nav small { font-size: 9px; }
  .mobile-nav .active { color: var(--blue); }
  .mobile-nav .mobile-add { width: 46px; min-height: 46px; margin: -25px auto 0; border-radius: 50%; color: #fff; background: var(--blue); font-size: 25px; box-shadow: 0 8px 22px rgba(25,118,168,.3); }
  .sheet { display: block; }
  .sheet-panel { position: absolute; inset: auto 0 0; padding: 9px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: #fff; }
  .sheet-handle { width: 40px; height: 4px; margin: 0 auto 14px; border-radius: 4px; background: #d3dce1; }
  .sheet-panel header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
  .sheet-panel h2 { margin: 2px 0 0; }
  .menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .menu-grid button { min-height: 105px; padding: 15px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .menu-grid button > span, .menu-grid button strong, .menu-grid button small { display: block; }
  .menu-grid button > span { color: var(--blue); font-size: 22px; }
  .menu-grid button strong { margin-top: 8px; font-size: 12px; }
  .menu-grid button small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
  .toast-region { inset: auto 16px calc(84px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
