/*
 * Console (/app) styles: css/app.css. Tokens, buttons, forms, tables, tabs and tags come from css/np.css; this
 * sheet only adds the console's own pieces (framed windows, notebook cells, the decision graph, charts, cards).
 * Sections: 1 top and tabs  2 windows and layout  3 shared bits  4 observe  5 workshop  6 train  7 prove
 * 8 colony  9 mine  10 small screens  11 touch targets
 */

/* ------------------------------------------------------------------------------------------ 1 top and tabs */

.cn { background: var(--page); }
.cn-top { position: relative; isolation: isolate; overflow: clip; background: var(--ink-0); padding-top: calc(var(--hdr-space) + 32px); padding-bottom: 22px; }
.cn-top .stars { z-index: -1; opacity: .7; }
.cn-top-in { display: flex; flex-direction: column; gap: 16px; }
.cn-heading { display: flex; flex-direction: column; gap: 12px; }
.cn-heading .h2-sm { text-shadow: 3px 3px 0 #2a2622; }
.cn-status { display: flex; flex-wrap: wrap; gap: 6px; }
.cn-stat {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 10px;
  font-family: var(--f-mono); font-size: 12.5px; color: var(--fg-2); white-space: nowrap;
}
.cn-stat::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink-2); clip-path: var(--step-2); }
.cn-dot { width: 8px; height: 8px; background: var(--acc); box-shadow: 0 0 6px var(--acc); flex: none; }
.cn-status.is-down .cn-dot { background: var(--down); box-shadow: 0 0 6px var(--down); }
.cn-pill { font-family: var(--f-label); text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }
.cn-pill--live { color: var(--acc); }
.cn-pill--soon { color: var(--fg-3); }
.cn-pill--warn { color: var(--pending); }
@media (min-width: 768px) {
  .cn-top { padding-top: calc(var(--hdr-space) + 48px); padding-bottom: 28px; }
  .cn-top-in { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .cn-status { justify-content: flex-end; }
}

.cn-tabbar { position: sticky; top: var(--hdr-space); z-index: 40; background: var(--page); box-shadow: 0 1px 0 var(--ink-4); }
.cn-tabs { border-bottom: 0; gap: 2px; scroll-padding-inline: 16px; }
.cn-tab { min-height: 48px; padding: 0 14px; font-size: 14px; }
.cn-tab svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.cn-tab[aria-selected='true'] svg { opacity: 1; color: var(--acc); }
.cn-tab[aria-selected='true']::after { bottom: 0; }
.cn-tab:focus-visible { outline-offset: -3px; }
.cn-tabs.has-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 32px); mask-image: linear-gradient(90deg, transparent, #000 32px); }
.cn-tabs.has-right { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
.cn-tabs.has-left.has-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);
}

.cn-body { padding-top: 20px; padding-bottom: 72px; min-height: 60vh; }
.cn-banners { display: flex; flex-direction: column; gap: 8px; }
.cn-banners:not(:empty) { margin-bottom: 16px; }
.cn-banner { align-items: center; flex-wrap: wrap; justify-content: space-between; }
.cn-banner-text { flex: 1 1 260px; }
.cn-panel { animation: cn-in 260ms var(--ease-out) both; }
@keyframes cn-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------------------------------ 2 windows and layout */

.box {
  position: relative; min-width: 0; background: #0d0c0a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13);
}
.box::after {
  content: ''; position: absolute; inset: -4px; pointer-events: none;
  background: url('/img/ui/stud.svg') left top / 10px 10px no-repeat, url('/img/ui/stud.svg') right top / 10px 10px no-repeat,
    url('/img/ui/stud.svg') left bottom / 10px 10px no-repeat, url('/img/ui/stud.svg') right bottom / 10px 10px no-repeat;
  image-rendering: pixelated;
}
.box-bar {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 12px 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .015);
}
.box-dots { display: inline-flex; gap: 5px; flex: none; }
.box-dots i { width: 8px; height: 8px; background: #2e2924; display: block; }
.box-dots i:first-child { background: var(--acc-lo); }
.box-title { font-family: var(--f-label); text-transform: uppercase; font-size: 13px; font-weight: 400; letter-spacing: .05em; color: var(--fg-2); line-height: 1.1; min-width: 0; overflow-wrap: anywhere; }
.box-tag { margin-left: auto; font-family: var(--f-label); text-transform: uppercase; font-size: 11px; color: var(--fg-4); letter-spacing: .06em; white-space: nowrap; }
.box-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.box-tag + .box-actions { margin-left: 8px; }
.box-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 640px) { .box-body { padding: 20px; } }
.box { scroll-margin-top: calc(var(--hdr-space) + 64px); }
.box.is-wrong { box-shadow: inset 0 0 0 1px rgba(255, 107, 90, .45); }

