/* WAI Studio. Every colour and face comes from the host's design tokens (tokens.css standing
   alone; the site's own inside the site), and every part is drawn as Quantum Studio draws
   its own: the same top bar, segments, panes, buttons, badges and tables. */
.ws {
  --ws-gap: 12px;
  --ws-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: var(--ws-gap);
  color: var(--text-primary);
  background: var(--bg-base);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 14px;
  min-width: 0;
}
.ws *, .ws *::before, .ws *::after { box-sizing: border-box; }
.ws h1, .ws h2, .ws h3, .ws h4 { margin: 0; text-wrap: balance; }
.ws [hidden] { display: none !important; }
.ws-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--ws-radius); background: var(--bg-surface); }
.ws-brand { display: flex; align-items: baseline; gap: 8px; margin-right: auto; }
.ws-brand .ws-title { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: 0.01em; }
.ws-mark { font-family: var(--font-mono, ui-monospace, monospace); color: var(--accent-text); font-size: 14px; }
.ws-tabs { display: flex; flex-wrap: wrap; border: 1px solid var(--border-subtle); border-radius: 6px; overflow: hidden; align-self: flex-start; max-width: 100%; }
.ws-seg { min-height: 32px; padding: 5px 11px; border: 0; background: var(--bg-base); color: var(--text-secondary); font: 12px var(--font-mono, ui-monospace, monospace); cursor: pointer; }
.ws-seg + .ws-seg { border-left: 1px solid var(--border-subtle); }
.ws-seg[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 18%, var(--bg-base)); color: var(--text-primary); }
.ws :focus-visible { outline: 2px solid var(--focus-ring, var(--accent)); outline-offset: 2px; }
.ws-views { min-width: 0; }
.ws-pane { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border); border-radius: var(--ws-radius); background: var(--bg-surface); overflow: hidden; }
.ws-pane.ws-dropping { border-color: var(--accent); }
.ws-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.ws-head h2 { font-size: 11px; font-family: var(--font-mono, ui-monospace, monospace); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }
.ws-body { padding: 10px 12px 14px; min-width: 0; }
.ws-grow { flex: 1; }
.ws-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ws-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.ws-part { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.ws-sub { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.ws-why { margin: 0; color: var(--text-secondary); font-size: 13px; line-height: 1.55; max-width: 72ch; }
.ws-field { display: flex; flex-direction: column; gap: 3px; flex: 1 1 160px; min-width: 0; font-size: 10px; font-family: var(--font-mono, ui-monospace, monospace); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.ws-field input[type="file"] { font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); letter-spacing: 0; text-transform: none; max-width: 100%; }
.ws-input, .ws-select { width: 100%; min-height: 32px; padding: 5px 8px; border: 1px solid var(--border-subtle); border-radius: 6px; background: var(--bg-base); color: var(--text-primary); font: 12px var(--font-mono, ui-monospace, monospace); letter-spacing: 0; text-transform: none; }
.ws-btn { min-height: 32px; padding: 5px 12px; border: 1px solid var(--border-subtle); border-radius: 6px; background: var(--bg-base); color: var(--text-primary); font: 12px var(--font-mono, ui-monospace, monospace); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.ws-btn:hover:not(:disabled) { border-color: var(--accent); }
.ws-btn:disabled { opacity: 0.5; cursor: default; }
.ws-btn.ws-small { min-height: 26px; padding: 2px 9px; font-size: 11px; }
.ws-primary { background: var(--accent-fill, var(--accent)); border-color: var(--accent-fill, var(--accent)); color: var(--on-accent, #0c0a09); font-weight: 650; }
.ws-primary:hover:not(:disabled) { background: var(--accent-fill-hover, var(--accent)); }
.ws-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ws-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-subtle); font: 11px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.ws-badge.ok { color: var(--ok-text); border-color: color-mix(in srgb, var(--ok-text) 40%, transparent); }
.ws-badge.bad { color: var(--bad-text); border-color: color-mix(in srgb, var(--bad-text) 40%, transparent); }
.ws-note { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono, ui-monospace, monospace); overflow-wrap: anywhere; margin: 0; }
.ws-k { font: 10px var(--font-mono, ui-monospace, monospace); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); text-align: left; margin: 0; }
.ws-bad { color: var(--bad-text); margin: 0; overflow-wrap: anywhere; }
.ws-warn { color: var(--warn-text); }
.ws-out { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ws-out:empty { display: none; }
.ws-verdict, .ws-summary { margin: 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.ws-mono { font: 12px var(--font-mono, ui-monospace, monospace); overflow-wrap: anywhere; }
.ws-scroll { overflow-x: auto; max-width: 100%; }
.ws-table { width: 100%; border-collapse: collapse; font: 12px var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.ws-table caption { padding-bottom: 4px; }
.ws-table th, .ws-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
.ws-table th { color: var(--text-secondary); font-weight: 500; }
.ws-table thead th { color: var(--text-muted); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.ws-facts th { width: 11em; }
.ws-pre { margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--bg-base); border: 1px solid var(--border); font: 12px/1.4 var(--font-mono, ui-monospace, monospace); overflow: auto; white-space: pre; max-height: 340px; max-width: 100%; }
.ws-log { min-height: 160px; }
.ws-details summary { cursor: pointer; font: 12px var(--font-mono, ui-monospace, monospace); color: var(--text-secondary); padding: 4px 0; }
.ws-list { margin: 0; padding-left: 18px; }
.ws-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font: 12px/1.45 var(--font-mono, ui-monospace, monospace); }
.ws-lines li { display: flex; gap: 6px; overflow-wrap: anywhere; }
.ws-lines li.ok .ws-mark { color: var(--ok-text); }
.ws-lines li.bad { color: var(--bad-text); }
.ws-receipts { display: flex; flex-direction: column; gap: 10px; }
.ws-receipt { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-base); min-width: 0; }
.ws-receipt-head { margin: 0; overflow-wrap: anywhere; }
.ws-picture { max-width: 100%; height: auto; image-rendering: pixelated; border: 1px solid var(--border); border-radius: 6px; align-self: flex-start; background: var(--bg-base); }
.ws-frame-box:empty { display: none; }
.ws-frame { width: 100%; min-height: 560px; border: 1px solid var(--border); border-radius: var(--ws-radius); background: var(--bg-base); }
.ws-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 4px 2px; font: 11px var(--font-mono, ui-monospace, monospace); color: var(--text-muted); }
.ws-status { margin-left: auto; color: var(--text-secondary); overflow-wrap: anywhere; }
.ws-status.ok { color: var(--ok-text); }
.ws-status.bad { color: var(--bad-text); }
.ws-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The command palette: a dialog over the page. */
.ws-palette { width: min(760px, calc(100vw - 32px)); max-height: min(80vh, 760px); padding: 0; border: 1px solid var(--border-subtle); border-radius: var(--ws-radius); background: var(--bg-surface); color: var(--text-primary); }
.ws-palette::backdrop { background: color-mix(in srgb, var(--bg-base) 70%, transparent); }
.ws-palette .ws-body { display: flex; flex-direction: column; gap: 6px; }
.ws-palette-list { list-style: none; margin: 0; padding: 0; overflow: auto; max-height: min(60vh, 560px); display: flex; flex-direction: column; gap: 2px; }
.ws-op > button, .ws-op > div { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-primary); text-align: left; font: inherit; }
.ws-op > button { cursor: pointer; }
.ws-op > button:hover, .ws-op > button:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ws-op-id { color: var(--accent-text); font-size: 12px; }
.ws-op-sum { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
.ws-op-where { font: 11px var(--font-mono, ui-monospace, monospace); color: var(--text-muted); overflow-wrap: anywhere; }
.ws-op-where.here { color: var(--ok-text); }
@media (max-width: 640px) {
  .ws-top { padding: 8px 10px; }
  .ws-facts th { width: auto; }
  .ws-frame { min-height: 420px; }
}
