@import url("/suaraku/suaraku.css");

/* Konten — gudang skrip TTS (tema sama Suaraku lewat import) */

/* ===== OVERRIDE APP TITLE — kuning jelas tanpa shadow ===== */
body.konten-app.suaraku-app .app-title {
  color: var(--yellow) !important;
  text-shadow: none !important;
  -webkit-text-fill-color: var(--yellow) !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
}
body.konten-app.suaraku-app .brand-mark {
  width: 56px !important;
  height: 56px !important;
  background: transparent !important;
  box-shadow: 0 0 0 1px rgba(250,204,21,0.2) !important;
  border-radius: 14px !important;
  overflow: hidden;
  padding: 0;
}

body.konten-app.suaraku-app .brand-mark img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  border-radius: 14px;
}

body.konten-app.suaraku-app .tag {
  max-width: 24rem;
}

/* Kolom Brief mengisi tinggi grid; scroll di tengah, footer & tombol tidak menutupi field */
.card-brief.card-studio {
  flex: 1;
  min-height: 0;
}

.card-brief .card-studio-scroll {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  padding-bottom: 1.25rem;
}

/* Pesan error panjang: scrollable agar tidak mendorong model & tombol keluar layar */
.card-brief .studio-notice,
.card-brief .credits-banner {
  max-height: 5.75rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  word-break: break-word;
}

.card-brief .card-studio-footer {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  padding-top: 0.65rem;
}

.card-brief .card-studio-footer .actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
}

.card-brief .card-studio-footer .actions #btnGenerate {
  display: flex;
  width: min(100%, 22rem);
  min-height: 3rem;
  padding: 0.72rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #0a0a0a;
  background: linear-gradient(120deg, var(--yellow), var(--yellow2));
  border: none;
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.38),
    0 8px 32px rgba(250, 204, 21, 0.38);
}

.card-brief .card-studio-footer .actions #btnGenerate #genLabel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  text-align: center;
  color: inherit;
}

.card-brief .card-head--brief {
  align-items: center;
  gap: 0.5rem;
}

.card-brief .card-head--brief h2 {
  margin: 0;
}

.card-brief .card-head--brief #btnResetBrief {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-color: rgba(250, 204, 21, 0.42);
}

/* Suaraku hanya memakai width 100% untuk text/password — samakan number di Konten */
body.konten-app.suaraku-app input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

body.konten-app.suaraku-app input[type="number"]:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.18), 0 0 16px rgba(250, 204, 21, 0.1);
}

select optgroup {
  font-weight: 800;
  color: var(--yellow2);
  background: #0c0c0c;
}

select option {
  font-weight: 500;
  color: var(--text);
  background: #0a0a0a;
}

#outputScript {
  min-height: min(48vh, 420px);
}

.konten-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* Riwayat generate + modal konfirmasi */
.konten-history {
  flex-shrink: 0;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(250, 204, 21, 0.2);
  max-height: min(34vh, 280px);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.konten-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-bottom: 0.45rem;
}

.konten-history-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--yellow-dim);
}

.konten-history-head .btn-sm {
  flex-shrink: 0;
}

.konten-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scrollbar-gutter: stable;
}

.konten-history-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.42);
}

.konten-history-item-main {
  min-width: 0;
}

.konten-history-item-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--yellow2);
  line-height: 1.35;
}

.konten-history-item-meta {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.konten-history-item-preview {
  font-size: 0.74rem;
  color: #d4d4d8;
  line-height: 1.45;
  margin-top: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.konten-history-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.konten-history-item-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}

.konten-history-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  padding: 0.45rem 0.25rem 0.15rem;
  line-height: 1.45;
}

.konten-confirm.modal-confirm {
  border-radius: 16px;
}

/* konten-modal-keys — ukuran override untuk modal baru km-* */
.konten-modal-keys {
  width: min(540px, 100%);
}

.field-tipe-konten label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tipe-konten-mark {
  display: inline-block;
  width: 14px;
  height: 10px;
  background: linear-gradient(
    var(--yellow2) 0,
    var(--yellow2) 2px,
    transparent 2px,
    transparent 4px,
    var(--yellow2) 4px,
    var(--yellow2) 6px,
    transparent 6px,
    transparent 8px,
    var(--yellow2) 8px,
    var(--yellow2) 10px
  );
  border-radius: 1px;
  flex-shrink: 0;
  opacity: 0.95;
}

