/* Global: jangan biarkan .field { display:flex } menampilkan elemen [hidden] */
[hidden] {
  display: none !important;
}

:root {
  --ink: #0e1518;
  --ink-soft: #1a2429;
  --paper: #e9eef1;
  --paper-2: #dce4e9;
  --line: rgba(14, 21, 24, 0.12);
  --accent: #0d9488;
  --accent-2: #0f766e;
  --cta: #f59e0b;
  --danger: #c0392b;
  --ok: #0d9488;
  --shadow: 0 16px 40px rgba(14, 21, 24, 0.14);
  --radius: 12px;
  --font-display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Manrope", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--paper);
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 420px at 6% -8%, rgba(13, 148, 136, 0.14), transparent 55%),
    radial-gradient(700px 400px at 96% 4%, rgba(245, 158, 11, 0.1), transparent 50%),
    linear-gradient(165deg, #f1f5f7 0%, #e4ebee 48%, #dce4e9 100%);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.03;
  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");
  pointer-events: none;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1.15rem 0.35rem;
  max-width: 1180px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.format-tabs {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.18rem;
  border-radius: 999px;
  background: rgba(14, 21, 24, 0.06);
  border: 1px solid var(--line);
}
.format-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0.62;
  transition: background 0.18s ease, opacity 0.18s ease, color 0.18s ease;
}
.format-tab:hover { opacity: 0.9; }
.format-tab.is-active {
  background: var(--ink);
  color: var(--paper);
  opacity: 1;
}
.brand { display: flex; align-items: baseline; gap: 0.55rem; }
.mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}
.product {
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.62;
}
.top-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
}
.connect-btn {
  padding: 0.38rem 0.75rem !important;
  font-size: 0.78rem !important;
  border-radius: 8px !important;
}

.stage {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.35rem 1.15rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 1.35rem;
  align-items: start;
  min-height: calc(100vh - 3.5rem);
  animation: rise 0.55s ease both;
}

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

.block { margin-bottom: 0.75rem; }
.block-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 0.4rem;
}
.source-block {
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-bottom: 0.65rem;
}
.field span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.58;
}
.field.compact { margin-bottom: 0; min-width: 72px; }
.url-row {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
}
.url-field { flex: 1; min-width: 0; margin-bottom: 0; }
.url-add-btn {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0 !important;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 10px !important;
}
.yt-row {
  margin-top: 0.5rem;
  align-items: flex-end;
}
.yt-row .secondary {
  flex-shrink: 0;
  white-space: nowrap;
  height: 2.4rem;
  padding: 0 0.75rem !important;
  font-size: 0.82rem !important;
  border-radius: 10px !important;
}
.extra-urls {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.extra-url-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.extra-url-row input { flex: 1; min-width: 0; }
.extra-url-row .url-remove-btn {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0 !important;
  font-size: 1rem;
  border-radius: 8px !important;
}
#url-count-hint,
#yt-url-count-hint { margin: 0.3rem 0 0; }
.yt-row .url-add-btn { flex-shrink: 0; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  border-radius: 10px;
  padding: 0.58rem 0.72rem;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { resize: vertical; line-height: 1.4; }
input:focus, textarea:focus, select:focus {
  border-color: rgba(13, 148, 136, 0.55);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
  background: #fff;
}

.row {
  display: flex;
  gap: 0.65rem;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}
.row.tight { gap: 0.5rem; }
.styles {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.65rem 0.5rem;
  margin: 0;
  background: rgba(255, 255, 255, 0.45);
}
.styles legend {
  padding: 0 0.3rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.58;
}
.styles label {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-right: 0.65rem;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.media-stack {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.media-zone {
  padding: 0.65rem 0.75rem;
  border-radius: 11px;
  border: 1.5px dashed rgba(14, 21, 24, 0.2);
  background: rgba(255, 255, 255, 0.5);
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.media-zone:focus,
.media-zone.is-focus {
  border-color: rgba(13, 148, 136, 0.55);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.media-zone.is-drag {
  border-color: var(--accent);
  background: rgba(13, 148, 136, 0.1);
}
.media-zone-illust {
  border-color: rgba(13, 148, 136, 0.35);
  background: rgba(13, 148, 136, 0.06);
}
.media-zone-illust .media-zone-copy em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent-2);
}
.media-zone-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-bottom: 0.45rem;
}
.media-zone-copy strong {
  font-family: var(--font-display);
  font-size: 0.88rem;
}
.media-zone-copy span {
  font-size: 0.78rem;
  opacity: 0.68;
  line-height: 1.3;
}
.media-zone-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.file-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
.media-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: flex-start;
}
.media-thumbs:empty { display: none; }
.media-thumb {
  position: relative;
  width: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #cfd8de;
  display: flex;
  flex-direction: column;
}
.media-thumb img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  display: block;
}
.media-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 999px;
  font-size: 0.7rem;
  line-height: 1;
  background: rgba(14, 21, 24, 0.75);
  color: #fff;
  border: none;
  z-index: 2;
}
.media-credit {
  display: block;
  font-size: 0.55rem;
  line-height: 1.25;
  padding: 0.22rem 0.28rem;
  background: #152025;
  color: #d5dee4;
  text-decoration: none;
  max-height: 2.5em;
  overflow: hidden;
}
a.media-credit:hover {
  color: #fff;
  text-decoration: underline;
}

.actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}
.secondary-row { margin-top: -0.15rem; margin-bottom: 0.65rem; }

button {
  font: inherit;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.58rem 0.95rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s, border-color 0.15s, opacity 0.15s;
}
button:active { transform: translateY(1px) scale(0.98); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.primary {
  background: var(--cta);
  color: #1a1205;
  border-color: transparent;
}
.primary:hover:not(:disabled) { background: #eab308; }
.secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.secondary:hover:not(:disabled) { background: rgba(255, 255, 255, 0.65); }
.ghost {
  background: transparent;
  border-color: var(--line);
  padding: 0.42rem 0.7rem;
  font-size: 0.82rem;
}

.status {
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: rgba(14, 21, 24, 0.05);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.35;
  min-height: 2.4rem;
}
.status.busy {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
  animation: pulse 1.4s ease infinite;
}
.status.error {
  border-color: rgba(192, 57, 43, 0.35);
  background: rgba(192, 57, 43, 0.08);
  color: var(--danger);
}
.status.ok {
  border-color: rgba(13, 148, 136, 0.4);
  background: rgba(13, 148, 136, 0.1);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.fold {
  margin: 0.45rem 0;
  border-top: 1px solid var(--line);
  padding-top: 0.45rem;
}
.fold summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
  opacity: 0.8;
}
.meta {
  margin-top: 0.4rem;
  border-top: 1px solid var(--line);
  padding-top: 0.55rem;
}
.meta summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
}

.preview {
  position: sticky;
  top: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  animation: float-in 0.65s 0.08s ease both;
}
@keyframes float-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.phone {
  position: relative;
  width: min(100%, 300px);
  aspect-ratio: 9 / 16;
  border-radius: 24px;
  background: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 3px solid #243038;
  transition: width 0.22s ease, aspect-ratio 0.22s ease, border-radius 0.22s ease;
}
.phone[data-aspect="16:9"] {
  width: min(100%, 440px);
  aspect-ratio: 16 / 9;
  border-radius: 14px;
}
.phone[data-aspect="16:9"] .phone-notch {
  display: none;
}
.phone-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  height: 14px;
  border-radius: 999px;
  background: #0a1012;
  z-index: 2;
}
.phone video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a1012;
  display: none;
}
.phone.has-video video { display: block; }
.phone.has-video .phone-empty { display: none; }
.phone-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.25rem;
  text-align: center;
  color: rgba(233, 238, 241, 0.7);
  padding: 1.5rem;
  background: linear-gradient(160deg, #1a262c, #0e1518 55%, #152028);
}
.phone-empty strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--paper);
}
.phone-empty span { font-size: 0.82rem; }

.narrator-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.25rem 0 0.5rem;
  font-size: 0.85rem;
}
.narrator-character-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  margin-bottom: 0.45rem;
}
.narrator-thumb {
  width: 72px;
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.22));
}
.narrator-character-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}
.narrator-head.sub {
  margin-top: 0.3rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}
