:root {
  color-scheme: light;
  --ink: #171411;
  --muted: #716a62;
  --quiet: #a29a91;
  --black: #171411;
  --black-soft: #f3f0ea;
  --paper: #fffdfa;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(23, 20, 17, 0.05);
  --line: rgba(36, 30, 24, 0.13);
  --line-strong: rgba(36, 30, 24, 0.24);
  --brass: #9a7535;
  --wine: #6b2638;
  --green: #2f5a45;
  --blue: #225da8;
  --red: #b83333;
  --shadow: 0 18px 56px rgba(42, 34, 25, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.modal-open {
  overflow: hidden;
}

body[data-active-module="v3"]:not(.modal-open):not(.v3-page-loading-active) {
  overflow-y: auto;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 74% 8%, rgba(201, 161, 95, 0.16), transparent 34%),
    radial-gradient(circle at 10% 24%, rgba(107, 38, 56, 0.08), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #fbf8f2 46%, #f4efe6 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
textarea,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.lux-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
}

.global-toast {
  position: fixed;
  top: 82px;
  left: 50%;
  z-index: 40;
  max-width: min(520px, calc(100vw - 28px));
  transform: translateX(-50%);
  padding: 11px 16px;
  border: 1px solid rgba(47, 90, 69, 0.2);
  border-radius: 999px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 44px rgba(42, 34, 25, 0.14);
  backdrop-filter: blur(18px);
  font-size: 13px;
  font-weight: 700;
}

.global-toast.error {
  border-color: rgba(184, 51, 51, 0.2);
  color: var(--red);
}

.global-toast[hidden] {
  display: none;
}

.brand-lockup,
.header-status,
.hero-actions,
.composer-actions,
.panel-head,
.output-meta,
.check-row,
.provider-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(154, 117, 53, 0.46);
  border-radius: var(--radius);
  color: var(--brass);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.brand-home-link {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-home-link:hover .brand-mark {
  border-color: rgba(47, 90, 69, 0.34);
  color: var(--green);
  background: rgba(47, 90, 69, 0.06);
}

.brand-home-link:focus-visible,
.header-action-button:focus-visible {
  outline: 3px solid rgba(47, 90, 69, 0.18);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
}

h2 {
  max-width: 14ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 68px;
  line-height: 0.96;
  font-weight: 500;
}

h3 {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 650;
}

.eyebrow,
.metric-label,
.file-meta,
.micro-copy,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  text-transform: uppercase;
}

.module-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 20, 17, 0.04);
}

.tab {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.active {
  color: var(--paper);
  background: var(--ink);
}

.header-status {
  justify-content: flex-end;
  min-width: 0;
}

/* Provider and session diagnostics belong in the model settings, not the primary navigation. */
.header-status #providerState,
.header-status #sessionLabel {
  display: none;
}

.session-code {
  max-width: 170px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.surface-switch-link {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.surface-switch-link:hover {
  border-color: rgba(47, 90, 69, 0.32);
  background: rgba(47, 90, 69, 0.08);
}

.header-action-button {
  cursor: pointer;
}

.header-action-button.active {
  border-color: rgba(47, 90, 69, 0.28);
  color: var(--green);
  background: rgba(47, 90, 69, 0.1);
}

.admin-settings-link {
  border-color: rgba(154, 117, 53, 0.3);
  color: var(--brass);
  background: rgba(154, 117, 53, 0.08);
}

.admin-settings-link:hover {
  border-color: rgba(154, 117, 53, 0.48);
  background: rgba(154, 117, 53, 0.14);
}

.admin-settings-link[hidden] {
  display: none;
}

.state-pill,
.mini-pill {
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid rgba(154, 117, 53, 0.28);
  border-radius: 999px;
  color: var(--brass);
  background: rgba(154, 117, 53, 0.09);
  font-size: 12px;
  white-space: nowrap;
}

.homepage {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.hero-band {
  min-height: 348px;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(420px, 560px);
  gap: clamp(36px, 5vw, 78px);
  align-items: center;
  padding: 38px 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(247, 241, 231, 0.94)),
    var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 16px;
  max-width: 680px;
  padding: 8px 0;
}

.hero-line {
  max-width: 520px;
  color: #4d4740;
  font-size: 17px;
  line-height: 1.7;
}

.hero-actions {
  max-width: 560px;
  margin-top: 4px;
}

.hero-actions .button {
  min-width: 150px;
}

.hero-gallery-lane {
  width: min(100%, 512px);
  min-height: 286px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 228px));
  gap: 22px;
  align-items: center;
  justify-content: end;
  justify-self: end;
  border-left: 1px solid var(--line);
  padding-left: clamp(28px, 4vw, 54px);
}

.case-showcase {
  position: relative;
}

.hero-card {
  min-width: 0;
  width: 100%;
  max-width: 228px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.hero-card-head {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-card-head strong {
  color: var(--brass);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 500;
  text-transform: none;
}

.case-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  perspective: 1200px;
}

.case-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: end;
  overflow: hidden;
  border: 1px solid rgba(36, 30, 24, 0.13);
  border-radius: var(--radius);
  background: #f7f2ea;
  box-shadow: 0 18px 42px rgba(42, 34, 25, 0.14);
  opacity: 0;
  transform: translateX(22px) rotateY(-7deg) scale(0.96);
  animation: caseFade 20s infinite;
}

.case-slide:nth-child(2) {
  animation-delay: 5s;
}

.case-slide:nth-child(3) {
  animation-delay: 10s;
}

.case-slide:nth-child(4) {
  animation-delay: 15s;
}

.case-slide img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.case-slide::after {
  content: "";
  position: absolute;
  inset: 48% 0 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(23, 20, 17, 0.72));
}

.case-slide div {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 3px;
  padding: 14px;
  color: var(--paper);
}

.case-slide span,
.case-source {
  font-size: 12px;
  font-weight: 700;
}

.case-slide strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.case-source {
  color: var(--brass);
  text-decoration: none;
}

.synced-carousel .case-slide {
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px) rotateY(-4deg) scale(0.98);
  animation: none;
  transition: opacity 520ms ease, transform 620ms ease;
}

.synced-carousel .case-slide.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) rotateY(0deg) scale(1);
}

.history-carousel .case-slide {
  border: 1px solid rgba(36, 30, 24, 0.13);
  background: #f7f2ea;
  box-shadow: 0 22px 54px rgba(42, 34, 25, 0.2), 0 5px 16px rgba(42, 34, 25, 0.08);
  cursor: pointer;
}

.history-carousel {
  border-radius: var(--radius);
  box-shadow: 0 22px 54px rgba(42, 34, 25, 0.18), 0 5px 16px rgba(42, 34, 25, 0.07);
}

.history-carousel .case-slide img {
  filter: saturate(0.98) contrast(1.02);
}

.history-carousel .case-slide::after,
.history-carousel .case-slide div {
  display: none;
}

.empty-hero-history .case-slide {
  opacity: 1;
  animation: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(239, 232, 219, 0.74)),
    rgba(23, 20, 17, 0.04);
  transform: none;
}

.empty-hero-history .case-slide::after {
  display: none;
}

@keyframes caseFade {
  0%,
  20% {
    opacity: 1;
    transform: translateX(0) rotateY(0deg) scale(1);
  }
  25%,
  100% {
    opacity: 0;
    transform: translateX(-22px) rotateY(7deg) scale(0.96);
  }
}

.module-panel {
  margin-top: 18px;
}

.module-panel[hidden] {
  display: none;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 410px);
  gap: 18px;
  align-items: start;
}

.module-stack {
  display: grid;
  gap: 18px;
}

.mode-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(248, 244, 236, 0.68)),
    rgba(255, 255, 255, 0.62);
}

.mode-switch-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mode-switch-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
}

.mode-switch {
  width: min(252px, 100%);
  min-height: 42px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  flex: 0 0 min(252px, 38vw);
  padding: 4px;
  border-radius: 999px;
  cursor: pointer;
  isolation: isolate;
}

.mode-switch .segment {
  min-height: 34px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0;
}

.mode-switch .segment.active {
  color: #fffdf8;
  background: var(--sage-deep, var(--ink));
  box-shadow: 0 8px 18px rgba(24, 25, 21, 0.12);
}

.mode-switch .segment:not(.active):hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.mode-workspace[data-current-mode="simple"] [data-mode-area] {
  display: none !important;
}

.simple-mode-panel {
  border: 1px solid rgba(47, 90, 69, 0.18);
  border-radius: var(--radius);
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(247, 243, 235, 0.74)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.simple-mode-panel[hidden] {
  display: none !important;
}

.simple-mode-hero,
.simple-actions,
.simple-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.simple-mode-hero {
  justify-content: space-between;
  margin-bottom: 14px;
}

.simple-prompt-field {
  display: grid;
  gap: 8px;
}

.simple-prompt-field span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.simple-drop-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.18fr);
  gap: 12px;
  margin-top: 12px;
}

.simple-file-drop {
  min-height: 118px;
  align-content: center;
}

.simple-file-list {
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.simple-file-list.empty-simple-list {
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.simple-file-row {
  justify-content: space-between;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.simple-file-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-file-row span {
  flex: 0 0 auto;
  color: var(--muted);
}

.simple-notice {
  margin-top: 12px;
}

.simple-case-summary {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(47, 90, 69, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.simple-case-summary-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.simple-case-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.simple-case-summary strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.simple-case-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.simple-case-summary.matching {
  border-color: rgba(47, 90, 69, 0.28);
  background: rgba(247, 250, 244, 0.78);
}

.simple-case-summary.selected {
  border-color: rgba(47, 90, 69, 0.34);
  background: rgba(246, 250, 242, 0.9);
}

.simple-case-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.simple-case-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 8px;
  border: 1px solid rgba(47, 90, 69, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 11px;
  font-weight: 680;
}

.simple-actions {
  justify-content: flex-start;
  margin-top: 14px;
}

.flow-section {
  scroll-margin-top: 92px;
}

.section-title h3 {
  font-size: 22px;
}

.studio-panel,
.panel,
.gallery-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.studio-panel,
.panel,
.gallery-wrap {
  padding: 18px;
}

.settings-rail {
  display: grid;
  gap: 14px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

textarea,
input[type="text"],
input[type="password"],
input[type="url"],
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
}

textarea {
  min-height: 156px;
  resize: vertical;
  line-height: 1.55;
}

textarea::placeholder,
input::placeholder {
  color: #9c948b;
}

textarea:focus,
input:focus,
select:focus,
.segment:focus-visible,
.button:focus-visible,
.tab:focus-visible,
.output-preview:focus-visible {
  outline: 3px solid rgba(201, 161, 95, 0.24);
  outline-offset: 2px;
  border-color: rgba(154, 117, 53, 0.48);
}

.notice-bar {
  min-height: 42px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(34, 93, 168, 0.18);
  border-radius: var(--radius);
  color: var(--blue);
  background: rgba(34, 93, 168, 0.06);
  font-size: 13px;
  line-height: 1.45;
}

.notice-bar.success {
  border-color: rgba(47, 90, 69, 0.18);
  color: var(--green);
  background: rgba(47, 90, 69, 0.07);
}

.notice-bar.warning {
  border-color: rgba(154, 117, 53, 0.24);
  color: var(--brass);
  background: rgba(154, 117, 53, 0.08);
}

.notice-bar.error {
  border-color: rgba(184, 51, 51, 0.2);
  color: var(--red);
  background: rgba(184, 51, 51, 0.07);
}

.run-progress-panel,
.v2-progress-panel {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(34, 93, 168, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
}

.run-progress-panel[hidden],
.v2-progress-panel[hidden] {
  display: none !important;
}

.simple-run-progress {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.v1-progress-panel {
  border-color: rgba(47, 90, 69, 0.18);
}

.run-progress-head,
.v2-progress-head,
.run-progress-steps,
.v2-progress-steps {
  display: flex;
  align-items: center;
  gap: 8px;
}

.run-progress-head,
.v2-progress-head {
  justify-content: space-between;
}

.run-progress-head strong,
.v2-progress-head strong {
  color: var(--ink);
  font-size: 13px;
}

.run-progress-head span,
.run-progress-detail,
.v2-progress-head span,
.v2-progress-detail {
  color: var(--muted);
  font-size: 12px;
}

.run-progress-meter,
.v2-progress-meter {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 20, 17, 0.08);
}

.run-progress-meter span,
.v2-progress-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green), var(--brass));
  transition: width 300ms ease;
}

.v1-progress-panel .run-progress-meter span,
.simple-run-progress .run-progress-meter span {
  background: linear-gradient(90deg, var(--green), var(--blue), var(--brass));
}

.run-progress-steps,
.v2-progress-steps {
  flex-wrap: wrap;
  margin-top: 10px;
}

.run-progress-step,
.v2-progress-step {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 750;
}

.run-progress-step.done,
.v2-progress-step.done {
  border-color: rgba(47, 90, 69, 0.2);
  color: var(--green);
  background: rgba(47, 90, 69, 0.07);
}

.run-progress-step.active,
.v2-progress-step.active {
  border-color: rgba(34, 93, 168, 0.24);
  color: var(--blue);
  background: rgba(34, 93, 168, 0.08);
}

.run-progress-step.failed,
.v2-progress-step.failed {
  border-color: rgba(184, 51, 51, 0.22);
  color: var(--red);
  background: rgba(184, 51, 51, 0.07);
}

.run-progress-detail,
.v2-progress-detail {
  margin: 10px 0 0;
  line-height: 1.45;
}

.composer-actions {
  justify-content: space-between;
  margin-top: 14px;
}

.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease, border-color 140ms ease;
}

.button:active {
  transform: scale(0.98);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary {
  color: var(--paper);
  background: var(--ink);
}

.secondary,
.compact,
.ghost {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.76);
}

.ghost {
  color: var(--brass);
}

.compact {
  min-height: 34px;
  padding: 0 13px;
  font-size: 12px;
}

.full-width {
  width: 100%;
  margin-top: 10px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.status-strip > div {
  min-height: 70px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.58);
}

.status-strip strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-id-details {
  min-width: 0;
}

.status-id-details summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}

.status-id-details strong {
  display: block;
  margin-top: 5px;
}

.provider-list,
.event-list,
.form-grid {
  display: grid;
  gap: 10px;
}

.model-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.provider-list {
  margin-bottom: 14px;
}

.tuning-grid,
.model-api-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
}

.model-workbench-grid,
.advanced-api-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.model-switch-card,
.api-subpanel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.model-help {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.model-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.model-option {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  text-align: left;
}

.model-option span,
.model-option small {
  color: var(--muted);
  font-size: 12px;
}

.model-option strong {
  font-size: 17px;
}

.model-option.active {
  border-color: rgba(154, 117, 53, 0.58);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(154, 117, 53, 0.11));
  box-shadow: 0 0 0 3px rgba(154, 117, 53, 0.08);
}

.model-option:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.model-option.temporarily-disabled {
  cursor: not-allowed;
  filter: grayscale(0.38);
  opacity: 0.5;
}

.v2-single-model {
  grid-template-columns: 1fr;
}

.v2-single-model .model-option:disabled {
  cursor: default;
  opacity: 1;
}

.v2-single-model .model-option.temporarily-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.v2-model-card-grid {
  margin-top: 14px;
}

.v2-provider-area .v2-model-panel {
  margin-top: 14px;
}

.advanced-api-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.44);
}

.advanced-api-panel summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 750;
}

.advanced-api-panel summary small {
  color: var(--muted);
  font-weight: 500;
}

.advanced-api-grid {
  padding: 0 14px 14px;
}

.api-subpanel h4 {
  margin-bottom: 2px;
}

.compact-provider-list {
  margin: 4px 0 0;
}

.tuning-card {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 360px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.params-card,
.material-card {
  height: 100%;
}

.material-card {
  grid-template-rows: auto 128px auto auto;
  gap: 10px;
}

h4 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.api-controls {
  display: grid;
  align-content: start;
}

.provider-row,
.event-row {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.provider-row.ready {
  border-color: rgba(47, 90, 69, 0.2);
}

.muted-row {
  opacity: 0.78;
}

.provider-row.temporarily-disabled {
  filter: grayscale(0.28);
  opacity: 0.66;
}

.provider-title {
  justify-content: space-between;
}

.provider-models,
.provider-row p,
.event-row span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.control-block {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.control-block span {
  display: flex;
  justify-content: space-between;
  color: var(--ink);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brass);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 20, 17, 0.04);
}

.segmented.intensity {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segmented.quality {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segmented.v2-transform-segmented {
  width: 188px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  flex: 0 0 188px;
}

.v2-transform-control {
  position: relative;
  gap: 8px;
  isolation: isolate;
}

.v2-transform-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.v2-transform-label {
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.v2-transform-state {
  color: var(--sage-deep);
  font-weight: 760;
}

.v2-transform-state[hidden] {
  display: none !important;
}

.v2-transform-hint {
  color: var(--muted);
  line-height: 1.45;
}

.v2-aspect-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v2-transform-segmented .segment {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding-inline: 0;
  white-space: nowrap;
  pointer-events: auto;
}

.v2-transform-segmented .segment[data-tooltip]:hover::after,
.v2-transform-segmented .segment[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: min(260px, 78vw);
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 252, 246, 0.98);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  transform: translateX(-50%);
}

.segment {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}

.segment.active {
  color: var(--paper);
  background: var(--ink);
}

.file-drop {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px dashed rgba(154, 117, 53, 0.34);
  border-radius: var(--radius);
  background: rgba(154, 117, 53, 0.05);
  cursor: pointer;
}

.asset-preview {
  min-height: 128px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(154, 117, 53, 0.18);
  border-radius: var(--radius);
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(248, 242, 232, 0.78)),
    rgba(154, 117, 53, 0.06);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-color: rgba(255, 253, 248, 0.92);
  font-size: 13px;
  text-align: center;
}

.asset-preview:not(.empty-asset-preview):not(.document-preview) {
  background-size: contain;
}

.asset-preview.document-preview {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(239, 232, 219, 0.72)),
    rgba(23, 20, 17, 0.04);
}

.asset-preview span {
  max-width: 80%;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.86);
  overflow-wrap: anywhere;
}

.file-drop input {
  display: none;
}

.file-title {
  font-size: 14px;
  font-weight: 700;
}

.check-row {
  justify-content: flex-start;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.advanced-asset-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.advanced-asset-panel[hidden],
.advanced-conditional-field[hidden] {
  display: none;
}

.advanced-role-checks {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 8px;
}

.role-check {
  min-width: 0;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.role-check input {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  accent-color: var(--ink);
}

.role-check span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-check:has(input:checked) {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(23, 20, 17, 0.06);
}

.advanced-strength {
  margin-top: 0;
}

#assetIntentNotesInput {
  min-height: 38px;
  height: 38px;
  max-height: 38px;
  resize: none;
  overflow-y: auto;
  padding: 9px 10px;
  line-height: 1.4;
  scrollbar-color: rgba(154, 117, 53, 0.54) rgba(23, 20, 17, 0.06);
}

.advanced-asset-panel > .field:last-child {
  grid-column: 1 / -1;
}

.gallery-wrap,
.lower-grid {
  margin-top: 18px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.history-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gallery.empty-gallery {
  min-height: 230px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(154, 117, 53, 0.26);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
}

.gallery.empty-gallery::before {
  content: "生成结果将在这里展示";
  color: var(--muted);
  font-size: 13px;
}

.gallery.loading {
  opacity: 0.74;
}

.skeleton-card {
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.35), rgba(154, 117, 53, 0.12), rgba(255, 255, 255, 0.35)),
    rgba(23, 20, 17, 0.04);
  background-size: 240px 100%;
  animation: shimmer 1.1s infinite linear;
}

@keyframes shimmer {
  from {
    background-position: -240px 0;
  }
  to {
    background-position: 240px 0;
  }
}

.output-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
}

.output-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 0;
  cursor: pointer;
  overflow: hidden;
  background: var(--black-soft);
}

.output-preview::after {
  content: attr(data-label);
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  min-height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #111;
  background: rgba(255, 253, 250, 0.9);
  font-size: 12px;
  font-weight: 750;
}

.output-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.output-card.selected {
  border-color: rgba(154, 117, 53, 0.72);
  box-shadow: 0 0 0 3px rgba(154, 117, 53, 0.14);
}

.history-gallery {
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  scrollbar-color: rgba(154, 117, 53, 0.54) rgba(23, 20, 17, 0.06);
}

.history-gallery.empty-history {
  min-height: 180px;
  max-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(154, 117, 53, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.history-gallery.empty-history::before {
  content: "历史图片会在生成后出现在这里";
  color: var(--muted);
  font-size: 13px;
}

.history-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(250, 248, 243, 0.72));
}

