/* ============================================================
   PYROLIS — component style layer (back-office + tech + soft)
   Ported CLASS-FOR-CLASS from the React prototype:
     design/project/src/components/app.css   (§2.1–2.20, 2.26)
     design/project/src/components/app2.css   (§2.8, 2.9, 2.15, 2.21–2.25)
   Values are exact (see docs/specs/inventory/design-system.md).
   Responsive rules are container queries on .app-viewport (name: vp).
   Consumes tokens from tokens.css; fonts from fonts.css (imported below).
   Class names are kept identical to the prototype (no renames).
   ============================================================ */
@import "./fonts.css";

/* ============================================================
   Ported from app.css
   ============================================================ */

/* ---------- Stage & simulated viewport ---------- */
.stage { min-height: 100vh; display: flex; justify-content: center; background: oklch(0.90 0.008 70); }
.app-viewport {
  container-type: inline-size; container-name: vp;
  width: 100%; min-height: 100vh; background: var(--paper);
  box-shadow: var(--sh-2); position: relative;
  transition: max-width var(--t-slow) var(--ease);
}
.app-viewport[data-bp="mobile"]  { max-width: 400px; }
.app-viewport[data-bp="tablet"]  { max-width: 834px; }
.app-viewport[data-bp="laptop"]  { max-width: 1366px; }
.app-viewport[data-bp="full"]    { max-width: none; box-shadow: none; }

/* ---------- Back-office shell ---------- */
.bo { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.bo-side {
  background: var(--coal); color: var(--ink-inv);
  display: flex; flex-direction: column; gap: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.bo-logo { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; }
.bo-logo .mark {
  width: 28px; height: 28px; border-radius: 7px; background: var(--fire);
  display: grid; place-items: center; color: white; font-weight: 700; font-size: 13px;
  flex: none;
}
.bo-logo .word { font-weight: 600; font-size: 15px; letter-spacing: 0.01em; }
.bo-logo .tenant { font-size: 11px; opacity: 0.55; display: block; margin-top: 1px; }
.bo-nav { padding: 4px 8px 16px; display: flex; flex-direction: column; gap: 1px; }
.bo-nav .nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.09em; opacity: 0.45; padding: 14px 10px 5px; }
/* Collapsible sections (NavSections hook): the header is a button, groups
   collapse via .nav-group.collapsed persisted in localStorage. */
.bo-nav button.nav-sec { appearance: none; background: none; border: 0; color: inherit; font-family: inherit; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 5px; text-align: left; }
.bo-nav button.nav-sec:hover { opacity: 0.8; }
.bo-nav .nav-sec .nav-caret { margin-left: auto; opacity: 0.7; transition: transform 0.15s ease; }
.bo-nav .nav-group.collapsed .nav-caret { transform: rotate(-90deg); }
.bo-nav .nav-group.collapsed .nav-items { display: none; }
.bo-nav .nav-group { display: flex; flex-direction: column; gap: 1px; }
.bo-nav .nav-items { display: flex; flex-direction: column; gap: 1px; }
.bo-nav a {
  display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: var(--r-2);
  color: oklch(0.85 0.005 70); font-size: 13px; text-decoration: none; line-height: 1.2;
}
.bo-nav a .ic { opacity: 0.65; flex: none; }
.bo-nav a:hover { background: oklch(0.32 0.012 45); text-decoration: none; }
.bo-nav a.on { background: oklch(0.34 0.03 41); color: white; }
.bo-nav a.on .ic { opacity: 1; color: oklch(0.78 0.12 45); }
.bo-nav a .badge { margin-left: auto; }

.bo-main { min-width: 0; display: flex; flex-direction: column; }
.bo-top {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
  border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 40;
}
.bo-burger { display: none; }
.bo-search {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-2);
  padding: 6px 10px; color: var(--ink-3); font-size: 13px; cursor: pointer;
}
.bo-search:hover { border-color: var(--line-strong); }
.bo-search kbd {
  margin-left: auto; font-family: var(--font-mono); font-size: 10.5px;
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 5px; background: var(--surface);
}
.bo-top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.bo-content { padding: 20px 24px 80px; max-width: 1480px; width: 100%; }

/* Mobile/tablet shell adaptation */
@container vp (max-width: 1023px) {
  .bo { grid-template-columns: 1fr; }
  .bo-side { display: none; position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 100; box-shadow: var(--sh-3); }
  .bo-side.open { display: flex; }
  .bo-burger { display: inline-flex; }
  .bo-scrim { position: fixed; inset: 0; background: oklch(0.2 0.01 60 / 0.4); z-index: 99; }
  .bo-content { padding: 16px 14px 96px; }
}

/* ---------- Page header ---------- */
.ph { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.ph h1 { font-size: var(--fs-21); font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.ph .sub { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.ph .ph-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.crumbs a { color: var(--ink-3); }
.crumbs .sep { opacity: 0.5; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; border-radius: var(--r-2);
  font: 500 13px var(--font-sans); padding: 7px 13px; cursor: pointer;
  border: 1px solid transparent; line-height: 1.2; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.btn:focus-visible { outline: 2px solid var(--fire); outline-offset: 2px; }
.btn-primary { background: var(--fire); color: white; }
.btn-primary:hover { background: var(--fire-deep); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-danger { background: var(--st-red); color: white; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-lg { padding: 11px 18px; font-size: 14px; border-radius: var(--r-3); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-2);
  border: none; background: transparent; color: var(--ink-2); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn .dot {
  position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--fire); border: 2px solid var(--surface);
}

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 500; padding: 2px 9px; line-height: 1.5; white-space: nowrap;
}
.chip .cdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip-gray   { background: var(--st-gray-bg);   color: var(--st-gray); }
.chip-blue   { background: var(--st-blue-bg);   color: var(--st-blue); }
.chip-green  { background: var(--st-green-bg);  color: var(--st-green); }
.chip-amber  { background: var(--st-amber-bg);  color: var(--st-amber); }
.chip-red    { background: var(--st-red-bg);    color: var(--st-red); }
.chip-violet { background: var(--st-violet-bg); color: var(--st-violet); }
.chip-teal   { background: var(--st-teal-bg);   color: var(--st-teal); }
.chip-fire   { background: var(--fire-soft);    color: var(--fire-deep); }
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-full); background: var(--fire); color: white;
  font-size: 10.5px; font-weight: 600; font-family: var(--font-mono);
}
.badge.muted { background: oklch(0.45 0.012 50); }

/* ---------- Cards & panels ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--sh-1); min-width: 0; }
.card-pad { padding: 16px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.card-h .spacer { margin-left: auto; }
.well { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 10px 12px; }
/* Tailwind's preflight makes every <svg> a block; our icons are inline
   glyphs that sit on the text baseline next to a sentence. */
.ic { display: inline-block; vertical-align: -0.15em; }
.picto { display: inline-block; vertical-align: -0.18em; flex: none; }
.ph-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-2); background: var(--surface-2); color: var(--ink-2); flex: none; }
.well > .ic:first-child { margin-right: 4px; }
/* Screen body vertical rhythm — stacks top-level blocks (KPI grids, cards,
   tables) with the prototype's 14px gap. Applied by `state_gate` "normal".
   Only affects direct children, so single-block screens are unchanged. */
.screen-stack { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
@container vp (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(2, 1fr); } }
@container vp (max-width: 640px) { .g4, .g3, .g2 { grid-template-columns: 1fr; } }

