/* RetailBox Automation - data lake concept showcase. Neutral navy/teal palette. */
:root {
  --navy-900: #0b1f33;
  --navy-800: #102a43;
  --navy-700: #1b3a5b;
  --teal-700: #0b6b63;
  --teal-600: #0f7c73;
  --teal-100: #dff3f0;
  --page: #f6f7f9;
  --surface: #ffffff;
  --chart-surface: #fcfcfb;
  --ink: #0f1720;
  --ink-2: #47505c;
  --ink-3: #5f6874;
  --line: #d9dde3;
  --grid: #e5e7eb;
  --axis: #b9bfc8;
  --focus: #b45309;
  /* Lots - categorical slots 1-3, validated (CVD all-pairs >= 9.2) */
  --lot-a: #2a78d6; --lot-a-tint: #e9f1fb;
  --lot-b: #eb6834; --lot-b-tint: #fdeee7;
  --lot-c: #1baf7a; --lot-c-tint: #e3f6ef;
  --series: #2a78d6;
  --good: #0b7a0b; --critical: #b42323;
  --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 160px; }
body { margin: 0; font-size: 15px; line-height: 1.5; background: var(--page); }
a { color: var(--teal-700); }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 12px; top: 44px; position: fixed; z-index: 100; background: #fff; padding: 8px 12px; border: 2px solid var(--focus); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* Fixed honesty banner */
.banner {
  position: sticky; top: 0; z-index: 50;
  background: #2b2f36; color: #fff; text-align: center;
  font-size: 13px; padding: 7px 16px; letter-spacing: 0.01em;
  border-bottom: 2px solid #f2c14e;
}
.banner strong { font-weight: 600; }

