/* KAMOD UIX V3 — presentation primitives only.
   Workflow state, pricing, provider selection and API behavior stay in the
   owning templates. Scope every override to .kamod-uix-v3. */

.kamod-uix-v3 {
  --k3-bg: #0A0A0F;
  --k3-bg-deep: #07080d;
  --k3-panel: rgba(255,255,255,.04);
  --k3-panel-strong: rgba(255,255,255,.065);
  --k3-panel-hover: rgba(255,255,255,.08);
  --k3-border: rgba(255,255,255,.105);
  --k3-border-strong: rgba(255,255,255,.18);
  --k3-text: #f6f7fb;
  --k3-muted: #9aa3b7;
  --k3-subtle: #697287;
  --k3-orange: #FF6B35;
  --k3-orange-hover: #ff8255;
  --k3-orange-soft: rgba(255,107,53,.14);
  --k3-blue: #4389ff;
  --k3-blue-soft: rgba(67,137,255,.13);
  --k3-green: #55dfa0;
  --k3-danger: #ff6f86;
  --k3-radius: 16px;
  --k3-radius-sm: 11px;
  --k3-shadow: 0 22px 70px rgba(0,0,0,.32);
  --bg: var(--k3-bg);
  --bg-soft: #0d111b;
  --surface: var(--k3-panel);
  --surface-2: rgba(255,255,255,.035);
  --surface-3: rgba(255,255,255,.06);
  --line: var(--k3-border);
  --line-strong: var(--k3-border-strong);
  --border: var(--k3-border);
  --border-soft: rgba(255,255,255,.075);
  --ink: var(--k3-text);
  --ink-dim: var(--k3-muted);
  --ink-dim-2: var(--k3-subtle);
  --text: var(--k3-text);
  --text-soft: #bcc3d2;
  --text-dim: var(--k3-muted);
  --accent: var(--k3-blue);
  --accent-2: #2674f4;
  --accent-soft: var(--k3-blue-soft);
  --warm: var(--k3-orange);
  --warm-2: var(--k3-orange);
  --warm-soft: var(--k3-orange-soft);
  --warm-ink: #fff;
  background:
    radial-gradient(circle at 82% -12%, rgba(44,100,210,.10), transparent 34%),
    radial-gradient(circle at 12% 22%, rgba(255,107,53,.045), transparent 25%),
    linear-gradient(180deg, #0b0e16 0%, var(--k3-bg) 42%, var(--k3-bg-deep) 100%);
  color: var(--k3-text);
  letter-spacing: -.02em;
}

.kamod-uix-v3 .kamod-shell {
  grid-template-columns: 204px minmax(0,1fr);
}

.kamod-uix-v3 .kamod-rail {
  padding: 14px 10px 16px;
  background: rgba(7,11,19,.9);
  border-right-color: var(--k3-border);
  box-shadow: 18px 0 60px rgba(0,0,0,.12);
}

.kamod-uix-v3 .rail-brand {
  height: 50px;
  padding: 4px 8px;
  margin-bottom: 8px;
}

.kamod-uix-v3 .rail-link {
  min-height: 42px;
  padding: 9px 10px;
  gap: 11px;
  border-radius: 11px;
  color: #a4adbf;
  font-size: .835rem;
  font-weight: 650;
  letter-spacing: -.012em;
}

.kamod-uix-v3 .rail-link:hover {
  color: var(--k3-text);
  background: var(--k3-panel);
  border-color: var(--k3-border);
}

.kamod-uix-v3 .rail-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(33,93,185,.32), rgba(33,93,185,.18));
  border-color: rgba(67,137,255,.58);
  box-shadow: inset 0 0 0 1px rgba(67,137,255,.06), 0 10px 30px rgba(0,0,0,.14);
}

.kamod-uix-v3 .rail-divider { margin: 8px 6px; }

.kamod-uix-v3 .kamod-topbar {
  height: 60px;
  padding: 0 20px;
  gap: 10px;
  background: rgba(7,11,19,.82);
  border-bottom-color: var(--k3-border);
  box-shadow: 0 10px 40px rgba(0,0,0,.12);
}

.kamod-uix-v3 .topbar-crumb {
  font-size: .83rem;
  letter-spacing: -.01em;
}

.kamod-uix-v3 .topbar-balance,
.kamod-uix-v3 .topbar-admin,
.kamod-uix-v3 .kamod-lang-switcher > * {
  min-height: 38px;
  border-color: var(--k3-border);
  background: var(--k3-panel);
}

.kamod-uix-v3 .topbar-topup {
  min-height: 38px;
  padding-inline: 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--k3-orange), #ff7d45);
  box-shadow: 0 10px 26px rgba(255,107,53,.18);
  color: #fff;
}

.kamod-uix-v3 .topbar-topup:hover {
  background: linear-gradient(135deg, var(--k3-orange-hover), var(--k3-orange));
  transform: translateY(-1px);
}

.kamod-uix-v3 .kamod-shell-page {
  width: 100%;
  padding: 24px 24px 42px;
}

.kamod-uix-v3 .shell-page-header {
  max-width: 1480px;
  margin: 0 auto 18px;
}

.kamod-uix-v3 .shell-page-title {
  color: var(--k3-text);
  font-size: clamp(1.8rem, 2.3vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.kamod-uix-v3 .shell-hero-stack {
  margin-top: 7px;
  color: var(--k3-muted);
  font-size: .93rem;
  line-height: 1.5;
}

.kamod-uix-v3 :is(button, a, input, textarea, select):focus-visible {
  outline: 3px solid rgba(67,137,255,.42);
  outline-offset: 2px;
}

/* Shared page primitives. These classes are opt-in and contain no behavior. */
.k3-page {
  width: min(1480px, 100%);
  margin: 0 auto;
}

.k3-panel {
  background:
    linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  border: 1px solid var(--k3-border);
  border-radius: var(--k3-radius);
  box-shadow: 0 16px 50px rgba(0,0,0,.16);
}

.k3-panel-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--k3-border);
}

.k3-panel-title {
  color: var(--k3-text);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -.025em;
}

.k3-eyebrow {
  color: var(--k3-muted);
  font-size: .69rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.k3-primary,
.k3-secondary,
.k3-ghost {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: .84rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}

.k3-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--k3-orange), #ff7d45);
  box-shadow: 0 10px 24px rgba(255,107,53,.18);
}

