/* Screens mockup. Colours, type and spacing come from OSPREY's tokens.css. */
:root {
  --st-ok: var(--color-success);
  --st-minor: var(--color-warning);
  --st-major: var(--color-error);
  --st-quiet: var(--border-default);
  --nav-w: 244px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-display);
  font-size: 13px;
  line-height: var(--leading-snug);
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--surface-focus); outline-offset: 1px; }
.osprey-ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.grow { flex: 1 1 auto; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-secondary); }

#frame { height: 100%; display: flex; justify-content: center; }
#app {
  display: flex; height: 100%; width: 100%; max-width: var(--tile-w, 100%);
  background: var(--surface-canvas);
  border-inline: 1px solid var(--border-default);
}
main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* ---------------------------------------------------------------- navigator */
#nav {
  flex: none; width: var(--nav-w); display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-secondary); border-right: 1px solid var(--border-default);
}
.nav-top { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--border-default); }
.nav-top b { font-weight: var(--weight-semibold); font-size: 13px; letter-spacing: 0.01em; }
.icon-btn {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: var(--radius-md);
  color: var(--text-secondary);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text-primary); }
.icon-btn[aria-pressed="true"] { color: var(--color-accent); background: var(--surface-selected); }
.nav-search {
  display: flex; align-items: center; gap: 8px; margin: 10px 10px 4px; padding: 0 8px; height: 30px;
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  background: var(--surface-well); color: var(--text-secondary); text-align: left;
}
.nav-search:hover { border-color: var(--text-muted); color: var(--text-primary); }
.nav-search kbd, .kbd {
  margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 0 4px; line-height: 16px;
}
.nav-scroll { flex: 1 1 auto; overflow-y: auto; padding: 4px 6px 12px; }
.nav-h {
  margin: 14px 8px 4px; font-size: 10px; font-weight: var(--weight-semibold); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted);
}
.row {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 8px; border-radius: var(--radius-md);
  text-align: left; color: var(--text-primary); white-space: nowrap;
}
.row > span { overflow: hidden; text-overflow: ellipsis; }
.row:hover { background: var(--surface-hover); }
.row.on { background: var(--surface-selected); color: var(--color-accent); }
.row .osprey-ic { color: var(--text-secondary); }
.row.on .osprey-ic { color: inherit; }
.row .sub { margin-left: auto; font-size: 11px; color: var(--text-muted); flex: none; }
.row.l1 { padding-left: 30px; }
.row.l2 { padding-left: 44px; color: var(--text-secondary); height: 26px; }
.row.l2.on { color: var(--color-accent); }
.row .caret { margin-left: -4px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--text-muted); }
.row .caret:hover { background: var(--surface-press); color: var(--text-primary); }
.row .caret .osprey-ic { width: 13px; height: 13px; }
.hint { margin: 2px 8px; font-size: 11px; color: var(--text-muted); }
.grid-lab { margin: 6px 8px 4px 30px; font-size: 11px; color: var(--text-muted); }
.sectors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 0 8px 6px 30px; }
.sectors button {
  position: relative; height: 24px; border-radius: var(--radius-md); border: 1px solid var(--border-default);
  font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-secondary);
}
.sectors button:hover { background: var(--surface-hover); color: var(--text-primary); border-color: var(--text-muted); }
.sectors button.on { background: var(--surface-selected); color: var(--color-accent); border-color: var(--color-accent); }
.sectors button.flt::after {
  content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--st-major); box-shadow: 0 0 0 2px var(--bg-secondary);
}
.nav-foot { border-top: 1px solid var(--border-default); padding: 6px; }
.nav-foot .row { color: var(--text-secondary); }
#app.nav-min #nav { width: 44px; }
#app.nav-min .nav-top { padding: 0; justify-content: center; }
#app.nav-min .nav-top b, #app.nav-min .nav-scroll, #app.nav-min .nav-foot, #app.nav-min .nav-search span, #app.nav-min .nav-search kbd { display: none; }
#app.nav-min .nav-search { margin: 10px 7px; padding: 0; justify-content: center; border-color: transparent; background: none; }