.narrator-preview {
  position: absolute;
  left: 1.5%;
  bottom: 16%;
  width: 36%;
  max-height: 48%;
  object-fit: contain;
  object-position: bottom left;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}
.phone.beside-narrator .narrator-preview {
  /* selaras lane presenter ~34–40% frame export */
  left: 0;
  bottom: 12%;
  width: 34%;
  max-height: 46%;
}
.narrator-preview.is-right {
  left: auto;
  right: 3%;
  object-position: bottom right;
}
.narrator-preview[hidden] {
  display: none !important;
}
.narrator-panel {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}
.narrator-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.3rem 0.55rem;
  margin-bottom: 0.35rem;
}
.narrator-head-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}
.narrator-head-copy strong {
  font-family: var(--font-display);
  font-size: 0.9rem;
}
.narrator-head span {
  font-size: 0.76rem;
  opacity: 0.72;
}
.link-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.72rem;
  font-weight: 600;
}
.link-status .link-label {
  font-size: 0.72rem;
}
.link-dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #9aa3b2;
  box-shadow: 0 0 0 2px rgba(154, 163, 178, 0.25);
}
.link-status[data-state="checking"] .link-dot {
  background: #d4a017;
  box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.28);
}
.link-status[data-state="ok"] {
  border-color: rgba(13, 148, 136, 0.45);
  background: rgba(13, 148, 136, 0.12);
}
.link-status[data-state="ok"] .link-dot {
  background: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.35);
}
.link-status[data-state="err"] {
  border-color: rgba(220, 80, 80, 0.4);
  background: rgba(220, 80, 80, 0.1);
}
.link-status[data-state="err"] .link-dot {
  background: #e74c3c;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.3);
}
.narrator-panel audio {
  width: 100%;
  margin-bottom: 0.35rem;
}
.narrator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.preview-cap {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.65;
  text-align: center;
}

.caption-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  display: flex;
  padding:
    var(--layout-pad-top, 5%)
    8%
    var(--layout-pad-bottom, 4%);
}
.caption-overlay.beside-narrator {
  /* nilai dari applyLayoutPreview() — mirror shorts.py */
  padding-top: var(--layout-pad-top, 5%);
  padding-left: var(--beside-pad-left, 26%);
  padding-right: var(--beside-pad-right, 13%);
  padding-bottom: var(--layout-pad-bottom, 10%);
  justify-content: flex-start !important;
  align-items: flex-end !important;
}
.caption-overlay[data-align-h="kiri"] { justify-content: flex-start; }
.caption-overlay[data-align-h="tengah"] { justify-content: center; }
.caption-overlay[data-align-h="kanan"] { justify-content: flex-end; }
.caption-overlay[data-align-v="atas"] { align-items: flex-start; }
.caption-overlay[data-align-v="tengah"] { align-items: center; }
.caption-overlay[data-align-v="bawah"] { align-items: flex-end; }
.caption-overlay[hidden] { display: none !important; }

.caption-card {
  width: 92%;
  max-width: 92%;
  height: 5.6rem;
  min-height: 5.6rem;
  max-height: 5.6rem;
  box-sizing: border-box;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  background: rgba(10, 14, 22, 0.82);
  color: #f8fafc;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.68rem, 2.4vw, 0.85rem);
  line-height: 1.25;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  border-left: 3px solid #0d9488;
  animation: cap-in 0.25s ease;
}
.caption-overlay.beside-narrator .caption-card {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 0.35rem 0.7rem 0.5rem;
  font-size: clamp(1.05rem, 3.8vw, 1.4rem);
  line-height: 1.16;
  text-align: left;
  justify-content: flex-start;
  align-items: flex-start;
  white-space: normal;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}
