/* L'Avinir PWA. One palette for chat and dashboards: cream, burgundy, charcoal, warm grey. No gold. */
:root {
  --wine: #5B1A2B;          /* brand + the one anomaly accent per screen */
  --wine-soft: #7A2E40;
  --wine-text: #7A2E40;     /* burgundy used as text/link on the page surface */
  --paper: #F5EEE4;         /* cream */
  --card: #FFFDF9;
  --ink: #221A17;           /* charcoal */
  --ink-2: #4A403B;
  --muted: #7A6F68;
  --line: #E4DACD;          /* warm grey rules */
  --rule: #CFC4B6;
  --user: #EADBC8;
  --fill-2: #A1958B;        /* secondary data mark (warm grey) */
  --fill-3: #D9CFC3;
  --high: #9E2A2B;
  --watch: #6B5E55;
  --low: #5F7A61;
  --on-wine: #F5EEE4;
  --serif: "Century Schoolbook", "Century Schoolbook L", "TeX Gyre Schola", "Liberation Serif", "DejaVu Serif", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabs-h: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17110F; --card: #221A17; --ink: #F1E9DF; --ink-2: #D6CCC2; --muted: #A89C93;
    --line: #3A2E29; --rule: #4C3F38; --user: #4A2630; --fill-2: #8C8077; --fill-3: #3F342E;
    --wine-text: #E8A5B4; --high: #E0787E; --watch: #BFB1A6; --low: #9DB89F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #17110F; --card: #221A17; --ink: #F1E9DF; --ink-2: #D6CCC2; --muted: #A89C93;
  --line: #3A2E29; --rule: #4C3F38; --user: #4A2630; --fill-2: #8C8077; --fill-3: #3F342E;
  --wine-text: #E8A5B4; --high: #E0787E; --watch: #BFB1A6; --low: #9DB89F;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 16px/1.45 var(--sans);
  background: var(--paper); color: var(--ink);
  display: flex; flex-direction: column; height: 100dvh; overflow: hidden;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--wine-text); }
