/* Final UI acceptance corrections. Keep theme colors paired with their surfaces. */
:root { --ui-font: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; }
body { padding-left: 0; }
.login-screen { overflow-y: auto; overscroll-behavior: contain; align-items: safe center; }
.login-card { flex-shrink: 0; margin-block: auto; }
.login-card h1 { font-family: var(--ui-font); font-weight: 700; letter-spacing: 0; }
.login-card label span { font-size: 13px; }
.login-card > .eyebrow { font-size: 12px; line-height: 1.6; letter-spacing: .08em; }
.login-mark > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.login-error, .dialog-form-error { font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; border: 1px solid var(--danger); }
:root[data-theme="midnight"] :is(.login-error, .dialog-form-error) { background: #3a202d; color: #ffc0cb; border-color: #a95064; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.login-error, .dialog-form-error) { background: #fff0f0; color: #922738; border-color: #cb7a86; }
@media (max-height: 620px) { .login-screen { align-items: start; padding-block: 20px; } .login-card { margin-block: 0; } }

/* The original brand reset was scoped to midnight, leaving light themes with a
   second body inset and a 34px badge wrapping the whole brand name. */
.app-sidebar .side-brand > .side-brand-mark { position: relative; display: block; width: 48px; height: 48px; flex: 0 0 48px; padding: 0; border: 0; background: none; box-shadow: none; }
.app-sidebar .side-brand > .side-brand-copy { display: block; width: auto; height: auto; min-width: 0; flex: 1; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.app-sidebar .side-brand-copy > b { display: block; font-family: var(--ui-font); font-size: 20px; line-height: 1.3; letter-spacing: .02em; }
.app-sidebar .side-brand-copy small { display: block; margin-top: 4px; font-size: 11px; line-height: 1.5; }
@media (min-width: 901px) {
  body { padding-left: 0; }
  .app-sidebar { width: 160px; }
  main { margin-left: 160px; }
  .topbar { left: 0; }
}
@media (max-width: 900px) {
  body { padding-left: 0; }
  main { margin-left: 0; }
  main > #create.studio-view:not([hidden]) { height: auto; min-height: calc(100dvh - 134px); overflow: visible; padding-bottom: 100px; }
}

/* Dialog contents should remain readable and reachable at short viewport heights. */
.theme-dialog, .material-dialog { scrollbar-gutter: stable; }
.dialog-head > div { min-width: 0; }
.dialog-head h2, .theme-dialog-head h2 { overflow-wrap: anywhere; }
.dialog-head > button, .theme-dialog-close { flex-shrink: 0; }
.material-dialog .dialog-actions { gap: 10px; }
.material-dialog .dialog-actions > button { min-height: 44px; }
.billing-budget-summary small, .billing-budget-summary > span, .point-price-list article > div small,
.point-price-list article > p span, .billing-list article > strong > small,
.points-rate-card :is(span, small), .points-recharge-preview span,
.points-recharge-dialog .dialog-head p:last-child,
.tasks-view .task-meta p, .tasks-view .task-kind-heading span { font-size: 12px; line-height: 1.6; }

/* Light palettes: override fixed navy surfaces from the legacy dashboard layer. */
:root:is([data-theme="mint"], [data-theme="terracotta"]) { color-scheme: light; background: var(--paper); color: var(--text); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(body, main, .home-view) { background: var(--paper); color: var(--text); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .topbar { background: var(--topbar-bg); border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .app-sidebar { background: var(--sidebar-bg); border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .side-brand-copy { color: var(--ink); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .side-brand-copy small { color: var(--muted); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .side-nav a { color: var(--sidebar-muted); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .side-nav a:is(:hover, .active) { background: var(--nav-active); color: var(--sidebar-ink); border-color: color-mix(in srgb, var(--sidebar-ink) 25%, transparent); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .side-nav a > i { color: inherit; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .side-nav a.active::before { background: var(--gold); box-shadow: none; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.topbar-motto, .profile-trigger, .icon-button, .profile-trigger > .app-icon) { color: var(--text); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.quota-chip, .model-chip, .topbar-popover, .topbar-popover.profile-menu) { background: var(--card); border-color: var(--line); color: var(--text); box-shadow: var(--shadow-soft); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.quota-chip > b, .profile-summary-avatar, .account-avatar) { background: var(--surface-strong); border-color: var(--line); color: var(--ink); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.profile-menu > a, .profile-menu > button, .profile-menu .profile-summary b) { color: var(--text); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.profile-menu > a:hover, .profile-menu > button:hover, .icon-button:hover) { background: var(--surface-soft); color: var(--ink); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.profile-menu .app-icon, .model-chip > .app-icon, .quota-chip > .app-icon) { color: var(--ink-2); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .model-chip b { color: var(--ink-2); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .profile-menu #logout-button { color: var(--danger); border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.profile-menu .profile-summary small, .notification-panel p) { color: var(--muted); }

:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .panel, .task-card, .publish-row, .quota-overview article, .account-card,
  .publish-summary article, .metric-grid article, .library-card,
  .image-step-panel, .image-output-panel, .image-history-card,
  .billing-budget-summary, .points-rate-card, .theme-dialog, .material-dialog,
  .theme-option, .product-details-dialog, .p2-work-card, .platform-copy-card,
  .p2-quick-picker-popover, .p2-picker-drawer, .p2-story-row, .p2-copy-source
) { background: var(--card); border-color: var(--line); color: var(--text); box-shadow: var(--shadow-soft); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .material-dialog .dialog-head, .theme-dialog .theme-dialog-head,
  .material-dialog .dialog-actions, .theme-dialog .theme-dialog-foot
) { background: var(--card); border-color: var(--line); color: var(--text); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .materials-view .library-toolbar, .tasks-view .task-toolbar, .billing-note,
  .billing-reconcile-stats article, .points-recharge-preview,
  .account-quota > div, .account-quota .account-points-balance,
  .material-image-picker, .voice-capture-box, .p2-selected-material,
  .p2-quick-option, .music-source-options button, .ai-music-option,
  .p2-setting-row .segment span, .image-mode-grid label > span,
  .style-preset-grid label > span, .user-material-card, .image-reference-upload,
  .image-template-upload, .storyboard-result, .copy-preview
) { background: var(--surface-soft); color: var(--text); border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .quota-overview article.remaining, .billing-view .quota-overview article.remaining,
  .point-price-icon, .metric-grid .metric-icon, .points-presets button,
  .p2-mini-action, .voice-record-select, .voice-preview
) { background: var(--surface-strong); color: var(--ink-2); border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select) { background: var(--card); color: var(--text); border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(input, textarea)::placeholder { color: var(--muted); opacity: 1; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(input, textarea, select):focus { border-color: var(--gold); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .secondary, .material-add, .task-card-actions button, .back-button,
  .theme-trigger, .library-card-actions .secondary, .audio-upload-button,
  .product-copy-tools button, .platform-copy-actions button
) { background: var(--card); color: var(--ink-2); border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.primary, .points-presets button.active) { background: var(--ink-2); color: #fff; border-color: var(--ink-2); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .material-filters button, .task-filters button, .recent-filter, .recent-more
) { color: var(--muted); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .material-filters button.active, .task-filters button.active, .recent-filter.active,
  .p2-setting-row .segment input:checked + span, .image-mode-grid input:checked + span,
  .style-preset-grid input:checked + span, .music-source-options button[aria-pressed="true"]
) { background: var(--surface-strong); border-color: var(--ink-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-2); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .page-intro h1, .dashboard-head h2, .section-heading h2, .admin-pricing h2,
  .billing-reconcile h2, .result-info h1, .dialog-head h2, .theme-dialog-head h2,
  .theme-option-copy b, .panel-title, .material-title, .field > span,
  .material-select-row label > span, .storyboard-field > span, .dialog-field > span,
  .library-card h3, .task-meta h3, .task-kind-heading h2, .publish-meta h3,
  .quota-overview strong, .account-meta h3, .account-quota b,
  .publish-summary strong, .metric-grid strong, .billing-budget-summary b,
  .billing-list article > strong, .point-price-list article > div b,
  .p2-card-title h2, .p2-narration-heading, .p2-combined-editor > span,
  .p2-selected-copy > b, .p2-quick-option b, .p2-picker-drawer > summary,
  .p2-story-row > summary, .p2-copy-source > summary, .p2-more-settings > summary,
  .p2-setting-row > legend, .p2-volume-row .music-volume-control output,
  .image-mode-grid b, .image-step-panel h2, .image-output-panel h2,
  .image-history-meta h3, .style-preset-grid b, .user-material-card b,
  .storyboard-result summary, .storyboard-result pre, .recent-heading h2,
  .recent-card-title, .product-selling-panel h3, .product-details-content,
  .platform-copy-heading, .platform-copy-card label
) { color: var(--text); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .page-intro > div > p:last-child, .dashboard-head > div > p:last-child,
  .section-heading > p, .theme-dialog-head p:last-child, .theme-option-copy small,
  .dialog-field > small, .material-intro, .muted, .empty-state p,
  .image-history-meta p, .library-card p, .task-meta p, .task-kind-heading span,
  .publish-meta p, .publish-meta small, .quota-overview small, .account-meta p,
  .account-quota small, .metric-grid small, .metric-grid em, .billing-budget-summary small,
  .billing-budget-summary > span, .billing-list article > strong > small,
  .point-price-list article > div small, .point-price-list article > p span,
  .points-rate-card span, .points-rate-card small, .points-recharge-preview span,
  .points-recharge-dialog .dialog-head p:last-child, .p2-card-title small,
  .p2-narration-heading small, .p2-narration-box > small, .p2-combined-editor > span small,
  .p2-selected-copy > small, .p2-quick-option small, .p2-final-cost span,
  .p2-final-cost small, .music-recommendation, .image-mode-grid small,
  .style-preset-grid small, .user-material-card small, .recent-card-date,
  .recent-empty, .recent-empty p, .recent-loading, .task-filter-set > small,
  .task-filter-count, .product-selling-panel p, .submit-note
) { color: var(--muted); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .point-price-list article > p strong, .points-rate-card strong,
  .points-recharge-preview strong, .account-quota .account-points-balance b,
  .p2-add-voice, .p2-model-row .video-model-note, .library-kind,
  .product-copy-tools button, .view:not(.home-view) .eyebrow
) { color: var(--ink-2); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .p2-final-cost strong { color: var(--ink-2) !important; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .billing-list .point-positive { color: #176a4c; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .billing-list .point-negative { color: #8c4c0c; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.p2-page-progress > span, .p2-page-progress > span > b) { color: var(--muted); background: transparent; border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .p2-page-progress > span.active { color: var(--ink-2); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .p2-page-progress > span.active > b { background: var(--ink-2); color: #fff; border-color: var(--ink-2); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.p2-page-progress > i, .header-divider) { background: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .home-panorama { background: var(--paper); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .home-panorama :is(.recent-card-title, .recent-card-date) { text-shadow: none; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .mobile-nav { background: var(--card); border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .toast { background: var(--sidebar-bg); color: var(--sidebar-ink); }
@media (max-width: 560px) {
  .point-price-list article { grid-template-columns: 36px minmax(0, 1fr); }
  .point-price-list article > p { grid-column: 2; flex-wrap: wrap; justify-content: flex-start; padding-bottom: 12px; }
  .billing-budget-summary > span { white-space: normal; }
  .points-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Final interaction states and readable professional layout. */
:root body :is(input, textarea, select, button) { font-family: var(--ui-font); }
:root[data-theme] .app-sidebar .side-brand-copy > b { font-family: var(--ui-font); font-size: 20px; line-height: 1.3; }
:root[data-theme] .app-sidebar .side-brand > .side-brand-mark { width: 48px; height: 48px; flex-basis: 48px; }
:root[data-theme] .app-sidebar .side-brand-mark img { width: 48px; height: 48px; }
:root[data-theme] button:disabled,
.studio-view #creation-form button:disabled,
:root[data-theme] #image-submit-button:disabled {
  background: var(--surface-strong);
  color: var(--muted);
  border: 1px dashed var(--muted);
  box-shadow: none;
  opacity: 1;
  filter: none;
  cursor: not-allowed;
}
:root[data-theme="midnight"] button:disabled,
:root[data-theme="midnight"] #creation-form button:disabled,
:root[data-theme="midnight"] #image-submit-button:disabled { background: #203248; color: #a8b9ce; border-color: #73869e; }
#creation-form[data-experience="professional"] .guide-directions > div { grid-template-columns: 1fr; }
#creation-form[data-experience="professional"] .p2-card-title { flex-wrap: wrap; gap: 8px; }
#creation-form[data-experience="professional"] .p2-card-title h2 { white-space: nowrap; }
@media (min-width: 1201px) and (max-width: 1500px) {
  #creation-form[data-experience="professional"] .p2-three-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #creation-form[data-experience="professional"] .p2-video-settings { grid-column: 1 / -1; }
  #creation-form[data-experience="professional"] .p2-video-settings .p2-settings-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 900px) {
  .mobile-nav a { min-width: 0; flex: 1 1 0; font-size: 11px; line-height: 1.35; white-space: nowrap; }
  .mobile-nav a .app-icon { width: 22px; height: 22px; }
}
@media (max-width: 560px) {
  #material-delete-dialog .dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #material-delete-dialog .dialog-actions > span { display: none; }
  #material-delete-dialog .dialog-actions button { padding-inline: 12px; }
}


/* Narrow image workspace: captions and source cards must not keep desktop widths. */
.image-studio-view .image-product-grid .user-material-card,
.p2-picker-body .user-material-grid .user-material-card { min-width: 0; }
@media (max-width: 700px) {
  .selling-panel-heading { flex-wrap: wrap; align-items: flex-start; }
  .selling-panel-heading > b { flex: 1 0 100%; }
  .selling-panel-heading > button { align-self: flex-start; }
  .view:not(.home-view) .panel-title { flex-wrap: wrap; align-items: flex-start; gap: 8px; }
  .view:not(.home-view) .panel-title > span { flex: 1 0 100%; }
  .image-step-panel .panel-title small { text-align: left; line-height: 1.6; }
  .image-studio-view .style-preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-studio-view .image-product-grid { overflow-x: hidden; scrollbar-width: thin; }
  .image-studio-view :is(.product-category-filters, .product-series-filters) { flex-wrap: wrap; overflow: visible; margin-right: 0; padding-right: 0; }
  .image-studio-view .product-series-filters { padding-right: 10px; }
}
@media (max-width: 480px) {
  .image-studio-view :is(.image-step-panel, .image-output-panel) { padding: 18px 14px; }
  .image-studio-view .image-product-grid { grid-template-columns: 1fr; }
  .image-studio-view .image-product-grid .user-material-card > img { height: 150px; }
  .product-copy-tools small { flex-basis: 100%; min-width: 0; }
}

/* Small helper text must retain contrast on the light palettes' tinted cards. */
:root[data-theme="mint"] { --muted: #48655d; }
:root[data-theme="terracotta"] { --muted: #715950; --gold: #a64a2a; }

/* Light home surfaces and short desktop navigation. */
:root:is([data-theme="mint"], [data-theme="terracotta"]) .home-panorama::before,
:root:is([data-theme="mint"], [data-theme="terracotta"]) .home-panorama::after { display: none; }
@media (min-width: 901px) {
  .app-sidebar .side-nav { min-height: 0; max-height: calc(100dvh - 96px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 12px; }
}

/* Result metadata wraps by complete labels rather than shrinking each label. */
.result-layout { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 32px; }
.result-layout > * { min-width: 0; }
.result-info h1 { margin-bottom: 16px; font-family: var(--ui-font); font-size: clamp(28px, 2.5vw, 32px); font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.result-specs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.result-specs span { flex: 0 1 auto; width: auto; max-width: 100%; padding: 7px 10px; font-size: 12px; line-height: 1.6; word-break: normal; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .result-layout { grid-template-columns: 1fr; gap: 20px; }
  .result-info h1 { font-size: 28px; }
}

/* Consistent dialog typography and compact material rows with few records. */
:root dialog h2 { font-family: var(--ui-font); font-size: 26px; font-weight: 700; line-height: 1.35; }
.materials-view .material-library { align-content: start; grid-auto-rows: auto; }
.tasks-view .task-tags { flex-wrap: wrap; overflow: visible; }
.task-tags span { font-size: 11px; line-height: 1.5; }
.point-price-list article { grid-template-columns: 38px minmax(0, .7fr) minmax(0, 1.3fr); }
.point-price-list article > p { flex-wrap: wrap; gap: 12px; }
@media (max-width: 560px) {
  :root dialog h2 { font-size: 24px; }
  .point-price-list article { grid-template-columns: 36px minmax(0, 1fr); }
}

/* Recheck fixes shared by warm and mint themes. */
:root[data-theme] .app-sidebar .side-brand { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
:root[data-theme] .app-sidebar .side-brand > .side-brand-mark { flex: 0 0 48px; min-width: 48px; max-width: 48px; margin: 0; padding: 0; }
:root[data-theme] .app-sidebar .side-brand > .side-brand-copy { flex: 0 1 auto; width: auto; min-width: 0; height: auto; margin: 0; padding: 0; display: block; place-items: start; text-align: left; font-style: normal; }
:root[data-theme] .app-sidebar .side-brand-copy > b { margin: 0; text-align: left; }
.materials-view .library-toolbar { flex-wrap: wrap; }
.materials-view :is(.material-filters, .library-actions) { flex-wrap: wrap; min-width: 0; overflow: visible; }
.materials-view :is(.material-filters, .library-actions) button { flex: 0 0 auto; white-space: nowrap; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.p2-change-button, .p2-selected-copy i) { background: var(--surface-strong); color: var(--ink-2); border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) #creation-form .p2-change-button { color: var(--ink-2); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .p2-change-button:is(:hover, [aria-expanded="true"]) { background: var(--ink-2); color: #fff; border-color: var(--ink-2); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) #creation-form .p2-change-button:is(:hover, [aria-expanded="true"]) { color: #fff; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .task-search { background: var(--card); color: var(--text); border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .task-search input { background: transparent; color: var(--text); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .task-search .app-icon { color: var(--muted); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .view:not(.home-view) .panel-title > span > b { background: var(--surface-strong); border-color: var(--line); color: var(--ink-2); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .quota-overview .remaining :is(small, span) { color: var(--muted); }
:root .empty-state h2 { font-family: var(--ui-font); font-size: 24px; font-weight: 700; line-height: 1.4; }


/* Form palette has priority over legacy selectors containing multiple :not(). */
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]),
  textarea, select
) { background: var(--card) !important; color: var(--text) !important; border-color: var(--line) !important; color-scheme: light; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(input, textarea)::placeholder { color: var(--muted) !important; opacity: 1; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(input, textarea, select):focus { border-color: var(--gold) !important; outline: 2px solid var(--gold); outline-offset: 2px; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.platform-copy-panel, .image-history-card > .platform-copy-panel) { background: var(--surface-soft); border-color: var(--line); color: var(--text); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.platform-copy-heading small, .platform-copy-note, .platform-image-select) { color: var(--muted); }
.platform-copy-heading small, .platform-copy-note, .platform-copy-actions button, .platform-copy-heading button { font-size: 12px; line-height: 1.6; }
.platform-copy-card textarea { font-size: 13px; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .billing-connection { background: var(--surface-soft); color: var(--text); border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.billing-connection.failed, .billing-connection.missing) { background: #fff0f0; color: #922738; border-color: #cb7a86; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.billing-connection.succeeded, .billing-connection.ready) { background: #e8f2eb; color: #236142; border-color: #6e9b7d; }
:root[data-theme] button:disabled {
  background: var(--surface-strong) !important;
  color: var(--muted) !important;
  border: 1px dashed var(--muted) !important;
  box-shadow: none !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  cursor: not-allowed;
}
:root[data-theme="midnight"] button:disabled { background: #203248 !important; color: #a8b9ce !important; border-color: #73869e !important; }

/* Audit of remaining fixed light helper colors in active creation controls. */
:root:is([data-theme="mint"], [data-theme="terracotta"]) #music-recommendation { color: var(--muted); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) #music-recommendation b { color: var(--ink-2); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .p2-quick-picker-popover > header, .p2-quick-picker-search,
  .p2-quick-picker-popover > header button
) { background: var(--surface-soft); color: var(--text); border-color: var(--line); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .p2-quick-picker-popover > header b, .p2-quick-picker-popover > header button:hover,
  .p2-advanced-copy > summary, .creation-toolbar .toolbar-tip b,
  .p2-story-row > summary .app-icon
) { color: var(--text); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(
  .p2-quick-picker-popover > header small, .p2-quick-picker-search > span,
  .p2-quick-picker-search .app-icon, .p2-quick-picker-empty,
  .p2-advanced-copy > summary small, .creation-toolbar > button small,
  .creation-toolbar .toolbar-tip span, .p2-story-row > summary > span:nth-child(2),
  .voice-capture-box > span, .voice-capture-box > b, .voice-capture-box > small
) { color: var(--muted); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .p2-quick-option:hover { background: var(--surface-strong); border-color: var(--gold); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .p2-quick-option.selected > .app-icon { color: var(--ink-2); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .cost-estimate strong { color: var(--ink-2) !important; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .cost-estimate strong.over { color: #922738 !important; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) .task-load-warning { background: #fff3df; color: #795018; border-color: #b78c4b; }
.voice-capture-box > span, .voice-capture-box > b, .voice-capture-box > small { font-size: 12px; line-height: 1.6; }

/* Missing portrait photos use paired theme colors, including midnight. */
.library-cover.portrait { background: var(--surface-strong); }
.library-cover > .p2-portrait-placeholder { background: var(--surface-strong); color: var(--text); }
.library-cover .p2-portrait-placeholder b { color: var(--text); }
.library-cover .p2-portrait-placeholder small { color: var(--muted); }
.library-cover .portrait-placeholder { background: var(--surface-strong); color: var(--text); font-family: var(--ui-font); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.p2-material-placeholder, .p2-person-preview-placeholder, .p2-quick-option-placeholder) { background: var(--surface-strong); color: var(--text); }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.p2-material-placeholder, .p2-person-preview-placeholder) :is(b, .app-icon) { color: var(--text) !important; }
:root:is([data-theme="mint"], [data-theme="terracotta"]) :is(.p2-material-placeholder, .p2-person-preview-placeholder) :is(small, span) { color: var(--muted); }

/* Account initials use paired tokens instead of accent text on an ink gradient. */
:root[data-theme] .account-main > span {
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--line);
  font-family: var(--ui-font);
  font-weight: 700;
}

/* Material descriptions must contribute to the card's intrinsic row height. */
.materials-view .material-library { grid-auto-rows: max-content; align-content: start; }
.materials-view .library-card { height: auto; min-height: 0; }
.materials-view .library-card-body { flex: 1 0 auto; min-height: auto; }
.materials-view .library-card-body > * { flex-shrink: 0; }
.materials-view .library-card-body p { flex: 0 0 auto; min-height: auto; height: auto; line-height: 1.65; overflow-wrap: anywhere; }
.materials-view .library-card-actions { flex-shrink: 0; margin-top: auto; padding-top: 12px; }