/* ===== KONTEN — RESPONSIVE OVERRIDES ===== */

/* Nav actions: wrap rapi di layar medium */
body.konten-app.suaraku-app .nav-actions {
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Tombol nav compact — ikon + label */
.btn-nav-compact,
.btn-nav-settings {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Semua tombol nav punya min-width agar tidak terlalu kecil */
body.konten-app.suaraku-app .nav-actions .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== BREAKPOINT 1024px — layout 2 kolom tapi nav lebih compact ===== */
@media (max-width: 1024px) {
  body.konten-app.suaraku-app .app-title {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  }

  body.konten-app.suaraku-app .byline {
    font-size: 0.78rem;
  }

  body.konten-app.suaraku-app .nav-actions {
    gap: 0.3rem;
  }

  body.konten-app.suaraku-app .nav-actions .btn {
    font-size: 0.72rem;
    padding: 0.38rem 0.65rem;
  }

  body.konten-app.suaraku-app .nav-actions .credit-pill {
    font-size: 0.62rem;
    padding: 0.2rem 0.45rem 0.2rem 0.38rem;
  }

  /* Sembunyikan label teks, tampilkan hanya ikon di 1024px */
  .btn-nav-compact .btn-nav-label,
  .btn-nav-settings .btn-nav-label {
    display: none;
  }

  .btn-nav-compact,
  .btn-nav-settings {
    padding: 0.38rem 0.55rem;
    min-width: 36px;
    justify-content: center;
  }
}

/* ===== BREAKPOINT 900px — single column, scroll mode ===== */
@media (max-width: 900px) {
  /* Nav: 2 baris — brand di atas, actions di bawah */
  body.konten-app.suaraku-app .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem 0.75rem;
    margin-left: -0.15rem;
    margin-right: -0.15rem;
    border-radius: 0 0 14px 14px;
    border: 1px solid rgba(250, 204, 21, 0.2);
    border-top: none;
    background: linear-gradient(180deg, rgba(250, 204, 21, 0.06), transparent);
  }

  body.konten-app.suaraku-app .nav-actions {
    display: grid;
    grid-template-columns: auto auto 1fr 1fr 1fr;
    gap: 0.4rem;
    flex-wrap: unset;
    justify-content: unset;
    align-items: center;
  }

  /* Credit pill: kolom 1 */
  body.konten-app.suaraku-app .nav-actions .credit-pill {
    grid-column: 1;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Key status: kolom 2 */
  body.konten-app.suaraku-app .nav-actions #keyStatus {
    grid-column: 2;
    text-align: center;
    justify-content: center;
    white-space: nowrap;
  }

  /* 3 tombol mengisi sisa kolom */
  body.konten-app.suaraku-app .nav-actions .btn {
    min-height: 40px;
    justify-content: center;
    text-align: center;
    font-size: 0.72rem;
    padding: 0.4rem 0.5rem;
  }

  /* Tampilkan label lagi di 900px karena ada ruang */
  .btn-nav-compact .btn-nav-label,
  .btn-nav-settings .btn-nav-label {
    display: inline;
  }

  /* Workspace: 1 kolom */
  body.konten-app.suaraku-app .workspace {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .card-brief .card-studio-scroll {
    max-height: none;
    flex: 1 1 0;
    min-height: 0;
  }

  #outputScript {
    min-height: 220px;
    max-height: 45vh;
  }
}

/* ===== BREAKPOINT 640px — mobile sempit ===== */
@media (max-width: 640px) {
  body.konten-app.suaraku-app .app-title {
    font-size: 1.6rem;
  }

  body.konten-app.suaraku-app .byline {
    font-size: 0.72rem;
  }

  body.konten-app.suaraku-app .tag {
    font-size: 0.6rem;
  }

  /* Nav actions: 2 baris grid */
  body.konten-app.suaraku-app .nav-actions {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.35rem;
  }

  /* Credit pill full width baris pertama */
  body.konten-app.suaraku-app .nav-actions .credit-pill {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }

  /* Key status full width baris kedua */
  body.konten-app.suaraku-app .nav-actions #keyStatus {
    grid-column: 1 / -1;
    text-align: center;
    justify-content: center;
    width: 100%;
  }

  body.konten-app.suaraku-app .nav-actions .btn {
    min-height: 44px;
    font-size: 0.72rem;
    padding: 0.45rem 0.5rem;
  }

  .card-brief .card-head--brief {
    padding-top: 0.15rem;
    margin-bottom: 0.25rem;
  }

  /* Kecilkan judul BRIEF dan tombol Reset */
  .card-brief .card-head--brief h2 {
    font-size: 0.72rem !important;
  }

  .card-brief .card-head--brief #btnResetBrief {
    font-size: 0.62rem !important;
    padding: 0.2rem 0.55rem !important;
    min-height: 26px !important;
  }

  /* Padding card brief lebih compact */
  body.konten-app.suaraku-app .col-left.kbn-tab-active .card-brief {
    padding: 0.5rem 0.6rem !important;
  }

  /* Label field lebih kecil */
  body.konten-app.suaraku-app .col-left .field label {
    font-size: 0.6rem !important;
    margin-bottom: 0.2rem !important;
  }

  /* Select dan input lebih compact */
  body.konten-app.suaraku-app .col-left select,
  body.konten-app.suaraku-app .col-left textarea {
    font-size: 0.82rem !important;
    padding: 0.4rem 0.55rem !important;
  }

  .card-brief .card-studio-footer .actions #btnGenerate {
    width: 100%;
    max-width: none;
    min-height: 42px;
    font-size: 0.95rem !important;
  }

  body.konten-app.suaraku-app input[type="number"] {
    min-height: 44px;
    font-size: 1rem;
  }

  /* Header skrip: stack vertikal */
  .konten-app .col-right .card-head.card-head--text {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding-bottom: 0.25rem;
  }

  /* Judul dan char count lebih kecil */
  .konten-app .col-right .card-head--text .card-head-text-meta h2 {
    font-size: 0.72rem !important;
  }

  .konten-app .col-right .card-head--text .card-head-text-meta .char-count {
    font-size: 0.62rem !important;
  }

  /* Padding card lebih compact di mobile */
  body.konten-app.suaraku-app .col-right.kbn-tab-active .card-text {
    padding: 0.5rem 0.6rem !important;
  }

  .konten-app .col-right .card-head--text .konten-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
  }

  .konten-app .col-right .card-head--text .konten-actions .btn,
  .konten-app .col-right .card-head--text .konten-actions .btn.btn-sm {
    justify-content: center;
    min-height: 30px;
    font-size: 0.65rem;
    padding: 0.25rem 0.2rem;
    border-radius: 8px;
  }

  /* Buat Mp3 full width */
  .konten-app .col-right .card-head--text .konten-actions #btnBuatMp3 {
    grid-column: 1 / -1;
    min-height: 32px;
  }

  /* Riwayat lebih compact di mobile */
  .konten-history {
    max-height: min(28vh, 220px);
  }

  .konten-history-head {
    flex-wrap: wrap;
  }

  .konten-history-head .btn-sm {
    width: 100%;
    justify-content: center;
  }

  /* Modal key: lebih compact di mobile */
  .konten-modal-keys {
    border-radius: 16px;
    max-height: 95dvh;
  }

  .km-header {
    padding: 0.85rem 1rem;
  }

  .km-body {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .km-footer {
    padding: 0.6rem 1rem;
  }

  .km-add-row {
    flex-direction: column;
    gap: 0.4rem;
  }

  .km-key-actions {
    gap: 0.15rem;
  }

  .km-icon-btn {
    width: 32px;
    height: 32px;
  }

  .km-icon-btn--activate {
    font-size: 0.55rem;
    padding: 0 0.4rem;
  }
}

