/* Data stores and studios. Builds on app.css tokens only: lists are the kit .list/.list-item, stats are
   stat()/kpiRow, JSON colours live in app.css. Nothing here sets an outer margin. */

/* tab bodies are stacks; empty slots (an unused result box) take no gap */
.ds-tab > :empty { display: none; }

/* three-pane browser: stores | keys | entry */
.ds-grid { display: grid; grid-template-columns: 230px 290px minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
.ds-pane { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); min-width: 0; display: flex; flex-direction: column; max-height: calc(100dvh - 210px); }
.ds-pane-h { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-3); border-bottom: 1px solid var(--border); }
.ds-pane-h h3 { font-size: var(--fs-2); font-weight: 600; color: var(--text-2); flex: 1; }
.ds-pane-tools { display: flex; flex-direction: column; gap: var(--gap-s); padding: var(--sp-2); border-bottom: 1px solid var(--border); }
.ds-pane-tools input:not([type="checkbox"]), .ds-pane-tools select { height: var(--ctl-h-s); }
.ds-pane > .paged-more:empty { display: none; }
.ds-list { flex: 1; min-height: 60px; overflow-y: auto; padding: var(--sp-1); }
.ds-list .list-item.mono { font-family: var(--mono); font-size: var(--fs-2); }
.ds-list .list-item.deleted { color: var(--faint); text-decoration: line-through; }
.ds-entry { padding: var(--pad); overflow-y: auto; }
.ds-entry-h { display: flex; align-items: flex-start; gap: var(--sp-3); flex-wrap: wrap; }
.ds-entry-h > .grow { display: flex; flex-direction: column; gap: var(--sp-1); }
.ds-entry-h h2 { font-family: var(--mono); font-size: var(--fs-4); word-break: break-all; }
.ds-meta { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); color: var(--muted); font-size: var(--fs-2); }
.ds-meta b { color: var(--text-2); font-weight: 500; }
.ds-value { max-height: 56vh; }
.ds-empty { padding: var(--sp-7) var(--sp-4); text-align: center; color: var(--faint); font-size: var(--fs-2); }
.ds-hint { color: var(--muted); font-size: var(--fs-2); }
.ds-json-err { color: var(--bad); font-size: var(--fs-2); min-height: 16px; }
/* a value shown exactly once (webhook secret, invite link) */
.secret-once { font-family: var(--mono); font-size: var(--fs-3); padding: var(--sp-2) var(--sp-3); border: 1px dashed var(--warn); border-radius: var(--radius-s); background: var(--warn-bg); word-break: break-all; }

/* studios */
.studio-card, .st-game { display: block; }
.st-game h3 { font-size: var(--fs-4); min-width: 0; }
.st-metrics { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-1) var(--sp-3); margin: 0; align-items: center; }
.st-metrics dt { color: var(--muted); font-size: var(--fs-2); }
.st-metrics dd { margin: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: var(--sp-2); font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.st-bar { height: 6px; border-radius: 999px; background: var(--hover); overflow: hidden; }
.st-bar span { display: block; height: 100%; border-radius: 999px; background: var(--ok); transition: width var(--dur-3) var(--ease); }
.st-bar span.accent { background: var(--accent); } .st-bar span.warn { background: var(--warn); } .st-bar span.info { background: var(--info); }
.scope-group { display: flex; flex-direction: column; gap: var(--sp-1); }
.scope-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-1) var(--sp-4); font-family: var(--mono); font-size: var(--fs-2); }
.scope-list .have { color: var(--ok); }
.scope-list .miss { color: var(--faint); }
.group-hero { display: flex; gap: var(--sp-3); align-items: center; }
.group-hero img, .group-initial { width: 56px; height: 56px; flex: none; border-radius: var(--radius-l); background: var(--hover); }
.group-initial { display: grid; place-items: center; background: var(--accent-bg); color: var(--accent-2); font-size: var(--fs-kpi); font-weight: 700; }
.shout { border-left: 3px solid var(--accent); padding: var(--sp-2) var(--sp-3); color: var(--text-2); background: var(--panel-2); border-radius: 0 var(--radius-s) var(--radius-s) 0; }

@container content (max-width: 1080px) {
  .ds-grid { grid-template-columns: 200px minmax(0, 1fr); }
  .ds-grid .ds-pane:last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .ds-grid { grid-template-columns: minmax(0, 1fr); }
  .ds-pane { max-height: none; }
}
