/* MetropolitanHost Studio builder — full new UI shell.
 * Wraps the legacy sectionize-main shell with a global sidebar (248px),
 * topbar (56px), and a 3-column main area: generation panel · canvas · project panel.
 *
 * Loaded after assets/css/main.css (legacy) and tokens.css (new).
 *
 * Architecture:
 *   .studio-app                              <- outer grid (sidebar | (topbar above main))
 *     .studio-sb                             <- GLOBAL nav, app-wide (Dashboard, Builder…)
 *     .studio-tb                             <- topbar (breadcrumbs, save, publish…)
 *     .studio-main-area                      <- holds the 3-col workspace
 *       .studio_app-shell  (legacy)            <- left panel + canvas + right drawer
 *
 * The left panel is the GENERATION OPTIONS surface (One Page, RTL, DNA, Style,
 * Template size). It is intentionally distinct from the global sidebar.
 */

/* ─────────────────────────────────────────────────────────────────
 * 0. Hide legacy chrome that the new shell replaces
 * ───────────────────────────────────────────────────────────────── */
.studio_topbar { display: none !important; }      /* legacy topbar -> replaced by .studio-tb */
.studio_sidebar-rail { display: none !important; } /* legacy icon rail -> redundant under new sidebar */

/* ─────────────────────────────────────────────────────────────────
 * 1. Geist font everywhere
 * ───────────────────────────────────────────────────────────────── */
body, .studio_app-shell, .studio_sidebar, .dropdown-menu, .studio_canvas, .studio_drawer,
input, button, textarea, select, .studio_panel-content, .studio-app, .studio-app * {
  font-family: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.text-mono, .studio-app .text-mono, code, pre, .studio-app [class*="-mono"] {
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ─────────────────────────────────────────────────────────────────
 * 2. Outer grid
 * ───────────────────────────────────────────────────────────────── */
html, body { height: 100%; margin: 0; padding: 0; }
body { overflow: hidden; background: var(--bg-1, oklch(0.10 0.02 270)); color: var(--ink-0, white); }

body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(700px 500px at 0% 0%, oklch(0.7 0.19 256 / 0.10), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, oklch(0.66 0.21 295 / 0.08), transparent 60%);
}

.studio-app {
  display: grid;
  grid-template-columns: 248px 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
  height: 100vh; width: 100vw; position: relative; z-index: 1;
}

/* ─────────────────────────────────────────────────────────────────
 * 3. GLOBAL sidebar (left rail) — app-wide navigation only
 * ───────────────────────────────────────────────────────────────── */
.studio-sb {
  grid-area: sidebar;
  background: rgba(8, 11, 24, 0.65);
  border-right: 1px solid var(--stroke-1, rgba(255,255,255,0.06));
  backdrop-filter: blur(24px);
  display: flex; flex-direction: column;
  padding: 14px 12px 12px;
  overflow-y: auto;
}
.studio-sb-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; text-decoration: none; color: var(--ink-0); }
.studio-brand-mark { width: 28px; height: 28px; border-radius: 8px;
  background: var(--grad-primary, linear-gradient(135deg, oklch(0.7 0.19 256), oklch(0.66 0.21 295)));
  display: grid; place-items: center;
  box-shadow: 0 6px 20px -6px oklch(0.7 0.19 256 / 0.7);
}
.studio-brand-mark::after { content: ""; width: 10px; height: 10px; border: 2px solid white; border-radius: 2px; transform: rotate(45deg); opacity: 0.95; }
.studio-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.studio-brand-text .name { font-weight: 600; font-size: 14px; letter-spacing: -0.02em; color: var(--ink-0); }
.studio-brand-text small { color: var(--ink-2); font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.08em; }

.studio-sb-workspace {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; background: var(--glass-2, rgba(255,255,255,0.045));
  border: 1px solid var(--stroke-1); border-radius: var(--r-md, 10px);
  margin-bottom: 16px; cursor: pointer; transition: background .2s;
}
.studio-sb-workspace:hover { background: var(--glass-3, rgba(255,255,255,0.07)); }
.studio-sb-workspace .ws-info { display: flex; gap: 10px; align-items: center; min-width: 0; }
.studio-sb-workspace .ws-avatar {
  width: 28px; height: 28px; border-radius: 7px; background: var(--grad-primary);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; color: white; flex-shrink: 0;
}
.studio-sb-workspace .ws-text { min-width: 0; }
.studio-sb-workspace .ws-text .t { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-0); }
.studio-sb-workspace .ws-text .s { font-size: 11px; color: var(--ink-2); }
.studio-sb-workspace svg { color: var(--ink-2); flex-shrink: 0; }

.studio-sb-section { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.studio-sb-section + .studio-sb-section { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--stroke-1); }
.studio-sb-label {
  padding: 6px 10px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3, oklch(0.42 0.02 270));
}
.studio-sb-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px;
  color: var(--ink-1); text-decoration: none; font-size: 13.5px; cursor: pointer;
  border: 1px solid transparent; position: relative; transition: background .15s, color .15s;
}
.studio-sb-link:hover { background: var(--glass-2); color: var(--ink-0); }
.studio-sb-link.active {
  background: linear-gradient(180deg, oklch(0.7 0.19 256 / 0.18), oklch(0.66 0.21 295 / 0.1));
  color: var(--ink-0); border-color: oklch(0.7 0.19 256 / 0.25);
}
.studio-sb-link.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 2px;
  background: var(--grad-primary); border-radius: 2px;
}
.studio-sb-link .ic { width: 16px; height: 16px; color: var(--ink-2); flex-shrink: 0; }
.studio-sb-link.active .ic { color: var(--cyan, oklch(0.85 0.13 205)); }
.studio-sb-link[data-stub="1"] { opacity: 0.45; cursor: not-allowed; }
.studio-sb-link[data-stub="1"]:hover { background: transparent; color: var(--ink-1); }

.studio-sb-badge {
  margin-left: auto; padding: 2px 7px; font-size: 10px; font-family: var(--f-mono);
  background: var(--glass-3); border: 1px solid var(--stroke-2);
  border-radius: 999px; color: var(--ink-2);
}
.studio-sb-badge.new {
  background: oklch(0.78 0.17 158 / 0.18); color: var(--success); border-color: oklch(0.78 0.17 158 / 0.4);
}

.studio-sb-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--stroke-1); display: flex; flex-direction: column; gap: 6px; }
.studio-credit { padding: 12px; background: var(--glass-1); border: 1px solid var(--stroke-1); border-radius: var(--r-md); }
.studio-credit[data-stub="1"] { opacity: 0.55; }
.studio-credit .row1 { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); margin-bottom: 8px; font-family: var(--f-mono); }
.studio-credit .bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.06); overflow: hidden; }
.studio-credit .bar > span { display: block; height: 100%; background: var(--grad-primary); border-radius: 2px; }
.studio-credit .row2 { display: flex; justify-content: space-between; font-size: 11.5px; margin-top: 8px; color: var(--ink-1); }
.studio-credit .row2 a { color: var(--blue-bright); text-decoration: none; font-weight: 500; }

.studio-sb-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.studio-sb-user:hover { background: var(--glass-2); }
.studio-sb-user .av { width: 28px; height: 28px; border-radius: 50%; background: var(--grad-primary); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: white; flex-shrink: 0; }
.studio-sb-user .info { min-width: 0; }
.studio-sb-user .info .n { font-size: 13px; font-weight: 500; color: var(--ink-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.studio-sb-user .info .e { font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─────────────────────────────────────────────────────────────────
 * 4. Topbar
 * ───────────────────────────────────────────────────────────────── */
.studio-tb {
  grid-area: topbar; display: flex; align-items: center; gap: 12px;
  padding: 0 18px; border-bottom: 1px solid var(--stroke-1);
  background: rgba(8, 11, 24, 0.5); backdrop-filter: blur(20px);
}
.studio-crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.studio-crumbs a { color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.studio-crumbs a:hover { color: var(--ink-0); }
.studio-crumbs .sep { opacity: 0.4; }
.studio-crumbs .current { color: var(--ink-0); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }

.studio-save-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: oklch(0.78 0.17 158 / 0.12); border: 1px solid oklch(0.78 0.17 158 / 0.3);
  color: var(--success); font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.04em;
  border-radius: 999px; margin-left: 8px;
  transition: transform .25s, box-shadow .25s;
}
.studio-save-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px currentColor; }
.studio-save-pill.saving { transform: scale(1.05); box-shadow: 0 0 0 6px oklch(0.78 0.17 158 / 0.12); }

.studio-tb-grow { flex: 1; }
.studio-tb-actions { display: flex; align-items: center; gap: 6px; }
.studio-tb-icon-btn {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--ink-1); cursor: pointer;
}
.studio-tb-icon-btn:hover { background: var(--glass-2); border-color: var(--stroke-1); color: var(--ink-0); }
.studio-tb-icon-btn[data-stub="1"] { opacity: 0.5; }
.studio-tb-icon-btn[data-stub="1"]:hover { background: transparent; border-color: transparent; cursor: not-allowed; }
.studio-tb-icon-btn .ic { width: 16px; height: 16px; }
.studio-tb-divider { width: 1px; height: 22px; background: var(--stroke-1); margin: 0 4px; }

.studio-tb-share, .studio-tb-publish {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 9999px; font-size: 13px; cursor: pointer; font-weight: 500;
}
.studio-tb-share { background: var(--glass-2); border: 1px solid var(--stroke-1); color: var(--ink-0); }
.studio-tb-share[data-stub="1"] { opacity: 0.55; cursor: not-allowed; }
.studio-tb-share:hover:not([data-stub="1"]) { background: var(--glass-3); border-color: var(--stroke-bright); }
.studio-tb-publish {
  background: var(--grad-primary); border: 0; color: white; font-weight: 600; padding: 7px 14px;
  box-shadow: var(--shadow-glow-blue);
}
.studio-tb-publish:hover { transform: translateY(-1px); }

/* ─────────────────────────────────────────────────────────────────
 * 5. Main 3-column area
 * ───────────────────────────────────────────────────────────────── */
.studio-main-area {
  grid-area: main; overflow: hidden; position: relative;
  display: flex; background: transparent;
}
.studio-main-area .studio_app-shell {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  background: transparent; height: 100%;
}
/* The legacy shell-body becomes the 3-col workspace.
   Layout: [generation panel 320px] [canvas flex] [project panel 340px] */
.studio-main-area .studio_shell-body {
  flex: 1; min-height: 0; display: grid !important;
  grid-template-columns: 320px 1fr 340px;
  gap: 14px; padding: 14px;
  overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────────
 * 6. GENERATION PANEL (left, inside main) — legacy .studio_sidebar
 *    (NOT the global sidebar — that's outside, the leftmost rail.
 *    This is the controls surface for what to generate.)
 * ───────────────────────────────────────────────────────────────── */
.studio-main-area .studio_sidebar {
  width: auto !important;
  /* Flatter than the global sidebar (.studio-sb) so the eye reads
     "tools surface" not "navigation". No backdrop blur — it sits inside main. */
  background: rgba(255, 255, 255, 0.022) !important;
  border: 1px solid var(--stroke-1) !important;
  border-radius: var(--r-lg, 16px) !important;
  display: flex; flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
  position: static !important;
}
.studio-main-area .studio_sidebar::before {
  /* Subtle "GENERATION" label band so it's clearly a different surface */
  content: "Generation"; display: block;
  padding: 10px 14px 0;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3);
}
.studio-main-area .studio_sidebar-panel {
  width: 100% !important;
  height: 100%;
  display: flex; flex-direction: column;
  border: 0 !important; background: transparent !important;
  padding: 14px 14px 14px;
  overflow-y: auto;
}
.studio-main-area .studio_panel-content { display: flex; flex-direction: column; gap: 14px; }

/* Section header pattern */
.studio-main-area .settings-group {
  background: var(--glass-1); border: 1px solid var(--stroke-1); border-radius: var(--r-md);
  padding: 0; margin: 0;
}
.studio-main-area .settings-group-hd {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2);
  padding: 12px 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  list-style: none;
}
.studio-main-area .settings-group-hd::-webkit-details-marker { display: none; }
.studio-main-area .settings-group-hd::after {
  content: ""; width: 8px; height: 8px;
  border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2);
  transform: rotate(45deg); transition: transform .2s;
}
.studio-main-area details[open] > .settings-group-hd::after { transform: rotate(225deg); }
.studio-main-area .settings-group > *:not(.settings-group-hd) { padding: 0 14px 14px; }

