/* A single shell width contract. Mobile navigation is an overlay; desktop
   navigation and the inspector give their space back when collapsed. */
html body.nd-panels-v46 { --nd-sidebar-width: 14.5rem; }
html body.nd-panels-v46 :is(.menu-toggle, .menu-close, .nd-sidebar-collapse, .gen-settings-close, .nd-settings-reveal) {
  display: inline-flex !important; align-items: center; justify-content: center;
  min-width: 2.75rem; min-height: 2.75rem; width: 2.75rem; height: 2.75rem;
  flex-shrink: 0; padding: .625rem; border: 1px solid var(--nd-border);
  border-radius: .625rem; background: var(--nd-control); color: var(--nd-ink);
  box-shadow: none; cursor: pointer; font: inherit;
}
html body.nd-panels-v46 :is(.menu-toggle, .menu-close, .nd-sidebar-collapse, .gen-settings-close, .nd-settings-reveal) svg {
  width: 1.5rem; height: 1.5rem; flex: 0 0 1.5rem; pointer-events: none;
}
html body.nd-panels-v46 .nd-sidebar-collapse { display: none !important; }
html body.nd-panels-v46 #main-menu .side-nav.nav a { gap: .75rem; min-height: 2.75rem; font-size: .875rem; }
html body.nd-panels-v46 #main-menu .side-nav.nav a svg { width: 1.5rem; height: 1.5rem; flex: 0 0 1.5rem; opacity: 1; stroke-width: 1.8; }
html body.nd-panels-v46 .studio-sidebar { touch-action: pan-y; }
html body.nd-panels-v46 .nd-generation-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  min-width: 0; min-height: 3.25rem; height: 3.25rem; padding-right: .75rem;
  background: var(--nd-page); border-bottom: 1px solid var(--nd-border);
}
html[data-theme] body.nd-panels-v46.studio-shell[data-page="create"] .nd-generation-toolbar .gen-category-bar {
  flex: 1 1 auto; min-width: 0; height: auto; margin: 0; border: 0; padding-block: .25rem;
}
html body.nd-panels-v46 .nd-settings-reveal { width: 2.75rem; padding: .625rem; }
html body.nd-panels-v46 .nd-settings-reveal[hidden] { display: none !important; }
html body.nd-panels-v46 .nd-settings-reveal[aria-expanded="true"] { color: var(--nd-brand); border-color: var(--nd-brand); }
html body.nd-panels-v46 .gen-settings[hidden] { display: none !important; }
html body.nd-panels-v46.nd-settings-modal { overflow: hidden; }
html[data-theme] body.nd-panels-v46.studio-shell[data-page="create"] .gen-settings {
  position: fixed; inset: 0 0 0 auto; display: flex; flex-direction: column;
  width: min(23rem, calc(100vw - 1rem)); max-width: calc(100vw - 1rem) !important;
  height: var(--nd-viewport-height, 100dvh); max-height: var(--nd-viewport-height, 100dvh);
  visibility: visible; transform: none; overflow: hidden; z-index: 45;
  border: 1px solid var(--nd-border) !important; border-radius: .875rem 0 0 .875rem;
  background: var(--nd-panel) !important; box-shadow: -12px 0 36px #0003 !important;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
html[data-theme] body.nd-panels-v46.studio-shell[data-page="create"] .gen-settings-head {
  position: static; display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex: 0 0 auto; padding: .75rem 1rem;
  border-bottom: 1px solid var(--nd-border) !important;
}
html[data-theme] body.nd-panels-v46.studio-shell[data-page="create"] .gen-settings-body {
  flex: 1 1 auto; min-height: 0; padding: 1rem; overflow-y: auto; overscroll-behavior: contain;
}
html[data-theme] body.nd-panels-v46.studio-shell[data-page="create"] .gen-settings-foot {
  flex: 0 0 auto; padding: 1rem; border-top: 1px solid var(--nd-border) !important;
  background: var(--nd-navigation) !important;
}
html body.nd-panels-v46 .gen-settings :is(select, .gen-ratios button, .gen-model-option) { min-height: 2.75rem; }
html body.nd-panels-v46 .gen-settings-toggle .gen-settings-word { display: inline !important; color: inherit; }
html body.nd-panels-v46 .gen-settings-toggle .gen-config-summary { display: none; }
html body.nd-panels-v46 .gen-settings-toggle { gap: .5rem; }
html body.nd-panels-v46 .gen-settings-toggle > span[aria-hidden] { order: -1; }

@media (max-width: 700px) {
  html body.nd-panels-v46 .nd-settings-reveal { width: 2.75rem; padding: .625rem; }
  html body.nd-panels-v46 .nd-settings-reveal span { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  html body.nd-panels-v46 .gen-settings-toggle .gen-model-label { display: none !important; }
}

@media (min-width: 901px) {
  html:not(.nd-context-child) body.nd-panels-v46.studio-shell { padding-left: var(--nd-sidebar-width) !important; }
  html:not(.nd-context-child) body.nd-panels-v46.studio-shell.sidebar-collapsed { --nd-sidebar-width: 4.75rem; }
  html body.nd-panels-v46.studio-shell #main-menu {
    width: var(--nd-sidebar-width) !important; padding: 1rem .75rem !important;
    transform: none; overflow-x: hidden; overflow-y: auto;
  }
  html body.nd-panels-v46.studio-shell #main-menu .sidebar-head { justify-content: flex-start; margin: 0 0 1rem; min-height: 2.75rem; }
  html body.nd-panels-v46.studio-shell #main-menu .brand { justify-content: flex-start; gap: .625rem; padding: 0 .5rem; }
  html body.nd-panels-v46.studio-shell #main-menu .brand span { display: block; }
  html body.nd-panels-v46.studio-shell #main-menu .side-nav.nav { gap: .25rem; }
  html body.nd-panels-v46.studio-shell #main-menu .side-nav.nav a { justify-content: flex-start; padding: .625rem .75rem !important; }
  html body.nd-panels-v46.studio-shell #main-menu .nav-label { position: static; width: auto; height: auto; clip-path: none; overflow: visible; white-space: nowrap; }
  html body.nd-panels-v46.studio-shell #main-menu .sidebar-caption { display: none; }
  html body.nd-panels-v46.studio-shell #main-menu .sidebar-foot { display: flex; padding: 1rem .75rem; font-size: .75rem; }
  html body.nd-panels-v46.studio-shell .menu-close { display: none !important; }
  html body.nd-panels-v46.studio-shell .nd-sidebar-collapse { display: flex !important; width: 100%; gap: .75rem; padding-inline: .625rem; justify-content: flex-start; margin-top: .5rem; font-size: .8125rem; }
  html body.nd-panels-v46.studio-shell.sidebar-collapsed #main-menu .brand { justify-content: center; padding: 0; width: 100%; }
  html body.nd-panels-v46.studio-shell.sidebar-collapsed #main-menu .brand span,
  html body.nd-panels-v46.studio-shell.sidebar-collapsed #main-menu .sidebar-foot { display: none; }
  html body.nd-panels-v46.studio-shell.sidebar-collapsed #main-menu .side-nav.nav a { justify-content: center; padding: .625rem !important; }
  html body.nd-panels-v46.studio-shell.sidebar-collapsed #main-menu .nav-label,
  html body.nd-panels-v46.studio-shell.sidebar-collapsed .nd-sidebar-collapse span { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  html body.nd-panels-v46.studio-shell.sidebar-collapsed .nd-sidebar-collapse { justify-content: center; margin-top: auto; padding-inline: .625rem; }
  html body.nd-panels-v46.studio-shell.sidebar-collapsed .nd-sidebar-collapse svg { transform: rotate(180deg); }
  html body.nd-panels-v46.studio-shell .main { max-width: none; width: 100%; min-width: 0; }
  html body.nd-panels-v46 .gen-workbench { height: calc(100% - 3.25rem); }
  html[data-theme] body.nd-panels-v46.studio-shell[data-page="create"] .gen-main { padding-left: 0; }
  html.nd-context-child body.nd-panels-v46 .gen-workbench { height: calc(100dvh - 3.25rem) !important; }
}

/* v47: the inspector's toggle belongs to the workspace context bar. */
html body.nd-panels-v46 .gen-composer-bar .gen-settings-toggle { display: none !important; }
html body.nd-panels-v46 .nd-composer-dialog #generate .gen-composer-bar .gen-settings-toggle { display: flex !important; }
html body.nd-panels-v46 .gen-settings-head .gen-settings-close { display: inline-flex !important; }
.gen-model-choices-label { display: block; margin: 0 0 .625rem; font-size: .75rem; color: var(--nd-secondary); }
.gen-model-cards { display: grid; gap: .5rem; }
html body.nd-panels-v46 .gen-model-choice { display: grid; grid-template-columns: 2.25rem minmax(0,1fr); gap: .375rem .625rem; align-items: center; width: 100%; padding: .75rem; border: 1px solid var(--nd-border) !important; border-radius: .875rem; background: var(--nd-control) !important; color: var(--nd-ink); text-align: left; font: inherit; cursor: pointer; }
html body.nd-panels-v46 .gen-model-choice[aria-pressed="true"] { border-color: var(--nd-brand) !important; background: color-mix(in srgb,var(--nd-brand) 12%,var(--nd-control)) !important; }
html body.nd-panels-v46 .gen-model-choice:focus-visible { outline: 2px solid var(--nd-brand); outline-offset: 2px; }
.gen-model-choice:disabled { opacity: .55; cursor: default; }
.gen-model-symbol { display: grid; place-items: center; grid-row: span 2; width: 2.25rem; height: 2.5rem; border-radius: .75rem .35rem .75rem .35rem; background: linear-gradient(145deg,#d7f8a0,#accb83); color: #263a1c; font-size: 1.375rem; font-weight: 750; font-style: italic; }
.gen-model-identity { display: grid; min-width: 0; gap: .2rem; }
.gen-model-identity strong { font-size: .875rem; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.gen-model-identity small { font-size: .6875rem; color: var(--nd-secondary); }
.gen-model-price { grid-column: 2; font-size: .8125rem; font-weight: 650; color: var(--nd-brand); }
html[data-theme] body.nd-panels-v46 #quote { display: grid; gap: .75rem; }
html[data-theme] body.nd-panels-v46 #quote .gen-price-coupon { position: relative; display: grid; gap: .4rem; padding: 1rem; border: 1px dashed #a4be65 !important; border-radius: .875rem; background: linear-gradient(125deg,#f0f7cc,#dcf1b8 55%,#d0e6a4) !important; color: #263919 !important; box-shadow: inset 0 1px #fff8; }
html[data-theme] body.nd-panels-v46 #quote .gen-price-coupon :is(strong,small,span) { color: #263919 !important; }
.gen-quote-label { font-size: .6875rem; letter-spacing: .04em; text-transform: uppercase; }
html[data-theme] body.nd-panels-v46 #quote .gen-price-coupon strong { font-size: 1.25rem; line-height: 1.3; }
html[data-theme] body.nd-panels-v46 #quote .gen-price-coupon small { font-size: .6875rem; line-height: 1.5; }
html[data-theme] body.nd-panels-v46 #quote .quote-balance { margin: 0; padding: 0 .25rem; border: 0; background: transparent !important; }

@media (min-width: 1180px) {
  html[data-theme] body.nd-panels-v46.studio-shell[data-page="create"] .gen-workbench { display: grid; grid-template-columns: minmax(0, 1fr) clamp(18rem, 22vw, 22rem); }
  html[data-theme] body.nd-panels-v46.studio-shell[data-page="create"].gen-settings-collapsed .gen-workbench { grid-template-columns: minmax(0, 1fr); }
  html[data-theme] body.nd-panels-v46.studio-shell[data-page="create"] .gen-settings {
    position: relative; inset: auto; z-index: 1; width: auto; max-width: none !important;
    height: 100%; max-height: 100%; border-radius: 0; border-width: 0 0 0 1px !important;
    box-shadow: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.nd-panels-v46 :is(.studio-sidebar, .gen-settings, .nd-sidebar-collapse) { transition: none !important; }
}
