:root {
  --bg: rgba(10, 14, 22, 0.82);
  --line: rgba(255, 255, 255, 0.08);
  --fg: #e5e7eb;
  --dim: #9ca3af;
  --acc: #facc15;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #0b0f17;
  color: var(--fg);
  font:
    13px/1.45 system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
  overflow: hidden;
}
#app {
  position: fixed;
  inset: 0;
}
#app canvas {
  display: block;
}
#labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.bubble {
  background: #fff;
  color: #111;
  padding: 5px 9px;
  border-radius: 12px;
  font-size: 12px;
  max-width: 190px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  position: relative;
  white-space: normal;
  line-height: 1.25;
}
.bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
  transform: translateX(-50%);
}
.panel {
  position: fixed;
  background: var(--bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  z-index: 5;
}
.panels-hidden .panel {
  display: none;
}
#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: linear-gradient(rgba(10, 14, 22, 0.9), rgba(10, 14, 22, 0.5));
  z-index: 6;
}
#hud .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
#hud .brand img {
  display: block;
  height: 32px;
  width: auto;
}
#hud .brand span {
  color: var(--dim);
  white-space: nowrap;
}
#hud .brand .about {
  color: var(--acc);
  text-decoration: none;
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid rgba(250, 204, 21, 0.35);
  border-radius: 999px;
  white-space: nowrap;
}
#hud .brand .about:hover {
  background: rgba(250, 204, 21, 0.12);
}
#intro .introlinks a {
  color: var(--acc);
}
#hud .mid {
  display: flex;
  gap: 10px;
  align-items: center;
}
.pill {
  background: rgba(250, 204, 21, 0.15);
  color: var(--acc);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 600;
}
.mono {
  font-family: var(--mono);
}
.coin {
  color: #fff;
  font-weight: 600;
}
#hud .right {
  display: flex;
  gap: 6px;
}
button,
.btn {
  background: #1f2937;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.btn:hover {
  background: #374151;
}
button.on {
  background: var(--acc);
  color: #111;
  font-weight: 700;
}
button.primary,
.btn.primary {
  background: var(--acc);
  color: #111;
  font-weight: 700;
}
.hidden {
  display: none !important;
}
#left {
  top: 56px;
  left: 10px;
  width: 250px;
  max-height: calc(100vh - 230px);
  overflow: auto;
}
#right {
  top: 56px;
  right: 10px;
  width: 300px;
  max-height: calc(100vh - 230px);
  overflow: auto;
}
#bottom {
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 150px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
}
h3 {
  margin: 0 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--acc);
}
h3 small {
  color: var(--dim);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  margin-left: 6px;
}
#roster {
  list-style: none;
  margin: 0;
  padding: 0;
}
#roster li {
  display: grid;
  grid-template-columns: 10px 1fr;
  grid-template-areas: 'sw nm' 'sw ti' 'sw st';
  gap: 0 8px;
  padding: 5px 6px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
#roster li:hover {
  background: rgba(255, 255, 255, 0.05);
}
#roster li.sel {
  border-color: var(--acc);
  background: rgba(250, 204, 21, 0.08);
}
#roster .sw {
  grid-area: sw;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