/* Toggle/switch — restyle bootstrap custom-switch to match design */
.studio-main-area .studio_quick-switches { display: flex; flex-direction: column; gap: 12px; }
.studio-main-area .custom-control.custom-switch { padding-left: 0; min-height: auto; display: flex; align-items: center; justify-content: space-between; }
.studio-main-area .custom-switch .custom-control-label {
  padding-left: 0; font-size: 13px; color: var(--ink-0); cursor: pointer; user-select: none;
  font-weight: 500;
}
.studio-main-area .custom-switch .custom-control-label::before,
.studio-main-area .custom-switch .custom-control-label::after { display: none !important; }
.studio-main-area .custom-switch { position: relative; padding-right: 38px; }
.studio-main-area .custom-switch::after {
  content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 32px; height: 18px; border-radius: 999px;
  background: rgba(255,255,255,0.1); cursor: pointer; transition: background .2s;
}
.studio-main-area .custom-switch::before {
  content: ""; position: absolute; right: 16px; top: 50%; margin-top: -7px;
  width: 14px; height: 14px;
  background: white; border-radius: 50%; transition: right .2s; z-index: 1;
}
.studio-main-area .custom-switch:has(input:checked)::after { background: var(--grad-primary); }
.studio-main-area .custom-switch:has(input:checked)::before { right: 2px; }
.studio-main-area .custom-switch input { position: absolute; right: 0; top: 0; width: 32px; height: 18px; opacity: 0; cursor: pointer; }
@supports not (selector(:has(*))) {
  /* Older browsers — fall back to the legacy bootstrap appearance */
  .studio-main-area .custom-switch::before, .studio-main-area .custom-switch::after { display: none; }
  .studio-main-area .custom-switch .custom-control-label::before,
  .studio-main-area .custom-switch .custom-control-label::after { display: inline-block !important; }
}

/* DNA pill switch — style to match */
.studio-main-area .studio_dna-switch-wrap {
  display: flex !important; align-items: center; gap: 10px;
  background: var(--glass-2); border: 1px solid var(--stroke-1);
  border-radius: var(--r-md); padding: 10px 12px;
  position: relative; cursor: pointer;
}
.studio-main-area .studio_dna-switch-wrap input { position: absolute; opacity: 0; }
.studio-main-area .dna-switch-track {
  width: 32px; height: 18px; border-radius: 999px; background: rgba(255,255,255,0.1);
  position: relative; transition: background .2s; flex-shrink: 0; cursor: pointer;
}
.studio-main-area .dna-switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  background: white; border-radius: 50%; transition: transform .2s;
}
.studio-main-area input:checked + .dna-switch-track { background: var(--grad-primary); }
.studio-main-area input:checked + .dna-switch-track::after { transform: translateX(14px); }
.studio-main-area .studio_dna-label { font-size: 13px; color: var(--ink-0); font-weight: 500; }
.studio-main-area .studio_dna-label small { color: var(--ink-2) !important; font-size: 11px !important; font-weight: 400; }

/* Industry/style accordions inside the panel */
.studio-main-area .studio_dna-meta-label {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; display: block; margin-top: 14px;
}
.studio-main-area .sigma-ind-list { display: flex; flex-direction: column; gap: 4px; }
.studio-main-area .sigma-ind-item {
  background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: 8px;
  padding: 8px 10px; cursor: pointer; transition: background .15s, border-color .15s;
}
.studio-main-area .sigma-ind-item:hover { background: var(--glass-3); border-color: var(--stroke-bright); }
.studio-main-area .sigma-ind-item.active {
  background: linear-gradient(180deg, oklch(0.7 0.19 256 / 0.18), oklch(0.66 0.21 295 / 0.1));
  border-color: oklch(0.7 0.19 256 / 0.4);
}
.studio-main-area .sigma-ind-head { display: flex; align-items: center; gap: 8px; }
.studio-main-area .sigma-ind-dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--ind-hue), 60%, 60%); flex-shrink: 0; }
.studio-main-area .sigma-ind-name { flex: 1; font-size: 12.5px; color: var(--ink-0); font-weight: 500; }
.studio-main-area .sigma-ind-top-pers { font-family: var(--f-mono); font-size: 9.5px; color: var(--ink-2); padding: 1px 6px; background: var(--glass-3); border-radius: 4px; }
.studio-main-area .sigma-ind-chevron { color: var(--ink-3); font-size: 10px; }

.studio-main-area .sigma-style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.studio-main-area .sigma-style-tile {
  background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: 8px;
  padding: 10px; cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: all .15s;
}
.studio-main-area .sigma-style-tile:hover { background: var(--glass-3); border-color: var(--stroke-bright); }
.studio-main-area .sigma-style-tile.active {
  border-color: var(--tile-color, oklch(0.7 0.19 256));
  box-shadow: 0 0 0 2px var(--tile-color, oklch(0.7 0.19 256)) inset, 0 0 0 1px var(--tile-color, oklch(0.7 0.19 256));
}
.studio-main-area .sigma-style-swatch { width: 14px; height: 14px; border-radius: 4px; background: var(--tile-color, oklch(0.7 0.19 256)); flex-shrink: 0; }
.studio-main-area .sigma-style-label { font-size: 11.5px; color: var(--ink-0); font-weight: 500; line-height: 1.2; }

.studio-main-area .sigma-ind-toggle-btn {
  background: transparent; border: 1px dashed var(--stroke-2); border-radius: 8px;
  color: var(--ink-2); padding: 8px; font-size: 11.5px; font-family: var(--f-sans);
  width: 100%; margin-top: 8px; cursor: pointer; transition: all .15s;
}
.studio-main-area .sigma-ind-toggle-btn:hover { color: var(--ink-0); border-color: var(--stroke-bright); background: var(--glass-2); }

/* Style group — bootstrap selects */
.studio-main-area .form-group { margin-bottom: 12px; }
.studio-main-area .form-group label {
  display: block; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; font-weight: 500;
}
.studio-main-area select.form-control,
.studio-main-area input.form-control {
  background: var(--glass-2) !important; border: 1px solid var(--stroke-1) !important;
  color: var(--ink-0) !important; border-radius: 8px !important; height: 36px !important;
  font-size: 13px !important; padding: 0 10px !important;
}
.studio-main-area select.form-control:focus,
.studio-main-area input.form-control:focus {
  border-color: oklch(0.7 0.19 256 / 0.6) !important;
  box-shadow: 0 0 0 4px oklch(0.7 0.19 256 / 0.1) !important;
}

/* Generate Template button — full-width primary in panel footer */
.studio-main-area #generate-template,
.studio-main-area .studio_btn.success.btn-block,
.studio-main-area button#download-project,
.studio-main-area button#generate-html,
.studio-main-area button#save-template,
.studio-main-area .studio-pri-btn {
  background: var(--grad-primary) !important;
  border: 0 !important; color: white !important;
  border-radius: var(--r-pill, 9999px) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 11px 16px !important;
  display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 14px 40px -16px oklch(0.7 0.19 256 / 0.55), 0 0 0 4px oklch(0.7 0.19 256 / 0.06) !important;
  width: 100%;
  position: relative;
}
.studio-main-area #generate-template:hover,
.studio-main-area button#download-project:hover,
.studio-main-area button#generate-html:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 50px -16px oklch(0.7 0.19 256 / 0.7) !important;
}
.studio-main-area #download-project[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Save Template button — secondary tone, still on-design */
.studio-main-area button#save-template,
.studio-main-area .studio_btn.warning {
  background: var(--glass-2) !important;
  border: 1px solid var(--stroke-bright) !important;
  color: var(--ink-0) !important;
  box-shadow: none !important;
}
.studio-main-area button#save-template:hover { background: var(--glass-3) !important; }

/* Mode toggle (Classic / AI) at top of generation panel */
.studio-mode-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--glass-2); border: 1px solid var(--stroke-1);
  border-radius: var(--r-md); padding: 4px;
}
.studio-mode-toggle button {
  padding: 7px 10px; background: transparent; border: 0; color: var(--ink-2);
  font-size: 12px; font-weight: 500; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  position: relative;
}
.studio-mode-toggle button.on { background: var(--glass-3); color: var(--ink-0); }
.studio-mode-toggle button[data-stub="1"] { opacity: 0.5; cursor: not-allowed; }
.studio-mode-toggle .badge {
  position: absolute; top: -8px; right: -4px; padding: 1px 6px; font-family: var(--f-mono);
  font-size: 8.5px; letter-spacing: 0.05em; border-radius: 999px;
  background: oklch(0.66 0.21 295 / 0.25); color: var(--violet); border: 1px solid oklch(0.66 0.21 295 / 0.4);
}

/* AI prompt stub — visible but blurred to communicate "missing feature" */
.studio-ai-stub {
  margin: 12px 0 16px; padding: 14px 14px 16px;
  background: var(--glass-1); border: 1px dashed var(--stroke-bright);
  border-radius: var(--r-md);
  position: relative;
  filter: blur(1.4px) saturate(0.85);
  opacity: 0.55;
  pointer-events: none; user-select: none;
  transition: filter .25s, opacity .25s;
}
.studio-ai-stub:hover {
  filter: blur(0.6px) saturate(0.95);
  opacity: 0.85;
}
.studio-ai-stub::after {
  content: "PHASE 2 — AI APIs"; position: absolute; top: 8px; right: 10px;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.08em;
  color: var(--violet); padding: 1px 7px; background: oklch(0.66 0.21 295 / 0.18);
  border-radius: 999px; border: 1px solid oklch(0.66 0.21 295 / 0.35);
}
.studio-ai-stub h5 { font-size: 12px; color: var(--ink-1); margin-bottom: 8px; font-weight: 500; }
.studio-ai-stub textarea {
  width: 100%; min-height: 70px; background: rgba(0,0,0,0.3); border: 1px solid var(--stroke-1);
  border-radius: 8px; padding: 10px; color: var(--ink-1); font-size: 12.5px; line-height: 1.5;
  resize: none;
}

/* ─────────────────────────────────────────────────────────────────
 * 7. CANVAS (center) — legacy .studio_canvas
 * ───────────────────────────────────────────────────────────────── */
.studio-main-area .studio_canvas {
  flex: 1; min-width: 0; min-height: 0;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--stroke-1);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative;
  margin: 0 !important;
}
.studio-main-area .studio_canvas-preview { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.studio-main-area .studio_preview-frame-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 0 !important; }

/* Top frame bar (page name + Open + Back) */
.studio-main-area .studio_preview-frame-bar {
  padding: 10px 14px !important; border-bottom: 1px solid var(--stroke-1);
  background: transparent !important;
  display: flex; align-items: center; gap: 10px;
}
.studio-main-area #preview-page-title { font-size: 13px; color: var(--ink-0); font-family: var(--f-mono); }
.studio-main-area .studio_preview-frame-bar .studio_btn.light {
  background: var(--glass-2) !important; border: 1px solid var(--stroke-1) !important;
  color: var(--ink-0) !important; border-radius: 8px !important;
  padding: 6px 12px !important; font-size: 12px !important;
}

