/* Additions for the live build: real images, sign-in screen, states the mockup only faked. */
html, body { margin: 0; min-height: 100%; }
html { scroll-padding-top: 84px; scroll-behavior: auto; }
body { background: var(--studio-haze); }
html.dark, html.dark body { background: #141416; color-scheme: dark; }
#dash { min-height: 100vh; }
[hidden] { display: none !important; }

/* previews */
.thumb { overflow: hidden; }
.thumb img, .bigprev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bigprev { overflow: hidden; }
.bigprev .src { z-index: 1; padding: 3px 7px; border-radius: 8px; background: color-mix(in srgb, var(--studio) 78%, transparent); }
.modal.wide .bigprev img { object-fit: contain; background: var(--studio-edge); }

/* sign-in / no access */
.lockwrap { min-height: calc(100vh - 84px); display: grid; place-items: center; padding: 24px 16px; }
.lockcard { width: min(420px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 14px; text-align: center; align-items: center; }
.lockcard .pv-primary { width: 100%; height: 48px; }

/* banner under the monitor heading for errors from actions */
.banner { padding: 10px 14px; border-radius: 14px; font: 500 13px/1.35 var(--font-sans); background: var(--well); color: var(--ink); }
.banner.error { box-shadow: inset 3px 0 0 var(--ink); }

/* tools that are not live yet are plain text, not controls */
.tile.soon { cursor: default; opacity: .62; box-shadow: none; background: transparent; border-style: dashed; }
.tile.soon:hover, .tile.soon:active { transform: none; }

/* the kit's `.pv button { font: inherit }` outranks `.mini` and was enlarging small buttons */
.dash .mini { font: 500 12px/1 var(--font-sans); }

/* buttons that can't run right now */
.ibtn[disabled], .mini[disabled] { opacity: .45; cursor: not-allowed; }
.ibtn[disabled]:hover, .ibtn[disabled]:active { transform: none; box-shadow: none; }

/* job panel content */
.kv.compact .path b { word-break: break-all; white-space: normal; font-weight: 500; }
.logbox { font: 400 11px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--body); white-space: pre-wrap; word-break: break-word;
  background: var(--well); border-radius: 12px; padding: 10px 12px; max-height: none; }
.logbox.err { color: var(--ink); }
.isec-title { font: 600 10px/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.srvlist { display: flex; flex-direction: column; gap: 6px; }
.srvlist label { display: flex; align-items: center; gap: 8px; font: 500 12px/1.2 var(--font-sans); }

/* node detail panel under an expanded row */
.nt-panel { padding: 4px 0 14px 20px; display: flex; flex-direction: column; gap: 8px; }
.nt-panel .kvgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 18px; }
.nt-panel .kvgrid div { display: flex; justify-content: space-between; gap: 10px; font: 400 12px/1.3 var(--font-sans); color: var(--muted); border-bottom: 1px solid var(--well); padding-bottom: 4px; }
.nt-panel .kvgrid b { color: var(--ink); font-weight: 500; text-align: right; }
.nt-actions .note { font: 400 11px/1.3 var(--font-sans); color: var(--muted); }

/* archived rows: no actions */
.qrow.ro { cursor: default; }
.qrow input[disabled] { visibility: hidden; }

/* diagnostics list */
.diag-item.error b { color: var(--ink); }

/* account menu under the avatar */
.whowrap { position: relative; }
.whowrap > .who { border: 0; cursor: pointer; }
.whomenu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 220px; padding: 14px; display: flex; flex-direction: column; gap: 6px; border-radius: 18px; }
.whomenu b { font: 600 13px/1.2 var(--font-sans); }
.whomenu .mini { display: inline-flex; align-items: center; justify-content: center; margin-top: 6px; }

/* Scripts & plugins: real folders hold 140+ items, so the cards drop the big preview box
   and show the kind icon inline. */
#scripts .tool { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
#scripts .tool .pv { aspect-ratio: auto; width: 40px; height: 40px; border-radius: 12px; flex: none; }
#scripts .tool .pv svg { width: 20px; height: 20px; }
#scripts .tool .hd { flex: 1 1 0; padding: 0; }
#scripts .tool p, #scripts .tool .ft { flex-basis: 100%; }
#scripts .tool p { min-height: 0; }
#scripts .tool p:not(.label) { min-height: 17px; }
#scripts .tool { min-width: 0; overflow: hidden; }
#scripts .tool .ft { min-width: 0; width: 100%; }
#scripts .tool .ft .mini { flex: none; }