.k3-primary:hover { transform: translateY(-1px); background: linear-gradient(135deg, var(--k3-orange-hover), var(--k3-orange)); }
.k3-secondary { color: #fff; background: var(--k3-blue-soft); border-color: rgba(67,137,255,.55); }
.k3-secondary:hover { background: rgba(67,137,255,.22); }
.k3-ghost { color: var(--k3-muted); background: var(--k3-panel); border-color: var(--k3-border); }
.k3-ghost:hover { color: #fff; background: var(--k3-panel-hover); border-color: var(--k3-border-strong); }
.k3-primary:disabled,.k3-secondary:disabled,.k3-ghost:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.k3-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid var(--k3-border);
  border-radius: 999px;
  color: var(--k3-muted);
  background: var(--k3-panel);
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.k3-pill.success { color: var(--k3-green); border-color: rgba(85,223,160,.24); background: rgba(85,223,160,.08); }
.k3-pill.orange { color: #ff9b75; border-color: rgba(255,107,53,.26); background: var(--k3-orange-soft); }

.k3-input {
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid var(--k3-border);
  border-radius: var(--k3-radius-sm);
  background: rgba(5,9,17,.5);
  color: var(--k3-text);
  font: inherit;
  font-size: .86rem;
}

.k3-input::placeholder { color: #6e788c; }
.k3-input:focus { border-color: rgba(67,137,255,.7); box-shadow: 0 0 0 3px rgba(67,137,255,.09); }

.k3-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 28px;
  border: 1px dashed var(--k3-border-strong);
  border-radius: 14px;
  color: var(--k3-muted);
  text-align: center;
  line-height: 1.55;
}

@media (max-width: 1040px) {
  .kamod-uix-v3 .kamod-shell { grid-template-columns: 76px minmax(0,1fr); }
  .kamod-uix-v3 .rail-brand::after,
  .kamod-uix-v3 .rail-link .rail-tip { display: none; }
  .kamod-uix-v3 .rail-link { justify-content: center; padding-inline: 8px; }
}

@media (max-width: 720px) {
  .kamod-uix-v3 .kamod-shell { grid-template-columns: 1fr; }
  .kamod-uix-v3 .kamod-rail {
    position: relative;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 9px 10px;
    gap: 5px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--k3-border);
  }
  .kamod-uix-v3 .rail-brand { width: 44px; height: 44px; padding: 0; margin: 0; flex: 0 0 44px; }
  .kamod-uix-v3 .rail-link { min-width: 58px; min-height: 44px; padding: 7px 5px; gap: 3px; flex-direction: column; }
  .kamod-uix-v3 .rail-link .rail-tip { display: block; max-width: 64px; overflow: hidden; text-overflow: ellipsis; font-size: 8.5px; }
  .kamod-uix-v3 .rail-link[style*="margin-top:auto"] { margin-top: 0 !important; }
  .kamod-uix-v3 .kamod-shell-page { padding: 18px 12px 30px; }
  .kamod-uix-v3 .kamod-topbar { height: 56px; padding: 0 10px; overflow-x: auto; scrollbar-width: none; }
  .kamod-uix-v3 .kamod-topbar::-webkit-scrollbar { display: none; }
  .kamod-uix-v3 .kamod-topbar > * { flex-shrink: 0; }
  .kamod-uix-v3 .topbar-admin span,
  .kamod-uix-v3 .topbar-topup span,
  .kamod-uix-v3 .topbar-balance small { display: none; }
}

/* Native production surfaces: visual migration only. Existing IDs, values,
   inline handlers and request code remain in their original templates. */
.kamod-uix-v3 :is(.shell-topbar,.shell-stage,.shell-content) { width: 100%; }
.kamod-uix-v3 .shell-topbar { max-width: 1480px; margin: 0 auto 16px; }
.kamod-uix-v3 .shell-page-sub { max-width: 760px; margin-top: 7px; color: var(--k3-muted); font-size: .88rem; line-height: 1.5; }
.kamod-uix-v3 .shell-status { border-color: var(--k3-border); background: var(--k3-panel); color: var(--k3-muted); }
.kamod-uix-v3 .shell-stage { max-width: 1480px; margin-inline: auto; }
.kamod-uix-v3 .shell-content { padding: 0 !important; }
.kamod-uix-v3 .shell-pill { display: none !important; }
.kamod-uix-v3 .shell-embed { border: 0 !important; border-radius: 0 !important; background: transparent !important; }

.kamod-uix-v3 :is(.v2-workspace,.director-stage,.storyboard-stage) { gap: 12px !important; }
.kamod-uix-v3 :is(.v2-panel,.v2-card,.director-card,.director-history,.storyboard-card,.storyboard-panel,.storyboard-history) {
  border-color: var(--k3-border) !important;
  border-radius: 16px !important;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018)) !important;
  box-shadow: none !important;
}

.kamod-uix-v3 .v2-provider-rail {
  padding: 10px !important;
  border: 1px solid var(--k3-border) !important;
  border-radius: 16px !important;
  background: rgba(255,255,255,.025) !important;
}