/* ===== BREAKPOINT 400px — layar sangat sempit ===== */
@media (max-width: 400px) {
  body.konten-app.suaraku-app .app-title {
    font-size: 1.4rem;
  }

  body.konten-app.suaraku-app .brand-mark {
    width: 38px;
    height: 38px;
  }

  body.konten-app.suaraku-app .brand-mark svg {
    width: 20px;
    height: 20px;
  }

  .konten-app .col-right .card-head--text .konten-actions {
    grid-template-columns: 1fr 1fr;
  }

  /* Buat Mp3 full width */
  .konten-app .col-right .card-head--text .konten-actions #btnBuatMp3 {
    grid-column: 1 / -1;
  }
}

/* ===== MODAL API KEY — gaya promptvision ===== */

/* Override ukuran modal lama */
.konten-modal-keys {
  width: min(540px, 100%);
  max-height: 90dvh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
}

/* Header */
.km-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(250, 204, 21, 0.12);
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.km-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.km-header-icon {
  width: 34px;
  height: 34px;
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yellow2);
  flex-shrink: 0;
}

.km-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--yellow2);
  margin: 0;
  line-height: 1.2;
}

.km-subtitle {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.15rem 0 0;
}

.km-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.km-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e0e0e0;
}

/* Body */
.km-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-gutter: stable;
}