#roster .nm {
  grid-area: nm;
  font-weight: 600;
}
#roster .ti {
  grid-area: ti;
  color: var(--dim);
  font-size: 11px;
}
#roster .st {
  grid-area: st;
  color: #93c5fd;
  font-size: 11px;
}
#brain.empty .content {
  display: none;
}
#brain:not(.empty) .placeholder {
  display: none;
}
.placeholder {
  color: var(--dim);
  padding: 6px 0 10px;
}
.sub {
  color: var(--dim);
  font-size: 11px;
}
.status {
  color: #93c5fd;
  margin-bottom: 6px;
}
.brainrow {
  display: flex;
  gap: 10px;
  align-items: center;
}
.bars {
  flex: 1;
}
.bar {
  position: relative;
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  margin: 4px 0;
  overflow: hidden;
}
.bar label {
  position: absolute;
  left: 6px;
  top: 0;
  font-size: 9px;
  line-height: 12px;
  color: #fff;
  z-index: 1;
  text-shadow: 0 1px 2px #000;
}
.bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: #f59e0b;
  transition: width 0.1s linear;
}
.bar i.pink {
  background: #ec4899;
}
.bar i.cyan {
  background: #22d3ee;
}
.bar i.grey {
  background: #6b7280;
}
.bar i.brown {
  background: #a16207;
}
.bar i.green {
  background: #22c55e;
}
.bar.split i.r {
  left: auto;
  right: 0;
  background: #3b82f6;
}
#vfb {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.ok {
  color: #4ade80;
}
.warn {
  color: #fbbf24;
}
.tiny {
  font-size: 11px;
  color: var(--dim);
}
a {
  color: #93c5fd;
}
.vfb {
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.vfb a {
  text-decoration: none;
}
.vfb b {
  color: var(--acc);
  margin-right: 4px;
}
.vfb .model {
  font-size: 11px;
  color: #d1d5db;
}
.vfb .def {
  font-size: 10px;
  color: var(--dim);
  margin-top: 2px;
}
#progress .prog {
  margin-bottom: 6px;
}
#progress label {
  font-size: 11px;
  color: var(--dim);
}
.track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
.track i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22c55e, #facc15);
  transition: width 0.4s;
}
#feed {
  overflow: auto;
  font-size: 11.5px;
  padding-right: 4px;
}
.log {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.log .t {
  color: var(--dim);
  font-family: var(--mono);
  margin-right: 6px;
}
.log.speech {
  color: #cbd5e1;
}
.log.speech b {
  color: #fde68a;
}
.log.speech i {
  color: var(--dim);
  font-style: normal;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 16px;
}
.card {
  background: #111827;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px;
  width: min(560px, 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  max-height: 92vh;
  overflow: auto;
}
.card.wide {
  width: min(900px, 100%);
}
.card h1 {
  margin: 0 0 8px;
  font-size: 26px;
}
.card h1 .logo {
  display: block;
  width: 232px;
  max-width: 70%;
  height: auto;
  margin: -4px auto 10px;
}
.card p {
  color: #d1d5db;
}
.card input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0b0f17;
  color: #fff;
  margin: 8px 0 12px;
}
.row {
  display: flex;
  gap: 8px;
}
.row.wrap {
  flex-wrap: wrap;
  margin-top: 12px;
}
.row .primary {
  flex: 1;
}
.x {
  position: absolute;
  top: 12px;
  right: 12px;
}
.res-head {
  display: flex;
  gap: 18px;
  align-items: center;
}
#resLogo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.ticker {
  font-family: var(--mono);
  font-size: 20px;
  color: var(--acc);
}
.tag {
  font-style: italic;
  font-size: 16px;
}
.lore {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  border-radius: 10px;
}
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
h4 {
  margin: 8px 0 4px;
  color: var(--acc);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
td {
  padding: 3px 4px;
  border-bottom: 1px solid var(--line);
}
td:last-child {
  text-align: right;
  font-family: var(--mono);
  color: #fff;
}
ol,
ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: #d1d5db;
}
@media (max-width: 900px) {
  #left,
  #right {
    display: none;
  }
  #bottom {
    grid-template-columns: 1fr;
    height: 130px;
  }
  #progress {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
  }
  .cols {
    grid-template-columns: 1fr;
  }
  .res-head {
    flex-direction: column;
    text-align: center;
  }
  #hud .brand span {
    display: none;
  }
}
/* --- work cards, AI status, connectome panel --- */
.workcard {
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid rgba(250, 204, 21, 0.5);
  border-radius: 8px;
  padding: 4px;
  width: 120px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.workcard canvas {
  display: block;
  width: 112px;
  height: 64px;
  border-radius: 4px;
  background: #000;
}
.workcard .wc-t {
  color: #fde68a;
  font-size: 10px;
  line-height: 1.2;
  margin-top: 3px;
  max-height: 26px;
  overflow: hidden;
  text-align: center;
}
.statusline {
  font-size: 11px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.persona {
  font-size: 11px;
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 6px 8px;
  margin: 8px 0 4px;
}
.thought {
  font-size: 12px;
  color: #fde68a;
  font-style: italic;
  margin: 4px 0 6px;
}
#workView {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #000;
  display: block;
}
#brain h4 {
  margin: 10px 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #93c5fd;
}
.nr {
  font-size: 10.5px;
  margin: 2px 0;
  color: #d1d5db;
}
.nr b {
  color: var(--acc);
  display: inline-block;
  width: 36px;
}
.nr span {
  display: inline-block;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 0 4px;
  margin: 1px 2px 1px 0;
}
.nr i {
  color: #6b7280;
  font-style: normal;
  margin-left: 3px;
  font-size: 9px;
}
#cns {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
#cnsHeat {
  display: block;
  margin: 6px auto;
  background: #0b0f17;
  border-radius: 6px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 2px 7px;
  color: #d1d5db;
}
.chip b {
  color: var(--acc);
}
.banner {
  width: 100%;
  border-radius: 10px;
  margin: 12px 0 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  display: block;
}
#introAI {
  margin-top: 6px;
}
/* --- launch panel --- */
.launch {
  border: 1px solid rgba(250, 204, 21, 0.35);
  background: rgba(250, 204, 21, 0.05);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
}
.launch h4 {
  margin-top: 0;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.launch label {
  font-size: 11px;
  color: var(--dim);
  display: block;
}
.launch label input[type='number'],
.launch label input:not([type]) {
  width: 100%;
  margin: 3px 0 0;
  padding: 7px 9px;
  font-size: 13px;
}
.launch .check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  color: #e5e7eb;
  margin: 6px 0 10px;
}
.launch .check input {
  margin-top: 3px;
}
.launch code {
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 4px;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* --- round 3: camera bar, chat, sliders, HR, neurons, gallery, deliverables, mobile --- */
#hud select {
  background: #1f2937;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  font: inherit;
}
#hud .right button.on2 {
  background: #2563eb;
  color: #fff;
}
.tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.tab {
  padding: 2px 10px;
  font-size: 11px;
}
.tab.on {
  background: var(--acc);
  color: #111;
  font-weight: 700;
}
.channels {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.channels button {
  padding: 1px 8px;
  font-size: 10px;
  border-radius: 999px;
}
.channels button.on {
  background: #2563eb;
  color: #fff;
}
#feedWrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#feed,
#chat {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
#chat {
  font-size: 11.5px;
}
.msg {
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  gap: 8px;
}
.msg .av {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: none;
  margin-top: 1px;
}
.msg b {
  color: #fde68a;
}
.msg .t {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
}
.msg.spoken {
  opacity: 0.75;
}
.talk {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}
.talk input {
  flex: 1;
  font: inherit;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0b0f17;
  color: #fff;
}
.sliders label {
  display: grid;
  grid-template-columns: 90px 1fr 36px;
  gap: 6px;
  align-items: center;
  font-size: 10.5px;
  color: var(--dim);
  margin: 2px 0;
}
.sliders input {
  width: 100%;
}
.sliders b {
  color: #fff;
  font-family: var(--mono);
  font-weight: 400;
  font-size: 10px;
  text-align: right;
}
.hr {
  font-size: 11px;
  color: #d1d5db;
}
.hr li {
  margin: 2px 0;
}
.hr ul {
  padding-left: 16px;
  margin: 4px 0;
}
.hr .friends span {
  display: inline-block;
  margin: 1px 4px 1px 0;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  font-size: 10px;
}
.hr .friends span.bad {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}
.neuronview {
  margin-top: 6px;
}
#neuronCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #05070d;
  border: 1px solid var(--line);
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.gallery .g {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  text-align: center;
}
.gallery .g:hover {
  background: rgba(255, 255, 255, 0.08);
}
.gallery img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
}
.gallery .g b {
  display: block;
  margin-top: 6px;
}
.gallery .g small {
  color: var(--dim);
}
.cands {
  margin: 10px 0;
}
.candrow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.candrow img {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  cursor: pointer;
  border: 3px solid transparent;
}
.candrow img.on {
  border-color: var(--acc);
}
.candrow .c {
  text-align: center;
  font-size: 10px;
  color: var(--dim);
}
.simrow {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  margin: 6px 0;
}
.simrow label {
  font-size: 12px;
  color: var(--dim);
}
.simrow b {
  color: #fff;
}
#simOut {
  grid-column: 1 / -1;
  color: #d1d5db;
}
#curveCanvas {
  width: 100%;
  height: auto;
  display: block;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}