.kamod-uix-v3 .v2-rail-label { margin: 10px 9px 6px !important; color: var(--k3-subtle) !important; font-size: .64rem !important; letter-spacing: .11em !important; }
.kamod-uix-v3 .v2-provider-btn { margin: 0 0 5px !important; padding: 12px !important; border: 1px solid transparent !important; border-radius: 11px !important; background: transparent !important; }
.kamod-uix-v3 .v2-provider-btn:hover { border-color: var(--k3-border) !important; background: var(--k3-panel) !important; }
.kamod-uix-v3 .v2-provider-btn.active { border-color: rgba(67,137,255,.6) !important; background: linear-gradient(135deg, rgba(67,137,255,.23), rgba(67,137,255,.09)) !important; }
.kamod-uix-v3 .v2-provider-title { color: var(--k3-text) !important; font-size: .83rem !important; }
.kamod-uix-v3 .v2-provider-sub { display: -webkit-box; margin-top: 4px !important; overflow: hidden; color: var(--k3-muted) !important; font-size: .7rem !important; line-height: 1.4 !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kamod-uix-v3 .v2-provider-btn:not(.active) .v2-provider-sub { -webkit-line-clamp: 1; }

.kamod-uix-v3 :is(.v2-panel-head,.v2-result-head) { border-color: var(--k3-border) !important; }
.kamod-uix-v3 :is(.v2-panel-title,.director-card-title,.storyboard-section-label) { color: var(--k3-text) !important; }
.kamod-uix-v3 :is(.v2-panel-copy,.v2-field-hint,.director-note,.storyboard-intro,.storyboard-ref-note) { color: var(--k3-muted) !important; }
.kamod-uix-v3 :is(.v2-input,.v2-textarea,.director-input,.director-textarea,.director-select,.storyboard-input,.storyboard-textarea) { border-color: var(--k3-border) !important; border-radius: 11px !important; background: rgba(4,8,15,.52) !important; color: var(--k3-text) !important; }
.kamod-uix-v3 :is(.v2-input,.v2-textarea,.director-input,.director-textarea,.director-select,.storyboard-input,.storyboard-textarea):focus { border-color: rgba(67,137,255,.72) !important; box-shadow: 0 0 0 3px rgba(67,137,255,.10) !important; }
.kamod-uix-v3 :is(.v2-dropzone,.director-dropzone,.ref-slot) { border-color: var(--k3-border-strong) !important; border-style: dashed !important; border-radius: 13px !important; background: rgba(255,255,255,.018) !important; }
.kamod-uix-v3 :is(.v2-dropzone,.director-dropzone,.ref-slot):hover { border-color: rgba(67,137,255,.56) !important; background: rgba(67,137,255,.055) !important; }
.kamod-uix-v3 :is(.v2-submit,.v2-btn-primary,.director-submit,.generate-btn) { min-height: 46px !important; border: 0 !important; border-radius: 11px !important; background: linear-gradient(135deg, var(--k3-orange), #ff7d45) !important; color: #fff !important; font-weight: 800 !important; box-shadow: 0 12px 28px rgba(255,107,53,.16) !important; }
.kamod-uix-v3 :is(.v2-submit,.v2-btn-primary,.director-submit,.generate-btn):hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.kamod-uix-v3 :is(.v2-pill,.director-res-btn,.storyboard-pill) { border-color: var(--k3-border) !important; background: var(--k3-panel) !important; color: var(--k3-muted) !important; box-shadow: none !important; }
.kamod-uix-v3 :is(.v2-pill,.director-res-btn).active,
.kamod-uix-v3 .director-res-btn.selected { border-color: rgba(67,137,255,.56) !important; background: rgba(67,137,255,.16) !important; color: #fff !important; }
.kamod-uix-v3 :is(.director-model-card,.v2-model-card) { border-color: var(--k3-border) !important; background: var(--k3-panel) !important; border-radius: 12px !important; }
.kamod-uix-v3 :is(.director-model-card,.v2-model-card).selected { border-color: rgba(255,107,53,.72) !important; background: var(--k3-orange-soft) !important; }
.kamod-uix-v3 :is(.director-cost-line,.sb-cost-line,.v2-price-box) { border-color: rgba(255,107,53,.32) !important; background: rgba(255,107,53,.055) !important; border-radius: 12px !important; }
.kamod-uix-v3 :is(.v2-result-media video,.v2-result-media img,.director-image-wrap img,.storyboard-result img) { max-width: 100%; border-radius: 13px; }

@media (max-width: 980px) {
  .kamod-uix-v3 :is(.director-stage,.storyboard-stage,.v2-workflow-grid) { grid-template-columns: 1fr !important; }
  .kamod-uix-v3 .v2-provider-rail { min-height: 72px; align-items: stretch !important; overflow-y: hidden !important; }
  .kamod-uix-v3 .v2-provider-btn { min-height: 50px !important; display: flex !important; align-items: center !important; }
  .kamod-uix-v3 .v2-provider-title { display: block !important; overflow: visible !important; color: var(--k3-text) !important; line-height: 1.25 !important; }
  .kamod-uix-v3 .v2-provider-sub { display: none !important; }
}

[data-theme="light"] .kamod-uix-v3 {
  --k3-bg: #f5f7fb;
  --k3-bg-deep: #edf1f7;
  --k3-panel: rgba(255,255,255,.78);
  --k3-panel-strong: #fff;
  --k3-panel-hover: #fff;
  --k3-border: rgba(24,35,56,.11);
  --k3-border-strong: rgba(24,35,56,.18);
  --k3-text: #182033;
  --k3-muted: #5e687b;
  --k3-subtle: #818a9a;
  background: linear-gradient(180deg,#f7f9fc,#eef2f7);
}

[data-theme="light"] .kamod-uix-v3 .kamod-rail,
[data-theme="light"] .kamod-uix-v3 .kamod-topbar { background: rgba(255,255,255,.88); }

[data-theme="light"] .kamod-uix-v3 .rail-link { color: #5e687b; }
[data-theme="light"] .kamod-uix-v3 .rail-link:hover { color: #182033; }
[data-theme="light"] .kamod-uix-v3 .rail-link.active {
  color: #174ea6;
  background: linear-gradient(135deg, rgba(37,99,235,.16), rgba(37,99,235,.08));
  border-color: rgba(37,99,235,.42);
}

/* Same-origin workspaces inside the V3 shell. The owning templates keep every
   workflow handler and DOM hook; this layer only normalizes presentation. */
.kamod-embed-v3 {
  --k3-bg: #0A0A0F;
  --k3-panel: rgba(255,255,255,.04);
  --k3-panel-strong: rgba(255,255,255,.065);
  --k3-border: rgba(255,255,255,.105);
  --k3-border-strong: rgba(255,255,255,.18);
  --k3-text: #f6f7fb;
  --k3-muted: #9aa3b7;
  --k3-subtle: #697287;
  --k3-orange: #FF6B35;
  --k3-blue: #4389ff;
  --bg: transparent;
  --bg-soft: #0d111b;
  --surface: var(--k3-panel);
  --surface-2: rgba(255,255,255,.035);
  --surface-3: rgba(4,8,15,.48);
  --line: var(--k3-border);
  --line-strong: var(--k3-border-strong);
  --border: var(--k3-border);
  --border-soft: rgba(255,255,255,.075);
  --ink: var(--k3-text);
  --ink-dim: var(--k3-muted);
  --ink-dim-2: var(--k3-subtle);
  --text: var(--k3-text);
  --text-soft: #bcc3d2;
  --text-dim: var(--k3-muted);
  --accent: var(--k3-blue);
  --accent-2: #2674f4;
  --accent-soft: rgba(67,137,255,.13);
  width: 100%;
  min-height: 0;
  padding: 8px 8px 26px !important;
  align-items: stretch !important;
  background: transparent !important;
  color: var(--k3-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: -.02em;
}

.kamod-embed-v3 > nav,
.kamod-embed-v3 > header { display: none !important; }

.kamod-embed-v3 :is(.wrapper,.container,.studio-wrap,.main-wrap) {
  width: 100% !important;
  max-width: none !important;
  margin-inline: auto !important;
}

.kamod-embed-v3 :is(.card,.panel,.renderer-card,.result-card,.history-card,.model-card,.mode-tab,.section-tabs,.sub-tabs) {
  border-color: var(--k3-border) !important;
  box-shadow: none !important;
}

.kamod-embed-v3 :is(.card,.renderer-card,.result-card,.history-card) {
  border-radius: 16px !important;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018)) !important;
}

.kamod-embed-v3 :is(.section-tabs,.sub-tabs,.mode-tabs) {
  padding: 5px;
  border-radius: 13px !important;
  background: rgba(2,6,13,.44) !important;
}

.kamod-embed-v3 :is(.section-tab,.sub-tab,.mode-tab) {
  min-height: 42px;
  border-radius: 10px !important;
  border-color: transparent !important;
  background: transparent !important;
  color: var(--k3-muted) !important;
  box-shadow: none !important;
}

.kamod-embed-v3 :is(.section-tab,.sub-tab,.mode-tab).active {
  border-color: rgba(67,137,255,.48) !important;
  background: linear-gradient(135deg, rgba(67,137,255,.23), rgba(67,137,255,.10)) !important;
  color: #fff !important;
}

.kamod-embed-v3 :is(.model-card,.renderer-option) {
  min-height: 82px;
  padding: 14px !important;
  border-radius: 13px !important;
  border-color: var(--k3-border) !important;
  background: rgba(255,255,255,.025) !important;
  box-shadow: none !important;
}

.kamod-embed-v3 :is(.model-card,.renderer-option):hover {
  border-color: rgba(67,137,255,.42) !important;
  background: rgba(67,137,255,.075) !important;
  transform: translateY(-1px);
}

.kamod-embed-v3 :is(.model-card,.renderer-option).selected,
.kamod-embed-v3 .renderer-option.active {
  border-color: rgba(255,107,53,.76) !important;
  background: linear-gradient(145deg, rgba(255,107,53,.15), rgba(255,107,53,.045)) !important;
}

.kamod-embed-v3 :is(input[type=text],input[type=number],input[type=url],textarea,select) {
  min-height: 44px;
  border: 1px solid var(--k3-border) !important;
  border-radius: 11px !important;
  background: rgba(4,8,15,.55) !important;
  color: var(--k3-text) !important;
}

.kamod-embed-v3 :is(input,textarea,select):focus {
  border-color: rgba(67,137,255,.72) !important;
  box-shadow: 0 0 0 3px rgba(67,137,255,.10) !important;
}

.kamod-embed-v3 :is(.dropzone,.upload-zone,.ref-slot,.upload-area) {
  border-style: dashed !important;
  border-color: var(--k3-border-strong) !important;
  border-radius: 13px !important;
  background: rgba(255,255,255,.018) !important;
}

.kamod-embed-v3 :is(.dropzone,.upload-zone,.ref-slot,.upload-area):hover {
  border-color: rgba(67,137,255,.56) !important;
  background: rgba(67,137,255,.055) !important;
}

.kamod-embed-v3 :is(.generate-btn,.btn-primary,.action-btn),
.kamod-embed-v3 .submit-btn:not([id$="-cancel"]):not(.secondary):not(.ghost) {
  min-height: 46px;
  border-radius: 11px !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--k3-orange), #ff7d45) !important;
  color: #fff !important;
  font-weight: 800 !important;
  box-shadow: 0 12px 28px rgba(255,107,53,.16) !important;
}

.kamod-embed-v3 :is(.generate-btn,.btn-primary,.action-btn):hover:not(:disabled),
.kamod-embed-v3 .submit-btn:not([id$="-cancel"]):not(.secondary):not(.ghost):hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.kamod-embed-v3 :is(.generate-btn,.btn-primary,.action-btn):disabled,
.kamod-embed-v3 .submit-btn:not([id$="-cancel"]):not(.secondary):not(.ghost):disabled {
  opacity: .45;
  cursor: not-allowed;
}

.kamod-embed-v3 :is(.card-title,.card h3,.section-label) {
  color: var(--k3-muted) !important;
  letter-spacing: .1em !important;
}

.kamod-embed-v3 :is(.mc-name,.renderer-name) { color: var(--k3-text) !important; }
.kamod-embed-v3 :is(.mc-price,.mc-desc,.renderer-desc,.field-hint) { color: var(--k3-muted) !important; }
.kamod-embed-v3 :is(.result-video,video,img) { max-width: 100%; }

[data-theme="light"] .kamod-embed-v3 {
  --k3-bg: #f5f7fb;
  --k3-panel: rgba(255,255,255,.82);
  --k3-panel-strong: #fff;
  --k3-border: rgba(24,35,56,.12);
  --k3-border-strong: rgba(24,35,56,.20);
  --k3-text: #182033;
  --k3-muted: #5e687b;
  --k3-subtle: #818a9a;
  --bg: transparent;
  --bg-soft: #eef2f7;
  --surface: var(--k3-panel);
  --surface-2: rgba(255,255,255,.72);
  --surface-3: rgba(255,255,255,.92);
  --line: var(--k3-border);
  --line-strong: var(--k3-border-strong);
  --border: var(--k3-border);
  --border-soft: rgba(24,35,56,.08);
  --ink: var(--k3-text);
  --ink-dim: var(--k3-muted);
  --ink-dim-2: var(--k3-subtle);
  --text: var(--k3-text);
  --text-soft: #465268;
  --text-dim: var(--k3-muted);
}

[data-theme="light"] .kamod-embed-v3 :is(input[type=text],input[type=number],input[type=url],textarea,select) {
  background: rgba(255,255,255,.88) !important;
}

[data-theme="light"] .kamod-embed-v3 :is(.section-tabs,.sub-tabs,.mode-tabs) {
  background: rgba(24,35,56,.035) !important;
}

[data-theme="light"] .kamod-embed-v3 :is(.section-tab,.sub-tab,.mode-tab).active {
  color: #174ea6 !important;
}

@media (max-width: 720px) {
  .kamod-embed-v3 { padding: 4px 2px 22px !important; }
  .kamod-embed-v3 :is(.grid-2,.card-row,.renderer-options,.model-grid,.model-grid-2,.model-grid-3) { grid-template-columns: 1fr !important; }
  .kamod-embed-v3 :is(.section-tabs,.mode-tabs) { overflow-x: auto; scrollbar-width: none; }
  .kamod-embed-v3 :is(.section-tab,.mode-tab) { min-width: 132px; }
}

/* AI Film Studio V3 — approved three-column creation workspace. Existing IDs,
   inputs and handlers remain in place; only the information architecture is
   rebuilt around them. */
.kamod-film-studio-v3 {
  display: grid !important;
  grid-template-columns: minmax(286px, 330px) minmax(520px, 1fr) minmax(260px, 300px);
  grid-template-rows: minmax(440px, auto) auto;
  gap: 12px;
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  padding: 8px !important;
  overflow-x: hidden;
}

.kamod-film-studio-v3 > .card {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px;
  align-self: start;
  border-radius: 14px !important;
  background: rgba(255,255,255,.028) !important;
}

.kamod-film-studio-v3 > #results {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 438px;
  padding: 8px;
  border: 1px solid var(--k3-border);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 28%, rgba(67,137,255,.10), transparent 42%),
    rgba(255,255,255,.022);
  overflow: hidden;
}

.kamod-film-studio-v3 .film-v3-stage-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  min-height: 420px;
  padding: 40px;
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 11px;
  color: var(--k3-muted);
  font-size: .9rem;
  line-height: 1.55;
  text-align: center;
}

.kamod-film-studio-v3 .film-v3-stage-empty > span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 7px;
  border: 1px solid rgba(67,137,255,.35);
  border-radius: 50%;
  background: rgba(67,137,255,.11);
  color: #8fb8ff;
}

.kamod-film-studio-v3 .film-v3-stage-empty > strong {
  color: var(--k3-text);
  font-size: 1rem;
}

.kamod-film-studio-v3 .film-v3-stage-empty > p {
  max-width: 430px;
  margin: 0;
  color: var(--k3-muted);
  font-size: .78rem;
}

.kamod-film-studio-v3 > #results > :is(video,img),
.kamod-film-studio-v3 > #results > .result-item :is(video,img) {
  width: 100%;
  min-height: 420px;
  max-height: 620px;
  object-fit: contain;
  border-radius: 11px;
  background: #05070b;
}