/* ---------------------------------------------------------------- tab strip, toolbar */
#tabstrip { flex: none; display: flex; align-items: stretch; height: 34px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-default); min-width: 0; }
.tabs { display: flex; min-width: 0; overflow: hidden; }
.tab {
  display: flex; align-items: center; gap: 6px; max-width: 200px; min-width: 60px; padding: 0 6px 0 12px;
  border-right: 1px solid var(--border-default); color: var(--text-secondary); white-space: nowrap;
}
.tab > span { overflow: hidden; text-overflow: ellipsis; }
.tab:hover { color: var(--text-primary); }
.tab.on { background: var(--surface-canvas); color: var(--text-primary); box-shadow: inset 0 2px 0 var(--color-accent); }
.tab .x { display: grid; place-items: center; width: 18px; height: 18px; border-radius: var(--radius-sm); color: var(--text-muted); flex: none; }
.tab .x:hover { background: var(--surface-press); color: var(--text-primary); }
.tab .x .osprey-ic { width: 12px; height: 12px; }
.strip-end { margin-left: auto; display: flex; align-items: center; gap: 6px; padding: 0 8px; flex: none; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px; border-radius: var(--radius-full);
  border: 1px solid var(--border-default); font-size: 11px; color: var(--text-secondary); white-space: nowrap;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }

#toolbar { flex: none; display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--surface-hairline); min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; margin-left: 6px; white-space: nowrap; }
.crumbs button { padding: 2px 6px; border-radius: var(--radius-md); color: var(--text-secondary); }
.crumbs button:hover { background: var(--surface-hover); color: var(--text-primary); }
.crumbs .here { padding: 2px 6px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; }
.crumbs .sep { color: var(--text-muted); display: grid; }
.crumbs .sep .osprey-ic { width: 12px; height: 12px; }
.seg { display: inline-flex; border: 1px solid var(--border-default); border-radius: var(--radius-md); overflow: hidden; height: 24px; }
.seg button { padding: 0 9px; font-size: 12px; color: var(--text-secondary); }
.seg button + button { border-left: 1px solid var(--border-default); }
.seg button:hover { color: var(--text-primary); background: var(--surface-hover); }
.seg button.on { background: var(--surface-selected); color: var(--color-accent); }
.tool-sep { width: 1px; height: 18px; background: var(--border-default); margin: 0 4px; }
.notes-btn { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--radius-md); font-size: 12px; color: var(--text-secondary); border: 1px solid var(--border-default); }
.notes-btn:hover { color: var(--text-primary); }
.notes-btn.on { color: var(--color-accent); border-color: var(--color-accent); background: var(--surface-selected); }
.notes-btn b { font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; color: var(--text-muted); }
.notes-btn[hidden] { display: none; }
.zoom-val { min-width: 40px; text-align: center; font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- page head */
#head { flex: none; padding: 16px 24px 0; border-bottom: 1px solid var(--border-default); }
.h-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.h-row h1 { margin: 0; font-size: 20px; font-weight: var(--weight-semibold); letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idchip {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); padding: 2px 7px;
  border: 1px solid var(--border-default); border-radius: var(--radius-md); white-space: nowrap;
}
.idchip:hover { color: var(--text-primary); border-color: var(--text-muted); }
.verdict { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.verdict i { width: 8px; height: 8px; border-radius: 50%; background: var(--st-ok); }
.verdict.major { color: var(--st-major); font-weight: var(--weight-medium); }
.verdict.major i { background: var(--st-major); box-shadow: 0 0 0 3px var(--error-tint-25); }
.verdict.off i { background: none; border: 1px dashed var(--text-muted); }
.h-sub { margin-top: 3px; font-size: 12px; color: var(--text-secondary); min-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vtabs { display: flex; gap: 2px; margin-top: 12px; }
.vtabs button {
  position: relative; padding: 7px 12px 9px; color: var(--text-secondary); border-radius: var(--radius-md) var(--radius-md) 0 0; white-space: nowrap;
}
.vtabs button:hover { color: var(--text-primary); background: var(--surface-hover); }
.vtabs button.on { color: var(--text-primary); font-weight: var(--weight-medium); }
.vtabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--color-accent); border-radius: 2px 2px 0 0; }
.vtabs button .n { margin-left: 6px; font-size: 10px; color: var(--text-muted); }
.vtabs.none { height: 14px; }

/* ---------------------------------------------------------------- body */
#body { flex: 1 1 auto; overflow: auto; padding: 16px 24px 96px; }
.views { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.views button {
  height: 26px; padding: 0 11px; border-radius: var(--radius-full); border: 1px solid var(--border-default);
  font-size: 12px; color: var(--text-secondary); white-space: nowrap;
}
.views button:hover { color: var(--text-primary); border-color: var(--text-muted); }
.views button.on { color: var(--color-accent); border-color: var(--color-accent); background: var(--surface-selected); }
.band { display: flex; align-items: flex-start; }
.band + .band { margin-top: var(--gap); }
.band > svg + svg { margin-left: var(--gap); }
.loading, .empty { color: var(--text-muted); padding: 40px 0; }

svg.ir { display: block; flex: none; overflow: hidden; }
.ir text { font-family: var(--font-display); dominant-baseline: central; pointer-events: none; }
.ir .num { font-variant-numeric: tabular-nums; }
.ir .note { display: none; }
body.notes .ir .note { display: initial; }
body.notes .ir text.note { fill: var(--color-accent-secondary); }
.ir .off { fill: var(--text-muted); }
.ir .glyph { fill: var(--text-muted); }
.ir rect.vb { stroke: var(--surface-hairline); stroke-width: 1; }
.ir rect.vb.bad { stroke: var(--st-major); stroke-width: 1.5; }
.ir .badtx { fill: var(--st-major); font-weight: 600; }
.ir .lk { cursor: pointer; }
.ir rect.chip { stroke: var(--border-default); }
.ir rect.chip.lk:hover, .ir rect.lk:hover { fill: var(--surface-hover); stroke: var(--color-accent); }
.ir polygon.lk:hover { stroke: var(--color-accent); stroke-width: 2; }
.ir .hot { stroke: var(--color-accent) !important; stroke-width: 2px !important; stroke-dasharray: none !important; }
.ir .flt { stroke: var(--st-major) !important; stroke-width: 2.5px !important; }
.ir .btn { cursor: pointer; }
.ir .btn:hover rect { filter: brightness(1.12); }
.ir .btn.apply { opacity: 0.45; }
.ir-in {
  width: 100%; height: 100%; border: 1px solid var(--border-default); border-radius: 4px;
  background: var(--surface-well); color: var(--text-primary); font: 12px var(--font-display); padding: 0 6px;
}
.ir-in:focus { outline: none; border-color: var(--color-accent); }

/* ---------------------------------------------------------------- overlays */
#peek {
  position: fixed; z-index: var(--z-dropdown); pointer-events: none; max-width: 320px; padding: 8px 10px;
  background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dropdown); font-size: 12px;
}
#peek b { display: block; font-weight: var(--weight-semibold); font-size: 13px; }
#peek .mono { font-size: 11px; color: var(--text-secondary); }
#peek .go { margin-top: 4px; color: var(--color-accent); font-size: 11px; }
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: var(--z-toast);
  padding: 8px 14px; border-radius: var(--radius-lg); background: var(--bg-elevated); border: 1px solid var(--border-default);
  box-shadow: var(--shadow-dropdown); font-size: 12px;
}
#scrim { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--overlay-black-50); display: grid; justify-items: center; align-items: start; padding-top: 12vh; }
#scrim[hidden], #peek[hidden], #toast[hidden] { display: none; }
.palette, .dialog {
  width: min(680px, 92vw); background: var(--bg-panel); border: 1px solid var(--border-default); border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-dialog); overflow: hidden;
}
.pal-in { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border-bottom: 1px solid var(--border-default); color: var(--text-secondary); }
.pal-in input { flex: 1; height: 100%; border: 0; outline: 0; background: none; color: var(--text-primary); font: 15px var(--font-display); }
.pal-f { display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--surface-hairline); flex-wrap: wrap; }
.pal-f button { height: 24px; padding: 0 10px; border-radius: var(--radius-full); border: 1px solid var(--border-default); font-size: 11px; color: var(--text-secondary); }
.pal-f button b { font-weight: var(--weight-regular); color: var(--text-muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.pal-f button.on { color: var(--color-accent); border-color: var(--color-accent); background: var(--surface-selected); }
.pal-f label { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.pal-h { margin: 8px 8px 2px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); font-weight: var(--weight-semibold); }
.res { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 8px; border-radius: var(--radius-md); text-align: left; white-space: nowrap; }
.res .osprey-ic { color: var(--text-muted); }
.res .t { overflow: hidden; text-overflow: ellipsis; }
.res .i { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }
.res .w { margin-left: auto; font-size: 11px; color: var(--text-secondary); flex: none; padding-left: 12px; }
.res.sel { background: var(--surface-selected); }
.res.sel .osprey-ic { color: var(--color-accent); }
.pal-foot { display: flex; gap: 14px; padding: 7px 14px; border-top: 1px solid var(--surface-hairline); font-size: 11px; color: var(--text-muted); }
.pal-foot .kbd { margin: 0 4px 0 0; }
.dialog { width: min(440px, 92vw); padding: 18px 20px 16px; margin-top: 6vh; }
.dialog h2 { margin: 0 0 4px; font-size: 16px; font-weight: var(--weight-semibold); }
.dialog .tgt { font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; }
.dialog table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 14px; }
.dialog td { padding: 6px 8px; border-top: 1px solid var(--surface-hairline); }
.dialog td:first-child { font-family: var(--font-mono); font-size: 11px; }
.dialog td.v { text-align: right; font-variant-numeric: tabular-nums; }
.dialog .acts { display: flex; justify-content: flex-end; gap: 8px; }
.btn2 { height: var(--control-h); padding: 0 14px; border-radius: var(--radius-md); border: 1px solid var(--border-default); }
.btn2:hover { background: var(--surface-hover); }
.btn2.pri { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-on-accent); font-weight: var(--weight-medium); }
.menu {
  position: fixed; z-index: var(--z-dropdown); min-width: 170px; padding: 4px; background: var(--bg-elevated);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--shadow-dropdown);
}
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; height: 28px; padding: 0 8px; border-radius: var(--radius-md); text-align: left; }
.menu button:hover { background: var(--surface-hover); }

/* ---------------------------------------------------------------- mockup controls (not part of the design) */
#mockbar {
  position: fixed; right: 14px; bottom: 14px; z-index: var(--z-overlay); font-size: 11px;
  background: var(--bg-elevated); border: 1px dashed var(--color-accent-secondary); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-dropdown); padding: 8px 10px; display: grid; gap: 6px; max-width: 330px;
}
#mockbar .mb-h { display: flex; align-items: center; gap: 8px; color: var(--color-accent-secondary); font-weight: var(--weight-semibold); letter-spacing: 0.06em; text-transform: uppercase; font-size: 10px; }
#mockbar .mb-r { display: flex; align-items: center; gap: 8px; }
#mockbar .mb-r > span { width: 44px; color: var(--text-secondary); }
#mockbar .seg { height: 22px; }
#mockbar .seg button { font-size: 11px; padding: 0 8px; }
#mockbar a { color: var(--color-accent); text-decoration: none; }
#mockbar a:hover { text-decoration: underline; }
#mockbar.min .mb-r, #mockbar.min .mb-l { display: none; }