/* KPI */
.kpi { padding: 14px 16px; }
.kpi .k-label { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: var(--fs-26); font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .k-trend { font-size: 11.5px; margin-top: 3px; }
.kpi .k-trend.up { color: var(--st-green); } .kpi .k-trend.down { color: var(--st-red); } .kpi .k-trend.flat { color: var(--ink-3); }
.kpi.alert { border-color: var(--st-red); border-left: 3px solid var(--st-red); }

/* ---------- Data table ---------- */
.dt-wrap { overflow-x: auto; }
.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
.dt th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-3); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); white-space: nowrap; position: sticky; top: 0;
}
.dt th.sortable { cursor: pointer; } .dt th.sortable:hover { color: var(--ink); }
.dt td { padding: 0 12px; height: var(--row-h); border-bottom: 1px solid var(--line); vertical-align: middle; }
.dt tbody tr { cursor: pointer; }
.dt tbody tr:hover { background: var(--surface-2); }
.dt tbody tr.sel { background: var(--fire-soft); }
.dt .r { text-align: right; } .dt th.r { text-align: right; }
.dt .main-cell { font-weight: 500; }
.dt .sub-cell { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.dt-check { width: 34px; } .dt-check input { accent-color: var(--fire); width: 15px; height: 15px; cursor: pointer; }

/* Column-click filtering — header funnel trigger + redesigned dropdown
   (opt-in via `on_filter`, see DataTable moduledoc). */
.dt-filter-caret {
  background: none; border: 0; padding: 3px; margin: 0 0 0 4px; cursor: pointer;
  color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-1); vertical-align: middle;
}
.dt-filter-caret:hover { color: var(--ink); background: var(--surface-3); }
.dt-filter-caret--active { color: var(--fire); background: var(--fire-soft); }
.dt-filter-pop {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2);
  box-shadow: var(--sh-pop); padding: 10px; display: flex; flex-direction: column; gap: 8px;
  min-width: 190px; font-weight: normal; text-transform: none; letter-spacing: normal;
  text-align: left; color: var(--ink);
}
.dt-filter-pop-title {
  font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dt-filter-opts { display: flex; flex-direction: column; }
.dt-filter-opt {
  background: none; border: 0; padding: 6px 8px; cursor: pointer; text-align: left;
  color: var(--ink); font-size: 13px; border-radius: var(--r-1);
}
.dt-filter-opt:hover { background: var(--surface-2); }
.dt-filter-form { display: flex; flex-direction: column; gap: 8px; }
.dt-filter-label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--ink-3); }
.dt-filter-label .select, .dt-filter-label .input { font-size: 13px; color: var(--ink); }

/* Resource nav-icon (opt-in `nav_to`). */
.dt-nav-link { margin-left: 6px; color: var(--ink-3); font-size: 12px; text-decoration: none; vertical-align: middle; }
.dt-nav-link:hover { color: var(--fire); text-decoration: none; }

.bulkbar {
  position: sticky; bottom: 16px; margin: 12px auto 0; width: fit-content; z-index: 30;
  display: flex; align-items: center; gap: 10px; background: var(--coal); color: var(--ink-inv);
  border-radius: var(--r-3); padding: 8px 10px 8px 16px; box-shadow: var(--sh-pop); font-size: 13px;
}
.bulkbar .btn { background: oklch(0.36 0.02 45); color: white; border: none; }
.bulkbar .btn:hover { background: oklch(0.42 0.03 45); }

/* card-collapse of tables on narrow viewports */
@container vp (max-width: 700px) {
  .dt-responsive .dt thead { display: none; }
  .dt-responsive .dt, .dt-responsive .dt tbody, .dt-responsive .dt tr, .dt-responsive .dt td { display: block; width: 100%; }
  .dt-responsive .dt tr { border: 1px solid var(--line); border-radius: var(--r-2); margin-bottom: 8px; background: var(--surface); padding: 10px 12px; }
  .dt-responsive .dt td { border: none; height: auto; padding: 2px 0; }
  .dt-responsive .dt td.r { text-align: left; }
  .dt-responsive .dt td[data-th]::before { content: attr(data-th) " · "; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
}

/* Toolbar above tables */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .ti {
  display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-2); padding: 6px 10px; font-size: 13px; color: var(--ink-3); min-width: 200px;
}
.toolbar .ti input { border: none; outline: none; background: transparent; font: inherit; color: var(--ink); width: 100%; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: var(--r-full); padding: 4px 11px; font-size: 12px; color: var(--ink-2); cursor: pointer;
}
.fchip:hover { border-color: var(--ink-3); }
.fchip.on { background: var(--coal); color: white; border-color: var(--coal); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  border: none; background: none; font: 500 13px var(--font-sans); color: var(--ink-2);
  padding: 9px 13px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--fire-deep); border-bottom-color: var(--fire); }
.tabs button .badge { margin-left: 6px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field .req { color: var(--st-red); }
.input, .select, textarea.input {
  font: 400 13px var(--font-sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-2); padding: 7px 10px; width: 100%;
}
.input:focus, .select:focus, textarea.input:focus { outline: 2px solid var(--fire); outline-offset: -1px; border-color: var(--fire); }
.field .hint { font-size: 11.5px; color: var(--ink-3); }
.field .hint.reg { color: var(--st-blue); display: flex; gap: 5px; align-items: flex-start; }
.field.error .input { border-color: var(--st-red); }
.field .err-msg { font-size: 11.5px; color: var(--st-red); }
.prefill { background: var(--st-blue-bg); border-radius: 3px; padding: 0 3px; font-size: 11px; color: var(--st-blue); }

/* ---------- Timeline ---------- */
.tl { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 0; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 27px; height: 27px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; flex: none; color: var(--ink-2); z-index: 1;
}
.tl-dot.agent { background: var(--st-violet-bg); color: var(--st-violet); border-color: transparent; }
.tl-dot.fire { background: var(--fire-soft); color: var(--fire-deep); border-color: transparent; }
.tl-body { font-size: 13px; padding-top: 4px; min-width: 0; }
.tl-body .who { font-weight: 500; }
.tl-body .when { color: var(--ink-3); font-size: 11.5px; margin-left: 6px; }
.tl-body .what { color: var(--ink-2); margin-top: 1px; }

/* ---------- State blocks ---------- */
.state-block { padding: 48px 24px; text-align: center; color: var(--ink-2); }
.state-block .sb-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; background: var(--surface-2);
  display: grid; place-items: center; color: var(--ink-3);
}
.state-block.error .sb-icon { background: var(--st-red-bg); color: var(--st-red); }
.state-block.offline .sb-icon { background: var(--st-amber-bg); color: var(--st-amber); }
.state-block h4 { margin: 0 0 4px; font-size: 14.5px; color: var(--ink); }
.state-block p { margin: 0 0 14px; font-size: 13px; max-width: 380px; margin-inline: auto; }
.skel { border-radius: var(--r-1); background: linear-gradient(100deg, var(--surface-2) 40%, var(--surface-3) 50%, var(--surface-2) 60%); background-size: 200% 100%; animation: skel 1.2s infinite linear; }
@keyframes skel { from { background-position: 120% 0; } to { background-position: -80% 0; } }
.readonly-banner, .denied-banner {
  display: flex; gap: 9px; align-items: center; padding: 9px 14px; border-radius: var(--r-2);
  font-size: 12.5px; margin-bottom: 14px;
}
.readonly-banner { background: var(--st-amber-bg); color: var(--st-amber); }
.denied-banner { background: var(--st-red-bg); color: var(--st-red); }