.km-provider-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.85rem;
  background: rgba(0, 0, 0, 0.35);
}

.km-provider-tab {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.km-provider-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
}

.km-provider-tab--active {
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250, 204, 21, 0.35);
  color: var(--yellow2);
}

.km-provider-tab-title {
  display: block;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.km-provider-tab-sub {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.58rem;
  opacity: 0.85;
}

.km-empty-sub {
  margin: 0.35rem 0 0;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
}

/* Info banner */
.km-info-banner {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.65rem 0.8rem;
  background: rgba(250, 204, 21, 0.04);
  border: 1px solid rgba(250, 204, 21, 0.14);
  border-radius: 12px;
  font-size: 0.72rem;
  color: #a3a3a3;
  line-height: 1.55;
}

.km-info-icon {
  color: var(--yellow2);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.km-info-banner a {
  color: var(--yellow2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Key list */
.km-keys-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.km-empty {
  text-align: center;
  padding: 1.5rem 0.5rem;
  opacity: 0.4;
}

.km-empty svg {
  margin: 0 auto 0.5rem;
  display: block;
  color: var(--muted);
}

.km-empty p {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* Key row */
.km-key-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.km-key-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(250, 204, 21, 0.2);
}

.km-key-row--active {
  border-color: rgba(250, 204, 21, 0.4);
  background: rgba(250, 204, 21, 0.03);
}

.km-key-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(250, 204, 21, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 900;
  color: var(--yellow2);
  flex-shrink: 0;
}

.km-key-info {
  flex: 1;
  min-width: 0;
}

.km-key-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.km-key-badge {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(250, 204, 21, 0.1);
  color: var(--yellow2);
  flex-shrink: 0;
}

.km-key-mask {
  font-size: 0.68rem;
  font-family: ui-monospace, monospace;
  color: var(--muted);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.km-key-credit {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  color: #4ade80;
  flex-shrink: 0;
  min-width: 3rem;
  text-align: right;
}

/* Action buttons per row */
.km-key-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.km-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.km-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e0e0e0;
}

.km-icon-btn--copy.copied {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
}

.km-icon-btn--activate {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: auto;
  padding: 0 0.5rem;
  color: var(--yellow-dim);
  border: 1px solid rgba(250, 204, 21, 0.25);
}

.km-icon-btn--activate:hover {
  background: rgba(250, 204, 21, 0.08);
  color: var(--yellow2);
  border-color: rgba(250, 204, 21, 0.5);
}

.km-icon-btn--activate.is-active {
  background: rgba(250, 204, 21, 0.12);
  color: var(--yellow2);
  border-color: rgba(250, 204, 21, 0.5);
}

.km-icon-btn--del:hover {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
}

/* Section label */
.km-section-label {
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.55rem;
}

/* Add section */
.km-add-section {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.km-add-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.km-select {
  flex: 0 0 auto;
  min-width: 0;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  outline: none;
  transition: border-color 0.2s;
  cursor: pointer;
}

.km-select:focus {
  border-color: var(--yellow);
}

.km-model-section {
  padding: 0.85rem 0 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 0.75rem;
}

.km-model-select {
  width: 100%;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.km-model-hint {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(163, 163, 163, 0.85);
}

.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(163, 163, 163, 0.85);
}

.field-hint a {
  color: rgba(250, 204, 21, 0.75);
  text-decoration: underline;
}

.field-hint a {
  color: rgba(250, 204, 21, 0.75);
  text-decoration: underline;
}

.km-key-badge--oa {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.35);
  color: #93c5fd;
}

.km-input {
  flex: 1;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.km-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.15);
}

.km-key-input-wrap {
  position: relative;
  margin-bottom: 0.5rem;
}

.km-key-input {
  padding-right: 2.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
}

.km-eye-btn {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  transition: color 0.15s;
}

.km-eye-btn:hover {
  color: #e0e0e0;
}

.km-add-error {
  font-size: 0.72rem;
  color: #f87171;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.km-add-error.hidden {
  display: none;
}

.km-add-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: #d4d4d8;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.km-add-btn:hover:not(:disabled) {
  background: rgba(250, 204, 21, 0.08);
  border-color: rgba(250, 204, 21, 0.3);
  color: var(--yellow2);
}

.km-add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Footer */
.km-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(250, 204, 21, 0.1);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  gap: 0.5rem;
}

.km-key-count {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 480px) {
  .km-add-row {
    flex-direction: column;
  }
  .km-key-actions {
    gap: 0.15rem;
  }
}

/* ===== TOAST NOTIFICATION ===== */
#kontenToastContainer {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  width: max-content;
  max-width: min(92vw, 420px);
}