.kamod-film-studio-v3 > #filmDirectorCard {
  grid-column: 2;
  grid-row: 3;
  width: 100%;
  max-width: none;
  margin: 0 !important;
  padding: 16px;
  border-radius: 14px;
}

.kamod-film-studio-v3 > #historySection {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-width: none;
  margin: 0 !important;
  padding: 16px;
  border-radius: 14px;
}

.kamod-film-studio-v3 > .film-v3-inspector {
  grid-column: 3;
  grid-row: 1 / span 3;
  min-width: 0;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--k3-border);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
}

.kamod-film-studio-v3 .film-v3-inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 15px;
}

.kamod-film-studio-v3 .film-v3-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--k3-subtle);
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .14em;
}

.kamod-film-studio-v3 .film-v3-inspector h2 {
  margin: 0;
  color: var(--k3-text);
  font-size: .98rem;
  letter-spacing: -.03em;
}

.kamod-film-studio-v3 .film-v3-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(74,222,128,.18);
  border-radius: 999px;
  background: rgba(74,222,128,.07);
  color: #86efac;
  font-size: .66rem;
  white-space: nowrap;
}

.kamod-film-studio-v3 .film-v3-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 12px rgba(74,222,128,.62);
}

.kamod-film-studio-v3 .film-v3-result-preview {
  min-height: 248px;
  margin: 0 14px 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--k3-border);
  border-radius: 12px;
  background: rgba(2,6,13,.58);
}

