/* Nyxis Studio — night palette, lavender moon accent, editorial serif headings. */
:root {
  --bg: #0a0910;
  --bg-glow: #141029;
  --panel: #12101b;
  --panel-2: #1a1727;
  --line: #2a2540;
  --line-soft: #1f1b30;
  --ink: #ece8f7;
  --ink-2: #c9c3de;
  --muted: #8e87a8;
  --accent: #c4b0ff;
  --accent-2: #9d85f2;
  --accent-ink: #140f24;
  --star: #ffd59e;
  --ok: #86e3b6;
  --warn: #ffd59e;
  --bad: #ff8fa0;
  --radius: 12px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, var(--bg-glow), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.boot { display: grid; place-items: center; height: 100vh; font: 28px var(--serif); color: var(--muted); }

/* ---------- shell ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px;
  padding: 14px 28px; background: rgba(10, 9, 16, .82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 600 17px var(--serif); letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.brand small { font: 500 10px var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-left: 2px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink-2); padding: 7px 12px; border-radius: 999px; font-size: 14px; }
.nav a:hover { background: var(--panel-2); text-decoration: none; }
.nav a.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.account .team { color: var(--ink-2); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; max-width: 1320px; margin: 0 auto; padding: 32px 28px 80px; }
.layout.rail-closed { grid-template-columns: minmax(0, 1fr) 44px; }
main { min-width: 0; }
.page-narrow { max-width: 780px; }

/* ---------- type ---------- */
h1 { font: 500 40px/1.1 var(--serif); margin: 0 0 8px; letter-spacing: -.01em; }
h2 { font: 500 24px/1.2 var(--serif); margin: 0 0 6px; }
h3 { font: 600 15px var(--sans); margin: 0 0 4px; }
.lede { color: var(--ink-2); font-size: 16px; max-width: 620px; margin: 0 0 28px; }
.eyebrow { font: 600 11px var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.section { margin: 36px 0 0; }
.section > .eyebrow { padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: 999px;
  padding: 9px 18px; font: 600 14px var(--sans); white-space: nowrap;
}
.btn:hover { border-color: var(--accent-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #d3c4ff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

label.field { display: block; margin: 0 0 18px; }
label.field > span, .field-label { display: block; font: 600 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: 15px var(--sans);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.code { font: 13px/1.45 var(--mono); min-height: 200px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(196, 176, 255, .15); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--accent); }
.check small { display: block; color: var(--muted); }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 16px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--ink-2); border-radius: 999px;
  padding: 6px 12px; font: 500 13px var(--sans); cursor: pointer;
}
.chip:hover { border-color: var(--accent-2); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.chip .dim { opacity: .7; font-weight: 400; margin-left: 4px; }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 12px; }
.card.inset { background: var(--panel-2); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
a.type-card { display: block; color: var(--ink); background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 18px; transition: border-color .15s, transform .15s; }
a.type-card:hover { text-decoration: none; border-color: var(--accent-2); transform: translateY(-1px); }
a.type-card h3 { font: 500 19px var(--serif); margin-bottom: 6px; }
a.type-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.badge { display: inline-block; font: 600 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge.ok { color: var(--ok); border-color: rgba(134, 227, 182, .35); }
.badge.warn { color: var(--warn); border-color: rgba(255, 213, 158, .35); }
.badge.bad { color: var(--bad); border-color: rgba(255, 143, 160, .35); }
.badge.accent { color: var(--accent); border-color: rgba(196, 176, 255, .4); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }

.hero { padding: 26px 0 8px; }
.hero h1 { font-size: 52px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 24px; }
.quick a { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--radius); background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-soft); color: var(--ink); }
.quick a:hover { text-decoration: none; border-color: var(--accent-2); }
.quick b { font: 500 20px var(--serif); }
.quick span { color: var(--muted); font-size: 13.5px; }

.notice { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--panel); border-radius: 10px; padding: 12px 16px; color: var(--ink-2); margin: 0 0 18px; }
.notice.bad { border-left-color: var(--bad); }
.notice.warn { border-left-color: var(--warn); }
.empty { color: var(--muted); padding: 22px 0; }
.err { color: var(--bad); font-size: 14px; margin: 8px 0 0; min-height: 1em; }
pre.cmd { background: #07060c; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; word-break: break-all; font: 12.5px/1.5 var(--mono); color: var(--ink-2); margin: 8px 0; }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: 22px 0; }

/* ---------- size picker ---------- */
.size-custom { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-top: 10px; max-width: 300px; }
.size-custom span { color: var(--muted); }

/* ---------- uploads ---------- */
.drop { border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.drop.over { border-color: var(--accent); background: rgba(196, 176, 255, .05); }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; line-height: 1; }
.thumb .tag { position: absolute; left: 4px; bottom: 4px; font: 600 10px var(--mono); background: rgba(0,0,0,.7); padding: 1px 5px; border-radius: 4px; }

/* ---------- jobs ---------- */
.job { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.job:last-child { border-bottom: 0; }
.job .pic { width: 64px; height: 64px; border-radius: 10px; background: var(--panel-2); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.job .pic img, .job .pic video { width: 100%; height: 100%; object-fit: cover; }
.job .title { font-weight: 600; }
.job .prompt { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bar { height: 4px; background: var(--line-soft); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 4px; transition: width .4s; }
.bar.indet i { width: 35% !important; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* ---------- rail ---------- */
.rail { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; border-left: 1px solid var(--line-soft); padding-left: 20px; }
.rail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.rail-head .eyebrow { margin: 0; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); cursor: pointer; font-size: 14px; }
.icon-btn:hover { border-color: var(--accent-2); }
.rail-item { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
.rail-item:hover { text-decoration: none; }
.rail-item .pic { width: 52px; height: 52px; border-radius: 8px; background: var(--panel-2); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 18px; }
.rail-item .pic img, .rail-item .pic video { width: 100%; height: 100%; object-fit: cover; }
.rail-item b { font-size: 13px; display: block; }
.rail-item span { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.layout.rail-closed .rail-body { display: none; }
.layout.rail-closed .rail { padding-left: 6px; }
.layout.rail-closed .rail-head .eyebrow { display: none; }

/* ---------- library ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar select { width: auto; padding: 6px 10px; font-size: 13px; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(var(--tile, 200px), 1fr)); }
.tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--panel); border: 1px solid var(--line-soft); cursor: zoom-in; padding: 0; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: var(--fit, cover); }
.tile .audio { display: grid; place-items: center; height: 100%; color: var(--accent); font: 34px var(--serif); }
.tile .kind { position: absolute; left: 8px; top: 8px; }
.list-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.list-row .tile { aspect-ratio: 1; }

.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(5, 4, 9, .92); display: grid; grid-template-columns: 1fr 360px; }
.lightbox .stage { display: grid; place-items: center; padding: 30px; min-height: 0; }
.lightbox .stage img, .lightbox .stage video { max-height: calc(100vh - 60px); max-width: 100%; object-fit: contain; border-radius: 8px; }
.lightbox .stage audio { width: 80%; }
.lightbox aside { background: var(--panel); border-left: 1px solid var(--line); padding: 24px; overflow: auto; }
.lightbox dl { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; font-size: 13px; margin: 14px 0; }
.lightbox dt { color: var(--muted); }
.lightbox dd { margin: 0; word-break: break-word; }

/* ---------- machines ---------- */
.machine { display: grid; grid-template-columns: 1fr auto; gap: 14px; }
.machine .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 6px; }
.gpu-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gpu-table th { text-align: left; font: 600 11px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.gpu-table td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); }
.gpu-table tr.pick { cursor: pointer; }
.gpu-table tr.pick:hover td { background: var(--panel-2); }
.gpu-table tr.on td { background: rgba(196, 176, 255, .1); }

/* ---------- auth ---------- */
.auth { max-width: 420px; margin: 9vh auto; padding: 0 20px; }
.auth .brand { justify-content: center; margin-bottom: 26px; font-size: 22px; }
.auth .brand img { width: 40px; height: 40px; }
.auth h1 { font-size: 32px; text-align: center; }
.auth .lede { text-align: center; margin: 0 auto 26px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); padding: 10px 18px; border-radius: 999px; z-index: 60; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.bad { border-color: var(--bad); color: var(--bad); }

@media (max-width: 1000px) {
  .layout, .layout.rail-closed { grid-template-columns: 1fr; }
  .rail { position: static; border-left: 0; padding-left: 0; max-height: none; }
  .lightbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .top { flex-wrap: wrap; gap: 12px; }
  .account { margin-left: 0; }
  .hero h1 { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