/* Toolbar with viewport buttons + actions */
.studio-main-area .studio_preview-toolbar {
  padding: 10px 14px !important; border-bottom: 1px solid var(--stroke-1);
  background: transparent !important;
  display: flex; align-items: center; gap: 10px;
}
.studio-main-area .studio_toolbar-group#device-switcher {
  display: flex; gap: 2px; padding: 3px;
  background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: 10px;
}
.studio-main-area .dev-btn {
  padding: 5px 10px; background: transparent; border: 0; color: var(--ink-2); border-radius: 7px;
  font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 5px;
}
.studio-main-area .dev-btn.active { background: var(--glass-3); color: var(--ink-0); }
.studio-main-area .studio_toolbar-actions { display: flex; gap: 4px; margin-left: auto; }
.studio-main-area .ta-icon-btn {
  width: 32px; height: 32px; border-radius: 8px; background: transparent; border: 1px solid transparent;
  color: var(--ink-1); cursor: pointer; display: grid; place-items: center;
}
.studio-main-area .ta-icon-btn:hover:not([disabled]) { background: var(--glass-2); border-color: var(--stroke-1); color: var(--ink-0); }
.studio-main-area .ta-icon-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.studio-main-area .studio_toolbar-sep { width: 1px; height: 22px; background: var(--stroke-1); }

/* iframe area with stats overlay */
.studio-main-area .studio_iframe-area { flex: 1; position: relative; padding: 14px; }
.studio-main-area #page-preview-frame {
  width: 100%; height: 100%; border-radius: 12px;
  background: white; border: 1px solid var(--stroke-2);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5);
}
.studio-main-area #stats-bar {
  position: absolute; bottom: 22px; left: 22px;
  display: flex; gap: 8px;
  background: rgba(8, 11, 24, 0.85); border: 1px solid var(--stroke-2);
  border-radius: 999px; padding: 4px 12px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-1);
  backdrop-filter: blur(10px);
}

/* Empty state — niche cards */
.studio-main-area .studio_preview-placeholder { padding: 24px; flex: 1; overflow-y: auto; }
.studio-main-area .studio_preview-empty {
  text-align: center; padding: 40px 20px;
}
.studio-main-area .studio_preview-empty i { font-size: 36px; color: var(--ink-3); margin-bottom: 16px; }
.studio-main-area .studio_preview-empty h3 { font-size: 18px; color: var(--ink-0); margin-bottom: 8px; }
.studio-main-area .studio_preview-empty p { color: var(--ink-2); font-size: 13px; max-width: 360px; margin: 0 auto 16px; line-height: 1.5; }
.studio-main-area .studio_preview-empty .studio_btn {
  background: var(--glass-2); border: 1px solid var(--stroke-bright); color: var(--ink-0); border-radius: 999px; padding: 8px 16px;
}

/* AI fab — top right of canvas (avoid collision with #stats-bar at bottom-left) */
.studio-canvas-fab {
  position: absolute; top: 80px; right: 28px;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: rgba(8, 11, 24, 0.85); border: 1px solid var(--stroke-2);
  border-radius: 9999px; backdrop-filter: blur(20px);
  box-shadow: var(--shadow-glow-blue);
  font-size: 12.5px; color: var(--ink-1);
  opacity: 0.45; cursor: not-allowed; user-select: none; z-index: 5;
}
.studio-canvas-fab .icc { width: 22px; height: 22px; border-radius: 50%; background: var(--grad-primary); display: grid; place-items: center; }
.studio-canvas-fab .ks { font-family: var(--f-mono); font-size: 10px; opacity: 0.7; padding: 1px 5px; background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ─────────────────────────────────────────────────────────────────
 * 8. PROJECT PANEL (right) — legacy .studio_drawer
 *    (Selected Sections + Pages + Save Template + Properties stubs)
 * ───────────────────────────────────────────────────────────────── */
.studio-main-area .studio_drawer {
  width: auto !important; transform: none !important; position: static !important;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid var(--stroke-1);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.studio-main-area .studio_drawer::before {
  /* Mirror the generation surface label */
  content: "Project"; display: block;
  padding: 10px 14px 0;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3);
}
.studio-main-area .studio_drawer-toggle { display: none !important; }
.studio-main-area .studio_drawer-inner {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px; overflow-y: auto; flex: 1;
}
.studio-main-area .studio_card {
  background: var(--glass-1); border: 1px solid var(--stroke-1); border-radius: var(--r-md);
  padding: 14px; box-shadow: none !important;
}
.studio-main-area .studio_panel-title {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.studio-main-area .studio_result-empty {
  text-align: center; padding: 24px 12px;
  color: var(--ink-2); font-size: 12px; line-height: 1.5;
}
.studio-main-area .studio_result-empty i { font-size: 24px; display: block; margin-bottom: 10px; color: var(--ink-3); }
.studio-main-area .studio_pages-result #pages-area {
  display: flex; flex-direction: column; gap: 6px;
}

/* Properties / Insights stub — appended below the legacy cards */
.studio-stub-block {
  background: var(--glass-1); border: 1px dashed var(--stroke-bright); border-radius: var(--r-md);
  padding: 14px; opacity: 0.45; pointer-events: none; user-select: none;
  position: relative;
}
.studio-stub-block::before {
  content: attr(data-phase); position: absolute; top: 8px; right: 10px;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.08em;
  color: var(--violet); padding: 1px 7px; background: oklch(0.66 0.21 295 / 0.18);
  border-radius: 999px; border: 1px solid oklch(0.66 0.21 295 / 0.35);
}
.studio-stub-block h4 {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px;
}
.studio-stub-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.studio-stub-tab {
  padding: 5px 10px; font-size: 11px; color: var(--ink-2); border-radius: 7px;
  background: var(--glass-2); border: 1px solid var(--stroke-1);
}
.studio-stub-tab.on { color: var(--ink-0); background: var(--glass-3); }
.studio-stub-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.studio-stub-score {
  padding: 8px 10px; background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: 8px;
}
.studio-stub-score .h { font-family: var(--f-mono); font-size: 9.5px; color: var(--ink-2); margin-bottom: 4px; letter-spacing: 0.05em; }
.studio-stub-score .v { font-size: 18px; font-weight: 700; color: var(--ink-0); letter-spacing: -0.02em; }
.studio-stub-score .v em { font-style: normal; color: var(--success); }
.studio-stub-score .v.warn em { color: var(--warning); }
.studio-stub-score .meter { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.08); margin-top: 6px; overflow: hidden; }
.studio-stub-score .meter > span { display: block; height: 100%; }

.studio-stub-meta {
  margin-top: 10px; padding: 10px; background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: 8px;
}
.studio-stub-meta .url { font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); }
.studio-stub-meta .title { font-size: 13px; color: var(--cyan); margin: 4px 0; }
.studio-stub-meta .desc { font-size: 11.5px; color: var(--ink-1); line-height: 1.45; }

/* ─────────────────────────────────────────────────────────────────
 * 9. Sections panel slide-in (legacy) — keep as-is, just retheme
 * ───────────────────────────────────────────────────────────────── */
.studio_sections-panel {
  background: rgba(10, 14, 31, 0.92) !important;
  backdrop-filter: blur(28px);
  border-left: 1px solid var(--stroke-2);
}

/* ─────────────────────────────────────────────────────────────────
 * 10. Bottom dock (generation timeline)
 * ───────────────────────────────────────────────────────────────── */
.studio-dock[hidden] { display: none; }
.studio-dock {
  position: fixed; bottom: 14px; left: calc(248px + (100vw - 248px) / 2); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: rgba(8, 11, 24, 0.85); border: 1px solid var(--stroke-2);
  border-radius: 9999px; backdrop-filter: blur(24px);
  box-shadow: 0 18px 40px -10px rgba(0,0,0,0.6); z-index: 40;
}
.studio-dock-ctrl {
  width: 32px; height: 32px; border-radius: 50%; background: var(--grad-primary); border: 0;
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-glow-blue);
}
.studio-stage { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9999px; font-size: 12px; color: var(--ink-1); position: relative; }
.studio-stage .num { width: 18px; height: 18px; border-radius: 50%; background: var(--glass-2); border: 1px solid var(--stroke-1); display: grid; place-items: center; font-family: var(--f-mono); font-size: 9px; color: var(--ink-3); }
.studio-stage.done .num { background: oklch(0.78 0.17 158 / 0.2); color: var(--success); border-color: oklch(0.78 0.17 158 / 0.5); }
.studio-stage.done { color: var(--ink-0); }
.studio-stage.active .num { background: oklch(0.7 0.19 256 / 0.25); color: var(--blue-bright); border-color: oklch(0.7 0.19 256 / 0.6); }
.studio-stage.active { color: var(--ink-0); }
.studio-stage + .studio-stage::before { content: ""; position: absolute; left: -10px; top: 50%; width: 8px; height: 1px; background: var(--stroke-2); }
.studio-dock-divider { width: 1px; height: 22px; background: var(--stroke-1); margin: 0 4px; }
.studio-dock-meta { font-family: var(--f-mono); color: var(--ink-2); font-size: 11px; }

/* ─────────────────────────────────────────────────────────────────
 * 11. Deploy modal
 * ───────────────────────────────────────────────────────────────── */
.studio-modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(4, 6, 14, 0.55); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.studio-modal-bg.show { display: flex; opacity: 1; }
.studio-modal { width: 720px; max-width: 92vw; max-height: 88vh; overflow: auto; background: linear-gradient(180deg, rgba(20, 25, 50, 0.95), rgba(8, 11, 24, 0.95)); border: 1px solid var(--stroke-2); border-radius: var(--r-xl, 24px); box-shadow: 0 40px 100px -20px rgba(0,0,0,0.7); padding: 28px; position: relative; }
.studio-modal-close { position: absolute; top: 18px; right: 18px; width: 32px; height: 32px; border-radius: 8px; background: var(--glass-2); border: 1px solid var(--stroke-1); display: grid; place-items: center; cursor: pointer; color: var(--ink-1); }
.studio-modal h2 { font-size: 22px; letter-spacing: -0.025em; margin-bottom: 6px; color: var(--ink-0); }
.studio-modal .lead a { color: var(--blue-bright); text-decoration: none; }
.studio-deploy-tabs { display: flex; gap: 6px; padding: 4px; background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: 12px; margin-bottom: 18px; }
.studio-deploy-tab { flex: 1; padding: 8px 12px; text-align: center; font-size: 12.5px; cursor: pointer; color: var(--ink-2); border-radius: 8px; }
.studio-deploy-tab.on { background: var(--glass-3); color: var(--ink-0); }
.studio-deploy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.studio-deploy-card { padding: 18px; background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: var(--r-md); cursor: pointer; display: flex; gap: 14px; align-items: flex-start; }
.studio-deploy-card:hover { border-color: var(--stroke-bright); background: var(--glass-3); }
.studio-deploy-card[data-stub="1"] { opacity: 0.45; cursor: not-allowed; }
.studio-deploy-active { background: linear-gradient(180deg, oklch(0.7 0.19 256 / 0.12), oklch(0.66 0.21 295 / 0.06)) !important; border-color: oklch(0.7 0.19 256 / 0.45) !important; }
.studio-deploy-card .lm { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; font-weight: 700; color: white; font-size: 12px; }
.studio-deploy-card .info .h { font-size: 14px; font-weight: 600; margin-bottom: 2px; letter-spacing: -0.01em; color: var(--ink-0); }
.studio-deploy-card .info .s { font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.studio-deploy-card .meta { margin-left: auto; align-self: center; color: var(--ink-2); }
.studio-modal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--stroke-1); }

/* ─────────────────────────────────────────────────────────────────
 * 12. Topbar legacy bridge — hide the legacy user dropdown that's now
 *     rendered inside the legacy topbar (which itself is hidden).
 *     Sidebar shows the user, topbar shows the actions. Keep separate.
 * ───────────────────────────────────────────────────────────────── */
