/* August Projects — Design System CSS
   Strictly black, white and grey. No hue anywhere.
   Meaning is carried by icon + label + tone (darker = more urgent) + shape
   (solid / outlined / dashed), never by colour. */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&family=Nunito:wght@700;800&display=swap');

:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --fg: #0a0a0a;
  --fg-secondary: #404040;
  --muted: #737373;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --shell: #0a0a0a;
  --shell-muted: #262626;
  --shell-text: #a3a3a3;
  --shell-text-active: #ffffff;

  /* Plot status: text tones only; chip shapes are defined under "Status chips". */
  --available: #0a0a0a;
  --held: #404040;
  --booked: #262626;
  --sold: #0a0a0a;
  --mortgaged: #0a0a0a;
  --registered: #404040;
  --not-sale: #a3a3a3;

  /* Severity ladder: darker = more urgent. */
  --high: #0a0a0a;
  --medium: #404040;
  --low: #737373;

  /* Feedback: "fine" is quiet, "danger" is loudest. */
  --success: #525252;
  --success-bg: #f5f5f5;
  --warn: #262626;
  --warn-bg: #ebebeb;
  --danger: #0a0a0a;
  --danger-bg: #e0e0e0;

  --font-ui: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-label: 'Nunito', -apple-system, system-ui, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-press: 140ms;
  --dur-popover: 180ms;
  --dur-drawer: 250ms;

  --radius-none: 0px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

body { min-height: 100vh; }

/* ─── Layout shell ─── */
.app-shell {
  display: grid;
  /* minmax(0, 1fr): the content column may shrink below its widest child
     (tables scroll inside themselves instead of pushing the page sideways). */
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr 56px;
  }
}

/* ─── Sidebar (desktop) ─── */
.sidebar {
  background: var(--shell);
  color: var(--shell-text);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 0 8px 32px;
  font-family: var(--font-label);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.12em;
  color: var(--shell-text-active);
  text-transform: uppercase;
  line-height: 1.2;
}
.sidebar-logo small {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--shell-text);
  margin-top: 2px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--shell-text);
  text-decoration: none;
  transition: background var(--dur-press) var(--ease-out), color var(--dur-press) var(--ease-out);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: var(--shell-muted); color: var(--shell-text-active); }
.nav-item.active { background: var(--shell-muted); color: var(--shell-text-active); font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.nav-badge {
  margin-left: auto;
  background: #ffffff;   /* sidebar is black, so the count reads as a white pill */
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.6;
}

.nav-separator {
  height: 1px;
  background: var(--shell-muted);
  margin: 8px 0;
}

/* ─── Collapsible sidebar (desktop only) ───
   State lives on <html class="sidebar-collapsed">, set before first paint by the
   inline head script and toggled by app.js (button or the "[" key). */
.logo-mark { display: none; }
.nav-label, .sidebar-text { white-space: nowrap; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--shell-muted);
}
.sidebar-toggle svg { transition: transform 200ms var(--ease-out); }
.sidebar-toggle kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--shell-text);
  border: 1px solid var(--shell-muted);
  border-radius: 4px;
  padding: 0 5px;
  line-height: 1.6;
}

@media (min-width: 769px) {
  .app-shell { transition: grid-template-columns 200ms var(--ease-out); }

  .sidebar-collapsed .app-shell { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar-collapsed .sidebar { padding: 24px 10px 16px; }

  .sidebar-collapsed .logo-full { display: none; }
  .sidebar-collapsed .logo-mark { display: block; text-align: center; font-size: 20px; letter-spacing: 0; }
  .sidebar-collapsed .sidebar-logo { padding: 0 0 32px; }

  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .sidebar-text,
  .sidebar-collapsed .sidebar-toggle kbd { display: none; }
  .sidebar-collapsed .nav-item { justify-content: center; gap: 0; padding: 10px 0; position: relative; }
  .sidebar-collapsed .nav-badge {
    position: absolute; top: 3px; right: 6px;
    margin: 0; padding: 0 4px; font-size: 9px; line-height: 1.5;
  }
  .sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }
}

/* Keyboard toggles and first paint happen instantly; only clicks animate. */
.sidebar-instant .app-shell,
.sidebar-instant .sidebar-toggle svg { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .app-shell, .sidebar-toggle svg { transition: none !important; }
}

/* ─── Bottom nav (phone) ─── */
.bottom-nav {
  display: none;
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 56px;
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  min-width: 56px;
}
.bottom-nav-item.active { color: var(--fg); }
.bottom-nav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ─── Main content ─── */
.main {
  padding: 24px 32px;
  max-width: 1400px;
  min-height: 100vh;
  min-width: 0;
}
@media (max-width: 768px) {
  .main { padding: 16px; padding-bottom: 72px; }
}

