/* app.css: chrome aplikasi, gaya Spotify (DESIGN-spotify.md).
   Gelap imersif, aksen hijau #1ed760, tombol pill uppercase, kartu 8px.
   Kertas pratinjau tetap putih supaya akurat; print.css tidak disentuh. */

:root {
  --bg: #121212;
  --surface: #181818;
  --surface-2: #1f1f1f;
  --surface-3: #252525;
  --text: #ffffff;
  --text-muted: #b3b3b3;
  --text-faint: #7c7c7c;
  --border: #272727;
  --border-strong: #4d4d4d;

  --primary: #1ed760;
  --primary-strong: #1db954;
  --primary-soft: rgba(30, 215, 96, .14);
  --on-primary: #000000;

  --success: #1ed760;  --success-soft: rgba(30, 215, 96, .14);
  --warning: #ffa42b;  --warning-soft: rgba(255, 164, 43, .14);
  --danger: #f3727f;   --danger-soft: rgba(243, 114, 127, .14);
  --info: #539df5;     --info-soft: rgba(83, 157, 245, .14);

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px;
  --shadow-sm: none;
  --shadow-md: rgba(0, 0, 0, .3) 0 8px 8px;
  --shadow-lg: rgba(0, 0, 0, .5) 0 8px 24px;

  --glow-focus: 0 0 0 2px #ffffff;
  --glow-cta: none;
  --glow-cta-hover: none;

  --dur: 160ms;
  --ease: cubic-bezier(.3, .7, .4, 1);
  --font: "SpotifyMixUI", "Circular", "CircularSp-Arab", "Helvetica Neue", helvetica, arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;

  /* dipakai print.css & pratinjau */
  --paper: #ffffff;
  --desk: #0b0b0b;
  --appbar-h: 58px;
}

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; color-scheme: dark; }
html, body { overflow-x: clip; }

/* border-box hanya untuk chrome aplikasi (BUKAN lembar kertas) */
#viewDash, #viewDash *, .appbar, .appbar *, .tabbar, .tabbar *,
.zoombar, .zoombar *, #form, #form *, #checklist, #checklist *,
.toast, input, textarea, select, button { box-sizing: border-box; }

a, button, summary, select, input, textarea, label { touch-action: manipulation; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.is-hidden { display: none !important; }

/* Pane tersembunyi tetap harus terukur untuk pagination */
.is-offpane { position: absolute !important; left: -20000px; top: 0; width: calc(100vw - 24px); max-width: 1152px; visibility: hidden; pointer-events: none; }

:focus-visible { outline: none; box-shadow: var(--glow-focus); }

/* ---------- layout ---------- */
.wrap { margin-inline: auto; }
.wrap-dash   { width: min(768px,  calc(100% - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))); }
.wrap-editor { width: min(1152px, calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))); }

/* ---------- appbar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(18, 18, 18, .92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.appbar-inner { padding-block: var(--sp-3); }
.app-title { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--primary); }
.app-sub { margin: 2px 0 0; font-size: 14px; color: var(--text-muted); overflow-wrap: anywhere; }

/* ---------- dashboard ---------- */
.dash-main { display: flex; flex-direction: column; gap: var(--sp-5); padding-block: var(--sp-5) calc(var(--sp-7) + env(safe-area-inset-bottom, 0px)); }

.card { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.card-lg { padding: var(--sp-4); }
.card-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; }

.specs-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); }
.specs-text { min-width: 0; flex: 1 1 220px; }
.specs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px var(--sp-4); margin: var(--sp-3) 0 0; font-size: 14px; }
.specs-grid dt { color: var(--text-muted); font-size: 12px; }
.specs-grid dd { margin: 0; font-weight: 700; }
@media (min-width: 640px) { .specs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .card-lg { padding: var(--sp-5); } }

.specs-actions { display: flex; flex-direction: column; gap: var(--sp-2); flex: none; width: 100%; }
.specs-actions > * { width: 100%; }
@media (min-width: 640px) { .specs-actions { flex-direction: row; width: auto; } .specs-actions > * { width: auto; } }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); margin: 0 0 var(--sp-3); font-size: 18px; font-weight: 700; }
.section-count { font-size: 12px; font-weight: 400; color: var(--text-muted); }

.draft-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.empty-note { margin: 0; padding: var(--sp-4); font-size: 14px; color: var(--text-muted); }

.draft { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); transition: background var(--dur) var(--ease); }
.draft-main { min-width: 0; flex: 1 1 auto; text-decoration: none; color: inherit; }
.draft-main strong { display: block; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.draft-main span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow-wrap: anywhere; }
@media (hover: hover) { .draft:hover { background: var(--surface-3); } }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 10.5px; font-weight: 700; vertical-align: middle; }