.caption-card.style-kartu-teal {
  background: rgba(10, 14, 22, 0.82);
  color: #fcfdff;
  border-left: 3px solid #0d9488;
}
.caption-card.style-kuning-stroke,
.caption-card.style-putih-outline {
  background: transparent;
  border-left: none;
  box-shadow: none;
  text-shadow: 0 0 2px #000, 0 2px 0 #000, 2px 0 0 #000, -2px 0 0 #000, 0 -2px 0 #000;
}
.caption-card.style-kuning-stroke { color: #ffe600; text-transform: uppercase; }
.caption-card.style-putih-outline { color: #fff; }
.caption-card.style-impact-merah {
  background: rgba(140, 18, 28, 0.9);
  color: #fff;
  text-transform: uppercase;
  border-left: 3px solid #ffd228;
  border-radius: 10px;
}
.caption-card.style-neon-cyan {
  background: rgba(6, 10, 18, 0.86);
  color: #78fffa;
  border-left: 3px solid #38f0e6;
}
.caption-card.style-serif-elegan {
  background: rgba(28, 22, 16, 0.78);
  color: #fff6e6;
  border-left: 3px solid #d4a862;
  font-family: Georgia, "Times New Roman", serif;
}
.caption-card.style-pill-soft {
  background: rgba(248, 250, 252, 0.9);
  color: #12161c;
  border-left: none;
  border-radius: 28px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.caption-card.style-breaking-bar {
  background: rgba(12, 12, 14, 0.92);
  color: #fff;
  border-left: 4px solid #dc1e28;
  border-radius: 6px;
  text-transform: uppercase;
}
@keyframes cap-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.caption-editor {
  width: min(100%, 300px);
  margin-top: 0.2rem;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
}
.caption-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.caption-editor-titles {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.caption-editor-head strong {
  font-family: var(--font-display);
  font-size: 0.9rem;
}
.caption-editor-head span {
  font-size: 0.74rem;
  opacity: 0.68;
}
.icon-btn {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
}
.icon-btn[aria-pressed="false"] { opacity: 0.55; }
.icon-btn .icon-eye-off[hidden],
.icon-btn .icon-eye[hidden] {
  display: none !important;
}
.caption-controls {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: end;
}
.caption-controls .grow { flex: 1 1 100px; }
.layout-controls input[type="number"] { width: 5rem; }
.layout-fold { margin-top: 0.35rem; }
.caption-line-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.45rem;
}
.caption-line-nav span {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.72;
}
.caption-head-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(14, 21, 24, 0.45);
  display: grid;
  justify-content: end;
  z-index: 40;
  animation: fade 0.2s ease;
}
.drawer[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer-panel {
  width: min(100vw, 360px);
  height: 100%;
  background: var(--paper);
  padding: 1rem 1.05rem 1.75rem;
  box-shadow: var(--shadow);
  overflow: auto;
  animation: slide 0.25s ease;
}
@keyframes slide {
  from { transform: translateX(20px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.drawer-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.drawer-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}
.drawer-section {
  margin: 0.95rem 0 0.3rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
}
.drawer-hint {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  opacity: 0.7;
  line-height: 1.35;
}
.meta-line {
  margin: 0.25rem 0 0.1rem;
  font-size: 0.78rem;
  opacity: 0.7;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 600;
}
.badge.engine-ai { border-color: #0d9488; color: #0f4f4a; }
.badge.engine-rule { border-color: #b08a3c; color: #6a4e12; }
.yt-alts {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.3rem 0 0.55rem;
}
.yt-alts button {
  text-align: left;
  font-size: 0.8rem;
  padding: 0.4rem 0.55rem;
}
.tts-log {
  white-space: pre-wrap;
  background: rgba(14, 21, 24, 0.06);
  border-radius: 10px;
  padding: 0.65rem;
  font-size: 0.78rem;
  line-height: 1.35;
  min-height: 3.2rem;
}

@media (max-width: 920px) {
  .stage {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
  .preview { position: static; order: -1; }
  .phone { width: min(100%, 260px); }
  .phone[data-aspect="16:9"] { width: min(100%, 100%); }
  .format-tabs { order: 3; width: 100%; justify-content: center; }
  .top-links { width: 100%; }
  .connect-btn { flex: 1 1 auto; }
}

.draft-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.draft-empty {
  margin: 0.4rem 0;
  font-size: 0.82rem;
  opacity: 0.7;
}
.draft-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.7rem;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.draft-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.draft-item-meta strong {
  font-size: 0.88rem;
  line-height: 1.3;
  word-break: break-word;
}
.draft-item-meta span {
  font-size: 0.72rem;
  opacity: 0.68;
  line-height: 1.3;
}
.draft-item-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
