/* Studio and console layout. Uses the tokens and components from theme.css. */
.ph { display: flex; flex-direction: column; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-4); }
.mode {
  all: unset; box-sizing: border-box; cursor: pointer; display: block; padding: var(--s-4); border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); transition: border-color .15s, background .15s, box-shadow .15s;
}
.mode:hover { border-color: var(--border-strong); background: var(--surface-2); }
.mode.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.mode:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.mode h3 { margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.mode h3::after { content: ""; margin-left: auto; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); }
.mode.on h3::after { border: 5px solid var(--accent); background: var(--surface); }
.mode p { font-size: 12.5px; color: var(--text-2); }

.cfg { margin-bottom: var(--s-4); }
.trow { display: grid; grid-template-columns: 160px 1fr 2fr auto; gap: var(--s-3); align-items: end; margin-bottom: var(--s-3); padding-bottom: var(--s-3); border-bottom: 1px dashed var(--border); }
.trow:last-of-type { border-bottom: 0; }
.trow .miss { margin-left: 6px; }
.sect { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin: var(--s-4) 0 var(--s-3); }
.run-actions { display: flex; flex-direction: column; align-items: stretch; gap: var(--s-3); margin: var(--s-5) 0; position: sticky; bottom: 0; padding: var(--s-3) 0; background: linear-gradient(0deg, var(--bg) 70%, transparent); z-index: 5; }
.run-test, .run-main { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.run-test .dim { font-size: 12.5px; }
.run-actions .status { color: var(--text-2); font-size: 13px; min-height: 1.4em; display: inline-flex; align-items: center; gap: 8px; }

/* Context window presets */
.ctx { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: var(--s-2); }
.chip {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px;
  border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); transition: border-color .15s, background .15s, box-shadow .15s;
}
.chip b { font-size: 15px; font-weight: 650; }
.chip span { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.chip.on span { color: var(--text-2); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Test Setup: RAM estimate */
.est { margin-bottom: var(--s-4); }
.est-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.est-head h3 { margin: 0; margin-right: auto; }
.est-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-3); margin-bottom: var(--s-4); }
.est-card { padding: var(--s-4); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.est-card .top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }
.est-card .meter { margin: var(--s-2) 0; }
.est-card .k:last-child { overflow-wrap: anywhere; }
.est .wrap { max-height: none; margin-bottom: var(--s-3); box-shadow: none; }
.est .sect { margin-top: var(--s-3); }
.est td.tot, .est th.tot { font-weight: 650; }
.est ul { margin: var(--s-2) 0 0; padding-left: 18px; color: var(--text-2); font-size: 12.5px; }
.est ul li { margin-bottom: 4px; }
.est .sys { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: 13px; color: var(--text-2); margin-bottom: var(--s-3); }
.est .sys b { color: var(--text); font-variant-numeric: tabular-nums; }

.ucreate { display: grid; grid-template-columns: 1fr 1fr 170px auto; gap: var(--s-3); align-items: start; margin-bottom: var(--s-5); padding: var(--s-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.ucreate > .btn { margin-top: 24px; }
.ucell { display: flex; align-items: center; gap: 10px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-line); flex: none; }
.uname { font-weight: 500; }
td .q { display: inline-flex; align-items: center; white-space: nowrap; font-variant-numeric: tabular-nums; }

.k-new { margin: var(--s-3) 0 var(--s-4); }
.k-new .secret { display: flex; gap: var(--s-2); align-items: center; margin-top: var(--s-2); }
.k-new .secret code { flex: 1; padding: 8px 10px; font-size: 13px; user-select: all; }
.route h3 { display: flex; gap: var(--s-2); align-items: center; }
.route { margin-bottom: var(--s-3); }
.route textarea { min-height: 70px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.save-bar { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-4); }

@media (max-width: 760px) {
  .trow, .ucreate { grid-template-columns: 1fr; } .ucreate > .btn { margin-top: 0; }
  .bar .meta { order: 2; margin-left: auto; }
  .run-actions { position: static; background: none; }
}
