/* SysForge Web — one stylesheet (SPEC §20.1: base font 16px, controls ≥ 44px). */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --ink: #1b1f24;
  --muted: #5b6270;
  --faint: #8a909b;
  --line: #e5e1d8;
  --line-strong: #d4cfc3;
  --side: #1c2026;
  --side-2: #262b33;
  --side-ink: #d5dae2;
  --side-faint: #8b93a1;
  --accent: #c2410c;
  --accent-hover: #a83a0b;
  --accent-soft: #fdf0e7;
  --accent-line: #f3c7ab;
  --accent-ink: #9a3412;
  --ok: #15803d;
  --ok-soft: #e7f5ec;
  --warn: #b45309;
  --warn-soft: #fdf3df;
  --err: #b91c1c;
  --err-soft: #fdecec;
  --info-soft: #e8f0fb;
  --info: #1d4ed8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(28, 32, 38, .05), 0 4px 16px rgba(28, 32, 38, .04);
  --font: "IBM Plex Sans", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); }
a:hover { color: var(--accent); }
code, kbd, .mono { font-family: var(--mono); font-size: .92em; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 22px 16px; display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; padding: 2px 6px 10px; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 22px; height: 22px; }
.brand b { display: block; font-size: 1.15rem; color: #fff; letter-spacing: -.01em; }
.brand small { display: block; color: var(--side-faint); font-size: .82rem; line-height: 1.3; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: var(--side-ink);
  text-decoration: none; min-height: 46px; font-weight: 500; }
.nav a svg { width: 20px; height: 20px; flex: none; opacity: .85; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.on { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav .badge-dot { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .25); }
.side-foot { margin-top: auto; border-top: 1px solid var(--side-2); padding: 14px 6px 0; font-size: .82rem; color: var(--side-faint); line-height: 1.6; }
.side-foot b { color: var(--side-ink); font-weight: 600; }
.side-foot .demo { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 99px; background: #3b2a1c; color: #fbbf8a; font-size: .75rem; }

.main { padding: 30px 36px 60px; min-width: 0; }
.page-head { margin-bottom: 22px; max-width: 900px; }
.page-head .eyebrow { font-family: var(--mono); color: var(--muted); font-size: .85rem; letter-spacing: .02em; }
.page-head h1 { font-size: 2rem; margin: 2px 0 6px; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin: 0; }

/* ---------- cards & form ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card h2 { font-size: 1.3rem; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.card h2 .step { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid;
  place-items: center; font-size: .95rem; font-weight: 700; flex: none; }
.card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.sub { color: var(--muted); font-size: .92rem; }
.help { color: var(--muted); font-size: .9rem; margin-top: 8px; }
label.lbl, .lbl { display: block; font-weight: 600; font-size: .93rem; margin-bottom: 7px; }
.lbl .opt { font-weight: 400; color: var(--muted); }
.field { margin-bottom: 18px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.row > .grow { flex: 1 1 220px; }

input[type=text], input[type=number], input[type=search], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  min-height: 46px; padding: 9px 13px; width: 100%; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input.mono { font-family: var(--mono); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235b6270' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 .95rem var(--font); cursor: pointer;
  text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.big { width: 100%; min-height: 54px; font-size: 1.05rem; border-radius: 12px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--err); border-color: #f0c2c2; }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err); color: var(--err); }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: .88rem; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.btn.primary:disabled { background: #d8a68c; border-color: #d8a68c; opacity: 1; }

.stepper { display: flex; gap: 8px; }
.stepper .btn { width: 46px; padding: 0; font-size: 1.3rem; font-weight: 500; }
.stepper input { width: 84px; text-align: center; font-weight: 600; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick .btn { min-width: 46px; padding: 8px 12px; }
.quick .btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

.check { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; min-height: 44px; padding-top: 10px; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check span small { display: block; color: var(--muted); font-size: .86rem; }

/* choice cards (theme mode, databases) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.choice { position: relative; display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 16px 18px 16px 50px; cursor: pointer;
  background: var(--surface); transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--line-strong); }
.choice input { position: absolute; left: 17px; top: 18px; width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.choice b { display: block; font-size: 1rem; }
.choice small { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.tag { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; margin-top: 8px;
  background: var(--ok-soft); color: var(--ok); }
.tag.blue { background: var(--info-soft); color: var(--info); }
.tag.amber { background: var(--warn-soft); color: var(--warn); }
.tag.grey { background: var(--surface-2); color: var(--muted); }
.tag.red { background: var(--err-soft); color: var(--err); }

/* theme pickers */
.pickers { margin-top: 20px; border-top: 1px dashed var(--line-strong); padding-top: 18px; }
.picker { margin-bottom: 20px; }
.picker-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.picker-head .lbl { margin: 0; }
.picker-head .sub { font-size: .85rem; }
.tiles { display: grid; gap: 9px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles.wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { position: relative; display: flex; flex-direction: column; gap: 7px; border: 1.5px solid var(--line); border-radius: 11px;
  padding: 9px; cursor: pointer; background: var(--surface); min-height: 44px; font-size: .86rem; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile:hover { border-color: var(--line-strong); }
.tile:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.tile:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.tile b { font-weight: 600; font-size: .88rem; line-height: 1.25; }
.tile small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.swatch { display: flex; height: 26px; border-radius: 7px; overflow: hidden; }
.swatch i { flex: 1; }
.surprise { height: 26px; border-radius: 7px; background: conic-gradient(from 90deg, #f97316, #eab308, #22c55e, #06b6d4, #6366f1, #d946ef, #f97316);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .95rem; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.lay { height: 46px; border-radius: 6px; background: var(--surface-2); display: grid; overflow: hidden; border: 1px solid var(--line); }
.lay i { display: block; }
.lay.sidebar { grid-template-columns: 26% 1fr; } .lay.sidebar i:first-child { background: #3b4352; }
.lay.sidebar-mini { grid-template-columns: 11% 1fr; } .lay.sidebar-mini i:first-child { background: #3b4352; }
.lay.topnav { grid-template-rows: 26% 1fr; } .lay.topnav i:first-child { background: #3b4352; }
.lay.topnav-tabs { grid-template-rows: 24% 16% 1fr; } .lay.topnav-tabs i:first-child { background: #3b4352; }
.lay.topnav-tabs i:nth-child(2) { background: repeating-linear-gradient(90deg, #c9ccd3 0 22%, transparent 22% 28%); margin: 3px 6px; }
.lay.mega-menu { grid-template-rows: 26% 1fr; position: relative; } .lay.mega-menu i:first-child { background: #3b4352; }
.lay.mega-menu i:nth-child(2) { background: #fff; margin: 0 12% 30% 8%; border-radius: 0 0 4px 4px; box-shadow: 0 3px 6px rgba(0, 0, 0, .15); }
.lay.surprise { background: conic-gradient(from 90deg, #f97316, #eab308, #22c55e, #06b6d4, #6366f1, #d946ef, #f97316); border: 0; }
.corner { height: 26px; display: flex; align-items: center; justify-content: center; }
.corner i { width: 70%; height: 22px; background: #3b4352; }
.density-demo { display: flex; flex-direction: column; justify-content: center; height: 26px; }
.density-demo i { display: block; height: 3px; background: #b7bcc6; border-radius: 2px; }
.more { margin-top: 6px; }
.more summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "+"; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); }
.more[open] summary::before { content: "−"; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* ---------- generator layout ---------- */
.gen { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: 24px; align-items: start; }
.gen-right { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 20px; }
.tiles4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface-2); border-radius: 11px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.15; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .85rem; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.checks li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: .93rem; line-height: 1.4; }
.checks li small { display: block; color: var(--muted); font-size: .84rem; white-space: pre-line; overflow-wrap: anywhere; }
.ico { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.ico.OK { background: var(--ok-soft); color: var(--ok); }
.ico.WARN { background: var(--warn-soft); color: var(--warn); }
.ico.ERROR { background: var(--err-soft); color: var(--err); }
.prev-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.prev-head h2 { margin: 0; }
.previews { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pv-name { font-weight: 600; font-size: .92rem; margin-top: 7px; line-height: 1.3; }
.pv-meta { font-family: var(--mono); font-size: .74rem; color: var(--muted); line-height: 1.45; }
.cli { position: relative; background: #1f2329; color: #e6e1d6; border-radius: 10px; padding: 12px 64px 12px 14px; font: .8rem/1.55 var(--mono);
  white-space: pre-wrap; word-break: break-word; margin: 0 0 14px; max-height: 150px; overflow: auto; }
.cli-copy { position: absolute; right: 6px; top: 6px; background: #343a43; color: #e6e1d6; border: 0; border-radius: 6px; padding: 4px 9px;
  font: 600 .75rem var(--font); cursor: pointer; min-height: 28px; }
.reason { color: var(--err); font-size: .88rem; margin-top: 9px; text-align: center; }
.empty { color: var(--muted); font-size: .92rem; padding: 18px; text-align: center; background: var(--surface-2); border-radius: 10px; }
.panel-loading { opacity: .6; transition: opacity .15s; }

/* run / progress */
.run h2 { margin-bottom: 12px; }
.bar { height: 12px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .25s; }
.run-meta { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); margin: 8px 0 12px; gap: 10px; }
.log { background: #1f2329; color: #d9dde3; font: .78rem/1.6 var(--mono); border-radius: 10px; padding: 10px 12px; max-height: 220px;
  overflow: auto; white-space: pre-wrap; margin: 0; }
.run-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.alert { padding: 13px 16px; border-radius: 11px; margin-bottom: 18px; font-size: .95rem; border: 1px solid transparent; }
.alert.ok { background: var(--ok-soft); color: #14532d; border-color: #bfe3cb; }
.alert.err { background: var(--err-soft); color: #7f1d1d; border-color: #f2c4c4; }
.alert.info { background: var(--info-soft); color: #1e3a8a; border-color: #c8d8f5; }
.alert.warn { background: var(--warn-soft); color: #78350f; border-color: #f2d8a6; }

/* ---------- theme preview mock (uses the generated app's own CSS variables) ---------- */
.tp { aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--color-bg); position: relative; }
.tp-frame { display: grid; height: 100%; grid-template-columns: 1fr; grid-template-rows: 1fr; grid-template-areas: "body"; }
.tp-side { grid-area: side; } .tp-panel { grid-area: panel; } .tp-top { grid-area: top; } .tp-tabs { grid-area: tabs; } .tp-body { grid-area: body; }
.tp-side, .tp-panel, .tp-top, .tp-tabs, .tp-mega { display: none; }
/* side menus */
.tp[data-layout=sidebar] .tp-frame, .tp[data-layout=boxed] .tp-frame, .tp[data-layout=detached] .tp-frame { grid-template-columns: 23% 1fr; grid-template-areas: "side body"; }
.tp[data-layout=sidebar-right] .tp-frame { grid-template-columns: 1fr 23%; grid-template-areas: "body side"; }
.tp[data-layout=sidebar-mini] .tp-frame { grid-template-columns: 9% 1fr; grid-template-areas: "side body"; }
.tp[data-layout=sidebar-dual] .tp-frame { grid-template-columns: 8% 16% 1fr; grid-template-areas: "side panel body"; }
.tp[data-layout=mixed] .tp-frame { grid-template-columns: 20% 1fr; grid-template-rows: 14% 1fr; grid-template-areas: "top top" "panel body"; }
.tp[data-layout=sidebar] .tp-side, .tp[data-layout=sidebar-right] .tp-side, .tp[data-layout=sidebar-mini] .tp-side, .tp[data-layout=sidebar-dual] .tp-side,
.tp[data-layout=boxed] .tp-side, .tp[data-layout=detached] .tp-side { display: flex; }
.tp[data-layout=sidebar-dual] .tp-panel, .tp[data-layout=mixed] .tp-panel { display: flex; }
/* top menus */
.tp[data-layout=topnav] .tp-frame, .tp[data-layout=mega-menu] .tp-frame { grid-template-rows: 15% 1fr; grid-template-areas: "top" "body"; }
.tp[data-layout=topnav-tabs] .tp-frame { grid-template-rows: 14% 10% 1fr; grid-template-areas: "top" "tabs" "body"; }
.tp[data-layout=topnav] .tp-top, .tp[data-layout=topnav-tabs] .tp-top, .tp[data-layout=mega-menu] .tp-top, .tp[data-layout=mixed] .tp-top { display: flex; }
.tp[data-layout=topnav-tabs] .tp-tabs { display: flex; }
.tp[data-layout=mega-menu] .tp-mega { display: grid; }
/* boxed and floating frames */
.tp[data-layout=boxed] { background: color-mix(in srgb, var(--color-primary-500) 14%, var(--color-bg)); }
.tp[data-layout=boxed] .tp-frame { margin: 4% 6%; height: 92%; border-radius: 6px; overflow: hidden; background: var(--color-bg);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .14); }
.tp[data-layout=detached] { background: color-mix(in srgb, var(--color-primary-500) 6%, var(--color-bg)); }
.tp[data-layout=detached] .tp-frame { padding: 3%; gap: 3%; }
.tp[data-layout=detached] .tp-side { border-radius: 6px; }
.tp-side { background: var(--nav-bg); flex-direction: column; gap: 7%; padding: 9% 12%; border-right: 1px solid var(--nav-border); }
.tp[data-layout=sidebar-right] .tp-side { border-right: 0; border-left: 1px solid var(--nav-border); }
.tp-side i { display: block; height: 4px; border-radius: 2px; background: var(--nav-fg); opacity: .55; }
.tp-side i:first-child { background: var(--nav-active-bg); opacity: 1; height: 7px; margin-bottom: 8%; }
.tp[data-layout=sidebar-mini] .tp-side, .tp[data-layout=sidebar-dual] .tp-side { padding: 30% 22%; gap: 12%; }
.tp[data-layout=sidebar-mini] .tp-side i, .tp[data-layout=sidebar-dual] .tp-side i { height: 5px; border-radius: 50%; }
.tp-panel { background: var(--color-surface); border-right: 1px solid var(--color-border); flex-direction: column; gap: 8%; padding: 14% 12%; }
.tp-panel i { display: block; height: 4px; border-radius: 2px; background: var(--color-neutral-300); }
.tp-panel i:first-child { background: color-mix(in srgb, var(--color-primary-500) 35%, transparent); height: 7px; }
.tp-top { background: var(--nav-bg); align-items: center; gap: 5%; padding: 0 5%; border-bottom: 1px solid var(--nav-border); }
.tp-top b { width: 8%; height: 40%; border-radius: 3px; background: var(--nav-active-bg); }
.tp-top i { width: 9%; height: 3px; border-radius: 2px; background: var(--nav-fg); opacity: .6; }
.tp-tabs { background: var(--color-surface); align-items: flex-end; gap: 3%; padding: 0 5%; border-bottom: 1px solid var(--color-border); }
.tp-tabs i { width: 12%; height: 3px; background: var(--color-neutral-300); }
.tp-tabs i:first-child { background: var(--color-primary-600); }
.tp-mega { position: absolute; left: 14%; top: 15%; width: 60%; height: 30%; background: var(--color-surface); border-radius: 0 0 5px 5px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .16); grid-template-columns: repeat(3, 1fr); gap: 8%; padding: 4% 6%; z-index: 2; }
.tp-mega i { display: block; height: 3px; background: var(--color-neutral-300); border-radius: 2px; }
.tp-body { padding: 6% 6% 5%; display: grid; grid-template-rows: auto auto 1fr; gap: calc(var(--space-3, 12px) * .45); min-width: 0; }
.tp-head { display: flex; justify-content: space-between; align-items: center; }
.tp-head i { width: 30%; height: 5px; border-radius: 3px; background: var(--color-text); opacity: .75; }
.tp-btn { width: 17%; height: 11px; background: var(--color-primary-600); border-radius: calc(var(--radius-control) * .45); }
.tp-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--space-3, 12px) * .45); }
.tp-kpis span { height: 22px; background: var(--card-bg); border: var(--card-border); box-shadow: var(--card-shadow);
  border-radius: calc(var(--radius-card) * .45); position: relative; }
.tp-kpis span::after { content: ""; position: absolute; left: 14%; top: 36%; width: 42%; height: 4px; border-radius: 2px; background: var(--color-primary-500); }
.tp-chart { background: var(--card-bg); border: var(--card-border); box-shadow: var(--card-shadow); border-radius: calc(var(--radius-card) * .45);
  display: flex; align-items: flex-end; gap: 7%; padding: 5% 9% 0; min-height: 0; }
.tp-chart i { flex: 1; border-radius: calc(var(--radius-sm) * .5) calc(var(--radius-sm) * .5) 0 0; }
.tp-chart i:nth-child(1) { height: 40%; background: var(--color-primary-300); }
.tp-chart i:nth-child(2) { height: 62%; background: var(--color-primary-400); }
.tp-chart i:nth-child(3) { height: 88%; background: var(--color-primary-600); }
.tp-chart i:nth-child(4) { height: 50%; background: var(--color-accent-500); }
.tp.big { border-radius: 14px; }

/* ---------- home page mock (axis landing) ---------- */
.th { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--color-bg);
  display: grid; grid-template-rows: 13% auto 1fr; }
.th-inset { position: absolute; right: 4%; bottom: 5%; width: 34%; aspect-ratio: 16 / 10; border-radius: 5px; border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .28); z-index: 3; }
.th-nav { display: flex; align-items: center; gap: 6%; padding: 0 6%; background: var(--nav-bg); border-bottom: 1px solid var(--nav-border); }
.th-nav b { width: 9%; height: 42%; border-radius: 2px; background: var(--color-primary-600); }
.th-nav i { width: 9%; height: 2px; background: var(--nav-fg); opacity: .6; }
.th-nav i:first-of-type { margin-left: auto; }
.th-nav span { width: 14%; height: 44%; border-radius: 2px; background: var(--color-primary-600); }
.th-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 6%; align-items: center; padding: 7% 7% 4%; }
.th-copy { display: grid; gap: 7px; }
.th-inset .th-copy { gap: 3px; }
.th-copy b { height: 8px; width: 80%; border-radius: 2px; background: var(--color-text); }
.th-copy i { height: 3px; width: 60%; border-radius: 2px; background: var(--color-text-muted); opacity: .6; }
.th-copy span { height: 9px; width: 34%; border-radius: 2px; background: var(--color-primary-600); }
.th-inset .th-copy b { height: 4px; } .th-inset .th-copy span { height: 4px; } .th-inset .th-copy i { height: 2px; }
.th-art { aspect-ratio: 4 / 3; border-radius: 4px; background: var(--card-bg); border: var(--card-border); box-shadow: var(--card-shadow);
  background-image: linear-gradient(var(--color-primary-200), var(--color-primary-200)); background-size: 70% 18%; background-position: 50% 30%; background-repeat: no-repeat; }
.th-search { display: none; }
.th-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4%; padding: 0 7% 6%; align-content: start; }
.th-cards i { aspect-ratio: 4 / 3; border-radius: 3px; background: var(--card-bg); border: var(--card-border); box-shadow: var(--card-shadow); position: relative; }
.th-cards i::before { content: ""; position: absolute; left: 14%; top: 18%; width: 22%; aspect-ratio: 1; border-radius: 3px;
  background: color-mix(in srgb, var(--color-primary-500) 30%, transparent); }
/* variants */
.th[data-landing=saas] { background: radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--color-primary-500) 30%, transparent), transparent 60%), var(--color-bg); }
.th[data-landing=saas] .th-nav { background: transparent; border: 0; }
.th[data-landing=saas] .th-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding-bottom: 2%; }
.th[data-landing=saas] .th-copy { justify-items: center; width: 70%; }
.th[data-landing=saas] .th-art { width: 70%; aspect-ratio: 3 / 1; background-image: linear-gradient(90deg, var(--nav-bg) 22%, transparent 22%); background-size: 100% 100%; }
.th[data-landing=saas] .th-cards { display: none; }
.th[data-landing=split-hero] { grid-template-rows: 1fr; }
.th[data-landing=split-hero] .th-nav, .th[data-landing=split-hero] .th-cards { display: none; }
.th[data-landing=split-hero] .th-hero { grid-template-columns: 1fr 1fr; padding: 0; height: 100%; gap: 0; }
.th[data-landing=split-hero] .th-copy { padding: 0 12%; }
.th[data-landing=split-hero] .th-art { height: 100%; aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none;
  background: linear-gradient(160deg, var(--color-primary-600), var(--color-primary-800)); }
.th[data-landing=portal] .th-hero { display: block; padding: 6% 12% 9%; background: linear-gradient(135deg, var(--color-primary-600), var(--color-secondary-600)); }
.th[data-landing=portal] .th-copy { display: none; }
.th[data-landing=portal] .th-art { aspect-ratio: auto; height: 12px; border-radius: 99px; background: var(--color-surface); border: 0; }
.th-inset[data-landing=portal] .th-art { height: 5px; }
.th[data-landing=portal] .th-cards { margin-top: -4%; grid-template-columns: repeat(4, 1fr) 1.3fr; }
.th[data-landing=one-page] { grid-template-rows: 1fr; background: linear-gradient(150deg, var(--color-primary-800), var(--color-primary-600)); }
.th[data-landing=one-page] .th-nav { position: absolute; inset: 0 0 auto; height: 13%; background: transparent; border: 0; }
.th[data-landing=one-page] .th-nav i { background: var(--color-on-primary); }
.th[data-landing=one-page] .th-hero { grid-template-columns: 1fr; justify-items: center; align-self: center; }
.th[data-landing=one-page] .th-copy { justify-items: center; width: 70%; }
.th[data-landing=one-page] .th-copy b, .th[data-landing=one-page] .th-copy i { background: var(--color-on-primary); }
.th[data-landing=one-page] .th-copy span { background: var(--color-surface); }
.th[data-landing=one-page] .th-art, .th[data-landing=one-page] .th-cards { display: none; }
.th[data-landing=minimal] { grid-template-rows: 1fr; }
.th[data-landing=minimal] .th-nav, .th[data-landing=minimal] .th-art { display: none; }
.th[data-landing=minimal] .th-hero { grid-template-columns: 1fr; justify-items: center; align-self: end; padding-bottom: 3%; }
.th[data-landing=minimal] .th-copy { justify-items: center; width: 60%; }
.th[data-landing=minimal] .th-cards { grid-template-columns: repeat(4, 14%); justify-content: center; align-self: start; padding-top: 2%; }
.th[data-landing=minimal] .th-cards i { aspect-ratio: 3 / 1; border-radius: 99px; }
.th[data-landing=minimal] .th-cards i::before { display: none; }

/* ---------- tables & lists ---------- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.toolbar .grow { flex: 1 1 240px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: .94rem; }
.t th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600;
  padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr:hover td { background: #fbfaf7; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.t input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
.code { font-family: var(--mono); font-size: .86rem; color: var(--muted); white-space: nowrap; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--muted); font-size: .9rem; }
.sticky-bar { position: sticky; bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--side);
  color: #fff; padding: 12px 16px 12px 20px; border-radius: 13px; margin-top: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .78rem; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.chip b { color: var(--ink); font-weight: 600; }
.mini-swatch { display: inline-flex; width: 54px; height: 14px; border-radius: 4px; overflow: hidden; vertical-align: middle; }
.mini-swatch i { flex: 1; }
.yaml { background: #1f2329; color: #e6e1d6; font: .82rem/1.6 var(--mono); border-radius: 12px; padding: 16px 18px; overflow: auto; max-height: 640px; margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: .94rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 8px; }
.add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.add-grid .card { margin: 0; }
.add-grid form { display: flex; flex-direction: column; gap: 10px; }
input[type=file] { font: inherit; font-size: .9rem; min-height: 46px; padding: 9px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); width: 100%; background: var(--surface-2); }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 30px 0 14px; }
.section-title h2 { font-size: 1.3rem; }
.status { font-weight: 600; font-size: .8rem; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.status.DONE, .status.OK { background: var(--ok-soft); color: var(--ok); }
.status.RUNNING { background: var(--info-soft); color: var(--info); }
.status.FAILED { background: var(--err-soft); color: var(--err); }
.status.WARN { background: var(--warn-soft); color: var(--warn); }
.mixer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 22px; align-items: start; }
.mixer .grid-2 { grid-template-columns: 1fr 1fr; }

@media (max-width: 1180px) {
  .choices.three { grid-template-columns: 1fr; }
  .gen { grid-template-columns: 1fr; }
  .gen-right { position: static; }
  .cols, .mixer { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px; }
  .brand { padding: 0; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { padding: 8px 12px; }
  .side-foot { display: none; }
  .main { padding: 20px 16px 50px; }
  .previews { grid-template-columns: 1fr 1fr; }
  .mixer .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- picker diagrams for the newer axes ---------- */
.lay.sidebar-right { grid-template-columns: 1fr 26%; } .lay.sidebar-right i:first-child { order: 2; background: #3b4352; }
.lay.sidebar-dual { grid-template-columns: 9% 22% 1fr; } .lay.sidebar-dual i:first-child { background: #3b4352; }
.lay.sidebar-dual i:nth-child(2) { background: #dfe2e8; }
.lay.mixed { grid-template-columns: 26% 1fr; grid-template-rows: 26% 1fr; } .lay.mixed i:first-child { grid-column: 1 / 3; background: #3b4352; }
.lay.mixed i:nth-child(2) { background: #dfe2e8; }
.lay.boxed { padding: 5px 9px; background: #e9e4f2; } .lay.boxed i:first-child { background: linear-gradient(90deg, #3b4352 26%, #f6f5f1 26%); height: 100%; border-radius: 3px; }
.lay.detached { grid-template-columns: 24% 1fr; gap: 4px; padding: 4px; } .lay.detached i:first-child { background: #3b4352; border-radius: 4px; }
.hd { height: 46px; border-radius: 6px; border: 1px solid var(--line); background: #fff; position: relative; overflow: hidden; display: block; }
.hd i { position: absolute; display: block; border-radius: 2px; }
.hd.corporate i:nth-child(1) { inset: 0 0 auto; height: 9px; background: #3b4352; }
.hd.corporate i:nth-child(2) { left: 8%; top: 15px; width: 42%; height: 6px; background: #8a909b; box-shadow: 0 9px 0 -1px #c9ccd3; }
.hd.corporate i:nth-child(3) { right: 8%; top: 14px; width: 34%; height: 24px; background: #e9ecf1; }
.hd.saas { background: radial-gradient(circle at 50% 0, #e3e6ff, #fff 70%); }
.hd.saas i:nth-child(1) { left: 25%; top: 7px; width: 50%; height: 5px; background: #8a909b; }
.hd.saas i:nth-child(2) { left: 18%; top: 17px; width: 64%; height: 24px; background: linear-gradient(90deg, #3b4352 24%, #eef0f4 24%); }
.hd.split-hero i:nth-child(1) { right: 0; top: 0; bottom: 0; width: 45%; background: linear-gradient(160deg, #6b7486, #3b4352); border-radius: 0; }
.hd.split-hero i:nth-child(2) { left: 8%; top: 14px; width: 38%; height: 6px; background: #8a909b; box-shadow: 0 9px 0 -1px #c9ccd3; }
.hd.split-hero i:nth-child(3) { left: 8%; bottom: 7px; width: 18%; height: 6px; background: #3b4352; }
.hd.portal i:nth-child(1) { inset: 0 0 auto; height: 22px; background: linear-gradient(135deg, #6b7486, #3b4352); border-radius: 0; }
.hd.portal i:nth-child(2) { left: 22%; top: 8px; width: 56%; height: 6px; background: #fff; border-radius: 9px; }
.hd.portal i:nth-child(3) { left: 8%; top: 27px; width: 84%; height: 12px; background: repeating-linear-gradient(90deg, #e9ecf1 0 22%, transparent 22% 26%); }
.hd.one-page { background: linear-gradient(150deg, #3b4352, #6b7486); }
.hd.one-page i:nth-child(1) { left: 22%; top: 13px; width: 56%; height: 7px; background: #fff; }
.hd.one-page i:nth-child(2) { left: 32%; top: 25px; width: 36%; height: 3px; background: #c9ccd3; }
.hd.one-page i:nth-child(3) { left: 42%; top: 33px; width: 16%; height: 6px; background: #fff; border-radius: 9px; }
.hd.minimal i:nth-child(1) { left: 44%; top: 6px; width: 12%; height: 11px; background: #3b4352; border-radius: 3px; }
.hd.minimal i:nth-child(2) { left: 30%; top: 21px; width: 40%; height: 5px; background: #8a909b; }
.hd.minimal i:nth-child(3) { left: 22%; top: 32px; width: 56%; height: 5px; background: repeating-linear-gradient(90deg, #dfe2e8 0 22%, transparent 22% 26%); }
.navdemo { height: 46px; border-radius: 6px; border: 1px solid var(--line); background: #f6f5f1; display: grid; grid-template-columns: 30% 1fr; overflow: hidden; }
.navdemo i:first-child { display: block; background: #fff; border-right: 1px solid #e3e0d8;
  background-image: linear-gradient(#3b5bdb, #3b5bdb), linear-gradient(#b8bcc6, #b8bcc6), linear-gradient(#b8bcc6, #b8bcc6);
  background-size: 70% 5px, 60% 3px, 60% 3px; background-position: 50% 9px, 50% 21px, 50% 29px; background-repeat: no-repeat; }
.navdemo.nd-dark i:first-child { background-color: #1f2329; border-color: #1f2329; }
.navdemo.nd-brand i:first-child { background-color: #2f4ab8; border-color: #2f4ab8;
  background-image: linear-gradient(rgba(255,255,255,.3), rgba(255,255,255,.3)), linear-gradient(#c8d2fb, #c8d2fb), linear-gradient(#c8d2fb, #c8d2fb); }
.navdemo.nd-tinted i:first-child { background-color: #e5ebff; border-color: #cdd7fb; }