.history-card .output-preview {
  aspect-ratio: 1 / 1;
}

.history-card.readonly .output-preview::after {
  background: rgba(255, 253, 250, 0.78);
  color: var(--muted);
}

.history-meta {
  display: grid;
  gap: 6px;
  padding: 11px 11px 0;
}

.history-prompt {
  min-height: 38px;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-detail {
  color: var(--muted);
  font-size: 11px;
}

.output-meta {
  justify-content: space-between;
  padding: 10px 11px;
  font-size: 12px;
}

.output-id {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output-provider {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output-diagnostics {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.output-diagnostics summary {
  cursor: pointer;
  white-space: nowrap;
}

.output-diagnostics .output-id {
  display: block;
  max-width: 100%;
  margin-top: 5px;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: 10px;
}

.download-link {
  color: var(--brass);
  text-decoration: none;
  font-weight: 750;
}

.history-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.history-load-more {
  min-height: 170px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 16px;
  border: 1px dashed rgba(154, 117, 53, 0.28);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
  font-size: 12px;
}

.delete-link {
  padding: 0;
  border: 0;
  color: var(--red);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.delete-link:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
}

.revision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.revision-selected-card {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(154, 117, 53, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.revision-selected-card.is-empty {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.42);
}

.revision-selected-preview {
  width: 74px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(23, 20, 17, 0.08);
  font-size: 12px;
  font-weight: 750;
}

.revision-selected-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.revision-selected-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.revision-selected-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.revision-selected-copy strong,
.revision-selected-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revision-selected-copy strong {
  color: var(--ink);
  font-size: 14px;
}

.revision-selected-copy small {
  color: var(--muted);
  font-size: 12px;
}

.revision-selected-card.is-empty .revision-selected-copy strong {
  color: var(--muted);
}

.revision-selected-card .button {
  min-width: 72px;
}

.revision-grid .button {
  min-width: 156px;
}

.event-list {
  max-height: 210px;
  overflow: auto;
}

.v2-workbench {
  align-items: stretch;
}

.v2-case-area {
  border-color: rgba(34, 93, 168, 0.16);
}

.v2-agent-area {
  border-color: rgba(47, 90, 69, 0.18);
}

.v2-status-actions,
.v2-sync-actions,
.v2-filter-row,
.v2-tag-row,
.v2-facet-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.v2-status-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.v2-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.v2-status-tile {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.v2-status-tile strong,
.v2-case-row strong,
.v2-output-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-status-tile small,
.v2-template-card p,
.v2-case-row span,
.v2-output-meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v2-sync-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.v2-auto-sync-copy {
  justify-content: flex-start;
  padding: 10px 12px;
  border: 1px solid rgba(47, 90, 69, 0.16);
  border-radius: var(--radius);
  color: var(--green);
  background: rgba(47, 90, 69, 0.06);
  font-size: 12px;
  line-height: 1.45;
}

.v2-model-panel {
  margin-top: 14px;
}

.v2-model-control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 14px 14px;
  align-items: end;
}

.v2-model-control-grid .button {
  min-height: 46px;
}

.v2-filter-row {
  align-items: end;
  margin-bottom: 14px;
}

.v2-filter-row .field {
  flex: 1;
}

.v2-search-thinking {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -2px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(34, 93, 168, 0.18);
  border-radius: var(--radius);
  color: var(--blue);
  background: rgba(34, 93, 168, 0.06);
  font-size: 12px;
}

.v2-search-thinking[hidden] {
  display: none;
}

.v2-search-thinking strong {
  color: var(--ink);
  font-size: 13px;
}

.v2-search-thinking small {
  color: var(--muted);
}

.thinking-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(34, 93, 168, 0.18);
  border-top-color: var(--blue);
  border-radius: 999px;
  animation: spinThinking 850ms linear infinite;
}

@keyframes spinThinking {
  to {
    transform: rotate(360deg);
  }
}

.v2-facet-bar {
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.v2-facet {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.v2-facet.active {
  color: var(--paper);
  border-color: var(--ink);
  background: var(--ink);
}

.v2-template-grid {
  height: clamp(460px, 64vh, 720px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  align-content: start;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1px 6px 1px 1px;
  scrollbar-gutter: stable;
}

.v2-template-card {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
}

.v2-template-card.selected {
  border-color: rgba(154, 117, 53, 0.72);
  box-shadow: 0 0 0 3px rgba(154, 117, 53, 0.12);
}

.v2-template-preview {
  width: 100%;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(23, 20, 17, 0.05);
  cursor: zoom-in;
  font-size: 12px;
  font-weight: 750;
}

button.v2-template-preview {
  padding: 0;
}

.v2-template-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.v2-template-body {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(22px, auto) auto;
  align-content: start;
  gap: 10px;
}

.v2-template-card p {
  min-height: 50px;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.v2-template-card .button {
  justify-self: start;
}

.v2-template-load-more {
  min-height: 160px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 16px;
  border: 1px dashed rgba(154, 117, 53, 0.28);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
  font-size: 12px;
}

.v2-template-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.v2-template-head strong {
  line-height: 1.35;
}

.v2-tag-row {
  flex-wrap: wrap;
}

.v2-tag-row span {
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(23, 20, 17, 0.06);
  font-size: 11px;
  font-weight: 700;
}

.v2-run-grid,
.v2-output-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 16px;
  align-items: stretch;
}

.v2-output-layout {
  grid-template-columns: minmax(200px, 0.7fr) minmax(240px, 0.85fr) minmax(320px, 1fr) minmax(220px, 0.75fr);
}

.v2-composer,
.v2-side-controls,
.v2-output-layout > div {
  min-width: 0;
}

.v2-composer {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.v2-prompt-field {
  color: var(--ink);
}

.v2-prompt-field textarea {
  min-height: 170px;
}

.v2-side-controls {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.v2-side-controls .control-block {
  margin-top: 0;
}

.v2-asset-panel {
  grid-column: 1 / -1;
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  grid-template-areas:
    "head head"
    "preview file"
    "preview roles"
    "preview controls"
    "list list"
    "hint hint";
  gap: 10px 14px;
  margin-top: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.v2-asset-panel > * {
  min-width: 0;
}

.v2-asset-panel .mini-head {
  grid-area: head;
  align-self: center;
  min-width: 0;
}

.v2-asset-head {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.v2-asset-head-actions {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.v2-asset-panel button,
.v2-asset-panel input,
.v2-asset-panel label,
.v2-asset-panel select,
.v2-asset-panel textarea {
  position: relative;
  z-index: 1;
}

.v2-asset-preview {
  grid-area: preview;
  min-height: 0;
  width: 100%;
  height: 100%;
  min-height: 256px;
  aspect-ratio: auto;
}

.v2-file-drop {
  grid-area: file;
  align-self: start;
  width: 100%;
  min-height: 78px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  padding: 13px 14px;
  border-style: solid;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(250, 242, 226, 0.68)),
    rgba(255, 255, 255, 0.66);
}

.v2-file-drop .file-title {
  width: auto;
  min-width: 0;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 16px;
  border: 1px solid rgba(180, 144, 78, 0.36);
  border-radius: 999px;
  color: #21180d;
  background: linear-gradient(180deg, #fff1ca 0%, #d4aa5c 100%);
  box-shadow: 0 8px 18px rgba(180, 144, 78, 0.16);
  font-weight: 750;
  white-space: normal;
}

.v2-file-drop .file-meta {
  display: none;
}

.v2-asset-role-checks {
  grid-area: roles;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.v2-asset-role-checks .role-check {
  min-height: 30px;
  justify-content: center;
  padding: 5px 8px;
  white-space: nowrap;
}

.v2-asset-mini-grid {
  grid-area: controls;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 8px;
  align-items: start;
  width: 100%;
}

.v2-asset-mini-grid .field {
  min-width: 0;
}

.v2-asset-mini-grid .field > span {
  display: block;
  white-space: normal;
}

#v2AssetNotesInput {
  min-height: 38px;
  height: 38px;
  max-height: 38px;
  resize: none;
  overflow-y: auto;
  padding: 9px 10px;
  line-height: 1.4;
}

.v2-asset-list {
  grid-area: list;
  display: grid;
  gap: 6px;
}

#v2ClearAssetBtn {
  flex: 0 0 auto;
  align-self: center;
  justify-self: end;
  min-width: 112px;
  white-space: nowrap;
}

#v2AssetLockHint {
  grid-area: hint;
  align-self: center;
  justify-self: start;
  margin: 0;
  text-align: left;
  max-width: 520px;
}

.v2-asset-list.empty-v2-list {
  min-height: 36px;
  padding: 8px 10px;
}

.v2-asset-list.empty-v2-list::before {
  content: none;
}

.v2-asset-row {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.v2-asset-row strong,
.v2-asset-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-asset-row strong {
  color: var(--ink);
  font-size: 12px;
}

.v2-asset-row span {
  color: var(--muted);
  font-size: 11px;
}

.v2-template-vars {
  display: grid;
  gap: 10px;
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.v2-template-vars summary {
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.v2-template-vars:not([open]) {
  gap: 0;
}

.v2-case-list,
.v2-brain-panel,
.v2-output-grid {
  min-height: 180px;
  display: grid;
  gap: 10px;
}

.v2-case-row,
.v2-brain-row,
.v2-output-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
}

.v2-brain-panel {
  align-content: start;
}

.v2-brain-row strong {
  color: var(--ink);
  font-size: 12px;
}

.v2-brain-row span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.v2-brain-row.status-ok {
  border-color: rgba(67, 135, 105, 0.32);
}

.v2-brain-row.status-warn {
  border-color: rgba(154, 117, 53, 0.38);
}

.v2-brain-row.status-error {
  border-color: rgba(156, 68, 68, 0.38);
}

.v2-prompt-plan {
  min-height: 240px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #2e2a25;
  background: rgba(255, 255, 255, 0.64);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.v2-output-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.v2-history-grid {
  min-height: 180px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  scrollbar-color: rgba(154, 117, 53, 0.54) rgba(23, 20, 17, 0.06);
}

.account-module {
  gap: 18px;
}

body.account-center-open {
  overflow: hidden;
}

.account-center-overlay {
  --account-block-gutter: clamp(14px, 3vh, 36px);
  position: fixed;
  inset: 0;
  z-index: 120;
  margin: 0;
  padding: var(--account-block-gutter) clamp(14px, 4vw, 64px);
  overflow: auto;
  background: rgba(31, 30, 26, 0.34);
  backdrop-filter: blur(12px);
}

.account-center-backdrop {
  position: absolute;
  inset: 0;
}

.account-center-dialog {
  position: relative;
  z-index: 1;
  width: min(1080px, 100%);
  max-height: min(880px, calc(100dvh - 2 * var(--account-block-gutter)));
  min-height: min(610px, calc(100dvh - 2 * var(--account-block-gutter)));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 253, 247, 0.72);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 0 26px 80px rgba(25, 24, 20, 0.2);
}

.account-center-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px clamp(16px, 3vw, 28px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 252, 0.96), rgba(247, 243, 232, 0.74));
}

.account-center-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 650;
}

.account-center-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px clamp(16px, 3vw, 28px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 252, 0.9);
}

.account-center-nav-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.account-center-nav-button:hover,
.account-center-nav-button.active {
  color: var(--sage-deep);
  border-bottom-color: var(--sage);
}

.account-center-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px clamp(16px, 3vw, 28px) 24px;
}

.account-center-view[hidden] {
  display: none;
}

.account-data-notice {
  margin: 8px clamp(16px, 3vw, 28px) 0;
  padding: 10px 13px;
  border: 1px solid rgba(154, 117, 53, 0.34);
  border-radius: 10px;
  color: #795d2e;
  background: rgba(244, 231, 194, 0.56);
  font-size: 13px;
  line-height: 1.5;
}

.account-access-panel {
  display: grid;
  gap: 16px;
}

.account-access-hero,
.account-access-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.account-access-hero {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(241, 237, 222, 0.92), rgba(255, 255, 252, 0.86));
}

.account-access-hero h3 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 22px;
}

.account-access-hero p:not(.eyebrow),
.account-access-card-head p,
.account-access-explain span,
.account-access-dialog > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.account-access-explain {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-access-explain article {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 252, 0.62);
}

.account-access-endpoint {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 16px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 243, 232, 0.48);
}

.account-access-endpoint > div:first-child {
  display: grid;
  gap: 4px;
}

.account-access-endpoint strong {
  color: var(--ink);
  font-size: 14px;
}

.account-access-endpoint span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-access-endpoint-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.account-access-endpoint-actions input {
  min-width: 0;
  flex: 1;
  color: var(--muted);
  font-size: 12px;
}

.account-access-explain strong,
.account-access-card h4 {
  color: var(--ink);
  font-size: 15px;
}

.account-access-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 252, 0.72);
}

.account-access-card-head {
  align-items: center;
}

.account-access-create-form {
  display: flex;
  align-items: end;
  gap: 12px;
}

.account-access-create-form .field {
  flex: 1;
}

.account-access-key-list {
  display: grid;
  gap: 10px;
}

.account-access-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(247, 243, 232, 0.54);
}

.account-access-key-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.account-access-key-info p,
.account-access-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-access-key-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-access-key-title strong {
  color: var(--ink);
}

.account-access-key-info code {
  width: fit-content;
  color: var(--sage-deep);
  font-size: 12px;
}

.account-access-dialog {
  width: min(680px, calc(100vw - 30px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 72px rgba(25, 24, 20, 0.22);
}

.account-access-dialog::backdrop {
  background: rgba(31, 30, 26, 0.42);
  backdrop-filter: blur(8px);
}

.account-access-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.account-access-dialog h3 {
  margin-top: 4px;
  font-size: 22px;
}

.account-access-secret,
.account-access-manual-copy {
  width: 100%;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(247, 243, 232, 0.72);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.account-access-secret {
  min-height: 42px;
}

.account-access-manual-copy {
  min-height: 150px;
  resize: vertical;
  white-space: pre-wrap;
}

.account-access-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-access-feedback {
  min-height: 20px;
  margin: 8px 0;
  color: var(--sage-deep);
  font-size: 12px;
}

.veyra-account-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 252, 0.88), rgba(247, 243, 232, 0.72)),
    var(--panel);
}

.account-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.account-kpi {
  min-height: 132px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 252, 0.68);
}

.account-kpi span,
.account-kpi small,
.account-usage-row span,
.account-history-meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-kpi strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: clamp(19px, 2.4vw, 30px);
  line-height: 1.1;
  font-weight: 500;
}

.balance-kpi strong {
  color: var(--sage-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.6vw, 48px);
}

.billing-module {
  gap: 18px;
}

.billing-console-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 252, 0.9), rgba(247, 243, 232, 0.72)),
    var(--panel);
}

.billing-console-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(340px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.billing-settings-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 252, 0.68);
}

.retention-settings-form {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 252, 0.68);
}

.billing-toggle-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.billing-toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--sage);
}

.billing-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.billing-admin-page {
  max-width: 1120px;
}

.billing-admin-title {
  min-width: min(520px, 100%);
}

.billing-rule-list {
  display: grid;
  gap: 16px;
}

.billing-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.billing-rule-card {
  min-height: 230px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 252, 0.72);
}

.billing-rule-card h3 {
  margin-top: 4px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 252, 0.58);
}

.account-record-section {
  overflow: hidden;
}

.account-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.account-history-card {
  display: grid;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 252, 0.72);
}

.account-live-preview,
.account-mock-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(23, 20, 17, 0.06);
}

.account-live-preview {
  cursor: pointer;
}

.account-live-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.account-mock-preview {
  color: var(--sage-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
}

.account-history-meta {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.account-history-meta strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.account-template-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.account-template-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 252, 0.72);
}

.account-template-preview {
  width: 84px;
  min-height: 112px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  color: var(--sage-deep);
  background: rgba(23, 20, 17, 0.06);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

button.account-template-preview {
  cursor: pointer;
}

.account-template-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.account-template-meta {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
}

.account-template-meta strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.account-template-meta p {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.account-template-meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.account-usage-list {
  display: grid;
  gap: 10px;
}

.account-usage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 252, 0.7);
}

.account-usage-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.account-usage-row div:last-child {
  justify-items: end;
  text-align: right;
}

.account-usage-row strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}

.account-empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 252, 0.46);
  text-align: center;
}

.account-empty-state p {
  margin: 0;
}

.v2-mock-preview,
.v2-live-preview {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
}

.v2-mock-preview {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(154, 117, 53, 0.34);
  color: var(--brass);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(248, 242, 232, 0.78)),
    rgba(23, 20, 17, 0.04);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
}

.v2-live-preview {
  display: block;
  border: 1px solid var(--line);
  background: var(--black-soft);
}

button.v2-live-preview {
  width: 100%;
  padding: 0;
  cursor: pointer;
}

button.v2-live-preview:focus-visible {
  outline: 3px solid rgba(201, 161, 95, 0.36);
  outline-offset: 2px;
}

.v2-live-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.v2-output-meta {
  display: grid;
  gap: 3px;
}

.v2-output-badge {
  width: max-content;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.v2-output-badge.live {
  color: var(--green);
  background: rgba(47, 90, 69, 0.1);
}

.v2-output-badge.mock {
  color: var(--brass);
  background: rgba(154, 117, 53, 0.1);
}

.v2-output-badge.unknown {
  color: var(--muted);
  background: rgba(23, 20, 17, 0.06);
}

.v2-output-error {
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(184, 51, 51, 0.18);
  border-radius: var(--radius);
  color: var(--red);
  background: rgba(184, 51, 51, 0.06);
  font-size: 12px;
  line-height: 1.5;
}

.v2-history-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
}

.v2-history-card .v2-live-preview,
.v2-history-card .v2-mock-preview {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.v2-history-meta {
  display: grid;
  gap: 5px;
  padding: 10px;
}

.v2-history-meta strong {
  min-height: 38px;
  overflow: hidden;
  display: -webkit-box;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.v2-history-meta span {
  color: var(--muted);
  font-size: 11px;
}

.v2-history-footer {
  border-top: 1px solid var(--line);
}

.v2-history-note {
  min-height: 72px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px dashed rgba(154, 117, 53, 0.26);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.empty-v2-list {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(154, 117, 53, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.42);
}

.empty-v2-list:empty::before {
  content: "等待数据";
  color: var(--muted);
  font-size: 13px;
}

.empty-v2-list.has-empty-message::before {
  content: none;
}

.empty-v2-message {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.v2-template-grid:not(.empty-v2-list)::before,
.v2-case-list:not(.empty-v2-list)::before,
.v2-output-grid:not(.empty-v2-list)::before {
  content: none;
}

.v2-template-grid.empty-v2-list {
  height: 220px;
  overflow: hidden;
}

.sample-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 20, 17, 0.34);
  backdrop-filter: blur(12px);
}

.sample-modal[hidden] {
  display: none;
}

.sample-dialog {
  position: relative;
  width: min(940px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 242, 232, 0.96)),
    var(--paper);
  box-shadow: 0 30px 90px rgba(42, 34, 25, 0.24);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.sample-hero {
  display: grid;
  gap: 12px;
  padding-right: 48px;
}

.sample-hero h2 {
  max-width: 14ch;
  font-size: 52px;
}

.sample-hero p:last-child {
  max-width: 520px;
  color: #4d4740;
  line-height: 1.7;
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.sample-card {
  min-height: 168px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
}

.sample-step {
  color: var(--brass);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.sample-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.sample-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 0;
  background: transparent;
  color: inherit;
}

.image-lightbox[hidden] {
  display: none;
}

.image-lightbox::backdrop {
  background: transparent;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 20, 17, 0.58);
  backdrop-filter: blur(14px);
}

.lightbox-panel {
  position: relative;
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.96);
  box-shadow: 0 36px 110px rgba(23, 20, 17, 0.34);
}

.lightbox-head,
.lightbox-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.lightbox-action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 16px;
}

.lightbox-action-bar[hidden] {
  display: none;
}

.lightbox-action-bar .button {
  min-width: 96px;
}

.lightbox-danger-action {
  color: var(--red);
}

.lightbox-head {
  padding-right: 68px;
}

.lightbox-close {
  z-index: 8;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(23, 20, 17, 0.16);
}

.lightbox-close:hover {
  border-color: rgba(154, 117, 53, 0.42);
  background: #fff;
}

.lightbox-close:focus-visible {
  outline: 3px solid rgba(154, 117, 53, 0.28);
  outline-offset: 2px;
}