/* ---------- tombol: pill, uppercase, letter-spacing ---------- */
.btn-primary, .btn-ghost, .btn-danger, .btn-mini {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 20px;
  border-radius: 9999px;
  font: inherit; font-size: 13px; font-weight: 700; line-height: 1.1;
  text-transform: uppercase; letter-spacing: 1.4px;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn-primary:active, .btn-ghost:active, .btn-danger:active, .btn-mini:active { transform: scale(.96); }

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-ghost   { background: transparent; color: var(--text); border-color: var(--text-faint); }
.btn-danger  { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.btn-mini    { min-height: 44px; padding: 8px 16px; font-size: 12px; letter-spacing: 1px; background: var(--surface-2); color: var(--text); }
.btn-mini:disabled { opacity: .4; cursor: not-allowed; }
@media (hover: hover) {
  .btn-primary:hover { background: #3be477; transform: scale(1.03); }
  .btn-ghost:hover { border-color: var(--text); transform: scale(1.03); }
  .btn-danger:hover { background: var(--danger-soft); }
  .btn-mini:hover { background: var(--surface-3); }
}

/* tombol ikon bulat (naik / turun / hapus) */
.icon-btn { flex: none; width: 44px; min-width: 44px; padding: 0; border-radius: 50%; letter-spacing: 0; font-size: 16px; }

/* ---------- editor appbar ---------- */
.editor-appbar-inner { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); padding-block: var(--sp-2); }
.editor-back  { order: 1; }
.editor-meta  { order: 2; min-width: 0; flex: 1 1 0; }
.editor-print { order: 3; }
.tpl-pick     { order: 4; flex: 1 1 100%; width: 100%; }
.editor-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-status { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#viewEditor .appbar { position: static; }
@media (min-width: 641px) {
  #viewEditor .appbar { position: sticky; }
  .editor-appbar-inner { flex-wrap: nowrap; min-height: var(--appbar-h); }
  .tpl-pick { order: 3; flex: none; width: auto; }
  .editor-print { order: 4; }
}

/* ---------- tabbar ---------- */
.tabbar {
  position: sticky; top: 0; z-index: 40;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(18, 18, 18, .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 641px) { .tabbar { top: var(--appbar-h); padding-top: 0; } }
.tabbar-inner { display: flex; gap: var(--sp-2); padding-block: var(--sp-2); }
.tab {
  flex: 1 1 0; min-height: 44px; padding: 0 var(--sp-4);
  border-radius: 9999px; border: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
  background: var(--surface-2); color: var(--text-muted);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
@media (min-width: 641px) { .tab { flex: none; } }
@media (hover: hover) { .tab:hover { color: var(--text); background: var(--surface-3); } }
.tab[aria-selected="true"] { background: var(--primary); color: var(--on-primary); }

/* ---------- editor grid ---------- */
.editor-main { display: grid; gap: var(--sp-5); padding-block: var(--sp-4) calc(var(--sp-6) + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1024px) { .editor-main { grid-template-columns: minmax(22rem, 26rem) 1fr; align-items: start; } }

.form-pane { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
#form { display: flex; flex-direction: column; gap: var(--sp-2); }
.form-note { margin: 0; padding: 0 var(--sp-1) var(--sp-2); font-size: 12px; color: var(--text-faint); }
.paper-pane { min-width: 0; }

/* ---------- accordion ---------- */
details.sec { background: var(--surface); border-radius: var(--radius-md); overflow: hidden; }
details.sec > summary {
  min-height: 56px; display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4); cursor: pointer; list-style: none;
  font-size: 16px; font-weight: 700;
}
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::before {
  content: ""; width: 8px; height: 8px; flex: none;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(-45deg); transition: transform var(--dur) var(--ease);
}
details.sec[open] > summary::before { transform: rotate(45deg); }
details.sec > summary:focus-visible { box-shadow: inset 0 0 0 2px #fff; }
details.sec > .sec-body { padding: var(--sp-3) var(--sp-4) var(--sp-4); border-top: 1px solid var(--border); }
details.sec .sec-meta { margin-left: auto; font-size: 11.5px; font-weight: 400; color: var(--text-faint); text-align: right; max-width: 45%; }

/* ---------- form (inilah perbaikan kolom: border-box + min-width:0) ---------- */
.field { margin-bottom: var(--sp-4); min-width: 0; }
.field > label, .field > .field-label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: var(--sp-2); }
.field .hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: var(--sp-1); }

input[type="text"], input[type="date"], input[type="password"], input[type="url"], textarea, select {
  display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 46px;
  padding: 11px 16px;
  border: 0; border-radius: 500px;
  background: var(--surface-2); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  font: inherit; font-size: 16px; /* cegah auto-zoom iOS */
  -webkit-appearance: none; appearance: none;
  transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
textarea { min-height: 96px; line-height: 1.55; resize: vertical; border-radius: var(--radius-md); }
select {
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, #b3b3b3 50%), linear-gradient(135deg, #b3b3b3 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input[type="text"]:focus-visible, input[type="date"]:focus-visible, input[type="password"]:focus-visible,
input[type="url"]:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; background: var(--surface-3); box-shadow: inset 0 0 0 2px #ffffff;
}
input[type="file"] { width: 100%; max-width: 100%; min-height: 44px; padding: 6px 0; font-size: 13px; color: var(--text-muted); }
input[type="range"] { min-height: 44px; accent-color: var(--primary); }

.row-item { background: var(--surface-2); border-radius: var(--radius-md); padding: var(--sp-3); margin-bottom: var(--sp-2); min-width: 0; }
.row-head { display: flex; align-items: center; gap: 6px; margin-bottom: var(--sp-2); }
.row-head .row-no { font-size: 12px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; margin-right: auto; }

.item-row { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 6px; min-width: 0; }
.item-row input, .item-row textarea { flex: 1 1 auto; min-width: 0; width: auto; }
.row-item input, .row-item textarea { background: var(--surface); }

.check { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); }

.tokens { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.token {
  min-height: 40px; padding: 6px 14px; border: 0; border-radius: 9999px;
  background: var(--surface-3); color: var(--text-muted);
  font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer;
}
@media (hover: hover) { .token:hover { background: var(--primary-soft); color: var(--primary); } }

.logo-preview { display: block; height: 72px; width: 72px; margin-bottom: var(--sp-2); border-radius: var(--radius-sm); background: var(--surface-3); object-fit: contain; padding: 4px; }
.logo-row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

/* ---------- checklist ---------- */
.checklist { padding: var(--sp-4); font-size: 14px; }
.checklist-title { margin: 0; font-weight: 700; }
.checklist ul { list-style: none; padding: 0; margin: var(--sp-2) 0 0; }
.checklist li + li { margin-top: var(--sp-1); }
.checklist button {
  text-align: left; width: 100%; min-height: 44px; display: flex; align-items: center; gap: var(--sp-3);
  background: none; border: 0; border-radius: var(--radius-sm); padding: var(--sp-1) 6px;
  font: inherit; font-size: 14px; color: var(--text); cursor: pointer;
}
@media (hover: hover) { .checklist button:hover { background: var(--surface-2); } }
.mark { width: 20px; height: 20px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 11px; font-weight: 700; }
.mark.no  { background: var(--danger-soft);  color: var(--danger); }
.mark.yes { background: var(--primary); color: #000; }

/* ---------- pratinjau kertas ---------- */
.zoombar { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); flex-wrap: wrap; }
.zoom-label { font-size: 12px; font-weight: 700; color: var(--text-muted); }
#zoom { flex: 1 1 8rem; width: auto; min-width: 0; min-height: 0; height: 28px; accent-color: var(--primary); }
.btn-fit { min-height: 40px; padding: 6px 16px; font-size: 12px; }
.paper-status { margin-left: auto; font-size: 12px; color: var(--text-muted); }
@media (max-width: 640px) { .paper-status { margin-left: 0; flex: 1 1 100%; } }

.paper-bg {
  background: var(--desk); border-radius: var(--radius-md); padding: var(--sp-3);
  overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  touch-action: pan-x pan-y pinch-zoom;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: var(--sp-3); right: var(--sp-3);
  bottom: calc(var(--sp-3) + env(safe-area-inset-bottom, 0px)); z-index: 60;
  margin-inline: auto; max-width: 24rem; padding: var(--sp-3) var(--sp-4);
  border-radius: 9999px; background: #ffffff; color: #000000;
  font-size: 14px; font-weight: 700; text-align: center; box-shadow: var(--shadow-lg);
}

.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; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Fitur AI: tombol pengaturan, dialog, pratinjau hasil.
   Memakai token yang sama dengan chrome lain (pill, radius 8px,
   tombol uppercase) supaya tidak terlihat seperti UI asing.
   ============================================================ */

/* Tombol pengaturan di dashboard */
.ai-settings-dash { align-self: flex-start; margin-top: var(--sp-3); }


/* Satu tombol AI utama di header editor. Tidak ada tombol AI per bagian. */
.ai-start-edit { order: 3; }
.ai-settings-edit { order: 5; }
.ai-project-prompt {
  min-height: 150px;
  border-radius: var(--radius-md) !important;
}
.ai-project-hint { margin-bottom: 0; }

/* ---------- overlay + bottom sheet ---------- */
.ai-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.ai-sheet {
  width: min(560px, 100%);
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: aiSheetIn var(--dur) var(--ease);
}
@keyframes aiSheetIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-sheet-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.ai-dialog-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-close { font-size: 18px; line-height: 1; }

.ai-sheet-body {
  padding: var(--sp-4);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.ai-sheet-body .field:last-child { margin-bottom: 0; }

.ai-sheet-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.ai-sheet-foot > * { flex: 1 1 130px; }
.ai-sheet-foot > .btn-danger { flex: 0 1 auto; }

/* ---------- isi form pengaturan ---------- */
.ai-keyrow { display: flex; gap: var(--sp-2); align-items: stretch; min-width: 0; }
.ai-keyrow input { flex: 1 1 auto; min-width: 0; }
.ai-keyrow .btn-mini { flex: none; }

/* ---------- pratinjau hasil ---------- */
.ai-status { margin: 0; font-size: 14px; color: var(--text-muted); }
.ai-status-err { color: var(--danger); }

.ai-view { padding-bottom: var(--sp-3); margin-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
.ai-view:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.ai-view-label { margin: 0 0 var(--sp-1); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); }
.ai-view-val {
  margin: 0 0 var(--sp-2);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 220px;
  overflow-y: auto;
}
.ai-view-val:last-child { margin-bottom: 0; }
.ai-view-empty { color: var(--text-faint); font-style: italic; }

/* Layar lebar: dialog jadi modal tengah, bukan bottom sheet. */
@media (min-width: 620px) {
  .ai-overlay { align-items: center; padding: var(--sp-3); }
  .ai-sheet { border-radius: var(--radius-lg); border: 1px solid var(--border); }
}

/* HP kecil: tombol dialog jadi satu kolom supaya tidak sempit. */
@media (max-width: 420px) {
  .ai-sheet-foot > * { flex: 1 1 100%; }
  .ai-sheet-foot > .btn-danger { flex: 1 1 100%; }
}

@media print {
  .ai-overlay, .ai-sec-btn, .ai-settings-dash, .ai-settings-edit { display: none !important; }
}

/* Jarak form */
.row-item { display: flex; flex-direction: column; gap: 4px; }
.row-item > .row-head { margin-bottom: 2px; }
.row-item input, .row-item textarea { margin: 0; }
.field { margin-bottom: 12px; }
.field > label, .field > .field-label { margin-bottom: 4px; }
#form { gap: 6px; }
.form-pane { gap: 8px; }


/* ========== FIX toolbar HP (tidak dempet) + logo picker ========== */
.editor-appbar-inner {
  display: grid !important;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "back meta gear"
    "actions actions actions"
    "tpl tpl tpl";
  gap: 8px;
  align-items: center;
  padding: 10px 0;
}
.editor-back { grid-area: back; width: 44px; min-width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.editor-back .btn-label { display: none; }
.editor-meta { grid-area: meta; min-width: 0; }
.editor-meta .editor-title { display: none; } /* hemat ruang di HP; status tetap */
.ai-settings-edit {
  grid-area: gear;
  width: 44px !important; min-width: 44px !important; height: 44px !important;
  padding: 0 !important; border-radius: 50% !important;
  justify-self: end;
}
.editor-actions {
  grid-area: actions;
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  width: 100%;
  flex: none !important;
}
.editor-actions > * {
  flex: none !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 44px;
  padding: 10px 8px !important;
  font-size: 12px !important;
  letter-spacing: 0.6px !important;
  justify-content: center;
}
.editor-actions .btn-label { display: inline; }
.tpl-pick {
  grid-area: tpl;
  width: 100% !important;
  flex: none !important;
  min-height: 44px;
}
.ai-start-edit { order: unset !important; }

@media (min-width: 720px) {
  .editor-appbar-inner {
    display: flex !important;
    flex-wrap: nowrap;
    gap: 10px;
  }
  .editor-back { width: auto; min-width: auto; height: auto; padding: 10px 16px; border-radius: 9999px; }
  .editor-back .btn-label { display: inline; }
  .editor-meta .editor-title { display: block; }
  .editor-actions {
    display: flex !important;
    width: auto;
    grid-template-columns: none;
  }
  .editor-actions > * { width: auto !important; padding: 10px 16px !important; }
  .tpl-pick { width: auto !important; min-width: 11rem; }
  .ai-settings-edit { justify-self: auto; }
}

/* Logo upload terlihat jelas */
.logo-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
}
.logo-preview {
  display: block !important;
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 6px;
  margin: 0;
}
.logo-preview.is-empty { opacity: 0.85; }
.logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.logo-pick {
  flex: 1 1 auto;
  min-height: 44px;
}
.file-input.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  border: 0 !important;
}