.site-header {
  background: var(--navy-800); color: #fff;
}
.header-inner { max-width: 1360px; margin: 0 auto; padding: 14px 32px 0; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand h1 { margin: 0; font-size: 19px; font-weight: 650; line-height: 1.25; }
.brand p { margin: 2px 0 0; font-size: 13px; color: #c9d5e3; }
.role-picker { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #dbe4ee; }
.role-picker select {
  font: inherit; font-size: 14px; padding: 6px 10px; border-radius: 6px; border: 1px solid #6d86a3;
  background: var(--navy-900); color: #fff; min-width: 180px;
}
.role-picker .who { color: #9fb3c8; }

.tabs { display: flex; gap: 4px; margin-top: 12px; }
.tab {
  font: inherit; font-size: 14px; font-weight: 550; color: #dbe4ee; background: transparent;
  border: 0; border-bottom: 3px solid transparent; padding: 10px 16px 9px; cursor: pointer; border-radius: 6px 6px 0 0;
}
.tab:hover { background: var(--navy-700); color: #fff; }
.tab[aria-selected="true"] { color: #fff; border-bottom-color: #5fd1c3; background: var(--navy-700); }
.tab:focus-visible { outline-color: #f2c14e; outline-offset: -3px; }

main { max-width: 1360px; margin: 0 auto; padding: 22px 32px 48px; }
.page[hidden] { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 14px; }
.page-head h2 { margin: 0; font-size: 22px; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); max-width: 1120px; }
h3 { font-size: 16px; margin: 0 0 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.caption { font-size: 13px; color: var(--ink-3); margin: 8px 0 0; }
.caption.platform { color: var(--teal-700); font-weight: 550; }
.caption.platform::before { content: "\2192\00a0"; }
.note {
  border-left: 4px solid var(--teal-600); background: var(--teal-100); padding: 10px 14px;
  border-radius: 0 6px 6px 0; color: #0b3d38; font-size: 14px;
}
.muted { color: var(--ink-3); }
.pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: #f1f3f6; color: var(--ink-2); white-space: nowrap;
}
.lot-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.lot-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lot-swatch.a { background: var(--lot-a); } .lot-swatch.b { background: var(--lot-b); } .lot-swatch.c { background: var(--lot-c); }
.lot-swatch.src { background: #8a929c; }

/* Overview */
.diagram-wrap { padding: 14px 14px 10px; }
.diagram-wrap svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--ink-2); margin-top: 8px; align-items: center; }
.legend .dash { display: inline-block; width: 22px; height: 0; border-top: 2px dashed #5f6874; vertical-align: middle; margin-right: 6px; }
.lot-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.lot-notes .card { border-top: 4px solid; padding-top: 12px; }
.lot-notes .a { border-top-color: var(--lot-a); } .lot-notes .b { border-top-color: var(--lot-b); } .lot-notes .c { border-top-color: var(--lot-c); }
.lot-notes p { margin: 0; font-size: 14px; color: var(--ink-2); }
details.textalt { margin-top: 10px; font-size: 14px; }
details.textalt summary { cursor: pointer; color: var(--teal-700); font-weight: 550; }

/* Tables */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); background: #f3f5f8; font-weight: 650; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #f8fafc; }
.sbom td { padding: 6px 10px; }
.sbom td:first-child { font-weight: 600; }
.sbom .osi { color: var(--good); font-weight: 600; white-space: nowrap; }
.sbom .note-cell { color: var(--ink-2); font-size: 13px; min-width: 300px; max-width: 420px; }
.sbom th { white-space: nowrap; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.seg button { font: inherit; font-size: 13px; border: 0; background: #fff; padding: 6px 12px; cursor: pointer; color: var(--ink); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--navy-800); color: #fff; }
.footnote { font-size: 13px; color: var(--ink-3); margin-top: 10px; }

/* Pipeline */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step { display: flex; flex-direction: column; }
.step-num { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--navy-800); color: #fff; font-weight: 700; font-size: 13px; align-items: center; justify-content: center; margin-right: 8px; flex: none; }
.step h3 { display: flex; align-items: center; font-size: 16px; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 10px; font-size: 13px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.kv dd.mono { font-size: 12px; }
td.num { white-space: nowrap; }
.mini { font-size: 12.5px; }
.mini th, .mini td { padding: 3px 6px; }
.mini th { font-size: 11px; }
.status-ok { color: var(--good); font-weight: 650; white-space: nowrap; }
.status-ok::before { content: "\2713\00a0"; }
.flowline { font-size: 12.5px; margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); }
.flowline li { margin: 1px 0; }
.step .caption.platform { margin-top: auto; padding-top: 10px; }

.dash-head { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 10px; gap: 16px; }
.dash-head h3 { margin: 0; font-size: 18px; }
.filter { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.filter select { font: inherit; padding: 5px 8px; border-radius: 6px; border: 1px solid #8b949e; background: #fff; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.kpi .label { font-size: 13px; color: var(--ink-2); }
.kpi .value { font-size: 30px; font-weight: 650; line-height: 1.15; margin-top: 2px; }
.kpi .sub { font-size: 12.5px; color: var(--ink-3); }
.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-top: 14px; }
.dash-grid .wide { grid-column: 1 / -1; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: inherit; }
.tooltip {
  position: fixed; pointer-events: none; z-index: 60; background: #0f1720; color: #fff; font-size: 12.5px;
  padding: 6px 9px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.2); white-space: nowrap;
}
.tooltip[hidden] { display: none; }
.bar { fill: var(--series); }
.bar:hover, .bar.hot { fill: #1c5cab; }

/* Ask the data */
.ask-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.ask-form { display: flex; gap: 8px; margin-top: 6px; }
.ask-form input {
  flex: 1; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #8b949e; border-radius: 6px;
}
.btn {
  font: inherit; font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--teal-700); background: var(--teal-700); color: #fff;
}
.btn:hover { background: #095a53; }
.btn.secondary { background: #fff; color: var(--teal-700); }
.examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.examples button {
  font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 999px; border: 1px solid #9aa4af;
  background: #fff; color: var(--ink); cursor: pointer;
}
.examples button:hover { border-color: var(--teal-700); color: var(--teal-700); background: #f3fbfa; }
.answer { margin-top: 14px; }
.answer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.interp { font-size: 13px; color: var(--ink-2); }
pre.sql {
  background: #0f1d2c; color: #e6edf3; padding: 10px 12px; border-radius: 6px; font-size: 13px; line-height: 1.45;
  overflow-x: auto; margin: 6px 0 10px; white-space: pre;
}
pre.sql .kw { color: #7cc7ff; font-weight: 600; }
pre.sql .str { color: #a5e3b5; }
pre.sql .cm { color: #9aa7b4; font-style: italic; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.big-number { font-size: 44px; font-weight: 650; line-height: 1.1; }
.refusal {
  border-left: 4px solid var(--critical); background: #fbeeee; padding: 12px 14px; border-radius: 0 6px 6px 0;
}
.refusal h3 { color: #8f1c1c; margin: 0 0 4px; font-size: 15px; }
.refusal h3 { display: flex; align-items: center; gap: 8px; }
.refusal h3::before {
  content: "!"; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 20px; height: 20px; border-radius: 50%; background: var(--critical); color: #fff; font-size: 13px; font-weight: 800;
}
.refusal p { margin: 0; }
.side .card + .card { margin-top: 14px; }
.guard dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 10px; margin: 0; font-size: 13.5px; }
.guard dt { color: var(--ink-3); }
.guard dd { margin: 0; font-weight: 550; }
.guard ul { margin: 0; padding-left: 16px; }
.audit-list { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow-y: auto; font-size: 12.5px; }
.audit-list li { border-bottom: 1px solid var(--grid); padding: 6px 0; }
.audit-list .meta { color: var(--ink-3); }
.audit-list code { display: block; white-space: pre-wrap; word-break: break-word; color: #1b3a5b; background: #f3f5f8; padding: 3px 6px; border-radius: 4px; margin-top: 3px; font-size: 11.5px; }
.outcome { font-weight: 650; }
.outcome.ok { color: var(--good); }
.outcome.no { color: var(--critical); }
.outcome.ok::before { content: "\2713\00a0"; }

/* Access */
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 4px 0 0; padding: 0; border: 0; }
.role-cards legend { font-weight: 650; margin-bottom: 8px; padding: 0; }
.role-card { position: relative; display: block; cursor: pointer; }
.role-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.role-card .box { display: block; border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: #fff; height: 100%; }
.role-card input:checked + .box { border-color: var(--teal-700); background: #f1faf9; box-shadow: inset 0 0 0 1px var(--teal-700); }
.role-card input:focus-visible + .box { outline: 3px solid var(--focus); outline-offset: 2px; }
.role-card .title { font-weight: 650; font-size: 15px; }
.role-card .kc { font-size: 12.5px; color: var(--ink-3); }
.role-card .desc { font-size: 13px; color: var(--ink-2); margin-top: 4px; display: block; }
.access-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 14px; margin-top: 14px; }
.yes { color: var(--good); font-weight: 650; white-space: nowrap; }
.yes::before { content: "\2713\00a0"; }
.no { color: var(--critical); font-weight: 650; white-space: nowrap; }
.no::before { content: "\2715\00a0"; }
.masked { color: var(--ink-3); font-style: italic; }
.current-col { background: #eef8f6; }
.locked { border: 1px dashed #9aa4af; border-radius: 6px; padding: 16px; color: var(--ink-2); background: #fafbfc; }
.locked strong::before { content: "Restricted · "; color: var(--critical); }
.audit-table td { font-size: 13px; }
.audit-table td.sqlc { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: #1b3a5b; max-width: 460px; word-break: break-word; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (forced-colors: active) {
  .bar { fill: CanvasText; }
  .tab[aria-selected="true"] { border-bottom-color: Highlight; }
}
@media (max-width: 1100px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .ask-layout, .dash-grid, .access-grid, .result-grid { grid-template-columns: 1fr; }
}
