/* SCIKIQ Signal · design system for the IIB Motor 360 demo.
   Sharp corners only. The hexagon is the only pictorial shape. Blue is the only accent. */
:root {
  --ink: #1E1E1E; --muted: #636363; --paper: #F5F7FA; --white: #FFFFFF;
  --blue: #0168FA; --blue-text: #0158D6; --mist: #E8EEF7; --tint: #DCE8FE; --deep: #0A2A66; --hair: #D5DCE6;
  --good: #1E7F4F; --partial: #8A6412; --alert: #C23B22; --idle: #7D848D;
  --amber: #B7791F;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; border-radius: 0 !important; }
/* A class that sets display (grid2, panel rows) must not unhide an element the page script hid. */
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5; }
a { color: var(--blue-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; margin: 0; }
code, pre { font-family: Consolas, "Cascadia Mono", Menlo, monospace; font-size: 12.5px; }

/* --- banner, watermark --------------------------------------------------------------------- */
.banner { background: var(--deep); color: var(--white); font-size: 12px; letter-spacing: .02em; padding: 6px 24px; }
.watermark { background: #FFF4DE; color: #7A4B00; border-bottom: 1px solid #F0D49B; font-weight: 600; font-size: 12.5px;
  padding: 6px 24px; text-transform: uppercase; letter-spacing: .04em; }

/* --- header --------------------------------------------------------------------------------- */
.topbar { display: flex; align-items: center; gap: 24px; background: var(--white); border-bottom: 1px solid var(--hair);
  padding: 10px 24px; position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.wordmark { font-weight: 700; letter-spacing: .08em; font-size: 17px; color: var(--deep); }
.brand img { height: 26px; }
.product { font-size: 12.5px; color: var(--muted); border-left: 1px solid var(--hair); padding-left: 10px; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--muted); padding: 6px 10px; font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.on { color: var(--ink); border-bottom-color: var(--blue); }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.role-switch { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.role-switch select { font-family: var(--font); font-size: 12.5px; padding: 4px 6px; border: 1px solid var(--hair); background: var(--white); color: var(--ink); }
.badge { font-size: 11px; font-weight: 600; padding: 3px 8px; text-transform: uppercase; letter-spacing: .04em; }
.badge.offline { background: #ECEEF1; color: var(--idle); }
.badge.online { background: var(--tint); color: var(--blue-text); }
.locator { display: flex; justify-content: flex-end; gap: 6px; padding: 6px 24px; font-size: 11.5px; color: var(--idle);
  text-transform: uppercase; letter-spacing: .08em; background: var(--white); border-bottom: 1px solid var(--hair); }
.locator .on { color: var(--blue-text); font-weight: 700; }
.locator span[title] { cursor: help; }
.locator .viewing { margin-right: auto; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--ink); }
.locator .viewing .muted { margin-left: 6px; }
.locator .steps-label { text-transform: none; letter-spacing: 0; }
@media (max-width: 900px) { .locator { flex-wrap: wrap; } .locator .viewing { flex: 1 0 100%; } }

/* --- guided tour strip ------------------------------------------------------------------------- */
.tour { display: flex; align-items: center; gap: 14px; background: var(--tint); border-bottom: 1px solid #B9CFF3; padding: 10px 24px; }
.tour .hex { width: 30px; height: 34px; font-size: 14px; }
.tour-body { flex: 1; min-width: 0; }
.tour-title { font-weight: 600; font-size: 13.5px; }
.tour-show { font-size: 13px; margin-top: 2px; }
.tour-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 900px) { .tour { flex-wrap: wrap; padding: 10px 16px; } .tour-nav { flex: 1 0 100%; } }
/* narrow screens: brand and controls on one row, the page nav as one scrollable row below */
@media (max-width: 1180px) {
  .topbar { gap: 8px 16px; padding: 10px 16px; }
  .topbar .right { margin-left: auto; }
  .nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .nav a { white-space: nowrap; }
  .locator { padding: 6px 16px; }
  main { padding: 18px 16px 48px; }
  .banner, .watermark { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 640px) {
  .product { display: none; }
  .page-head h1 { font-size: 20px; }
  .kpi .value { font-size: 21px; }
}
html, body { overflow-x: hidden; }

main { max-width: 1320px; margin: 0 auto; padding: 22px 24px 60px; }
footer { max-width: 1320px; margin: 0 auto; padding: 18px 24px 40px; color: var(--idle); font-size: 12px; border-top: 1px solid var(--hair); }

/* --- page header ---------------------------------------------------------------------------- */
.page-head { margin-bottom: 18px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .12em; color: var(--blue-text); }
.eyebrow .bar { display: inline-block; width: 18px; height: 3px; background: var(--blue); }
.page-head h1 { font-size: 24px; margin-top: 6px; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); margin: 6px 0 0; max-width: 860px; }
.page-head .why { margin: 8px 0 0; max-width: 900px; font-size: 15px; line-height: 1.55; }
.page-head .why strong { color: var(--deep); }

/* --- technical detail behind one click, and what the AI saw --------------------------------- */
details.more { margin-top: 12px; border: 1px solid var(--hair); background: var(--white); }
details.more > summary { cursor: pointer; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--deep); background: var(--paper); }
details.more > .more-body { padding: 12px 14px; border-top: 1px solid var(--hair); }
.ai-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* --- findings: a headline number that links to the page that explains it ------------------------ */
.findings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.finding { display: block; background: var(--white); border: 1px solid var(--hair); border-top: 3px solid var(--blue); padding: 14px 16px; color: var(--ink); }
.finding:hover { border-color: var(--blue); text-decoration: none; background: var(--paper); }
.finding.lead { border-top-color: var(--deep); background: var(--mist); }
.finding .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.finding .value { font-size: 26px; font-weight: 600; margin-top: 4px; letter-spacing: -.01em; }
.finding .note { font-size: 12.5px; margin-top: 4px; }
.finding .go { font-size: 12px; color: var(--blue-text); margin-top: 8px; font-weight: 600; }
@media (max-width: 900px) { .findings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .findings { grid-template-columns: 1fr; } }
.findings > * { min-width: 0; }
.plain-panel { background: var(--white); border: 1px solid var(--hair); border-left: 3px solid var(--deep); padding: 12px 16px; }
.plain-panel p { margin: 0 0 6px; } .plain-panel p:last-child { margin: 0; }
.plain-panel .k { font-weight: 600; color: var(--deep); }

/* --- board-pack use pages and the catalogue ------------------------------------------------- */
.uses-grid .use-card .label { display: flex; align-items: center; gap: 8px; }
.uses-grid .use-card .hex { width: 26px; height: 30px; font-size: 12px; }
.use-title { font-size: 16px; font-weight: 600; margin-top: 8px; line-height: 1.35; }
.use-facts { display: grid; grid-template-columns: 2fr 3fr 1fr; gap: 10px 18px; margin: 12px 0 16px; font-size: 13px; }
.use-facts .k, .use-question .k { font-weight: 600; color: var(--deep); }
@media (max-width: 900px) { .use-facts { grid-template-columns: 1fr; } }
.use-question { background: var(--tint); padding: 10px 14px; margin: 0 0 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.use-measure { border-top-color: var(--blue); }
.use-safe { margin-top: 18px; }
.hairline { border: 0; border-top: 1px solid var(--hair); margin: 14px 0 0; }
.section-title { font-size: 15px; font-weight: 600; margin: 26px 0 10px; display: flex; align-items: center; gap: 8px; }

/* --- hexagon (the only pictorial shape) ----------------------------------------------------- */
.hex { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 27px; background: var(--blue);
  color: var(--white); font-size: 11.5px; font-weight: 700; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); flex: none; }
.hex.sm { width: 12px; height: 14px; }
.hex.ink { background: var(--deep); } .hex.good { background: var(--good); } .hex.partial { background: var(--partial); }
.hex.alert { background: var(--alert); } .hex.idle { background: var(--idle); } .hex.mist { background: var(--hair); color: var(--ink); }

/* --- KPI tiles: at most four per row, mist panels with a thin top rule ---------------------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--mist); border-top: 2px solid var(--deep); padding: 14px 16px; }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 26px; font-weight: 600; margin-top: 4px; letter-spacing: -.01em; }
.kpi .note { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- panels, grids, tables ------------------------------------------------------------------ */
.panel { background: var(--white); border: 1px solid var(--hair); padding: 16px 18px; }
.panel + .panel { margin-top: 14px; }
.panel h2 { font-size: 15px; margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-6-4 { display: grid; grid-template-columns: 6fr 4fr; gap: 14px; }
@media (max-width: 1000px) { .grid2, .grid3, .grid-6-4 { grid-template-columns: 1fr; } }
.grid2 > *, .grid3 > *, .grid-6-4 > *, .kpis > * { min-width: 0; }  /* let wide tables scroll inside their panel */
.muted { color: var(--muted); } .small { font-size: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; border-bottom: 1px solid var(--hair); padding: 7px 8px; background: var(--paper); }
table.data td { border-bottom: 1px solid var(--hair); padding: 7px 8px; vertical-align: top; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.clickable { cursor: pointer; } table.data tr.clickable:hover td { background: var(--paper); }
table.data tr.sel td { background: var(--tint); }
.table-wrap { overflow-x: auto; max-height: 560px; overflow-y: auto; }
.table-wrap > table.data { min-width: 560px; }  /* on a phone the table scrolls sideways instead of squeezing words */

/* --- status pills and source badges ---------------------------------------------------------- */
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; letter-spacing: .02em; }
.pill.good { background: #E3F2EA; color: var(--good); } .pill.partial { background: #F6EFDD; color: var(--partial); }
.pill.alert { background: #F8E3DF; color: var(--alert); } .pill.idle { background: #ECEEF1; color: var(--idle); }
.pill.blue { background: var(--tint); color: var(--blue-text); }
.src { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 3px 8px; border: 1px solid var(--hair);
  background: var(--white); margin: 2px 4px 2px 0; }
.src.placeholder { border-color: #F0D49B; background: #FFF8EA; color: #7A4B00; }
button.src { font-family: var(--font); font-size: 12px; text-align: left; color: var(--ink); line-height: 1.35; }
button.src:hover { border-color: var(--blue); background: var(--tint); }

/* --- buttons and forms ----------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 8px 14px; border: 1px solid var(--deep); background: var(--deep); color: var(--white); cursor: pointer; }
.btn:hover { background: #0D3680; text-decoration: none; }
.btn.secondary { background: var(--white); color: var(--deep); }
.btn.secondary:hover { background: var(--mist); }
.btn.blue { background: var(--blue); border-color: var(--blue); }
.btn.small { font-size: 12px; padding: 5px 10px; }
.btn[disabled] { opacity: .5; cursor: default; }
input[type=text], textarea, select.input { font-family: var(--font); font-size: 14px; padding: 9px 11px; border: 1px solid var(--hair);
  background: var(--white); color: var(--ink); width: 100%; }
input[type=text]:focus, textarea:focus { outline: 2px solid var(--tint); border-color: var(--blue); }
select.input { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

details.sql { margin-top: 10px; border: 1px solid var(--hair); background: var(--paper); }
details.sql summary { cursor: pointer; padding: 7px 10px; font-size: 12.5px; font-weight: 600; color: var(--deep); }
details.sql pre { margin: 0; padding: 10px 12px; white-space: pre-wrap; border-top: 1px solid var(--hair); background: var(--white); }

/* --- answers, briefings, notes -------------------------------------------------------------- */
.answer { font-size: 15px; line-height: 1.6; }
.callout { border-left: 3px solid var(--blue); background: var(--white); padding: 12px 14px; }
.callout.alert { border-left-color: var(--alert); } .callout.good { border-left-color: var(--good); }
.callout.partial { border-left-color: var(--partial); }
.note-box { white-space: pre-wrap; background: var(--paper); border: 1px solid var(--hair); padding: 12px 14px; font-size: 13.5px; }
.reasons li { margin: 4px 0; }
.briefing h2 { font-size: 19px; margin-bottom: 8px; }
.briefing p { margin: 0 0 10px; }
.method { background: var(--mist); border-top: 2px solid var(--blue); padding: 12px 14px; font-size: 13px; }

/* --- hex tile map ---------------------------------------------------------------------------- */
.tilemap svg { width: 100%; height: auto; display: block; }
.tilemap .tile polygon { stroke: var(--white); stroke-width: 2; cursor: pointer; }
.tilemap .tile:hover polygon { stroke: var(--ink); }
.tilemap .tile.sel polygon { stroke: var(--blue); stroke-width: 3; }
.tilemap .tile text { font-size: 11px; font-weight: 600; pointer-events: none; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.legend .swatch { width: 18px; height: 10px; display: inline-block; }

/* --- Connect landing progress ---------------------------------------------------------------- */
.steps { list-style: none; padding: 0; margin: 10px 0 0; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--idle); }
.steps li.run { color: var(--ink); font-weight: 600; } .steps li.done { color: var(--good); }
.steps li .hex { background: var(--hair); }
.steps li.run .hex { background: var(--blue); animation: pulse 1s infinite alternate; }
.steps li.done .hex { background: var(--good); }
@keyframes pulse { from { opacity: .45; } to { opacity: 1; } }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--deep); color: var(--white); padding: 10px 14px; font-size: 13px; z-index: 50; }
.empty { color: var(--muted); font-style: italic; padding: 10px 0; }
.chart-box { position: relative; height: 280px; }
.spinner { display: inline-block; width: 14px; height: 16px; background: var(--blue);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); animation: pulse .6s infinite alternate; }
