:root {
  color-scheme: dark;
  --bg: #07080a;
  --bg-elevated: #0c0e12;
  --panel: #0e1116;
  --field: #12161d;
  --line: rgba(232, 236, 242, 0.1);
  --line-strong: rgba(232, 236, 242, 0.22);
  --text: #f2f4f7;
  --muted: #8b93a1;
  --accent: #d6ff3f;
  --accent-ink: #10140a;
  --accent-soft: rgba(214, 255, 63, 0.14);
  --tungsten: #e8a87c;
  --danger: #ff6b6b;
  --radius: 10px;
  --radius-sm: 6px;
  --font-ui: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Syne", "Manrope", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-family: var(--font-ui);
}

* { box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(214, 255, 63, 0.06), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(232, 168, 124, 0.05), transparent 50%),
    var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
button:hover { background: rgba(255,255,255,.06); }
button:disabled { opacity: .35; cursor: not-allowed; }
h1, p { margin: 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr) 340px;
  grid-template-rows: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(10px);
  animation: cm-rise 520ms cubic-bezier(.22,1,.36,1) both;
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(12px);
  animation: cm-rise 480ms cubic-bezier(.22,1,.36,1) both;
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo {
  display: block;
  height: 52px;
  width: auto;
  background: transparent;
  object-fit: contain;
}
.brand-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.brand-kicker {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.brand-tag {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.field-model select { font-size: 11px; letter-spacing: -.01em; }
.status {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.settings-link { text-decoration: none; display: inline-grid; place-items: center; }
.btn-primary {
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 0 0 1px rgba(214, 255, 63, 0.25), 0 0 24px rgba(214, 255, 63, 0.12);
}
.btn-primary:hover {
  background: #e4ff6d;
  transform: translateY(-1px);
}
.btn-ghost {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.compose {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: linear-gradient(180deg, #12161d, #0a0c10);
  animation-delay: 60ms;
}

.compose-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.compose-label {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.compose-sub {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.compose-count {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.compose-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  align-items: stretch;
}

.compose-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  flex-shrink: 0;
  width: 100%;
  transition: border-color 160ms ease, background 160ms ease;
}
.compose-block:hover { border-color: rgba(255,255,255,.2); }

.block-head { margin: 0; }
.block-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.block-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.compose-prompt { padding: 0; border: 0; background: transparent; }
.compose-prompt:hover { border-color: transparent; }

.field { display: grid; gap: 6px; min-width: 0; width: 100%; }
.field span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.field textarea, .batch textarea, .field select {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.35);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.field-prompt {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  width: 100%;
}
.field-prompt:focus-within {
  border-color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.field textarea { min-height: 112px; padding: 12px; resize: none; line-height: 1.5; font-size: 13px; }
.field select {
  height: 36px;
  padding: 0 28px 0 10px;
  appearance: none;
  background-color: rgba(0,0,0,.35);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 11px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  overflow: hidden;
  text-overflow: ellipsis;
}
.field-model select { font-size: 11px; letter-spacing: -.01em; }
.field textarea:focus, .field select:focus, .batch textarea:focus {
  border-color: rgba(255,255,255,.35);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}

.gen-settings { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.gen-settings-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.ratio-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.ratio-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.chip-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.ratio-chip {
  height: 32px;
  padding: 0;
  border-radius: 10px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(0,0,0,.25);
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.ratio-chip:hover {
  color: #fff;
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.05);
}
.ratio-chip.active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  cursor: pointer;
  user-select: none;
  width: 100%;
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid var(--line);
  transition: background 160ms ease, border-color 160ms ease;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}
.toggle input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(16px);
  background: var(--accent-ink);
}
.toggle-label { color: rgba(255,255,255,.88); font-size: 12px; }

.batch { color: var(--muted); font-size: 12px; padding: 0; overflow: hidden; }
.batch summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}
.batch-summary-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.batch-hint {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch summary::-webkit-details-marker { display: none; }
.batch summary::after {
  content: "+";
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  transition: transform 160ms ease, border-color 160ms ease;
}
.batch[open] summary::after {
  content: "−";
  border-color: rgba(255,255,255,.35);
  color: #fff;
}
.batch textarea {
  min-height: 80px;
  padding: 0 12px 12px;
  resize: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.batch textarea:focus { box-shadow: none; border-color: transparent; }

.compose-refs { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.refs-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.refs-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}
.refs-actions .btn-chip,
.refs-actions .btn-chip-muted {
  flex: 1;
  justify-content: center;
}
.btn-chip {
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
}
.btn-chip:hover { background: #e4ff6d; }
.btn-chip-muted {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.btn-chip-muted:hover { background: rgba(255,255,255,.06); }

.drop {
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
  cursor: pointer;
}
.drop-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 18px;
  line-height: 1;
  color: rgba(255,255,255,.7);
}
.drop.dragging {
  border-color: #fff;
  color: #fff;
  background: rgba(255,255,255,.04);
}
.drop.dragging .drop-icon { border-color: #fff; color: #fff; }

.asset-grid {
  min-height: 88px;
  max-height: 180px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.asset-card {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}
.asset-card:hover { border-color: rgba(255,255,255,.28); transform: translateY(-1px); }
.asset-card.selected { border-color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.asset-card img,
.asset-card video { width: 100%; height: 100%; object-fit: cover; }
.asset-video-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.asset-role-video {
  display: grid;
  place-items: center;
  padding: 8px;
  color: rgba(255,255,255,.72);
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.field-video-urls {
  display: grid;
  gap: 6px;
}
.field-video-urls textarea {
  min-height: 56px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: #fff;
  padding: 10px 12px;
  font: inherit;
}
.asset-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: .88;
  transition: opacity 160ms ease, transform 160ms ease, background 160ms ease, border-color 160ms ease;
}
.asset-card:hover .asset-remove,
.asset-remove:focus-visible { opacity: 1; }
.asset-remove:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.asset-role {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.asset-card.selected .asset-role { display: grid; }
.asset-role button {
  height: 22px;
  padding: 0;
  font-size: 9px;
  border-radius: 6px;
}
.asset-role button.active { background: #fff; color: #000; border-color: #fff; }

.empty-hint {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.stage {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-rows: auto 1fr;
}

.stage-head {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.preview-wrap {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #000;
}

.preview-frame {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.preview-frame.ratio-9-16 { aspect-ratio: 9/16; height: min(100%, 72vh); width: auto; }
.preview-frame.ratio-16-9 { aspect-ratio: 16/9; width: min(100%, 90%); height: auto; }
.preview-frame.ratio-1-1 { aspect-ratio: 1/1; height: min(100%, 60vh); width: auto; }
.preview-frame.ratio-4-3 { aspect-ratio: 4/3; width: min(100%, 85%); height: auto; }
.preview-frame.ratio-3-4 { aspect-ratio: 3/4; height: min(100%, 70vh); width: auto; }
.preview-frame.ratio-21-9 { aspect-ratio: 21/9; width: min(100%, 95%); height: auto; }

.preview-empty {
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: grid;
  place-content: center;
  place-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  padding: 24px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(214,255,63,0.03), transparent 40%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255,255,255,0.015) 2px,
      rgba(255,255,255,0.015) 3px
    );
}
.preview-empty-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.preview-empty-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.preview-empty-sub {
  font-size: 12px;
  color: var(--muted);
}

.pro-player { position: absolute; inset: 0; background: #000; }
.pro-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}
#previewVideo { width: 100%; height: 100%; object-fit: contain; background: #000; }

.pro-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.45) 0%, transparent 22%, transparent 58%, rgba(0,0,0,.82) 100%);
  opacity: 0;
  transition: opacity 220ms ease;
}
.pro-player.is-active .pro-vignette,
.pro-player.is-paused .pro-vignette { opacity: 1; }

.pro-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border: 2px solid rgba(255,255,255,.18);
  border-top-color: #fff;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  z-index: 4;
}

.pro-center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  color: #000;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  z-index: 3;
  transition: transform 180ms ease, opacity 180ms ease;
}
.pro-center-play svg { width: 30px; height: 30px; fill: currentColor; margin-left: 3px; }
.pro-center-play:hover { transform: translate(-50%, -50%) scale(1.06); }
.pro-center-play.is-hidden { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(.92); }

.pro-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 0 14px 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
}
.pro-player.is-active .pro-controls,
.pro-player.is-paused .pro-controls {
  opacity: 1;
  transform: translateY(0);
}

.pro-scrub { position: relative; height: 18px; display: grid; align-items: center; margin-bottom: 8px; }
.pro-scrub-rail {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  overflow: hidden;
  transition: height 140ms ease;
}
.pro-scrub:hover .pro-scrub-rail,
.pro-scrub-input:active + .pro-scrub-rail { height: 6px; }
.pro-scrub-buffer { height: 100%; width: 0; background: rgba(255,255,255,.22); }
.pro-scrub-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(214, 255, 63, 0.35);
}
.pro-scrub-input {
  position: relative;
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}
.pro-scrub-input::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
  transition: transform 140ms ease;
}
.pro-scrub-input:active::-webkit-slider-thumb { transform: scale(1.15); }
.pro-scrub-input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
}

.pro-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pro-icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: #fff;
  backdrop-filter: blur(10px);
}
.pro-icon-btn:hover { background: rgba(255,255,255,.16); }
.pro-icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.pro-icon-btn .icon-pause,
.pro-icon-btn .icon-muted,
.pro-icon-btn .icon-collapse { display: none; }
.pro-icon-btn.is-playing .icon-play { display: none; }
.pro-icon-btn.is-playing .icon-pause { display: block; }
.pro-icon-btn.is-muted .icon-volume { display: none; }
.pro-icon-btn.is-muted .icon-muted { display: block; }
.pro-player:fullscreen .icon-expand { display: none; }
.pro-player:fullscreen .icon-collapse { display: block; }

.pro-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  color: rgba(255,255,255,.88);
}
.pro-time-sep { color: rgba(255,255,255,.35); }
.pro-spacer { flex: 1; }

.pro-volume {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pro-volume-input {
  width: 72px;
  height: 4px;
  appearance: none;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  cursor: pointer;
}
.pro-volume-input::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
}
.pro-volume-input::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: #fff;
}

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

.pro-player:fullscreen { border-radius: 0; }
.pro-player:fullscreen .pro-screen { height: 100vh; }

.history {
  grid-column: 3;
  grid-row: 2;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: linear-gradient(180deg, #12161d, #0a0c10);
  animation-delay: 120ms;
}

.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.history-label {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.history-sub {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.history-count {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.history-toolbar {
  display: grid;
  gap: 10px;
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.18);
}

.history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-filter {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.history-filter:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.history-filter.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.history-filter-count {
  min-width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: inherit;
  font-size: 9px;
}

.history-filter.active .history-filter-count {
  background: rgba(0, 0, 0, 0.16);
}

.history-search {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-size: 12px;
  outline: none;
}

.history-search::placeholder {
  color: var(--muted);
}

.history-search:focus {
  border-color: rgba(214, 255, 63, 0.45);
}

.history-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  align-items: stretch;
}

.history-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.history-card:hover {
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.04);
  transform: translateY(-1px);
}
.history-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(214, 255, 63, 0.12);
}

.history-card.is-pending {
  border-color: rgba(214, 255, 63, 0.28);
  background: linear-gradient(180deg, rgba(214, 255, 63, 0.08), rgba(255, 255, 255, 0.02));
}

.history-card.is-live {
  border-color: rgba(232, 168, 124, 0.5);
  background: linear-gradient(180deg, rgba(232, 168, 124, 0.1), rgba(255, 255, 255, 0.02));
}

.history-card.is-ready {
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  padding: 10px;
}

.history-card.is-failed {
  border-color: rgba(255, 107, 107, 0.35);
}

.history-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 150px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255,255,255,.08);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  padding: 6px;
  flex-shrink: 0;
}

.history-card.is-ready .history-thumb {
  width: 84px;
  flex: 0 0 84px;
  aspect-ratio: 9 / 16;
  max-height: none;
  height: 112px;
  padding: 0;
}

.history-card.is-pending .history-thumb {
  aspect-ratio: 16 / 9;
  max-height: 120px;
  background:
    radial-gradient(circle at 70% 30%, rgba(214, 255, 63, 0.16), transparent 55%),
    #050607;
}

.history-card.is-live .history-thumb {
  aspect-ratio: 16 / 9;
  max-height: 120px;
  background:
    radial-gradient(circle at 30% 20%, rgba(232, 168, 124, 0.22), transparent 55%),
    #050607;
}

.history-thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb-state {
  width: 100%;
  display: grid;
  gap: 6px;
  place-items: center;
  color: #fff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.thumb-state strong {
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0;
  color: var(--tungsten);
}
.history-thumb .thumb-play {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
}
.history-thumb .thumb-play::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  margin-left: 9px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid #000;
}