.konten-toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.3);
  pointer-events: auto;
  white-space: nowrap;
  animation: kontenToastIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

.konten-toast.hiding {
  animation: kontenToastOut 0.25s ease-in forwards;
}

.konten-toast--success {
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid rgba(74, 222, 128, 0.45);
  color: #86efac;
}

.konten-toast--error {
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.konten-toast--info {
  background: rgba(20, 20, 20, 0.92);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fde68a;
}

.konten-toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.konten-toast--success .konten-toast-icon { background: rgba(74,222,128,0.15); color: #4ade80; }
.konten-toast--error   .konten-toast-icon { background: rgba(248,113,113,0.15); color: #f87171; }
.konten-toast--info    .konten-toast-icon { background: rgba(250,204,21,0.12);  color: #facc15; }

@keyframes kontenToastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes kontenToastOut {
  from { opacity: 1; transform: translateY(0)   scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.95); }
}

/* ===== BOTTOM NAVBAR — mobile only ===== */
.konten-bottom-nav {
  display: none; /* hidden di desktop */
}

@media (max-width: 900px) {
  /* Full height + override suaraku.css */
  body.konten-app.suaraku-app {
    overflow: hidden !important;
    height: 100dvh !important;
    min-height: unset !important;
  }

  body.konten-app.suaraku-app .app-shell {
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: unset !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.konten-app.suaraku-app .workspace {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* Sembunyikan nav-actions di header saat mobile — digantikan bottom nav */
  body.konten-app.suaraku-app .nav-actions {
    display: none !important;
  }

  /* Nav header jadi 1 baris brand saja */
  body.konten-app.suaraku-app .nav {
    flex-direction: row;
    align-items: center;
    padding: 0.55rem 0.75rem;
    margin: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(250, 204, 21, 0.15);
    background: rgba(3, 3, 3, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  /* Tab switching: sembunyikan kolom yang tidak aktif */
  body.konten-app.suaraku-app .col-left,
  body.konten-app.suaraku-app .col-right {
    display: none !important;
  }

  body.konten-app.suaraku-app .col-left.kbn-tab-active,
  body.konten-app.suaraku-app .col-right.kbn-tab-active {
    display: flex !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* Saat generating: col-right boleh overflow visible agar fixed overlay bisa keluar */
  body.konten-app.suaraku-app.is-generating .col-right.kbn-tab-active {
    overflow: visible !important;
  }

  /* col-left aktif: card-brief scroll */
  body.konten-app.suaraku-app .col-left.kbn-tab-active .card-brief {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  body.konten-app.suaraku-app .col-left.kbn-tab-active .card-brief .card-studio-scroll {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
  }

  /* col-right aktif: card-text mengisi penuh */
  body.konten-app.suaraku-app .col-right.kbn-tab-active .card-text {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    height: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  body.konten-app.suaraku-app .col-right.kbn-tab-active #outputScript {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    resize: none !important;
  }

  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-history {
    flex-shrink: 0 !important;
    max-height: 22vh !important;
  }

  /* ===== TAB SKRIP: header compact ===== */
  body.konten-app.suaraku-app .col-right.kbn-tab-active .card-text {
    padding: 0.5rem 0.6rem !important;
  }

  body.konten-app.suaraku-app .col-right.kbn-tab-active .card-head--text {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.2rem !important;
    margin-bottom: 0.2rem !important;
  }

  body.konten-app.suaraku-app .col-right.kbn-tab-active .card-head-text-meta h2 {
    font-size: 0.7rem !important;
  }

  body.konten-app.suaraku-app .col-right.kbn-tab-active .card-head-text-meta .char-count {
    font-size: 0.6rem !important;
  }

  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.25rem !important;
    width: 100% !important;
  }

  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-actions .btn,
  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-actions .btn-sm {
    min-height: 28px !important;
    height: 28px !important;
    font-size: 0.62rem !important;
    padding: 0 0.3rem !important;
    justify-content: center !important;
    border-radius: 8px !important;
  }

  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-actions #btnBuatMp3 {
    grid-column: 1 / -1 !important;
    min-height: 32px !important;
    height: 32px !important;
    font-size: 0.72rem !important;
  }

  /* Riwayat: tombol Kosongkan semua compact */
  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-history-head .btn-sm {
    min-height: 28px !important;
    height: 28px !important;
    font-size: 0.6rem !important;
    padding: 0 0.5rem !important;
  }

  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-loading.visible {
    position: absolute !important;
    inset: 0 !important;
    border-radius: var(--radius) !important;
    z-index: 10 !important;
  }

  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-loading.visible .kl-rings {
    width: 220px !important; height: 220px !important;
  }
  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-loading.visible .kl-ring-mid {
    inset: 24px !important;
  }
  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-loading.visible .kl-ring-inner {
    inset: 60px !important;
  }
  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-loading.visible .kl-center {
    width: 88px !important; height: 88px !important;
  }
  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-loading.visible .kl-center-icon {
    font-size: 2.2rem !important;
  }
  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-loading.visible .kl-glow {
    width: 380px !important; height: 380px !important;
  }
  body.konten-app.suaraku-app .col-right.kbn-tab-active .konten-loading.visible .kl-phase-text {
    font-size: clamp(1.8rem, 6vw, 2.6rem) !important;
  }

  /* Bottom navbar */
  .konten-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(8, 8, 8, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(250, 204, 21, 0.15);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  }

  .kbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.65rem 0.25rem 0.6rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    text-decoration: none;
    font-family: inherit;
    transition: color 0.18s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    min-height: 62px;
  }

  .kbn-item:active {
    transform: scale(0.93);
  }

  .kbn-item--active {
    color: var(--yellow2);
  }

  .kbn-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.18s;
  }

  .kbn-item--active .kbn-icon {
    filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.5));
  }

  .kbn-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
  }

  /* Tombol Generate — dihapus dari bottom nav */

  /* Badge jumlah karakter di tab Skrip */
  .kbn-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 14px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--yellow);
    color: #000;
    font-size: 0.52rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .kbn-badge.hidden { display: none; }

  /* Dot merah untuk API key belum diset */
  .kbn-dot {
    position: absolute;
    top: 8px;
    right: calc(50% - 12px);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f87171;
    border: 1.5px solid #080808;
  }

  .kbn-dot.hidden { display: none; }

  /* Active indicator — garis atas */
  .kbn-item--active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--yellow2);
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
  }

  /* Tab Generate saat aktif (proses): tidak dipakai lagi */

  .kbn-generate-btn::before { display: none; }
}