/* ─── Header bar ─── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.header-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.header-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.header-right { display: flex; align-items: center; gap: 8px; }

.sync-status {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: #0a0a0a; }
/* Stale = hollow ring, so it differs by shape, not colour. */
.sync-dot.stale { background: transparent; box-shadow: inset 0 0 0 1.5px #0a0a0a; }

/* ─── Project filter chips ─── */
.filter-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.chip {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background-color var(--dur-press) var(--ease-out), color var(--dur-press) var(--ease-out), border-color var(--dur-press) var(--ease-out);
}
.chip:hover { border-color: var(--fg); color: var(--fg); }
.chip.active { background: var(--fg); color: var(--surface); border-color: var(--fg); }

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.card-header {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ─── Metric cards ─── */
.metric { text-align: left; }
.metric-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-family: var(--font-mono);
}
.metric-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ─── Status chips ─── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  line-height: 1.4;
}
/* Chips differ by fill and outline style, plus icon and label. Darkest = most final. */
.status-available  { color: #0a0a0a; background: #ffffff; box-shadow: inset 0 0 0 1px #0a0a0a; }
.status-held       { color: #262626; background: #e5e5e5; }
.status-booked     { color: #0a0a0a; background: #d4d4d4; }
.status-sold       { color: #ffffff; background: #0a0a0a; }
.status-mortgaged  { color: #0a0a0a; background: #ffffff; outline: 1px dashed #0a0a0a; outline-offset: -1px; }
.status-registered { color: #ffffff; background: #525252; }
.status-not-sale   { color: #737373; background: transparent; box-shadow: inset 0 0 0 1px #d4d4d4; }

/* Same scheme for the small status dots (e.g. Inventory summary row). */
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-available  { background: #ffffff; box-shadow: inset 0 0 0 1.5px #0a0a0a; }
.dot-held       { background: #e5e5e5; box-shadow: inset 0 0 0 1px #a3a3a3; }
.dot-booked     { background: #a3a3a3; }
.dot-sold       { background: #0a0a0a; }
.dot-mortgaged  { background: #ffffff; outline: 1.5px dashed #0a0a0a; outline-offset: -1.5px; }
.dot-registered { background: #525252; }
.dot-not-sale   { background: transparent; box-shadow: inset 0 0 0 1px #d4d4d4; }

.status-icon { font-size: 10px; }

.severity-high   { color: var(--high); }
.severity-medium { color: var(--medium); }
.severity-low    { color: var(--low); }

/* ─── Tables ─── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr { height: 40px; }
@media (max-width: 768px) { .data-table tr { height: 56px; } }
.data-table tbody tr:hover { background: #fafafa; }

.cell-mono {
  font-family: var(--font-mono);
  font-size: 12px;
}
.cell-money {
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: right;
}
.cell-link {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
  cursor: pointer;
}
.cell-link:hover { text-decoration-color: var(--fg); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out), opacity var(--dur-press);
  border: none;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--fg);
  color: var(--surface);
  border-radius: var(--radius-none);
}
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.btn-secondary:hover { border-color: var(--fg); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
}
.btn-ghost:hover { color: var(--fg); background: #f5f5f5; }

/* ─── Micro-label (section header) ─── */
.micro-label {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ─── Checksum strip ─── */
.checksum {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  margin-top: 8px;
}
.checksum-ok { background: var(--success-bg); color: var(--success); }
/* A mismatch must be seen: white with a black outline, not a faint grey. */
.checksum-warn { background: #ffffff; color: #0a0a0a; box-shadow: inset 0 0 0 1px #0a0a0a; font-weight: 600; }

/* ─── Ageing buckets ─── */
.bucket-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border);
}
.bucket-bar > div { height: 100%; }

/* ─── Provenance indicator ─── */
.provenance-trigger {
  cursor: pointer;
  border-bottom: 1px dashed var(--border-strong);
}
.provenance-trigger:hover { border-bottom-color: var(--fg); }

/* ─── Issue badge ─── */
.issue-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
/* High is inverted (black fill) so it wins at a glance; medium is a grey fill. */
.issue-badge-high { background: #0a0a0a; color: #ffffff; }
.issue-badge-medium { background: #e5e5e5; color: #262626; }

/* ─── Tabs ─── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--dur-press);
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); font-weight: 600; border-bottom-color: var(--fg); }

/* ─── Search / Command palette trigger ─── */
.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  min-width: 200px;
}
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  margin-left: auto;
}

/* ─── Empty / Error / Stale states ─── */
.state-empty, .state-error, .state-stale {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.state-error { color: var(--danger); }
.state-stale {
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: var(--radius-sm);
  font-size: 12px;
  padding: 8px 12px;
  text-align: left;
}

/* ─── Grid layouts ─── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Funnel ─── */
.funnel { display: flex; align-items: flex-end; gap: 2px; height: 120px; }
.funnel-bar {
  flex: 1;
  background: var(--fg);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  position: relative;
}
.funnel-bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

/* ─── Chat bubbles (Agent) ─── */
.chat-thread { display: flex; flex-direction: column; gap: 16px; }
.chat-msg {
  max-width: 72%;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.55;
}
.chat-msg-user {
  align-self: flex-end;
  background: var(--fg);
  color: var(--surface);
  border-radius: 16px 16px 4px 16px;
}
.chat-msg-agent {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px;
}
.chat-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.chat-source-chip {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
}

/* ─── Review card ─── */
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  box-sizing: border-box;
}
.review-question {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 20px;
}
.review-evidence {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin-bottom: 24px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  /* Evidence is written as aligned lines; keep the line breaks, wrap long lines. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 768px) {
  .review-card { padding: 20px; }
  .review-actions .btn { flex: 1 1 0; min-width: 0; min-height: 44px; }
}
/* Tappable numbers: a larger touch area on touch screens without shifting the layout. */
@media (pointer: coarse) {
  .provenance-trigger { position: relative; }
  .provenance-trigger::after { content: ""; position: absolute; inset: -10px -4px; }
}

/* ─── Utility ─── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.text-right { text-align: right; }
.text-mono { font-family: var(--font-mono); }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.hidden-mobile { }
@media (max-width: 768px) { .hidden-mobile { display: none !important; } }
.hidden-desktop { display: none; }
@media (max-width: 768px) { .hidden-desktop { display: block !important; } }

/* ─── Phone fit ─── */
@media (max-width: 768px) {
  /* Wide tables scroll inside themselves instead of widening the page. */
  main table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .header > *, .header-right { min-width: 0; }
  .header-right { flex-wrap: wrap; }
  /* Touch targets: chips and buttons at least 40px tall, card links padded. */
  .chip { min-height: 40px; padding: 8px 14px; }
  main .btn { min-height: 40px; }
}

/* ─── Toast (button feedback) ─── */
.ap-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 300;
  max-width: min(92vw, 420px);
  background: #0a0a0a; color: #ffffff;
  font-size: 13px; line-height: 1.4;
  padding: 10px 14px; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  transition: transform 200ms var(--ease-out), opacity 200ms var(--ease-out);
}
.ap-toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 768px) { .ap-toast { bottom: 72px; } }

/* ─── Provenance: tap any number to see its sources ─── */
.provenance-trigger:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 2px; }

.prov-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(10, 10, 10, 0.32);
  opacity: 0; pointer-events: none;
  transition: opacity 200ms var(--ease-out);
}
.prov-open .prov-overlay { opacity: 1; pointer-events: auto; }

.prov-sheet {
  position: fixed; z-index: 401; background: var(--surface); color: var(--fg);
  display: flex; flex-direction: column;
  /* Desktop: right-hand panel */
  top: 0; right: 0; bottom: 0; width: min(420px, 100vw);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 250ms var(--ease-drawer);
}
.prov-open .prov-sheet { transform: translateX(0); }
@media (max-width: 768px) {
  /* Phone: bottom sheet */
  .prov-sheet {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 82vh;
    border-left: none; border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  .prov-open .prov-sheet { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .prov-sheet, .prov-overlay, .ap-toast { transition: opacity 150ms ease; }
  .prov-sheet { transform: none !important; opacity: 0; }
  .prov-open .prov-sheet { opacity: 1; }
}

.prov-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.prov-title { font-family: var(--font-label); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.prov-close { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 18px; line-height: 1; color: var(--fg); }
.prov-close:active { transform: scale(0.97); }
.prov-body { padding: 20px; overflow-y: auto; }
.prov-value { font-family: var(--font-mono); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.prov-label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.prov-section { margin-top: 20px; }
.prov-section h4 { font-family: var(--font-label); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.prov-src { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.prov-src.shown { border-color: var(--fg); box-shadow: inset 3px 0 0 var(--fg); }
.prov-src-path { font-family: var(--font-mono); font-size: 12px; color: var(--fg-secondary); word-break: break-word; }
.prov-src-val { font-family: var(--font-mono); font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.prov-tag { grid-column: 1 / -1; font-size: 11px; font-weight: 600; color: var(--muted); }
.prov-src.shown .prov-tag { color: var(--fg); }
.prov-alert { padding: 10px 12px; border-radius: 8px; background: #ffffff; box-shadow: inset 0 0 0 1px #0a0a0a; font-size: 13px; font-weight: 600; }
.prov-note { font-size: 13px; color: var(--fg-secondary); line-height: 1.5; }
.prov-sample { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: #e5e5e5; color: #262626; }
.prov-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