.cn-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.cn-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cn-panel > * + * { margin-top: 20px; }
.ob-view > * + * { margin-top: 20px; }
@media (min-width: 1024px) {
  .cn-grid--side { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 24px; }
}
@media (min-width: 1280px) {
  .cn-grid--side { grid-template-columns: 380px minmax(0, 1fr); }
  .cn-grid--2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; }
}

/* ------------------------------------------------------------------------------------------ 3 shared bits */

.cn-label { font-family: var(--f-label); text-transform: uppercase; font-size: 12px; letter-spacing: .05em; color: var(--fg-3); }
.cn-ico { display: inline-flex; flex: none; }
.cn-ico svg { width: 100%; height: 100%; }
.cn-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 6px; }
.tag.tag--mono { text-transform: none; font-family: var(--f-mono); letter-spacing: 0; }
.cn-tile { position: relative; isolation: isolate; padding: 12px 12px 11px; gap: 8px; min-width: 0; }
.cn-tile::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink-2); clip-path: var(--step-2); }
.cn-tile .stat-k { font-size: 11px; }
.cn-tile .stat-v { font-size: 19px; overflow-wrap: anywhere; }
.cn-tile .stat-v.up { color: var(--up); }
.cn-tile .stat-v.down { color: var(--down); }
.cn-notice { flex-wrap: wrap; align-items: center; }
.cn-notice-text { flex: 1 1 220px; }
.cn-notice-act { display: flex; gap: 8px; flex-wrap: wrap; }
.cn-empty { padding: 28px 12px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cn-empty p { max-width: 460px; line-height: 1.35; }
.cn-empty-act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cn-skel { display: flex; flex-direction: column; gap: 10px; }
.cn-skel .skeleton { height: 18px; }
.cn-skel .skeleton:first-child { height: 34px; width: 55%; }
.cn-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cn-foot { margin-top: -4px; line-height: 1.4; }
.cn-kv dd { text-align: left; }
.cn-intro { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.cn-copy {
  position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px;
  font-family: var(--f-label); text-transform: uppercase; font-size: 12px; color: var(--fg-2);
}
.cn-copy::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink-3); clip-path: var(--step-2); }
.cn-copy:hover { color: var(--fg); }
.cn-copy .cn-ico { width: 14px; height: 14px; }

/* segmented control */
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg-btn {
  position: relative; isolation: isolate; flex: 1 0 auto; min-height: 40px; min-width: 52px; padding: 0 12px;
  font-family: var(--f-label); text-transform: uppercase; font-size: 13px; letter-spacing: .03em; color: var(--fg-3);
}
.seg-btn::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink-2); clip-path: var(--step-2); box-shadow: inset 0 0 0 2px var(--ink-4); }
.seg-btn:hover { color: var(--fg); }
.seg-btn[aria-checked='true'] { color: var(--on-acc); }
.seg-btn[aria-checked='true']::before { background: var(--acc); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .3), inset -2px -2px 0 rgba(0, 40, 15, .3); }
.seg-btn:focus-visible { outline-offset: 2px; }
@media (pointer: coarse) { .seg-btn { min-height: 44px; } }

.cn-table { font-size: 14px; }
.cn-table td, .cn-table th { padding: 10px; }
.cn-table tr.is-wrong td { background: rgba(255, 107, 90, .06); }
.cn-table tr.is-wrong td:first-child { box-shadow: inset 2px 0 0 var(--down); }

/* transaction status line */
.txline { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.35; color: var(--fg-2); }
.txline-dot { width: 8px; height: 8px; margin-top: 5px; flex: none; background: var(--fg-3); }
.txline--pending .txline-dot { background: var(--pending); animation: blink 1s steps(1) infinite; }
.txline--ok .txline-dot { background: var(--acc); }
.txline--warn .txline-dot { background: var(--pending); }
.txline--err { color: var(--down); }
.txline--err .txline-dot { background: var(--down); }
.txline .link { white-space: nowrap; }