button { font: inherit; color: inherit; }
.num, table { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- App bar ---------- */
.bar {
  background: var(--wine); color: var(--on-wine);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.bar h1 { margin: 0; font: 400 20px/1.2 var(--serif); letter-spacing: .3px; }
.bar h1 a { color: inherit; text-decoration: none; }
.bar h1 a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
.bar .sub { margin: 2px 0 0; font-size: 12px; opacity: .8; }
.bar-actions { display: flex; align-items: center; gap: 8px; }
.net { font-size: 12px; background: rgba(255,255,255,.15); padding: 3px 8px; border-radius: 99px; }
.lang { border: 1px solid rgba(245,238,228,.4); background: none; color: var(--on-wine); border-radius: 99px; padding: 3px 10px; font-size: 12px; cursor: pointer; }

main { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; }
#view { padding: 16px 16px calc(var(--tabs-h) + 88px + var(--safe-b)); max-width: 1100px; margin: 0 auto; }

/* ---------- Tabs + chat button ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; border-top: 1px solid var(--line); background: var(--card); padding-bottom: var(--safe-b);
}
.tabs a {
  flex: 1; min-width: 0; text-align: center; text-decoration: none; color: var(--muted);
  font-size: 12px; padding: 10px 2px 11px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tabs a::before { content: ""; display: block; width: 18px; height: 2px; margin: 0 auto 7px; background: transparent; border-radius: 2px; }
.tabs a.on { color: var(--ink); font-weight: 600; }
.tabs a.on::before { background: var(--wine-text); }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--tabs-h) + 14px + var(--safe-b)); z-index: 21;
  display: flex; align-items: center; gap: 8px; border: 0; border-radius: 99px; cursor: pointer;
  background: var(--wine); color: var(--on-wine); padding: 12px 16px 12px 14px; font-size: 15px;
  box-shadow: 0 6px 20px rgba(34,26,23,.28);
}
.fab svg { width: 20px; height: 20px; }

/* ---------- Type & layout ---------- */
.page-head { margin: 4px 0 18px; }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.page-head h2 { font: 400 28px/1.15 var(--serif); margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
section.block { margin: 30px 0 0; }
.block > h3, .h3 { font: 400 20px/1.2 var(--serif); margin: 0 0 4px; }
.block > .lede { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.footer { margin: 40px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; }
.big { font: 400 44px/1 var(--serif); letter-spacing: -.01em; font-variant-numeric: lining-nums; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.card h4 { margin: 0 0 4px; font-size: 15px; }
.card p { margin: 6px 0 0; font-size: 14px; }
.card.anomaly { border-left: 3px solid var(--wine-text); }
.card.low { opacity: .72; }
.card.ignored { opacity: .65; }
.list { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Buttons & chips ---------- */
.btn { border: 1px solid var(--rule); background: var(--card); color: var(--ink); border-radius: 99px; padding: 7px 14px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn.primary { background: var(--wine); border-color: var(--wine); color: var(--on-wine); }
.btn.ghost { border-color: transparent; background: none; color: var(--wine-text); padding-left: 0; padding-right: 0; }
.btn:disabled { opacity: .45; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip:disabled { opacity: .45; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 99px; overflow: hidden; max-width: 100%; }
.seg button { border: 0; background: none; padding: 7px 14px; font-size: 14px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--ink); color: var(--paper); }
select { font: inherit; font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 6px 8px; max-width: 100%; }
.badge { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; border: 1px solid var(--ink-2); color: var(--ink-2); vertical-align: 2px; white-space: nowrap; }
.badge.adjust, .badge.examine { border-color: var(--wine-text); color: var(--wine-text); }
.tag { display: inline-block; font-size: 12px; color: var(--ink-2); background: var(--fill-3); padding: 2px 8px; border-radius: 4px; margin: 4px 4px 0 0; }
.sev { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sev.act { color: var(--wine-text); }

/* ---------- Provenance chip ---------- */
.prov {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: transparent;
  border-radius: 12px; padding: 1px 8px; font-size: 11.5px; color: var(--muted); cursor: pointer;
  max-width: 100%; text-align: left; vertical-align: middle; line-height: 1.6;
}
.prov .go { flex: none; }
.prov::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--fill-2); flex: none; }
.prov.ledger::before { background: var(--ink); }
.prov.observed::before { background: transparent; border: 1.5px solid var(--ink-2); width: 4px; height: 4px; }
.prov.reported::before { background: var(--fill-2); }
.prov.recalled::before, .prov.estimated::before { background: transparent; border: 1.5px dashed var(--muted); width: 4px; height: 4px; }
.prov.signal::before { background: var(--wine-text); }
.sample { font-size: 12px; color: var(--muted); white-space: nowrap; }
.records .rec { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 8px 0; background: var(--paper); }
.records .rec dl.kv { font-size: 13px; margin-top: 4px; }
.records .rec dd { overflow-wrap: anywhere; }
.records .rec .btn { margin: 4px 0 6px; }

/* ---------- KPI tile ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .v { font: 400 30px/1 var(--serif); font-variant-numeric: lining-nums; }
.kpi .v small { font-size: 16px; color: var(--muted); }
.kpi .l { font-size: 13px; color: var(--ink-2); }

/* ---------- States ---------- */
.state { border: 1px dashed var(--rule); border-radius: 12px; padding: 16px; color: var(--muted); font-size: 14px; background: transparent; }
.state strong { color: var(--ink-2); display: block; margin-bottom: 2px; font-weight: 600; }
.state.v03 { border-style: dotted; }
.skel { height: 14px; border-radius: 6px; background: var(--line); margin: 8px 0; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* ---------- Signal carousel ---------- */
.swipe { display: grid; grid-auto-flow: column; grid-auto-columns: 86%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.swipe::-webkit-scrollbar { display: none; }
.swipe > * { scroll-snap-align: start; }
@media (min-width: 760px) { .swipe { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-columns: auto; } }
.sig .find { font: 400 18px/1.3 var(--serif); margin: 6px 0 10px; }
.fig { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.fig .n { font: 400 26px/1 var(--serif); font-variant-numeric: lining-nums; }

/* ---------- Recommendation card ---------- */
.reco .act { font: 400 17px/1.35 var(--serif); margin: 4px 0 8px; }
.reco ul { margin: 8px 0 0; padding: 0 0 0 18px; font-size: 14px; }
.reco li { margin: 4px 0; }
.reco .impact { font: 400 22px/1 var(--serif); }
.reco .note { font-size: 13px; background: var(--fill-3); border-radius: 8px; padding: 8px 10px; margin-top: 10px; }
.reco .quote { font-size: 13px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 10px; margin: 10px 0 0; }
.status-pill { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.status-pill.accepted, .status-pill.modified { color: var(--low); }

/* ---------- Tables -> cards below 600px ---------- */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; padding: 8px 8px; border-bottom: 1px solid var(--rule); }
table.t td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t td.r, table.t th.r { text-align: right; }
table.t tr.anomaly td:first-child { box-shadow: inset 3px 0 0 var(--wine-text); }
table.t tr.low { opacity: .7; }
table.t tr.sub td { padding-top: 0; font-size: 12.5px; color: var(--muted); border-bottom-style: dashed; }
table.t tr.click { cursor: pointer; }
@media (max-width: 599px) {
  table.t, table.t tbody, table.t tr, table.t td { display: block; width: 100%; }
  table.t thead { display: none; }
  table.t tr { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
  table.t tr.anomaly { box-shadow: inset 3px 0 0 var(--wine-text); }
  table.t tr.anomaly td:first-child { box-shadow: none; }
  table.t tr.sub { margin-top: -12px; border-top: 0; border-radius: 0 0 12px 12px; }
  table.t td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.t td.r { text-align: right; }
  table.t td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; flex: none; max-width: 45%; }
  table.t td.head { font-weight: 600; font-size: 15px; text-align: left; display: block; }
  table.t td.head::before { content: none; }
  table.t td[data-label=""]::before { content: none; }
  table.t td .tv { text-align: right; min-width: 0; }
  table.t td.head .tv { text-align: left; }
}

/* ---------- Allocation matrix ---------- */
.cell { white-space: nowrap; }
.cell .d { font-size: 12px; color: var(--muted); margin-left: 4px; }
.cell .d.up { color: var(--low); font-weight: 600; }
.cell .d.down { color: var(--wine-text); font-weight: 600; }
.score { border: 1px solid var(--rule); background: none; border-radius: 6px; width: 30px; height: 26px; cursor: pointer; font-weight: 700; }
.pname { font-weight: 600; text-decoration: none; color: var(--ink); }
.pmeta { font-size: 12.5px; color: var(--muted); }

/* ---------- Charts ---------- */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font: 11px var(--sans); fill: var(--muted); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--rule); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin: 8px 0 0; }
.legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--ink); vertical-align: 3px; margin-right: 6px; }
.legend i.dot { width: 9px; height: 9px; border: 0; border-radius: 50%; vertical-align: 0; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--paper); font-size: 12.5px; padding: 6px 9px; border-radius: 6px; max-width: 240px; }
.hbar { display: grid; grid-template-columns: minmax(84px, 30%) 1fr auto; gap: 8px; align-items: center; font-size: 13.5px; margin: 8px 0; }
.hbar .track { height: 12px; background: var(--fill-3); border-radius: 0 4px 4px 0; position: relative; min-width: 0; }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); border-radius: 0 4px 4px 0; }
.hbar .fill.cost { background: var(--fill-2); border-radius: 0; }
.gapbar { display: inline-block; width: 70px; height: 8px; background: var(--fill-3); position: relative; vertical-align: middle; border-radius: 2px; }
.gapbar b { position: absolute; top: 0; bottom: 0; background: var(--ink-2); }
.gapbar b.anom { background: var(--wine-text); }
.gapbar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; border-left: 1px solid var(--muted); }

/* ---------- Map ---------- */
.map { width: 100%; height: auto; display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.map .land { fill: var(--fill-3); }
.map .dot { stroke-width: 1.5; cursor: pointer; }
.map .explained { fill: var(--ink); stroke: var(--card); }
.map .under { fill: var(--fill-2); stroke: var(--ink); }
.map .parallel { fill: var(--wine-text); stroke: var(--card); }
.map .unknown { fill: var(--card); stroke: var(--fill-2); }
.map .spontaneous { fill: var(--card); stroke: var(--ink); }
.map .sel { stroke: var(--wine-text); stroke-width: 2.5; }
.lg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1.5px solid; }
.lg-dot.explained { background: var(--ink); border-color: var(--ink); }
.lg-dot.under { background: var(--fill-2); border-color: var(--ink); }
.lg-dot.parallel { background: var(--wine-text); border-color: var(--wine-text); }
.lg-dot.unknown { background: var(--card); border-color: var(--fill-2); }
.lg-dot.spontaneous { background: var(--card); border-color: var(--ink); }

/* ---------- Distribution headline ---------- */
.thesis { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; }
.thesis .n { font: 400 64px/0.95 var(--serif); font-variant-numeric: lining-nums; }
.thesis .l { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.thesis .vs { font: italic 400 16px var(--serif); color: var(--muted); padding-top: 34px; }
.thesis .gap { grid-column: 1 / -1; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.mkt summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.mkt summary::-webkit-details-marker { display: none; }
.mkt .venues { margin: 10px 0 0; padding: 0; list-style: none; font-size: 14px; }
.mkt .venues li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); cursor: pointer; }
.feed-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.stat-label { font-size: 12.5px; color: var(--muted); }

/* ---------- Derivation (Berry Bros proof) ---------- */
.deriv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: stretch; margin-top: 10px; }
.deriv > div { background: var(--paper); border-radius: 10px; padding: 10px; }
.deriv .n { font: 400 26px/1 var(--serif); }
.deriv .l { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.deriv .final { background: var(--ink); color: var(--paper); }
.deriv .final .l { color: var(--paper); opacity: .85; }

/* ---------- Sheets & dialogs ---------- */
dialog { border: 0; border-radius: 16px; padding: 20px; width: min(420px, calc(100vw - 32px)); background: var(--card); color: var(--ink); max-height: 85vh; overflow-y: auto; }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { margin: 0 0 6px; font: 400 20px var(--serif); }
dialog .close { position: absolute; right: 12px; top: 10px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
dialog input, dialog textarea { width: 100%; padding: 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; background: var(--paper); color: var(--ink); }
#gate button[type=submit] { width: 100%; padding: 10px; border: 0; border-radius: 8px; background: var(--wine); color: #fff; cursor: pointer; }
.err { color: var(--high); font-size: 14px; margin: 0 0 8px; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 10px 0 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

/* ---------- Chat sheet ---------- */
.chat-sheet { position: fixed; inset: 0; z-index: 40; background: var(--paper); display: flex; flex-direction: column; }
.chat-sheet[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px 16px; background: var(--wine); color: var(--on-wine); }
.chat-head h2 { margin: 0; font: 400 18px var(--serif); }
.chat-head button { border: 0; background: rgba(255,255,255,.14); color: var(--on-wine); border-radius: 99px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.agent { background: var(--card); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--user); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.err { border-color: var(--high); }
.msg.hl { outline: 2px solid var(--wine-text); outline-offset: 2px; }
.msg a.ent { color: var(--wine-text); text-decoration-style: dotted; text-underline-offset: 3px; }
.typing span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }
.chat-chips { padding: 0 16px 8px; }
.composer { display: flex; gap: 8px; padding: 8px 12px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--paper); }
.composer textarea { flex: 1; resize: none; max-height: 140px; border: 1px solid var(--line); border-radius: 20px; padding: 10px 14px; font: inherit; background: var(--card); color: var(--ink); min-width: 0; }
.composer button { width: 42px; height: 42px; align-self: flex-end; border: 0; border-radius: 50%; background: var(--wine); color: #fff; font-size: 20px; cursor: pointer; flex: none; }
.composer button:disabled { opacity: .4; }
body.chat-open { overflow: hidden; }

@media (min-width: 900px) {
  .split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .page-head h2 { font-size: 34px; }
}

/* ---------- Pilot tenant (Barbou): assumptions, badges, forms ---------- */
.hyp { display: inline-block; margin-left: 6px; vertical-align: middle; font: 600 10px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase;
  color: var(--watch); border: 1px dashed var(--watch); border-radius: 99px; padding: 3px 7px; text-decoration: none; white-space: nowrap; }
.kpi .v .hyp { font-size: 10px; }
.conf { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.conf.certain { color: var(--low); }
.conf.guessing { color: var(--high); }
.acard h4 { margin-top: 6px; }
.acard.hl, .card.hl { outline: 2px solid var(--wine-text); outline-offset: 2px; }
.facts { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; }
.facts li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.facts li:first-child { border-top: 0; }
.facts li > span:first-child { color: var(--ink-2); min-width: 0; }
.aform { margin-top: 10px; display: grid; gap: 10px; }
.field { display: grid; gap: 4px; font-size: 14px; }
.field > span { color: var(--ink-2); }
.field input, .field textarea, .inline-name input { font: inherit; font-size: 15px; color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 7px 9px; width: 100%; min-width: 0; }
.field-row { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.choices { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.inline-name { margin: 8px 0; display: grid; gap: 4px; }
.inline-name .row { display: flex; gap: 8px; }
.card.note, .note-a6 { background: var(--fill-3); border-color: transparent; }
.note-a6 { margin: 12px 0; }
.linkcard { text-decoration: none; color: inherit; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.flag { font-size: 12px; font-weight: 600; color: var(--muted); }
.flag.over { color: var(--high); }
table.srct { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
table.srct td, table.srct th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
table.srct th { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
table.srct .r { text-align: right; }
.tabs a.has-count { position: relative; overflow: visible; }
.tabs a .count { position: absolute; top: 3px; left: calc(50% + 12px); min-width: 17px; padding: 1px 5px; border-radius: 99px; background: var(--wine); color: var(--on-wine); font-size: 10.5px; font-weight: 700; line-height: 1.4; }

/* Pilot tenant: follow-up chips (pro forma · payé · envoyé) and the estate's pricing rule */
.fu { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.fu .chip { padding: 4px 9px; font-size: 12px; }
.card.policy { border-left: 3px solid var(--accent, var(--ink)); }
.card.policy ul { margin: 0 0 8px; padding-left: 18px; }

/* Public profile previews: placeholders say what will fill a cell; they never look like figures. */
.ph { display: inline-block; font: 600 11px/1.6 var(--sans, inherit); letter-spacing: .04em; text-transform: uppercase;
  padding: 1px 8px; border-radius: 99px; border: 1px dashed var(--rule); color: var(--muted); background: transparent; white-space: nowrap; }
.ph.ph-wl { border-style: dotted; }
.ph.ph-you { border-style: solid; color: var(--wine); border-color: var(--wine); }
.kpi .v .ph { font-size: 12px; }
.ph-legend { border-style: dashed; }
.ph-legend .ph { margin: 0 2px; }
.ph-frame { opacity: .9; }
.ph-frame .t td, .ph-frame .t th { border-color: var(--line); }
.ph-seg button:disabled { cursor: default; opacity: .55; }
.facts.wines li.gone strong { text-decoration: line-through; color: var(--muted); }
.fab[hidden] { display: none; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; font-size: 13px; }

/* Instagram: « Ajouter un profil » (views/profile/presence.js) */
.igadd { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 8px 0 4px; }
.igadd label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; }
.igadd label:first-child { flex-basis: 100%; }
.igadd input, .igadd select { font: inherit; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--card); color: var(--ink); min-width: 0; }
.igadd input[name=country] { max-width: 5em; text-transform: uppercase; }

/* Partner pages (ingestion version), one party record, visibility markers, requests */
.card.ingest { border: 1px dashed var(--wine-text); background: none; }
.card.ingest strong { color: var(--wine-text); }
h2.sect { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 22px 0 4px; }
.facts .r { text-align: right; }
.vis { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); white-space: nowrap; }
.vis::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.vis.shared { color: var(--wine-text); }
.vis.shared::before { background: var(--wine-text); }
.vis.private::before { border: 1.5px solid var(--muted); width: 5px; height: 5px; }
.vis-toggle { color: var(--muted); margin-top: 2px; }
#rq-form .field select { font: inherit; font-size: 15px; color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 7px 9px; width: 100%; min-width: 0; }
.kinds { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.kinds .chip input { position: absolute; opacity: 0; pointer-events: none; }
.radios { display: grid; gap: 4px; }
.card.check { border-left: 3px solid var(--rule); }
.card.check.ok { border-left-color: var(--wine-text); }
.card.check.blocked { border-left-color: var(--high); }
.card.check.blocked strong { color: var(--high); }
.card.check p { margin: 4px 0 0; }
.excl td.head { white-space: normal; }
#rq-form .field .field-row select { width: auto; flex: none; }
.vis-toggle { justify-content: flex-start; } .field .vis-toggle input { width: auto; flex: none; margin: 0; }