.studio-app .studio_topbar-user { display: none !important; }

/* Keyboard-shortcut hints on primary buttons */
.studio-kbd {
  display: inline-flex; align-items: center; padding: 1px 6px; margin-left: auto;
  font-family: var(--f-mono); font-size: 10px;
  background: rgba(255,255,255,0.18); border-radius: 4px; color: rgba(255,255,255,0.85);
}

/* ─────────────────────────────────────────────────────────────────
 * 12.4. New Generation Panel — full Application UI structure
 * ───────────────────────────────────────────────────────────────── */
.studio-main-area .studio_sidebar::before { content: none; }
.studio-main-area #panel-settings.studio-legacy-hidden > details,
.studio-main-area #panel-settings.studio-legacy-hidden > button#generate-template {
  display: none !important;
}
/* Keep the legacy industry list and style grid in the DOM but visually hidden,
   so existing JS can still click them programmatically. */
.studio-main-area #panel-settings.studio-legacy-hidden #dna-archetype-wrap,
.studio-main-area #panel-settings.studio-legacy-hidden #dna-personality-wrap {
  display: none !important;
}

.studio-genpanel { display: flex; flex-direction: column; height: 100%; }
.studio-genpanel-head {
  padding: 14px 16px; border-bottom: 1px solid var(--stroke-1);
  flex-shrink: 0;
}
.studio-genpanel-head .title {
  font-size: 13px; font-weight: 600; color: var(--ink-0);
  display: flex; align-items: center; gap: 8px;
}
.studio-genpanel-head .title .ic { color: var(--cyan); flex-shrink: 0; }
.studio-genpanel-head .title .pill {
  margin-left: auto;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.08em;
  padding: 2px 7px; background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: 999px; color: var(--ink-2);
}
.studio-genpanel-body {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 18px;
}
.studio-genpanel-foot {
  padding: 14px 14px 16px; border-top: 1px solid var(--stroke-1);
  flex-shrink: 0; display: flex; flex-direction: column; gap: 12px;
}

.studio-section { display: flex; flex-direction: column; gap: 8px; }
.studio-section.studio-hidden { display: none; }
.studio-section-label {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2);
  display: flex; justify-content: space-between; align-items: baseline;
}
.studio-section-label small { color: var(--ink-3); font-family: var(--f-sans); font-size: 10.5px; text-transform: none; letter-spacing: 0; }

/* [2026-05-09] Method picker refactor — was cramped 3-up grid where labels
   truncated. Now: vertical stack of full-width rows with icon + name +
   description side-by-side. (Old 3-col grid + 10/10/8 padding rules removed
   on 2026-05-10 since the comment-block escape characters were breaking the
   CSS parser and silently suppressing the new rules below.) */

.studio-method-grid {
  display: flex; flex-direction: column; gap: 6px;
}
.studio-method {
  position: relative;
  padding: 10px 12px;
  background: var(--glass-2); border: 1px solid var(--stroke-1);
  border-radius: var(--r-md);
  color: var(--ink-1); cursor: pointer;
  display: flex; flex-direction: row; align-items: center; gap: 12px;
  text-align: left; transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  overflow: hidden;
}
.studio-method:hover:not([data-stub="1"]) { background: var(--glass-3); border-color: var(--stroke-bright); }
.studio-method.on {
  background: linear-gradient(135deg, oklch(0.7 0.19 256 / 0.20), oklch(0.66 0.21 295 / 0.10));
  border-color: oklch(0.7 0.19 256 / 0.45);
  color: var(--ink-0);
  box-shadow: 0 0 0 1px oklch(0.7 0.19 256 / 0.18) inset;
}
.studio-method[data-stub="1"] { opacity: 0.55; cursor: not-allowed; }
.studio-method .lockup {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.studio-method .lockup .ico {
  width: 26px; height: 26px; flex-shrink: 0;
  color: var(--cyan);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--glass-2); border-radius: 8px;
  transition: background .15s, color .15s;
}
.studio-method .lockup .ico svg { width: 14px; height: 14px; display: block; }
.studio-method.on .lockup .ico {
  color: white;
  background: linear-gradient(135deg, var(--blue, oklch(0.7 0.19 256)), var(--violet, oklch(0.66 0.21 295)));
}
.studio-method .lockup .text {
  display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1;
}
.studio-method strong { font-size: 13px; font-weight: 600; color: var(--ink-0); letter-spacing: -0.01em; }
.studio-method small {
  font-size: 11px; color: var(--ink-2); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.studio-method.on small { color: var(--ink-1); }
.studio-method .phase-badge {
  flex-shrink: 0;
  font-family: var(--f-mono); font-size: 8.5px; letter-spacing: 0.08em;
  padding: 2px 6px; background: oklch(0.66 0.21 295 / 0.2); color: var(--violet);
  border-radius: 999px; border: 1px solid oklch(0.66 0.21 295 / 0.4);
  position: static; /* override old absolute positioning */
}

/* Onboarding pulse */
@keyframes studio-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 oklch(0.7 0.19 256 / 0.6), 0 0 0 4px oklch(0.7 0.19 256 / 0.06); }
  50%      { box-shadow: 0 0 0 8px oklch(0.7 0.19 256 / 0), 0 0 0 4px oklch(0.7 0.19 256 / 0.16); }
}
.studio-pulse { animation: studio-pulse-glow 1.4s ease-in-out infinite; }

/* AI command stub — visible but blurred */
.studio-ai-section { padding-bottom: 4px; }
.studio-ai-stub {
  padding: 12px;
  background: var(--glass-1); border: 1px dashed var(--stroke-bright);
  border-radius: var(--r-md);
  position: relative;
  filter: blur(1.2px) saturate(0.85); opacity: 0.6;
  pointer-events: none; user-select: none;
  transition: filter .25s, opacity .25s;
}
.studio-ai-stub::after {
  content: attr(data-phase); position: absolute; top: 8px; right: 10px;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.08em;
  padding: 1px 7px; background: oklch(0.66 0.21 295 / 0.18); color: var(--violet);
  border-radius: 999px; border: 1px solid oklch(0.66 0.21 295 / 0.35);
  pointer-events: none;
}
.studio-ai-stub h5 { font-size: 11.5px; color: var(--ink-1); margin: 0 0 8px; font-weight: 500; }
.studio-ai-stub textarea {
  width: 100%; min-height: 60px; background: rgba(0,0,0,0.3); border: 1px solid var(--stroke-1);
  border-radius: 8px; padding: 8px 10px; color: var(--ink-1); font-size: 11.5px; line-height: 1.5; resize: none;
}
.studio-ai-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 10px; color: var(--ink-2); }
.studio-ai-foot .kbd { font-family: var(--f-mono); padding: 1px 5px; background: var(--glass-2); border-radius: 4px; }

/* Pill rows — universal */
.studio-pillrow { display: flex; gap: 6px; }
.studio-pillrow-wrap { flex-wrap: wrap; }
.studio-pillrow-tight { gap: 4px; flex-wrap: wrap; }
.studio-pill {
  padding: 6px 10px; background: var(--glass-2); border: 1px solid var(--stroke-1);
  color: var(--ink-1); border-radius: 9999px; font-size: 11.5px; cursor: pointer;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, color .15s, border-color .15s;
}
.studio-pill:hover { background: var(--glass-3); color: var(--ink-0); border-color: var(--stroke-bright); }
.studio-pill.on {
  background: linear-gradient(180deg, oklch(0.7 0.19 256 / 0.18), oklch(0.66 0.21 295 / 0.1));
  color: var(--ink-0); border-color: oklch(0.7 0.19 256 / 0.4);
}
.studio-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--ind-hue, 210), 60%, 60%); flex-shrink: 0; }
.studio-pill .swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--tile-color, oklch(0.7 0.19 256)); flex-shrink: 0; }

/* [2026-05-12] .pill-opt — the chip variant used throughout the Design tab
   for radius / container-width / section-padding / animation / typography /
   niche / button-style / layout-mode rows. Server marks the currently-
   active value with `.on`; previously the CSS had styling for .studio-pill.on
   only, so the design tab chips appeared unselected even when the manifest
   carried defaults. */
.pill-opt {
  padding: 6px 10px; background: var(--glass-2); border: 1px solid var(--stroke-1);
  color: var(--ink-1); border-radius: 9999px; font-size: 11.5px; cursor: pointer;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
}
.pill-opt:hover:not(:disabled):not(.is-soon):not(.is-disabled-by-layout) {
  background: var(--glass-3); color: var(--ink-0); border-color: var(--stroke-bright);
}
.pill-opt.on {
  background: linear-gradient(180deg, oklch(0.7 0.19 256 / 0.18), oklch(0.66 0.21 295 / 0.1));
  color: var(--ink-0); border-color: oklch(0.7 0.19 256 / 0.4);
  box-shadow: inset 0 0 0 1px oklch(0.7 0.19 256 / 0.25);
}
.pill-opt.is-soon { opacity: 0.45; cursor: not-allowed; }

/* [2026-05-12] is-disabled-by-layout — applied by JS to container-width
   pills that the active layout-mode overrides. e.g. layout-wide forces
   container=1440 so the other container widths are visually disabled.
   The .on chip remains highlighted to show the forced value. */
.pill-opt.is-disabled-by-layout {
  opacity: 0.35; cursor: not-allowed; pointer-events: none;
  filter: saturate(0.4);
}
.pill-opt.is-disabled-by-layout.on { opacity: 0.7; }

.studio-show-all {
  padding: 8px 12px; background: transparent; border: 1px dashed var(--stroke-2); border-radius: 8px;
  color: var(--ink-2); font-size: 11.5px; font-family: var(--f-sans); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  transition: color .15s, border-color .15s;
}
.studio-show-all:hover { color: var(--ink-0); border-color: var(--stroke-bright); }

.studio-checkbox-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer;
  font-size: 11.5px; color: var(--ink-2);
}
.studio-checkbox-row input { margin: 0; cursor: pointer; }

/* Industry picker modal — search + grid */
.studio-modal-search {
  background: var(--glass-2) !important; border: 1px solid var(--stroke-1) !important;
  color: var(--ink-0) !important; border-radius: 9999px !important;
  font-size: 13px !important; padding: 9px 14px !important;
}
.studio-ind-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; max-height: 50vh; overflow-y: auto; padding-right: 4px; }
.studio-ind-card {
  padding: 12px 10px; background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: 10px;
  color: var(--ink-0); cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 4px; transition: all .15s;
}
.studio-ind-card:hover { background: var(--glass-3); border-color: var(--stroke-bright); }
.studio-ind-card .dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--ind-hue, 210), 60%, 60%); }
.studio-ind-card .name { font-size: 12.5px; font-weight: 500; }
.studio-ind-card .tone { font-family: var(--f-mono); font-size: 10px; color: var(--ink-2); }

/* Collapsible sections */
.studio-collapsible { background: var(--glass-1); border: 1px solid var(--stroke-1); border-radius: var(--r-md); padding: 0; }
.studio-collapsible > summary {
  padding: 11px 14px;
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2);
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.studio-collapsible > summary::-webkit-details-marker { display: none; }
.studio-collapsible > summary::after {
  content: ""; width: 6px; height: 6px;
  border-right: 1.5px solid var(--ink-2); border-bottom: 1.5px solid var(--ink-2);
  transform: rotate(45deg); transition: transform .2s; margin-left: 8px;
}
.studio-collapsible[open] > summary::after { transform: rotate(225deg); }
.studio-collapsible > summary .meta { font-family: var(--f-sans); font-size: 10.5px; color: var(--ink-3); text-transform: none; letter-spacing: 0; font-weight: 400; }
.studio-collapsible .studio-stack { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 14px; }
.studio-row { display: flex; flex-direction: column; gap: 6px; }
.studio-row > label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
}