.prompt-trigger {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.prompt-trigger span {
  color: var(--brass);
  font-size: 12px;
  font-weight: 750;
}

.prompt-trigger small {
  max-width: min(720px, calc(100vw - 180px));
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-trigger:disabled {
  cursor: default;
  opacity: 0.56;
}

.lightbox-stage {
  min-height: 240px;
  display: grid;
  place-items: center;
  overflow: auto;
  background:
    linear-gradient(45deg, rgba(154, 117, 53, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(154, 117, 53, 0.06) 25%, transparent 25%),
    #f8f6f1;
  background-position: 0 0, 0 12px;
  background-size: 24px 24px;
}

.lightbox-stage.zoomed {
  place-items: start center;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: calc(100vh - 188px);
  display: block;
  cursor: zoom-in;
  object-fit: contain;
}

.lightbox-stage img.zoomed {
  width: min(1480px, 180vw);
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.lightbox-prompt-panel {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 124px;
  z-index: 3;
}

.lightbox-prompt-panel[hidden] {
  display: none;
}

.prompt-card {
  max-height: min(520px, calc(100vh - 180px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.76);
  box-shadow: 0 24px 70px rgba(23, 20, 17, 0.22);
  backdrop-filter: blur(18px);
}

.prompt-card-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--brass);
  font-size: 12px;
  font-weight: 750;
}

.prompt-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.prompt-copy-btn {
  color: var(--brass);
}

.prompt-copy-btn.copied {
  color: var(--green);
}

.prompt-scroll-box {
  min-height: 0;
  max-height: min(460px, calc(100vh - 238px));
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  color: #2e2a25;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  user-select: text;
  scrollbar-color: rgba(154, 117, 53, 0.54) rgba(23, 20, 17, 0.06);
}

.prompt-scroll-box:focus {
  outline: 3px solid rgba(201, 161, 95, 0.24);
  outline-offset: -3px;
}

.wechat-share-guide {
  position: fixed;
  z-index: 130;
  top: calc(18px + env(safe-area-inset-top));
  right: 18px;
  max-width: min(320px, calc(100vw - 32px));
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 253, 250, 0.94);
  box-shadow: 0 20px 70px rgba(23, 20, 17, 0.2);
  text-align: left;
}

.wechat-share-guide span {
  color: var(--brass);
  font-size: 11px;
  font-weight: 750;
}

.wechat-share-guide strong {
  font-size: 13px;
  font-weight: 650;
}

.wechat-share-guide small {
  color: var(--muted);
  font-size: 12px;
}

.share-poster-sheet {
  position: fixed;
  inset: 0;
  z-index: 132;
  display: grid;
  place-items: center;
  padding: 24px;
}

.share-poster-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 253, 247, 0.2), transparent 38%),
    rgba(23, 20, 17, 0.58);
  backdrop-filter: blur(16px);
}