/* ---------- Drawer / modal ---------- */
.overlay { position: fixed; inset: 0; background: oklch(0.2 0.01 60 / 0.42); z-index: 200; display: flex; }
.drawer {
  margin-left: auto; width: min(560px, 94%); background: var(--surface); height: 100%;
  box-shadow: var(--sh-pop); display: flex; flex-direction: column; animation: slidein var(--t-med) var(--ease);
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-h h3 { margin: 0; font-size: 15px; }
.drawer-b { padding: 18px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }
.modal {
  /* `visibility`/`pointer-events` set explicitly: the console bundles DaisyUI
     (Tailwind), whose own `.modal` component (an unrelated dialog pattern,
     gated on `.modal-open`/`[open]`/`:target`) also targets this class name
     and defaults to `visibility:hidden; pointer-events:none`. Since this rule
     doesn't otherwise set those two properties, DaisyUI's declaration was the
     only one in play and won — the panel laid out correctly (right size,
     position, z-index) but never actually painted or accepted clicks. This
     rule is NOT in a `@layer`, so it already beats DaisyUI's layered
     declarations for every property it DOES set (R1 follow-up fix). */
  margin: auto; width: min(640px, 94%); max-height: 90vh; background: var(--surface); border-radius: var(--r-4);
  box-shadow: var(--sh-pop); display: flex; flex-direction: column; animation: pop var(--t-med) var(--ease);
  visibility: visible; pointer-events: auto;
}
@keyframes pop { from { transform: scale(0.97) translateY(8px); opacity: 0; } }

/* ---------- Command palette ---------- */
.cmdk { margin: 12vh auto auto; width: min(620px, 94%); background: var(--surface); border-radius: var(--r-4); box-shadow: var(--sh-pop); overflow: hidden; animation: pop var(--t-med) var(--ease); }
.cmdk input { width: 100%; border: none; outline: none; font: 400 15px var(--font-sans); padding: 16px 18px; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); }
.cmdk .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); padding: 10px 18px 4px; }
.cmdk .item { display: flex; align-items: center; gap: 10px; padding: 9px 18px; font-size: 13.5px; cursor: pointer; }
.cmdk .item:hover, .cmdk .item.hl { background: var(--fire-soft); }
.cmdk .item .k { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.cmdk-foot { display: flex; gap: 14px; padding: 8px 18px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 11px; color: var(--ink-3); }

/* ---------- Planning board ---------- */
.plan-grid { display: grid; grid-template-columns: 168px repeat(5, 1fr); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; background: var(--surface); min-width: 880px; }
.plan-scroll { overflow-x: auto; }
.plan-hcell { background: var(--surface-2); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 8px 10px; font-size: 12px; font-weight: 600; text-align: center; }
.plan-hcell .d { display: block; font-size: 10.5px; color: var(--ink-3); font-weight: 500; }
.plan-hcell.today { background: var(--fire-soft); color: var(--fire-deep); }
.plan-tech { display: flex; align-items: center; gap: 9px; padding: 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; }
.plan-tech .cap { margin-left: auto; }
.plan-cell { border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px; min-height: 86px; display: flex; flex-direction: column; gap: 4px; }
.plan-cell.today-col { background: oklch(0.97 0.012 50); }
.plan-cell.dragover { background: var(--fire-soft); outline: 2px dashed var(--fire-line); outline-offset: -3px; }
.mblock {
  border-radius: var(--r-1); padding: 5px 7px; font-size: 11px; line-height: 1.3; cursor: grab;
  border-left: 3px solid; background: var(--surface); box-shadow: var(--sh-1); border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  user-select: none;
}
.mblock:active { cursor: grabbing; }
.mblock .mb-t { font-weight: 600; font-size: 10px; font-family: var(--font-mono); color: var(--ink-3); display: flex; justify-content: space-between; }
.mblock.k-verification { border-left-color: var(--st-blue); }
.mblock.k-maintenance { border-left-color: var(--st-teal); }
.mblock.k-installation { border-left-color: var(--st-violet); }
.mblock.k-depannage { border-left-color: var(--st-red); background: var(--st-red-bg); }
.mblock.k-formation { border-left-color: var(--st-amber); }
.mblock.absence { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 6px, var(--surface) 6px, var(--surface) 12px); border-left-color: var(--ink-3); color: var(--ink-2); cursor: default; }
.cap-gauge { width: 46px; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.cap-gauge i { display: block; height: 100%; border-radius: 4px; background: var(--st-green); }
.cap-gauge.warn i { background: var(--st-amber); } .cap-gauge.over i { background: var(--st-red); }

/* ---------- Kanban ---------- */
.kb { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kb-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-3); padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.kb-col.dragover { background: var(--fire-soft); outline: 2px dashed var(--fire-line); outline-offset: -3px; }
.kb-col-h { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 2px 6px; }
.kb-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: 9px 11px; font-size: 12.5px; box-shadow: var(--sh-1); cursor: pointer; }
.kb-card:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); }

/* ---------- Avatars ---------- */
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--ink-2); font-size: 10.5px; font-weight: 600; flex: none; border: 1px solid var(--line); }
.av.lg { width: 36px; height: 36px; font-size: 13px; }
.av.agent { background: var(--st-violet-bg); color: var(--st-violet); }
.av.photo { overflow: hidden; padding: 0; }
.av.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.av-stack { display: flex; } .av-stack .av { margin-left: -7px; box-shadow: 0 0 0 2px var(--surface); } .av-stack .av:first-child { margin-left: 0; }

/* ---------- Diff / approval cards ---------- */
.diff-line { display: grid; grid-template-columns: 1fr 1fr; gap: 0; font-size: 12.5px; border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.diff-line .old { background: var(--st-red-bg); padding: 8px 11px; text-decoration: line-through; color: var(--st-red); }
.diff-line .new { background: var(--st-green-bg); padding: 8px 11px; color: var(--st-green); }
.approval { border: 1px solid var(--st-violet); border-left-width: 3px; }

/* ---------- Provenance ---------- */
.prov { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--st-blue); background: var(--st-blue-bg); border-radius: var(--r-full); padding: 1.5px 8px; cursor: pointer; white-space: nowrap; }
.prov:hover { text-decoration: underline; }

/* ---------- Review bar ---------- */
.rb {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 1000;
  background: oklch(0.18 0.01 280); color: oklch(0.92 0.005 280); border-radius: 14px;
  box-shadow: var(--sh-pop); display: flex; align-items: center; gap: 4px; padding: 6px 8px;
  font-family: var(--font-mono); font-size: 11px; flex-wrap: wrap; max-width: 96vw;
}
.rb .rb-tag { padding: 2px 7px; opacity: 0.55; letter-spacing: 0.04em; }
.rb select {
  background: oklch(0.26 0.012 280); color: inherit; border: 1px solid oklch(0.34 0.015 280);
  border-radius: 7px; font: inherit; padding: 4px 6px; cursor: pointer; max-width: 150px;
}
.rb .rb-bp { display: flex; gap: 2px; }
.rb .rb-bp button {
  background: oklch(0.26 0.012 280); border: 1px solid oklch(0.34 0.015 280); color: inherit;
  font: inherit; padding: 4px 8px; cursor: pointer; border-radius: 7px;
}
.rb .rb-bp button.on { background: var(--fire); border-color: var(--fire); color: white; }
.rb .rb-min { background: none; border: none; color: inherit; cursor: pointer; opacity: 0.6; font: inherit; padding: 4px 7px; }
.rb.min { padding: 4px; gap: 0; }