/* Color combos */
.studio-color-combos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.studio-swatch {
  padding: 0; background: transparent; border: 1px solid var(--stroke-1); border-radius: 8px;
  cursor: pointer; overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.studio-swatch:hover { border-color: var(--stroke-bright); transform: translateY(-1px); }
.studio-swatch.on { border-color: var(--blue-bright); box-shadow: 0 0 0 2px oklch(0.7 0.19 256 / 0.25); }
.studio-swatch .sw-row { height: 22px; display: block; }
.studio-swatch .sw-label {
  font-size: 9.5px; padding: 4px 6px; color: var(--ink-1);
  background: var(--glass-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Segmented (Dark/Light, Page width, Density, Btn shape) */
.studio-segmented {
  display: flex; gap: 4px; padding: 3px;
  background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: 10px;
}
.studio-segmented button {
  flex: 1; padding: 6px 10px; background: transparent; border: 0; color: var(--ink-2);
  font-size: 12px; font-weight: 500; border-radius: 7px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.studio-segmented button.on { background: var(--glass-3); color: var(--ink-0); }

/* Range — Heading scale */
.studio-range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; outline: none; }
.studio-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: var(--shadow-glow-blue); cursor: pointer; }
.studio-range::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: white; box-shadow: var(--shadow-glow-blue); cursor: pointer; }
.studio-range-out { font-family: var(--f-mono); color: var(--ink-1); font-size: 10.5px; text-transform: none; letter-spacing: 0; }

/* Toggle rows in Advanced */
.studio-toggle-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--stroke-1); cursor: pointer;
}
.studio-toggle-row:last-child { border-bottom: 0; }
.studio-toggle-row .lockup { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.studio-toggle-row strong { font-size: 12.5px; color: var(--ink-0); font-weight: 500; }
.studio-toggle-row small { font-size: 10.5px; color: var(--ink-2); }
.studio-toggle-row.studio-stub-row { opacity: 0.6; cursor: not-allowed; }
.studio-toggle {
  width: 32px; height: 18px; background: rgba(255,255,255,0.1); border-radius: 999px;
  position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0;
}
.studio-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  background: white; border-radius: 50%; transition: transform .2s;
}
.studio-toggle.on { background: var(--grad-primary); }
.studio-toggle.on::after { transform: translateX(14px); }
.studio-toggle[data-stub="1"] { cursor: not-allowed; }

/* Phase badge — small inline */
.phase-badge.sm {
  font-family: var(--f-mono); font-size: 8.5px; letter-spacing: 0.06em;
  padding: 1px 5px; background: oklch(0.66 0.21 295 / 0.2); color: var(--violet);
  border-radius: 999px; border: 1px solid oklch(0.66 0.21 295 / 0.4); margin-left: 6px;
}

/* Page-set select (mounted) */
.studio-select-wrap .form-group { margin: 0; }
.studio-select-wrap label { display: none; }
.studio-select-wrap select.form-control {
  background: var(--glass-2) !important; border: 1px solid var(--stroke-1) !important;
  color: var(--ink-0) !important; border-radius: 8px !important; height: 36px !important;
  font-size: 13px !important; padding: 0 10px !important;
}

/* Primary generate */
.studio-pri-btn {
  background: var(--grad-primary) !important; border: 0 !important; color: white !important;
  padding: 12px 16px !important; border-radius: var(--r-pill) !important;
  font-weight: 600 !important; font-size: 13.5px !important;
  display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 14px 50px -16px oklch(0.7 0.19 256 / 0.55), 0 0 0 6px oklch(0.7 0.19 256 / 0.06) !important;
  width: 100%; cursor: pointer; transition: transform .15s;
}
.studio-pri-btn:hover { transform: translateY(-1px); }
.studio-pri-btn .kbd {
  font-family: var(--f-mono); font-size: 10px; padding: 1px 5px;
  background: rgba(255,255,255,0.18); border-radius: 4px; margin-left: auto;
}

/* Suggested next */
.studio-suggested .head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px;
}
.studio-suggested .refresh { background: transparent; border: 0; color: var(--ink-2); cursor: pointer; padding: 2px; }
.studio-suggested .refresh:hover { color: var(--ink-0); }
.studio-suggested ul.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.studio-suggested li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; background: var(--glass-1); border: 1px solid var(--stroke-1); border-radius: 8px;
  font-size: 11.5px; color: var(--ink-1); line-height: 1.4;
}
.studio-suggested li .ic-wrap {
  width: 22px; height: 22px; border-radius: 6px; background: var(--glass-3);
  border: 1px solid var(--stroke-2); display: grid; place-items: center; color: var(--cyan); flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────
 * 12.6. RIGHT PANEL — tabbed (Pages / Templates / DNA / Layout / History)
 * ───────────────────────────────────────────────────────────────── */
.studio-main-area .studio_drawer::before { content: none; } /* the tab bar handles labelling now */
.studio-rp { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.studio-rp-head { flex-shrink: 0; border-bottom: 1px solid var(--stroke-1); padding: 6px 6px 0; }
.studio-rp-tabs {
  display: flex; gap: 2px; align-items: stretch;
  overflow-x: auto;
}
.studio-rp-tabs::-webkit-scrollbar { height: 2px; }
.studio-rp-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 8px; background: transparent; border: 1px solid transparent;
  border-radius: 8px 8px 0 0; color: var(--ink-2); font-size: 11.5px; cursor: pointer;
  white-space: nowrap; transition: color .15s, background .15s;
  position: relative; flex-shrink: 0;
}
@media (max-width: 1280px) {
  /* Narrow right panel — drop labels, keep icons + tooltip from title attr */
  .studio-rp-tab .lbl { display: none; }
}
.studio-rp-tab:hover:not([data-stub="1"]) { color: var(--ink-0); background: var(--glass-2); }
.studio-rp-tab.on {
  color: var(--ink-0);
  background: var(--glass-2);
  border-color: var(--stroke-1);
  border-bottom-color: transparent;
  margin-bottom: -1px;
}
.studio-rp-tab[data-stub="1"] { opacity: 0.5; cursor: not-allowed; }
.studio-rp-tab .ic { width: 14px; height: 14px; flex-shrink: 0; color: currentColor; }
.studio-rp-tab .lbl { font-weight: 500; }
.studio-rp-tab .ct {
  font-family: var(--f-mono); font-size: 9.5px; padding: 1px 5px;
  background: var(--glass-3); border: 1px solid var(--stroke-2); border-radius: 999px; color: var(--ink-2);
}
.studio-rp-tab.on .ct { background: oklch(0.7 0.19 256 / 0.18); color: var(--blue-bright); border-color: oklch(0.7 0.19 256 / 0.4); }
.studio-rp-tab .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 6px currentColor; color: var(--success);
}
.studio-rp-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.studio-rp-pane { display: flex; flex-direction: column; gap: 12px; }
.studio-rp-pane[hidden] { display: none; }
.studio-rp-mount { display: flex; flex-direction: column; gap: 12px; }

/* Action row in Pages tab */
.studio-rp-actions {
  display: flex; gap: 8px; padding-top: 4px;
  border-top: 1px solid var(--stroke-1); margin-top: 8px;
}
.studio-ghost-btn {
  flex: 1; padding: 8px 12px; background: var(--glass-2); border: 1px solid var(--stroke-1);
  color: var(--ink-1); border-radius: 8px; font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, color .15s, border-color .15s;
}
.studio-ghost-btn:hover { background: var(--glass-3); color: var(--ink-0); border-color: var(--stroke-bright); }
.studio-ghost-btn.studio-danger { color: oklch(0.72 0.18 22); }
.studio-ghost-btn.studio-danger:hover { background: oklch(0.72 0.18 22 / 0.1); color: oklch(0.78 0.18 22); border-color: oklch(0.72 0.18 22 / 0.4); }

/* Card baseline used inside tabs */
.studio-rp-card { background: var(--glass-1); border: 1px solid var(--stroke-1); border-radius: var(--r-md); padding: 14px; }
.studio-rp-card.studio-blurred {
  filter: blur(1.2px) saturate(0.85); opacity: 0.6;
  pointer-events: none; user-select: none; position: relative;
}
.studio-rp-card.studio-blurred::after {
  content: attr(data-phase); position: absolute; top: 8px; right: 10px;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.08em;
  color: var(--violet); padding: 1px 7px; background: oklch(0.66 0.21 295 / 0.18);
  border-radius: 999px; border: 1px solid oklch(0.66 0.21 295 / 0.35);
  filter: blur(0); opacity: 1; pointer-events: auto;
}

.studio-rp-empty .studio-empty-state,
.studio-empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 24px 12px; text-align: center;
}
.studio-empty-state .ic { width: 28px; height: 28px; color: var(--ink-3); margin-bottom: 4px; }
.studio-empty-state p { font-size: 13px; color: var(--ink-1); margin: 0; }
.studio-empty-state small { font-size: 11.5px; color: var(--ink-3); }

/* DNA tab card */
.studio-dna-actions { padding-top: 12px; margin-top: 10px; border-top: 1px solid var(--stroke-1); display: flex; }
.studio-dna-actions .studio-ghost-btn { flex: 1; }

/* Layout tab — Phase 2 properties */
.studio-prop-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.studio-prop-row .lbl { font-size: 11px; color: var(--ink-2); width: 50px; flex-shrink: 0; }
.studio-prop-input {
  flex: 1; display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 9px; background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: 8px;
}
.studio-prop-input input {
  background: transparent; border: 0; outline: 0; color: var(--ink-0);
  font-family: var(--f-mono); font-size: 11.5px; flex: 1; min-width: 0; padding: 0;
}
.studio-prop-input .unit { color: var(--ink-3); font-size: 10px; }

/* History tab list */
.studio-history-list {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.studio-history-list li {
  display: flex; gap: 10px; padding: 8px 10px;
  background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: 8px;
  font-size: 12px; align-items: center;
}
.studio-history-list li .when { font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); flex-shrink: 0; min-width: 80px; }
.studio-history-list li .what { color: var(--ink-1); }

.studio-card-title {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px;
}
.studio-props-empty { font-size: 12px; color: var(--ink-2); padding: 10px 0; line-height: 1.5; }
.studio-props-list {
  display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px;
  margin: 0; font-size: 12.5px;
}
.studio-props-list dt { color: var(--ink-2); font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.studio-props-list dd { color: var(--ink-0); margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.studio-props-list dd .dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--ind-hue, 210), 60%, 60%); }
.studio-props-list dd .swatch { width: 12px; height: 12px; border-radius: 3px; }

/* ─────────────────────────────────────────────────────────────────
 * 12.7. COLLAPSIBLE side panels
 *      Uses a body class to drive grid template columns transitions.
 * ───────────────────────────────────────────────────────────────── */
.studio-main-area .studio_shell-body {
  transition: grid-template-columns .25s ease;
}
body.studio-left-collapsed  .studio-main-area .studio_shell-body { grid-template-columns: 0 1fr 340px; }
body.studio-right-collapsed .studio-main-area .studio_shell-body { grid-template-columns: 320px 1fr 0; }
body.studio-left-collapsed.studio-right-collapsed .studio-main-area .studio_shell-body { grid-template-columns: 0 1fr 0; }

@media (max-width: 1280px) {
  body.studio-left-collapsed  .studio-main-area .studio_shell-body { grid-template-columns: 0 1fr 300px; }
  body.studio-right-collapsed .studio-main-area .studio_shell-body { grid-template-columns: 280px 1fr 0; }
}
@media (max-width: 1100px) {
  body.studio-left-collapsed  .studio-main-area .studio_shell-body { grid-template-columns: 0 1fr 280px; }
  body.studio-right-collapsed .studio-main-area .studio_shell-body { grid-template-columns: 260px 1fr 0; }
}

