:root { --ink: #1c1c1c; --muted: #6b6b6b; --line: #e3e3e3; --bg: #fafafa; --accent: #1f5fbf; --bad: #b3261e; --ok: #1e7f4f; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
header { display: flex; gap: 1.5rem; align-items: center; padding: .6rem 1.2rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
header .user-menu { margin-left: auto; }
/* Pages in a left sidebar; on a narrow screen it becomes a scrollable row. */
.layout { display: grid; grid-template-columns: 13rem minmax(0, 1fr); align-items: start; }
.layout > * { min-width: 0; }
#nav { display: flex; flex-direction: column; gap: .1rem; padding: 1rem .6rem; position: sticky; top: 3.2rem; }
#nav a { color: var(--muted); text-decoration: none; padding: .45rem .7rem; border-radius: 6px; border-left: 3px solid transparent; }
#nav a:hover { background: #f0f0f0; color: var(--ink); }
#nav a.active { color: var(--ink); background: #fff; border-left-color: var(--accent); font-weight: 600; }
@media (max-width: 760px) { header { flex-wrap: wrap; gap: .6rem 1rem; } .layout { grid-template-columns: minmax(0, 1fr); } #nav { flex-direction: row; overflow-x: auto; position: static; padding: .4rem .6rem; border-bottom: 1px solid var(--line); } #nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; border-radius: 0; } #nav a.active { border-bottom-color: var(--accent); background: none; } }
header .brand { display: inline-flex; align-items: center; gap: .5rem; }
/* The person menu matches data.nua.space's and monitor.nua.space's. */
.user-menu { margin-left: auto; position: relative; }
.user-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 999px; padding: 3px 3px 3px 12px; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { border-color: var(--line); background: #f1f1f1; }
.user-name { font-weight: 600; }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: #0f766e; color: #fff; font-size: 12px; font-weight: 700; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; box-shadow: 0 8px 24px rgb(16 24 40 / 0.14); z-index: 30; }
.user-dropdown > * + * { margin-top: 4px; }
#environments { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; font-size: .8rem; }
#environments .env { padding: .15rem .7rem; color: var(--muted); text-decoration: none; }
#environments a.env:hover { background: #f4f4f4; color: var(--ink); }
#environments .env.current { color: #fff; background: var(--muted); font-weight: 600; }
body[data-environment="production"] header { border-bottom: 3px solid var(--bad); }
body[data-environment="production"] #environments .env.current { background: var(--bad); }
body[data-environment="staging"] header { border-bottom: 3px solid #c58a00; }
body[data-environment="staging"] #environments .env.current { background: #c58a00; }
main { max-width: 1180px; padding: 1.2rem 1.6rem; min-width: 0; }
h1 { font-size: 1.3rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.4rem 0 .6rem; }
.muted { color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .8rem 1rem; }
.tile .n { font-size: 1.6rem; font-weight: 600; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: .85rem; background: #f4f4f4; }
tr:last-child td { border-bottom: 0; }
code { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: #f1f1f1; padding: 0 .25rem; border-radius: 3px; }
pre { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: #f4f4f4; padding: .6rem; border-radius: 6px; overflow: auto; max-height: 24rem; }
form.inline { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .8rem; margin: .6rem 0; }
form.inline label { display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); gap: .2rem; }
input, select, textarea { font: inherit; padding: .35rem .5rem; border: 1px solid #c9c9c9; border-radius: 4px; min-width: 9rem; }
textarea { min-width: 24rem; min-height: 6rem; }
button { font: inherit; padding: .4rem .8rem; border-radius: 4px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button.quiet { background: #fff; color: var(--accent); }
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
.pill { display: inline-block; padding: 0 .45rem; border-radius: 999px; font-size: .78rem; background: #ececec; }
.pill.ok { background: #dff3e7; color: var(--ok); }
.pill.bad { background: #f9dedc; color: var(--bad); }
.pill.warn { background: #fdefc7; color: #7a5300; }
#toast { position: fixed; right: 1rem; bottom: 1rem; background: var(--ink); color: #fff; padding: .6rem .9rem; border-radius: 6px; max-width: 32rem; white-space: pre-wrap; }
#toast.bad { background: var(--bad); }
.secret { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: #fff8dc; border: 1px solid #e6d28a; padding: .6rem; border-radius: 6px; word-break: break-all; }
a.link { color: var(--accent); cursor: pointer; text-decoration: underline; }
.job-io { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.io-panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.io-panel > h3 { font-size: .85rem; margin: 0 0 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: .8rem; align-items: start; }
.preview { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .8rem; display: flex; flex-direction: column; gap: .65rem; }
.preview-heading, .preview-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.preview-heading strong { font-size: .85rem; font-weight: 500; }
.media-format { color: var(--muted); background: #f4f4f4; border-radius: 4px; padding: .15rem .4rem; font-size: .7rem; letter-spacing: .04em; }
.preview-load { display: flex; flex-direction: column; gap: .65rem; align-items: center; justify-content: center; min-height: 150px; width: 100%; padding: 1.4rem; color: var(--accent); background: #f6f8fc; border: 1px dashed #cdd8e8; border-radius: 6px; }
.preview-load:hover:not(:disabled) { background: #edf3fc; border-color: var(--accent); }
.preview-load:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.preview-load svg { width: 30px; height: 30px; }
.preview-slot { width: 100%; min-width: 0; border-radius: 6px; overflow: hidden; background: #f4f4f4; }
.preview .preview-slot:empty { display: none; }
.preview img, .preview video { display: block; width: 100%; max-height: 480px; object-fit: contain; }
.preview audio { display: block; width: 100%; }
.preview-meta { color: var(--muted); font-size: .78rem; }
.preview-details { color: var(--muted); font-size: .78rem; }
.preview-details summary { cursor: pointer; }
.preview-details dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .7rem; margin: .6rem 0 0; }
.preview-details dd { margin: 0; overflow-wrap: anywhere; }
.preview-details code { font-size: inherit; }
.preview-note, .preview-error, .empty-output { margin: 0; padding: 1rem; color: var(--muted); background: #f6f6f6; border-radius: 6px; font-size: .85rem; overflow-wrap: anywhere; }
.preview-error { color: var(--bad); }
.job-input-summary { margin-bottom: 1rem; }
.job-input-summary:last-child { margin-bottom: 0; }
.job-input-summary h4 { font-size: .8rem; margin: 0 0 .4rem; color: var(--muted); font-weight: 500; }
.prompt-block { margin-bottom: .8rem; }
.prompt-block:last-child { margin-bottom: 0; }
.prompt-block summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.prompt-copy, .prompt-excerpt { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); font-size: 14px; margin: .35rem 0 0; }
.prompt-excerpt { display: block; }
.prompt-block[open] .prompt-excerpt { display: none; }
.parameter-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.parameter-tag { display: inline-flex; gap: .4rem; flex-wrap: wrap; background: #f6f6f6; border: 1px solid #ededed; border-radius: 5px; padding: .3rem .5rem; overflow-wrap: anywhere; max-width: 100%; font-size: .78rem; }
.parameter-tag span { color: var(--muted); }
.parameter-tag strong { font-weight: 500; }
.request-json { margin-top: 1.4rem; }
.request-json summary { cursor: pointer; font-size: 1.05rem; font-weight: 600; }
@media (max-width: 760px) { .job-io { grid-template-columns: minmax(0, 1fr); } }
.gap-top { margin-top: .8rem; }
.gap-bottom { margin-bottom: .8rem; }
/* Deactivated rows stay listed, greyed. */
tr.off td { color: var(--muted); opacity: .65; }
/* A form of a few labelled fields, one per row, label beside its field. */
form.stacked { max-width: 46rem; }
form.stacked label { display: grid; grid-template-columns: 15rem 1fr; align-items: center; gap: 1rem; margin: .4rem 0; }
form.stacked button[type=submit] { display: block; margin: .6rem 0 0 auto; }
/* A row's action buttons sit at its right edge. */
td:last-child:has(button) { text-align: right; white-space: nowrap; }
input.secret { -webkit-text-security: disc; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
/* One item per line inside a cell (a key part and its hint, a model), never
   broken between its words; a wide table scrolls inside its box, so the
   page itself never scrolls sideways. */
td .line { white-space: nowrap; }
.scroll-x { overflow-x: auto; max-width: 100%; }

/* The Providers page hides deactivated rows unless "Show deactivated" is on. */
.hide-off tr.off{display:none}
/* A heading with a small switch on the right of the same line. */
.section-head{display:flex;align-items:baseline;justify-content:space-between;gap:1rem;flex-wrap:wrap}
label.toggle{display:inline-flex;gap:.4rem;align-items:center;font-size:.85rem;color:var(--muted);cursor:pointer;white-space:nowrap}
/* Checkboxes keep their own size, not the text inputs' width and padding. */
input[type=checkbox]{min-width:0;padding:0;margin:0}
/* The small label in front of each line of a Models table Provider cell. */
.hint{display:inline-block;min-width:3.6em;font-size:12px}
/* A provider's key parts: names in one column, values aligned in the next. */
.key-grid{display:grid;grid-template-columns:max-content max-content;column-gap:.6rem;row-gap:.25rem;align-items:baseline;white-space:nowrap}
.key-grid code{justify-self:start}
/* A model id stays on one line, so its column widens to fit it. */
.nowrap{white-space:nowrap}
/* Playground: the form beside the request it builds; stacked when narrow. */
[hidden]{display:none!important}
.pg-layout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:1rem;align-items:start}
.pg-form{background:#fff;border:1px solid var(--line);border-radius:8px;padding:1rem;min-width:0}
.pg-form h3{font-size:.85rem;margin:1rem 0 .5rem;color:var(--muted);font-weight:600}
.pg-row{display:grid;grid-template-columns:9rem minmax(0,1fr);gap:.4rem .8rem;align-items:start;margin:.45rem 0}
.pg-row > span{color:var(--muted);font-size:.85rem;padding-top:.35rem}
.pg-row textarea,.pg-row select,.pg-row input{width:100%;min-width:0}
.pg-params{display:grid;grid-template-columns:repeat(auto-fill,minmax(14rem,1fr));gap:.6rem .8rem}
.pg-param{display:flex;flex-direction:column;gap:.2rem;font-size:.85rem;min-width:0}
.pg-param > span{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}
.pg-param input,.pg-param select{width:100%;min-width:0}
.pg-param small,.pg-note{font-size:.75rem;line-height:1.35}
.pg-note{margin:.3rem 0;padding-left:1.1rem}
p.pg-note{padding-left:0}
.pg-summary{margin:.2rem 0 .6rem}
.pg-uploads{display:flex;flex-wrap:wrap;gap:.3rem;margin-top:.3rem}
.pg-form button[type=submit]{display:block;margin:1rem 0 0 auto}
.pg-actions{display:flex;justify-content:space-between;gap:.6rem;margin-top:.6rem}
.pg-actions button[type=submit]{margin:0}
button.link-button{background:none;border:0;color:var(--bad);padding:0 .1rem;cursor:pointer}
.pg-preview{background:#fff;border:1px solid var(--line);border-radius:8px;padding:.6rem .8rem;min-width:0;position:sticky;top:4rem}
.pg-preview summary{cursor:pointer;font-weight:600;font-size:.85rem}
.pg-preview pre{max-height:32rem;margin:.5rem 0 0}
.pg-thread{display:flex;flex-direction:column;gap:.5rem;margin:.8rem 0}
.pg-message{border:1px solid var(--line);border-radius:8px;padding:.5rem .7rem;background:#fafafa}
.pg-message.user{background:#f6f8fc;border-color:#d8e2f2}
.pg-message > div,.pg-reply{white-space:pre-wrap;overflow-wrap:anywhere}
.pg-reply{max-width:28rem;max-height:9rem;overflow:auto;font-size:.85rem}
.pg-failure{color:var(--bad);font-size:.8rem;min-width:12rem;max-width:22rem;overflow-wrap:anywhere}
.pg-runs .parameter-tags{min-width:11rem}
.pg-runs .parameter-tag{white-space:nowrap}
.preview-inline{min-width:10rem}
.preview-load.small{min-height:0;padding:.5rem .7rem;flex-direction:row;font-size:.8rem}
.preview-load.small svg{width:18px;height:18px}
.preview-inline .preview-slot:empty{display:none}
.preview-inline img,.preview-inline video{display:block;max-width:18rem;max-height:14rem;object-fit:contain}
.preview-inline audio{display:block;width:16rem}
td details pre{max-width:28rem;max-height:16rem}
@media (max-width: 900px){.pg-layout{grid-template-columns:minmax(0,1fr)}.pg-preview{position:static}.pg-row{grid-template-columns:minmax(0,1fr)}.pg-row > span{padding-top:0}}
form.cell{display:inline-flex;gap:.3rem;margin:0 .3rem .3rem 0}
form.cell input{min-width:0;width:7rem}
