/* KESTREL AI · Cockpit unification pass
   The supplied Reading Cockpit is the visual authority for every creator
   control. This layer deliberately comes last so legacy creator rules cannot
   reintroduce the former gold / grey component language. */
:root {
  --restrel-bg: #050806;
  --restrel-panel: rgba(13, 23, 18, .86);
  --restrel-panel-deep: rgba(7, 15, 11, .9);
  --restrel-edge: rgba(190, 235, 208, .14);
  --restrel-edge-strong: rgba(0, 230, 118, .48);
  --restrel-text: #e9f4ed;
  --restrel-copy: #b4c8bb;
  --restrel-muted: #80958a;
  --restrel-green: #00e676;
  --restrel-green-soft: #a4f3bc;
  --restrel-radius: 14px;
  --restrel-font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Inter, system-ui, sans-serif;
}

html, body, .restrel-studio {
  font-family: var(--restrel-font) !important;
  background: var(--restrel-bg) !important;
  color: var(--restrel-text) !important;
}
body .app-shell .system-announcement-icon {
  background: rgba(0,230,118,.16) !important;
  color: var(--restrel-green-soft) !important;
  box-shadow: 0 0 0 3px rgba(0,230,118,.06) !important;
}
/* Brand lockup: give the supplied wordmark a clear, centered presence. */
body .app-shell.app-shell > .platform-nav .platform-nav-brand {
  display: flex !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: center !important;
  height: 92px !important;
  min-height: 92px !important;
  margin-bottom: 8px !important;
  padding: 0 0 10px !important;
  text-decoration: none;
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 2px;
}
@media(min-width:861px) and (max-height:900px){body .app-shell.app-shell>.platform-nav .platform-nav-brand{height:80px!important;min-height:80px!important}}
@media(min-width:861px) and (max-height:720px){body .app-shell.app-shell>.platform-nav .platform-nav-brand{height:64px!important;min-height:64px!important}}
@media(min-width:861px) and (max-height:540px){body .app-shell.app-shell>.platform-nav .platform-nav-brand{height:48px!important;min-height:48px!important;padding-bottom:6px!important}}
body .app-shell.app-shell > .platform-nav .platform-nav-brand .restrel-wordmark {
  display: block !important;width:100% !important;
  height: auto !important;max-width:none !important;
  object-fit: contain !important;
  object-position: center !important;transform:none !important;
  scale: 1;
  opacity: .92;
  transition: scale 180ms ease-out, opacity 180ms ease-out;
}
body .app-shell.app-shell > .platform-nav .platform-nav-brand:focus-visible {
  outline-color: var(--restrel-green);
}
body .app-shell.app-shell > .platform-nav .platform-nav-brand:focus-visible .restrel-wordmark {
  scale: 1.025;
  opacity: 1;
}
@media (hover: hover) and (pointer: fine) {
  body .app-shell.app-shell > .platform-nav .platform-nav-brand:hover .restrel-wordmark {
    scale: 1.025;
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  body .app-shell.app-shell > .platform-nav .platform-nav-brand .restrel-wordmark {
    transition: none;
    scale: 1 !important;
  }
}

/* One heading recipe for the center page title and the inspector title. */
body .app-shell.app-shell:not(.home-mode) .platform-page-heading h1,
body .app-shell.app-shell:not(.home-mode) .inspector-head h3 {
  font-family: var(--restrel-font) !important;font-size:var(--kestrel-type-section) !important;line-height:var(--kestrel-leading-title) !important;font-weight:600 !important;letter-spacing:0 !important;
}
body .app-shell.app-shell:not(.home-mode) .inspector-head h3 { margin: 0 !important; }

body .app-shell.app-shell:not(.home-mode) #overview-view,
body .app-shell.app-shell:not(.home-mode) .overview-view {
  display: none !important;
}
body .app-shell.app-shell.home-mode #video-studio,
body .app-shell.app-shell.home-mode #image-studio-view,
body .app-shell.app-shell.home-mode #video-enhancement-view {
  display: none !important;
}

/* The creator is one continuous glass surface. */
body .app-shell.app-shell:not(.home-mode) .workspace-scroll {
  display: block !important;
  overflow: auto !important;
  padding: 10px 0 48px !important;
  min-height: 0 !important;
  scrollbar-color: #294c39 transparent;
}

/* Let the page heading travel with the creator surface. The workbench owns
   one scroll context so the header never hangs in a detached framed strip. */