/* ---------- Tech app ---------- */
.tech-shell { max-width: 100%; min-height: 100vh; background: var(--paper); display: flex; flex-direction: column; }
.tech-top {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--coal); color: white;
  position: sticky; top: 0; z-index: 50;
}
.tech-top .sync { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 12px; }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-full); padding: 4px 11px; font-size: 11.5px; font-weight: 600; }
.sync-pill.ok { background: oklch(0.35 0.06 150); color: oklch(0.9 0.06 150); }
.sync-pill.pending { background: oklch(0.4 0.07 85); color: oklch(0.93 0.07 90); }
.sync-pill.offline { background: oklch(0.38 0.02 60); color: oklch(0.88 0.01 60); }
.tech-body { flex: 1; padding: 16px; padding-bottom: 92px; max-width: 900px; width: 100%; margin: 0 auto; }
.tech-tabbar {
  position: sticky; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tech-tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: var(--touch);
  justify-content: center; font-size: 10.5px; color: var(--ink-3); border-radius: var(--r-2); text-decoration: none;
}
.tech-tabbar a.on { color: var(--fire-deep); background: var(--fire-soft); }
.tech-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--sh-1); }
.tech-row { display: flex; align-items: center; gap: 12px; min-height: var(--touch); padding: 12px 14px; }
.offline-note { display: flex; gap: 8px; align-items: flex-start; background: var(--st-amber-bg); color: var(--st-amber); border-radius: var(--r-2); padding: 9px 12px; font-size: 12px; margin-top: 12px; }
.check-pt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.check-pt .pt-actions { margin-left: auto; display: flex; gap: 6px; }
.pt-btn {
  min-width: var(--touch); min-height: var(--touch); border-radius: var(--r-2); border: 1.5px solid var(--line-strong);
  background: var(--surface); font: 600 13px var(--font-sans); cursor: pointer; color: var(--ink-2); padding: 0 14px;
}
.pt-btn.ok.on { background: var(--st-green-bg); border-color: var(--st-green); color: var(--st-green); }
.pt-btn.nok.on { background: var(--st-red-bg); border-color: var(--st-red); color: var(--st-red); }
.pt-btn.na.on { background: var(--surface-3); border-color: var(--ink-3); color: var(--ink); }
.sig-pad { border: 1.5px dashed var(--line-strong); border-radius: var(--r-3); height: 170px; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; background: white; touch-action: none; }

/* ---------- Misc ---------- */
.hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; }
.section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); font-weight: 600; margin: 22px 0 9px; }

/* ---------- Fiche personne (Round 10, app2.css) ---------- */
.profile-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.profile-hero > .av { flex: none; }
.profile-hero-main { flex: 1; min-width: 200px; }
.profile-hero-main h1 { line-height: 1.15; }
.profile-hero-meta { display: flex; gap: 18px; margin-top: 10px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.profile-hero-meta a { color: var(--ink-2); }
.profile-hero-meta a:hover { color: var(--fire); }
.profile-hero-actions { display: flex; gap: 8px; align-items: center; }
@media (max-width: 760px) { .profile-hero { flex-wrap: wrap; } .profile-hero-actions { width: 100%; } .profile-hero-actions .btn { flex: 1; } }
.toast-stack { position: fixed; bottom: 70px; right: 18px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--coal); color: white; border-radius: var(--r-3); padding: 11px 16px; font-size: 13px; box-shadow: var(--sh-pop); display: flex; gap: 9px; align-items: center; animation: pop var(--t-med) var(--ease); max-width: 380px; }
.placeholder-img {
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 8px, var(--surface-3) 8px, var(--surface-3) 9px);
  border: 1px solid var(--line); border-radius: var(--r-2); display: grid; place-items: center;
  color: var(--ink-3); font-family: var(--font-mono); font-size: 11px; min-height: 80px; text-align: center; padding: 8px;
}
.wip-banner { display: flex; gap: 9px; align-items: center; background: var(--st-violet-bg); color: var(--st-violet); border-radius: var(--r-2); padding: 9px 14px; font-size: 12.5px; margin-bottom: 16px; }
.wire-block { border: 1.5px dashed var(--line-strong); border-radius: var(--r-2); padding: 14px; color: var(--ink-3); font-size: 12.5px; background: var(--surface); }
.wire-block b { color: var(--ink-2); display: block; margin-bottom: 3px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }

/* ============================================================
   Ported from app2.css (scope, filtres, carte, assignation,
   tâches, catalogue, admin, calendrier)
   ============================================================ */

/* ---------- Scope switcher ---------- */
.scope { position: relative; }
.scope-btn {
  display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-2); padding: 6px 10px;
  font: 500 12.5px var(--font-sans); color: var(--ink); cursor: pointer; max-width: 240px;
}
.scope-btn:hover { border-color: var(--line-strong); }
.scope-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 120; width: 300px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  box-shadow: var(--sh-pop); overflow: hidden; animation: pop var(--t-fast) var(--ease);
}
.scope-menu-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); padding: 10px 14px 4px; font-weight: 600; }
.scope-opt { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; padding: 8px 14px; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.scope-opt:hover { background: var(--surface-2); }
.scope-opt.on { background: var(--fire-soft); }
.scope-opt.in { padding-left: 30px; }
.scope-opt b { font-size: 13px; font-weight: 500; display: block; }
.scope-sub { font-size: 11px; color: var(--ink-3); }
.scope-chk { margin-left: auto; color: var(--fire); }
.scope-menu-f { font-size: 11px; color: var(--ink-3); padding: 8px 14px; border-top: 1px solid var(--line); background: var(--surface-2); }
@container vp (max-width: 720px) { .scope-lbl { display: none; } .scope-btn { max-width: none; } }

/* Scope switcher — variante sidebar (sous le nom du tenant) */
.bo-scope-wrap { padding: 0 12px 12px; }
.scope-side { display: block; }
.scope-side .scope-btn {
  width: 100%; max-width: none; background: oklch(0.28 0.012 45); border-color: oklch(0.34 0.014 45);
  color: oklch(0.9 0.005 70); padding: 8px 11px; justify-content: flex-start;
}
.scope-side .scope-btn:hover { background: oklch(0.32 0.014 45); border-color: oklch(0.4 0.02 45); }
.scope-side .scope-lbl { flex: 1; display: block; text-align: left; }
.scope-side .scope-btn .ic:last-child { opacity: 0.6; }
.scope-side .scope-menu { width: calc(100% - 0px); left: 0; right: 0; }

/* ---------- Topbar avatar menu (2026-07-20) ---------- */
.avatar-menu { position: relative; }
.avatar-menu-btn { background: none; border: none; padding: 0; line-height: 0; cursor: pointer; border-radius: 50%; }
.avatar-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 120; width: 190px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3);
  box-shadow: var(--sh-pop); overflow: hidden; animation: pop var(--t-fast) var(--ease);
}
.avatar-menu.open .avatar-dropdown { display: block; }
.avatar-dropdown-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px; font-size: 12.5px;
  color: var(--ink); text-decoration: none; cursor: pointer;
}
.avatar-dropdown-item:hover { background: var(--surface-2); }
.avatar-dropdown-item.danger { color: var(--st-red); }