.kamod-film-studio-v3 .film-v3-result-preview video,
.kamod-film-studio-v3 .film-v3-result-preview img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: #05070b;
}

.kamod-film-studio-v3 .film-v3-result-empty {
  max-width: 220px;
  padding: 24px 16px;
  text-align: center;
}

.kamod-film-studio-v3 .film-v3-result-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(67,137,255,.35);
  border-radius: 50%;
  background: rgba(67,137,255,.11);
  color: #8fb8ff;
  font-size: .85rem;
}

.kamod-film-studio-v3 .film-v3-result-empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--k3-text);
  font-size: .82rem;
}

.kamod-film-studio-v3 .film-v3-result-empty p {
  margin: 0;
  color: var(--k3-muted);
  font-size: .7rem;
  line-height: 1.5;
}

.kamod-film-studio-v3 :is(.film-v3-primary-action,.film-v3-secondary-action) {
  min-height: 42px;
  margin: 0 14px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  text-decoration: none;
  font-size: .76rem;
  font-weight: 800;
}

.kamod-film-studio-v3 .film-v3-primary-action {
  background: linear-gradient(135deg, var(--k3-orange), #ff7d45);
  color: #fff;
}

.kamod-film-studio-v3 .film-v3-secondary-action {
  border: 1px solid var(--k3-border-strong);
  color: #c9d0de;
}

.kamod-film-studio-v3 .film-v3-inspector-group {
  border-top: 1px solid var(--k3-border);
}

.kamod-film-studio-v3 .film-v3-inspector-group button {
  width: 100%;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: var(--k3-text);
  font: inherit;
  font-size: .76rem;
  cursor: default;
}

.kamod-film-studio-v3 .film-v3-inspector-group p {
  margin: -5px 14px 14px;
  color: var(--k3-muted);
  font-size: .68rem;
  line-height: 1.5;
}

.kamod-film-studio-v3 .film-v3-inspector-group p[hidden] { display: none; }

.kamod-film-studio-v3 .film-v3-workflow-title {
  margin: 0 0 10px;
  color: var(--k3-text);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: -.015em;
}

.kamod-film-studio-v3 > .card > .tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 14px;
}

.kamod-film-studio-v3 > .card > .tabs .tab {
  min-height: 38px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 9px;
  text-align: left;
  font-size: .74rem;
  gap: 10px;
}

.kamod-film-studio-v3 > .card > .tabs .tab.active {
  border-color: rgba(255,107,53,.8);
  background: linear-gradient(135deg, rgba(255,107,53,.16), rgba(67,137,255,.06));
  color: #fff;
}

.kamod-film-studio-v3 .film-v3-more-workflows {
  border: 1px solid var(--k3-border);
  border-radius: 9px;
  background: rgba(255,255,255,.018);
}

.kamod-film-studio-v3 .film-v3-more-workflows > summary {
  padding: 10px 11px;
  color: var(--k3-muted);
  font-size: .7rem;
  cursor: pointer;
}

.kamod-film-studio-v3 .film-v3-more-workflows[open] > summary {
  border-bottom: 1px solid var(--k3-border);
}

.kamod-film-studio-v3 .film-v3-more-workflows .tab {
  margin: 5px;
}

.kamod-film-studio-v3 > .card > :is(label,.prompt-wrap,.mini-cost-line,.prompt-meter,.image-section,#videoEditSection,#omniSection,#flfSection,#combinerSection,#seedance25Section,#minimaxH3Section,#videoControls) {
  max-width: 100%;
}

.kamod-film-studio-v3 > .card textarea { max-height: 148px; }
.kamod-film-studio-v3 > .card .row { grid-template-columns: 1fr !important; }
.kamod-film-studio-v3 > .card #generateBtn,
.kamod-film-studio-v3 > .card :is(#veSubmitBtn,#omniSubmitBtn,#flfSubmitBtn,#combinerSubmitBtn,#s25SubmitBtn,#h3SubmitBtn) {
  background: linear-gradient(135deg, var(--k3-orange), #ff7d45) !important;
  box-shadow: 0 12px 28px rgba(255,107,53,.16);
}

.kamod-film-studio-v3 #historyList {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 10px !important;
}

.kamod-film-studio-v3 #historyList .history-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.kamod-film-studio-v3 #historyList .history-video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  border: 1px solid var(--k3-border);
  border-radius: 9px;
  background:
    radial-gradient(circle at 50% 40%, rgba(67,137,255,.16), transparent 42%),
    rgba(2,6,13,.58);
  color: var(--k3-text);
  cursor: pointer;
}

.kamod-film-studio-v3 #historyList .history-video-play {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(67,137,255,.35);
  border-radius: 50%;
  background: rgba(67,137,255,.13);
  color: #8fb8ff;
  font-size: .75rem;
}

.kamod-film-studio-v3 #historyList .history-video-model {
  max-width: 88%;
  overflow: hidden;
  color: var(--k3-muted);
  font-size: .68rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kamod-film-studio-v3 #historyList .h-info {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
}

.kamod-film-studio-v3 #historyList .h-prompt {
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  line-height: 1.4;
}

.kamod-film-studio-v3 #historyList .h-meta {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.kamod-film-studio-v3 #historyList .dl-btn {
  width: fit-content;
  max-width: 100%;
  margin-top: 2px !important;
  box-sizing: border-box;
}

.kamod-film-studio-v3 #historyList .history-load-more {
  min-height: 42px;
  border: 1px solid var(--k3-border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--k3-text);
  font: inherit;
  font-size: .76rem;
  font-weight: 800;
  cursor: pointer;
}

/* Film Studio light mode is intentionally scoped so dark mode and every
   generation handler retain their existing behavior. */