body .app-shell.app-shell:not(.home-mode) > .workspace {
  display: block !important;
  overflow: auto !important;
}
body .app-shell.app-shell:not(.home-mode) > .workspace > .workspace-header {
  display: flex !important;
  flex: none !important;
}
body .app-shell.app-shell:not(.home-mode) > .workspace > .workspace-scroll {
  flex: none !important;
  min-height: auto !important;
  overflow: visible !important;
}
body .app-shell.app-shell:not(.home-mode) > .workspace > .creation-workbench {
  display: grid !important;
  grid-template-columns: 180px minmax(0,1fr);
  align-items: start;
  gap: 16px;
  padding: 14px 9px 40px 0 !important;
}
body .app-shell.app-shell:not(.home-mode) > .workspace > .creation-workbench.hidden {display:none!important}
.creation-tool-nav {display:flex;flex-direction:column;gap:6px;min-width:0}
body .app-shell.app-shell:not(.home-mode) .creation-tool-nav .image-feature-card {display:flex;align-items:center;gap:10px;width:100%;min-height:48px;margin:0;padding:10px 12px;text-align:left;border:1px solid transparent!important;border-radius:10px;background:transparent!important;box-shadow:none!important;color:var(--restrel-copy);cursor:pointer}
.creation-tool-nav .image-feature-card small {display:none}
body .app-shell.app-shell:not(.home-mode) .creation-tool-nav .image-feature-card strong {font-size:13px!important;font-weight:500;line-height:1.5}
body .app-shell.app-shell:not(.home-mode) .creation-tool-nav .image-feature-card:hover {background:#11271b!important;color:var(--restrel-text)}
body .app-shell.app-shell:not(.home-mode) .creation-tool-nav .image-feature-card.is-selected {border-color:#23864b!important;background:#102e1e!important;color:#d9fbe5}
body .app-shell.app-shell:not(.home-mode) .creation-workbench>.hero-card.studio-panel {width:100%!important;margin:0!important}
.creation-tool-nav .image-feature-icon,.creation-tool-nav .restrel-icon {display:grid;place-items:center;flex:none;width:22px;height:22px;border:0;padding:0;background:none;color:var(--restrel-green-soft)}
.creation-tool-nav svg {width:20px;height:20px;flex:none}
.creation-tool-nav button:focus-visible,.creation-tool-versions button:focus-visible {outline:2px solid var(--restrel-green);outline-offset:3px}
.creation-tool-group {min-width:0;margin:0}
.creation-category-button {display:flex;align-items:center;gap:10px;width:100%;min-height:48px;padding:10px 12px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--restrel-copy);font:inherit;font-size:13px;text-align:left;cursor:pointer;transition:background-color 160ms ease,color 160ms ease,border-color 160ms ease}
.creation-category-button:hover {background:var(--restrel-panel);color:var(--restrel-text)}
.creation-tool-group.has-selection>.creation-category-button {color:var(--restrel-green-soft)}
.creation-tool-group.is-open>.creation-category-button {background:var(--restrel-panel);color:var(--restrel-text);border-color:var(--restrel-edge)}
.creation-tool-nav .creation-category-chevron {width:14px;height:14px;margin-left:auto;color:var(--restrel-muted);transition:transform 220ms cubic-bezier(.16,1,.3,1)}
.creation-tool-group.is-open .creation-category-chevron {transform:rotate(90deg)}
.creation-category-panel {display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows 220ms cubic-bezier(.16,1,.3,1),opacity 160ms ease}
.creation-tool-group.is-open>.creation-category-panel {grid-template-rows:1fr;opacity:1}
.creation-category-tools {min-height:0;overflow:hidden;display:flex;flex-direction:column;gap:4px;padding-inline:12px 0}
body .app-shell.app-shell:not(.home-mode) #imageToolNav .creation-category-tools .image-feature-card {min-height:44px;padding:9px 10px;border-radius:8px;gap:8px}
.creation-category-tools .image-feature-icon {display:none}
.creation-category-tools .image-feature-card>span:last-child {min-width:0;overflow-wrap:anywhere}
@media(prefers-reduced-motion:reduce){.creation-category-panel,.creation-category-chevron,.creation-category-button{transition:none}}
.creation-tool-heading h2 {margin:0 0 6px;font-size:18px;color:var(--restrel-text)}
.creation-tool-heading p {margin:0 0 20px;color:var(--restrel-copy);font-size:13px;line-height:1.7}
.creation-tool-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:20px}
.creation-tool-fields label {display:grid;gap:6px;margin:0;color:var(--restrel-copy);font-size:12px}
.creation-tool-fields :is(input,select) {min-height:42px;font-size:13px}
.creation-tool-fields[hidden],.creation-tool-heading[hidden],.creation-tool-plan[hidden] {display:none}
.creation-tool-plan {margin-bottom:20px;padding:16px 0;border-block:1px solid var(--restrel-edge)}
.creation-plan-head {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;font-size:12px;color:var(--restrel-copy)}
:is(#videoToolPrepare,#imageToolPrepare)[aria-busy="true"] {background:var(--restrel-green)!important;border-color:var(--restrel-green)!important;color:#041108!important;font-weight:600!important;opacity:1;cursor:progress}
.creation-tool-plan textarea {min-height:100px}
.creation-tool-plan p {font-size:12px;line-height:1.7;color:var(--restrel-copy);margin:8px 0}
.creation-tool-plan #videoToolPlanStatus.is-ready {display:flex;align-items:flex-start;gap:10px;margin:14px 0;padding:12px 14px;border:1px solid rgba(164,243,188,.35);border-radius:8px;background:#10271a;color:var(--restrel-green-soft);font-size:14px;font-weight:600;line-height:1.7;overflow-wrap:anywhere}
.creation-tool-plan #videoToolPlanStatus.is-ready::before {content:"";flex:0 0 20px;height:20px;margin-top:2px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12 3 3 5-6'/%3E%3C/svg%3E") center/contain no-repeat}
.creation-tool-versions {display:flex;flex-wrap:wrap;gap:8px}
.creation-tool-versions button {padding:8px 12px;border:1px solid var(--restrel-edge);border-radius:8px;background:#0b1b12;color:var(--restrel-text);cursor:pointer}
.creation-tool-versions button[aria-pressed="true"] {border-color:var(--restrel-green)}
.creation-prompt-preview {flex-basis:100%;min-width:0;margin:4px 0 8px;color:var(--restrel-copy)}
.creation-prompt-preview summary {cursor:pointer;padding:10px 0;font-size:13px}
.creation-prompt-preview pre {max-height:360px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;font-size:14px;line-height:1.8;color:var(--restrel-text);margin:8px 0}
.creative-ad-flow[hidden] {display:none}
.creative-ad-flow {display:grid;gap:12px;margin-top:16px;min-width:0}
.creative-ad-flow label {display:grid;gap:8px;color:var(--restrel-text);font-size:13px}
.creative-ad-flow select {width:100%;min-width:0;min-height:44px}
.creative-ad-flow textarea {width:100%;min-height:220px;line-height:1.8}
.creative-ad-flow p {white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}
.creative-ad-steps {display:flex;flex-wrap:wrap;gap:8px 20px;list-style:none;margin:0;padding:12px 0;border-block:1px solid var(--restrel-edge);font-size:13px;color:var(--restrel-copy)}
.creative-ad-steps [aria-current="step"] {color:var(--restrel-green-soft);font-weight:600}
#video-studio[data-tool="creative-ad"] #mediaFields .media-role:not([data-role="image_references"]) {display:none}
#video-studio[data-tool="creative-ad"] #mediaFields .media-grid {grid-template-columns:minmax(0,1fr)}
.video-tool-setup {margin-block:20px 28px}
.video-tool-setup h3 {margin:0 0 8px;font-size:18px;font-weight:650}
.video-tool-setup > p {margin:0 0 18px;color:var(--restrel-copy);line-height:1.65}
.video-tool-setup #schemaFields {margin-block:16px}
.video-tool-setup #mediaFields {margin-block:18px 0}
#video-studio[data-tool="storyboard"] #mediaFields .media-role:not([data-role="image_references"]) {display:none}
#video-studio[data-tool="storyboard"] #mediaFields .media-grid {grid-template-columns:minmax(0,1fr)}
#video-studio[data-tool="creative-ad"] .creation-plan-head {margin-top:20px}
.replica-steps {display:flex;gap:18px;list-style:none;margin:0 0 16px;padding:0 0 16px;border-bottom:1px solid var(--restrel-edge)}
.replica-steps li {display:grid;gap:4px;flex:1;min-width:0;color:var(--restrel-copy);font-size:12px;line-height:1.6}
.replica-steps strong {font-size:13px;font-weight:600;color:var(--restrel-text)}
.replica-steps [aria-current="step"] strong {color:var(--restrel-green-soft)}
.replica-next {margin:0 0 20px;color:var(--restrel-green-soft);font-size:13px;line-height:1.7;overflow-wrap:anywhere}
.replica-section {margin-bottom:24px}
.replica-section h3,.replica-section-title {margin:0 0 8px;color:var(--restrel-text);font-size:16px;line-height:1.6;font-weight:600}
.replica-section-title {margin-top:24px}
.replica-section>p,.replica-review>p {color:var(--restrel-copy);font-size:13px;line-height:1.7;margin:0 0 12px;max-width:72ch}
.replica-review {margin:16px 0;border-block:1px solid var(--restrel-edge);padding:14px 0;color:var(--restrel-text)}
.replica-review summary {cursor:pointer;font-size:14px;line-height:1.6;padding:4px 0}
.replica-review[open] summary {margin-bottom:12px}
.replica-review summary:focus-visible {outline:2px solid var(--restrel-green);outline-offset:4px;border-radius:4px}
#video-studio[data-tool="replicate"] .media-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
#video-studio[data-tool="replicate"] .media-role[data-role="video_references"] {grid-column:1 / -1}
#video-studio[data-tool="replicate"] .replica-type-field,
#video-studio[data-tool="replicate"] .replica-replacement-field {grid-column:1 / -1}
.replica-field-help {display:block;color:var(--restrel-copy);font-size:13px;line-height:1.7;font-weight:400;overflow-wrap:anywhere}
.replica-submit-hint {margin:10px 0 0;color:var(--restrel-green-soft);font-size:13px;line-height:1.7;overflow-wrap:anywhere}
#video-studio[data-tool="replicate"] .creation-tool-plan {border-top:0;padding-top:0;margin-bottom:16px}
#video-studio[data-tool="replicate"] .creation-tool-plan textarea {min-height:76px}
#video-studio[data-tool="replicate"] .asset-library-panel {display:none}
#video-studio[data-tool="replicate"] .task-status.guide {display:none}
.replica-steps[hidden],.replica-section[hidden],.replica-section-title[hidden],.replica-review[hidden],.replica-next[hidden],.replica-submit-hint[hidden],#video-studio[data-tool="replicate"] .media-role[hidden] {display:none}
@media(max-width:520px){.replica-steps{gap:10px}.replica-steps li{font-size:12px}.replica-steps span{display:none}#video-studio[data-tool="replicate"] .media-grid{grid-template-columns:minmax(0,1fr)}#video-studio[data-tool="replicate"] .creation-plan-head button{width:100%;min-height:44px}}
@media(max-width:1100px) and (min-width:761px){body .app-shell.app-shell:not(.home-mode)>.workspace>.creation-workbench{grid-template-columns:146px minmax(0,1fr);gap:10px}.creation-tool-nav .image-feature-card{padding:9px 8px;gap:7px}.creation-tool-fields{grid-template-columns:minmax(0,1fr)}}
@media(max-width:760px){body .app-shell.app-shell:not(.home-mode)>.workspace>.creation-workbench{display:flex!important;flex-direction:column;gap:12px;padding:12px 0 28px!important}.creation-tool-nav{flex-direction:row;width:100%;overflow-x:auto;gap:6px;padding:3px 2px 9px;scrollbar-width:thin;mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 20px),transparent)}body .app-shell.app-shell:not(.home-mode) .creation-tool-nav .image-feature-card{width:auto;flex:0 0 auto;min-height:44px;white-space:nowrap;padding:9px 11px}.creation-tool-fields{grid-template-columns:minmax(0,1fr)}.creation-plan-head{flex-wrap:wrap}}
@media(max-width:760px){#imageToolNav{flex-direction:column;overflow:visible;mask-image:none;padding:0;gap:4px}#imageToolNav .creation-category-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding-inline:12px 0}body .app-shell.app-shell:not(.home-mode) #imageToolNav .image-feature-card{width:100%;white-space:normal}.creation-category-button{min-height:44px}}
body .app-shell.app-shell:not(.home-mode) .hero-card.studio-panel {
  box-sizing: border-box !important;
  width: min(100%, 960px) !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 20px !important;
  border: 1px solid var(--restrel-edge) !important;
  border-radius: 18px !important;
  background: linear-gradient(150deg, rgba(18, 32, 24, .9), rgba(6, 14, 10, .88)) !important;
  box-shadow: 0 24px 70px rgba(0,0,0,.38), inset 0 1px rgba(229,255,239,.08) !important;
}
/* The page header is part of the cockpit surface, rather than a detached
   black strip between the navigation and the creator panel. */
body .app-shell.app-shell:not(.home-mode) .workspace-header {
  box-sizing: border-box !important;
  flex: 0 0 112px !important;
  height: auto !important;
  min-height: 112px !important;
  padding: 0 16px !important;
  border: 1px solid var(--restrel-edge) !important;
  border-radius: 18px !important;
  background: linear-gradient(145deg, rgba(18,32,24,.9), rgba(6,14,10,.88)) !important;
  box-shadow: 0 16px 38px rgba(0,0,0,.22), inset 0 1px rgba(229,255,239,.07) !important;
}
@media (min-width: 861px) {
  /* The scroll track belongs to the creator column; reserve its width so the
     header edge lines up exactly with the visible workbench surface below. */
  body .app-shell.app-shell:not(.home-mode) .workspace-header { margin-right: 9px !important; }
}
body .app-shell.app-shell:not(.home-mode) .workspace-header::after {
  border: 0 !important;
  box-shadow: inset 0 -1px rgba(0,230,118,.08) !important;
}
body .app-shell.app-shell:not(.home-mode) .workspace-header .platform-page-heading h1 {
  margin: 0 !important;font-size:var(--kestrel-type-section) !important;line-height:var(--kestrel-leading-title) !important;font-weight:600 !important;letter-spacing:0 !important;}
body .app-shell.app-shell:not(.home-mode) .workspace-header .platform-page-heading p {
  margin: 5px 0 0 !important;
  color: var(--restrel-muted) !important;
  font-size:var(--kestrel-type-meta) !important;line-height:var(--kestrel-leading-meta) !important;
}
body .app-shell.app-shell:not(.home-mode) .workspace-header-actions { gap: 7px !important; }
body .app-shell.app-shell:not(.home-mode) .runtime-badge {
  border-color: var(--restrel-edge) !important;
  background: rgba(0,230,118,.06) !important;
  color: var(--restrel-green-soft) !important;
}
body .app-shell.app-shell:not(.home-mode) .settings-toggle {
  border-color: var(--restrel-edge) !important;
  background: rgba(4,18,11,.8) !important;
  color: #b9d5c2 !important;
}
body .app-shell.app-shell:not(.home-mode) .new-project-action {
  border-color: rgba(0,230,118,.42) !important;
  background: rgba(0,230,118,.1) !important;
  color: #d9ffe7 !important;
}
body .app-shell.app-shell:not(.home-mode) .hero-card.studio-panel::before {
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(143,255,192,.07), transparent 32%, transparent 70%, rgba(0,230,118,.04));
}

/* One type scale: compact labels, readable content, deliberate headings. */
body .app-shell .studio-panel,
body .app-shell .studio-panel button,
body .app-shell .studio-panel input,
body .app-shell .studio-panel select,
body .app-shell .studio-panel textarea {
  font-family: var(--restrel-font) !important;
}
body .app-shell .studio-panel label,
body .app-shell .studio-panel .media-title,
body .app-shell .studio-panel .frame-tool-title {
  color: var(--restrel-copy) !important;font-size:var(--kestrel-type-control) !important;
  font-weight:600 !important;line-height:var(--kestrel-leading-control) !important;
  letter-spacing: .01em;
}
body .app-shell .studio-panel .model-row label,
body .app-shell .studio-panel .prompt-dock-head label {
  color: var(--restrel-text) !important;font-size:var(--kestrel-type-control) !important;
  font-weight: 700 !important;
}
body .app-shell .studio-panel .model-row,
body .app-shell .studio-panel .prompt-dock,
body .app-shell .studio-panel .schema-grid,
body .app-shell .studio-panel .media-box {
  position: relative;
  z-index: 1;
}

/* Inputs/selects share the reference's dark acrylic treatment. */
body .app-shell .studio-panel select,
body .app-shell .studio-panel input[type="text"],
body .app-shell .studio-panel input[type="url"],
body .app-shell .studio-panel input[type="number"],
body .app-shell .studio-panel textarea {
  box-sizing: border-box !important;
  min-height: 42px !important;
  border: 1px solid var(--restrel-edge) !important;
  border-radius: 10px !important;
  background: rgba(2, 10, 7, .72) !important;
  color: var(--restrel-text) !important;
  box-shadow: inset 0 1px rgba(232,255,240,.035) !important;font-size:var(--kestrel-type-body) !important;
  line-height: 1.45 !important;
}
body .app-shell .studio-panel select { padding: 0 12px !important; }
body .app-shell .studio-panel input[type="text"],
body .app-shell .studio-panel input[type="url"],
body .app-shell .studio-panel input[type="number"] { padding: 9px 11px !important; }
body .app-shell .studio-panel select:hover,
body .app-shell .studio-panel input:hover,
body .app-shell .studio-panel textarea:hover { border-color: rgba(164,243,188,.3) !important; }
body .app-shell .studio-panel select:focus,
body .app-shell .studio-panel input:focus,
body .app-shell .studio-panel textarea:focus {
  border-color: var(--restrel-edge-strong) !important;
  box-shadow: 0 0 0 3px rgba(0,230,118,.09), inset 0 1px rgba(232,255,240,.05) !important;
  outline: 0 !important;
}
body .app-shell .studio-panel select option { background: #0d1711; color: var(--restrel-text); }

/* Model row and prompt editor. */
body .app-shell .studio-panel .model-row { gap: 12px !important; margin-bottom: 2px; }
body .app-shell .studio-panel .model-row { grid-template-columns: minmax(120px, .72fr) minmax(0, 1.28fr) !important; }
body .app-shell .studio-panel .model-row select { min-height: 43px !important; }
body .app-shell .studio-panel .model-meta { min-height: 18px; color: var(--restrel-muted) !important; font-size:var(--kestrel-type-meta) !important; }
body .app-shell .studio-panel .prompt-dock {
  margin-top: 16px !important;
  padding: 15px !important;
  border: 1px solid var(--restrel-edge) !important;
  border-radius: var(--restrel-radius) !important;
  background: linear-gradient(145deg, rgba(11, 25, 16, .84), rgba(4, 13, 8, .76)) !important;
  box-shadow: inset 0 1px rgba(230,255,240,.05) !important;
}
body .app-shell .studio-panel .prompt-dock:focus-within { border-color: var(--restrel-edge-strong) !important; box-shadow: 0 0 0 3px rgba(0,230,118,.08), inset 0 1px rgba(230,255,240,.08) !important; }
body .app-shell .studio-panel .prompt-dock textarea,
body .app-shell .studio-panel #prompt {
  min-height: 136px !important;
  margin-top: 3px !important;
  padding: 11px 0 16px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(190,235,208,.1) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #effaf2 !important;font-size:var(--kestrel-type-body) !important;line-height:var(--kestrel-leading-body) !important;
}
body .app-shell .studio-panel .prompt-dock textarea::placeholder,
body .app-shell .studio-panel input::placeholder { color: #607469 !important;font-size:var(--kestrel-type-body) !important;line-height:var(--kestrel-leading-body) !important;}
body .app-shell .studio-panel .prompt-dock-tip,
body .app-shell .studio-panel .asset-library-status,
body .app-shell .studio-panel .asset-library-mention-hint { color: var(--restrel-muted) !important; font-size:var(--kestrel-type-meta) !important; line-height: 1.55 !important; }
body .app-shell .studio-panel .asset-library-panel { margin-top: 13px !important; padding-top: 11px !important; border-top: 1px solid rgba(190,235,208,.1) !important; }
body .app-shell .studio-panel .asset-library-actions { gap: 7px !important; margin-top: 9px !important; }

/* All secondary controls use the same quiet outlined language. */
body .app-shell .studio-panel .asset-library-btn,
body .app-shell .studio-panel .mini-button,
body .app-shell .studio-panel .square-action,
body .app-shell .studio-panel .prompt-action-btn {
  min-height: 32px !important;
  padding: 0 10px !important;
  border: 1px solid var(--restrel-edge) !important;
  border-radius: 9px !important;
  background: rgba(9, 26, 16, .72) !important;
  color: #b6d5c1 !important;font-size:var(--kestrel-type-control) !important;
  font-weight:600 !important;
}
body .app-shell .studio-panel .asset-library-btn:hover,
body .app-shell .studio-panel .mini-button:hover,
body .app-shell .studio-panel .square-action:hover { border-color: var(--restrel-edge-strong) !important; background: rgba(0,230,118,.1) !important; color: #ddffea !important; }

/* Settings and media fields: each card has identical geometry. */
body .app-shell .studio-panel .schema-grid,
body .app-shell .studio-panel .prompt-settings-grid { gap: 10px !important; margin: 16px 0 !important; }
body .app-shell .studio-panel .schema-field {
  min-width: 0 !important;
  padding: 11px !important;
  border: 1px solid var(--restrel-edge) !important;
  border-radius: 11px !important;
  background: rgba(8, 22, 14, .62) !important;
}
body .app-shell .studio-panel .schema-field select { margin-top: 7px !important; min-height: 39px !important; }
body .app-shell .studio-panel .schema-field small,
body .app-shell .studio-panel .resolution-cost { color: var(--restrel-muted) !important; font-size:var(--kestrel-type-meta) !important; line-height: 1.5 !important; }
body .app-shell .studio-panel .media-box { margin-top: 6px !important; padding: 14px !important; border: 1px solid var(--restrel-edge) !important; border-radius: 14px !important; background: rgba(6, 18, 11, .54) !important; }
body .app-shell .studio-panel .media-title-row { margin-bottom: 7px !important; }
body .app-shell .studio-panel .ref-limit-hint { color: var(--restrel-muted) !important; font-size:var(--kestrel-type-meta) !important; line-height: 1.6 !important; }
body .app-shell .studio-panel .media-grid { gap: 10px !important; margin-top: 11px !important; }
body .app-shell .studio-panel .media-role {
  min-width: 0 !important;
  padding: 11px !important;
  border: 1px solid rgba(190,235,208,.12) !important;
  border-radius: 12px !important;
  background: rgba(10, 26, 17, .58) !important;
}
body .app-shell .studio-panel .media-role-head b { color: var(--restrel-text) !important;font-size:var(--kestrel-type-control) !important; font-weight: 700 !important;line-height:var(--kestrel-leading-control) !important;}
body .app-shell .studio-panel .role-count,
body .app-shell .studio-panel .media-role-hint { color: var(--restrel-muted) !important; font-size:var(--kestrel-type-meta) !important; }
body .app-shell .studio-panel .file-picker {
  min-height: 54px !important;
  border: 1px dashed rgba(142,238,177,.32) !important;
  border-radius: 9px !important;
  background: rgba(0,230,118,.035) !important;
}
body .app-shell .studio-panel .file-picker:hover { border-color: var(--restrel-edge-strong) !important; background: rgba(0,230,118,.08) !important; }
body .app-shell .studio-panel .file-picker span { color: #bce9cb !important; font-size:var(--kestrel-type-meta) !important; }
body .app-shell .studio-panel .file-picker em { color: var(--restrel-muted) !important; font-size:var(--kestrel-type-meta) !important; }
body .app-shell .studio-panel .media-role .url-row { gap: 6px !important; margin-top: 7px !important; }
body .app-shell .studio-panel .media-role .url-row input { min-height: 32px !important; font-size:var(--kestrel-type-meta) !important; }

/* First/last frame tools were the last legacy gold island. */
body .app-shell .studio-panel .frame-tools {
  display: grid !important;
  gap: 9px !important;
  margin-top: 10px !important;
  padding: 12px !important;
  border: 1px solid rgba(190,235,208,.13) !important;
  border-radius: 11px !important;
  background: linear-gradient(145deg, rgba(14,31,20,.82), rgba(6,16,10,.78)) !important;
}
body .app-shell .studio-panel .frame-tool-title { color: var(--restrel-text) !important;font-size:var(--kestrel-type-control) !important; font-weight:600 !important;line-height:var(--kestrel-leading-control) !important;}
body .app-shell .studio-panel .frame-model-row { gap: 8px !important; }
body .app-shell .studio-panel .frame-model-row select,
body .app-shell .studio-panel .frame-ratio-label select,
body .app-shell .studio-panel .frame-note { min-height: 36px !important; font-size:var(--kestrel-type-meta) !important; }
body .app-shell .studio-panel .frame-cost { color: var(--restrel-green-soft) !important; font-size:var(--kestrel-type-meta) !important; }
body .app-shell .studio-panel .frame-ratio-label { color: var(--restrel-copy) !important; font-size:var(--kestrel-type-meta) !important; }
body .app-shell .studio-panel .frame-note { padding: 8px 9px !important; }
body .app-shell .studio-panel .frame-generate-button {
  min-height: 38px !important;
  border: 1px solid rgba(0,230,118,.46) !important;
  border-radius: 9px !important;
  background: linear-gradient(180deg, rgba(0,230,118,.2), rgba(0,119,61,.22)) !important;
  color: #ddffea !important;font-size:var(--kestrel-type-control) !important;
  font-weight:600 !important;
  box-shadow: inset 0 1px rgba(212,255,226,.1) !important;
}
body .app-shell .studio-panel .frame-generate-button,
body .app-shell .inspector .task-redo-btn,
body .app-shell .inspector .result-actions a,
body .app-shell .studio-panel .generate-btn,
body .app-shell .studio-panel .image-studio-submit {
  font-family: var(--restrel-font) !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
}
body .app-shell .studio-panel .frame-generate-button { font-weight: 700 !important; }
body .app-shell .inspector .task-redo-btn {
  min-height: 38px !important;
  border: 1px solid var(--restrel-edge) !important;
  border-radius: 9px !important;
  background: rgba(9,26,16,.72) !important;
  color: #b6d5c1 !important;font-size:var(--kestrel-type-control) !important;
  font-weight: 700 !important;
}
body .app-shell .inspector .task-redo-btn:hover:not(:disabled) {
  border-color: var(--restrel-edge-strong) !important;
  background: rgba(0,230,118,.1) !important;
  color: #ddffea !important;
}
body .app-shell .studio-panel .frame-generate-button:hover:not(:disabled) { border-color: var(--restrel-green) !important; background: rgba(0,230,118,.25) !important; transform: translateY(-1px); }
body .app-shell .studio-panel .frame-generate-button:disabled { opacity: .55 !important; }
body .app-shell .studio-panel .frame-help { margin: 0 !important; color: var(--restrel-muted) !important; font-size:var(--kestrel-type-meta) !important; line-height: 1.55 !important; }
body .app-shell .studio-panel .frame-result { border-top: 1px solid rgba(190,235,208,.1) !important; }

/* Primary submit colors and geometry are owned by cockpit-theme.css. */
body .app-shell .studio-panel .task-status { margin-top: 11px !important; color: var(--restrel-copy) !important; font-size:var(--kestrel-type-meta) !important; line-height: 1.6 !important; }
body .app-shell .studio-panel .credit-freeze-hint { color: var(--restrel-muted) !important; font-size:var(--kestrel-type-meta) !important; line-height: 1.5 !important; }

/* Right rail keeps the same green/neutral hierarchy as the workspace. */
body .app-shell .inspector,
body .app-shell .inspector .task-card,
body .app-shell .inspector .result-card { font-family: var(--restrel-font) !important; }
body .app-shell .inspector .task-card,
body .app-shell .inspector .result-card { border-color: var(--restrel-edge) !important; background: rgba(9, 21, 14, .64) !important; border-radius: 13px !important; }
body .app-shell .inspector .task-badge { color: var(--restrel-green-soft) !important; background: rgba(0,230,118,.1) !important; border-color: rgba(0,230,118,.25) !important; }
body .app-shell .inspector .task-step.done > span,
body .app-shell .inspector .task-step.active > span { border-color: rgba(0,230,118,.5) !important; color: var(--restrel-green-soft) !important; }

@media (max-width: 860px) {
  body .app-shell.app-shell:not(.home-mode) .workspace-header { min-height: 68px !important; }
  body .app-shell.app-shell:not(.home-mode) > .workspace {
    display: flex !important;
    overflow: visible !important;
  }
  body .app-shell.app-shell:not(.home-mode) > .workspace > .workspace-scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }
  body .app-shell.app-shell:not(.home-mode) .workspace-scroll { padding: 0 0 30px !important; }
  body .app-shell.app-shell:not(.home-mode) .hero-card.studio-panel { padding: 14px !important; border-radius: 15px !important; }
  body .app-shell .studio-panel .schema-grid { grid-template-columns: 1fr 1fr !important; }
  body .app-shell .studio-panel .media-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 520px) {
  body .app-shell.app-shell > .platform-nav .platform-nav-brand { height: 72px !important; min-height: 72px !important; padding-bottom: 10px !important; }
  body .app-shell.app-shell > .platform-nav .platform-nav-brand .restrel-wordmark {width:168px !important; height: auto !important;transform:none !important;max-width:100% !important;}
  body .app-shell .workspace-header .settings-toggle { width: 36px !important; min-width: 36px !important; height: 32px !important; padding: 0 !important; overflow: hidden !important; font-size: 0 !important; }
  body .app-shell .workspace-header .settings-toggle::after { content: "⚙"; color: #b8d8c4; font-size: 14px; line-height: 1; }
  body .app-shell .workspace-header .new-project-action { min-width: 58px !important; padding: 0 8px !important; white-space: nowrap !important; font-size:var(--kestrel-type-meta) !important; }
  body .app-shell .studio-panel .schema-grid { grid-template-columns: 1fr !important; }
  body .app-shell .studio-panel .model-row { grid-template-columns: 1fr !important; }
  body .app-shell .studio-panel .model-row .square-action { display: none !important; }
}


/* Outfit flat lays: layout choice and role-specific uploads share the image-studio owner. */
.apparel-flatlay[hidden],#imageStudioAssets[hidden],#imageStudioAssetThumbs[hidden],.apparel-flatlay [hidden]{display:none!important}
.apparel-flatlay{margin-block:24px;color:var(--restrel-text)}
.apparel-flatlay fieldset{min-width:0;margin:0;padding:0;border:0}
.apparel-flatlay legend{padding:0;font-size:16px;font-weight:650}
.apparel-help{max-width:72ch;margin:8px 0 16px;color:var(--restrel-copy);font-size:13px;line-height:1.65}
.apparel-layouts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.apparel-layout{position:relative;display:grid;align-content:start;gap:7px;min-width:0;padding:9px;border:1px solid var(--restrel-edge);border-radius:12px;cursor:pointer;background:var(--restrel-panel-deep)}
.apparel-layout:hover{border-color:var(--restrel-copy)}
.apparel-layout.is-selected{border-color:var(--restrel-green);background:#10261a}
.apparel-layout:focus-within{outline:2px solid var(--restrel-green);outline-offset:3px}
.apparel-layout input{position:absolute;top:17px;left:17px;z-index:1;width:18px;height:18px;accent-color:var(--restrel-green);cursor:pointer}
.apparel-layout img{display:block;width:100%;height:auto;aspect-ratio:3/4;object-fit:contain;border-radius:6px;background:#17221b}
.apparel-layout strong{font-size:13px;line-height:1.5;color:var(--restrel-text);overflow-wrap:anywhere}
.apparel-layout small{font-size:12px;line-height:1.55;color:var(--restrel-copy)}
.apparel-selection{margin:12px 0 24px;color:var(--restrel-green-soft);font-size:13px}
.apparel-uploads{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 22px}
.apparel-upload{min-width:0;padding-block:4px 14px;border-bottom:1px solid var(--restrel-edge)}
.apparel-upload>strong{font-size:14px}
.apparel-upload-preview{display:flex;align-items:center;gap:12px;min-height:90px;margin-block:10px}
.apparel-upload-preview img{display:block;width:76px;height:90px;object-fit:contain;border-radius:6px;background:#17221b}
.apparel-upload-preview span{min-width:0;font-size:12px;line-height:1.6;color:var(--restrel-copy);overflow-wrap:anywhere}
.apparel-upload-actions{display:flex;flex-wrap:wrap;gap:8px}
.apparel-upload-actions button{min-height:44px;white-space:normal}
.apparel-flatlay button:focus-visible{outline:2px solid var(--restrel-green);outline-offset:3px}
@media(max-width:600px){.apparel-layouts{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.apparel-layout{padding:7px}.apparel-layout input{left:12px;top:12px}.apparel-uploads{gap:14px}.apparel-upload-preview{align-items:flex-start;flex-direction:column;gap:7px}.apparel-upload-preview img{width:100%;height:110px}.apparel-upload-actions{flex-direction:column}.apparel-upload-actions button{width:100%}}
/* Replica sound review uses the existing studio controls and keeps each line together. */
.replica-sound-review{margin-block:20px;min-width:0;overflow-wrap:anywhere}
.replica-sound-review[hidden]{display:none}
.replica-sound-review h3{margin:0 0 12px}
.replica-sound-review>p{margin:0 0 16px;line-height:1.7}
.replica-sound-review fieldset{min-width:0;margin:0 0 18px;padding:14px;border:1px solid var(--line-2);border-radius:12px}
.replica-sound-review legend{padding-inline:5px;font-weight:600}
.replica-sound-review fieldset>p{margin:0 0 14px;white-space:pre-wrap;line-height:1.7}
.replica-sound-review label{display:flex;flex-direction:column;gap:6px;margin-block:10px;font-size:14px;line-height:1.5}
.replica-sound-review :is(input,select){width:100%;min-width:0;min-height:44px;font-size:16px}
.replica-sound-timing{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
.replica-sound-review .replica-sound-confirm{flex-direction:row;align-items:flex-start;gap:10px;margin-block:20px}
.replica-sound-review .replica-sound-confirm input{flex:none;width:20px;min-height:20px;margin-top:2px;accent-color:var(--strong)}
.replica-sound-review button{min-height:44px;padding:10px 16px;font:inherit;cursor:pointer}