/* ---------- Assignee ---------- */
.assignee { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.assignee-ic { width: 22px; height: 22px; border-radius: 6px; background: var(--st-teal-bg); color: var(--st-teal); display: inline-grid; place-items: center; flex: none; }
.assign-pop, .filter-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 130; width: 300px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-3);
  box-shadow: var(--sh-pop); padding: 10px; animation: pop var(--t-fast) var(--ease);
}
.assign-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.assign-opt { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: none; padding: 7px 8px; border-radius: var(--r-2); cursor: pointer; font: inherit; }
.assign-opt:hover { background: var(--surface-2); }

/* ---------- Filter bar ---------- */
.filterbar { margin-bottom: 12px; }
.fchip.add { border-style: dashed; color: var(--ink-2); }
.fchip.clear { color: var(--st-red); border-color: transparent; }
.filter-pop { width: 320px; }
.filter-row { display: flex; gap: 6px; margin-bottom: 6px; }
.filter-row .select:first-child { flex: 1; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px; background: var(--coal); color: var(--ink-inv);
  border-radius: var(--r-full); padding: 3px 6px 3px 11px; font-size: 11.5px;
}
.filter-chip .op { opacity: 0.6; }
.filter-chip button { border: none; background: oklch(0.4 0.02 45); color: white; width: 17px; height: 17px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }

/* ---------- Map panel ---------- */
.mappanel { position: relative; border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; background: oklch(0.95 0.01 190); }
.map-bg { position: absolute; inset: 0;
  background-image:
    linear-gradient(oklch(0.9 0.02 150 / 0.5) 0, transparent 1px),
    radial-gradient(circle at 30% 40%, oklch(0.9 0.03 150) 0 22%, transparent 23%),
    radial-gradient(circle at 72% 60%, oklch(0.92 0.02 90) 0 18%, transparent 19%),
    repeating-linear-gradient(38deg, transparent 0 34px, oklch(0.88 0.01 60 / 0.5) 34px 36px),
    repeating-linear-gradient(-52deg, transparent 0 60px, oklch(0.88 0.01 60 / 0.4) 60px 61px);
  background-color: oklch(0.955 0.012 160);
}
.map-attr { position: absolute; bottom: 6px; right: 8px; font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-3); background: oklch(1 0 0 / 0.6); padding: 1px 6px; border-radius: 4px; }
.map-pin { position: absolute; transform: translate(-50%, -100%); border: none; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.map-pin .pin-dot { width: 15px; height: 15px; border-radius: 50% 50% 50% 0; transform: rotate(45deg); background: var(--st-blue); box-shadow: var(--sh-2); border: 2px solid white; }
.map-pin.red .pin-dot { background: var(--st-red); } .map-pin.amber .pin-dot { background: var(--st-amber); }
.map-pin.green .pin-dot { background: var(--st-green); } .map-pin.violet .pin-dot { background: var(--st-violet); }
.map-pin .pin-n { position: absolute; top: 0; color: white; font-size: 9px; font-weight: 700; width: 15px; height: 15px; display: grid; place-items: center; }
.map-pin .pin-label { font-size: 10.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; margin-top: 3px; white-space: nowrap; opacity: 0; transition: opacity var(--t-fast); box-shadow: var(--sh-1); pointer-events: none; }
.map-pin:hover .pin-label, .map-pin.sel .pin-label { opacity: 1; }
.map-pin.sel .pin-dot { outline: 3px solid var(--fire-line); outline-offset: 1px; }

/* ---------- Tasks ---------- */
.task-row { display: flex; gap: 11px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.task-row:hover { background: var(--surface-2); }
.task-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong); flex: none; cursor: pointer; display: grid; place-items: center; background: var(--surface); color: transparent; }
.task-check.done { background: var(--st-green); border-color: var(--st-green); color: white; }
.task-row.done .task-title { text-decoration: line-through; color: var(--ink-3); }
.task-title { flex: 1; }
.prio-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.prio-high { background: var(--st-red); } .prio-med { background: var(--st-amber); } .prio-low { background: var(--line-strong); }

/* calendar — MyCalendar full-height Google-Calendar-style day grid.
   Missions/tasks and a WHOLE-DAY Absence stay DATE-granular (no mission
   time in core v1 — see MyCalendarLive's moduledoc) and stack top-down,
   flow layout, in `.cal-daycol-allday`. A TIMED Absence (core follow-up:
   optional Absence.start_time/end_time) is absolutely positioned by real
   clock time inside `.cal-daycol-timed`, which carries the 8h-18h
   decorative gridline band (`top`/`height` computed as % of that
   10-hour span — MyCalendarLive.timed_style/1). */