[data-theme="light"] .kamod-film-studio-v3 > :is(.card,#results,#historySection,#filmDirectorCard),
[data-theme="light"] .kamod-film-studio-v3 > .film-v3-inspector,
[data-theme="light"] .kamod-film-studio-v3 .film-v3-more-workflows {
  background: rgba(255,255,255,.78) !important;
}

[data-theme="light"] .kamod-film-studio-v3 .film-v3-stage-empty {
  border-color: var(--k3-border-strong);
}

[data-theme="light"] .kamod-film-studio-v3 .film-v3-result-preview,
[data-theme="light"] .kamod-film-studio-v3 #historyList .history-video-placeholder,
[data-theme="light"] .kamod-film-studio-v3 .s25-media-preview,
[data-theme="light"] .kamod-film-studio-v3 .s25-media-preview-frame {
  background: #f4f7fb;
}

[data-theme="light"] .kamod-film-studio-v3 :is(.film-v3-stage-empty > span,.film-v3-result-icon,#historyList .history-video-play) {
  color: #1d4ed8;
}

[data-theme="light"] .kamod-film-studio-v3 .film-v3-state,
[data-theme="light"] .kamod-film-studio-v3 .s25-media-preview-status { color: #15803d; }
[data-theme="light"] .kamod-film-studio-v3 .film-v3-secondary-action { color: var(--k3-text); }
[data-theme="light"] .kamod-film-studio-v3 > .card > .tabs .tab.active { color: #9a3412; }
[data-theme="light"] .kamod-film-studio-v3 .mini-cost-line { color: #1d4ed8; }
[data-theme="light"] .kamod-film-studio-v3 .mini-cost-line strong { color: #182033; }
[data-theme="light"] .kamod-film-studio-v3 .ppill.active {
  border-color: rgba(22,163,74,.32);
  background: rgba(22,163,74,.08);
  color: #15803d;
}
[data-theme="light"] .kamod-film-studio-v3 .cost-warn {
  border-color: rgba(217,119,6,.28);
  background: rgba(245,158,11,.10);
  color: #92400e;
}

/* Upload-first media rows. Hosted URLs remain in these controls as internal
   transport state for the existing submit handlers, but customers interact
   with the upload button and its real preview/progress UI. */
.kamod-film-studio-v3 :is(
  .i2v-src-tab[data-src="url"],
  [id^="i2v-url-wrap-"],
  #veVidTabUrl,
  #veVideoUrlWrap,
  .ve-img-url,
  .omni-media-url,
  .flf-media-url,
  .s25-media-url,
  .h3-media-url,
  .combiner-clip-url
) {
  display: none !important;
}

.kamod-film-studio-v3 :is(.s25-upload-control,.combiner-upload-control) {
  min-width: 118px;
}

@media (max-width: 1180px) {
  .kamod-film-studio-v3 {
    grid-template-columns: minmax(270px, 320px) minmax(460px,1fr);
  }
  .kamod-film-studio-v3 > .film-v3-inspector { display: none; }
}

@media (max-width: 820px) {
  .kamod-film-studio-v3 {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    padding: 4px !important;
  }
  .kamod-film-studio-v3 > :is(.card,#results,#filmDirectorCard,#historySection,.film-v3-inspector) {
    width: 100%;
  }
  .kamod-film-studio-v3 > .film-v3-inspector { display: block; order: 3; }
  .kamod-film-studio-v3 > #historySection { order: 4; }
  .kamod-film-studio-v3 > #filmDirectorCard { order: 5; }
  .kamod-film-studio-v3 #historyList { grid-template-columns: 1fr; }
}

/* Audio Studio V3 — real audio forms and results in the approved three-rail shell. */
.kamod-audio-v3 .wrapper{
  display:grid!important;grid-template-columns:minmax(290px,330px) minmax(460px,1fr) minmax(250px,290px);
  gap:12px;max-width:none!important;padding:8px!important;align-items:start;
}
.kamod-audio-v3 .wrapper>.section-tabs{grid-column:1/-1;margin:0}
.kamod-audio-v3 .wrapper>.section{grid-column:1/3;grid-row:2;min-width:0}
.kamod-audio-v3 .wrapper>.audio-recent-section{grid-column:3;grid-row:2;position:sticky;top:76px;max-height:calc(100vh - 96px);overflow:auto;margin:0!important;padding:14px;border:1px solid var(--k3-border);border-radius:14px;background:rgba(255,255,255,.025)}
.kamod-audio-v3 .section.active>.grid-2{grid-template-columns:minmax(290px,330px) minmax(0,1fr)!important;gap:12px!important}
.kamod-audio-v3 .section.active>.grid-2>div>.card{padding:16px!important}
.kamod-audio-v3 .audio-recent-section .history-grid{grid-template-columns:1fr!important}
.kamod-audio-v3 .audio-recent-section h2{font-size:.92rem!important}
.kamod-audio-v3>.history-section{max-width:none!important;margin:18px 8px 0!important;padding:18px!important;border:1px solid var(--k3-border);border-radius:14px;background:rgba(255,255,255,.025)}
@media(max-width:1180px){
  .kamod-audio-v3 .wrapper{grid-template-columns:minmax(290px,330px) minmax(0,1fr)}
  .kamod-audio-v3 .wrapper>.audio-recent-section{display:none}
}
@media(max-width:760px){
  .kamod-audio-v3 .wrapper{display:flex!important;flex-direction:column;padding:4px!important}
  .kamod-audio-v3 .wrapper>*{width:100%}
  .kamod-audio-v3 .wrapper>.audio-recent-section{display:none}
  .kamod-audio-v3 .section.active>.grid-2{grid-template-columns:1fr!important}
}

/* Avatar Studio V3 — existing avatar workflows stay separate and truthful. */
.kamod-avatars-v3 .wrapper{
  display:grid!important;grid-template-columns:minmax(290px,330px) minmax(460px,1fr) minmax(250px,290px);
  gap:12px;max-width:none!important;padding:8px!important;align-items:start;
}
.kamod-avatars-v3 .wrapper>.section-tabs{grid-column:1/-1;margin:0}
.kamod-avatars-v3 .wrapper>.section{grid-column:1/3;grid-row:2;min-width:0}
.kamod-avatars-v3 .section.active>.grid-2{grid-template-columns:minmax(290px,330px) minmax(0,1fr)!important;gap:12px!important}
.kamod-avatars-v3 .section.active>.grid-2>div>.card{padding:16px!important}
.avatars-v3-aside{grid-column:3;grid-row:2;position:sticky;top:76px;overflow:hidden;border:1px solid var(--k3-border);border-radius:14px;background:rgba(255,255,255,.025);padding:15px}
.avatars-v3-aside>span{color:var(--k3-subtle);font-size:.62rem;font-weight:850;letter-spacing:.14em}
.avatars-v3-aside h2{margin:5px 0 14px;color:var(--k3-text);font-size:1rem}
.avatars-v3-preview{min-height:260px;display:grid;align-content:center;padding:22px 16px;text-align:center;border:1px dashed var(--k3-border-strong);border-radius:12px;background:rgba(2,6,13,.5)}
.avatars-v3-preview strong{color:var(--k3-text);font-size:.82rem}.avatars-v3-preview p{color:var(--k3-muted);font-size:.7rem;line-height:1.55}
.avatars-v3-aside>:is(a,button){width:100%;min-height:40px;margin-top:9px;display:flex;align-items:center;justify-content:center;border:1px solid var(--k3-border-strong);border-radius:10px;background:transparent;color:var(--k3-text);font:inherit;font-size:.73rem;font-weight:800;text-decoration:none;cursor:pointer}
.avatars-v3-aside>:is(a,button):first-of-type{border:0;background:linear-gradient(135deg,var(--k3-orange),#ff7d45);color:#fff}
@media(max-width:1180px){.kamod-avatars-v3 .wrapper{grid-template-columns:minmax(290px,330px) minmax(0,1fr)}.avatars-v3-aside{display:none}}
@media(max-width:760px){.kamod-avatars-v3 .wrapper{display:flex!important;flex-direction:column;padding:4px!important}.kamod-avatars-v3 .section.active>.grid-2{grid-template-columns:1fr!important}.avatars-v3-aside{display:block;position:static;width:100%}}

/* AI Images V3 — real model/workflow controls, canvas, and history rail. */
.kamod-images-v3 .wrapper{
  display:grid!important;grid-template-columns:minmax(300px,340px) minmax(480px,1fr) minmax(250px,290px);
  gap:12px;max-width:none!important;padding:8px!important;align-items:start;
}
.kamod-images-v3 .wrapper>.section-tabs{grid-column:1/-1;margin:0}
.kamod-images-v3 .wrapper>.section{grid-column:1/3;grid-row:2;min-width:0}
.kamod-images-v3 .wrapper>.images-recent-section{grid-column:3;grid-row:2;position:sticky;top:76px;max-height:calc(100vh - 96px);overflow:auto;margin:0!important;padding:15px;border:1px solid var(--k3-border);border-radius:14px;background:rgba(255,255,255,.025)}
.kamod-images-v3 .wrapper>.history-section{grid-column:1/-1;grid-row:3;position:static;margin:0!important;padding:18px;border:1px solid var(--k3-border);border-radius:14px;background:rgba(255,255,255,.025)}
.kamod-images-v3 .section.active>.model-grid-3,.kamod-images-v3 .section.active>.model-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.kamod-images-v3 .section.active>.grid-2{grid-template-columns:minmax(300px,340px) minmax(0,1fr)!important;gap:12px!important}
.kamod-images-v3 .section.active>.grid-2>div>.card{padding:16px!important}
.kamod-images-v3 .images-recent-section .history-grid{grid-template-columns:1fr!important}
.kamod-images-v3 .images-recent-section .hist-spinner-wrap{min-height:150px}
.kamod-images-v3 .history-generating-label{display:block;margin-top:8px;color:var(--k3-muted);font-size:.7rem;font-weight:750}
.kamod-images-v3 .history-preview-unavailable{display:grid;place-items:center;color:var(--k3-muted);font-size:.7rem;font-weight:750}
@media(max-width:1180px){.kamod-images-v3 .wrapper{grid-template-columns:minmax(300px,340px) minmax(0,1fr)}.kamod-images-v3 .wrapper>.images-recent-section{display:none}.kamod-images-v3 .wrapper>.history-section{display:block;grid-column:1/-1;grid-row:3;position:static}}
@media(max-width:760px){.kamod-images-v3 .wrapper{display:flex!important;flex-direction:column;padding:4px!important}.kamod-images-v3 .wrapper>*{width:100%}.kamod-images-v3 .wrapper>.images-recent-section{display:none}.kamod-images-v3 .wrapper>.history-section{display:block;position:static}.kamod-images-v3 .section.active>.grid-2{grid-template-columns:1fr!important}}

/* Post-Production V3 — reduce instructional density without changing tools. */
.post-v3-workspace .v2-provider-sub{display:none}
.post-v3-workspace .v2-provider-btn{min-height:46px;padding:11px 13px}
.post-v3-workspace .v2-panel-copy{max-width:760px;font-size:.8rem;line-height:1.5}
.post-v3-workspace #v2OmniPresets{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important;margin-bottom:12px!important}
.post-v3-workspace #v2OmniPresets>.v2-card{padding:11px 12px!important;border-radius:10px!important}
.post-v3-workspace #v2OmniPresets>.v2-card>div:nth-child(2){display:none}
.post-v3-workspace #v2OmniSummary{display:none!important}
@media(max-width:760px){.post-v3-workspace .v2-provider-sub{display:block}.post-v3-workspace #v2OmniPresets{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

/* Creative Chat V3 — existing text-chat capabilities only. */
.kamod-uix-v3 .chat-page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.kamod-uix-v3 .chat-page-head .shell-hero-stack {
  text-transform: none;
  letter-spacing: -.01em;
}

.kamod-uix-v3 .chat-page-actions { display: flex; align-items: center; gap: 8px; }
.kamod-uix-v3 .chat-page-history { display: none; }

.kamod-uix-v3 .chat-layout {
  width: min(1480px, 100%);
  height: calc(100vh - 138px);
  min-height: 620px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(380px,1fr) 280px;
  gap: 10px;
}

.kamod-uix-v3 .chat-sidebar,
.kamod-uix-v3 .chat-main,
.kamod-uix-v3 .chat-guide {
  min-width: 0;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  border: 1px solid var(--k3-border);
  border-radius: var(--k3-radius);
  box-shadow: 0 18px 50px rgba(0,0,0,.14);
  overflow: hidden;
}

.kamod-uix-v3 .chat-sidebar {
  width: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--k3-border);
}

.kamod-uix-v3 .chat-sidebar-header {
  min-height: 60px;
  padding: 14px;
  border-bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.kamod-uix-v3 .chat-sidebar-title {
  color: var(--k3-text);
  font-size: .98rem;
  font-weight: 760;
  align-self: center;
}

.kamod-uix-v3 .chat-new-btn {
  grid-column: 1 / -1;
  min-height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--k3-orange), #ff7c45);
  color: #fff;
  font-size: .84rem;
  font-weight: 760;
  box-shadow: 0 10px 24px rgba(255,107,53,.16);
}

.kamod-uix-v3 .chat-sidebar-close {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--k3-border);
  border-radius: 9px;
  background: var(--k3-panel);
  color: var(--k3-text);
  cursor: pointer;
}

.kamod-uix-v3 .chat-search-wrap { padding: 0 14px 10px; }
.kamod-uix-v3 .chat-search { min-height: 42px; padding-left: 36px; }
.kamod-uix-v3 .chat-search-box { position: relative; }
.kamod-uix-v3 .chat-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--k3-subtle); pointer-events: none; }

.kamod-uix-v3 .chat-list {
  padding: 5px 10px 12px;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}

.kamod-uix-v3 .chat-list-item {
  min-height: 58px;
  margin: 4px 0;
  padding: 10px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--k3-muted);
  background: transparent;
  gap: 8px;
}

.kamod-uix-v3 .chat-list-item:hover {
  background: var(--k3-panel);
  border-color: var(--k3-border);
}

.kamod-uix-v3 .chat-list-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(30,86,174,.25), rgba(30,86,174,.12));
  border-color: rgba(67,137,255,.64);
  box-shadow: inset 0 0 0 1px rgba(67,137,255,.06);
}

.kamod-uix-v3 .chat-list-copy { min-width: 0; flex: 1; }
.kamod-uix-v3 .chat-list-title { display: block; color: inherit; font-size: .81rem; font-weight: 650; }
.kamod-uix-v3 .chat-list-time { display: block; margin-top: 4px; color: var(--k3-subtle); font-size: .68rem; }
.kamod-uix-v3 .chat-list-item.active .chat-list-time { color: #9ebff5; }

.kamod-uix-v3 .chat-list-actions { display: flex; opacity: 0; transition: opacity .16s ease; }
.kamod-uix-v3 .chat-list-item:hover .chat-list-actions,
.kamod-uix-v3 .chat-list-item:focus-within .chat-list-actions { opacity: 1; }
.kamod-uix-v3 .chat-list-btn { width: 25px; height: 25px; padding: 0; color: inherit; border-radius: 7px; }

.kamod-uix-v3 .chat-sidebar-foot {
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid var(--k3-border);
  color: var(--k3-subtle);
  font-size: .7rem;
  line-height: 1.45;
}

.kamod-uix-v3 .chat-main {
  display: flex;
  flex-direction: column;
  border-radius: var(--k3-radius);
  background: linear-gradient(180deg, rgba(9,14,24,.78), rgba(7,10,17,.74));
}

.kamod-uix-v3 .chat-meta {
  min-height: 60px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--k3-border);
  gap: 9px;
}

.kamod-uix-v3 .chat-meta-title { color: var(--k3-text); font-size: .94rem; font-weight: 750; }
.kamod-uix-v3 .chat-model-badge { color: var(--k3-green); background: rgba(85,223,160,.07); border-color: rgba(85,223,160,.2); border-radius: 999px; }
.kamod-uix-v3 .chat-history-btn { display: none; }

.kamod-uix-v3 .chat-messages {
  padding: 22px;
  gap: 13px;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}

.kamod-uix-v3 .chat-welcome {
  width: min(660px, 100%);
  margin: auto;
  padding: 30px 20px;
  text-align: left;
}

.kamod-uix-v3 .chat-welcome-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(67,137,255,.36);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(67,137,255,.22), rgba(255,107,53,.12));
  box-shadow: 0 14px 34px rgba(0,0,0,.22);
  font-size: 1.25rem;
}