.history-body { width: 100%; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.history-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.history-status {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.history-status.ready { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.history-status.pending { color: var(--accent); border-color: rgba(214, 255, 63, 0.45); background: rgba(214, 255, 63, 0.08); }
.history-status.running { color: var(--tungsten); border-color: rgba(232, 168, 124, 0.55); animation: pulse 1.4s ease infinite; }
.history-status.failed { color: #fff; border-color: rgba(255,107,107,.55); background: rgba(255,107,107,.12); }
.history-ratio,
.history-pin {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 9px;
}
.history-pin {
  color: var(--tungsten);
  border: 1px solid rgba(232, 168, 124, 0.45);
  background: rgba(232, 168, 124, 0.12);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.history-pin.is-pending {
  color: var(--accent);
  border-color: rgba(214, 255, 63, 0.45);
  background: rgba(214, 255, 63, 0.1);
}
.history-prompt {
  margin: 0;
  color: rgba(255,255,255,.92);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-card.is-ready .history-prompt {
  -webkit-line-clamp: 2;
}
.history-progress {
  display: grid;
  gap: 6px;
}
.history-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(255,255,255,.72);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.history-progress-top strong {
  color: #fff;
  font-size: 11px;
}
.history-progress-track {
  position: relative;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.history-progress-track span {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255,255,255,.7), #fff);
  box-shadow: 0 0 14px rgba(255,255,255,.28);
  transition: width 240ms ease;
}
.history-card.is-live .history-progress-track span {
  background: linear-gradient(90deg, #e8a87c, #fff1df);
  box-shadow: 0 0 14px rgba(232, 168, 124, 0.35);
}
.history-card.is-pending .history-progress-track span {
  background: linear-gradient(90deg, rgba(214, 255, 63, 0.55), var(--accent));
  box-shadow: 0 0 14px rgba(214, 255, 63, 0.28);
  animation: pendingPulse 1.6s ease infinite;
}

@keyframes pendingPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.history-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.history-time { color: var(--muted); font-size: 10px; min-width: 0; }
.history-reuse {
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
}
.history-reuse:hover { background: #e4ff6d; }

.preview-empty-progress {
  width: min(220px, 70%);
  display: grid;
  gap: 8px;
  margin-top: 8px;
  justify-items: center;
}

.preview-empty-progress .history-progress-track {
  width: 100%;
  height: 8px;
}

.preview-empty-progress strong {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--tungsten);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

@keyframes cm-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .app { grid-template-columns: 360px minmax(0, 1fr) 300px; }
}

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 92px auto minmax(0, 1fr) 280px; }
  .compose { grid-column: 1; grid-row: 2; max-height: 42vh; }
  .stage { grid-column: 1; grid-row: 3; }
  .history { grid-column: 1; grid-row: 4; }
  .history-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: stretch;
  }
  .history-card {
    flex: 0 0 min(280px, 78vw);
  }
}

.settings-page {
  overflow: auto;
  background: var(--bg);
}

.settings-shell {
  min-height: 100vh;
  max-width: 920px;
  margin: 0 auto;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.settings-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #0d0d0d, #070707);
}

.settings-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.settings-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.settings-back:hover { color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.04); }

.settings-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.settings-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.settings-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

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

.settings-main {
  display: grid;
  gap: 10px;
}

.settings-block {
  padding: 16px;
  background: linear-gradient(180deg, #0d0d0d, #070707);
}

.settings-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.settings-block-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.settings-block-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}
.status-badge.ready {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

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

.field input[type="text"],
.field input[type="url"],
.field input[type="password"],
.field input[type="number"] {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.35);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field input:focus {
  border-color: rgba(255,255,255,.35);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}

.field-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.key-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.settings-toggle { margin-top: 14px; }

.settings-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.35);
  resize: vertical;
  line-height: 1.45;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.runtime-list {
  display: grid;
  gap: 8px;
  margin: 0;
}
.runtime-list > div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
}
.runtime-list dt {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.runtime-list dd {
  margin: 0;
  font-size: 12px;
  word-break: break-all;
}

@media (max-width: 760px) {
  .settings-topbar { flex-direction: column; align-items: stretch; }
  .settings-topbar-actions { justify-content: space-between; }
  .settings-grid, .settings-grid-3 { grid-template-columns: 1fr; }
  .runtime-list > div { grid-template-columns: 1fr; gap: 4px; }
}

/* Image studio (Seedream 5.0) */
.image-app {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr) 300px;
  grid-template-rows: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.status-error {
  color: #fff !important;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 4px 10px;
}
.create-notice strong { color: var(--text); font-weight: 600; }
.create-notice[hidden] { display: none; }

.image-compose {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
}

.image-preview {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
}

.image-history {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  flex-direction: column;
}

.mode-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.02);
}

.mode-tab {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.mode-tab.active { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.mode-tab.active:hover { background: #e4ff6d; }

.edit-block.hidden { display: none; }

.field-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.field-inline input { accent-color: #fff; }

.btn-small {
  height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.source-card {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--field);
}
.source-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.source-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.preview-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.preview-actions { display: flex; gap: 6px; }

.image-preview-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.04), transparent 70%);
}

.preview-empty {
  text-align: center;
  color: var(--muted);
}
.preview-empty[hidden] { display: none; }
.preview-image[hidden] { display: none; }
.preview-empty p { margin-bottom: 8px; font-size: 14px; }
.preview-hint { font-size: 11px; opacity: .7; }

.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.preview-image.hidden,
.preview-loader.hidden { display: none; }

.preview-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  background: rgba(0,0,0,.55);
  color: var(--muted);
  font-size: 13px;
}
.loader-ring {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.history-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.history-count {
  font-size: 11px;
  color: var(--muted);
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.image-history-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.history-empty {
  margin: 0;
  padding: 20px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.image-history-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  text-align: left;
  color: inherit;
}
.image-history-card:hover { background: rgba(255,255,255,.05); }
.image-history-card.active {
  border-color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.08);
}

.image-history-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--field);
  display: grid;
  place-items: center;
}
.image-history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-fallback {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.image-history-meta { min-width: 0; display: grid; gap: 4px; align-content: center; }
.image-history-mode {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.image-history-time {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text);
}
.image-history-size { font-size: 10px; color: var(--muted); }

@media (max-width: 1100px) {
  .image-app {
    grid-template-columns: 1fr;
    grid-template-rows: 92px auto auto auto;
    overflow: auto;
  }
  html, body { overflow: auto; }
  .image-compose, .image-preview, .image-history { grid-column: 1; grid-row: auto; min-height: 320px; }
  .image-preview-stage { min-height: 360px; }
}

/* Confirm generate panel */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(8px);
  animation: cm-fade 160ms ease both;
}
.confirm-overlay[hidden] { display: none !important; }
.confirm-panel {
  width: min(440px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #151a22, #0d1016);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  animation: cm-rise 220ms cubic-bezier(.22,1,.36,1) both;
}
.confirm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.confirm-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.confirm-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.confirm-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}
.confirm-close:hover { color: var(--text); }
.confirm-body {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
}
.confirm-meta {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.confirm-meta > div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
}
.confirm-meta dt {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.confirm-meta dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.confirm-prompt-block { display: grid; gap: 8px; }
.confirm-prompt {
  margin: 0;
  max-height: 160px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(242, 244, 247, 0.92);
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.confirm-note {
  margin: 0;
  color: var(--tungsten);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}
.confirm-actions .btn-primary { min-width: 148px; }

@keyframes cm-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