.cal-wrap { height: calc(100vh - 250px); min-height: 520px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; background: var(--surface); }
.cal-scroll { flex: 1; overflow: auto; display: flex; }
.cal-grid { display: flex; flex: 1; min-width: 0; }
.cal-gutter { flex: 0 0 44px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface-2); }
.cal-gutter-pad { height: 40px; flex: none; border-bottom: 1px solid var(--line); }
.cal-gutter-hours { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 2px 6px 2px 0; }
.cal-gutter-hours span { font-size: 9.5px; color: var(--ink-3); font-family: var(--font-mono); text-align: right; }
.cal-daycol { flex: 1; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.cal-daycol:last-child { border-right: none; }
.cal-daycol.today-col { background: oklch(0.97 0.012 50); }
.cal-daycol.dragover { background: var(--fire-soft); outline: 2px dashed var(--fire-line); outline-offset: -3px; }
.cal-daycol-h { height: 40px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 12px; font-weight: 600; }
.cal-daycol-h.today { background: var(--fire-soft); color: var(--fire-deep); }
.cal-daycol-h .d { display: block; font-size: 10.5px; color: var(--ink-3); font-weight: 500; }
.cal-add { border: 1px dashed var(--line-strong); background: none; border-radius: 6px; width: 20px; height: 20px; line-height: 1; font-size: 13px; color: var(--ink-2); cursor: pointer; flex: none; padding: 0; }
.cal-add:hover { background: var(--surface-3); }
.cal-daycol-body { flex: 1; min-height: 160px; display: flex; flex-direction: column; }
.cal-daycol-allday { padding: 8px 8px 4px; display: flex; flex-direction: column; gap: 6px; }
.cal-daycol-timed {
  flex: 1; min-height: 160px; position: relative; margin: 0 8px 8px;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 100% 20%; background-repeat: repeat-y;
  cursor: copy; /* empty timed space is clickable → « Nouvelle mission » */
}
.cal-daycol-timed:hover { background-color: var(--st-blue-bg); }
.cal-empty { font-size: 11px; color: var(--ink-3); text-align: center; padding-top: 10px; }
.cal-ev { border-radius: var(--r-1); padding: 4px 7px; font-size: 10.5px; line-height: 1.3; border-left: 3px solid; background: var(--surface); box-shadow: var(--sh-1); cursor: pointer; position: relative; }
.cal-ev[draggable="true"] { cursor: grab; }
.cal-ev[draggable="true"]:active { cursor: grabbing; }
.cal-ev.task { border-left-color: var(--st-violet); background: var(--st-violet-bg); }
.cal-ev.mission { border-left-color: var(--st-blue); }
.cal-ev.absence { border-left-color: var(--st-amber); background: var(--st-amber-bg); }
.cal-ev.timed { position: absolute; left: 2px; right: 2px; overflow: hidden; }
.cal-ev-time { display: block; font-size: 9.5px; color: var(--ink-3); }
.cal-legend { flex: none; display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 11.5px; color: var(--ink-2); }

/* ---------- Catalogue / admin bits ---------- */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-2); padding: 2px; gap: 2px; }
.seg button { border: none; background: none; font: 500 12.5px var(--font-sans); padding: 5px 12px; border-radius: 5px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.perm-matrix { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.perm-matrix th { text-align: center; padding: 8px 6px; font-size: 11px; color: var(--ink-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.perm-matrix th.first, .perm-matrix td.first { text-align: left; width: 46%; }
.perm-matrix td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.perm-matrix tr:hover { background: var(--surface-2); }
.perm-grp td { background: var(--surface-2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.tick { width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; cursor: pointer; }
.tick.on { background: var(--st-green-bg); color: var(--st-green); }
.tick.off { background: var(--surface-3); color: transparent; }
.toggle { width: 38px; height: 22px; border-radius: 12px; background: var(--surface-3); border: none; cursor: pointer; position: relative; transition: background var(--t-fast); flex: none; }
.toggle.on { background: var(--st-green); }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: white; transition: left var(--t-fast); box-shadow: var(--sh-1); }
.toggle.on::after { left: 18px; }
.split-price { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 14px; align-items: center; font-size: 13px; }

/* margin bar */
.margin-bar { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.margin-bar i { display: block; height: 100%; }

/* ---------- Dashboard — FlowPipeline (flux d'or, Phase 3b) ---------- */
.fp-step { flex: 1 0 120px; text-decoration: none; color: inherit; padding: 14px 12px; border-radius: 8px; margin: 6px; display: block; }
.fp-step:hover { background: var(--surface-2); }
.fp-step .fp-label { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
.fp-step .fp-count { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.fp-step .fp-sub { font-size: 11px; color: var(--ink-3); }
.fp-step.warn .fp-count, .fp-step.warn .fp-sub { color: var(--st-red); }

/* ============================================================
   PYROLIS — client portal (rounds 20 & 21)
   Upstream:
     design/project/src/components/app2.css   (rules)
     design/project/src/surfaces/app/round20.jsx  (Commander/Panier/
       Mes commandes screens — the portal-only components: PortalShop,
       PortalCart, PortalOrderSent, PortalOrders)
     design/project/src/surfaces/app/round21.jsx  (Accueil/Sites/
       Rapports/Demandes screens)
     design/project/src/surfaces/other.jsx  (PortalShellSoft — the
       shell those two rounds render inside, in the prototype)
   If you touch a `pshell-*`/`soft-*`/`ph-*`/`ps-*`/`pr-*`/`pq-*`/
   `shop-*`/`cart-*`/`ord-*` rule here, change app2.css too (or note
   why not) — five of the round-20/21 screens share `soft-*` alone.

   `app2.css` also serves console rounds. Left behind, deliberately:
     - `.oc-*`, `.pricing-*`, `.pub-*`, `.ged-*`, `.del-*`, `.te-*` —
       console-only (OrderCreate, PricingCard, catalogue publish
       toggle, DeliveryBlocked): no round-20/21 portal markup uses them.
     - `.ph-cell/.ph-del/.ph-meta/.ph-add/.ph-empty` and bare `.ps`/
       `.ps-m` — an unrelated console pair (equipment photo gallery;
       obligation/progress-strip ticks) that happens to share the
       `ph-`/`ps-` prefix with the portal classes below. Not the same
       feature; not ported.
     - `.ph-ring` / `.ph-facts` — an earlier "Accueil" hero (a ring
       chart) superseded by the `.ph-head`/`.ph-track`/`.ph-year` hero
       round21.jsx actually renders. app2.css keeps both (a second
       `.ph-hero { display: block; }` overrides the first, later in
       the cascade); only the surviving, effective declaration is
       ported below, merged into one rule.
     - `.row` — round20.jsx pairs it with inline `style={{ gap: ... }}`
       (PortalOrderSent, ClientOrders), but no `.row` rule exists in
       either app.css or app2.css upstream — `gap` alone does nothing
       without `display:flex`/`grid`. Looks like a pre-existing gap in
       the prototype itself; not invented here, since there's nothing
       to port.
     - `.linklike` (round20.jsx: PortalShop, PortalOrders) isn't under
       any of the nine prefixes above but the markup needs it, so it's
       included below anyway.

   Custom properties: every var() below already resolves against
   tokens.css (--fire, --fire-deep, --fire-soft, --coal, --paper,
   --surface*, --line*, --ink*, --st-*, --r-*, --font-mono). None
   missing — nothing here was invented.

   Breakpoint note: app2.css scopes portal narrow-viewport rules
   partly via `@container vp (max-width: 720px)` and partly via plain
   `@media (max-width: 720px)` for the very same 720px cut (compare
   its "coque responsive" section vs. its "Accueil/site/rapports"
   section) — upstream itself is inconsistent here. `@container vp`
   needs an ancestor with `container-type: inline-size;
   container-name: vp`; the back-office shell supplies that via
   `.app-viewport`, but the portal shell (portal.ex) supplies no such
   ancestor for ANY class below, `.pshell` included. Ported as literal
   `@container vp` these rules would be silently inert — so, matching
   the pattern app2.css itself already uses in half these cases, every
   720px rule below is `@media`, not `@container`.
   ============================================================ */

/* ---------- Soft language: shared bits ---------- */
.soft-wrap { max-width: 940px; margin: 0 auto; padding: 4px 0 40px; }
.soft-h1 { font-size: 26px; margin: 0 0 6px; }
.soft-h2 { font-size: 15px; margin: 26px 0 11px; }
.soft-lead { color: var(--ink-2); font-size: 14px; line-height: 1.55; margin: 0 0 18px; max-width: 620px; }
.soft-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 30px; padding: 8px 15px; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.soft-chip.on { background: var(--coal); color: #fff; border-color: var(--coal); }
.soft-empty { grid-column: 1 / -1; text-align: center; padding: 40px 0; color: var(--ink-3); font-size: 13.5px; }
.soft-done { text-align: center; padding: 34px 20px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); }
.soft-done-ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; background: var(--st-green-bg); color: var(--st-green); display: grid; place-items: center; }
.soft-flow { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.soft-step { font-size: 11.5px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 20px; padding: 4px 11px; }
.soft-step.on { border-color: var(--fire); color: var(--fire-deep); background: var(--fire-soft); font-weight: 600; }
.soft-back { display: inline-flex; align-items: center; gap: 6px; border: none; background: none; font: inherit; font-size: 12.5px; color: var(--ink-3); cursor: pointer; padding: 0 0 12px; }
.soft-back:hover { color: var(--fire); }
.soft-note { font-size: 12px; color: var(--ink-3); margin: 10px 0 0; }
.linklike { border: none; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.linklike:hover { color: var(--fire); }

/* ---------- Boutique & commandes (round 20) ---------- */
.shop-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-3); background: var(--st-green-bg); color: var(--st-teal); font-size: 13px; line-height: 1.5; margin-bottom: 16px; }
.shop-note.quote { background: var(--st-blue-bg); color: var(--st-blue); }
.shop-bar { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.shop-search { display: flex; align-items: center; gap: 9px; flex: 1 1 260px; min-width: 200px; border: 1px solid var(--line-strong); border-radius: 30px; padding: 0 15px; background: var(--surface); color: var(--ink-3); }
.shop-search input { flex: 1; border: none; background: none; font: inherit; font-size: 14px; padding: 11px 0; color: var(--ink); outline: none; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.shop-card { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; }
.shop-card.in { border-color: var(--fire); box-shadow: 0 0 0 3px var(--fire-soft); }
.shop-img { height: 96px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--surface-3) 8px 16px); display: grid; place-items: center; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }
.shop-body { padding: 13px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.shop-body b { font-size: 14px; }
.shop-body p { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin: 5px 0 9px; flex: 1; }
.shop-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 11px; }
.shop-foot { display: flex; align-items: center; gap: 10px; }
.shop-price { flex: 1; min-width: 0; }
.shop-price b { display: block; font-size: 17px; }
.shop-price b.ask { font-size: 13.5px; color: var(--st-blue); }
.shop-price i { display: block; font-style: normal; font-size: 10.5px; color: var(--ink-3); }
.shop-qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--fire); border-radius: 30px; overflow: hidden; }
.shop-qty button { width: 32px; height: 32px; border: none; background: var(--fire-soft); font: inherit; font-size: 17px; line-height: 1; color: var(--fire-deep); cursor: pointer; }
.shop-qty b { min-width: 30px; text-align: center; font-size: 13.5px; }
.shop-qty.sm button { width: 26px; height: 26px; font-size: 15px; }
.shop-cart { position: sticky; bottom: 16px; display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 20px; padding: 14px 18px; border: none; border-radius: 30px; background: var(--coal); color: #fff; font: inherit; font-size: 14px; cursor: pointer; box-shadow: 0 8px 26px rgba(0,0,0,.22); }
.shop-cart-n { width: 26px; height: 26px; border-radius: 50%; background: var(--fire); font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }
.cart-lines { border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.cart-line { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: none; }
.cart-line b { font-size: 13px; }
.cart-sum { width: 84px; text-align: right; font-size: 13.5px; font-weight: 500; }
.cart-opt { display: flex; gap: 11px; align-items: flex-start; padding: 12px 13px; border-radius: var(--r-2); background: var(--surface-2); }
.cart-opt input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--fire); flex: none; }
.cart-opt b { display: block; font-size: 13px; }
.cart-opt i { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-2); line-height: 1.45; }
.cart-tot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.cart-tot > div { display: flex; align-items: baseline; gap: 10px; padding: 4px 0; font-size: 13px; }
.cart-tot > div > span { flex: 1; color: var(--ink-2); }
.cart-tot .big { padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 15px; }
.cart-tot .big b { font-size: 19px; }
.cart-legal { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; margin: 12px 0 0; }
.ord { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.ord.on { border-color: var(--line-strong); }
.ord-h { display: flex; align-items: center; gap: 12px; width: 100%; border: none; background: none; font: inherit; color: var(--ink); cursor: pointer; padding: 14px 16px; }
.ord-h b { display: block; font-size: 14px; }
.ord-h i { display: block; font-style: normal; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.ord-b { padding: 0 16px 16px; }
.ord-flow { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px 0 14px; }
.ord-step { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.ord-step i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.ord-step.past i { background: var(--st-teal); border-color: var(--st-teal); }
.ord-step.past { color: var(--ink-2); }
.ord-step.on i { background: var(--fire); border-color: var(--fire); box-shadow: 0 0 0 3px var(--fire-soft); }
.ord-step.on { color: var(--fire-deep); font-weight: 600; }
.ord-step:not(:last-child)::after { content: ""; width: 14px; height: 1px; background: var(--line-strong); margin-left: 2px; }
.ord-act { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-radius: var(--r-2); background: var(--st-amber-bg); flex-wrap: wrap; }
.ord-act b { display: block; font-size: 13px; }
.ord-act i { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-2); }
.ord-docs { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-2); margin-top: 12px; overflow: hidden; }
.ord-doc { display: flex; align-items: center; gap: 9px; background: var(--surface); padding: 10px 12px; font-size: 12.5px; }
.ord-doc.off { color: var(--ink-3); }
.ord-eta { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-2); background: var(--st-blue-bg); color: var(--st-blue); font-size: 12.5px; }
.ord-eta.partial { background: var(--st-amber-bg); color: var(--st-amber); }
.ord-sign { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12px; color: var(--st-teal); }

/* ---------- Espace client : accueil, site, rapports, demandes (round 21) ---------- */
/* .ph-hero merges app2.css's two upstream declarations for this class
   (an earlier flex/ring-chart hero, later overridden to display:block
   by a second declaration once the .ph-head/.ph-track/.ph-year hero
   replaced it) into the one effective rule — see the "left behind"
   note above for why .ph-ring/.ph-facts aren't ported. */
.ph-hero { display: block; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); }
.ph-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.ph-eyebrow { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.ph-big { display: block; font-size: 22px; line-height: 1.2; margin-top: 3px; }
.ph-big span { font-size: 14px; font-weight: 400; color: var(--ink-2); }
.ph-track { position: relative; height: 10px; border-radius: 20px; background: var(--surface-3); overflow: visible; margin: 0 0 22px; }
.ph-track > i { display: block; height: 100%; border-radius: 20px; background: var(--st-teal); }
.ph-track > span { position: absolute; top: 15px; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--st-teal); white-space: nowrap; }
.ph-year { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.ph-m { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 0 6px; border-radius: var(--r-2); background: var(--surface-2); border: 1px solid transparent; }
.ph-m i { font-style: normal; font-size: 13px; font-weight: 600; line-height: 1; min-height: 13px; color: var(--ink-3); }
.ph-m em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--ink-3); }
.ph-m.done { background: var(--st-green-bg); } .ph-m.done i, .ph-m.done em { color: var(--st-teal); }
.ph-m.todo { background: var(--st-amber-bg); } .ph-m.todo i, .ph-m.todo em { color: var(--st-amber); }
.ph-m.now { background: var(--st-amber-bg); } .ph-m.now i, .ph-m.now em { color: var(--st-amber); }
.ph-m.late { background: var(--st-red-bg); } .ph-m.late i, .ph-m.late em { color: var(--st-red); }
.ph-m.current { border-color: var(--ink-2); }
.ph-leg { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--ink-3); flex-wrap: wrap; }
.ph-leg span { display: inline-flex; align-items: center; gap: 5px; }
.ph-leg .d { width: 9px; height: 9px; border-radius: 3px; }
.ph-leg .d.done { background: var(--st-teal); } .ph-leg .d.todo { background: var(--st-amber); } .ph-leg .d.late { background: var(--st-red); }
.ph-alert { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: var(--r-3); background: var(--st-amber-bg); flex-wrap: wrap; }
.ph-alert-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--surface); color: var(--st-amber); display: grid; place-items: center; }
.ph-alert b { display: block; font-size: 14px; }
.ph-alert i { display: block; font-style: normal; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.ph-next { display: grid; gap: 8px; }
.ph-visit { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; }
.ph-visit:hover { border-color: var(--fire); }
.ph-when { flex: none; width: 48px; text-align: center; }
.ph-when b { display: block; font-size: 20px; line-height: 1; }
.ph-when i { display: block; font-style: normal; font-size: 10.5px; color: var(--ink-3); }
.ph-visit > span b { display: block; font-size: 14px; }
.ph-visit > span i { display: block; font-style: normal; font-size: 12px; color: var(--ink-3); }
.ph-sites { display: grid; gap: 8px; }
.ph-site { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; }
.ph-site:hover { border-color: var(--line-strong); }
.ph-site b { display: block; font-size: 14px; }
.ph-site i { display: block; font-style: normal; font-size: 12px; color: var(--ink-3); }
.ph-bar { display: block; height: 5px; border-radius: 20px; background: var(--surface-3); overflow: hidden; margin-top: 8px; max-width: 260px; }
.ph-bar i { display: block; height: 100%; border-radius: 20px; }
.ps-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.ps-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.ps-facts > div { background: var(--surface); padding: 13px 15px; }
.ps-facts b { display: block; font-size: 21px; line-height: 1.15; text-transform: capitalize; }
.ps-facts span { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.ps-facts > div.bad b { color: var(--st-red); }
.ps-visit { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 15px; border-radius: var(--r-3); background: var(--st-blue-bg); color: var(--st-blue); font-size: 13px; flex-wrap: wrap; }
.ps-eq { border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; }
.ps-row { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.ps-row:last-child { border-bottom: none; }
.ps-row.ko { background: var(--st-red-bg); }
.ps-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--st-red); }
.ps-dot.ok { background: var(--st-teal); }
.ps-row b { display: block; font-size: 13.5px; }
.ps-row i { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.ps-no { flex: none; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.ps-due { flex: none; text-align: right; }
.ps-due b { font-size: 12px; }
.ps-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-top: 22px; }
.ps-docs button { display: flex; align-items: center; gap: 11px; padding: 14px 15px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.ps-docs button:hover { border-color: var(--fire); }
.ps-docs b { display: block; font-size: 13.5px; }
.ps-docs i { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.ps-docs span { flex: 1; min-width: 0; }
.ps-badge { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.ps-badge.ok { background: var(--st-green-bg); color: var(--st-teal); }
.ps-badge.ko { background: var(--st-red-bg); color: var(--st-red); }
.ps-badge.part, .ps-badge.todo { background: var(--st-amber-bg); color: var(--st-amber); }
.pr-list { display: grid; gap: 8px; }
.pr-row { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); flex-wrap: wrap; }
.pr-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; }
.pr-row b { display: block; font-size: 13.5px; }
.pr-row i { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.pr-ask { display: flex; align-items: center; gap: 11px; margin-top: 18px; padding: 13px 15px; border-radius: var(--r-3); background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.pq-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(216px, 1fr)); gap: 10px; }
.pq-kind { padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.pq-kind:hover, .pq-kind.on { border-color: var(--fire); }
.pq-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--fire-soft); color: var(--fire); margin-bottom: 10px; }
.pq-kind b { display: block; font-size: 14px; }
.pq-kind i { display: block; font-style: normal; font-size: 12px; color: var(--ink-2); line-height: 1.45; margin-top: 3px; }
.pq-row { padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); }
.pq-row-h { display: flex; align-items: center; gap: 10px; }
.pq-row-h b { font-size: 13.5px; }
.pq-row > i { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.pq-row p { margin: 9px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; padding-top: 9px; border-top: 1px solid var(--line); }
.pq-contact { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); flex-wrap: wrap; }
.pq-contact b { display: block; font-size: 14px; }
.pq-contact i { display: block; font-style: normal; font-size: 12px; color: var(--ink-3); }

/* ---------- Portal shell chrome (prototype PortalShellSoft, other.jsx) ----------
   Ported for completeness/future reuse. NOT currently referenced:
   PyrolisWeb.Shells.Portal (portal.ex) implements its own header/tab
   row with .btn/.chip and inline styles instead of this markup — see
   that module's moduledoc. Only .pshell-bottom/.pshell-bt would ever
   overlap with the shell's mobile nav, and portal.ex deliberately
   keeps its own classes for that instead (see the fold-in note
   below). */
.pshell { min-height: 100vh; background: var(--paper); container-type: inline-size; container-name: vp; }
.pshell-top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.pshell-bar { max-width: 1040px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 12px; align-items: center; }
.pshell-id { flex: 1; min-width: 0; }
.pshell-id b { display: block; font-size: 14px; }
.pshell-id span { display: block; font-size: 11.5px; color: var(--ink-3); }
.pshell-av { display: none; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 700; place-items: center; }
.pshell-tabs { max-width: 1040px; margin: 0 auto; padding: 0 20px 2px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.pshell-tabs::-webkit-scrollbar { display: none; }
.pshell-tab { flex: none; padding: 9px 13px; font-size: 13px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.pshell-tab:hover { color: var(--ink); }
.pshell-tab.on { color: var(--fire-deep); border-bottom-color: var(--fire); font-weight: 600; }
.pshell-main { max-width: 1040px; margin: 0 auto; padding: 24px 20px 80px; }
.pshell-bottom { display: none; }

/* Narrow-viewport rules for everything above (see the breakpoint note
   at the top of this section for why @media, not @container vp). */
@media (max-width: 720px) {
  .pshell-bar { padding: 10px 14px; }
  .pshell-who { display: none; }
  .pshell-av { display: grid; }
  .pshell-tabs { padding: 0 14px 2px; }
  .pshell-main { padding: 18px 14px 92px; }
  .pshell-bottom { display: flex; position: sticky; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .pshell-bt { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; font-size: 10.5px; min-height: 52px; }
  .pshell-bt.on { color: var(--fire); font-weight: 700; }
  .soft-h1 { font-size: 21px; }
  .soft-lead { font-size: 13.5px; }
  .soft-h2 { margin: 22px 0 10px; }
  .soft-done { padding: 26px 16px; }
  .ph-hero { padding: 16px; }
  .ph-year { grid-template-columns: repeat(6, 1fr); }
  .ph-big { font-size: 19px; }
  .ps-row { flex-wrap: wrap; }
  .ps-due { text-align: left; width: 100%; padding-left: 20px; }
  .shop-grid { grid-template-columns: 1fr; }
  .shop-bar { gap: 6px; }
  .shop-search { flex-basis: 100%; }
  .shop-cart { bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 35; padding: 13px 16px; }
  .shop-qty button { width: 44px; height: 44px; }
  .shop-qty b { min-width: 36px; font-size: 15px; }
  .shop-qty.sm button { width: 44px; height: 44px; }
  .cart-line { flex-wrap: wrap; }
  .cart-sum { width: auto; margin-left: auto; }
  .ord-h { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .ord-h b.num { order: 3; }
  .ord-b { padding: 0 14px 14px; }
  .ord-flow { gap: 8px; }
  .ord-step:not(:last-child)::after { display: none; }
  .ord-act { flex-direction: column; align-items: stretch; }
  .ord-act .btn { width: 100%; }
}

/* ---------- Shell — mobile bottom nav (folded in from portal.ex's
   embedded <style>, Task 2) ----------
   Same job as .pshell-bottom/.pshell-bt above (four destinations,
   sticky bottom bar, shown only under 720px), but portal.ex keeps its
   own class names (portal-bottom-nav / portal-bottom-tab / is-active)
   rather than switching to pshell-bottom/pshell-bt: those only
   activate inside "@container vp", and the portal shell establishes
   no such container (see the breakpoint note above) — literally
   reusing them would silently hide the bar on phones. The shell's own
   tests (portal_test.exs) also assert on these exact class names, so
   renaming would break them for no gain: the two rule sets are
   otherwise identical. */
.portal-bottom-nav { display: none; }
.portal-bottom-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; font-size: 10.5px; color: var(--ink-3); min-height: 52px; }
.portal-bottom-tab.is-active { color: var(--fire); font-weight: 700; }
@media (max-width: 720px) {
  .portal-bottom-nav {
    display: flex;
    position: sticky;
    bottom: 0;
    z-index: 40;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
}
