/* V15 cabin controls: ebony surfaces, satin metal edging, restrained ambient light. */
:is(#model-dialog, #access-dialog, .studio-tools-backdrop) {
  --dialog-accent: var(--cabin-accent, #cdb997);
  --dialog-muted: var(--cabin-muted, #a7a49c);
  --studio-gold: var(--cabin-accent, #cdb997);
  --studio-muted: var(--cabin-muted, #a7a49c);
  background: #050606c9;
  backdrop-filter: blur(19px) saturate(.45);
  -webkit-backdrop-filter: blur(19px) saturate(.45);
}
:is(#model-dialog .model-dialog, #access-dialog .access-dialog, .studio-tools-dialog) {
  --studio-gold: var(--cabin-accent, #cdb997);
  --studio-muted: var(--cabin-muted, #a7a49c);
  position: relative;
  border: 1px solid rgb(var(--cabin-rgb, 205 185 151) / .3);
  border-top-color: rgb(var(--cabin-rgb, 205 185 151) / .55);
  border-bottom-color: #ffffff16;
  border-radius: 16px;
  background: linear-gradient(130deg, #272725 0%, #1b1c1b 26%, #121514 62%, #101312 100%);
  box-shadow: inset 0 1px #f2eadb14, inset 0 -1px #0009, 0 2px 3px #0007, 0 30px 100px #000c;
  color: #e7e6df;
  scrollbar-color: #71716a transparent;
}
:is(#model-dialog, #access-dialog) :is(h2, .model-option strong), .studio-tools-header h2,
.studio-template-card h3, .studio-setting h3 { color: #eeeae2; }
:is(#model-dialog, #access-dialog) .dialog-eyebrow, .studio-tools-eyebrow { color: var(--cabin-accent, #cdb997); letter-spacing: .19em; font-size: 9px; }
.studio-tools-header { padding-bottom: 23px; border-bottom: 1px solid #e2e1d413; margin-bottom: 24px; }
.studio-tools-dialog { overflow: hidden; }
.studio-tools-header { flex-shrink: 0; }
.studio-tools-library, .studio-tools-preferences {
  min-height: 0; overflow: auto; overscroll-behavior: contain;
  padding: 3px 5px; margin: -3px -5px;
  scrollbar-width: thin; scrollbar-color: #71716a66 transparent;
}
.studio-tools-subtitle, #access-dialog .dialog-intro, #model-dialog .model-count { color: var(--cabin-muted, #a7a49c); }
:is(#model-dialog, #access-dialog) .dialog-close, .studio-tools-close {
  width: 34px; height: 34px; border-radius: 7px; border: 1px solid #e0dfd51c;
  background: linear-gradient(145deg, #3a3b372e, #101413aa);
  color: #aead9f; box-shadow: inset 0 1px #fff5de08, 0 2px 4px #0003;
}
:is(#model-dialog, #access-dialog) .dialog-close:hover, .studio-tools-close:hover {
  border-color: rgb(var(--cabin-rgb, 205 185 151) / .55);
  background: #e8debe09; color: #f0e8d9;
}
:is(#model-dialog, #access-dialog) .dialog-close:active, .studio-tools-close:active { box-shadow: inset 0 2px 4px #0008; transform: translateY(1px); }
:is(#model-dialog, #access-dialog) :is(button, input, summary):focus-visible,
.studio-tools-dialog :is(button, input, textarea, select):focus-visible { outline-color: var(--cabin-accent, #cdb997); }

/* Fields sit in shallow recesses, while primary actions keep a satin finish. */
#model-dialog #model-search, #access-dialog #code-input, .studio-search-wrap,
.studio-template-form :is(input, textarea, select), #access-dialog .lab-controls input {
  border: 1px solid #a9ada333; border-top-color: #070b09;
  border-bottom-color: #d2d7c52b; border-radius: 6px; background-color: #10120f;
  box-shadow: inset 0 2px 5px #0006, 0 1px #ece8d406; color: #e7e8df;
}
#model-dialog #model-search:focus, #access-dialog #code-input:focus, .studio-search-wrap:focus-within,
.studio-template-form :is(input, textarea, select):focus {
  border-color: rgb(var(--cabin-rgb, 205 185 151) / .65);
  box-shadow: inset 0 2px 5px #0006, 0 0 0 2px rgb(var(--cabin-rgb, 205 185 151) / .05);
}
.studio-search-wrap input { color: #e7e8df; }
#model-dialog #model-search::placeholder, #access-dialog #code-input::placeholder,
.studio-search-wrap input::placeholder, .studio-template-form :is(input, textarea)::placeholder { color: #8f978f; }
.studio-tools-button, #access-dialog :is(.demo-area button, .lab-controls button) {
  border: 1px solid #e3dec02e; border-top-color: #e3dec040;
  background: linear-gradient(155deg, #343533, #222423 70%);
  box-shadow: inset 0 1px #e9ead80c, 0 2px 3px #0003; color: #dddcd1;
}
.studio-tools-button:hover, #access-dialog :is(.demo-area button, .lab-controls button):hover {
  border-color: rgb(var(--cabin-rgb, 205 185 151) / .5); background: #373735; color: #f2eee4;
}
.studio-tools-button:active { box-shadow: inset 0 2px 4px #0007; transform: translateY(1px); }
.studio-tools-button.studio-tools-primary, #access-dialog .redeem-button {
  border: 1px solid rgb(var(--cabin-rgb, 205 185 151) / .6);
  border-top-color: rgb(var(--cabin-rgb, 205 185 151) / .9);
  background: linear-gradient(125deg, #444541, #2b2d2b 60%, #333633);
  color: #ede6d7; box-shadow: inset 0 1px #e9e6cd14, inset 0 -1px #0006, 0 5px 12px #0003;
  font-weight: 550;
}
.studio-tools-button.studio-tools-primary:hover, #access-dialog .redeem-button:hover { border-color: var(--cabin-accent, #cdb997); background: #444541; color: #fff9ea; }
#access-dialog .redeem-button:active { background: #252925; box-shadow: inset 0 2px 5px #0007; }
#access-dialog .redeem-button:disabled { border-color: #6f78625c; background: #242a25; color: #8f978b; box-shadow: none; }

/* Model rows read as choices on one continuous panel. */
#model-dialog .provider-filters { border-bottom-color: #dfdfce20; }
#model-dialog .provider-filters button { color: #a5aaa0; }
#model-dialog .provider-filters button.active { border-bottom-color: var(--cabin-accent, #cdb997); color: var(--cabin-accent, #cdb997); }
#model-dialog .model-option { border-bottom-color: #e1e0cb12; border-radius: 6px; }
#model-dialog button.model-option:hover { border-color: #c4c9bb26; background: #efedcd05; }
#model-dialog .model-option.active {
  border-color: rgb(var(--cabin-rgb, 205 185 151) / .25);
  background: linear-gradient(100deg, rgb(var(--cabin-rgb, 205 185 151) / .075), #ffffff01);
  box-shadow: inset 2px 0 rgb(var(--cabin-rgb, 205 185 151) / .85), inset 0 1px #f5f0d308;
}
#model-dialog .model-option .provider-mark {
  border: 1px solid #cbd1bf2b; border-top-color: #e7ebdc45;
  background: linear-gradient(145deg, #373a36, #1d211e 60%);
  border-radius: 6px; color: #dadacb; box-shadow: inset 0 1px #e6e8d60b, 0 3px 6px #0002;
}
#model-dialog .model-option.active .provider-mark { border-color: rgb(var(--cabin-rgb, 205 185 151) / .4); background: #33352e; color: var(--cabin-accent, #cdb997); }
#model-dialog .model-option small { color: #a7aea4; }
#model-dialog .model-option.active .model-check { border-color: rgb(var(--cabin-rgb, 205 185 151) / .35); color: var(--cabin-accent, #cdb997); }
#model-dialog .model-option-pending .provider-mark { border-color: #777e702e; background: #232622; color: #8e998c; box-shadow: none; }
#model-dialog .model-option-pending strong { color: #b3b7ac; }
#model-dialog .model-option-pending small { color: #959d90; }
#model-dialog .pending-badge { border-color: #c2c6b527; background: #f3ead202; color: #a7b09f; }
#model-dialog .model-dialog-note, #access-dialog .dialog-footer, .studio-tools-footer { border-top-color: #e4e1c919; color: #939f91; }
#model-dialog .dialog-commands kbd { border-color: #b2bcaa35; color: #8f9b89; background: #080d0930; }
#access-dialog .dialog-mark { border-color: rgb(var(--cabin-rgb, 205 185 151) / .4); border-radius: 8px; background: linear-gradient(145deg, #373932, #1b1d1a); color: var(--cabin-accent, #cdb997); box-shadow: inset 0 1px #fbf5df13, 0 6px 12px #0003; }
#access-dialog form label, .studio-template-form label { color: #b9c0b3; }
#access-dialog .demo-area, .studio-template-form { border-color: rgb(var(--cabin-rgb, 205 185 151) / .23); background: #10120f55; }
#access-dialog .demo-area code, #access-dialog .lab-area p, #access-dialog .dialog-footer button { color: var(--cabin-accent, #cdb997); }

/* Prompt cards and switches share the same understated edge detailing. */
.studio-library-filters { border-bottom-color: #d8dfc51b; }
.studio-library-filters button { color: #a3ada0; }
.studio-library-filters button[aria-pressed="true"] { color: var(--cabin-accent, #cdb997); border-bottom-color: var(--cabin-accent, #cdb997); }
.studio-template-card { border: 1px solid #b6c3aa22; border-top-color: #e5e7cd25; background: linear-gradient(155deg, #38342a10, #12141030); box-shadow: inset 0 1px #eff4dc04; }
.studio-template-card:hover { border-color: rgb(var(--cabin-rgb, 205 185 151) / .3); background-color: #dfe1bc03; }
.studio-template-glyph { color: #c9cbb8; }
.studio-template-number { color: #969a8c; }
.studio-template-description { color: #aaa89d; }
.studio-template-footer, .studio-custom-actions { border-top-color: #d7e4bc14; }
.studio-template-tag, .studio-template-count, .studio-custom-actions { color: #9d9e92; }
.studio-template-fill, .studio-template-favorite[aria-pressed="true"], .studio-form-heading h3 { color: var(--cabin-accent, #cdb997); }
.studio-template-favorite[aria-pressed="true"] .ui-icon { fill: rgb(var(--cabin-rgb, 205 185 151) / .15); }
.studio-template-fill:hover { color: #f5eedd; }
.studio-setting { border-top-color: #e6e4c819; }
.studio-setting-index { color: var(--cabin-accent, #cdb997); }
.studio-setting p { color: var(--cabin-muted, #a7a49c); }
.studio-scene-options button { border-color: #dce1c42c; background: #0e110e45; box-shadow: inset 0 1px #e7e9d208; }
.studio-scene-options button:hover { border-color: #b9c5ad73; }
.studio-scene-options button[aria-pressed="true"] { border-color: rgb(var(--cabin-rgb, 205 185 151) / .65); background: rgb(var(--cabin-rgb, 205 185 151) / .035); box-shadow: inset 0 1px rgb(var(--cabin-rgb, 205 185 151) / .12); }
.studio-scene-options strong { color: #dedfcf; }
.studio-scene-options small { color: #9fa294; }
.studio-scene-sample { border-color: #d8e2b910; background: linear-gradient(115deg, #0d100d 5%, #2b2e26 72%, rgb(var(--cabin-rgb, 205 185 151) / .65) 73%, #373b31 74%, #10140e 90%); }
.studio-scene-sample::after { background: linear-gradient(100deg, transparent, rgb(var(--cabin-rgb, 205 185 151) / .7)); }
.studio-switch { border-color: #b5bda246; background: #0f120e; box-shadow: inset 0 2px 4px #0008; }
.studio-switch > span { background: linear-gradient(135deg, #b6bbaa, #858e79); box-shadow: inset 0 1px #fff8df30, 0 1px 3px #0008; }
.studio-switch[aria-checked="true"] { border-color: rgb(var(--cabin-rgb, 205 185 151) / .6); background: rgb(var(--cabin-rgb, 205 185 151) / .16); }
.studio-switch[aria-checked="true"] > span { background: var(--cabin-accent, #cdb997); }
.studio-ambient-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 0; }
.studio-ambient-options button {
  display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 48px; padding: 10px 12px;
  border: 1px solid #dce1c42c; border-top-color: #dce1c43b; border-radius: 7px;
  color: #b8c0af; background: linear-gradient(135deg, #f4f2d005, #0e140f50);
  box-shadow: inset 0 1px #e7e9d208; font-size: 12px;
  transition: border-color .18s, background .18s;
}
.studio-ambient-options button[data-ambient="champagne"] { --swatch-rgb: 205 185 151; }
.studio-ambient-options button[data-ambient="glacier"] { --swatch-rgb: 161 196 210; }
.studio-ambient-options button[data-ambient="amethyst"] { --swatch-rgb: 187 167 210; }
.studio-ambient-options button:hover { border-color: rgb(var(--swatch-rgb) / .65); }
.studio-ambient-options button[aria-pressed="true"] { border-color: rgb(var(--swatch-rgb) / .65); background: rgb(var(--swatch-rgb) / .06); color: #e9e8de; }
.studio-ambient-swatch { flex: none; width: 13px; height: 13px; border: 1px solid rgb(var(--swatch-rgb) / .8); border-radius: 50%; background: radial-gradient(circle at 35% 25%, rgb(var(--swatch-rgb) / .9), rgb(var(--swatch-rgb) / .35) 60%, #151b14); box-shadow: 0 0 0 3px rgb(var(--swatch-rgb) / .065); }
.studio-ambient-check { margin-left: auto; width: 13px !important; height: 13px !important; opacity: 0; color: rgb(var(--swatch-rgb)); }
.studio-ambient-options button[aria-pressed="true"] .studio-ambient-check { opacity: 1; }
.toast { max-width: calc(100vw - 32px); border: 1px solid rgb(var(--cabin-rgb, 205 185 151) / .35); border-top-color: rgb(var(--cabin-rgb, 205 185 151) / .6); border-radius: 8px; background: linear-gradient(130deg, #34362fef, #20231fed); color: #e4e7d8; box-shadow: inset 0 1px #eff3db0d, 0 8px 28px #0008; backdrop-filter: blur(14px); line-height: 1.6; }
@media (max-width: 600px) {
  :is(#model-dialog .model-dialog, #access-dialog .access-dialog, .studio-tools-dialog) { border-radius: 12px; }
  .studio-tools-header { padding-bottom: 19px; margin-bottom: 20px; }
  .studio-ambient-options { gap: 7px; margin-top: 15px; }
  .studio-ambient-options button { gap: 7px; min-height: 46px; padding: 10px 9px; font-size: 11px; }
  .studio-ambient-swatch { width: 11px; height: 11px; }
  .studio-ambient-check { width: 11px !important; height: 11px !important; }
}
@media (prefers-reduced-motion: reduce) { .studio-ambient-options button { transition: none; } }