.deliv {
  display: grid;
  grid-template-columns: 200px 1fr 360px;
  gap: 14px;
  align-items: start;
}
.deliv canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  background: #000;
}
.deliv > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#stickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
#stickers a {
  display: block;
}
#stickers img {
  width: 100%;
  border-radius: 8px;
  background: #111;
}
.btn.small,
button.small {
  padding: 4px 8px;
  font-size: 11px;
}
.preflight {
  font-size: 11px;
  margin: 4px 0;
}
.preflight div {
  padding: 2px 0;
}
.preflight .ok {
  color: #4ade80;
}
.preflight .warn {
  color: #fbbf24;
}
.preflight .bad {
  color: #f87171;
}
.dashboard {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.dashboard .k {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px;
}
.dashboard .k b {
  display: block;
  font-size: 16px;
  color: #fff;
}
.dashboard .k span {
  font-size: 10px;
  color: var(--dim);
}
#mobileTabs {
  display: none;
}
@media (max-width: 900px) {
  #hud {
    height: auto;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
  }
  #hud .brand span {
    display: none;
  }
  #hud .right {
    flex-wrap: wrap;
  }
  #hud select,
  #btnTour,
  #btnRotate,
  #btnFollow {
    display: none;
  }
  #mobileTabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 7;
    background: rgba(10, 14, 22, 0.95);
    border-top: 1px solid var(--line);
    padding: 6px;
    gap: 6px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
  }
  #mobileTabs button {
    flex: 1;
  }
  #mobileTabs button.on {
    background: var(--acc);
    color: #111;
    font-weight: 700;
  }
  #left,
  #right,
  #bottom {
    display: none;
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 54px;
    width: auto;
    max-height: 48vh;
  }
  body.m-left #left,
  body.m-right #right,
  body.m-bottom #bottom {
    display: block;
  }
  body.m-bottom #bottom {
    display: grid;
    grid-template-columns: 1fr;
    height: 40vh;
  }
  #progress {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
  }
  .cols,
  .deliv {
    grid-template-columns: 1fr;
  }
  .res-head {
    flex-direction: column;
    text-align: center;
  }
  .card {
    padding: 16px;
  }
  .modal {
    padding: 8px;
  }
  .simrow {
    grid-template-columns: 1fr;
  }
}
/* --- rating --- */
.rating {
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 12px;
}
.rating h4 {
  margin-top: 0;
}
.stars button {
  font-size: 26px;
  line-height: 1;
  padding: 2px 4px;
  background: none;
  border: none;
  color: #4b5563;
}
.stars button.on {
  color: #facc15;
}
.aspects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 8px 0;
  font-size: 12px;
  color: #d1d5db;
}
.aspects button {
  padding: 2px 6px;
  font-size: 13px;
  background: none;
  border: 1px solid transparent;
}
.aspects button.on {
  border-color: var(--acc);
  background: rgba(250, 204, 21, 0.15);
}
.rating .row input {
  flex: 1;
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0b0f17;
  color: #fff;
}
.rating.done .stars button,
.rating.done .aspects button,
.rating.done input {
  pointer-events: none;
  opacity: 0.7;
}