.kamod-uix-v3 .chat-welcome h2 { margin: 0 0 8px; color: var(--k3-text); font-size: 1.55rem; letter-spacing: -.04em; }
.kamod-uix-v3 .chat-welcome p { margin: 0 0 20px; color: var(--k3-muted); font-size: .88rem; }
.kamod-uix-v3 .chat-suggestions { justify-content: flex-start; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }

.kamod-uix-v3 .chat-suggestion {
  min-height: 48px;
  padding: 11px 13px;
  border-radius: 11px;
  border-color: var(--k3-border);
  background: var(--k3-panel);
  color: #c8ceda;
  text-align: left;
  line-height: 1.35;
}

.kamod-uix-v3 .chat-suggestion:hover { color: #fff; background: var(--k3-blue-soft); border-color: rgba(67,137,255,.52); }

.kamod-uix-v3 .chat-bubble { max-width: 82%; padding: 13px 15px; border-radius: 13px; font-size: .86rem; }
.kamod-uix-v3 .chat-bubble.user { background: linear-gradient(135deg, rgba(22,73,151,.9), rgba(18,54,112,.9)); border: 1px solid rgba(67,137,255,.58); }
.kamod-uix-v3 .chat-bubble.assistant { background: var(--k3-panel); border-color: var(--k3-border); box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.kamod-uix-v3 .chat-bubble.assistant::before { content: 'K'; display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 8px; border-radius: 7px; color: #fff; background: linear-gradient(135deg, var(--k3-blue), #735bff); font-size: .7rem; font-weight: 850; }

.kamod-uix-v3 .chat-input-area {
  margin: 0 14px 10px;
  padding: 7px;
  border: 1px solid var(--k3-border);
  border-radius: 14px;
  background: rgba(4,8,15,.68);
  align-items: flex-end;
}

.kamod-uix-v3 .chat-input { min-height: 46px; padding: 12px; border: 0; background: transparent; }
.kamod-uix-v3 .chat-input:focus { border-color: transparent; box-shadow: none; }
.kamod-uix-v3 .chat-send-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--k3-orange), #ff7d45); font-size: 0; }
.kamod-uix-v3 .chat-send-btn::before { content: '➤'; font-size: 1rem; transform: translateX(1px); }
.kamod-uix-v3 .chat-price { padding: 0 18px 11px; color: var(--k3-subtle); font-size: .7rem; }
.kamod-uix-v3 .chat-price strong { color: var(--k3-green); }

.kamod-uix-v3 .chat-guide { display: flex; flex-direction: column; }
.kamod-uix-v3 .chat-guide-head { min-height: 60px; padding: 17px 15px; border-bottom: 1px solid var(--k3-border); color: var(--k3-text); font-size: .98rem; font-weight: 760; }
.kamod-uix-v3 .chat-guide-body { padding: 14px; display: grid; gap: 10px; }
.kamod-uix-v3 .chat-guide-card { padding: 13px; border: 1px solid var(--k3-border); border-radius: 12px; background: var(--k3-panel); }
.kamod-uix-v3 .chat-guide-card strong { display: block; margin-bottom: 5px; color: #dce1eb; font-size: .79rem; }
.kamod-uix-v3 .chat-guide-card p { margin: 0; color: var(--k3-muted); font-size: .75rem; line-height: 1.5; }
.kamod-uix-v3 .chat-guide-langs { display: flex; gap: 6px; margin-top: 9px; }
.kamod-uix-v3 .chat-guide-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--k3-border); color: var(--k3-subtle); font-size: .7rem; line-height: 1.5; }
.kamod-uix-v3 .chat-sidebar-backdrop { display: none; }

@media (max-width: 1240px) {
  .kamod-uix-v3 .chat-layout { grid-template-columns: 260px minmax(380px,1fr); }
  .kamod-uix-v3 .chat-guide { display: none; }
}

@media (max-width: 768px) {
  .kamod-uix-v3 .chat-page-head { align-items: flex-start; }
  .kamod-uix-v3 .chat-page-history { display: inline-flex; min-height: 36px; padding-inline: 12px; }
  .kamod-uix-v3 .chat-page-actions .k3-pill { display: none; }
  .kamod-uix-v3 .chat-layout { display: block; height: calc(100dvh - 132px); min-height: 520px; }
  .kamod-uix-v3 .chat-main { height: 100%; }
  .kamod-uix-v3 .chat-sidebar {
    display: flex;
    position: fixed;
    z-index: 80;
    top: 10px;
    left: 10px;
    bottom: 10px;
    width: min(340px, calc(100vw - 42px));
    transform: translateX(calc(-100% - 20px));
    transition: transform .22s ease;
    box-shadow: 28px 0 80px rgba(0,0,0,.55);
  }
  .kamod-uix-v3 .chat-sidebar.open { transform: translateX(0); }
  .kamod-uix-v3 .chat-sidebar-close { display: inline-grid; place-items: center; }
  .kamod-uix-v3 .chat-sidebar-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.58); backdrop-filter: blur(3px); }
  .kamod-uix-v3 .chat-sidebar-backdrop.open { display: block; }
  .kamod-uix-v3 .chat-history-btn { display: inline-flex; }
  .kamod-uix-v3 .chat-messages { padding: 14px; }
  .kamod-uix-v3 .chat-welcome { padding: 18px 4px; }
  .kamod-uix-v3 .chat-suggestions { grid-template-columns: 1fr; }
  .kamod-uix-v3 .chat-bubble { max-width: 90%; }
  .kamod-uix-v3 .chat-model-badge { display: none; }
}