.studio-main-area .studio_sidebar,
.studio-main-area .studio_drawer {
  transition: opacity .2s ease, transform .25s ease;
  position: relative;
}
body.studio-left-collapsed  .studio-main-area .studio_sidebar  { opacity: 0; transform: translateX(-12px); pointer-events: none; }
body.studio-right-collapsed .studio-main-area .studio_drawer   { opacity: 0; transform: translateX(12px);  pointer-events: none; }

/* Collapse handles — float on the canvas edges, ALWAYS visible
   regardless of collapse state, so the panel can always be re-opened. */
.studio-main-area { position: relative; }
.studio-collapse {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 22px; height: 56px; padding: 0;
  background: var(--glass-3); border: 1px solid var(--stroke-1);
  color: var(--ink-1); cursor: pointer; z-index: 6;
  display: grid; place-items: center;
  transition: left .25s ease, right .25s ease, background .15s, color .15s;
}
.studio-collapse:hover { background: var(--blue-bright); color: white; border-color: var(--blue-bright); }
.studio-collapse .ar { font-size: 14px; line-height: 1; font-weight: 700; }

/* Position relative to the panel widths — match the .studio_shell-body grid */
.studio-collapse-left  { left: 322px;  border-radius: 0 9px 9px 0; border-left: 0; }
.studio-collapse-right { right: 342px; border-radius: 9px 0 0 9px; border-right: 0; }
@media (max-width: 1280px) {
  .studio-collapse-left  { left: 282px; }
  .studio-collapse-right { right: 302px; }
}
@media (max-width: 1100px) {
  .studio-collapse-left  { left: 262px; }
  .studio-collapse-right { right: 282px; }
}

/* When a panel is collapsed, snap its handle to the wall */
body.studio-left-collapsed  .studio-collapse-left  { left: 14px; }
body.studio-right-collapsed .studio-collapse-right { right: 14px; }

/* legacy block name kept for backwards-compat with previous CSS */
.studio-props { background: var(--glass-1); border: 1px solid var(--stroke-1); border-radius: var(--r-md); padding: 14px; }
.studio-card-title {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 12px;
}
.studio-props-empty { font-size: 12px; color: var(--ink-2); padding: 10px 0; line-height: 1.5; }
.studio-props-list {
  display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px;
  margin: 0; font-size: 12.5px;
}
.studio-props-list dt { color: var(--ink-2); font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; }
.studio-props-list dd { color: var(--ink-0); margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.studio-props-list dd .dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--ind-hue, 210), 60%, 60%); }
.studio-props-list dd .swatch { width: 12px; height: 12px; border-radius: 3px; }

/* ─────────────────────────────────────────────────────────────────
 * 12.5. (legacy theme block — superseded but kept for fallback)
 * ───────────────────────────────────────────────────────────────── */
.studio-theme-grid { display: flex; flex-direction: column; gap: 14px; }
.studio-theme-row { display: flex; flex-direction: column; gap: 7px; }
.studio-theme-row > label {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-2); font-weight: 500;
}
.studio-mirror-hint { color: var(--ink-3); font-family: var(--f-sans); font-size: 9.5px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.studio-range-out { margin-left: auto; font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-1); text-transform: none; letter-spacing: 0; }

/* Segmented control (Dark/Light, Density) */
.studio-segmented {
  display: flex; gap: 4px; padding: 3px;
  background: var(--glass-2); border: 1px solid var(--stroke-1); border-radius: 10px;
}
.studio-segmented button {
  flex: 1; padding: 6px 10px; background: transparent; border: 0; color: var(--ink-2);
  font-size: 12px; font-weight: 500; border-radius: 7px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, color .15s;
}
.studio-segmented button:hover:not(.on):not([data-stub="1"]) { background: var(--glass-1); color: var(--ink-0); }
.studio-segmented button.on { background: var(--glass-3); color: var(--ink-0); }
.studio-segmented button[data-stub="1"] { opacity: 0.55; cursor: not-allowed; }

/* Pillrow (typography, page width) */
.studio-pillrow { display: flex; flex-wrap: wrap; gap: 6px; }
.studio-pillrow-tight { gap: 4px; }
.studio-pill {
  padding: 6px 10px; background: var(--glass-2); border: 1px solid var(--stroke-1);
  color: var(--ink-1); border-radius: 9999px; font-size: 11.5px; cursor: pointer;
  white-space: nowrap; transition: background .15s, color .15s, border-color .15s;
}
.studio-pill:hover { background: var(--glass-3); color: var(--ink-0); border-color: var(--stroke-bright); }
.studio-pill.on {
  background: linear-gradient(180deg, oklch(0.7 0.19 256 / 0.18), oklch(0.66 0.21 295 / 0.1));
  color: var(--ink-0); border-color: oklch(0.7 0.19 256 / 0.4);
}

/* Color combo swatches */
.studio-color-combos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.studio-swatch {
  padding: 0; background: transparent; border: 1px solid var(--stroke-1); border-radius: 10px;
  cursor: pointer; overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.studio-swatch:hover { border-color: var(--stroke-bright); transform: translateY(-1px); }
.studio-swatch.on { border-color: var(--blue-bright); box-shadow: 0 0 0 2px oklch(0.7 0.19 256 / 0.25); }
.studio-swatch .sw-row { height: 28px; display: block; }
.studio-swatch .sw-label {
  font-size: 9.5px; padding: 4px 6px; color: var(--ink-1);
  background: var(--glass-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Range slider — Heading scale */
.studio-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; outline: none;
}
.studio-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%; background: white;
  box-shadow: var(--shadow-glow-blue); cursor: pointer;
}
.studio-range::-moz-range-thumb {
  width: 16px; height: 16px; border: 0; border-radius: 50%; background: white;
  box-shadow: var(--shadow-glow-blue); cursor: pointer;
}

/* Hide the legacy raw form once we've mirrored its values */
.studio-main-area #advanced-settings,
.studio-main-area details.settings-group:has(#advanced-settings) {
  display: none !important;
}

/* Light-preview body class — flips the canvas iframe wrapper for visual feedback */
body.studio-light-preview .studio-main-area #page-preview-frame { background: #fafafa; }

/* ─────────────────────────────────────────────────────────────────
 * 13. Responsive
 * ───────────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .studio-main-area .studio_shell-body { grid-template-columns: 280px 1fr 300px; }
}
@media (max-width: 1100px) {
  .studio-app { grid-template-columns: 220px 1fr; }
  .studio-dock { left: calc(220px + 50%); }
  .studio-main-area .studio_shell-body { grid-template-columns: 260px 1fr 280px; }
}
@media (max-width: 900px) {
  .studio-app { grid-template-columns: 1fr; grid-template-rows: 56px 1fr; grid-template-areas: "topbar" "main"; }
  .studio-sb { display: none; }
  .studio-dock { left: 50%; }
  .studio-main-area .studio_shell-body { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────────────
 * 14. [2026-05-09] AGENT 1 POLISH PASS — Tasks T1–T20
 *
 *   T2  Sticky Generate footer above the fold
 *   T3  Method picker spacing — labels on 2 lines, ≥12px padding
 *   T4  Right panel tabs — proper hover/active state
 *   T5  Brand-rail collapse handle (Ctrl/⌘0)
 *   T6  Brand rail + AI Command panel visual unification
 *   T7  Empty canvas — chips not sun icon
 *   T8  Bottom dock active-stage animation
 *   T9  Toast container
 *   T11 Icon rendering audit — defaults
 *   T12 Topbar icons hover background
 *   T13 Brand mark + wordmark scale
 *   T14 Sidebar nav link icon currentColor
 *   T15 (PHP — href="#" on stub anchors)
 *   T16 aria-pressed mirroring
 *   T17 Modal a11y (focus trap, Escape, role)
 *   T18 Save pill + toast role="status"
 *   T19 :focus-visible outlines
 *   T20 Ctrl on non-Mac platforms via [data-platform="win"]
 * ───────────────────────────────────────────────────────────────── */

/* T11 — Icon defaults: every .ic descends color from parent so SVG
   stroke="currentColor" always renders. Force any icon that opted into
   ic.ic-sm to 14×14, default 16×16. */
.studio-app .ic { width: 16px; height: 16px; flex-shrink: 0; color: var(--ink-2); }
.studio-app .ic-sm { width: 14px; height: 14px; }
.studio-app .ic svg, .studio-app svg.ic { display: block; }
/* When the icon's parent has a stronger color set (e.g. .studio-tb-icon-btn:hover),
   the cascade lets currentColor flow naturally. */

/* T13 — Wordmark scale up: name 14, small 11. */
.studio-brand-text .name { font-size: 14px; }
.studio-brand-text small { font-size: 11px; }
.studio-brand-mark {
  /* Make sure the gradient reads as the design's --grad-primary, with a
     stronger glow that survives the rail's dark background. */
  background: var(--grad-primary, linear-gradient(135deg, oklch(0.7 0.19 256), oklch(0.66 0.21 295))) !important;
  box-shadow: 0 6px 20px -6px oklch(0.7 0.19 256 / 0.7);
}

/* T14 — sidebar nav-link icon colors track .active. (.ic already scoped at line 118
   but only with a static color; we now make it follow currentColor for hover too.) */
.studio-sb-link { color: var(--ink-1); }
.studio-sb-link .ic { color: var(--ink-2); transition: color .15s; }
.studio-sb-link:hover .ic { color: var(--ink-0); }
.studio-sb-link.active .ic { color: var(--cyan, oklch(0.85 0.13 205)); }

/* T12 — Topbar icon-button hover already exists at line 178 — keep current rule.
   Add a subtle :focus-visible state and an :active push. */
.studio-tb-icon-btn:active:not([data-stub="1"]) { transform: translateY(0.5px); background: var(--glass-3); }

/* T19 — :focus-visible global outline rule for ALL sigmav2 interactive surfaces. */
.studio-app a:focus-visible,
.studio-app button:focus-visible,
.studio-app input:focus-visible,
.studio-app select:focus-visible,
.studio-app textarea:focus-visible,
.studio-app [role="tab"]:focus-visible,
.studio-app [role="button"]:focus-visible,
.studio-app .studio-method:focus-visible,
.studio-app .studio-pill:focus-visible,
.studio-app .studio-toggle:focus-visible,
.studio-app .studio-segmented button:focus-visible,
.studio-app .studio-swatch:focus-visible,
.studio-app .studio-deploy-card:focus-visible,
.studio-app .studio-deploy-tab:focus-visible,
.studio-app .studio-rp-tab:focus-visible,
.studio-app .studio-tb-icon-btn:focus-visible,
.studio-app .studio-tb-share:focus-visible,
.studio-app .studio-tb-publish:focus-visible,
.studio-app .studio-collapse:focus-visible,
.studio-app .studio-pri-btn:focus-visible,
.studio-toast:focus-visible,
.studio-modal-bg.show *:focus-visible {
  outline: 2px solid var(--cyan, oklch(0.85 0.13 205));
  outline-offset: 2px;
  border-radius: 8px;
}
/* Toggles are circular so use box-shadow ring instead of sharp outline */
.studio-app .studio-toggle:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 2px var(--cyan, oklch(0.85 0.13 205)), 0 0 0 4px oklch(0.85 0.13 205 / 0.25);
}

/* T6 — Brand rail visual unification: keep the right border subtle, drop
   the harsh dark divider so it reads as one chrome surface against the
   AI Command panel that follows it. */
.studio-sb {
  border-right: 1px solid var(--stroke-1);
  /* Layered gradient gives the rail depth that meshes with the canvas
     while keeping the AI Command panel separated by margin, not by line. */
  background: linear-gradient(180deg, rgba(8,11,24,0.72) 0%, rgba(8,11,24,0.62) 100%);
}
/* Remove the hard divider line that used to sit between the rail and
   the AI Command panel — the .studio_sidebar already has its own card border. */
.studio-main-area .studio_sidebar { box-shadow: none !important; }