/* ------------------------------------------------------------------------------------------ 4 observe */

.ob-find { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.ob-find-btns { display: flex; gap: 8px; }
.ob-find .btn { min-height: 44px; }
.ob-picks-wrap { display: flex; flex-direction: column; gap: 10px; }
.ob-picks { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 1023px) {
  .ob-picks { flex-direction: row; max-height: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-snap-type: x proximity; padding-bottom: 2px; }
  .ob-picks::-webkit-scrollbar { display: none; }
  .ob-pick { flex: none; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 136px; max-width: 200px; scroll-snap-align: start; }
  .ob-pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
}
.ob-pick, .wv-polyp {
  position: relative; isolation: isolate; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px;
  min-height: 44px; padding: 8px 12px; text-align: left;
}
.ob-pick::before, .wv-polyp::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink-2); clip-path: var(--step-2); transition: background-color var(--t-fast) var(--ease); }
.ob-pick:hover::before, .wv-polyp:hover::before { background: var(--ink-3); }
.ob-pick-name, .wv-polyp-name { font-family: var(--f-body); font-size: 15px; color: var(--fg); }
.ob-pick-meta, .wv-polyp-meta { font-family: var(--f-mono); font-size: 12px; color: var(--fg-3); }
.wv-list { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.pv-head { display: flex; flex-direction: column; gap: 12px; }
.pv-name { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pv-name .h3 { overflow-wrap: anywhere; }
.pv-id { color: var(--fg-3); font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-open { position: relative; isolation: isolate; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; padding: 16px; }
.pv-open::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink-1); box-shadow: inset 2px 0 0 var(--acc); }
.pv-open-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pv-p { font-family: var(--f-display); font-size: 40px; line-height: 1; letter-spacing: -.5px; color: var(--fg); }
.pv-p small { font-family: var(--f-label); text-transform: uppercase; font-size: 13px; letter-spacing: .04em; color: var(--fg-3); }
.pv-p.up { color: var(--up); }
.pv-p.down { color: var(--down); }
.pv-when { font-size: 14px; color: var(--fg-3); }
.pv-count { font-size: 14px; color: var(--pending); }
.pv-open .txline { flex: 1 0 100%; }
.pv-choice { width: auto; min-width: 0; max-width: 220px; min-height: 36px; padding-block: 6px; font-size: 14px; }
/* phones: the call picker gets its own row under the title, so its label is never cut */
@media (max-width: 479px) {
  .pv-gbox .box-bar { flex-wrap: wrap; padding-block: 8px; }
  .pv-gbox .box-actions { flex: 1 0 100%; margin-left: 0; }
  .pv-gbox .pv-choice { width: 100%; max-width: none; }
}
.pv-verdict { font-size: 14px; line-height: 1.4; color: var(--fg-2); }
.pv-rowbtn { font-family: var(--f-mono); font-size: 13px; color: var(--fg); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .25); text-underline-offset: 3px; min-height: 32px; text-align: left; }
.pv-rowbtn:hover { color: var(--acc-hi); }