/* --- post calendar --- */
.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
.post {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.post .pw {
  font-size: 11px;
  color: var(--dim);
}
.post .pw b {
  color: var(--acc);
  margin-right: 4px;
}
.post .pk {
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0 6px;
  font-size: 10px;
}
.post .pt {
  font-size: 12.5px;
  color: #e5e7eb;
  white-space: pre-wrap;
  flex: 1;
}
.post button {
  align-self: flex-end;
}

/* --- treasury --- */
.tgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tbox {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.tbox h4 {
  margin-top: 0;
}
.tbox input[type='number'] {
  font: inherit;
  font-size: 12px;
  padding: 5px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0b0f17;
  color: #fff;
}
.props {
  display: grid;
  gap: 8px;
}
.prop {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  background: rgba(96, 165, 250, 0.06);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
}
.prop.done {
  opacity: 0.55;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.prop b {
  color: var(--acc);
}
.prop .why {
  color: #d1d5db;
  font-style: italic;
  margin-top: 2px;
}
.prop .acts {
  display: flex;
  gap: 6px;
  align-items: start;
}
.taccounts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.tacc {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11.5px;
}
.tacc b {
  display: block;
}
.tacc .pos {
  color: #93c5fd;
}
.thist {
  max-height: 160px;
  overflow: auto;
}
.thist div {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
#tCoins .coin {
  display: inline-block;
  margin: 2px 6px 2px 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}
#tCoins .coin i {
  color: var(--dim);
  font-style: normal;
  margin-left: 4px;
}
@media (max-width: 900px) {
  .tgrid {
    grid-template-columns: 1fr;
  }
}

/* --- desk journal --- */
.notes {
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow: auto;
}
.noteb {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12px;
}
.noteb b {
  color: var(--acc);
}
.noteb .dec {
  display: inline-block;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.08);
}
.noteb .dec.buy {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
.noteb .dec.sell {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.noteb .why {
  color: #e5e7eb;
  font-style: italic;
  margin: 3px 0;
}
.noteb details {
  margin-top: 3px;
}
.noteb summary {
  cursor: pointer;
  color: var(--dim);
  font-size: 11px;
}
.noteb table {
  width: 100%;
  font-size: 10.5px;
  margin-top: 4px;
}
.noteb td {
  padding: 1px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.noteb td.n {
  text-align: right;
  font-family: var(--mono);
}
.prop .expl {
  color: #cbd5e1;
  margin-top: 4px;
  font-size: 11.5px;
}
.prop .bd {
  color: var(--dim);
  font-size: 10.5px;
  font-family: var(--mono);
  margin-top: 3px;
}
.prop .test {
  background: rgba(250, 204, 21, 0.15);
  color: var(--acc);
  border-radius: 999px;
  padding: 0 6px;
  font-size: 10px;
  margin-left: 4px;
}

/* --- round 4: a11y, budget, extras, metrics, notebook, concepts, credits --- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: fixed;
  top: -60px;
  left: 10px;
  z-index: 100;
  background: var(--acc);
  color: #111;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 700;
}
.skip:focus {
  top: 8px;
}
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
button:focus-visible,
.btn:focus-visible,
#roster li:focus-visible,
.gallery .g:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.25);
}
#volume {
  width: 64px;
  accent-color: var(--acc);
  align-self: center;
}
.identity {
  color: #86efac;
}
.budget {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 150px;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-size: 10.5px;
  font-family: var(--mono);
  overflow: hidden;
  white-space: nowrap;
}
.budget i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(34, 197, 94, 0.35);
  transition: width 0.4s;
}
.budget.warn i {
  background: rgba(250, 204, 21, 0.4);
}
.budget.bad i {
  background: rgba(239, 68, 68, 0.45);
}
.budget span {
  position: relative;
  color: #e5e7eb;
}
.sprint {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 10px;
  font-size: 12px;
  color: #d1d5db;
}
.sprint label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.card input[type='radio'],
.card input[type='checkbox'] {
  width: auto;
  margin: 0;
  padding: 0;
  accent-color: var(--acc);
}
.blocked {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  font-size: 9.5px;
  vertical-align: middle;
}
.prog.blocked .track i {
  background: linear-gradient(90deg, #6b7280, #9ca3af);
}
.noterow {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.noterow input {
  flex: 1;
  font: inherit;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0b0f17;
  color: #fff;
}
.log.note {
  color: #fde68a;
}
.log.event {
  color: #fca5a5;
}
.thoughts {
  font-size: 11px;
  color: #d1d5db;
  border-left: 2px solid rgba(253, 230, 138, 0.4);
  padding-left: 8px;
  margin: 4px 0 6px;
}
.thoughts div {
  padding: 1px 0;
}
.thoughts .t {
  color: var(--dim);
  font-family: var(--mono);
  margin-right: 6px;
  font-size: 10px;
}
.thoughts i {
  color: #fde68a;
}
#raster {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #05070d;
}
.ablation {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 8px;
  font-size: 11px;
}
.ablation label {
  display: flex;
  gap: 5px;
  align-items: center;
  color: #d1d5db;
  cursor: pointer;
}
.ablation label.off {
  color: #fca5a5;
  text-decoration: line-through;
}
.ablation input {
  accent-color: var(--acc);
  margin: 0;
}
.memtools {
  margin-top: 6px;
  gap: 6px;
}
.memtools .row.wrap {
  margin-top: 0;
}
button.danger {
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}
/* pitch card boxes */
.box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 8px 0;
  font-size: 12.5px;
  color: #e5e7eb;
}
.box h4 {
  margin-top: 0;
}
.box p {
  margin: 4px 0;
  white-space: pre-wrap;
}
.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 3px 10px;
  font-size: 12px;
}
.kv b {
  color: var(--acc);
  text-transform: capitalize;
}
.kv span {
  white-space: pre-wrap;
  color: #d1d5db;
}
.lineage,
.lineage ul {
  list-style: none;
  padding-left: 14px;
  margin: 2px 0;
  border-left: 1px dashed var(--line);
}
.lineage > li {
  margin-left: -14px;
  border-left: 0;
}
.lineage li {
  padding: 1px 0 1px 6px;
  font-size: 12px;
}
.lineage b {
  color: #fff;
}
.lineage i {
  color: var(--dim);
}
.lineage .ticker {
  font-size: 12px;
}
.lineage-text {
  font-family: var(--mono);
  font-size: 11px;
  white-space: pre-wrap;
  margin: 0;
  color: #d1d5db;
}
.judge-head {
  display: flex;
  gap: 10px;
  align-items: center;
}
.judge .badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
}
.judge .badge.good {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}
.judge .badge.mid {
  background: rgba(250, 204, 21, 0.2);
  color: #fde68a;
}
.judge .badge.low {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.judge .verdict {
  font-style: italic;
}
.jbars label {
  display: grid;
  grid-template-columns: 110px 1fr 50px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--dim);
  margin: 3px 0;
}
.jbars b {
  color: #fff;
  font-family: var(--mono);
  font-weight: 400;
  text-align: right;
}
.launch-at {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.launch-at input {
  width: auto;
  margin: 0;
  padding: 6px 8px;
  font-size: 13px;
}
.post .at {
  display: block;
  color: #93c5fd;
  font-family: var(--mono);
  font-size: 10.5px;
}
.txsum {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.06);
}
.txsum b {
  color: #93c5fd;
}
.txsum ul {
  padding-left: 16px;
  margin: 2px 0;
}
.txsum .warn {
  color: #fbbf24;
}
.dashboard .k small {
  display: block;
  font-size: 9px;
  color: var(--dim);
}
/* gallery tabs, leaderboard */
.gfilters {
  margin: 4px 0 10px;
  gap: 14px;
}
.gfilters .check {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.gallery a.g {
  text-decoration: none;
  color: inherit;
  display: block;
}
.gallery .launched {
  display: block;
  color: #86efac;
}
.gallery .lb-by,
.gallery table.lb {
  grid-column: 1 / -1;
}
table.lb th {
  text-align: left;
  color: var(--dim);
  font-weight: 400;
  padding: 3px 4px;
  border-bottom: 1px solid var(--line);
}
table.lb td.n {
  font-family: var(--mono);
}
/* metrics modal */
.mgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mgrid canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #05070d;
  border: 1px solid var(--line);
}
.mgrid h4 select {
  margin-left: 8px;
  font: inherit;
  font-size: 11px;
  background: #0b0f17;
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 4px;
}
.scrub {
  align-items: center;
}
.scrub input[type='range'] {
  flex: 1;
  accent-color: var(--acc);
  margin: 0;
}
.scrub .check {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
/* notebook */
.card.notebook {
  background: #f5efdc;
  color: #2b2418;
  border: 1px solid #c9bb95;
  background-image: repeating-linear-gradient(transparent, transparent 23px, rgba(120, 90, 40, 0.18) 24px);
  font-family: 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
}
.card.notebook h1 {
  color: #2b2418;
  font-family: inherit;
}
.card.notebook .sub {
  color: #6b5a3a;
}
.card.notebook .x {
  background: #e7dcc0;
  color: #2b2418;
  border-color: #c9bb95;
}
.nbbody h4 {
  color: #8a5a1e;
  margin: 14px 0 2px;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}
.nbbody p {
  margin: 0;
  color: #2b2418;
  white-space: pre-wrap;
  line-height: 24px;
  font-size: 14px;
}
/* concepts */
.concepts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.concept {
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--fg);
}
.concept b {
  font-size: 16px;
  color: #fff;
}
.concept .ticker {
  font-size: 14px;
}
.concept p {
  margin: 4px 0;
  color: #d1d5db;
}
.concept small {
  color: var(--dim);
}
.concept.on {
  border-color: var(--acc);
  background: rgba(250, 204, 21, 0.1);
}
#conceptTimer {
  display: inline-block;
}
/* credits */
#credits {
  position: fixed;
  right: 10px;
  bottom: 168px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 10.5px;
  color: var(--dim);
}
#credits button {
  padding: 1px 8px;
  font-size: 10px;
  border-radius: 999px;
  opacity: 0.7;
}
#creditsBody {
  display: none;
  max-width: 320px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  text-align: right;
}
#credits.open #creditsBody {
  display: block;
}
.panels-hidden #credits {
  bottom: 10px;
}
/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .bar i,
  .track i,
  .budget i {
    transition: none !important;
  }
  .toast {
    transition: none !important;
  }
}
@media (max-width: 900px) {
  #volume,
  #btnMetrics,
  #identity {
    display: none;
  }
  .budget {
    min-width: 0;
    max-width: 46vw;
  }
  .mgrid {
    grid-template-columns: 1fr;
  }
  .ablation {
    grid-template-columns: repeat(2, 1fr);
  }
  #credits {
    right: 8px;
    bottom: 54px;
  }
  body.m-bottom #credits,
  body.m-left #credits,
  body.m-right #credits {
    display: none;
  }
  .jbars label {
    grid-template-columns: 80px 1fr 44px;
  }
  .kv {
    grid-template-columns: 1fr;
  }
}
/* toasts (dom.js toast()) */
#toasts {
  position: fixed;
  top: 54px;
  right: 12px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 24px));
}
.toast {
  background: rgba(17, 24, 39, 0.95);
  color: var(--fg);
  border: 1px solid var(--line);
  border-left: 3px solid #93c5fd;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.25s,
    transform 0.25s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast.warn {
  border-left-color: #fbbf24;
}
.toast.error {
  border-left-color: #f87171;
}
.scrub input[type='range'] {
  padding: 0;
}
@media (max-width: 900px) {
  #toasts {
    top: auto;
    bottom: 60px;
    left: 12px;
    right: 12px;
    max-width: none;
  }
}

/* --- AI credits breakdown (click the budget bar) --- */
.budgetdetail {
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 96vw);
  max-height: 60vh;
  overflow: auto;
  z-index: 8;
}
.budgetdetail table {
  font-size: 11px;
  margin: 6px 0;
}
.budgetdetail td:first-child {
  color: #e5e7eb;
}