/* T2 — Sticky generate footer above the fold.
   The .studio-genpanel-foot already has flex-shrink:0 (line 749). Make it
   stick to the panel bottom and add a glass elevation so it visually
   "lifts off" the scrolling body. */
.studio-genpanel { position: relative; }
.studio-genpanel-foot {
  position: sticky; bottom: 0; z-index: 5;
  background: linear-gradient(180deg, rgba(8,11,24,0.0) 0%, rgba(8,11,24,0.8) 35%, rgba(8,11,24,0.92) 100%);
  backdrop-filter: blur(14px);
  margin: 0 -14px -14px;
  padding: 14px 14px 16px;
  border-top: 1px solid var(--stroke-1);
}
.studio-genpanel-body {
  /* Reserve space for the sticky footer so the last suggestion doesn't
     hide under it when the panel is scrolled to the bottom. */
  padding-bottom: 4px;
}

/* T3 — Method picker spacing fix.
   Previously: 3-up cards at 70px each, padding 10px 10px 8px (line 768) →
   labels truncated and PHASE 2 badge overlapped content.
   Now: ≥12px internal padding, 2-line capable labels, badge auto-positioned
   above content, and below 280px column we stack vertically. */
/* [2026-05-10] Method picker is now ALWAYS vertical-stack (full-row each).
   Previous 3-up grid + media-query 2-up rules are obsolete and were
   conflicting with the new flex-column layout, so they're removed.
   Only the badge-position + small-line-height rules are kept. */
.studio-method {
  min-height: 0;
  gap: 6px;
}
.studio-method strong {
  font-size: 13px;
  letter-spacing: -0.005em;
  display: block;
}
.studio-method small {
  font-size: 11px;
  line-height: 1.35;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-method .phase-badge {
  /* Right-aligned chip inside the row. position:static so it sits in flow. */
  padding: 2px 6px;
  font-size: 8.5px;
  background: oklch(0.66 0.21 295 / 0.22);
  color: var(--violet);
  border: 1px solid oklch(0.66 0.21 295 / 0.42);
  border-radius: 999px;
  letter-spacing: 0.05em;
  pointer-events: none;
}

/* T4 — Right panel tabs polish.
   Hover/active gain proper padding, a cleaner type scale, and the
   blurred Phase-2 tabs (Layout, History) keep their disabled look.
   Pages tab gets a more graceful empty state title. */
.studio-rp-tab {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}
.studio-rp-tab .ic { color: currentColor; }
.studio-rp-tab:hover:not([data-stub="1"]):not(.on) {
  color: var(--ink-0);
  background: var(--glass-2);
}
.studio-rp-tab.on {
  color: var(--ink-0);
  background: linear-gradient(180deg, oklch(0.7 0.19 256 / 0.12) 0%, var(--glass-2) 100%);
  border-color: var(--stroke-1);
  border-bottom-color: transparent;
}
.studio-rp-tab.on::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px; bottom: -1px; height: 2px;
  background: var(--grad-primary, linear-gradient(90deg, oklch(0.7 0.19 256), oklch(0.66 0.21 295)));
  border-radius: 2px 2px 0 0;
}
/* Pages tab — improve empty state inside it (no pages yet) */
.studio-rp-pane[data-pane="pages"] .studio_result-empty {
  padding: 24px 14px;
}
.studio-rp-pane[data-pane="pages"] .studio_result-empty p {
  color: var(--ink-1);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}
/* Section labels in panes use mono for consistency */
.studio-rp-pane .studio_panel-title {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* T7 — Empty canvas state replacement.
   We hide the legacy .studio_preview-empty (sun icon + heading) and inject
   .studio-empty-canvas in its place via JS. The legacy node stays in DOM
   so existing handlers continue to function. */
.studio-main-area .studio_preview-placeholder { padding: 0 !important; }
.studio-main-area .studio_preview-empty { display: none !important; }
.studio-empty-canvas {
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 24px;
  text-align: center;
  gap: 18px;
  max-width: 720px;
  margin: 0 auto;
}
.studio-empty-canvas .ec-headline {
  font-size: 26px;
  letter-spacing: -0.025em;
  color: var(--ink-0);
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}
.studio-empty-canvas .ec-headline em {
  font-style: normal;
  background: var(--grad-primary, linear-gradient(90deg, oklch(0.7 0.19 256), oklch(0.66 0.21 295)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.studio-empty-canvas .ec-sub {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 480px;
  margin: 0;
}
.studio-empty-canvas .ec-chips {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin-top: 4px;
}
.studio-empty-canvas .ec-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: var(--glass-2); border: 1px solid var(--stroke-1);
  color: var(--ink-0); border-radius: 9999px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.studio-empty-canvas .ec-chip:hover {
  background: var(--glass-3);
  border-color: var(--stroke-bright);
  transform: translateY(-1px);
}
.studio-empty-canvas .ec-chip .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: hsl(var(--ind-hue, 210), 60%, 60%);
}
.studio-empty-canvas .ec-textbox {
  width: 100%; max-width: 520px;
  margin-top: 8px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px dashed var(--stroke-bright);
  border-radius: 14px;
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
  cursor: text;
  transition: border-color .15s;
}
.studio-empty-canvas .ec-textbox:hover { border-color: var(--cyan, oklch(0.85 0.13 205)); color: var(--ink-1); }
.studio-empty-canvas .ec-textbox .kbd {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 10px;
  padding: 1px 6px;
  background: rgba(255,255,255,0.10);
  border-radius: 4px;
  color: var(--ink-1);
}
.studio-empty-canvas .ec-textbox .ic { color: var(--cyan, oklch(0.85 0.13 205)); }

/* T8 — Bottom dock active-stage animation.
   Add a "ticking" pulse on the .active stage and progress dot fill on .done
   stages. Existing classes (.done, .active) come from line 669/671. */
.studio-dock { transition: opacity .25s; }
.studio-stage { transition: color .25s; }
@keyframes studio-stage-pulse {
  0%, 100% { box-shadow: 0 0 0 0 oklch(0.7 0.19 256 / 0.4); }
  50%      { box-shadow: 0 0 0 6px oklch(0.7 0.19 256 / 0); }
}
.studio-stage.active .num {
  animation: studio-stage-pulse 1.4s ease-in-out infinite;
}
/* Progress connector turns green between done stages */
.studio-stage.done + .studio-stage::before {
  background: oklch(0.78 0.17 158 / 0.6);
}
/* When the dock is "completed" (no active, all done), the rerun
   button becomes the prominent affordance. */
.studio-dock.is-complete .studio-dock-ctrl {
  background: var(--grad-primary);
  box-shadow: 0 0 0 4px oklch(0.78 0.17 158 / 0.18);
}
.studio-dock-ctrl:hover { transform: scale(1.05); }

/* T9 — Toast container + toast styles.
   Top-center, 3-second auto-dismiss (handled in JS). Supports info, success,
   warning, error kinds. Uses prefers-reduced-motion to drop animation. */
/* [2026-05-14] Notification redesign — center-of-screen popup card.
   Previous design was a top-72px pill; redesigned as a glass-card popup
   centered both horizontally and vertically. All toastr calls are
   intercepted in builder-shell.js and rerouted through sigmav2Toast so
   this is the single notification style across the app. */
.studio-toast-region {
  position: fixed;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  z-index: 2147483600;
  pointer-events: none;
  width: max-content;
  max-width: min(440px, 92vw);
}
.studio-toast {
  position: relative;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 24px 18px 20px;
  min-width: 280px;
  max-width: 100%;
  background: rgba(12, 16, 32, 0.92);
  border: 1px solid var(--stroke-2);
  border-radius: 14px;
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  color: var(--ink-0);
  font-size: 13.5px;
  line-height: 1.5;
  font-weight: 500;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04) inset;
  pointer-events: auto;
  animation: studio-toast-in .28s cubic-bezier(.2,.8,.2,1.1);
  overflow: hidden;
}
.studio-toast::after {
  /* Progress strip at the bottom edge — shrinks as the toast counts down. */
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0; height: 2px;
  background: currentColor;
  opacity: 0.5;
  transform-origin: left center;
  animation: studio-toast-progress var(--studio-toast-life, 3000ms) linear forwards;
}
.studio-toast .ic {
  color: currentColor;
  flex-shrink: 0;
  width: 22px; height: 22px;
  margin-top: 1px;
}
.studio-toast-body {
  flex: 1;
  min-width: 0;
  color: var(--ink-0);
}
.studio-toast-title {
  display: block;
  color: currentColor;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.studio-toast-msg {
  display: block;
  color: var(--ink-0);
  font-size: 13.5px;
  font-weight: 500;
}
.studio-toast-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  color: var(--ink-2);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity .15s ease, background .15s ease;
}
.studio-toast-close:hover { opacity: 1; background: rgba(255,255,255,0.08); }
.studio-toast-close svg { width: 12px; height: 12px; }

.studio-toast.kind-success { border-color: oklch(0.78 0.17 158 / 0.6); color: var(--success, oklch(0.82 0.18 158)); }
.studio-toast.kind-warning { border-color: oklch(0.78 0.13 75 / 0.6);  color: var(--warning, oklch(0.85 0.15 78)); }
.studio-toast.kind-error   { border-color: oklch(0.65 0.22 22 / 0.65); color: oklch(0.82 0.18 22); }
.studio-toast.kind-info    { border-color: oklch(0.7 0.19 256 / 0.55); color: var(--cyan, oklch(0.85 0.13 205)); }

.studio-toast.is-leaving { animation: studio-toast-out .22s ease-in forwards; }
.studio-toast.is-leaving::after { animation: none; }

@keyframes studio-toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes studio-toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(4px) scale(0.98); }
}
@keyframes studio-toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .studio-toast,
  .studio-toast.is-leaving { animation: none; }
  .studio-toast::after { animation-duration: 0s !important; }
  .studio-toast.is-leaving { opacity: 0; }
}

/* [2026-05-14] Hide the legacy toastr container outright — every toastr.*
   call is intercepted upstream and rerouted to .studio-toast-region. If
   any race-condition spills an actual toastr DOM node we keep it invisible
   so the user never sees the old pill alongside the new popup. */
#toast-container { display: none !important; }

/* [2026-05-14] Removed per user request — defensive hides for
   (a) topbar breadcrumb cluster "MetropolitanHost Studio / Projects /
       Builder · session XXXX"  →  .studio-crumbs
   (b) "Suggested next" tip panel in the v3 + v4 right-side rails →
       .studio-suggested (v3) and .suggested (v4)
   Even with the markup commented out in the PHP/JS files, this rule is
   the last line of defense in case any other call site re-renders these
   into the page. */
.studio-crumbs,
.studio-suggested,
.studio-panel-cmd .suggested,
.studio-panel-props .suggested { display: none !important; }

/* T20 — Render Ctrl on Windows/Linux.
   We set data-platform on <html> from JS. CSS swaps the visible glyph in
   any kbd hint that uses ⌘. We use a span.studio-kbd-mod inside .studio-kbd
   so the CSS can target and replace it cleanly. */
html[data-platform="win"] .studio-kbd-mod::before { content: "Ctrl"; }
html[data-platform="mac"] .studio-kbd-mod::before { content: "⌘"; }
html:not([data-platform]) .studio-kbd-mod::before { content: "⌘"; }
.studio-kbd-mod { display: inline; }
/* For kbd hints set via JS that already include the bare ⌘ glyph, allow
   data-mac/data-win attributes to override. */
html[data-platform="win"] [data-mac] { /* hooks for JS rewrite */ }

/* T5 — Brand-rail collapse handle.
   3rd handle floats on the rail edge, mirroring the panel handles' style
   but on the FAR LEFT (against the brand rail's right edge). */