/* decision graph */
.dg { position: relative; min-height: 200px; }
.dg-scroll { overflow: hidden; }
.dg-svg { display: block; overflow: visible; max-width: none; }
.dg-svg .e-pos { stroke: var(--acc); }
.dg-svg .e-neg { stroke: #a49d92; }
.dg-svg .e-zero { stroke: #3a342e; }
.dg-svg .n-in { fill: #141210; stroke: #5c564e; stroke-width: 1.5; }
.dg-svg .n-in.is-pos { stroke: var(--acc); }
.dg-svg .n-in.is-neg { stroke: #a49d92; }
.dg-svg .n-fill-pos { fill: var(--acc); }
.dg-svg .n-fill-neg { fill: #a49d92; }
.dg-svg .n-hid { fill: #141210; stroke: #5c564e; stroke-width: 1.5; }
.dg-svg .n-hid.is-on { fill: var(--acc); stroke: var(--acc-hi); }
.dg-svg .n-out { fill: #141210; stroke: #5c564e; stroke-width: 2; }
.dg-svg .n-out.is-up { fill: var(--acc-deep); stroke: var(--acc); }
.dg-svg .n-out.is-down { fill: #3a1814; stroke: var(--down); }
.dg-svg .g-lab { font-family: var(--f-label); font-size: 11px; fill: var(--fg-2); text-transform: uppercase; letter-spacing: .03em; }
.dg-svg .g-val { font-family: var(--f-mono); font-size: 11px; fill: var(--fg-3); }
.dg-svg .g-idx { font-family: var(--f-mono); font-size: 11px; fill: var(--fg-2); }
.dg-svg .g-z { font-family: var(--f-mono); font-size: 10px; fill: var(--fg); }
.dg-svg .g-big { font-family: var(--f-mono); font-size: 18px; fill: var(--fg); }
.dg-svg .g-cap { font-family: var(--f-label); font-size: 11px; fill: var(--fg-4); text-transform: uppercase; letter-spacing: .06em; }
.dg-svg .bar-bg { fill: #26221e; }
.dg-svg .bar-up { fill: var(--acc); }
.dg-svg .bar-down { fill: var(--down); }
.dg-svg line { transition: stroke-opacity var(--t-med) var(--ease); }
.dg-legend { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 0 0 6px; padding: 0; list-style: none; font-size: 13px; }
.dg-legend li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 26px; padding: 0 6px; background: var(--ink-1); }
.dg-n { font-family: var(--f-mono); color: var(--fg-3); }
.dg-f { font-family: var(--f-label); text-transform: uppercase; font-size: 12px; color: var(--fg-2); }
.dg-x { font-family: var(--f-mono); font-size: 12px; color: var(--fg-3); }
.dg-x.up { color: var(--up); }
.dg-x.down { color: #a49d92; }

/* ------------------------------------------------------------------------------------------ 5 workshop */

.ws-feat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ws-feats { display: flex; flex-direction: column; gap: 6px; }
.ws-feat { display: grid; grid-template-columns: 20px minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .9fr) 40px; gap: 6px; align-items: center; }
.ws-feat .select { min-height: 40px; padding: 6px 28px 6px 8px; font-size: 14px; background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; }
.ws-n { color: var(--fg-4); font-size: 12px; text-align: center; }
.ws-rm { display: inline-grid; place-items: center; width: 40px; height: 40px; color: var(--fg-3); }
.ws-rm:hover { color: var(--down); }
.ws-rm:disabled { opacity: .3; cursor: not-allowed; }
.ws-rm .cn-ico { width: 14px; height: 14px; }
.ws-checks { display: flex; flex-wrap: wrap; gap: 0 20px; font-size: 15px; color: var(--fg-2); }
@media (pointer: coarse) { .ws-feat .select { min-height: 44px; } .ws-rm { width: 44px; height: 44px; } .ws-feat { grid-template-columns: 18px minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .9fr) 44px; } }

.nb { display: flex; flex-direction: column; gap: 10px; }
.nb-cell { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; animation: cn-in 320ms var(--ease-out) both; }
.nb-gutter { font-size: 12px; color: var(--fg-4); padding-top: 9px; }
.nb-cell.is-run .nb-gutter { color: var(--pending); }
.nb-cell.is-done .nb-gutter { color: var(--acc-lo); }
.nb-cell.is-err .nb-gutter { color: var(--down); }
.nb-main { min-width: 0; background: var(--ink-1); box-shadow: inset 2px 0 0 var(--ink-4); }
.nb-cell.is-run .nb-main { box-shadow: inset 2px 0 0 var(--pending); }
.nb-cell.is-done .nb-main { box-shadow: inset 2px 0 0 var(--acc-lo); }
.nb-cell.is-err .nb-main { box-shadow: inset 2px 0 0 var(--down); }
.nb-code { padding: 8px 12px; font-size: 12.5px; color: var(--acc); border-bottom: 1px solid rgba(255, 255, 255, .05); overflow-wrap: anywhere; }
.nb-out { padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 3px; font-family: var(--f-mono); font-size: 12.5px; line-height: 1.45; color: var(--fg-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.nb-line.dim { color: var(--fg-4); }
.nb-line.err { color: var(--down); }

.ws-bal-wrap { display: flex; flex-direction: column; gap: 8px; }
.ws-bal { display: flex; height: 12px; gap: 2px; }
.ws-bal span { width: var(--w); min-width: 2px; }
.ws-bal-up { background: var(--acc); }
.ws-bal-down { background: var(--down); }
.ws-bal-flat { background: var(--fg-4); }
.ws-bal-keys { display: flex; gap: 16px; font-size: 12px; color: var(--fg-3); }
.ws-bal-keys span::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: 0; }
.ws-bal-keys .k-up::before { background: var(--acc); }
.ws-bal-keys .k-down::before { background: var(--down); }
.ws-bal-keys .k-flat::before { background: var(--fg-4); }
.ws-fp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px; background: var(--ink-1); }
.ws-fp-v { color: var(--fg); font-size: 14px; }
.ws-fp .help { flex: 1 0 100%; }

/* ------------------------------------------------------------------------------------------ 6 train */

.tr-ds { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.tr-ds .notice { width: 100%; }
.tr-ds-v { font-size: 15px; color: var(--fg); }
.tr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tr-stages { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.tr-stage { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 32px; padding: 0 10px; background: var(--ink-1); font-size: 14px; color: var(--fg-3); }
.tr-stage-dot { width: 8px; height: 8px; background: var(--ink-4); }
.tr-stage.is-run { color: var(--fg); }
.tr-stage.is-run .tr-stage-dot { background: var(--pending); animation: blink 1s steps(1) infinite; }
.tr-stage.is-done { color: var(--fg-2); }
.tr-stage.is-done .tr-stage-dot { background: var(--acc); }
.tr-stage.is-err .tr-stage-dot { background: var(--down); }
.tr-stage-v { font-size: 12px; color: var(--fg-3); text-align: right; }
.tr-genome { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--ink-1); }
.tr-bytes { display: block; font-size: 12px; line-height: 1.6; color: var(--fg-3); overflow-wrap: anywhere; word-break: break-all; }
.tr-spawn { display: grid; gap: 14px; }
@media (min-width: 640px) { .tr-spawn { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* loss chart */
.lc { display: flex; flex-direction: column; gap: 10px; }
.lc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--fg-2); }
.lc-key { display: inline-flex; align-items: center; gap: 8px; }
.lc-key i { display: inline-block; width: 18px; height: 0; border-top: 2px solid; }
.lc-key--train i { border-color: #25a955; }
.lc-key--valid i { border-color: #8f7be6; border-top-style: dashed; }
.lc-key--best i { width: 0; height: 12px; border-top: 0; border-left: 1px dotted var(--fg-2); }
.lc-plot { position: relative; width: 100%; }
.lc-canvas { display: block; width: 100%; height: 220px; touch-action: pan-y; cursor: crosshair; }
.lc-tip {
  position: absolute; z-index: 2; width: 150px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; pointer-events: none;
  background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--ink-4), 0 8px 20px rgba(0, 0, 0, .5); font-family: var(--f-mono); font-size: 12px; color: var(--fg-2);
}
.lc-tip b { font-family: var(--f-label); font-weight: 400; text-transform: uppercase; font-size: 11px; color: var(--fg); letter-spacing: .04em; }
.lc-tip-row { display: flex; align-items: center; gap: 6px; }
.lc-sw { width: 10px; height: 0; border-top: 2px solid; display: inline-block; }
.lc-sw--train { border-color: #25a955; }
.lc-sw--valid { border-color: #8f7be6; border-top-style: dashed; }

/* ------------------------------------------------------------------------------------------ 7 prove */

.pg-sub { font-size: 14px; color: var(--fg-3); line-height: 1.4; }
.pg-gates { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.pg-gate { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: 'ico name tag' 'ico detail tag'; gap: 2px 12px; align-items: center; padding: 12px; background: var(--ink-1); }
.pg-gate .pg-ico { grid-area: ico; width: 18px; height: 18px; }
.pg-gate .pg-ico .cn-ico { width: 18px; height: 18px; }
.pg-gate.is-pass { box-shadow: inset 2px 0 0 var(--acc); }
.pg-gate.is-pass .pg-ico { color: var(--acc); }
.pg-gate.is-fail { box-shadow: inset 2px 0 0 var(--down); }
.pg-gate.is-fail .pg-ico { color: var(--down); }
.pg-name { grid-area: name; font-family: var(--f-label); text-transform: uppercase; font-size: 14px; color: var(--fg); letter-spacing: .02em; }
.pg-detail { grid-area: detail; font-size: 12.5px; color: var(--fg-3); overflow-wrap: anywhere; }
.pg-gate.has-note { grid-template-areas: 'ico name tag' 'ico detail tag' 'ico note tag'; }
.pg-note { grid-area: note; font-size: 12.5px; line-height: 1.35; color: var(--fg-3); overflow-wrap: anywhere; }
.pg-gate .tag { grid-area: tag; }
.pg-verdict { font-size: 15px; line-height: 1.35; }
.pg-pick { display: grid; grid-template-columns: minmax(0, 220px) auto; justify-content: start; gap: 8px; }
.pg-chain { display: flex; flex-direction: column; gap: 14px; }
.pg-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.pg-pulses { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; list-style: none; }
.pg-pulse { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 64px; gap: 8px; align-items: center; min-height: 34px; padding: 0 10px; background: var(--ink-1); font-size: 13px; color: var(--fg-2); }
.pg-res { font-family: var(--f-label); text-transform: uppercase; font-size: 11px; text-align: right; color: var(--fg-3); }
.pg-pulse.is-hit .pg-res { color: var(--up); }
.pg-pulse.is-miss { box-shadow: inset 2px 0 0 var(--down); }
.pg-pulse.is-miss .pg-res { color: var(--down); }
.pg-pulse.is-open .pg-res { color: var(--pending); }
.pg-open { align-self: flex-start; min-height: 36px; font-size: 15px; }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bars-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 60px; gap: 10px; align-items: center; font-size: 13px; }
.bars-label { color: var(--fg-2); font-family: var(--f-label); text-transform: uppercase; font-size: 12px; letter-spacing: .02em; }
.bars-track { height: 14px; background: var(--ink-1); }
.bars-fill { display: block; height: 100%; width: var(--w); background: var(--fg-4); border-radius: 0 3px 3px 0; }
.bars-fill.is-float { background: #8f7be6; }
.bars-fill.is-model { background: var(--acc); }
.bars-val { font-family: var(--f-mono); color: var(--fg); text-align: right; }

.cal { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cal-svg { width: 100%; max-width: 420px; height: auto; overflow: visible; }
.cal-grid { stroke: rgba(255, 255, 255, .06); }
.cal-ax { font-family: var(--f-mono); font-size: 10px; fill: var(--fg-3); }
.cal-diag { stroke: var(--fg-4); stroke-dasharray: 4 4; }
.cal-line { fill: none; stroke: var(--acc); stroke-width: 2; stroke-linejoin: round; }
.cal-dot { fill: var(--acc); stroke: #0d0c0a; stroke-width: 2; }
.cal-cap { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--fg-3); }
.cal-key::before { content: ''; display: inline-block; width: 16px; margin-right: 8px; vertical-align: middle; border-top: 2px solid var(--acc); }
.cal-key--diag::before { border-top: 1px dashed var(--fg-4); }

/* ------------------------------------------------------------------------------------------ 8 colony */

.co-bar { display: flex; flex-direction: column; gap: 8px; }
.co-name { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 40px; text-align: left; color: var(--fg); font-size: 15px; }
.co-name:hover span:first-child { color: var(--acc-hi); text-decoration: underline; text-underline-offset: 3px; }
.co-sub { font-family: var(--f-mono); font-size: 11.5px; color: var(--fg-4); }
.co-table td { padding-block: 8px; }
@media (min-width: 640px) { .co-sub-mk { display: none; } }
@media (min-width: 640px) { .co-bar { flex-direction: row; align-items: center; justify-content: space-between; } }

/* ------------------------------------------------------------------------------------------ 9 mine */

.mn-top:empty { display: none; }
.mn-tips { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 14px 16px; }
.mn-tips::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ink-1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.mn-tips > div { display: flex; align-items: baseline; gap: 12px; }
.mn-tips-v { font-size: 18px; color: var(--fg); }
.mn-tips .help { grid-column: 1; }
.mn-tips .btn { grid-column: 2; grid-row: 1 / span 2; }
.mn-tips .txline { grid-column: 1 / -1; }
.mn-cards { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1280px) { .mn-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mn-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px; background: var(--ink-1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.mn-art { min-width: 0; }
.mn-img { width: 96px; height: 96px; image-rendering: pixelated; background: var(--ink-0); box-shadow: 0 0 0 1px var(--ink-4); }
.mn-img--none { display: grid; place-items: center; font-size: 12px; color: var(--fg-4); }
.mn-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mn-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 10px; }
.mn-head .h4 { overflow-wrap: anywhere; }
.mn-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0; }
.mn-kv > div { display: flex; flex-direction: column; gap: 2px; }
.mn-kv dt { font-family: var(--f-label); text-transform: uppercase; font-size: 11px; color: var(--fg-4); letter-spacing: .04em; }
.mn-kv dd { margin: 0; font-family: var(--f-mono); font-size: 14px; color: var(--fg); }
.mn-kv dd.up { color: var(--up); }
.mn-kv dd.down { color: var(--down); }
.mn-pulse { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 14px; color: var(--fg-2); }
.mn-forms { display: grid; gap: 8px; }
.mn-form { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 8px; max-width: 460px; }
.mn-form .btn { min-height: 44px; padding-inline: 12px; }
.mn-input { position: relative; min-width: 0; }
.mn-input .input { padding-right: 58px; }
.mn-max { position: absolute; right: 0; top: 0; bottom: 0; width: 56px; font-family: var(--f-label); text-transform: uppercase; font-size: 12px; color: var(--acc); }
.mn-max:hover { color: var(--acc-hi); }
.mn-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.mn-acts .btn { min-height: 44px; }
/* phones: the art sits beside the name, everything else takes the full card width */
@media (max-width: 479px) {
  .mn-card { grid-template-columns: 72px minmax(0, 1fr); gap: 12px 14px; align-items: center; }
  .mn-img { width: 72px; height: 72px; }
  .mn-main { display: contents; }
  .mn-main > * { grid-column: 1 / -1; }
  .mn-main > .mn-head { grid-column: 2; grid-row: 1; }
  .mn-form { max-width: none; }
}
@media (min-width: 640px) {
  .mn-card { grid-template-columns: 160px minmax(0, 1fr); gap: 20px; padding: 18px; }
  .mn-img { width: 160px; height: 160px; }
  .mn-kv { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------------------------------------ 10 small screens */

.hide-col-sm, .hide-col-md { display: none; }
@media (min-width: 640px) { .hide-col-sm { display: table-cell; } }
@media (min-width: 900px) { .hide-col-md { display: table-cell; } }
@media (max-width: 639px) {
  .cn-tab { padding: 0 12px; font-size: 13px; gap: 6px; }
  .box-bar { min-height: 40px; padding-inline: 12px; }
  .box-dots { display: none; }
  .pv-p { font-size: 34px; }
  .cn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cn-tile .stat-v { font-size: 17px; }
  .ob-find--stack { grid-template-columns: minmax(0, 1fr); }
  .ob-find--stack .btn { width: 100%; }
  .ob-find-btns .btn { flex: 1; }
  .cn-actions .btn { flex: 1 1 auto; }
  .bars-row { grid-template-columns: 82px minmax(0, 1fr) 54px; }
  .pg-pick { grid-template-columns: minmax(0, 1fr) auto; justify-content: stretch; }
  .ws-checks { flex-direction: column; }
}
@media (max-width: 359px) {
  .ws-feat { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .ws-n { display: none; }
  .cn-tile { padding: 10px; }
}

/* ------------------------------------------------------------------------------------------ 11 touch targets */

/* On a touch screen (or any phone-width window) every console control is at least 44 px tall; the drawn look
   stays the same, only the box grows. */
@media (pointer: coarse), (max-width: 639px) {
  .cn .btn { min-height: 44px; }
  .cn .btn--sm { padding-block: 10px; }
  .cn .filter, .cn .cn-copy, .cn .pv-choice, .cn .pg-open, .cn .co-name, .cn .pv-rowbtn { min-height: 44px; }
  .cn .pv-rowbtn, .cn .co-name { min-width: 44px; }
  .cn .filter { min-width: 44px; justify-content: center; }
  .cn .box-bar { min-height: 52px; }
}