/* ===== LOADING OVERLAY — gaya CERITAKU ===== */
.konten-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(3, 3, 3, 0.96);
  z-index: 10;
  border-radius: inherit;
  overflow: hidden;
  padding: 1.5rem 1rem 2.5rem;
  gap: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.konten-loading.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Ambient glow */
.kl-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(250, 204, 21, 0.12);
  filter: blur(60px);
  animation: klGlowPulse 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes klGlowPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.92); }
  50%       { opacity: 1;   transform: scale(1.08); }
}

/* Ring container */
.kl-rings {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

/* Outer dashed ring */
.kl-ring-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(250, 204, 21, 0.22);
  animation: klRotateCW 22s linear infinite;
}

/* Dots orbit */
.kl-dots {
  position: absolute;
  inset: 0;
}

.kl-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  background: rgba(250, 204, 21, 0.12);
  transition: background 0.3s, box-shadow 0.3s;
}

.kl-dot.lit {
  background: rgba(250, 204, 21, 0.85);
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.55);
}

/* Mid ring CCW */
.kl-ring-mid {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px solid rgba(250, 204, 21, 0.15);
  border-top-color: rgba(250, 204, 21, 0.7);
  animation: klRotateCCW 9s linear infinite;
}

/* Inner ring CW fast */
.kl-ring-inner {
  position: absolute;
  inset: 44px;
  border-radius: 50%;
  border: 2px solid rgba(250, 204, 21, 0.12);
  border-bottom-color: var(--yellow);
  animation: klRotateCW 3.5s linear infinite;
}

