:root {
  --bg: #090b0c;
  --bg2: #0d1011;
  --panel: #111516;
  --panel2: #171c1e;
  --panel3: #1d2325;
  --line: #2a3336;
  --txt: #d4ddd9;
  --dim: #75817e;
  --green: #7cff9b;
  --green-dim: #1b6b39;
  --amber: #ffbf55;
  --amber-dim: #805c24;
  --red: #ff6b57;
  --blue: #8ab4ff;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(circle at 20% 0%, rgba(124,255,155,.04), transparent 25%), var(--bg);
  color: var(--txt);
  font-family: var(--mono);
  font-size: 13px;
  overflow: hidden;
}
button, input, select, textarea { font-family: var(--mono); }
button, select, input[type="text"], input[type="range"] { color: var(--txt); }

.srd-header {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #121719, #0d1011);
}
.srd-brand { display: flex; align-items: baseline; gap: 9px; letter-spacing: .16em; font-weight: 800; }
.srd-brand b { color: var(--green); text-shadow: 0 0 12px rgba(124,255,155,.25); }
.srd-brand span { color: var(--dim); font-size: 11px; font-weight: 500; }
.chip {
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: .08em;
  background: rgba(255,255,255,.02);
}
.chip b { color: var(--green); font-weight: 500; }
.chip.down b { color: var(--red); }
.status { margin-left: auto; color: var(--dim); font-size: 11px; letter-spacing: .1em; display: flex; align-items: center; gap: 8px; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); display: inline-block; }
.status.ok .dot { background: var(--green); box-shadow: 0 0 12px rgba(124,255,155,.35); }
.status.busy .dot { background: var(--amber); animation: pulse 1s infinite; }
.status.err .dot { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }

.app-grid { height: calc(100vh - 48px); display: grid; grid-template-columns: minmax(420px, 45%) 1fr; min-height: 0; }
@media (max-width: 900px) { .app-grid { grid-template-columns: 1fr; grid-template-rows: 54% 46%; } }
.editor-pane { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.viewer-pane { display: flex; flex-direction: column; min-height: 0; background: #080a0b; }

.tabs { height: 42px; display: flex; border-bottom: 1px solid var(--line); background: var(--panel); }
.tab {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0 20px;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--dim);
  cursor: pointer;
}
.tab:hover { color: var(--txt); background: rgba(255,255,255,.02); }
.tab.active { color: var(--green); background: var(--panel2); box-shadow: inset 0 -2px 0 var(--green); }
.pane { display: none; flex: 1; min-height: 0; flex-direction: column; }
.pane.show { display: flex; }

.toolbar { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.toolbar label { color: var(--dim); font-size: 10px; letter-spacing: .12em; }
select, input[type="text"] { background: #090b0c; border: 1px solid var(--line); border-radius: 3px; padding: 7px 9px; font-size: 12px; }
#partname { width: 180px; }
textarea {
  flex: 1;
  min-height: 0;
  resize: none;
  border: 0;
  background: #080a0b;
  color: var(--txt);
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.55;
  tab-size: 4;
  white-space: pre;
}
#promptText { white-space: pre-wrap; font-size: 13px; line-height: 1.65; }
.desc { color: var(--dim); padding: 12px 16px 0; line-height: 1.6; font-size: 11px; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--panel2); }
button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--txt);
  border-radius: 3px;
  padding: 9px 14px;
  font-size: 11px;
  letter-spacing: .11em;
  cursor: pointer;
}
button:hover { border-color: var(--green-dim); color: #fff; }
button.primary { background: linear-gradient(180deg, #9cffb0, #5ed97c); color: #061008; border-color: var(--green); font-weight: 800; }
button.ghost { background: transparent; }
button:disabled { opacity: .42; cursor: default; }

.seed-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel2); }
.seed-grid { flex: 1; min-height: 0; overflow: auto; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.seed-card { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; min-height: 230px; }
.seed-thumb { height: 118px; background: #070909; border-bottom: 1px solid var(--line); position: relative; display: grid; place-items: center; color: var(--dim); font-size: 10px; }
.seed-thumb canvas { width: 100%; height: 100%; display: block; }
.seed-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.seed-prompt { color: var(--txt); font-size: 11px; line-height: 1.45; max-height: 62px; overflow: hidden; }
.seed-meta { display: flex; gap: 6px; flex-wrap: wrap; color: var(--dim); font-size: 10px; }
.badge { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; font-size: 10px; letter-spacing: .08em; color: var(--dim); }
.badge.A { color: var(--green); border-color: var(--green-dim); }
.badge.B { color: var(--amber); border-color: var(--amber-dim); }

.viewport-wrap { flex: 1; min-height: 0; position: relative; border-bottom: 1px solid var(--line); }
#viewport { position: absolute; inset: 0; overflow: hidden; }
#viewport canvas { display: block; }
.reticle { position: absolute; inset: 0; pointer-events: none; }
.reticle:before, .reticle:after { content: ""; position: absolute; background: rgba(124,255,155,.09); }
.reticle:before { left: 50%; top: 0; bottom: 0; width: 1px; }
.reticle:after { top: 50%; left: 0; right: 0; height: 1px; }
.corner { position: absolute; width: 16px; height: 16px; border-color: rgba(124,255,155,.36); border-style: solid; border-width: 0; pointer-events: none; }
.c-tl { top: 10px; left: 10px; border-top-width: 1px; border-left-width: 1px; }
.c-tr { top: 10px; right: 10px; border-top-width: 1px; border-right-width: 1px; }
.c-bl { bottom: 10px; left: 10px; border-bottom-width: 1px; border-left-width: 1px; }
.c-br { bottom: 10px; right: 10px; border-bottom-width: 1px; border-right-width: 1px; }
.hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); color: var(--dim); font-size: 10px; letter-spacing: .12em; pointer-events: none; }
.dim-overlay { position: absolute; top: 12px; left: 12px; border: 1px solid var(--line); background: rgba(9,11,12,.78); padding: 8px 10px; color: var(--dim); font-size: 10px; line-height: 1.6; min-width: 168px; }
.dim-overlay b { color: var(--green); font-weight: 500; }
.viewer-controls { position: absolute; right: 12px; top: 12px; width: 245px; border: 1px solid var(--line); background: rgba(9,11,12,.78); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.viewer-controls label { display: flex; justify-content: space-between; color: var(--dim); font-size: 10px; letter-spacing: .08em; }
input[type="range"] { width: 100%; accent-color: var(--green); }
.measure { color: var(--amber); font-size: 11px; min-height: 16px; }

.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.tl-seg { min-width: 0; padding: 9px 10px; border-right: 1px solid var(--line); position: relative; color: var(--dim); }
.tl-seg:last-child { border-right: 0; }
.tl-name { font-size: 10px; letter-spacing: .12em; }
.tl-time { margin-top: 4px; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.tl-seg.active { color: var(--amber); background: rgba(255,191,85,.06); }
.tl-seg.done { color: var(--green); }
.tl-seg.err { color: var(--red); }
.tl-seg.active:before, .tl-seg.done:before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: var(--panel2); }
.metric { padding: 10px 12px; border-right: 1px solid var(--line); min-width: 0; }
.metric:last-child { border-right: 0; }
.metric .label { color: var(--dim); font-size: 10px; letter-spacing: .12em; }
.metric .value { margin-top: 6px; color: var(--txt); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric.good .value { color: var(--green); }
.metric.degraded .value { color: var(--amber); }
.metric.unhealthy .value { color: var(--red); }

.log { height: 118px; overflow: auto; padding: 9px 12px; background: #070909; color: var(--dim); line-height: 1.55; white-space: pre-wrap; font-size: 11px; }
.log .err { color: var(--red); }
.log .ok { color: var(--green); }
.log .warn { color: var(--amber); }
.log .info { color: var(--blue); }

.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { .status.busy .dot { animation: none; } }

/* v7.0 unified tabs: convert + print + library */
.form-block { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #080a0b; }
.form-block label { color: var(--dim); font-size: 10px; letter-spacing: .12em; }
.form-block input[type="file"] { border: 1px dashed var(--line); background: var(--panel); color: var(--txt); padding: 10px; border-radius: 4px; }
.form-row { display: grid; grid-template-columns: repeat(4, minmax(70px, 1fr)); gap: 9px; }
.form-row > div { display: flex; flex-direction: column; gap: 6px; }
.form-row input[type="text"], .form-row select, .form-block select { width: 100%; }
.check { display: flex; align-items: center; gap: 8px; color: var(--txt) !important; }
.check input { accent-color: var(--green); }
.panel-status { margin: 12px 16px; min-height: 72px; border: 1px solid var(--line); background: var(--panel); border-radius: 5px; padding: 12px; color: var(--dim); overflow: auto; white-space: pre-wrap; line-height: 1.5; }
.panel-status.ok { color: var(--green); border-color: var(--green-dim); }
.panel-status.warn { color: var(--amber); border-color: var(--amber-dim); }
.panel-status.err { color: var(--red); border-color: rgba(255,107,87,.45); }
.panel-status.busy { color: var(--amber); }
.button-link { display: inline-flex; align-items: center; min-height: 33px; border: 1px solid var(--line); border-radius: 3px; padding: 8px 12px; color: var(--txt); text-decoration: none; font-size: 11px; letter-spacing: .09em; background: var(--panel); }
.button-link:hover { border-color: var(--green-dim); color: #fff; }
.button-link.disabled { pointer-events: none; opacity: .42; }
.download-list { padding: 0 16px 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.links a { color: var(--blue); text-decoration: none; }
.links a:hover { color: var(--green); }
@media (max-width: 900px) { .form-row { grid-template-columns: repeat(2, minmax(70px, 1fr)); } }

/* ── MOBILE LAYER v7.0g ─────────────────────────────────── */
#viewport { touch-action: none; }
@media (max-width: 768px) {
  html, body { overflow-y: auto; height: auto; min-height: 100dvh; }
  .srd-header { height: auto; flex-wrap: wrap; padding: 8px 10px; gap: 8px; }
  .app-grid { display: block; height: auto; }
  .editor-pane { border-right: none; border-bottom: 1px solid var(--line); }
  .viewer-pane { min-height: 0; }
  .viewport-wrap { height: 58dvh; flex: none; }
  .tabs { display: flex; overflow-x: auto; }
  .tab { min-height: 46px; padding: 0 12px; font-size: 12px; flex: 1 0 auto; }
  button { min-height: 44px; padding: 11px 16px; font-size: 14px; }
  .actions { position: sticky; bottom: 0; z-index: 5; }
  .actions button.primary { flex: 1; }
  select, input[type="text"], textarea { font-size: 16px; min-height: 44px; }
  .code, textarea { font-size: 14px; }
  .viewer-controls { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center; max-height: 34dvh; overflow: auto; }
  .dim-overlay { font-size: 9px; min-width: 0; padding: 5px 7px; }
  .seed-grid, .library-grid { grid-template-columns: 1fr; }
  .timeline { overflow-x: auto; grid-auto-flow: column; grid-template-columns: none; }
  .tl-seg { min-width: 96px; }
}

/* ══ SHED GLASS SKIN v7.0g — per Chris's mock ═══════════════ */
:root {
  --card: #12181a; --card2: #0c1112; --edge: #263033;
  --acc: #52f39c; --acc2: #2fdb7d;
  --syn-kw: #c792ea; --syn-com: #5ec97c; --syn-num: #6fd3ff; --syn-str: #ffd479;
  --r-card: 16px; --r-inner: 12px; --r-pill: 999px;
}
body { background:
  radial-gradient(120% 60% at 50% -10%, rgba(82,243,156,.06), transparent 55%),
  linear-gradient(180deg, #0b1011, #090c0d); }

.srd-header { background: transparent; border-bottom: 0; padding: 12px 14px; }
.srd-brand b { color: var(--acc); }
.chip, .status { border: 1px solid var(--edge); background: var(--card);
  border-radius: var(--r-pill); padding: 7px 12px; }

.tabs { border-bottom: 0; gap: 4px; padding: 0 8px; }
.tab { border: 0; background: transparent; letter-spacing: .1em;
  border-radius: 8px 8px 0 0; position: relative; }
.tab.active { color: var(--acc); background: transparent; }
.tab.active:after { content: ""; position: absolute; left: 12px; right: 12px;
  bottom: 4px; height: 3px; border-radius: 3px; background: var(--acc); }

.editor-pane, .viewer-pane { background: transparent; border: 0; padding: 0 10px 10px; gap: 10px; }
.toolbar, .actions, .seed-toolbar, .form-block { background: var(--card); border: 1px solid var(--edge);
  border-radius: var(--r-card); margin: 0 0 2px; }
select, input[type="text"], input[type="file"] { border-radius: 10px; border-color: var(--edge); background: var(--card2); }

.hl-wrap { position: relative; flex: 1; min-height: 180px; margin: 0;
  border: 1px solid var(--edge); border-radius: var(--r-card);
  background: var(--card2); overflow: hidden; }
.hl-wrap pre { margin: 0; position: absolute; inset: 0; overflow: auto;
  padding: 14px 16px; font: 500 13px/1.65 var(--mono); color: var(--txt);
  white-space: pre; pointer-events: none; }
.hl-wrap textarea { position: absolute; inset: 0; width: 100%; height: 100%;
  background: transparent; border: 0; resize: none; outline: none;
  padding: 14px 16px; font: 500 13px/1.65 var(--mono);
  color: transparent; caret-color: var(--acc); white-space: pre; overflow: auto; }
.hl-wrap textarea::selection { background: rgba(82,243,156,.22); color: transparent; }
.tok-kw { color: var(--syn-kw); } .tok-com { color: var(--syn-com); }
.tok-num { color: var(--syn-num); } .tok-str { color: var(--syn-str); }
.tok-id { color: #9adfff; }

button { border-radius: var(--r-pill); border-color: var(--edge); background: var(--card); }
button.primary { background: linear-gradient(180deg, #8dffb8, #3fe07f);
  border: 0; box-shadow: 0 4px 18px rgba(82,243,156,.25); }
button:hover { border-color: var(--acc2); }

.viewport-wrap { border: 1px solid var(--edge); border-radius: var(--r-card);
  overflow: hidden; background: #070a0b; }
.viewer-controls, .dim-overlay { border-radius: var(--r-inner);
  border-color: var(--edge); background: rgba(14,19,20,.86);
  backdrop-filter: blur(6px); }
.corner { display: none; }
.hint { opacity: .5; }

.timeline { border: 0; background: transparent; gap: 8px; padding: 2px; }
.tl-seg { border: 1px solid var(--edge) !important; border-radius: var(--r-inner);
  background: var(--card); padding: 10px 12px; }
.tl-seg.active:before, .tl-seg.done:before { left: 10px; right: 10px; bottom: 5px;
  border-radius: 2px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 8px 2px; background: transparent; border: 0; }
.metric { border: 1px solid var(--edge); border-radius: var(--r-inner);
  background: var(--card); padding: 10px 12px; }
.metric .label { color: var(--dim); font-size: 10px; letter-spacing: .12em; }
.metric .value { font-weight: 700; margin-top: 3px; }
.metric.good { border-color: var(--green-dim); } .metric.bad { border-color: #6b2a22; }
.log { border: 1px solid var(--edge); border-radius: var(--r-inner);
  background: var(--card2); margin: 0 2px 8px; }
.seed-card, .library-card { border-radius: var(--r-inner); border-color: var(--edge); background: var(--card); }
@media (max-width: 768px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .app-grid { padding: 0 2px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ══ code2step.com commercial finishing layer v7.0-final ═════════════ */
[hidden], .hidden { display: none !important; }
.srd-header .small { min-height: 0; padding: 7px 12px; font-size: 10px; }
.srd-brand b { font-size: 18px; letter-spacing: .08em; text-transform: lowercase; }
.account-chip b { max-width: 180px; display: inline-block; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.launch-card {
  border: 1px solid rgba(82,243,156,.20);
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(82,243,156,.12), transparent 55%),
    linear-gradient(180deg, rgba(18,24,26,.96), rgba(9,13,14,.92));
  border-radius: 18px;
  padding: 18px 18px 16px;
  margin: 0 0 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.04);
}
.launch-kicker { color: var(--acc); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; font-weight: 800; }
.launch-card h1 { margin: 8px 0 8px; font-size: clamp(20px, 3vw, 34px); line-height: 1.05; letter-spacing: -.045em; color: #effff6; }
.launch-card p { margin: 0; max-width: 760px; color: #9aaaa5; line-height: 1.55; }
.launch-points { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.launch-points span {
  border: 1px solid rgba(82,243,156,.20); color: #cffff0;
  background: rgba(82,243,156,.06); border-radius: 999px; padding: 6px 10px; font-size: 11px;
}
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(0,0,0,.58); backdrop-filter: blur(10px); }
.modal-card { width: min(1080px, 96vw); max-height: 92vh; overflow: auto; border: 1px solid var(--edge);
  border-radius: 22px; background:
    radial-gradient(80% 70% at 100% 0%, rgba(82,243,156,.10), transparent 55%),
    linear-gradient(180deg, #12181a, #090d0e); box-shadow: 0 30px 90px rgba(0,0,0,.55); padding: 18px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.modal-head h2 { margin: 6px 0 2px; letter-spacing: -.04em; font-size: 28px; color: #effff6; }
.modal-tabs { display: flex; gap: 4px; margin: 14px 0 10px; border-bottom: 1px solid var(--edge); }
.tab.mini { min-height: 40px; padding: 0 14px; flex: 0 0 auto; }
.auth-panel { display: none; }
.auth-panel.show { display: block; }
.auth-row { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
input[type="password"] { color: var(--txt); border: 1px solid var(--edge); background: var(--card2); border-radius: 10px; padding: 10px; min-height: 38px; width: 100%; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; }
.price-card { position: relative; border: 1px solid var(--edge); background: rgba(18,24,26,.86); border-radius: 16px; padding: 16px; min-height: 275px; display: flex; flex-direction: column; gap: 12px; }
.price-card.highlight { border-color: rgba(82,243,156,.55); box-shadow: 0 0 0 1px rgba(82,243,156,.16), 0 18px 55px rgba(82,243,156,.08); }
.price-card.highlight:before { content: "POPULAR"; position: absolute; top: -10px; right: 14px; border-radius: 999px; padding: 4px 8px; font-size: 9px; color: #06100a; background: var(--acc); font-weight: 900; letter-spacing: .12em; }
.price-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.price-title b { font-size: 18px; color: #effff6; }
.price { font-size: 26px; letter-spacing: -.06em; color: var(--acc); font-weight: 900; }
.price small { font-size: 11px; color: var(--dim); letter-spacing: 0; font-weight: 500; }
.price-card p { margin: 0; color: #98a7a2; line-height: 1.45; }
.price-card ul { margin: 0; padding-left: 16px; color: #cbd8d3; line-height: 1.55; }
.price-card li { margin: 4px 0; }
.price-card button { margin-top: auto; width: 100%; }
.usage-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; color: var(--dim); font-size: 10px; border-top: 1px solid var(--edge); padding-top: 10px; }
.panel-status.ok { border-color: var(--green-dim); color: var(--green); }
.panel-status.busy { border-color: var(--amber-dim); color: var(--amber); }
.panel-status.warn { border-color: var(--amber-dim); color: var(--amber); }
.panel-status.err { border-color: #6b2a22; color: var(--red); }
@media (max-width: 1180px) { .pricing-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); } }
@media (max-width: 768px) {
  .srd-header { align-items: center; }
  .srd-header .status { margin-left: 0; width: 100%; justify-content: flex-end; }
  .launch-card { padding: 14px; }
  .launch-card h1 { font-size: 24px; }
  .auth-row, .pricing-grid { grid-template-columns: 1fr; }
  .modal { padding: 8px; align-items: stretch; }
  .modal-card { width: 100%; max-height: 96dvh; border-radius: 18px; }
  .modal-tabs { overflow-x: auto; }
  .price-card { min-height: 0; }
}