/* Teknion products: real catalog images (white-background JPGs) */
.kprod { gap: 10px; }
.kprod .kimg { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #fff; }
.kprod .kimg img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kprod .kimg .tag { position: absolute; left: 10px; top: 10px; background: var(--pill-top); }
.kprod .mini { display: inline-flex; align-items: center; }
.kprod .kdl { background: linear-gradient(180deg, var(--obsidian-top), var(--obsidian-bottom)); color: var(--on-obsidian); border-color: var(--obsidian-edge); }
#teknion .tcard { height: 720px; }
#teknion .kselect { height: 36px; min-width: 240px; padding: 0 12px; border-radius: var(--radius-pill); }

/* Ideas board */
.dash .ipost, .dash .mini.voted { background: linear-gradient(180deg, var(--obsidian-top), var(--obsidian-bottom)); color: var(--on-obsidian); border-color: var(--obsidian-edge); }

/* ---------- Top bar menu: one pill that scrolls sideways as a unit ----------
   Swipe or drag it; it also scrolls itself to the current section. Edge fades say there is more. */
.bar > nav.scrollx { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; border-radius: var(--radius-pill); }
.bar > nav .navlinks { width: max-content; min-width: 100%; }
.bar > nav.more-right { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
.bar > nav.more-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px); mask-image: linear-gradient(90deg, transparent, #000 32px); }
.bar > nav.more-left.more-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
.bar > nav.dragging { cursor: grabbing; }
.bar > nav.dragging a { pointer-events: none; }

/* the primary button never wraps its label */
.pv-primary-main { min-width: 0; }
.pv-primary-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-primary-meta { flex: none; white-space: nowrap; }

/* two-column read-outs: every row starts flush left */
@media (max-width: 760px) {
  .stats > .stat:nth-child(odd), .minis > .mini-stat:nth-child(odd) { border-left: 0; padding-left: 0 !important; }
}

/* ---------- Phones ---------- */
@media (max-width: 560px) {
  .sitebar { padding: 8px 12px 0; }
  .dash .wrap { padding-left: 12px; padding-right: 12px; }
  /* bar: brand and controls on one row, the menu on the next */
  .bar { gap: 8px; padding: 6px 6px 6px 12px; row-gap: 6px; }
  .bar .clocks { display: none; }
  .bar .brand { gap: 8px; font-size: 14px; }
  .bar .themebtn { width: 36px; height: 36px; }
  .bar .avatar { width: 32px; height: 32px; }
  .bar > nav { margin: 0 -2px; }
  .navlinks > a { height: 30px; padding: 0 12px; }
  .navknob { height: 30px; }
  .hero-title { font-size: 28px; }

  /* home node table: node, GPU, what it is doing */
  .nt-row { grid-template-columns: 8px 60px 44px minmax(0, 1fr); gap: 10px; }
  .nodetable:not(.nt2) .nt-row > :nth-child(4) { display: none; }

  /* monitor node table: node, state, job, GPU (the rest is in the row's panel) */
  .qwrap > .nt2 { min-width: 0; }
  .nt2 .nt-row { grid-template-columns: 8px 54px 72px minmax(0, 1fr) auto; }
  .nt2 .nt-row > :nth-child(7) { white-space: nowrap; text-align: right; }
  .nt2 .nt-row > :nth-child(5), .nt2 .nt-row > :nth-child(6), .nt2 .nt-row > :nth-child(8),
  .nt2 .nt-row > :nth-child(9), .nt2 .nt-row > :nth-child(10), .nt2 .nt-row > :nth-child(11) { display: none; }
  .nt2 .nt-row > :nth-child(4) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nt-panel { padding-left: 0; }

  /* queue: checkbox, preview, name over progress, state over priority */
  .qtable { min-width: 0; }
  .qrow { grid-template-columns: 18px 48px minmax(0, 1fr) auto; grid-auto-rows: auto; gap: 4px 10px; padding: 8px 6px; }
  .qrow > :nth-child(2), .qrow > :nth-child(7), .qrow > :nth-child(8), .qrow > :nth-child(9) { display: none; }
  .qrow > :nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
  .qrow > :nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
  .qrow > :nth-child(4) { grid-column: 3; grid-row: 1; }
  .qrow > :nth-child(5) { grid-column: 4; grid-row: 1; justify-self: end; }
  .qrow > :nth-child(6) { grid-column: 3; grid-row: 2; }
  .qrow > :nth-child(10) { grid-column: 4; grid-row: 2; }
  .qrow .thumb { width: 48px; }
  .qhead > :nth-child(3), .qhead > :nth-child(6) { display: none; }
}