/* Center icon */
.kl-center {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(253,224,71,0.2), rgba(250,204,21,0.08));
  border: 1.5px solid rgba(250, 204, 21, 0.45);
  box-shadow: 0 0 22px rgba(250,204,21,0.28), inset 0 0 14px rgba(250,204,21,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: klCenterPulse 2.2s ease-in-out infinite;
}

.kl-center-icon {
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(250,204,21,0.7));
  transition: opacity 0.3s, transform 0.3s;
}

@keyframes klCenterPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}

@keyframes klRotateCW  { to { transform: rotate(360deg); } }
@keyframes klRotateCCW { to { transform: rotate(-360deg); } }

/* Text */
.kl-text {
  text-align: center;
  z-index: 1;
  width: 100%;
  max-width: 280px;
}

.kl-phase-text {
  font-family: var(--font-display, "Bebas Neue", sans-serif);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  letter-spacing: 0.08em;
  line-height: 1;
  background: linear-gradient(135deg, #fde047 0%, #facc15 50%, #ca8a04 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(250,204,21,0.4));
  transition: opacity 0.35s, transform 0.35s, filter 0.35s;
  margin: 0 0 0.4rem;
}

.kl-phase-text.fade-out {
  opacity: 0;
  transform: translateY(-6px);
  filter: blur(4px) drop-shadow(0 0 0 transparent);
}

.kl-phase-sub {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #4b5563;
  margin: 0;
  transition: opacity 0.3s;
}

.kl-phase-sub.fade-out { opacity: 0; }

/* Footer */
.kl-footer {
  position: absolute;
  bottom: 0.75rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #374151;
}

.kl-footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  display: inline-block;
  margin-right: 0.4rem;
  animation: klDotBlink 0.7s ease-in-out infinite;
}

@keyframes klDotBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.28; }
}

/* Card text: posisi relative agar overlay bisa absolute */
.card-text {
  position: relative;
}

/* ===== THEME INPUT — auto-resize ===== */
.theme-input-auto {
  resize: none;
  overflow-y: auto;
  min-height: 6rem;
  max-height: 12rem;
  line-height: 1.6;
}

/* ===== TOMBOL GENERATE — state BATAL ===== */
.card-brief .card-studio-footer .actions #btnGenerate.btn-generating {
  background: linear-gradient(120deg, #ef4444, #dc2626) !important;
  box-shadow: 0 2px 0 rgba(0,0,0,0.38), 0 8px 32px rgba(239,68,68,0.35) !important;
  color: #fff !important;
}

.card-brief .card-studio-footer .actions #btnGenerate.btn-generating:hover {
  box-shadow: 0 2px 0 rgba(0,0,0,0.38), 0 8px 40px rgba(239,68,68,0.55) !important;
}

/* Bottom nav generate — state batal: tidak dipakai lagi */

/* ===== FOOTER LOADING — Kang Imam Januar Lagi Mikir + dot berjalan ===== */
.kl-footer-left {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.kl-footer-brand {
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(250, 204, 21, 0.7);
}

/* Dot berjalan */
.kl-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.kl-td {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(250, 204, 21, 0.85);
  animation: klDotWalk 1.2s ease-in-out infinite;
}

.kl-td:nth-child(1) { animation-delay: 0s; }
.kl-td:nth-child(2) { animation-delay: 0.2s; }
.kl-td:nth-child(3) { animation-delay: 0.4s; }

@keyframes klDotWalk {
  0%, 80%, 100% {
    opacity: 0.2;
    transform: scale(0.7);
  }
  40% {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.7);
  }
}
