:root {
  color-scheme: dark;
  --ink: #f1eadf;
  --muted: #a9a1b1;
  --line: #3c3547;
  --panel: rgba(29, 25, 39, .88);
  --bg: #0f0d16;
  --purple: #c997dc;
  --lavender: #e1b8f0;
  --green: #8bd1aa;
  --red: #df9197;
  --gold: #f1c47e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 0%, rgba(125, 64, 153, .24), transparent 32rem),
    radial-gradient(circle at 2% 48%, rgba(50, 101, 93, .15), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; transform: none !important; }
.shell { width: min(1400px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 6px 2px 35px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--purple); border-radius: 50%; color: var(--purple); font-size: 1.05rem; box-shadow: 0 0 30px rgba(201, 151, 220, .28); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .78rem; letter-spacing: .19em; }
.brand small { color: var(--muted); font-size: .6rem; letter-spacing: .22em; margin-top: 3px; }
.connection { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; letter-spacing: .05em; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }
.hero { min-height: 345px; display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 28px 5px 45px; }
.eyebrow { color: var(--purple); letter-spacing: .19em; font-size: .67rem; font-weight: 800; margin: 0 0 14px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.045em; }
h1 { font-size: clamp(3.2rem, 7vw, 6.7rem); line-height: .87; max-width: 780px; margin: 0; }
h1 em { color: var(--lavender); font-style: italic; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2.1rem); margin: 0; }
.lede { color: var(--muted); max-width: 560px; line-height: 1.65; margin: 25px 0 0; font-size: .98rem; }
.hero-orbit { position: relative; display: grid; place-items: center; width: clamp(180px, 24vw, 310px); aspect-ratio: 1; border: 1px solid rgba(201, 151, 220, .44); border-radius: 50%; color: var(--gold); font-size: 4rem; box-shadow: 0 0 95px rgba(145, 83, 174, .23), inset 0 0 80px rgba(112, 55, 141, .16); }
.hero-orbit:before, .hero-orbit:after { content: ""; position: absolute; border: 1px solid rgba(201, 151, 220, .22); border-radius: 50%; }
.hero-orbit:before { inset: 13%; }
.hero-orbit:after { inset: 28%; border-color: rgba(241, 196, 126, .22); }
.hero-orbit span { position: relative; z-index: 1; }
.hero-orbit i, .hero-orbit b { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 20px var(--gold); }
.hero-orbit i { top: 9%; right: 20%; }
.hero-orbit b { bottom: 20%; left: 12%; background: var(--purple); box-shadow: 0 0 20px var(--purple); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 70px rgba(0, 0, 0, .16); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 30px; }
.stat-card { padding: 20px 21px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(26, 22, 34, .72); }
.stat-card.accent { border-color: rgba(201, 151, 220, .68); background: linear-gradient(135deg, rgba(89, 50, 104, .65), rgba(29, 25, 39, .78)); }
.stat-label { display: block; color: var(--muted); font-size: .63rem; letter-spacing: .16em; font-weight: 800; }
.stat-card strong { display: block; font-family: Georgia, serif; font-size: 2.55rem; font-weight: 500; margin: 8px 0 2px; }
.stat-card small { color: var(--muted); font-size: .76rem; }
.workflow, .create-panel, .library-panel, .package { padding: 25px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 21px; }
.section-heading .eyebrow { margin-bottom: 8px; }
.muted { color: var(--muted); font-size: .8rem; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.step { position: relative; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(18, 15, 24, .58); }
.step:not(:last-child):after { content: "→"; position: absolute; right: -14px; top: 26px; color: var(--line); z-index: 2; }
.step span { display: block; color: var(--muted); font-size: .62rem; letter-spacing: .12em; margin-bottom: 22px; }
.step strong, .step small { display: block; }
.step strong { font-size: .9rem; }
.step small { color: var(--muted); font-size: .72rem; margin-top: 4px; }
.step.active { border-color: rgba(201, 151, 220, .6); }
.step.active span { color: var(--purple); }
.step.done span:before { content: "✓ "; color: var(--green); }
.create-layout { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(420px, 1.1fr); gap: 16px; margin: 30px 0 45px; }
.badge { color: var(--gold); border: 1px solid rgba(241, 196, 126, .45); border-radius: 999px; font-size: .64rem; letter-spacing: .12em; padding: 7px 9px; }
.field-label { display: block; color: var(--muted); font-size: .75rem; letter-spacing: .04em; margin: 15px 0 7px; }
input, textarea, select { width: 100%; color: var(--ink); background: #211b2b; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; outline: none; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(201, 151, 220, .11); }
.check-row { display: flex; gap: 10px; align-items: start; margin: 18px 0; color: var(--ink); }
.check-row input { width: auto; margin-top: 3px; accent-color: var(--purple); }
.check-row strong, .check-row small { display: block; }
.check-row strong { font-size: .82rem; }
.check-row small { color: var(--muted); font-size: .7rem; margin-top: 4px; }
.style-preset-note { margin: 7px 0 0; color: var(--muted); font-size: .68rem; line-height: 1.4; }
.style-mode-row { padding: 11px 12px; border: 1px solid rgba(201, 151, 220, .28); border-radius: 10px; background: rgba(82, 47, 92, .16); }
.variant-note { color: var(--muted); font-size: .64rem; line-height: 1.5; margin: -4px 0 15px 26px; }
.variant-note span { color: var(--gold); font-weight: 800; letter-spacing: .08em; }
.button { color: var(--ink); background: #2a2333; border: 1px solid #4b3b54; border-radius: 9px; padding: 10px 13px; transition: .18s ease; }
.button:hover { transform: translateY(-1px); border-color: var(--purple); }
.button.primary { background: linear-gradient(135deg, #784681, #573160); border-color: #b77ac6; }
.button.secondary { color: var(--lavender); background: rgba(82, 47, 92, .55); border-color: #72517b; }
.button.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.button.danger { color: #e7adb2; background: transparent; border-color: #71434b; }
.button.wide { width: 100%; padding: 13px; font-weight: 750; }
.button.wide span { color: var(--gold); margin-right: 6px; }
.microcopy { color: var(--muted); font-size: .68rem; line-height: 1.45; margin: 16px 0 0; }
.run-list { display: grid; gap: 5px; max-height: 290px; overflow: auto; }
.run-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 10px 8px; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 10px; }
.run-row:hover, .run-row.selected { background: rgba(106, 65, 118, .2); border-color: rgba(201, 151, 220, .4); transform: none; }
.run-icon { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 50%; color: var(--purple); }
.run-copy { min-width: 0; }
.run-copy strong, .run-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-copy strong { font-size: .78rem; }
.run-copy small { color: var(--muted); font-size: .64rem; margin-top: 3px; }
.run-state { color: var(--muted); font-size: .62rem; white-space: nowrap; }
.run-state.review { color: var(--gold); }.run-state.ready { color: var(--green); }.run-state.generating { color: var(--purple); }.run-state.generation-issues { color: var(--red); }
.review-section { margin-bottom: 34px; }
.review-heading { align-items: end; margin-bottom: 17px; }
.run-picker { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .75rem; min-width: min(100%, 390px); }
.run-picker select { width: auto; min-width: 270px; }
.review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 17px; margin-bottom: 18px; }
.review-toolbar strong { font-family: Georgia, serif; font-size: 1.25rem; font-weight: 500; }
.review-toolbar p { margin: 4px 0 0; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notice { margin-bottom: 18px; padding: 13px 16px; border-radius: 10px; border: 1px solid var(--line); background: #211a27; color: var(--muted); font-size: .82rem; }
.notice.error { color: #ffb7b7; border-color: #70454d; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 15px; }
.card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #1c1723; transition: .18s ease; }
.card.keep { border-color: var(--green); box-shadow: 0 0 0 1px rgba(139, 209, 170, .25), 0 18px 40px rgba(0,0,0,.2); }
.card.reject, .card.rejected { border-color: #71444c; opacity: .62; }
.card.failed { border-color: var(--red); }
.preview { aspect-ratio: 2 / 3; background: #100d15; position: relative; overflow: hidden; }
.preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.preview-button { display: block; width: 100%; padding: 0; border: 0; border-radius: 0; background: #100d15; color: inherit; text-align: left; cursor: zoom-in; appearance: none; }
.preview-button img { transition: transform .22s ease, filter .22s ease; }
.preview-button:hover img, .preview-button:focus-visible img { transform: scale(1.025); filter: brightness(1.08); }
.preview-button:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
.zoom-hint { position: absolute; left: 50%; bottom: 12px; transform: translate(-50%, 5px); padding: 6px 9px; border: 1px solid rgba(241, 196, 126, .42); border-radius: 999px; background: rgba(12, 9, 16, .82); color: var(--ink); font-size: .62rem; letter-spacing: .05em; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; white-space: nowrap; }
.preview-button:hover .zoom-hint, .preview-button:focus-visible .zoom-hint { opacity: 1; transform: translate(-50%, 0); }
.preview-placeholder { height: 100%; display: grid; place-content: center; gap: 6px; padding: 20px; text-align: center; color: var(--muted); background: radial-gradient(circle at 50% 40%, rgba(109, 61, 115, .4), transparent 52%), #161220; }
.preview-placeholder span { color: var(--gold); font-size: 2rem; }
.preview-placeholder strong { color: var(--ink); font-size: .8rem; }
.preview-placeholder small { font-size: .67rem; line-height: 1.35; }
.pick { position: absolute; left: 10px; top: 10px; border-radius: 999px; padding: 5px 8px; font-size: .66rem; font-weight: 800; letter-spacing: .08em; background: rgba(12, 9, 16, .78); backdrop-filter: blur(8px); }
.variant-chip { position: absolute; right: 10px; top: 10px; border-radius: 999px; padding: 5px 8px; font-size: .58rem; font-weight: 800; letter-spacing: .08em; background: rgba(12, 9, 16, .72); color: var(--lavender); backdrop-filter: blur(8px); }
.card-body { padding: 12px; }
.card-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 9px; }
.card-title strong { font-size: .75rem; letter-spacing: .1em; }
.status { text-transform: uppercase; font-size: .6rem; letter-spacing: .1em; color: var(--muted); }
.status.keep { color: var(--green); }.status.reject, .status.rejected { color: var(--red); }.status.failed { color: var(--red); }
.note { width: 100%; margin: 2px 0 10px; font-size: .76rem; }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.card-actions button { font-size: .75rem; }
.card-actions .keep-btn { color: #b7e3c2; border-color: #3c7251; }.card-actions .reject-btn { color: #edb5b5; border-color: #75454c; }
.reroll-box { display: grid; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(60, 53, 71, .7); }
.reroll-box label { color: var(--muted); font-size: .64rem; letter-spacing: .05em; text-transform: uppercase; }
.reroll-box select { width: 100%; padding: 8px 9px; font-size: .7rem; }
.reroll-btn { width: 100%; color: var(--gold); background: transparent; border: 1px solid rgba(241, 196, 126, .46); border-radius: 8px; padding: 8px 10px; font-size: .72rem; font-weight: 700; }
.reroll-btn:hover { border-color: var(--gold); background: rgba(241, 196, 126, .08); }
.card-lock { display: block; color: var(--muted); font-size: .7rem; min-height: 32px; padding-top: 9px; }
.package { margin-top: 16px; }
.package-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: end; }
.compact-button { padding: 7px 9px; font-size: .66rem; }
.artifact-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.artifact-group { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(16, 13, 22, .48); }
.artifact-heading { display: flex; justify-content: space-between; gap: 8px; color: var(--lavender); font-size: .75rem; margin-bottom: 8px; }.artifact-heading span { color: var(--muted); font-size: .65rem; }
.artifact-file { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); text-decoration: none; border-top: 1px solid rgba(60, 53, 71, .6); padding: 8px 0 0; margin-top: 8px; font-size: .67rem; }.artifact-file:hover { color: var(--ink); }.artifact-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.artifact-file b { color: var(--gold); }
.artifact-empty { color: var(--muted); font-size: .7rem; }
.empty { padding: 70px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; grid-column: 1 / -1; }.empty.compact { padding: 25px 16px; font-size: .78rem; }.empty strong { color: var(--ink); }
.footer { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-top: 25px; color: var(--muted); font-size: .72rem; }.footer code { color: var(--purple); }
.lightbox[hidden] { display: none; }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: clamp(10px, 2vw, 28px); background: rgba(6, 5, 10, .9); backdrop-filter: blur(12px); }
.lightbox-backdrop { position: absolute; inset: 0; }
.lightbox-dialog { position: relative; display: flex; flex-direction: column; width: min(1500px, 100%); height: min(94vh, 1050px); overflow: hidden; border: 1px solid rgba(201, 151, 220, .45); border-radius: 18px; background: #15111d; box-shadow: 0 30px 120px rgba(0, 0, 0, .55); }
.lightbox-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: rgba(29, 25, 39, .94); }
.lightbox-header h2 { margin: 3px 0 0; font-family: Georgia, serif; font-size: clamp(1.25rem, 2vw, 1.8rem); font-weight: 500; }
.lightbox-header p { margin: 4px 0 0; }
.lightbox-controls { display: flex; gap: 7px; flex-wrap: wrap; justify-content: end; }
.lightbox-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); flex: 1; min-height: 0; }
.lightbox-image-stage { display: grid; place-items: center; min-width: 0; min-height: 0; padding: clamp(12px, 2vw, 28px); background: radial-gradient(circle at 50% 40%, rgba(109, 61, 115, .2), transparent 55%), #0b0910; }
.lightbox-image { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 190px); object-fit: contain; box-shadow: 0 18px 60px rgba(0, 0, 0, .45); }
.lightbox-details { min-width: 0; overflow: auto; padding: 22px; border-left: 1px solid var(--line); background: rgba(29, 25, 39, .74); }
.detail-grid { display: grid; gap: 10px; margin-bottom: 18px; }
.detail-grid div { display: grid; gap: 3px; padding-bottom: 10px; border-bottom: 1px solid rgba(60, 53, 71, .7); }
.detail-grid span { color: var(--muted); font-size: .63rem; letter-spacing: .1em; text-transform: uppercase; }
.detail-grid strong { overflow-wrap: anywhere; font-size: .78rem; font-weight: 600; }
.lightbox-details .wide { display: block; width: 100%; text-align: center; text-decoration: none; }
.lightbox-copy { margin-top: 24px; }
.lightbox-copy .eyebrow { margin-bottom: 8px; }
.lightbox-copy p:last-child { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; white-space: pre-wrap; }
.lightbox-footer { padding: 10px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .68rem; text-align: center; }
body.lightbox-open { overflow: hidden; }
@media (max-width: 900px) { .hero { min-height: 0; }.hero-orbit { width: 190px; }.create-layout { grid-template-columns: 1fr; }.artifact-groups { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 650px) { .shell { width: min(100% - 24px, 600px); padding-top: 18px; }.topbar { padding-bottom: 22px; }.connection { display: none; }.hero { display: block; padding: 22px 2px 35px; }.hero-orbit { margin: 32px auto 0; width: 150px; font-size: 2.7rem; }.stats { grid-template-columns: repeat(2, 1fr); }.stat-card { padding: 15px; }.stat-card strong { font-size: 2rem; }.workflow, .create-panel, .library-panel, .package { padding: 17px; }.steps { grid-template-columns: repeat(2, 1fr); }.step:not(:last-child):after { display: none; }.section-heading, .review-toolbar { display: block; }.section-heading > .muted, .section-heading > .badge { display: inline-block; margin-top: 11px; }.review-toolbar .toolbar-actions { margin-top: 14px; }.toolbar-actions .button { flex: 1; }.run-picker { margin-top: 15px; }.run-picker select { min-width: 0; flex: 1; }.artifact-groups { grid-template-columns: 1fr; }.footer { align-items: start; flex-direction: column; }.lightbox { padding: 0; }.lightbox-dialog { width: 100%; height: 100%; border-radius: 0; border: 0; }.lightbox-header { align-items: start; padding: 14px; }.lightbox-controls { gap: 5px; }.lightbox-controls .button { padding: 7px; font-size: .6rem; }.lightbox-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }.lightbox-image { max-height: 100%; }.lightbox-details { max-height: 32vh; padding: 16px; border-top: 1px solid var(--line); border-left: 0; }.lightbox-copy { margin-top: 16px; }.lightbox-footer { padding: 8px 14px; } }