.share-poster-card {
  position: relative;
  width: min(440px, calc(100vw - 36px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(246, 239, 222, 0.95)),
    var(--paper);
  box-shadow: 0 38px 120px rgba(23, 20, 17, 0.34);
}

.share-poster-copy {
  display: grid;
  gap: 5px;
}

.share-poster-copy span {
  color: var(--brass);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.share-poster-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-poster-copy p {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.share-poster-note {
  color: var(--brass);
  font-size: 11px;
  line-height: 1.4;
}

.share-poster-preview {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(154, 117, 53, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(45deg, rgba(154, 117, 53, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(154, 117, 53, 0.06) 25%, transparent 25%),
    #f7f1e2;
  background-position: 0 0, 0 10px;
  background-size: 20px 20px;
}

.share-poster-preview img {
  width: 100%;
  display: block;
}

.share-poster-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
}

.share-poster-actions .button {
  min-width: 0;
  text-align: center;
}

@media (max-width: 1180px) {
  .lux-header {
    grid-template-columns: 1fr;
  }

  .header-status {
    justify-content: flex-start;
  }

  .hero-band,
  .hero-gallery-lane,
  .workspace-grid,
  .tuning-grid,
  .model-workbench-grid,
  .model-api-grid,
  .advanced-api-grid,
  .lower-grid,
  .v2-status-grid,
  .v2-model-control-grid,
  .v2-run-grid,
  .billing-console-grid,
  .v2-output-layout {
    grid-template-columns: 1fr;
  }

  .v2-asset-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "head"
      "preview"
      "file"
      "roles"
      "controls"
      "list"
      "hint";
  }

  .v2-asset-panel > * {
    min-width: 0;
  }

  .v2-asset-preview {
    height: 220px;
  }

  .v2-file-drop,
  .v2-asset-role-checks,
  .v2-asset-mini-grid,
  #v2AssetLockHint,
  .v2-asset-list {
    width: 100%;
    max-width: 100%;
  }

  .v2-file-drop {
    display: grid;
    align-items: stretch;
    justify-items: stretch;
    gap: 6px;
  }

  .v2-file-drop .file-title {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .v2-asset-role-checks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .v2-asset-mini-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .v2-asset-mini-grid .field {
    min-width: 0;
  }

  .v2-asset-mini-grid .field > span {
    display: block;
    white-space: normal;
  }

  #v2AssetNotesInput {
    width: 100%;
    min-width: 0;
  }

  .hero-gallery-lane {
    border-left: 0;
    border-top: 1px solid var(--line);
    width: min(100%, 520px);
    min-height: auto;
    grid-template-columns: repeat(2, minmax(0, 228px));
    justify-content: center;
    justify-self: center;
    padding-top: 24px;
    padding-left: 0;
  }

  .case-carousel {
    aspect-ratio: 4 / 5;
  }
}

@media (max-width: 760px) {
  .lux-header,
  .homepage {
    padding: 14px;
  }

  .v2-asset-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "preview"
      "file"
      "roles"
      "controls"
      "list"
      "hint";
  }

  .v2-asset-preview {
    height: 240px;
  }

  #v2AssetLockHint {
    justify-self: start;
    text-align: left;
  }

  .v2-file-drop {
    align-items: stretch;
    flex-direction: column;
  }

  .v2-file-drop .file-title {
    width: 100%;
  }

  .v2-asset-role-checks,
  .v2-asset-mini-grid {
    grid-template-columns: 1fr;
  }

  .module-tabs {
    grid-template-columns: 1fr;
    border-radius: var(--radius);
  }

  .tab {
    border-radius: 6px;
    white-space: normal;
  }

  .hero-band {
    min-height: auto;
    padding: 22px;
    gap: 20px;
  }

  h2 {
    font-size: 44px;
  }

  .hero-actions,
  .composer-actions,
  .panel-head,
  .sample-actions,
  .revision-grid,
  .v2-status-actions,
  .v2-sync-actions,
  .v2-filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .segmented,
  .segmented.intensity {
    grid-template-columns: 1fr 1fr;
    border-radius: var(--radius);
  }

  .segment {
    border-radius: 6px;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .v2-template-grid,
  .v2-history-grid,
  .v2-output-grid {
    grid-template-columns: 1fr;
  }

  .model-options {
    grid-template-columns: 1fr;
  }

  .revision-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .revision-selected-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .revision-selected-preview {
    width: 58px;
  }

  .revision-selected-card .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .case-carousel {
    aspect-ratio: 4 / 5;
  }

  .hero-gallery-lane {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 210px));
    gap: 12px;
    justify-content: center;
    padding-top: 18px;
  }

  .hero-card {
    max-width: 210px;
    gap: 8px;
  }

  .hero-card-head strong {
    font-size: 13px;
  }

  .case-slide strong {
    font-size: 18px;
  }

  .sample-modal {
    padding: 12px;
  }

  .sample-dialog {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .sample-hero h2 {
    font-size: 34px;
  }

  .sample-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .hero-gallery-lane {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-card {
    max-width: none;
  }

  .v3-history-list,
  .v3-project-history-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.v3-template-catalog-loading,
.v3-template-catalog-error {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--muted, #64748b);
  line-height: 1.5;
}
.v3-template-catalog-error { color: #8a4c25; }

.v3-confirm-checkbox { display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.v3-confirm-checkbox input { margin-top: 4px; }

/* Doc173: Visual Asset Library is independent from project templates. */
.v3-visual-asset-library-view {
  display: grid;
  gap: 18px;
}

/* Doc180: the Professional character card is a fixed, beginner-facing
   workspace.  Empty slots are intentional placeholders, not missing UI. */
.v3-character-card-workspace {
  display: grid;
  gap: 18px;
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 22px;
  background: var(--surface, #fff);
  box-shadow: 0 16px 40px rgba(17, 24, 39, .07);
}

.v3-character-card-heading,
.v3-character-card-module-head,
.v3-character-card-module-footer,
.v3-character-card-actions,
.v3-character-card-source-options {
  display: flex;
  align-items: center;
  gap: 12px;
}

.v3-character-card-heading,
.v3-character-card-module-footer,
.v3-character-card-actions {
  justify-content: space-between;
}

.v3-character-card-heading h4,
.v3-character-card-module-head h5 {
  margin: 0;
}

.v3-character-card-heading p,
.v3-character-card-module-head p {
  margin: 5px 0 0;
  color: var(--muted, #6b7280);
}

.v3-character-card-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.v3-character-card-overall-progress {
  display: grid;
  gap: 7px;
}

.v3-character-card-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef1f5;
}

.v3-character-card-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6f7bf7, #55b9a5);
  transition: width .25s ease;
}

.v3-character-card-modules {
  display: grid;
  gap: 14px;
}

.v3-character-card-module {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e7eaf0;
  border-radius: 16px;
  background: #fbfcfe;
}

.v3-character-card-module[data-state="active"] {
  border-color: #b8dfd2;
  background: #f5fcf9;
}

.v3-character-card-module[data-state="reviewing"] {
  border-color: #f0d49a;
  background: #fffaf0;
}

.v3-character-card-module-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 30px;
  border-radius: 50%;
  background: #1f2937;
  color: #fff;
  font-weight: 700;
}

.v3-character-card-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.v3-character-card-module[data-v3-character-card-module="expression_set"] .v3-character-card-slots {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.v3-character-card-slot {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e4e8ef;
  border-radius: 12px;
  background: #fff;
}

.v3-character-card-slot-media,
.v3-character-card-slot-placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 2 / 3;
  place-items: center;
  padding: 0;
  border: 0;
  background: #f1f3f7;
}

.v3-character-card-slot-media {
  cursor: zoom-in;
}

.v3-character-card-slot-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v3-character-card-module[data-v3-character-card-module="expression_set"] .v3-character-card-slot-media img {
  object-position: 50% 18%;
}

.v3-character-card-slot-placeholder {
  color: #8a93a3;
  font-size: 12px;
}

.v3-character-card-slot-label {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
}

.v3-character-card-slot-label small {
  color: #7b8492;
}

.v3-character-card-module-footer {
  align-items: flex-end;
}

.v3-character-card-module-footer > small {
  max-width: 65ch;
  color: #687385;
}

.v3-character-card-body-controls {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: #f5f7fb;
}

.v3-character-card-source-options {
  flex-wrap: wrap;
}

.v3-character-card-body-controls textarea {
  width: 100%;
  min-height: 70px;
  resize: vertical;
}

.v3-character-card-empty {
  padding: 24px;
  border: 1px dashed #d4d9e2;
  border-radius: 14px;
  color: #707987;
  text-align: center;
}

@media (max-width: 640px) {
  .v3-character-card-workspace {
    padding: 14px;
    border-radius: 16px;
  }

  .v3-character-card-heading,
  .v3-character-card-module-footer,
  .v3-character-card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .v3-character-card-heading-actions {
    justify-content: space-between;
  }

  .v3-character-card-module-head {
    align-items: flex-start;
  }
}

.v3-library-panel,
.v3-project-visual-asset-panel {
  display: grid;
  gap: 16px;
}

.v3-library-panel[hidden],
.v3-project-visual-asset-panel[hidden] {
  display: none !important;
}

.v3-visual-asset-hub-card {
  align-content: start;
}

.v3-visual-asset-status,
.v3-visual-asset-hub-summary,
.v3-project-visual-asset-summary {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border: 1px solid rgba(88, 105, 177, 0.22);
  border-radius: 14px;
  background: rgba(246, 248, 255, 0.78);
}

.v3-visual-asset-status span,
.v3-visual-asset-hub-summary span,
.v3-project-visual-asset-summary span,
.v3-project-visual-asset-heading p,
.v3-visual-asset-card p,
.v3-visual-asset-view-summary,
.v3-visual-asset-dialog-heading p {
  color: var(--muted, #64748b);
  line-height: 1.55;
}

.v3-visual-asset-list {
  display: grid;
  gap: 12px;
}

.v3-visual-asset-library-cards {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(320px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.v3-visual-asset-section-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line, #dfe3ea);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.06);
}

.v3-visual-asset-section-toggle,
.v3-visual-asset-collapsed-summary,
.v3-visual-asset-card-head {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.v3-visual-asset-section-toggle strong {
  display: block;
  margin-top: 2px;
  font-size: 1.03rem;
}

.v3-visual-asset-create-toggle[data-open="true"] {
  padding: 14px;
  border: 1px solid rgba(88, 124, 255, 0.28);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.95), rgba(255, 255, 255, 0.92));
}

.v3-visual-asset-section-toggle small,
.v3-visual-asset-collapsed-summary span {
  max-width: 28ch;
  color: var(--muted, #64748b);
  line-height: 1.45;
  text-align: right;
}

.v3-visual-asset-collapsed-summary {
  padding: 14px;
  border: 1px dashed rgba(88, 105, 177, 0.32);
  border-radius: 14px;
  background: rgba(246, 248, 255, 0.76);
}

.v3-visual-asset-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line, #dfe3ea);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
}

.v3-visual-asset-card[data-expanded="false"] {
  background: rgba(255, 255, 255, 0.58);
}

.v3-visual-asset-card-detail {
  display: grid;
  gap: 10px;
}

.v3-visual-asset-card.active {
  border-color: #9fcdb2;
  background: linear-gradient(180deg, #f6fff9, #fff);
}

.v3-visual-asset-actions,
.v3-project-visual-asset-heading,
.v3-visual-asset-dialog-heading,
.v3-visual-asset-dialog-top-actions,
.v3-visual-asset-dialog-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.v3-visual-asset-card-head > div,
.v3-project-visual-asset-heading > div,
.v3-visual-asset-dialog-heading > div {
  display: grid;
  gap: 4px;
}

.v3-visual-asset-card-head span,
.v3-visual-asset-card-head small {
  color: var(--muted, #64748b);
  font-size: 13px;
}

.v3-visual-asset-card p,
.v3-project-visual-asset-heading p,
.v3-visual-asset-dialog-heading p {
  margin: 0;
}

.v3-visual-asset-create-form {
  display: grid;
  gap: 12px;
}

.v3-visual-asset-library-dialog [hidden],
.v3-visual-asset-binding-dialog [hidden],
.v3-visual-asset-create-form[hidden],
.v3-character-card-workspace[hidden],
.v3-visual-asset-workflow-panel[hidden] {
  display: none !important;
}

.v3-visual-asset-create-form h4 {
  margin: 0;
}

.v3-visual-asset-source-field {
  display: grid;
  gap: 9px;
}

.v3-visual-asset-file-drop {
  min-height: 98px;
  border-color: rgba(88, 105, 177, 0.34);
  background: linear-gradient(135deg, rgba(246, 248, 255, 0.94), rgba(255, 252, 246, 0.82));
}

.v3-visual-asset-source-list {
  min-height: 72px;
  padding: 9px;
}

.v3-visual-asset-source-feedback {
  margin: -2px 2px 0;
  color: #9a4d17;
  font-size: 0.88rem;
  line-height: 1.45;
}

.v3-visual-asset-create-feedback {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(88, 105, 177, 0.18);
  border-radius: 11px;
  color: var(--muted, #64748b);
  background: rgba(246, 248, 255, 0.72);
  font-size: 0.9rem;
  line-height: 1.5;
}

.v3-visual-asset-create-feedback[data-tone="ready"] {
  border-color: rgba(61, 125, 82, 0.28);
  color: #2f6642;
  background: rgba(246, 255, 249, 0.88);
}

.v3-visual-asset-create-feedback[data-tone="warning"] {
  border-color: rgba(176, 101, 42, 0.32);
  color: #8a4c25;
  background: rgba(255, 248, 238, 0.92);
}

.v3-visual-asset-workflow-panel {
  display: grid;
  gap: 14px;
  margin-top: 4px;
  padding: 16px;
  border: 1px solid rgba(88, 105, 177, 0.24);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(247, 249, 255, 0.96), rgba(255, 255, 255, 0.82));
}

.v3-visual-asset-workflow-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.v3-visual-asset-workflow-heading > div {
  display: grid;
  gap: 4px;
}

.v3-visual-asset-workflow-heading h4,
.v3-visual-asset-workflow-heading p { margin: 0; }

.v3-visual-asset-workflow-badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: #4f5f9c;
  background: rgba(229, 234, 255, 0.9);
  font-size: 12px;
  font-weight: 700;
}

.v3-visual-asset-workflow-progress {
  position: relative;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eaf4;
}

.v3-visual-asset-workflow-progress span {
  display: block;
  width: var(--v3-asset-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6f82d5, #9da9ec);
  transition: width 0.45s ease;
}

.v3-visual-asset-workflow-progress.is-running span {
  background: linear-gradient(90deg, #6f82d5 0%, #d0d8ff 48%, #6f82d5 100%);
  background-size: 220% 100%;
  animation: v3-asset-progress-shimmer 1.35s linear infinite;
}

@keyframes v3-asset-progress-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -120% 0; }
}

.v3-visual-asset-workflow-steps {
  display: grid;
  gap: 8px;
}

.v3-visual-asset-workflow-step {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted, #64748b);
  font-size: 13px;
}

.v3-visual-asset-workflow-step > span {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border: 2px solid #bcc4d6;
  border-radius: 50%;
}

.v3-visual-asset-workflow-step[data-state="done"] { color: #2f6642; }
.v3-visual-asset-workflow-step[data-state="done"] > span { border-color: #5aa16e; background: #5aa16e; }
.v3-visual-asset-workflow-step[data-state="active"] { color: #4f5f9c; font-weight: 700; }
.v3-visual-asset-workflow-step[data-state="active"] > span { border-color: #6f82d5; box-shadow: 0 0 0 4px rgba(111, 130, 213, 0.16); }
.v3-visual-asset-workflow-step[data-state="blocked"] { color: #8a4c25; }
.v3-visual-asset-workflow-step[data-state="blocked"] > span { border-color: #c87f4d; background: #f2c19a; }

.v3-visual-asset-workflow-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.v3-visual-asset-source-row {
  border-radius: 12px;
}

.v3-visual-asset-source-preview {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 1px solid rgba(88, 105, 177, 0.18);
  border-radius: 10px;
  object-fit: cover;
  background: #f4f6fb;
}

.v3-visual-asset-source-preview-placeholder {
  display: inline-grid;
  place-items: center;
  color: var(--muted, #64748b);
  font-size: 0.78rem;
  font-weight: 700;
}

.v3-visual-asset-source-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.v3-asset-row .v3-source-primary {
  color: #325e43;
  background: rgba(61, 125, 82, 0.10);
}

.v3-asset-row .v3-source-primary:hover,
.v3-asset-row .v3-source-primary:focus-visible {
  color: #214431;
  background: rgba(61, 125, 82, 0.17);
}

.v3-asset-row .v3-source-primary:disabled {
  cursor: default;
  color: #325e43;
  background: rgba(61, 125, 82, 0.16);
  opacity: 1;
}

.v3-project-visual-asset-panel {
  margin: 16px 0;
  padding: 17px;
  border: 1px solid rgba(88, 105, 177, 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(246, 248, 255, 0.88), rgba(255, 255, 255, 0.72));
}

.v3-project-visual-asset-heading h4 {
  margin: 2px 0 5px;
}

.v3-project-visual-asset-heading .v3-visual-asset-actions {
  flex: 0 0 auto;
}

.v3-project-visual-asset-summary {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.v3-project-visual-asset-chip {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(88, 105, 177, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
}

.v3-project-visual-asset-chip small {
  color: var(--muted, #64748b);
  line-height: 1.45;
}

.v3-visual-asset-binding-dialog {
  width: min(660px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  border: 0;
  border-radius: 22px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 28px 110px rgba(23, 20, 17, 0.38);
}

.v3-visual-asset-library-dialog {
  width: min(880px, calc(100vw - 32px));
}

.v3-visual-asset-dialog-top-actions {
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.v3-visual-asset-binding-dialog::backdrop {
  background: rgba(23, 20, 17, 0.54);
  backdrop-filter: blur(8px);
}

.v3-visual-asset-dialog-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  background: var(--paper, #fffaf0);
}

.v3-visual-asset-dialog-heading h3 { margin: 2px 0 5px; }
.v3-visual-asset-binding-choices { display: grid; gap: 10px; }
.v3-visual-asset-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line, #dfe3ea);
  border-radius: 13px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.68);
}
.v3-visual-asset-choice input { margin-top: 4px; }
.v3-visual-asset-choice span { display: grid; gap: 3px; }
.v3-visual-asset-choice small { color: var(--muted, #64748b); }
.v3-visual-asset-empty { padding: 12px 0; color: var(--muted, #64748b); line-height: 1.55; }

@media (max-width: 720px) {
  .v3-visual-asset-library-cards {
    grid-template-columns: 1fr;
  }

  .v3-character-card-module[data-v3-character-card-module="expression_set"] .v3-character-card-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v3-visual-asset-card-head,
  .v3-visual-asset-actions,
  .v3-project-visual-asset-heading,
  .v3-visual-asset-dialog-heading,
  .v3-visual-asset-dialog-top-actions,
  .v3-visual-asset-dialog-actions,
  .v3-visual-asset-workflow-heading { flex-direction: column; align-items: stretch; }
  .v3-visual-asset-actions .button,
  .v3-project-visual-asset-heading .button,
  .v3-visual-asset-dialog-heading .button,
  .v3-visual-asset-dialog-top-actions .button,
  .v3-visual-asset-dialog-actions .button,
  .v3-visual-asset-workflow-actions .button { width: 100%; }
  .v3-visual-asset-dialog-card { padding: 17px; }
  .v3-visual-asset-source-row { align-items: flex-start; border-radius: 13px; }
  .v3-visual-asset-source-actions { justify-content: flex-start; }
}

/* Bright ivory premium theme refresh: visual-only overrides, keeps existing DOM and interactions intact. */
:root {
  --ink: #171512;
  --muted: #776f63;
  --quiet: #aaa092;
  --black: #171512;
  --black-soft: #f1eadc;
  --paper: #fffaf0;
  --panel: rgba(255, 252, 246, 0.92);
  --panel-strong: rgba(255, 255, 255, 0.64);
  --line: rgba(180, 144, 78, 0.22);
  --line-strong: rgba(180, 144, 78, 0.36);
  --brass: #b58a3b;
  --wine: #8a4657;
  --green: #2d5b47;
  --blue: #426d86;
  --red: #b64338;
  --shadow: 0 22px 58px rgba(102, 81, 47, 0.11);
  --shadow-deep: 0 28px 80px rgba(102, 81, 47, 0.14);
}

body {
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 250, 239, 0.96) 36%, rgba(245, 238, 222, 0.9) 100%),
    linear-gradient(180deg, #fffdf7 0%, #f7efe0 58%, #fffaf0 100%);
}

.app-shell {
  background:
    linear-gradient(90deg, rgba(180, 144, 78, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(180, 144, 78, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
}

.lux-header {
  padding: 14px 26px;
  border-bottom: 1px solid rgba(180, 144, 78, 0.22);
  background: rgba(255, 252, 246, 0.9);
  box-shadow: 0 14px 34px rgba(102, 81, 47, 0.08);
  color: #171512;
}

.brand-mark {
  border-color: rgba(180, 144, 78, 0.44);
  color: #9a6f2a;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(247, 235, 210, 0.68)),
    rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74), 0 10px 24px rgba(102, 81, 47, 0.08);
}

.lux-header h1,
.lux-header .session-code {
  color: #171512;
}

.lux-header .eyebrow,
.lux-header .session-code {
  color: #7a7165;
}

.module-tabs {
  padding: 4px;
  border-color: rgba(180, 144, 78, 0.24);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 24px rgba(102, 81, 47, 0.07);
}

.tab {
  min-height: 38px;
  color: #776f63;
}

.tab.active {
  color: #12110f;
  background: linear-gradient(180deg, #fff1ca 0%, #d4aa5c 100%);
  box-shadow: 0 10px 24px rgba(180, 144, 78, 0.18);
}

.state-pill,
.mini-pill {
  border-color: rgba(193, 162, 103, 0.36);
  color: #8c682e;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 232, 204, 0.72)),
    rgba(193, 162, 103, 0.12);
}

.lux-header .state-pill,
.lux-header .mini-pill {
  color: #87642b;
  background: rgba(255, 248, 232, 0.86);
}

.homepage {
  width: min(1500px, 100%);
  padding: 26px;
}

.hero-band {
  border: 1px solid rgba(193, 162, 103, 0.28);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(251, 247, 238, 0.82) 52%, rgba(236, 224, 201, 0.72) 100%),
    linear-gradient(135deg, rgba(193, 162, 103, 0.18), transparent 44%);
  box-shadow: var(--shadow-deep);
}

.hero-band::before {
  content: "";
  position: absolute;
  inset: 18px;
  pointer-events: none;
  border: 1px solid rgba(193, 162, 103, 0.18);
  border-radius: inherit;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

h1,
h2 {
  color: #15130f;
}

h2 {
  max-width: 15ch;
  font-size: clamp(48px, 6vw, 76px);
}

.hero-copy p:not(.eyebrow) {
  color: #544a3d;
}

.hero-gallery-lane {
  position: relative;
  z-index: 1;
  border-left-color: rgba(193, 162, 103, 0.24);
}

.hero-card {
  padding: 12px;
  border: 1px solid rgba(193, 162, 103, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.2)),
    rgba(255, 252, 246, 0.56);
  box-shadow: 0 18px 44px rgba(20, 16, 12, 0.14);
}

.history-carousel .case-slide img,
.case-carousel .case-slide img,
.v2-template-preview img,
.v2-live-preview img,
.output-image {
  filter: saturate(0.94) contrast(1.03);
}

.studio-panel,
.panel,
.gallery-wrap,
.sample-dialog,
.lightbox-panel {
  border: 1px solid rgba(193, 162, 103, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 244, 233, 0.88)),
    rgba(251, 247, 238, 0.9);
  box-shadow: var(--shadow);
}

.panel-head {
  border-bottom: 1px solid rgba(193, 162, 103, 0.14);
}

.panel-head h3,
.mini-head strong,
.provider-title strong,
.v2-status-tile strong,
.v2-template-head strong,
.v2-output-meta strong,
.v2-history-meta strong {
  color: #171512;
}

.button,
.download-link,
.delete-link,
.prompt-trigger {
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.button {
  min-height: 42px;
  border-color: rgba(193, 162, 103, 0.34);
  color: #171512;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 237, 217, 0.9)),
    #fbf7ee;
  box-shadow: 0 8px 18px rgba(20, 16, 12, 0.06);
}

.button:hover,
.download-link:hover,
.delete-link:hover {
  transform: translateY(-1px);
}

.button.primary {
  border-color: rgba(193, 162, 103, 0.56);
  color: #fff9ee;
  background:
    linear-gradient(180deg, #2e5c4a 0%, #1c322a 100%),
    #264f40;
  box-shadow: 0 14px 34px rgba(38, 79, 64, 0.28);
}

.button.secondary {
  color: #342917;
  background:
    linear-gradient(180deg, #f7dfae 0%, #c79b52 100%),
    #c79b52;
}

.button.ghost {
  color: #7b5a25;
  background: rgba(255, 255, 255, 0.56);
}

.button.danger {
  border-color: rgba(154, 79, 86, 0.28);
  color: #8a3a2b;
  background:
    linear-gradient(180deg, rgba(255, 249, 246, 0.96), rgba(245, 225, 218, 0.88)),
    #fff4ef;
}

.notice-bar,
.v2-progress-panel,
.api-subpanel,
.advanced-api-panel,
.advanced-asset-panel,
.v2-status-tile,
.v2-asset-panel,
.v2-composer,
.v2-side-controls,
.v2-output-layout > div,
.v2-case-row,
.v2-brain-row,
.v2-output-card,
.history-card,
.v2-history-card,
.model-option,
.field input,
.field textarea,
.field select,
.file-drop,
.asset-preview,
.v2-asset-list,
.v2-prompt-plan {
  border-color: rgba(193, 162, 103, 0.22);
}

.field input,
.field textarea,
.field select {
  background: rgba(255, 253, 248, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(193, 162, 103, 0.58);
  box-shadow: 0 0 0 3px rgba(193, 162, 103, 0.16);
}

.segmented,
.segmented.intensity,
.model-options,
.v2-facet-bar {
  border-color: rgba(193, 162, 103, 0.22);
  background: rgba(20, 18, 15, 0.04);
}

.segment.active,
.v2-facet.active,
.model-option.active {
  border-color: rgba(193, 162, 103, 0.48);
  color: #1b1712;
  background:
    linear-gradient(180deg, rgba(255, 245, 222, 0.96), rgba(230, 204, 157, 0.86)),
    rgba(193, 162, 103, 0.2);
  box-shadow: 0 10px 28px rgba(20, 16, 12, 0.08);
}

.gallery,
.history-gallery,
.v2-template-grid,
.v2-history-grid,
.v2-output-grid {
  padding: 8px;
  border: 1px solid rgba(193, 162, 103, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 252, 246, 0.46);
}

.output-card,
.history-card,
.v2-template-card,
.v2-history-card,
.v2-output-card,
.v2-status-tile {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 240, 224, 0.78)),
    rgba(251, 247, 238, 0.84);
  box-shadow: 0 14px 30px rgba(20, 16, 12, 0.08);
}

.output-preview::after {
  color: #2b2114;
  background: rgba(250, 242, 224, 0.9);
  box-shadow: 0 8px 20px rgba(20, 16, 12, 0.1);
}

.download-link {
  color: #8a6428;
}

.delete-link {
  color: #7e3949;
}

.v2-template-card.selected,
.output-card.selected {
  border-color: rgba(193, 162, 103, 0.72);
  box-shadow:
    0 0 0 3px rgba(193, 162, 103, 0.14),
    0 20px 44px rgba(20, 16, 12, 0.14);
}

.v2-progress-meter {
  background: rgba(20, 18, 15, 0.08);
}

.v2-progress-meter span {
  background: linear-gradient(90deg, #2f5a45, #c19a56);
}

.v2-progress-step.active,
.v2-progress-step.done {
  border-color: rgba(193, 162, 103, 0.48);
  background: rgba(193, 162, 103, 0.12);
}

.lightbox-backdrop {
  background: rgba(58, 48, 34, 0.38);
}

.lightbox-stage {
  background:
    linear-gradient(45deg, rgba(193, 162, 103, 0.07) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(193, 162, 103, 0.07) 25%, transparent 25%),
    #f6efe1;
  background-position: 0 0, 0 12px;
  background-size: 24px 24px;
}

.global-toast {
  border-color: rgba(193, 162, 103, 0.32);
  color: #241c10;
  background: rgba(255, 247, 232, 0.94);
}

@media (max-width: 760px) {
  .lux-header {
    background: rgba(255, 252, 246, 0.94);
  }

  .hero-band {
    padding: 24px;
  }

  h2 {
    font-size: 42px;
  }
}

.v2-asset-panel .v2-file-drop .file-meta {
  display: none !important;
}

/* Desktop/H5 visual unification and V2 result layout polish. */
:root {
  --ink: #181915;
  --ink-soft: #393a35;
  --muted: #84857d;
  --quiet: #a8a8a1;
  --black: #181915;
  --black-soft: #f1f0eb;
  --paper: #fbfaf7;
  --paper-deep: #f1f0eb;
  --panel: rgba(255, 255, 252, 0.78);
  --panel-strong: rgba(255, 255, 252, 0.96);
  --line: rgba(24, 25, 21, 0.14);
  --line-strong: rgba(24, 25, 21, 0.24);
  --brass: #8f7a4f;
  --wine: #8f5662;
  --green: #748269;
  --blue: #687b8a;
  --red: #9a4f56;
  --sage: #828f79;
  --sage-deep: #748269;
  --sage-dark: #6d7c64;
  --champagne: #d6d2c7;
  --champagne-soft: rgba(214, 210, 199, 0.22);
  --shadow: 0 14px 38px rgba(24, 25, 21, 0.07);
  --shadow-deep: 0 20px 58px rgba(24, 25, 21, 0.09);
  --radius: 8px;
  --radius-sm: 6px;
}

* {
  min-width: 0;
}

html {
  background: var(--paper);
}

body {
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  background: var(--paper);
}

.lux-header {
  grid-template-columns: minmax(180px, 0.82fr) minmax(420px, 1.3fr) minmax(210px, 0.82fr);
  padding: 13px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 250, 247, 0.88);
  box-shadow: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-color: var(--line);
  color: var(--sage-dark);
  background: transparent;
  box-shadow: none;
  font-size: 17px;
}

.lux-header h1,
.brand-lockup h1 {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.eyebrow {
  letter-spacing: 0;
}

.module-tabs {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 0;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
  scrollbar-width: none;
}

.tab {
  min-width: max-content;
  min-height: 45px;
  padding: 0 0 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 14px;
  font-weight: 500;
}

.tab.active {
  border-color: var(--sage);
  color: var(--sage-deep);
  background: transparent;
  box-shadow: none;
}

.lab-nav-menu {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

.lab-nav-menu > .tab {
  height: 100%;
}

.lab-nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 50;
  min-width: 230px;
  display: none;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-4px);
  background: rgba(255, 255, 252, 0.96);
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.lab-nav-menu.is-open .lab-nav-dropdown {
  display: grid;
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.lab-nav-dropdown[hidden] {
  display: none;
}

.lab-nav-dropdown button {
  display: grid;
  gap: 3px;
  border: 0;
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.lab-nav-dropdown button:hover,
.lab-nav-dropdown button:focus-visible {
  background: rgba(116, 130, 105, 0.1);
  outline: none;
}

.lab-nav-dropdown span {
  font-size: 13px;
  font-weight: 750;
}

.lab-nav-dropdown small {
  color: var(--muted);
  font-size: 12px;
}

.surface-switch-link,
.state-pill,
.mini-pill,
.auto-save-pill {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.46);
  box-shadow: none;
  font-weight: 500;
}

.surface-switch-link:hover {
  border-color: var(--line-strong);
  color: var(--sage-deep);
  background: rgba(255, 255, 255, 0.68);
}

.header-action-button.active {
  border-color: rgba(116, 130, 105, 0.34);
  color: var(--sage-deep);
  background: rgba(116, 130, 105, 0.1);
}

.homepage {
  width: min(1360px, 100%);
  padding: 22px 24px 28px;
}

.hero-band {
  min-height: 236px;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 0.78fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding: 28px 34px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.hero-band::before {
  display: none;
}

.hero-copy {
  gap: 12px;
  padding: 0;
}

h2,
.hero-copy h2 {
  max-width: 16ch;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", sans-serif;
  font-size: clamp(40px, 4.7vw, 62px);
  font-weight: 300;
  line-height: 1.06;
}

.hero-line,
.hero-copy p:not(.eyebrow) {
  max-width: 520px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.hero-actions .button {
  min-width: 132px;
}

.hero-gallery-lane {
  width: min(100%, 450px);
  min-height: 230px;
  grid-template-columns: repeat(2, minmax(0, 198px));
  gap: 18px;
  border-left: 1px solid var(--line);
  padding-left: clamp(22px, 3vw, 36px);
}

.hero-card {
  max-width: 198px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.hero-card-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.hero-card-head strong,
.case-source {
  color: var(--sage-deep);
}

.case-slide,
.history-carousel,
.history-carousel .case-slide {
  border-color: var(--line);
  background: var(--paper-deep);
  box-shadow: var(--shadow);
}

.studio-panel,
.panel,
.gallery-wrap,
.sample-dialog,
.lightbox-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.studio-panel,
.panel,
.gallery-wrap {
  padding: 16px;
}

.section-title h3,
.panel-head h3 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.panel-head {
  margin-bottom: 13px;
  padding-bottom: 0;
  border-bottom: 0;
}

textarea,
input[type="text"],
input[type="password"],
input[type="url"],
select,
.field input,
.field textarea,
.field select {
  border-color: var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 252, 0.72);
  box-shadow: none;
  font-size: 13px;
}

textarea {
  min-height: 136px;
}

textarea:focus,
input:focus,
select:focus,
.segment:focus-visible,
.button:focus-visible,
.tab:focus-visible,
.output-preview:focus-visible {
  outline: 3px solid rgba(130, 143, 121, 0.2);
  border-color: rgba(116, 130, 105, 0.42);
}

.notice-bar,
.v2-progress-panel,
.v2-auto-sync-copy {
  border-color: var(--line);
  color: var(--muted);
  background: rgba(255, 255, 252, 0.6);
  font-size: 12px;
}

.notice-bar.success,
.v2-auto-sync-copy {
  border-color: rgba(116, 130, 105, 0.26);
  color: var(--sage-dark);
  background: rgba(130, 143, 121, 0.08);
}

.notice-bar.warning {
  border-color: rgba(143, 122, 79, 0.26);
  color: var(--brass);
  background: rgba(143, 122, 79, 0.08);
}

.notice-bar.error {
  border-color: rgba(154, 79, 86, 0.24);
  color: var(--red);
  background: rgba(154, 79, 86, 0.08);
}

.button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 252, 0.62);
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
}

.button:hover,
.download-link:hover,
.delete-link:hover {
  transform: none;
}

.button.primary,
.primary {
  border-color: var(--sage-deep);
  color: #fffdf8;
  background: var(--sage-deep);
  box-shadow: none;
}

.button.secondary,
.secondary {
  border-color: rgba(116, 130, 105, 0.34);
  color: var(--sage-dark);
  background: rgba(130, 143, 121, 0.12);
}

.button.ghost,
.ghost {
  color: var(--muted);
  background: transparent;
}

.compact {
  min-height: 32px;
  font-size: 12px;
}

.tuning-card,
.model-switch-card,
.api-subpanel,
.v2-composer,
.v2-side-controls,
.v2-asset-panel,
.v2-output-layout > div,
.v2-case-row,
.v2-brain-row,
.v2-output-card,
.v2-status-tile,
.output-card,
.history-card,
.v2-template-card,
.v2-history-card,
.file-drop,
.asset-preview,
.advanced-api-panel,
.advanced-asset-panel {
  border-color: var(--line);
  background: rgba(255, 255, 252, 0.58);
  box-shadow: none;
}

.tuning-card {
  min-height: 0;
  padding: 14px;
}

.material-card {
  grid-template-rows: auto 118px auto auto;
}

.segmented,
.segmented.intensity,
.segmented.quality,
.segmented.aspect-segmented {
  display: grid;
  gap: 3px;
  border-color: var(--line);
  border-radius: 999px;
  background: rgba(24, 25, 21, 0.04);
}

.segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented.aspect-segmented,
.segmented.quality,
.segmented.intensity,
.segmented.v2-transform-segmented {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segmented.v2-transform-segmented {
  width: 188px;
  flex: 0 0 188px;
}

.mode-switch {
  width: min(252px, 100%);
  min-height: 42px;
  flex: 0 0 min(252px, 38vw);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(24, 25, 21, 0.055);
}

.segment {
  min-height: 31px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.mode-switch .segment {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  font-weight: 680;
}

.segment.active,
.v2-facet.active,
.model-option.active {
  border-color: transparent;
  color: #fffdf8;
  background: var(--sage-deep);
  box-shadow: none;
}

.mode-switch .segment.active {
  color: #fffdf8;
  background: var(--sage-deep);
  box-shadow: 0 8px 18px rgba(24, 25, 21, 0.12);
}

.role-check {
  min-height: 29px;
  border-color: var(--line);
  background: rgba(255, 255, 252, 0.56);
  font-weight: 500;
}

.role-check:has(input:checked) {
  border-color: rgba(116, 130, 105, 0.38);
  color: var(--sage-dark);
  background: rgba(130, 143, 121, 0.1);
}

input[type="range"] {
  accent-color: var(--sage-deep);
}

.model-option {
  min-height: 102px;
  padding: 13px;
}

.model-option strong {
  font-size: 15px;
  font-weight: 600;
}

.gallery,
.history-gallery,
.v2-template-grid,
.v2-history-grid,
.v2-output-grid {
  border-color: var(--line);
  background: rgba(255, 255, 252, 0.36);
}

@media (max-width: 760px) {
  .v2-asset-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "head"
      "preview"
      "file"
      "roles"
      "controls"
      "list"
      "hint";
  }

  .v2-asset-panel > * {
    min-width: 0;
  }

  .v2-file-drop,
  .v2-asset-role-checks,
  .v2-asset-mini-grid,
  #v2AssetLockHint,
  .v2-asset-list {
    width: 100%;
    max-width: 100%;
  }

  .v2-file-drop {
    display: grid;
    align-items: stretch;
    justify-items: stretch;
    gap: 6px;
  }

  .v2-file-drop .file-title {
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .v2-asset-role-checks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .v2-asset-role-checks .role-check {
    min-width: 0;
    white-space: nowrap;
  }

  .v2-asset-mini-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .v2-asset-mini-grid .field {
    min-width: 0;
  }

  .v2-asset-mini-grid .field > span {
    display: block;
    white-space: normal;
  }

  #v2AssetNotesInput {
    width: 100%;
    min-width: 0;
  }
}

.gallery {
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
}

.output-preview,
.v2-live-preview,
.v2-mock-preview,
.history-card .output-preview {
  background: var(--paper-deep);
}

.output-preview::after {
  color: var(--ink);
  background: rgba(251, 250, 247, 0.9);
  box-shadow: none;
}

.output-image,
.history-carousel .case-slide img,
.case-carousel .case-slide img,
.v2-template-preview img,
.v2-live-preview img {
  filter: saturate(0.96) contrast(1.02);
}

.download-link {
  color: var(--sage-dark);
  font-weight: 600;
}

.delete-link {
  color: var(--red);
  font-weight: 600;
}

.v2-progress-meter {
  height: 6px;
  background: rgba(24, 25, 21, 0.08);
}

.v2-progress-meter span {
  background: linear-gradient(90deg, var(--sage), var(--sage-deep));
}

.v2-progress-step {
  border-color: var(--line);
  background: rgba(255, 255, 252, 0.58);
  font-weight: 500;
}

.v2-progress-step.active,
.v2-progress-step.done {
  border-color: rgba(116, 130, 105, 0.34);
  color: var(--sage-dark);
  background: rgba(130, 143, 121, 0.1);
}

.v2-output-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(250px, 0.82fr) minmax(380px, 1.22fr);
  grid-template-areas:
    "cases brain prompt"
    "images images images";
  gap: 14px;
  align-items: start;
}

.v2-result-block {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.v2-result-cases {
  grid-area: cases;
}

.v2-result-brain {
  grid-area: brain;
}

.v2-result-prompt {
  grid-area: prompt;
}

.v2-result-images {
  grid-area: images;
}

.v2-output-layout h4 {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.v2-case-list,
.v2-brain-panel,
.v2-output-grid {
  min-height: 0;
  max-height: 280px;
  overflow-y: auto;
  align-content: start;
  padding-right: 4px;
  scrollbar-color: rgba(116, 130, 105, 0.44) rgba(24, 25, 21, 0.05);
}

.v2-case-list.empty-v2-list,
.v2-brain-panel.empty-v2-list,
.v2-output-grid.empty-v2-list {
  min-height: 160px;
  max-height: 160px;
  overflow: hidden;
}

.v2-prompt-plan {
  height: clamp(260px, 34vh, 430px);
  min-height: 260px;
  max-height: 430px;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border-color: var(--line);
  color: var(--ink-soft);
  background: rgba(255, 255, 252, 0.68);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  scrollbar-color: rgba(116, 130, 105, 0.44) rgba(24, 25, 21, 0.05);
}

.v2-output-grid {
  max-height: none;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

.v2-output-grid.empty-v2-list {
  max-height: 190px;
}

.lab-workbench {
  gap: 18px;
}

.lab-home-panel {
  min-height: 240px;
}

.lab-home-panel[hidden] {
  display: none;
}

.lab-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 360px));
  gap: 12px;
}

.lab-module-card {
  min-height: 152px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(135deg, rgba(116, 130, 105, 0.08), rgba(180, 144, 78, 0.08)),
    rgba(255, 255, 255, 0.74);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.lab-module-card:hover,
.lab-module-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(116, 130, 105, 0.34);
  outline: none;
}

.lab-module-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.lab-module-card strong {
  font-size: 17px;
  line-height: 1.25;
}

.lab-module-card small {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.lab-module-detail {
  display: grid;
  gap: 18px;
}

.lab-module-detail[hidden] {
  display: none;
}

.lab-module-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-subcopy {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.lab-back-button {
  min-width: max-content;
}

.lab-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.lab-composer,
.lab-style-panel,
.lab-style-result,
.lab-result-card {
  min-width: 0;
}

.lab-composer,
.lab-style-panel {
  height: clamp(900px, 84vh, 980px);
  min-height: 0;
}

.lab-style-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.lab-control-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.lab-control-row + .lab-control-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.lab-control-row .field,
.lab-control-row .control-block {
  min-width: 0;
  min-height: 74px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  border: 1px solid rgba(116, 130, 105, 0.16);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: rgba(255, 255, 255, 0.5);
}

.lab-control-row .field span,
.lab-control-row .control-block > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lab-control-row .field select,
.lab-control-row .field input,
.lab-control-row .control-block input {
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
}

.lab-control-row .control-block input[type="range"] {
  min-height: 22px;
  padding: 0;
}

.lab-control-row + .lab-control-row .field {
  min-height: 68px;
  gap: 6px;
  padding: 9px 8px;
}

.lab-control-row + .lab-control-row .field span {
  font-size: 11px;
}

.lab-control-row + .lab-control-row .field select,
.lab-control-row + .lab-control-row .field input {
  min-height: 32px;
  padding: 7px 8px;
  font-size: 12px;
}

.lab-aspect-segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lab-reference-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

.lab-reference-head {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  padding: 11px 12px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.lab-reference-head strong {
  font-size: 13px;
  line-height: 1.2;
}

.lab-reference-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.lab-reference-head em {
  flex: 0 0 auto;
  border: 1px solid rgba(116, 130, 105, 0.22);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--sage-deep);
  background: rgba(250, 248, 241, 0.9);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
}

.lab-reference-panel {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.lab-reference-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lab-reference-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.lab-reference-file {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(47, 90, 69, 0.24);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  color: var(--sage-deep);
  background: rgba(245, 250, 244, 0.74);
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.lab-reference-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lab-reference-list {
  display: grid;
  gap: 8px;
}

.lab-reference-row,
.lab-card-reference {
  border: 1px solid rgba(116, 130, 105, 0.18);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: rgba(250, 248, 241, 0.72);
}

.lab-reference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
}

.lab-reference-row strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.lab-reference-remove {
  border: 0;
  border-radius: 999px;
  padding: 6px 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.lab-reference-remove:hover,
.lab-reference-remove:focus-visible {
  color: var(--danger, #9f3f34);
  outline: none;
}

.lab-card-reference {
  margin-top: 8px;
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.4;
}

.lab-intent-summary,
.lab-card-intent {
  border: 1px solid rgba(116, 130, 105, 0.18);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: rgba(246, 249, 241, 0.72);
}

.lab-intent-summary {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.45;
}

.lab-intent-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.lab-library-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-bottom: 0;
}

.lab-library-tools input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
}

.lab-library-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.lab-search-thinking {
  margin: 0;
  min-height: 58px;
}

.lab-search-thinking[hidden] {
  display: none;
}

.lab-library-panel[hidden] {
  display: none;
}

.lab-style-grid {
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  height: 100%;
  min-height: 0;
  max-height: none;
  align-content: start;
  overflow: auto;
  padding-right: 4px;
  scrollbar-color: rgba(116, 130, 105, 0.38) rgba(24, 25, 21, 0.04);
}

.lab-style-grid.empty-v2-list,
.lab-comparison-grid.empty-v2-list,
.lab-history-grid.empty-v2-list {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
}

.lab-style-tile {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr;
  gap: 4px;
}

.lab-style-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eeefe8;
}

button.lab-style-preview {
  cursor: zoom-in;
}

.lab-style-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lab-style-placeholder {
  width: 100%;
  padding: 4px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  overflow-wrap: anywhere;
  background: linear-gradient(145deg, transparent 35%, #e4e8de);
}

.lab-style-selection:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.lab-style-selection .lab-style-preview {
  width: 54px;
}

.lab-style-card {
  min-height: 152px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.lab-style-card:hover {
  transform: translateY(-1px);
  border-color: rgba(154, 117, 53, 0.34);
}

.lab-style-card.active {
  border-color: rgba(34, 93, 168, 0.34);
  background:
    linear-gradient(135deg, rgba(34, 93, 168, 0.08), rgba(47, 90, 69, 0.07)),
    rgba(255, 255, 255, 0.82);
}

.lab-style-card span,
.lab-card-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.lab-style-card strong {
  font-size: 14px;
  line-height: 1.32;
}

.lab-style-card small {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.lab-style-score {
  color: var(--sage-deep);
  font-weight: 720;
}

.lab-style-card em {
  align-self: end;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.lab-style-more-note {
  grid-column: 1 / -1;
  width: 100%;
  display: grid;
  place-items: center;
  min-height: 64px;
  border: 1px solid rgba(116, 130, 105, 0.24);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--sage-deep);
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 239, 228, 0.72)),
    rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.lab-style-more-note:hover,
.lab-style-more-note:focus-visible {
  border-color: rgba(116, 130, 105, 0.42);
  box-shadow: 0 12px 28px rgba(24, 25, 21, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.lab-progress {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  font-size: 13px;
}

.lab-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  max-height: 680px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: rgba(154, 117, 53, 0.54) rgba(23, 20, 17, 0.06);
}

.lab-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: rgba(154, 117, 53, 0.54) rgba(23, 20, 17, 0.06);
}

.lab-history-grid.empty-v2-list {
  min-height: 150px;
}

.lab-history-card {
  min-width: 0;
  overflow: hidden;
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  cursor: zoom-in;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.lab-history-card:hover,
.lab-history-card:focus-visible {
  border-color: rgba(116, 130, 105, 0.34);
  box-shadow: 0 14px 30px rgba(24, 25, 21, 0.08);
  outline: none;
  transform: translateY(-1px);
}

.lab-history-preview.v2-live-preview,
.lab-history-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
  background: var(--paper-deep);
  cursor: zoom-in;
}

.lab-history-preview img,
.lab-history-preview.v2-live-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.lab-history-meta.v2-history-meta {
  display: grid;
  gap: 5px;
  padding: 10px;
}

.lab-history-meta strong {
  min-height: 36px;
  overflow: hidden;
  display: -webkit-box;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lab-history-meta span {
  margin: 0;
  overflow-wrap: anywhere;
  overflow: hidden;
  display: -webkit-box;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lab-history-footer.v2-history-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
}

.lab-history-footer .history-card-actions {
  flex: 0 0 auto;
}

.lab-text-link {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.lab-text-link:hover,
.lab-text-link:focus-visible {
  color: var(--green);
  outline: none;
}

.lab-history-body,
.lab-history-tags,
.lab-history-card .lab-card-actions {
  display: none;
}

.lab-style-result {
  display: grid;
  gap: 10px;
}

.lab-style-result h4 {
  color: var(--ink);
  font-size: 15px;
}

.lab-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.lab-result-card {
  min-width: 0;
  overflow: hidden;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
}

.lab-result-card.is-running,
.lab-result-card.is-queued {
  border-color: rgba(79, 107, 82, 0.22);
  background: rgba(255, 255, 255, 0.58);
}

.lab-image-button,
.lab-error-tile {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper-deep);
}

.lab-image-button {
  padding: 0;
  cursor: zoom-in;
}

.lab-image-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.lab-error-tile {
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--red);
  text-align: center;
  font-size: 12px;
  line-height: 1.45;
  background: rgba(184, 51, 51, 0.06);
}

.lab-result-card.is-running .lab-error-tile,
.lab-result-card.is-queued .lab-error-tile {
  color: var(--muted);
  background: rgba(79, 107, 82, 0.07);
}

.lab-card-meta {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 0 10px;
}

.lab-card-meta strong {
  min-height: 38px;
  overflow: hidden;
  display: -webkit-box;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lab-card-quality,
.lab-card-quality-detail {
  margin: 0;
  padding: 0 10px;
  overflow: hidden;
  display: -webkit-box;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lab-card-quality {
  color: var(--ink-soft);
  font-weight: 720;
}

.lab-card-intent {
  margin: 0 10px;
  padding: 7px 9px;
  overflow: hidden;
  display: -webkit-box;
  color: var(--sage-deep);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lab-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

.lab-card-action {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.lab-card-action:hover {
  border-color: rgba(34, 93, 168, 0.28);
  color: var(--blue);
}

.lab-favorite-btn {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lab-favorite-btn.active {
  border-color: rgba(154, 117, 53, 0.34);
  color: var(--brass);
  background: rgba(154, 117, 53, 0.1);
}

.lab-prompt-detail {
  border-top: 1px solid var(--line);
  padding: 8px 10px 10px;
}

.lab-prompt-detail summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lab-prompt-detail pre {
  max-height: 180px;
  margin: 8px 0 0;
  overflow: auto;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.v2-live-preview,
.v2-mock-preview {
  aspect-ratio: 1 / 1;
}

.v2-live-preview img {
  object-fit: contain;
  background: var(--paper-deep);
}

.lightbox-backdrop {
  background: rgba(24, 25, 21, 0.36);
}

.lightbox-panel {
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  background: var(--panel-strong);
}

.lightbox-stage {
  background: var(--paper-deep);
}

.lightbox-prompt-panel {
  left: 18px;
  right: 18px;
  bottom: 70px;
}

.prompt-card {
  max-height: min(500px, calc(100vh - 176px));
  border-color: var(--line);
  background: rgba(251, 250, 247, 0.92);
  box-shadow: var(--shadow-deep);
}

.prompt-card-head {
  border-bottom-color: var(--line);
  color: var(--sage-dark);
}

.prompt-scroll-box {
  max-height: min(440px, calc(100vh - 236px));
  color: var(--ink-soft);
  background: rgba(255, 255, 252, 0.54);
  scrollbar-color: rgba(116, 130, 105, 0.44) rgba(24, 25, 21, 0.05);
}

.global-toast {
  border-color: var(--line);
  color: var(--ink);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

@media (max-width: 1180px) {
  .lux-header {
    grid-template-columns: 1fr;
  }

  .module-tabs {
    justify-content: flex-start;
  }

  .hero-band,
  .hero-gallery-lane,
  .account-summary-grid,
  .billing-console-grid,
  .lab-layout,
  .v2-output-layout {
    grid-template-columns: 1fr;
  }

  .v2-output-layout {
    grid-template-areas:
      "cases"
      "brain"
      "prompt"
      "images";
  }
}

@media (max-width: 760px) {
  .lux-header,
  .homepage {
    padding: 14px;
  }

  .hero-band {
    padding: 18px 0 20px;
  }

  h2,
  .hero-copy h2 {
    font-size: 38px;
  }

  .segmented.aspect-segmented,
  .segmented.quality,
  .segmented.intensity,
  .lab-aspect-segmented,
  .segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: var(--radius);
  }

  .lab-aspect-segmented {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lab-control-row,
  .lab-card-grid {
    grid-template-columns: 1fr;
  }

  .lab-reference-controls {
    grid-template-columns: 1fr;
  }

  .lab-comparison-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .lab-history-grid {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .lab-card-actions {
    grid-template-columns: 1fr;
  }

  .segmented.v2-transform-segmented {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-radius: 999px;
  }

  .segment {
    border-radius: var(--radius-sm);
  }

  .v2-prompt-plan {
    height: 300px;
  }

  .account-history-grid {
    grid-template-columns: 1fr;
  }

  .account-template-list {
    grid-template-columns: 1fr;
  }

  .account-usage-row {
    grid-template-columns: 1fr;
  }

  .account-usage-row div:last-child {
    justify-items: start;
    text-align: left;
  }

  .lightbox-panel {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
}

@media (max-width: 420px) {
  .v2-transform-row {
    align-items: center;
    flex-direction: row;
    gap: 6px;
  }

  .v2-transform-label {
    gap: 4px;
    font-size: 11px;
  }

  .segmented.v2-transform-segmented {
    width: 148px;
    flex: 0 0 148px;
  }

  .v2-transform-segmented .segment {
    min-height: 34px;
    font-size: 11px;
  }
}

/* Final responsive navigation pass: keep the header stable and let long tabs scroll horizontally. */
.lux-header {
  grid-template-columns: minmax(170px, 0.8fr) minmax(0, 1.6fr) minmax(180px, 0.8fr);
}

.module-tabs {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.module-tabs::-webkit-scrollbar {
  display: none;
}

.module-tabs .tab,
.module-tabs .lab-nav-menu {
  flex: 0 0 auto;
  scroll-snap-align: center;
}

.header-status {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.header-status > * {
  min-width: 0;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-status .session-code {
  max-width: 118px;
}

.lab-home-panel {
  display: grid;
  gap: 18px;
}

.lab-home-history-panel {
  margin-top: 2px;
}

.lab-nav-dropdown {
  position: fixed;
  top: var(--lab-menu-top, 66px);
  left: var(--lab-menu-left, 50vw);
}

@media (max-width: 1180px) {
  .lux-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .header-status {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .header-status::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 760px) {
  .module-tabs {
    flex-wrap: wrap;
    gap: 20px;
    margin: 0 -2px;
    max-width: calc(100vw - 28px);
    overflow-x: hidden;
    padding: 0 2px;
  }

  .module-tabs .tab,
  .module-tabs .lab-nav-menu {
    flex: 1 1 calc(50% - 10px);
    min-width: 0;
  }

  .module-tabs .tab {
    min-height: 42px;
    white-space: nowrap;
  }
}

/* Starred history and continuation picker. */
.history-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.favorite-filter {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(154, 117, 53, 0.18);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.favorite-filter input {
  width: 15px;
  height: 15px;
  accent-color: var(--brass);
}

.output-card,
.v2-history-card {
  position: relative;
}

.favorite-star-button {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 4;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  color: rgba(23, 20, 17, 0.46);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 20px rgba(23, 20, 17, 0.16);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.favorite-star-button.active {
  color: #fff8d9;
  border-color: rgba(154, 117, 53, 0.58);
  background: linear-gradient(135deg, #b8842e, #d6aa55);
}

.favorite-star-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.is-favorite {
  border-color: rgba(154, 117, 53, 0.46);
}

.revision-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.v2-favorite-reference-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  position: relative;
  padding: 10px;
  border: 1px solid rgba(116, 130, 105, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 252, 0.78), rgba(248, 245, 235, 0.56)),
    rgba(255, 255, 252, 0.58);
}

.v2-favorite-reference-card.is-empty {
  border-style: dashed;
  background: rgba(255, 255, 252, 0.48);
}

.v2-favorite-reference-card.has-selection {
  border-color: rgba(154, 117, 53, 0.46);
  background:
    linear-gradient(180deg, rgba(255, 251, 235, 0.86), rgba(248, 245, 235, 0.66)),
    rgba(255, 255, 252, 0.7);
}

.v2-favorite-reference-copy,
.v2-favorite-reference-card > span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.v2-reference-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.v2-reference-title-row span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.v2-reference-title-row em {
  flex: 0 0 auto;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 1px 7px;
  border: 1px solid rgba(116, 130, 105, 0.22);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.v2-favorite-reference-card.has-selection .v2-reference-title-row em {
  border-color: rgba(154, 117, 53, 0.34);
  color: #8a6423;
  background: rgba(255, 244, 203, 0.86);
}

.v2-favorite-reference-card strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v2-favorite-reference-card small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.v2-favorite-reference-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.v2-favorite-reference-actions .button {
  min-width: 0;
  width: 100%;
}

.favorite-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.favorite-picker-modal[hidden] {
  display: none;
}

.favorite-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 20, 17, 0.38);
  backdrop-filter: blur(8px);
}

.favorite-picker-panel {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 252, 0.96), rgba(247, 243, 232, 0.9)),
    var(--panel);
  box-shadow: 0 30px 90px rgba(23, 20, 17, 0.28);
}

.favorite-picker-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-right: 44px;
}

.favorite-picker-grid {
  min-height: 220px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding-right: 4px;
}

.favorite-picker-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}

button.favorite-picker-card {
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.favorite-picker-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(191, 166, 111, 0.22);
}

.favorite-picker-card.readonly {
  opacity: 0.72;
}

.favorite-picker-preview {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--black-soft);
  cursor: pointer;
}

.favorite-picker-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.favorite-picker-meta {
  display: grid;
  gap: 5px;
  padding: 10px;
}

.favorite-picker-meta strong {
  min-height: 36px;
  overflow: hidden;
  display: -webkit-box;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.favorite-picker-meta span {
  color: var(--muted);
  font-size: 11px;
}

.favorite-picker-action {
  width: max-content;
  max-width: 100%;
  min-height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fffdf8;
  background: var(--sage-deep);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

@media (max-width: 760px) {
  .mode-switch-row,
  .simple-mode-hero,
  .simple-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-switch {
    width: 100%;
    flex-basis: auto;
    min-height: 44px;
  }

  .simple-drop-grid {
    grid-template-columns: 1fr;
  }

  .simple-actions .button {
    width: 100%;
  }

  .history-section .panel-head,
  .panel-head:has(#v2HistoryCount) {
    align-items: stretch;
    flex-direction: column;
  }

  .history-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    justify-content: stretch;
  }

  .favorite-filter {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    padding: 8px 10px;
    border-radius: var(--radius);
    font-size: 13px;
  }

  .favorite-filter input {
    width: 18px;
    height: 18px;
  }

  .history-actions .state-pill {
    min-height: 36px;
    display: inline-grid;
    place-items: center;
  }

  .history-actions .button {
    width: auto;
    min-width: 70px;
    padding: 0 12px;
  }

  .history-gallery,
  .v2-history-grid {
    max-height: none;
    overflow: visible;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 6px;
  }

  .history-gallery.empty-history,
  .v2-history-grid.empty-v2-list {
    grid-template-columns: 1fr;
    min-height: 150px;
  }

  .history-card,
  .v2-history-card {
    border-radius: var(--radius);
  }

  .history-card .output-preview,
  .v2-history-card .v2-live-preview,
  .v2-history-card .v2-mock-preview {
    min-height: 0;
  }

  .favorite-star-button {
    top: 7px;
    right: 7px;
    width: 44px;
    height: 44px;
    font-size: 20px;
    box-shadow: 0 10px 24px rgba(23, 20, 17, 0.2);
  }

  .history-meta,
  .v2-history-meta {
    padding: 9px;
  }

  .history-prompt,
  .v2-history-meta strong {
    min-height: 34px;
    font-size: 12px;
    line-height: 1.4;
  }

  .history-detail,
  .v2-history-meta span {
    font-size: 10.5px;
    line-height: 1.35;
  }

  .output-meta,
  .v2-history-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 9px;
  }

  .history-card-actions {
    width: 100%;
    justify-content: space-between;
  }

  .revision-selected-card {
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: stretch;
  }

  .revision-selected-preview {
    width: 64px;
  }

  .revision-selected-copy strong,
  .revision-selected-copy small {
    white-space: normal;
  }

  .revision-selected-card .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .revision-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v2-favorite-reference-card {
    padding: 10px;
  }

  .v2-favorite-reference-copy,
  .v2-favorite-reference-card > span {
    gap: 5px;
  }

  .v2-favorite-reference-card strong {
    min-height: 28px;
    display: grid;
    align-items: center;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    background: rgba(24, 25, 21, 0.04);
  }

  .v2-favorite-reference-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .favorite-picker-modal {
    align-items: end;
    place-items: end center;
    padding: 0;
  }

  .favorite-picker-panel {
    width: 100%;
    max-height: min(86vh, 760px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
  }

  .favorite-picker-head {
    align-items: center;
    padding-right: 42px;
  }

  .favorite-picker-head h3 {
    font-size: 18px;
    line-height: 1.25;
  }

  .favorite-picker-grid {
    min-height: min(52vh, 420px);
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 2px 4px 0;
  }

  .favorite-picker-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: stretch;
  }

  .favorite-picker-preview {
    height: 100%;
    min-height: 116px;
    aspect-ratio: auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .favorite-picker-meta {
    align-content: space-between;
    gap: 8px;
    padding: 11px;
  }

  .favorite-picker-meta strong {
    min-height: 0;
    font-size: 13px;
    -webkit-line-clamp: 3;
  }

  .favorite-picker-meta span {
    font-size: 11px;
    line-height: 1.45;
  }

  .favorite-picker-action {
    width: 100%;
    min-height: 34px;
  }
}

@media (max-width: 640px) {
  .revision-actions {
    grid-template-columns: 1fr;
  }

  .favorite-picker-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .history-actions {
    grid-template-columns: 1fr auto;
  }

  .history-actions .favorite-filter {
    grid-column: 1 / -1;
  }

  .history-gallery,
  .v2-history-grid {
    gap: 8px;
  }

  .favorite-star-button {
    width: 42px;
    height: 42px;
  }

  .favorite-picker-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .favorite-picker-preview {
    min-height: 108px;
  }
}

/* Desktop polish pass for V1 material controls and starred thumbnails. */
@media (min-width: 761px) {
  .tuning-grid {
    gap: 16px;
  }

  .params-card {
    gap: 8px;
  }

  .params-card .control-block {
    margin-top: 10px;
  }

  .material-card {
    grid-template-columns: minmax(210px, 0.78fr) minmax(280px, 1.22fr);
    grid-template-areas:
      "head head"
      "upload preview"
      "list preview"
      "advanced advanced";
    grid-template-rows: auto minmax(82px, auto) auto auto;
    align-content: start;
    gap: 11px 12px;
  }

  .material-card .mini-head {
    grid-area: head;
    min-height: 28px;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(24, 25, 21, 0.07);
  }

  .material-head-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }

  .material-head-actions #assetState,
  .material-head-actions .button {
    min-height: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    font-weight: 680;
  }

  .material-head-actions .button {
    min-width: 48px;
    padding: 0 9px;
    border-color: rgba(116, 130, 105, 0.22);
    color: rgba(72, 82, 64, 0.74);
    background: rgba(255, 255, 252, 0.52);
  }

  .material-head-actions #assetState {
    min-width: 42px;
    padding: 0 9px;
    border-color: rgba(116, 130, 105, 0.28);
    color: var(--sage-deep);
    background: rgba(130, 143, 121, 0.1);
  }

  .material-card #assetPreview {
    grid-area: preview;
    min-height: 164px;
    height: 100%;
    border-radius: 16px;
  }

  .material-card .file-drop {
    grid-area: upload;
    min-height: 100px;
    align-content: center;
    border-radius: 16px;
    background: rgba(154, 117, 53, 0.045);
  }

  .material-card #assetList {
    grid-area: list;
    min-height: 38px;
    max-height: 96px;
    overflow: auto;
    border-radius: 14px;
    font-size: 11px;
  }

  .material-card #advancedAssetPanel {
    grid-area: advanced;
  }

  .advanced-asset-panel {
    grid-template-columns: minmax(230px, 0.96fr) minmax(260px, 1.04fr);
    gap: 10px 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(116, 130, 105, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 252, 0.42);
  }

  .advanced-role-checks {
    grid-column: 1;
    grid-row: 1 / span 4;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    align-content: start;
  }

  .advanced-strength,
  .advanced-asset-panel > .field {
    grid-column: 2;
  }

  .advanced-strength {
    gap: 7px;
  }

  .advanced-asset-panel > .field:last-child {
    grid-column: 2;
  }

  .role-check {
    min-height: 32px;
    justify-content: flex-start;
    border-radius: 12px;
    padding: 7px 9px;
  }

  .role-check input {
    width: 13px;
    height: 13px;
  }

  #assetIntentNotesInput {
    min-height: 42px;
    height: 42px;
    max-height: 72px;
    border-radius: 12px;
  }

  .favorite-star-button {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 22px;
    height: 22px;
    overflow: visible;
    padding: 0;
    border-color: rgba(255, 253, 247, 0.32);
    color: transparent;
    background: rgba(255, 253, 247, 0.34);
    box-shadow: 0 4px 10px rgba(24, 25, 21, 0.08);
    font-size: 0;
    line-height: 1;
    backdrop-filter: blur(8px);
  }

  .favorite-star-button::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    display: block;
    width: 14px;
    height: 14px;
    background: rgba(24, 25, 21, 0.4);
    transform: translate(-50%, -50%);
    -webkit-mask: url("/static/icons/bootstrap-star-fill.svg") center / contain no-repeat;
    mask: url("/static/icons/bootstrap-star-fill.svg") center / contain no-repeat;
  }

  .favorite-star-button:hover,
  .favorite-star-button:focus-visible {
    background: rgba(255, 253, 247, 0.52);
    box-shadow: 0 5px 13px rgba(24, 25, 21, 0.12);
  }

  .favorite-star-button:hover::before,
  .favorite-star-button:focus-visible::before {
    background: rgba(143, 107, 34, 0.86);
  }

  .favorite-star-button.active {
    border-color: rgba(255, 216, 68, 0.34);
    background: rgba(255, 248, 221, 0.36);
    box-shadow: 0 6px 16px rgba(255, 196, 0, 0.12);
  }

  .favorite-star-button.active::before {
    width: 15px;
    height: 15px;
    background: #ffd21a;
    filter: drop-shadow(0 1px 1.5px rgba(92, 63, 0, 0.2));
  }

  .is-favorite {
    border-color: rgba(181, 140, 57, 0.28);
  }
}

@media (min-width: 761px) and (max-width: 1040px) {
  .material-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "head"
      "preview"
      "upload"
      "list"
      "advanced";
  }

  .material-card #assetPreview {
    min-height: 190px;
  }

  .advanced-asset-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .advanced-role-checks,
  .advanced-strength,
  .advanced-asset-panel > .field,
  .advanced-asset-panel > .field:last-child {
    grid-column: 1;
    grid-row: auto;
  }

  .advanced-role-checks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.v2-asset-panel .v2-asset-role-checks {
  grid-area: roles;
  grid-column: roles;
  grid-row: roles;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 760px) {
  .v2-asset-panel .v2-asset-role-checks {
    grid-template-columns: 1fr;
  }
}

/* V3 commercial frontend shell. */
.v3-workbench {
  gap: 18px;
}

.v3-project-history-modal {
  position: fixed;
  inset: 0;
  z-index: 165;
  display: grid;
  place-items: center;
  padding: 24px;
}

.v3-project-history-modal[hidden] {
  display: none;
}

.v3-project-history-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 20, 17, 0.5);
  backdrop-filter: blur(14px);
}

.v3-project-history-dialog {
  position: relative;
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, 0.96);
  box-shadow: 0 34px 100px rgba(23, 20, 17, 0.28);
}

.v3-project-history-close {
  z-index: 4;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.92);
}

.v3-project-history-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 68px 16px 18px;
  border-bottom: 1px solid rgba(180, 144, 78, 0.18);
}

.v3-project-history-head h3 {
  margin: 0;
}

.v3-project-history-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.v3-project-history-grid {
  max-height: min(68vh, 760px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 18px;
}

.v3-project-history-grid.empty-v3-list {
  min-height: 220px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.v3-project-history-image-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
}

.v3-project-history-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(245, 241, 232, 0.72);
  cursor: zoom-in;
}

.v3-project-history-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.v3-project-history-image span {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.v3-project-history-image-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.v3-project-history-image-meta strong,
.v3-project-history-image-meta span {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-project-history-image-meta span {
  flex: 0 0 auto;
  color: var(--muted);
}

body[data-active-module="v3"] #providerState,
body[data-active-module="v3"] #sessionLabel {
  display: none;
}

.v3-home-view,
.v3-workspace-view {
  display: grid;
  gap: 18px;
  min-height: 0;
  align-content: start;
}

.v3-professional-home-surface,
.v3-professional-project-hub-slot,
.v3-professional-project-hub-slot > .v3-project-hub {
  display: grid;
  gap: 18px;
}

.v3-standard-home-surface {
  display: contents;
}

.v3-standard-home-surface[hidden],
.v3-professional-home-surface[hidden] {
  display: none;
}

.v3-professional-home-surface {
  align-content: start;
}

.v3-home-view[hidden],
.v3-workspace-view[hidden] {
  display: none;
}

.v3-workspace-view[data-v3-opening="true"] {
  cursor: progress;
}

.v3-workspace-view[data-v3-opening="true"] button,
.v3-workspace-view[data-v3-opening="true"] input,
.v3-workspace-view[data-v3-opening="true"] textarea,
.v3-workspace-view[data-v3-opening="true"] select {
  pointer-events: none;
}

.v3-page-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 32px;
  background: rgba(247, 244, 236, 0.34);
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  text-align: center;
}

.v3-page-loading-overlay[hidden] {
  display: none;
}

.v3-page-loading-overlay::before {
  content: "";
  width: 42px;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  border: 3px solid rgba(116, 130, 105, 0.18);
  border-top-color: rgba(93, 121, 70, 0.9);
  animation: v3PageSpin 0.9s linear infinite;
}

.v3-page-loading-overlay strong {
  color: var(--ink);
  font-size: 16px;
}

.v3-page-loading-overlay small {
  max-width: 320px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

body.v3-page-loading-active {
  overflow: hidden;
}

@keyframes v3PageSpin {
  to {
    transform: rotate(360deg);
  }
}

.v3-hero-panel,
.v3-home-panel,
.v3-history-panel,
.v3-image-history-panel,
.v3-workspace-header,
.v3-composer-panel,
.v3-brain-panel,
.v3-commerce-panel {
  border-color: rgba(116, 130, 105, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(248, 243, 232, 0.72)),
    rgba(255, 255, 252, 0.56);
}

.v3-hero-actions,
.v3-action-row,
.v3-result-meta,
.v3-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.v3-scenario-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.v3-template-chooser {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.v3-template-choice,
.v3-step-card {
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.v3-template-choice {
  min-height: 136px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
}

.v3-template-choice:hover:not(:disabled),
.v3-step-card:hover:not(:disabled) {
  border-color: rgba(47, 90, 69, 0.3);
  box-shadow: 0 12px 28px rgba(47, 90, 69, 0.09);
}

.v3-template-choice.active,
.v3-step-card.active {
  border-color: rgba(47, 90, 69, 0.38);
  background: rgba(243, 249, 239, 0.86);
  box-shadow: inset 0 0 0 1px rgba(47, 90, 69, 0.14);
}

.v3-template-choice.locked,
.v3-template-choice:disabled,
.v3-step-card:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.v3-template-choice span,
.v3-step-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.v3-template-choice strong,
.v3-step-card strong {
  font-size: 14px;
  line-height: 1.28;
}

.v3-template-choice small,
.v3-step-card small {
  line-height: 1.45;
}

.v3-template-create-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(47, 90, 69, 0.16);
  border-radius: var(--radius);
  background: rgba(245, 249, 241, 0.72);
}

.v3-template-create-panel h4 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.v3-template-create-panel p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.v3-create-visual-asset-binding-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(88, 105, 177, 0.2);
  border-radius: var(--radius);
  background: rgba(246, 248, 255, 0.68);
}

.v3-create-visual-asset-binding-panel[hidden] {
  display: none !important;
}

.v3-create-visual-asset-binding-panel h4 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.v3-create-visual-asset-binding-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.v3-create-visual-asset-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line, #dfe3ea);
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.72);
}

.v3-create-visual-asset-choice input {
  margin-top: 4px;
  flex: 0 0 auto;
}

.v3-create-visual-asset-choice span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.v3-create-visual-asset-choice strong,
.v3-create-visual-asset-choice small {
  overflow-wrap: anywhere;
}

.v3-create-visual-asset-choice small,
.v3-create-visual-asset-empty {
  color: var(--muted, #64748b);
  line-height: 1.45;
}

.v3-history-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.v3-project-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(168px, auto);
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.v3-field-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.v3-field-title-row .v3-field-hint {
  margin: 0;
  text-align: right;
}

.v3-project-goal-field textarea {
  min-height: 92px;
  resize: vertical;
}

.v3-project-create #v3NewProjectBtn {
  min-height: 92px;
  align-self: end;
  white-space: normal;
}

.v3-project-list,
.v3-project-timeline {
  display: grid;
  gap: 12px;
}

.v3-project-list {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.v3-project-list.empty-v3-list,
.v3-project-timeline.empty-v3-list {
  min-height: 128px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  border: 1px dashed rgba(116, 130, 105, 0.26);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.v3-history-list.empty-v3-list {
  min-height: 128px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  border: 1px dashed rgba(116, 130, 105, 0.26);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.v3-history-card {
  min-height: 132px;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  text-align: left;
  cursor: pointer;
}

.v3-history-image-card,
.v3-history-project-card {
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 8px;
  cursor: default;
}

.v3-history-preview,
.v3-history-project-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(237, 233, 224, 0.72);
  cursor: zoom-in;
}

.v3-history-project-preview {
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 48%, rgba(23, 20, 17, 0.16), rgba(23, 20, 17, 0) 54%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 243, 236, 0.76));
  box-shadow: inset 0 0 0 1px rgba(23, 20, 17, 0.04);
}

.v3-history-preview img,
.v3-history-project-preview > img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.58);
}

.v3-history-project-preview > img {
  position: absolute;
  top: 8%;
  left: 12%;
  width: 76%;
  height: 82%;
  z-index: 8;
  padding: 6px;
  transform: rotate(5deg);
  border: 1px solid rgba(23, 20, 17, 0.1);
  border-radius: 5px;
  background: #fff;
  box-shadow:
    0 20px 34px rgba(23, 20, 17, 0.24),
    0 4px 10px rgba(23, 20, 17, 0.16);
  object-fit: cover;
  object-position: center;
}

.v3-history-preview span,
.v3-history-empty-thumb {
  display: grid;
  min-height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.v3-history-stack {
  position: absolute;
  inset: 8% 11% 10% 10%;
  z-index: 2;
  pointer-events: none;
}

.v3-history-stack span {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 6px;
  border: 1px solid rgba(23, 20, 17, 0.1);
  border-radius: 5px;
  background: #fff;
  box-shadow:
    0 18px 30px rgba(23, 20, 17, 0.2),
    0 3px 8px rgba(23, 20, 17, 0.12);
}

.v3-history-stack span:nth-child(1) {
  z-index: 1;
  transform: translate(-18px, 8px) rotate(-6deg);
  opacity: 0.62;
}

.v3-history-stack span:nth-child(2) {
  z-index: 2;
  transform: translate(-9px, -6px) rotate(-3deg);
  opacity: 0.74;
}

.v3-history-stack span:nth-child(3) {
  z-index: 3;
  transform: translate(2px, 10px) rotate(2deg);
  opacity: 0.82;
}

.v3-history-stack span:nth-child(4) {
  z-index: 4;
  transform: translate(12px, -2px) rotate(4deg);
  opacity: 0.9;
}

.v3-history-stack span:nth-child(5) {
  z-index: 5;
  transform: translate(20px, 9px) rotate(7deg);
  opacity: 0.78;
}

.v3-history-stack img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 2px;
}

.v3-history-load-more-preview,
.v3-project-load-more-thumb {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-align: center;
}

.v3-history-load-more-preview span,
.v3-project-load-more-thumb span {
  width: 56px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(47, 90, 69, 0.08);
  color: rgba(47, 90, 69, 0.88);
  font-size: 16px;
  font-weight: 840;
}

.v3-project-load-more-card {
  cursor: default;
}

.v3-history-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.v3-history-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.v3-history-actions .button.primary {
  flex: 1;
  justify-content: center;
}

.v3-project-card {
  height: 382px;
  display: grid;
  grid-template-rows: auto 62px auto auto;
  align-content: start;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.64);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.v3-project-card-top {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 5px 8px;
}

.v3-project-card-top .v3-project-card-chips {
  grid-column: 1 / -1;
  order: 3;
}

.v3-project-template-label,
.v3-project-date {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-project-thumb-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(237, 233, 224, 0.64);
}

.v3-project-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.v3-project-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: block;
}

.v3-history-card:hover,
.v3-project-card:hover,
.v3-scenario-card:hover,
.v3-preset-card:hover {
  border-color: rgba(47, 90, 69, 0.3);
  box-shadow: 0 12px 28px rgba(47, 90, 69, 0.09);
}

.v3-scenario-card:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

.v3-scenario-card:disabled:hover {
  border-color: var(--line);
  box-shadow: none;
}

.v3-history-card strong {
  font-size: 14px;
  line-height: 1.3;
}

.v3-project-card strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.3;
}

.v3-history-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-project-card p,
.v3-project-timeline-row p {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-project-card p {
  margin: 0;
  max-height: 36px;
  overflow: hidden;
}

.v3-project-goal-slot {
  min-height: 62px;
  max-height: 62px;
  display: flex;
  align-items: center;
  padding: 8px 9px;
  overflow: hidden;
  border: 1px solid rgba(47, 90, 69, 0.1);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(245, 249, 241, 0.76);
}

.v3-project-goal-slot p {
  width: 100%;
  margin: 0;
  max-height: none;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.v3-project-card-actions,
.v3-project-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.v3-project-card-actions {
  justify-content: flex-start;
}

.v3-project-header-actions {
  justify-content: flex-end;
  max-width: min(46vw, 520px);
}

.v3-history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.v3-project-style-chips,
.v3-project-card-chips {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}

.v3-project-style-chips {
  justify-content: flex-end;
}

.v3-project-card-chips {
  justify-content: center;
}

.v3-project-style-chips span,
.v3-project-card-chips span {
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid rgba(47, 90, 69, 0.16);
  border-radius: 999px;
  color: #2f5a45;
  background: rgba(235, 243, 229, 0.62);
  font-size: 11px;
  font-weight: 760;
}

.v3-generation-settings {
  display: grid;
  grid-template-columns: minmax(180px, 0.68fr) minmax(260px, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.v3-setting-control {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(116, 130, 105, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.v3-setting-control > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.v3-count-control {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.v3-count-control input,
.v3-count-control select {
  grid-column: 1 / -1;
  width: 100%;
}

.v3-count-control select {
  min-height: 40px;
}

.v3-count-control .v3-field-hint {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.v3-result-delivery-summary {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.v3-image-recovery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.v3-count-control strong {
  justify-self: end;
  color: var(--ink);
  font-size: 13px;
}

.v3-aspect-segments {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.v3-aspect-segments button {
  min-height: 32px;
  padding: 7px 8px;
  border: 1px solid rgba(116, 130, 105, 0.2);
  border-radius: 999px;
  color: rgba(68, 55, 45, 0.78);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.v3-aspect-segments button.active {
  color: #2f5a45;
  border-color: rgba(47, 90, 69, 0.3);
  background: rgba(235, 243, 229, 0.86);
}

.v3-project-snapshot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.v3-project-snapshot.empty-v3-list {
  min-height: 86px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  border: 1px dashed rgba(116, 130, 105, 0.26);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.v3-project-snapshot-card {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(47, 90, 69, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.v3-project-snapshot-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.v3-project-snapshot-card strong {
  color: #243a30;
  font-size: 14px;
  line-height: 1.3;
}

.v3-project-snapshot-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-persistent-display-region {
  display: grid;
  gap: 14px;
}

.v3-photography-role-board {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(66, 109, 134, 0.24);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(241, 248, 250, 0.92), rgba(255, 255, 255, 0.7));
}

.v3-photography-role-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.v3-photography-role-heading div,
.v3-photography-role-card {
  display: grid;
  gap: 5px;
}

.v3-photography-role-heading span,
.v3-photography-role-heading small,
.v3-photography-role-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-photography-role-heading strong { color: #243a30; font-size: 15px; }

.v3-photography-role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.v3-photography-role-card {
  padding: 12px;
  border: 1px solid rgba(66, 109, 134, 0.17);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.v3-photography-role-card > div { display: flex; justify-content: space-between; gap: 8px; }
.v3-photography-role-card strong { color: #263b45; font-size: 13px; }
.v3-photography-role-card span { color: #427088; font-size: 12px; font-weight: 760; }
.v3-photography-role-card.blocked { border-color: rgba(178, 82, 64, 0.35); }
.v3-photography-role-card.blocked span { color: #a34330; }
.v3-photography-role-card.attention { border-color: rgba(178, 136, 44, 0.35); }
.v3-photography-role-card.attention span { color: #8a651c; }

.v3-step-action-region {
  border-color: rgba(47, 90, 69, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 244, 237, 0.64)),
    rgba(255, 255, 252, 0.58);
}

.v3-project-subpage {
  position: fixed;
  inset: 72px max(18px, calc((100vw - 1180px) / 2)) 24px;
  z-index: 120;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-color: rgba(66, 109, 134, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 249, 248, 0.82)),
    rgba(255, 255, 252, 0.62);
  box-shadow: 0 28px 86px rgba(23, 21, 18, 0.2);
}

.v3-project-subpage > .panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -2px -2px 14px;
  padding: 2px 2px 14px;
  border-bottom: 1px solid rgba(23, 20, 17, 0.08);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.v3-project-subpage[hidden] {
  display: none;
}

.v3-project-detail-panel,
.v3-step-action-region {
  min-height: 0;
  overflow: visible;
}

.v3-subpage-body {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.v3-scene-panel {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(66, 109, 134, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.v3-scene-panel article {
  min-width: 0;
  display: grid;
  grid-template-columns: 92px minmax(140px, 0.7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(23, 20, 17, 0.07);
  background: transparent;
}

.v3-scene-panel article:last-child {
  border-bottom: 0;
}

.v3-scene-panel span {
  color: #426d86;
  font-size: 11px;
  font-weight: 800;
}

.v3-scene-panel strong {
  color: #21352c;
  font-size: 13px;
  line-height: 1.3;
}

.v3-scene-panel p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-project-subpage .v3-composer-panel[hidden],
.v3-project-subpage .v3-results-panel[hidden],
.v3-project-subpage .v3-side-stack[hidden],
.v3-project-subpage .v3-project-next-actions[hidden] {
  display: none;
}

.v3-project-subpage .v3-workspace-grid {
  margin-top: 12px;
}

.v3-progress-panel {
  margin-top: 14px;
  border-color: rgba(47, 90, 69, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 250, 246, 0.66)),
    rgba(255, 255, 252, 0.56);
}

.v3-progress-panel .run-progress-head strong {
  font-size: 14px;
}

.v3-progress-panel .run-progress-head span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(47, 90, 69, 0.08);
  font-size: 11px;
  font-weight: 780;
}

.v3-progress-panel .run-progress-meter span {
  background: linear-gradient(90deg, var(--green), #426d86, var(--brass));
}

.v3-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  margin-top: 14px;
}

.v3-progress-steps .run-progress-step {
  min-height: 0;
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
}

.v3-progress-steps .run-progress-step::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: 4px;
  border-radius: 50%;
  background: rgba(116, 130, 105, 0.35);
}

.v3-progress-steps .run-progress-step.done {
  color: var(--green);
  background: transparent;
}

.v3-progress-steps .run-progress-step.done::before {
  background: var(--green);
}

.v3-progress-steps .run-progress-step.active {
  color: var(--blue);
  background: transparent;
}

.v3-progress-steps .run-progress-step.active::before {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(34, 93, 168, 0.1);
}

.v3-progress-steps .run-progress-step.failed {
  color: var(--red);
  background: transparent;
}

.v3-progress-steps .run-progress-step.failed::before {
  background: var(--red);
}

.v3-progress-footnote[hidden],
.v3-inline-notice[hidden] {
  display: none !important;
}

.v3-inline-notice {
  min-height: 0;
  display: block;
  margin-top: 8px;
  padding: 7px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  line-height: 1.45;
}

.v3-inline-notice.success {
  border-color: transparent;
  color: var(--green);
  background: transparent;
}

.v3-inline-notice.warning,
.v3-inline-notice.error {
  padding: 8px 10px;
  border: 1px solid currentColor;
  border-radius: 8px;
}

.v3-inline-notice.warning {
  border-color: rgba(154, 117, 53, 0.24);
  color: var(--brass);
  background: rgba(154, 117, 53, 0.08);
}

.v3-inline-notice.error {
  border-color: rgba(184, 51, 51, 0.2);
  color: var(--red);
  background: rgba(184, 51, 51, 0.07);
}

.v3-artifact-details {
  border: 1px solid rgba(116, 130, 105, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
}

.v3-artifact-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}

.v3-artifact-details summary::-webkit-details-marker {
  display: none;
}

.v3-artifact-details summary span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
}

.v3-artifact-details summary small {
  color: var(--muted);
  font-size: 12px;
}

.v3-artifact-details .v3-project-workflow,
.v3-artifact-details .v3-project-timeline,
.v3-artifact-details .v3-brand-memory-panel,
.v3-artifact-details .v3-workflow-artifacts {
  margin: 0 12px 12px;
}

.v3-workflow-artifacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.v3-artifact-card,
.v3-prompt-artifact {
  min-width: 0;
  border: 1px solid rgba(66, 109, 134, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.v3-artifact-card {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
}

.v3-artifact-card span,
.v3-prompt-artifact summary span {
  color: #426d86;
  font-size: 11px;
  font-weight: 800;
}

.v3-artifact-card strong {
  color: #21352c;
  font-size: 13px;
  line-height: 1.35;
}

.v3-artifact-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-prompt-artifact {
  grid-column: 1 / -1;
}

.v3-prompt-artifact summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}

.v3-prompt-artifact summary::-webkit-details-marker {
  display: none;
}

.v3-prompt-artifact summary small {
  color: var(--muted);
  font-size: 12px;
}

.v3-prompt-artifact pre {
  max-height: 240px;
  overflow: auto;
  margin: 0 12px 12px;
  padding: 10px;
  white-space: pre-wrap;
  color: #2b342e;
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(245, 249, 241, 0.78);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
}

.v3-review-artifact ul {
  display: grid;
  gap: 6px;
  margin: 0 12px 12px;
  padding: 10px 12px 10px 26px;
  color: #2b342e;
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(245, 249, 241, 0.78);
  font-size: 12px;
  line-height: 1.45;
}

.v3-step-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.v3-step-card {
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px;
}

.v3-step-card.done strong {
  color: #2f5a45;
}

.v3-step-card.current {
  border-color: rgba(47, 90, 69, 0.28);
}

.v3-production-entry {
  position: relative;
  min-height: 118px;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 8px;
  padding: 18px 20px;
  border-color: rgba(47, 90, 69, 0.2);
  background:
    linear-gradient(135deg, rgba(247, 250, 246, 0.94), rgba(255, 255, 255, 0.78)),
    rgba(245, 249, 241, 0.82);
  box-shadow: 0 16px 38px rgba(47, 90, 69, 0.08);
}

.v3-production-entry::after {
  content: "打开制作页";
  position: absolute;
  right: 18px;
  top: 18px;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  color: #fff;
  background: #2f5a45;
  font-size: 12px;
  font-weight: 820;
}

.v3-production-entry:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(47, 90, 69, 0.12);
}

.v3-production-entry .v3-production-kicker {
  color: #426d86;
  font-size: 11px;
  font-weight: 840;
  letter-spacing: 0;
}

.v3-production-entry strong {
  max-width: calc(100% - 118px);
  font-size: 20px;
  line-height: 1.2;
}

.v3-production-entry small {
  max-width: min(720px, calc(100% - 118px));
  color: rgba(68, 55, 45, 0.72);
  font-size: 13px;
  line-height: 1.55;
}

.v3-production-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.v3-production-meta em {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(66, 109, 134, 0.14);
  border-radius: 999px;
  color: rgba(38, 61, 75, 0.82);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
}

.v3-intent-details {
  margin-bottom: 12px;
  border: 1px solid rgba(116, 130, 105, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.v3-intent-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.v3-intent-details summary::-webkit-details-marker {
  display: none;
}

.v3-intent-details summary span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.v3-intent-details summary small {
  color: var(--muted);
  font-size: 12px;
}

.v3-intent-details .v3-preset-row {
  margin: 0;
  padding: 0 12px 12px;
}

.v3-project-output-board,
.v3-useful-reference-board,
.v3-project-workflow,
.v3-project-next-actions {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.v3-project-output-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.v3-useful-reference-board {
  grid-template-columns: minmax(0, 1fr);
}

.v3-project-reference-panel,
.v3-project-output-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.v3-project-surface-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.v3-project-surface-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.v3-project-surface-heading p:not(.eyebrow) {
  max-width: 760px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.v3-project-reference-panel .v3-useful-reference-board,
.v3-project-output-section .v3-project-output-board {
  margin-top: 0;
}

.v3-project-reference-group {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.v3-project-reference-group > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.v3-continuity-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 132px));
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.v3-continuity-input-card {
  display: grid;
  grid-template-rows: 112px auto;
  gap: 6px;
  width: 132px;
  min-width: 0;
  margin: 0;
}

.v3-continuity-input-frame {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(250, 248, 241, 0.86);
}

.v3-continuity-input-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.v3-continuity-input-name {
  display: block;
  width: 112px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-continuity-anchor-unbind {
  width: max-content;
  max-width: 100%;
  justify-self: start;
}

.v3-continuity-anchor-unbind[aria-busy="true"],
.v3-output-actions button[aria-busy="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: progress;
}

.v3-continuity-loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: v3-continuity-spin 0.75s linear infinite;
}

.v3-continuity-loading-label {
  white-space: nowrap;
}

@keyframes v3-continuity-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .v3-continuity-loading-spinner { animation: none; opacity: 0.7; }
}

.v3-project-reference-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.v3-project-reference-group-head > div {
  display: grid;
  gap: 3px;
}

.v3-project-reference-group-head strong {
  color: var(--ink);
  font-size: 13px;
}

.v3-project-reference-group-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.v3-project-reference-group-head > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.v3-project-reference-group-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.v3-project-output-board.empty-v3-list,
.v3-useful-reference-board.empty-v3-list {
  min-height: 118px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  border: 1px dashed rgba(116, 130, 105, 0.26);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.48);
}

.v3-project-output-tile,
.v3-useful-reference-tile,
.v3-workflow-step,
.v3-project-next-actions button {
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
}

.v3-project-output-tile {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 10px;
}

.v3-project-output-tile.selected,
.v3-result-card.selected {
  border-color: rgba(47, 90, 69, 0.36);
  background:
    linear-gradient(180deg, rgba(245, 249, 241, 0.86), rgba(255, 255, 255, 0.64)),
    rgba(245, 249, 241, 0.7);
  box-shadow: inset 0 0 0 1px rgba(47, 90, 69, 0.08);
}

.v3-project-output-preview,
.v3-project-output-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(237, 233, 224, 0.8);
}

.v3-project-output-preview {
  padding: 0;
  cursor: zoom-in;
}

.v3-project-output-preview img,
.v3-useful-reference-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.v3-project-output-placeholder,
.v3-reference-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.v3-project-output-tile strong,
.v3-useful-reference-tile strong {
  font-size: 13px;
  line-height: 1.25;
}

.v3-reference-origin {
  display: block;
  margin-bottom: 4px;
  color: #53624c;
  font-size: 11px;
  font-weight: 760;
}

.v3-ecommerce-history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.v3-ecommerce-history-summary article {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.v3-ecommerce-history-summary span {
  color: #426d86;
  font-size: 11px;
  font-weight: 800;
}

.v3-ecommerce-history-summary strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.v3-ecommerce-history-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.v3-project-output-tile p,
.v3-useful-reference-tile p,
.v3-workflow-step p,
.v3-project-next-actions small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.v3-output-actions button {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(66, 109, 134, 0.18);
  border-radius: 999px;
  color: #426d86;
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 740;
  cursor: pointer;
}

.v3-output-actions button:first-child {
  color: #2f5a45;
  border-color: rgba(47, 90, 69, 0.22);
  background: rgba(47, 90, 69, 0.08);
}

.v3-output-actions button:hover:not(:disabled) {
  border-color: rgba(47, 90, 69, 0.34);
  transform: translateY(-1px);
}

.v3-output-actions button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.v3-process-output-details {
  grid-column: 1 / -1;
  border: 1px solid rgba(116, 130, 105, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
}

.v3-process-only-note {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px dashed rgba(116, 130, 105, 0.24);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  font-size: 13px;
}

.v3-process-output-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.v3-process-output-details summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

.v3-process-output-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.v3-review-output-details {
  grid-column: 1 / -1;
  border: 1px solid rgba(173, 93, 52, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 248, 238, 0.76);
}

.v3-review-output-details summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
}

.v3-review-output-details summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

.v3-review-output-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}

.v3-review-output-tile {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(173, 93, 52, 0.2);
  border-radius: calc(var(--radius) - 2px);
  background: rgba(255, 255, 255, 0.72);
}

.v3-review-output-tile .v3-process-output-tile {
  width: 100%;
  aspect-ratio: 4 / 3;
}

.v3-review-output-tile strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
}

.v3-review-output-tile span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.v3-process-output-tile {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(237, 233, 224, 0.76);
  padding: 0;
  cursor: zoom-in;
}

.v3-process-output-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.v3-process-output-tile span {
  display: grid;
  place-items: center;
  min-height: 100%;
  color: var(--muted);
  font-size: 12px;
}

.v3-reference-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.v3-reference-actions button {
  border: 1px solid rgba(91, 70, 51, 0.16);
  background: rgba(255, 255, 255, 0.76);
  color: rgba(68, 55, 45, 0.82);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
}

.v3-reference-actions button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.v3-reference-feedback-form {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.v3-reference-feedback-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.v3-reference-feedback-form textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border: 1px solid rgba(91, 70, 51, 0.16);
  border-radius: 8px;
  padding: 7px 8px;
  color: rgba(68, 55, 45, 0.92);
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
}

.v3-useful-reference-tile {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 9px;
  padding: 9px;
  align-items: center;
}

.v3-useful-reference-tile img,
.v3-reference-placeholder {
  width: 72px;
  height: 72px;
  border-radius: calc(var(--radius) - 2px);
  background: rgba(237, 233, 224, 0.8);
}

.v3-project-workflow {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.v3-workflow-step {
  min-height: 86px;
  padding: 11px;
}

.v3-workflow-step span {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #53624c;
  background: rgba(236, 239, 230, 0.8);
  font-size: 11px;
  font-weight: 780;
}

.v3-workflow-step.done span {
  color: #2f5a45;
  background: rgba(222, 239, 226, 0.9);
}

.v3-workflow-step.active {
  border-color: rgba(47, 90, 69, 0.24);
  background: rgba(245, 249, 241, 0.78);
}

.v3-project-next-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.v3-project-next-actions button {
  min-height: 78px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.v3-project-next-actions button:hover:not(:disabled) {
  border-color: rgba(47, 90, 69, 0.3);
  box-shadow: 0 10px 24px rgba(47, 90, 69, 0.08);
}

.v3-project-next-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.v3-selected-memory-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid rgba(47, 90, 69, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(245, 249, 241, 0.9), rgba(255, 255, 255, 0.72)),
    rgba(245, 249, 241, 0.68);
}

.v3-selected-memory-bar[hidden] {
  display: none;
}

.v3-selected-memory-bar span,
.v3-brand-memory-panel span,
.v3-style-memory-status span,
.v3-continuation-main span {
  color: #426d86;
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.v3-selected-memory-bar strong,
.v3-style-memory-status strong,
.v3-continuation-main strong {
  display: block;
  color: #21352c;
  font-size: 14px;
  line-height: 1.35;
}

.v3-selected-memory-bar p,
.v3-style-memory-status p,
.v3-continuation-main p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-project-next-actions {
  display: block;
}

.v3-style-confirm-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(47, 90, 69, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 250, 246, 0.72)),
    rgba(245, 249, 241, 0.62);
}

.v3-style-confirm-panel.saved {
  border-color: rgba(47, 90, 69, 0.22);
  background:
    linear-gradient(180deg, rgba(245, 249, 241, 0.9), rgba(255, 255, 255, 0.72)),
    rgba(245, 249, 241, 0.72);
}

.v3-style-confirm-panel span {
  color: #426d86;
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.v3-style-confirm-panel strong {
  display: block;
  margin-top: 3px;
  color: #21352c;
  font-size: 15px;
  line-height: 1.35;
}

.v3-style-confirm-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-project-next-actions .v3-style-confirm-panel .button {
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  white-space: nowrap;
}

.v3-production-context {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(47, 90, 69, 0.14);
  border-radius: var(--radius);
  background: rgba(245, 249, 241, 0.72);
}

.v3-production-context span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: #2f5a45;
  background: rgba(47, 90, 69, 0.1);
  font-size: 12px;
  font-weight: 800;
}

.v3-production-context strong {
  color: #21352c;
  font-size: 14px;
  line-height: 1.35;
}

.v3-production-context p {
  flex: 1 1 260px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-continuation-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.75fr);
  gap: 12px;
}

.v3-continuation-main,
.v3-style-memory-status {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
}

.v3-style-memory-status.saved {
  border-color: rgba(47, 90, 69, 0.24);
  background:
    linear-gradient(180deg, rgba(245, 249, 241, 0.9), rgba(255, 255, 255, 0.68)),
    rgba(245, 249, 241, 0.72);
}

.v3-continuation-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.v3-project-next-actions .v3-continuation-buttons .button {
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  text-align: center;
}

.v3-brand-memory-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(47, 90, 69, 0.2);
  border-radius: var(--radius);
  background: rgba(245, 249, 241, 0.78);
}

.v3-brand-memory-copy {
  min-width: 0;
}

.v3-brand-memory-actions-inline {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.v3-brand-memory-panel[hidden] {
  display: none;
}

.v3-brand-memory-panel strong {
  display: block;
  color: #243a30;
  font-size: 14px;
  line-height: 1.35;
}

.v3-brand-memory-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-brand-memory-dialog {
  max-width: 680px;
}

.v3-brand-memory-modal[hidden] {
  display: none;
}

.v3-brand-memory-modal {
  z-index: 180;
}

.v3-brand-memory-form {
  display: grid;
  gap: 12px;
}

.v3-brand-memory-form textarea {
  resize: vertical;
}

.v3-brand-memory-reference-summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed rgba(47, 90, 69, 0.22);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.v3-brand-memory-actions {
  margin-top: 0;
}

.v3-project-timeline {
  margin-top: 14px;
}

.v3-project-timeline-row {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.v3-scenario-card,
.v3-preset-card {
  min-height: 126px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  text-align: left;
  cursor: pointer;
}

.v3-scenario-card span,
.v3-preset-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.v3-scenario-card strong,
.v3-preset-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.v3-scenario-card small,
.v3-preset-card small,
.v3-commerce-panel p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-scenario-card.active,
.v3-preset-card.active {
  border-color: rgba(47, 90, 69, 0.38);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(230, 239, 226, 0.74)),
    rgba(47, 90, 69, 0.08);
  box-shadow: 0 14px 34px rgba(47, 90, 69, 0.1);
}

.v3-scenario-card.locked {
  color: rgba(23, 21, 18, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(242, 235, 220, 0.58)),
    rgba(180, 144, 78, 0.08);
}

.v3-scenario-card.locked::after {
  content: "未激活";
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgba(180, 144, 78, 0.26);
  border-radius: 999px;
  color: #8c682e;
  background: rgba(255, 248, 232, 0.78);
  font-size: 11px;
  font-weight: 750;
}

.v3-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
  gap: 18px;
  align-items: start;
}

.v3-preset-row,
.v3-brand-grid,
.v3-input-grid {
  display: grid;
  gap: 12px;
}

.v3-preset-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.v3-variation-mode-row {
  grid-template-columns: repeat(5, minmax(128px, 1fr));
}

.v3-variation-mode-row .v3-preset-card {
  min-height: 116px;
}

.v3-preset-row[hidden] {
  display: none;
}

.v3-preset-card {
  min-height: 92px;
}

.v3-prompt-field {
  display: grid;
  gap: 8px;
}

.v3-field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-input-grid {
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.18fr);
  margin-top: 12px;
}

.v3-file-drop {
  min-height: 126px;
  align-content: center;
}

.v3-asset-list {
  min-height: 126px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
}

.v3-asset-list.empty-v3-list,
.v3-result-board.empty-v3-board {
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.v3-asset-row {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 9px;
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.v3-asset-file-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.v3-asset-file-copy strong,
.v3-asset-file-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v3-asset-file-copy small {
  color: var(--muted);
  font-size: 11px;
}

.v3-asset-row button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  color: #8a3a2b;
  background: rgba(138, 58, 43, 0.08);
  font-size: 12px;
  font-weight: 720;
  cursor: pointer;
}

.v3-asset-row button:hover,
.v3-asset-row button:focus-visible {
  color: #6f2f24;
  background: rgba(138, 58, 43, 0.14);
}

.v3-brand-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.v3-ecommerce-fields {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(47, 90, 69, 0.18);
  border-radius: var(--radius);
  background: rgba(245, 249, 241, 0.6);
}

.v3-workbench[data-v3-active-scenario="ecommerce"] .v3-composer-panel,
.v3-workbench[data-v3-active-scenario="ecommerce"] .v3-commerce-panel {
  border-color: rgba(47, 90, 69, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(245, 249, 241, 0.68)),
    rgba(255, 255, 255, 0.62);
}

.v3-workbench[data-v3-active-scenario="ecommerce"] .v3-file-drop {
  border-color: rgba(47, 90, 69, 0.26);
  background: rgba(245, 249, 241, 0.7);
}

.v3-ecommerce-fields[hidden] {
  display: none;
}

.v3-optional-details {
  display: grid;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(47, 90, 69, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
}

.v3-optional-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
}

.v3-optional-details summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.v3-optional-details[open] {
  padding-bottom: 14px;
}

.v3-optional-details[open] summary {
  margin-bottom: 12px;
}

.v3-reference-priority-controls[hidden] {
  display: none;
}

.v3-general-advanced-controls {
  width: min(100%, 760px);
  justify-self: center;
  margin-top: 18px;
}

.v3-reference-priority-controls {
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(47, 90, 69, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(246, 250, 243, 0.72)),
    rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 32px rgba(38, 58, 45, 0.08);
}

.v3-reference-priority-controls summary {
  min-height: 62px;
  padding: 13px 15px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(47, 90, 69, 0.08), rgba(255, 255, 255, 0.36)),
    rgba(255, 255, 255, 0.48);
  list-style: none;
}

.v3-reference-priority-controls summary::-webkit-details-marker {
  display: none;
}

.v3-reference-priority-controls summary span {
  position: relative;
  display: grid;
  gap: 2px;
  padding-left: 34px;
  font-size: 14px;
  letter-spacing: 0;
}

.v3-reference-priority-controls summary span::before {
  position: absolute;
  left: 0;
  top: 50%;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(47, 90, 69, 0.16);
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 50%, rgba(47, 90, 69, 0.82) 0 4px, transparent 5px),
    rgba(255, 255, 255, 0.76);
  content: "";
  transform: translateY(-50%);
}

.v3-reference-priority-controls summary small {
  max-width: 420px;
  color: rgba(64, 75, 66, 0.72);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.v3-reference-priority-controls summary::after {
  min-width: 58px;
  padding: 7px 12px;
  border: 1px solid rgba(47, 90, 69, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--primary);
  content: "展开";
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  box-shadow: inset 0 -1px 0 rgba(47, 90, 69, 0.08);
}

.v3-reference-priority-controls[open] summary {
  border-bottom: 1px solid rgba(47, 90, 69, 0.12);
  border-radius: 18px 18px 0 0;
}

.v3-reference-priority-controls[open] summary::after {
  content: "收起";
}

.v3-reference-priority-controls[open] summary {
  margin-bottom: 0;
}

.v3-reference-priority-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.v3-reference-priority-grid-compact {
  padding: 0;
}

.v3-reference-priority-grid-compact .v3-reference-priority-option {
  min-height: 82px;
}

.v3-shared-advanced-fields-slot {
  min-width: 0;
}

.v3-reference-priority-controls .v3-shared-advanced-fields-slot {
  margin: 0 14px 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(47, 90, 69, 0.1);
}

.v3-shared-brand-fields {
  margin-top: 0;
}

.v3-ecommerce-reference-controls {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(47, 90, 69, 0.12);
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(246, 250, 243, 0.58)),
    rgba(255, 255, 255, 0.58);
}

.v3-ecommerce-reference-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.v3-ecommerce-reference-head strong {
  color: var(--ink);
  font-size: 13px;
}

.v3-ecommerce-reference-head small {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.v3-ecommerce-fields .v3-shared-advanced-fields-slot .v3-brand-grid {
  margin-top: 0;
}

.v3-reference-priority-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  min-height: 92px;
  padding: 12px;
  border: 1px solid rgba(47, 90, 69, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(248, 246, 239, 0.54)),
    rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.v3-reference-priority-option:hover {
  border-color: rgba(47, 90, 69, 0.26);
  box-shadow: 0 10px 22px rgba(38, 58, 45, 0.08);
  transform: translateY(-1px);
}

.v3-reference-priority-option:has(input:checked) {
  border-color: rgba(47, 90, 69, 0.32);
  background:
    linear-gradient(180deg, rgba(238, 248, 235, 0.88), rgba(255, 255, 255, 0.68)),
    rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 24px rgba(47, 90, 69, 0.1);
}

.v3-reference-priority-option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 1px solid rgba(47, 90, 69, 0.26);
  border-radius: 7px;
  accent-color: var(--primary);
}

.v3-reference-priority-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.v3-reference-priority-option strong {
  font-size: 13px;
  color: var(--ink);
}

.v3-reference-priority-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.v3-results-panel {
  min-height: 280px;
}

.v3-result-board {
  min-height: 220px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.v3-result-card {
  min-height: 240px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(248, 244, 236, 0.58)),
    rgba(255, 255, 252, 0.58);
}

.v3-result-card-wide {
  grid-column: 1 / -1;
}

.v3-review-hold-card {
  min-height: 0;
  border-color: rgba(173, 93, 52, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 248, 238, 0.92), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 252, 0.58);
}

.v3-review-reasons {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-review-only-card {
  border-color: rgba(173, 93, 52, 0.22);
}

.v3-result-preview,
.v3-result-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(23, 20, 17, 0.08);
  border-radius: var(--radius);
  background: rgba(245, 241, 232, 0.72);
}

.v3-result-preview {
  padding: 0;
  cursor: zoom-in;
}

.v3-result-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.v3-result-placeholder span {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 760;
}

.v3-result-card strong {
  font-size: 15px;
}

.v3-result-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.v3-result-scene {
  color: rgba(74, 65, 51, 0.74);
  font-size: 11px;
}

.v3-overlay-copy {
  padding: 7px 9px;
  border: 1px solid rgba(66, 109, 134, 0.16);
  border-radius: var(--radius);
  color: #426d86;
  background: rgba(66, 109, 134, 0.08);
  font-weight: 720;
}

.v3-result-meta {
  align-self: end;
}

.v3-result-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(47, 90, 69, 0.08);
  font-size: 11px;
  font-weight: 750;
}

.v3-result-download {
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: 4px 8px;
  border-radius: 999px;
  color: #426d86;
  background: rgba(66, 109, 134, 0.08);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

.v3-side-stack {
  gap: 14px;
}

.v3-capability-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.v3-capability-list span {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(66, 109, 134, 0.2);
  border-radius: 999px;
  color: #426d86;
  background: rgba(66, 109, 134, 0.08);
  font-size: 12px;
  font-weight: 720;
}

.v3-closure-list,
.v3-warning-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.v3-closure-list[hidden],
.v3-warning-list[hidden] {
  display: none !important;
}

.v3-closure-row {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(116, 130, 105, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
}

.v3-closure-row strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.v3-closure-row span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.v3-closure-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--green);
  background: rgba(47, 90, 69, 0.08);
  font-size: 10px;
}

.v3-closure-row[data-status="attention"] .v3-closure-status {
  color: var(--red);
  background: rgba(182, 67, 56, 0.08);
}

.v3-closure-row[data-status="pending"] .v3-closure-status,
.v3-closure-row[data-status="not_applicable"] .v3-closure-status {
  color: var(--muted);
  background: rgba(24, 25, 21, 0.06);
}

.v3-warning-list {
  padding: 10px;
  border: 1px solid rgba(182, 67, 56, 0.16);
  border-radius: var(--radius);
  color: var(--red);
  background: rgba(182, 67, 56, 0.06);
  font-size: 12px;
  line-height: 1.45;
}

.v3-commerce-panel {
  display: grid;
  gap: 12px;
}

.v3-commerce-panel[hidden] {
  display: none;
}

.v3-commerce-plan-list,
.v3-commerce-export-list {
  display: grid;
  gap: 8px;
}

.v3-commerce-plan-list[hidden],
.v3-commerce-export-list[hidden] {
  display: none;
}

.v3-commerce-plan-row,
.v3-commerce-export-row {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(116, 130, 105, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
  font-size: 12px;
}

.v3-commerce-plan-row strong {
  color: var(--ink);
}

.v3-commerce-plan-row span,
.v3-commerce-export-row {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .v3-scenario-grid,
  .v3-template-chooser,
  .v3-project-snapshot {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .v3-step-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .v3-history-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .v3-project-history-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .v3-project-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .v3-project-output-board,
  .v3-project-workflow,
  .v3-workflow-artifacts,
  .v3-project-next-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v3-project-reference-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v3-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .v3-variation-mode-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v3-reference-priority-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .v3-project-subpage {
    inset: 12px;
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
  }

  .v3-workspace-view {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .v3-project-history-modal {
    padding: 12px;
  }

  .v3-project-history-head {
    align-items: stretch;
    flex-direction: column;
    padding: 16px 56px 14px 16px;
  }

  .v3-scenario-grid,
  .v3-template-chooser,
  .v3-step-cards,
  .v3-project-snapshot,
  .v3-project-list,
  .v3-preset-row,
  .v3-input-grid,
  .v3-project-create,
  .v3-generation-settings,
  .v3-brand-grid,
  .v3-reference-priority-grid,
  .v3-project-output-board,
  .v3-project-reference-group-grid,
  .v3-ecommerce-history-summary,
  .v3-project-workflow,
  .v3-workflow-artifacts,
  .v3-project-next-actions,
  .v3-result-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .v3-photography-role-grid { grid-template-columns: minmax(0, 1fr); }
  .v3-photography-role-heading { align-items: stretch; flex-direction: column; }

  .v3-history-list,
  .v3-project-history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v3-field-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .v3-field-title-row .v3-field-hint {
    text-align: left;
  }

  .v3-project-create #v3NewProjectBtn {
    min-height: 46px;
  }

  .v3-project-card {
    height: auto;
    grid-template-rows: auto auto auto auto auto auto;
  }

  .v3-project-card-top {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .v3-project-date {
    display: none;
  }

  .v3-aspect-segments {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v3-scene-panel article {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 4px;
  }

  .v3-project-subpage > .panel-head {
    margin-bottom: 12px;
  }

  .v3-progress-panel {
    padding: 11px;
  }

  .v3-scenario-card,
  .v3-preset-card {
    min-height: auto;
  }

  .v3-brand-memory-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .v3-selected-memory-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .v3-production-entry {
    min-height: auto;
    padding: 16px;
  }

  .v3-production-entry::after {
    position: static;
    width: fit-content;
    margin-top: 4px;
  }

  .v3-production-entry strong,
  .v3-production-entry small {
    max-width: none;
  }

  .v3-style-confirm-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .v3-continuation-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .v3-brand-memory-actions-inline,
  .v3-continuation-buttons {
    justify-content: flex-start;
  }

  .v3-template-create-panel,
  .v3-project-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .v3-project-header-actions {
    max-width: none;
  }
}

@media (max-width: 520px) {
  .v3-history-list,
  .v3-project-history-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .v3-project-history-dialog {
    max-height: calc(100vh - 24px);
  }
}

/* Render Bridge follows the existing administrator panel and field language. */
.render-bridge-console fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.bridge-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 20px 0; }
.bridge-admin-grid .field { min-width: 0; }
.bridge-admin-grid input, .bridge-admin-grid select { width: 100%; min-width: 0; }
.bridge-admin-grid small { color: var(--muted, #716a62); font-size: 12px; }
.bridge-admin-result { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.7; padding: 16px; margin-top: 16px; border: 1px solid var(--line, #d5d0c8); border-radius: 12px; }
@media (max-width: 640px) { .bridge-admin-grid { grid-template-columns: minmax(0, 1fr); } .render-bridge-console .billing-actions { flex-wrap: wrap; } }
.bridge-admin-details { margin-top: 16px; border-top: 1px solid var(--line, #d5d0c8); padding-top: 14px; }
.bridge-admin-details > summary { cursor: pointer; color: var(--muted, #716a62); font-weight: 600; }
#bridgeAdminProfiles { flex-wrap: wrap; }
#bridgeAdminProfiles button[aria-pressed="true"] { border-color: var(--ink, #171411); background: var(--black-soft, #f3f0ea); box-shadow: inset 0 0 0 1px var(--ink, #171411); }
.render-bridge-console [hidden] { display: none !important; }

.bridge-reward-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.bridge-reward-toolbar .micro-copy { margin: 0; }
.bridge-reward-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.bridge-reward-stat { display: grid; gap: 5px; min-width: 0; padding: 15px 16px; border: 1px solid var(--line, #d5d0c8); border-radius: 13px; background: rgba(250, 249, 244, 0.78); }
.bridge-reward-stat > span, .bridge-node-metric > span { color: var(--muted, #716a62); font-size: 12px; line-height: 1.4; }
.bridge-reward-stat > strong { color: var(--ink, #171411); font-size: clamp(20px, 2vw, 27px); line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bridge-reward-stat > small { color: var(--muted, #716a62); font-size: 11px; line-height: 1.4; }
.bridge-node-list { display: grid; gap: 12px; min-width: 0; }
.bridge-node-card { display: grid; gap: 10px; min-width: 0; padding: 16px; border: 1px solid var(--line, #d5d0c8); border-radius: 14px; background: var(--panel, #fffdfa); }
.bridge-node-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.bridge-node-identity { display: grid; gap: 4px; min-width: 0; }
.bridge-node-identity > strong { color: var(--ink, #171411); font-size: 15px; line-height: 1.4; }
.bridge-node-identity > code { color: var(--muted, #716a62); font: 12px/1.45 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.bridge-node-status { flex: 0 0 auto; padding: 5px 10px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 650; line-height: 1.2; }
.bridge-node-status.is-online { color: #28593c; border-color: #c7ddcc; background: #eef7ef; }
.bridge-node-status.is-busy { color: #725018; border-color: #e9d7ac; background: #fbf5e7; }
.bridge-node-status.is-attention { color: #875044; border-color: #e9c9c1; background: #fcf0ed; }
.bridge-node-status.is-offline, .bridge-node-status.is-unknown { color: #6d675e; border-color: #dedbd4; background: #f3f1ed; }
.bridge-node-meta, .bridge-node-current { margin: 0; color: var(--muted, #716a62); font-size: 12px; line-height: 1.45; }
.bridge-node-current { color: #76571d; }
.bridge-node-current.is-idle { color: var(--muted, #716a62); }
.bridge-node-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 2px; }
.bridge-node-metric { display: grid; gap: 4px; min-width: 0; padding: 10px 12px; border-radius: 10px; background: rgba(248, 247, 241, 0.82); }
.bridge-node-metric > strong { color: var(--ink, #171411); font-size: 17px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bridge-node-empty { padding: 20px; border: 1px dashed var(--line, #d5d0c8); border-radius: 12px; color: var(--muted, #716a62); text-align: center; line-height: 1.5; }
@media (max-width: 760px) {
  .bridge-reward-summary, .bridge-node-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .bridge-reward-toolbar { align-items: flex-start; }
  .bridge-reward-summary { gap: 8px; }
  .bridge-reward-stat { padding: 12px; }
  .bridge-node-card { padding: 13px; }
  .bridge-node-heading { align-items: flex-start; }
  .bridge-node-stats { gap: 6px; }
  .bridge-node-metric { padding: 9px; }
}

/* Administrator modules are separate cards, without changing shared panels. */
.billing-admin-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
.billing-admin-page > .panel {
  margin: 0;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line, #d5d0c8);
  border-radius: 16px;
  background: var(--panel, #fffdfa);
  box-shadow: 0 4px 18px rgba(42, 34, 25, 0.045);
}
@media (max-width: 640px) {
  .billing-admin-page { gap: 18px; }
  .billing-admin-page > .panel { padding: 18px; border-radius: 14px; }
}

/* Compact, evidence-based result metadata and honor hidden states in display cards. */
.provider-panel[hidden],
.v2-provider-area[hidden],
.v2-model-card-grid-panel[hidden],
.v3-visual-asset-status[hidden],
.v3-visual-asset-create-feedback[hidden] {
  display: none !important;
}

.v2-output-meta {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.v2-output-meta > strong {
  flex: 1 1 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.v2-output-meta .v2-route-badge,
.v2-output-meta .v2-review-badge {
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  color: #49574c;
  background: rgba(47, 90, 69, 0.08);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.v2-output-meta .v2-route-badge.unknown,
.v2-output-meta .v2-review-badge {
  color: var(--muted);
  background: rgba(23, 20, 17, 0.06);
}

.v2-output-meta .v2-review-details {
  flex: 1 1 100%;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.v2-output-meta .v2-review-details summary {
  width: fit-content;
  cursor: pointer;
}

.v2-output-meta .v2-review-details p {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.v3-source-badge {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: #46564c !important;
  background: rgba(47, 90, 69, 0.08) !important;
  font-size: 11px !important;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.node-rewards-panel {
  display: grid;
  gap: 16px;
}

.node-rewards-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
}

.node-rewards-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.node-rewards-code-row[hidden] {
  display: none;
}

.node-rewards-code {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: rgba(248, 247, 241, 0.82);
  font: 600 14px/1.4 ui-monospace, Consolas, monospace;
}

.node-rewards-code-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.node-rewards-node-list {
  display: grid;
  gap: 10px;
}

.node-rewards-node {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(250, 249, 244, 0.75);
}

.node-rewards-node-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.node-rewards-node-heading strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.node-rewards-status {
  flex: 0 0 auto;
  color: var(--sage-deep);
  font-size: 12px;
}

.node-rewards-identity,
.node-rewards-execution {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.node-rewards-node-stats {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.node-rewards-node-stats span,
.node-rewards-node-stats small {
  color: var(--muted);
  font-size: 12px;
}

.node-rewards-node-stats strong {
  color: var(--sage-deep);
}

.node-rewards-policy {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .node-rewards-code-row {
    grid-template-columns: 1fr;
  }
}

.node-rewards-bind-form {
  display: grid;
  gap: 8px;
}

.node-rewards-id-label {
  color: var(--muted);
  font-size: 12px;
}

.node-rewards-id-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.node-rewards-node-id {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: rgba(248, 247, 241, 0.82);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .node-rewards-id-row {
    grid-template-columns: 1fr;
  }
}