.studio-collapse-rail {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  left: 248px; /* sits at the rail edge */
  width: 22px; height: 56px; padding: 0;
  background: var(--glass-3); border: 1px solid var(--stroke-1); border-left: 0;
  border-radius: 0 9px 9px 0;
  color: var(--ink-1); cursor: pointer; z-index: 7;
  display: grid; place-items: center;
  transition: left .25s ease, background .15s, color .15s;
}
.studio-collapse-rail:hover { background: var(--blue-bright); color: white; border-color: var(--blue-bright); }
.studio-collapse-rail .ar { font-size: 14px; line-height: 1; font-weight: 700; }
@media (max-width: 1100px) { .studio-collapse-rail { left: 220px; } }
@media (max-width: 900px)  { .studio-collapse-rail { display: none; } }

/* When the brand rail is collapsed, the whole grid loses the 248px column. */
body.studio-rail-collapsed .studio-app {
  grid-template-columns: 0 1fr;
}
body.studio-rail-collapsed .studio-sb {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-12px);
}
body.studio-rail-collapsed .studio-collapse-rail { left: 14px; }
body.studio-rail-collapsed .studio-dock { left: 50%; }

/* Auth CTA in topbar (used by Agent 2 — graceful styles in case it's added) */
.studio-tb-auth {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--glass-2);
  border: 1px solid var(--stroke-bright);
  color: var(--ink-0);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.studio-tb-auth:hover { background: var(--glass-3); }

/* Save pill — make sure transition works for screen readers' announcement
   timing (no visual change here, just defensive). */
.studio-save-pill[role="status"] { /* presentational only */ }

/* aria-pressed mirroring (T16): visual is identical to .on, but adding a
   selector lets future themes target programmatic state separately. */
.studio-method[aria-pressed="true"],
.studio-pill[aria-pressed="true"],
.studio-toggle[aria-pressed="true"] { /* hook for future theming */ }

/* Style-N pill labels (T10) — ensure pills with .studio-theme-n class are
   readable. The JS prepends "Theme N" / "Sidebar N" when no human label
   is available; this just guards against very long labels overflowing. */
.studio-pill[data-btnstyle], .studio-pill[data-sidebarstyle] {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Topbar publish button focus-visible — already covered by global rule above
   but the inline gradient background needs an offset that doesn't merge. */
.studio-tb-publish:focus-visible { outline-offset: 3px; }


/* ════════════════════════════════════════════════════════════════════════════
   [2026-05-10] Section 15 — UX RESTRUCTURE PASS
   User feedback: cramped method picker, wasted padding/margins, section priority
   wrong, generate-template overlap, right panel useless. Fixes:
   - Method picker now vertical (above)
   - Sticky footer no longer overlaps body (padding-bottom + backdrop)
   - Download button under Generate (.studio-sec-btn)
   - Right panel: tabs hidden, single section
   - Tighter section gaps + uniform internal padding
   ════════════════════════════════════════════════════════════════════════════ */

/* Tighter genpanel-body so sections don't feel cavernous; reserve bottom space
   for the sticky footer so its content never sits ON TOP of the last section. */
.studio-genpanel-body {
  gap: 14px !important;             /* was 18px */
  padding: 14px 14px 24px !important;
  /* The sticky footer (~140-180px depending on Suggested next contents) overlays
     content. Add a buffer so the last visible section can scroll past it. */
  padding-bottom: 24px !important;
  scroll-padding-bottom: 200px;
}
.studio-genpanel-foot {
  position: sticky; bottom: 0; z-index: 5;
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--bg-1, oklch(0.10 0.02 270)) 0%, transparent),
    var(--bg-1, oklch(0.10 0.02 270)) 18%,
    var(--bg-1, oklch(0.10 0.02 270)) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 12px 14px 14px !important;     /* was 14px 14px 16px */
  gap: 8px !important;                     /* was 12px */
  box-shadow: 0 -8px 24px -8px rgba(0,0,0,0.6);
}

/* Secondary CTA (Download) — sits directly below Generate */
.studio-sec-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px 14px;
  background: var(--glass-2); color: var(--ink-0);
  border: 1px solid var(--stroke-1); border-radius: 10px;
  font-size: 13px; font-weight: 500; letter-spacing: -0.01em;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.studio-sec-btn:hover:not(:disabled) {
  background: var(--glass-3); border-color: var(--stroke-bright);
  box-shadow: 0 0 0 4px oklch(0.7 0.19 256 / 0.06);
}
.studio-sec-btn:active:not(:disabled) { transform: translateY(0.5px); }
.studio-sec-btn:disabled,
.studio-sec-btn[aria-disabled="true"] {
  opacity: 0.5; cursor: not-allowed;
  background: var(--glass-1); color: var(--ink-2);
}
.studio-sec-btn .ic { color: currentColor; flex-shrink: 0; }
.studio-sec-btn .kbd {
  font-family: var(--f-mono); font-size: 10px; opacity: 0.7;
  padding: 1px 5px; background: rgba(255,255,255,0.06); border-radius: 4px;
  margin-left: auto;
}

/* Suggested next — was hogging vertical space inside the sticky footer.
   Compressed since it's secondary content. */
.studio-suggested { padding-top: 8px; border-top: 1px solid var(--stroke-1); }
.studio-suggested .head { font-size: 10.5px; padding-bottom: 6px; }
.studio-suggested .list li { padding: 6px 0; font-size: 11.5px; }


/* Right panel simplification.
   User: "right sidebar is technically useless. We only need the download
   project button [moved to left footer]. The pages-created list goes into
   an Advanced tab. Delete project unnecessary." */

/* Hide the 5-tab nav entirely — single content view from now on. */
.studio-rp-head { display: none !important; }
.studio-rp-body { padding: 16px 14px !important; }

/* Hide the Templates / DNA / Layout / History panes — keep only Pages */
.studio-rp-pane[data-pane="templates"],
.studio-rp-pane[data-pane="dna"],
.studio-rp-pane[data-pane="layout"],
.studio-rp-pane[data-pane="history"] {
  display: none !important;
}
.studio-rp-pane[data-pane="pages"] { display: flex !important; }

/* Frame the remaining "Pages" pane as an "Advanced" panel */
.studio-rp-pane[data-pane="pages"]::before {
  content: "Advanced \00B7 Pages";
  display: block;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2);
  padding-bottom: 6px; border-bottom: 1px solid var(--stroke-1); margin-bottom: 4px;
}

/* Hide the legacy action row (Clear pages + Delete project) entirely. */
.studio-rp-actions { display: none !important; }

/* The legacy sectionsCard inside .studio_sections-result has its own Generate
   Page + Download Project buttons (`#generate-html`, `#download-project`).
   Hide those visually here — Download is now in the left sticky footer. */
.studio-rp .studio_sections-result #generate-html,
.studio-rp .studio_sections-result #download-project,
.studio-rp .studio_sections-result button[onclick*="deleteProject"],
.studio-rp .studio_sections-result .studio_btn-danger {
  display: none !important;
}


/* Visual unification of the sidebar + AI Command panel — subtle borders only.
   User: "left sidebar is still not the left sidebar"; the harsh divider made
   the brand rail and the settings panel read as two separate columns. */
.studio-sb { border-right: 1px solid var(--stroke-1); }
.studio_app-shell { border-left: 0 !important; }


/* Section-label tightening: the mono labels were eating vertical space */
.studio-section-label { padding-bottom: 2px; }
.studio-section-label small { line-height: 1.3; }


/* Method picker — even more breathing room now that it's full-row */
.studio-method-grid { gap: 7px; }
.studio-method:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px;
}


/* ════════════════════════════════════════════════════════════════════════════
   [2026-05-10] sigmav2_confirm modal — styled replacement for native confirm()
   Replaces ugly browser dialogs with the MetropolitanHost Studio visual language.
   ════════════════════════════════════════════════════════════════════════════ */
.studio-confirm-bg {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .18s ease;
  padding: 20px;
}
.studio-confirm-bg.show { opacity: 1; }
.studio-confirm-card {
  width: 100%; max-width: 420px;
  background: var(--bg-2, oklch(0.13 0.03 270));
  border: 1px solid var(--stroke-2, rgba(255,255,255,0.10));
  border-radius: var(--r-lg, 16px);
  padding: 22px 22px 18px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  transform: scale(0.96); transition: transform .18s ease;
}
.studio-confirm-bg.show .studio-confirm-card { transform: scale(1); }
.studio-confirm-title {
  font-size: 17px; font-weight: 600; letter-spacing: -0.02em;
  color: var(--ink-0, oklch(0.99 0.01 270));
  margin: 0 0 8px;
}
.studio-confirm-msg {
  font-size: 13.5px; line-height: 1.55;
  color: var(--ink-1, oklch(0.78 0.02 270));
  margin: 0 0 18px;
}
.studio-confirm-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.studio-confirm-cancel,
.studio-confirm-ok {
  padding: 9px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .08s;
  border: 1px solid transparent;
}
.studio-confirm-cancel {
  background: var(--glass-2); color: var(--ink-1);
  border-color: var(--stroke-1);
}
.studio-confirm-cancel:hover { background: var(--glass-3); color: var(--ink-0); border-color: var(--stroke-bright); }
.studio-confirm-ok[data-kind="primary"] {
  background: linear-gradient(135deg, var(--blue, oklch(0.7 0.19 256)), var(--violet, oklch(0.66 0.21 295)));
  color: white;
}
.studio-confirm-ok[data-kind="primary"]:hover {
  box-shadow: 0 0 0 4px oklch(0.7 0.19 256 / 0.18);
}
.studio-confirm-ok[data-kind="danger"] {
  background: oklch(0.72 0.18 22 / 0.18); color: oklch(0.78 0.18 22);
  border-color: oklch(0.72 0.18 22 / 0.45);
}
.studio-confirm-ok[data-kind="danger"]:hover {
  background: oklch(0.72 0.18 22 / 0.30); color: oklch(0.85 0.18 22);
  border-color: oklch(0.72 0.18 22 / 0.65);
}
.studio-confirm-cancel:focus-visible,
.studio-confirm-ok:focus-visible {
  outline: 2px solid var(--cyan, oklch(0.85 0.13 205));
  outline-offset: 2px;
}
.studio-confirm-cancel:active,
.studio-confirm-ok:active { transform: translateY(0.5px); }


/* [2026-05-10] Canvas loading overlay — shown during auto-first-generate or
   when manual Generate is clicked while iframe is still empty. Production
   directive: "no area should look empty, broken, or unfinished". */
.studio-canvas-loading {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at top, oklch(0.7 0.19 256 / 0.06), transparent 70%),
    var(--bg-1, oklch(0.10 0.02 270));
  z-index: 4;
  animation: studio-fade-in .25s ease-out;
}
@keyframes studio-fade-in { from { opacity: 0 } to { opacity: 1 } }
.studio-canvas-loading-card {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 28px 36px;
  background: var(--glass-2);
  border: 1px solid var(--stroke-1);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: 420px; text-align: center;
}
.studio-canvas-loading-mark {
  width: 56px; height: 56px;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg,
      oklch(0.7 0.19 256), oklch(0.66 0.21 295),
      oklch(0.85 0.13 205), oklch(0.7 0.19 256));
  -webkit-mask: radial-gradient(circle, transparent 22px, black 22px, black 26px, transparent 26px);
          mask: radial-gradient(circle, transparent 22px, black 22px, black 26px, transparent 26px);
  animation: studio-spin 1.4s linear infinite;
}
@keyframes studio-spin { to { transform: rotate(360deg) } }
.studio-canvas-loading-text { display: flex; flex-direction: column; gap: 4px; }
.studio-canvas-loading-text strong {
  font-size: 15px; font-weight: 600; color: var(--ink-0); letter-spacing: -0.01em;
}
.studio-canvas-loading-text small {
  font-size: 12px; color: var(--ink-2); line-height: 1.5;
}
@media (prefers-reduced-motion: reduce) {
  .studio-canvas-loading-mark { animation: none; }
  .studio-canvas-loading { animation: none; }
}



