/* Plan Konten — gaya UI mengikuti konten/konten.css */

/* ===== BRAND MARK — pakai logo WebP ===== */
body.plan-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.plan-app.suaraku-app .brand-mark img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  border-radius: 14px;
}

/* ===== BRAND MARK — pakai logo WebP ===== */
body.plan-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.plan-app.suaraku-app .brand-mark img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  border-radius: 14px;
}

/* ===== FULL HEIGHT LAYOUT ===== */
body.plan-app.suaraku-app {
  overflow: hidden;
  height: 100dvh;
}

body.plan-app.suaraku-app .app-shell {
  overflow: hidden;
  height: 100dvh;
  max-height: 100dvh;
}

body.plan-app.suaraku-app .workspace {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ===== BRIEF CARD ===== */
/* Kolom kiri mengisi penuh tinggi workspace */
.col-left {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

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

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

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

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

.theme-input-auto {
  resize: none;
  overflow-y: auto;
  min-height: 5rem;
  max-height: 10rem;
  line-height: 1.6;
}

/* ===== PLAN RESULT CARD ===== */
/* Kolom kanan harus mengisi penuh tinggi workspace */
.col-right {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.card-plan {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-head--plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.card-head-plan-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.card-head-plan-meta h2 { margin: 0; }

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

/* Ikon di tombol header plan */
.plan-head-icon { flex-shrink: 0; }
#btnCopyAll, #btnClearPlan {
  display: inline-flex; align-items: center; gap: 0.35rem;
}

.plan-export-wrap {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.plan-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.plan-result {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem 0 0.75rem;
  scrollbar-gutter: stable;
  /* Pastikan mengisi sisa tinggi card */
  height: 0;
}

.plan-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
  min-height: 220px;
}

.plan-empty svg { opacity: 0.3; }

.plan-empty p {
  font-size: 0.82rem;
  line-height: 1.6;
  max-width: 28rem;
  margin: 0;
}

/* ===== PLAN GRID ===== */
.plan-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.plan-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(250,204,21,0.15);
  border-radius: 12px;
  background: rgba(0,0,0,0.35);
  transition: background 0.15s, border-color 0.15s;
  animation: planItemIn 0.3s ease both;
}

.plan-item:hover {
  background: rgba(250,204,21,0.03);
  border-color: rgba(250,204,21,0.28);
}

@keyframes planItemIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.plan-item-day {
  flex-shrink: 0;
  height: 28px;
  padding: 0 0.6rem;
  border-radius: 8px;
  background: rgba(250,204,21,0.1);
  border: 1px solid rgba(250,204,21,0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.plan-item-day-label {
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-item-day-num {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--yellow2);
  line-height: 1;
}

.plan-item-body {
  flex: 1;
  min-width: 0;
}

.plan-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #e4e4e7;
  line-height: 1.4;
  margin: 0 0 0.2rem;
}

.plan-item-desc {
  font-size: 0.74rem;
  color: #a1a1aa;
  line-height: 1.5;
  margin: 0;
}

.plan-item-actions {
  flex-shrink: 0;
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

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

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

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

/* Tombol Buat Skrip — menonjol kuning */
.plan-btn-skrip {
  width: auto;
  padding: 0 0.55rem;
  height: 26px;
  border-radius: 7px;
  background: rgba(250,204,21,0.1);
  border: 1px solid rgba(250,204,21,0.3);
  color: var(--yellow2);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  gap: 0.3rem;
  white-space: nowrap;
}

.plan-btn-skrip:hover {
  background: rgba(250,204,21,0.2);
  border-color: rgba(250,204,21,0.6);
  color: var(--yellow2);
}

/* ===== STREAMING INDICATOR ===== */
.plan-streaming-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border: 1px dashed rgba(250,204,21,0.2);
  border-radius: 12px;
  background: rgba(250,204,21,0.02);
  font-size: 0.75rem;
  color: var(--muted);
}

.plan-streaming-dots {
  display: inline-flex;
  gap: 3px;
}

.plan-streaming-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(250,204,21,0.7);
  animation: planDotWalk 1.2s ease-in-out infinite;
}

.plan-streaming-dot:nth-child(2) { animation-delay: 0.2s; }
.plan-streaming-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes planDotWalk {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.7); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* ===== LOADING OVERLAY ===== */
.plan-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;
}

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

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

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

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

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

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

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

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

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

.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-left { display: inline-flex; align-items: center; gap: 0.4rem; }

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

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

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

/* ===== MODAL API KEY ===== */
.plan-modal-keys {
  width: min(540px, 100%);
  max-height: 90dvh;
  padding: 0;
  display: flex; flex-direction: column;
  overflow: hidden; border-radius: 20px;
}

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

.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: 1fr 1fr;
  gap: 0.45rem;
  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.55rem 0.7rem;
  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.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.km-provider-tab-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.62rem;
  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);
}

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

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

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

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

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

.km-add-section { padding-top: 0.75rem; border-top: 1px solid rgba(255,255,255,0.05); }
.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; }

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

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

/* ===== TOAST ===== */
#planToastContainer {
  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);
}

.plan-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: planToastIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

.plan-toast.hiding { animation: planToastOut 0.25s ease-in forwards; }

.plan-toast--success { background: rgba(20,20,20,0.92); border: 1px solid rgba(74,222,128,0.45); color: #86efac; }
.plan-toast--error   { background: rgba(20,20,20,0.92); border: 1px solid rgba(248,113,113,0.45); color: #fca5a5; }
.plan-toast--info    { background: rgba(20,20,20,0.92); border: 1px solid rgba(250,204,21,0.4); color: #fde68a; }

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

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

@keyframes planToastIn  { from { opacity: 0; transform: translateY(12px) scale(0.92); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes planToastOut { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(8px) scale(0.95); } }

/* ===== NAV COMPACT ===== */
body.plan-app.suaraku-app .nav-actions { gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }

.btn-nav-compact, .btn-nav-settings {
  display: inline-flex; align-items: center; gap: 0.35rem;
  white-space: nowrap; flex-shrink: 0;
}

body.plan-app.suaraku-app .nav-actions .btn { white-space: nowrap; flex-shrink: 0; }

/* ===== GENERATE BUTTON STATE ===== */
.card-brief .card-studio-footer .actions #btnGenerate {
  font-family: var(--font);
}

.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;
  font-family: var(--font) !important;
  font-weight: 800 !important;
  letter-spacing: 0.03em !important;
}

/* ===== BOTTOM NAVBAR ===== */
.plan-bottom-nav { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  body.plan-app.suaraku-app .app-title { font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
  body.plan-app.suaraku-app .byline { font-size: 0.78rem; }
  body.plan-app.suaraku-app .nav-actions { gap: 0.3rem; }
  body.plan-app.suaraku-app .nav-actions .btn { font-size: 0.72rem; padding: 0.38rem 0.65rem; }
  body.plan-app.suaraku-app .nav-actions .credit-pill { font-size: 0.62rem; padding: 0.2rem 0.45rem 0.2rem 0.38rem; }
  .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; }
}

@media (max-width: 900px) {
  body.plan-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.plan-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;
  }

  body.plan-app.suaraku-app .nav-actions .credit-pill { grid-column: 1; flex-shrink: 0; white-space: nowrap; }
  body.plan-app.suaraku-app .nav-actions #keyStatus { grid-column: 2; text-align: center; justify-content: center; white-space: nowrap; }

  body.plan-app.suaraku-app .nav-actions .btn {
    min-height: 40px; justify-content: center; text-align: center;
    font-size: 0.72rem; padding: 0.4rem 0.5rem;
  }

  .btn-nav-compact .btn-nav-label, .btn-nav-settings .btn-nav-label { display: inline; }

  body.plan-app.suaraku-app .workspace { grid-template-columns: 1fr; gap: 0.75rem; }

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

@media (max-width: 900px) {
  body.plan-app.suaraku-app .app-shell {
    height: 100dvh; max-height: 100dvh; overflow: hidden;
    display: flex; flex-direction: column;
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }

  body.plan-app.suaraku-app .nav-actions { display: none !important; }

  body.plan-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);
  }

  body.plan-app.suaraku-app .workspace {
    grid-template-columns: 1fr; gap: 0; flex: 1; min-height: 0;
  }

  body.plan-app.suaraku-app .col-left,
  body.plan-app.suaraku-app .col-right { display: none; }

  body.plan-app.suaraku-app .col-left.kbn-tab-active,
  body.plan-app.suaraku-app .col-right.kbn-tab-active { display: flex; flex: 1; min-height: 0; }

  body.plan-app.suaraku-app .col-right.kbn-tab-active { height: 100%; }

  body.plan-app.suaraku-app .col-right.kbn-tab-active .card-plan {
    flex: 1; min-height: 0; height: 100%; display: flex; flex-direction: column;
  }

  body.plan-app.suaraku-app .col-right.kbn-tab-active .plan-result {
    flex: 1; min-height: 0; height: 100%; max-height: none;
  }

  body.plan-app.suaraku-app { overflow: hidden !important; height: 100dvh !important; min-height: unset !important; }

  body.plan-app.suaraku-app .workspace {
    flex: 1 1 0 !important; min-height: 0 !important; overflow: hidden !important;
  }

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

  .plan-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.22rem; padding: 0.55rem 0.25rem 0.5rem;
    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: 56px;
  }

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

  .kbn-icon { width: 20px; height: 20px; 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.58rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1; }

  .kbn-generate-btn { color: var(--yellow2); position: relative; }
  .kbn-generate-btn .kbn-icon, .kbn-generate-btn .kbn-label {
    position: relative; z-index: 1; color: var(--yellow2);
    filter: drop-shadow(0 0 6px rgba(250,204,21,0.5));
  }

  .kbn-generate-ring {
    position: absolute; inset: 6px 8px; border-radius: 14px;
    background: transparent;
    box-shadow: none;
    z-index: 0; transition: box-shadow 0.2s;
  }

  .kbn-generate-btn:active .kbn-generate-ring { box-shadow: none; }

  .kbn-generate-btn.is-generating .kbn-icon,
  .kbn-generate-btn.is-generating .kbn-label {
    color: #f87171 !important;
    filter: drop-shadow(0 0 6px rgba(239,68,68,0.5)) !important;
    animation: none !important;
  }

  @keyframes kbnGeneratePulse {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(250,204,21,0.5)); }
    50%       { filter: drop-shadow(0 0 14px rgba(250,204,21,0.9)); }
  }

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

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

  .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): tampilkan garis atas juga */
  .kbn-generate-btn.kbn-item--active::before {
    display: block;
    background: var(--yellow2);
    box-shadow: 0 0 8px rgba(250,204,21,0.6);
  }

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

@media (max-width: 640px) {
  body.plan-app.suaraku-app .app-title { font-size: 1.6rem; }
  body.plan-app.suaraku-app .byline { font-size: 0.72rem; }
  body.plan-app.suaraku-app .tag { font-size: 0.6rem; }

  /* Header plan: dua baris kompak */
  .plan-app .col-right .card-head--plan {
    flex-direction: column; align-items: stretch;
    gap: 0.35rem; padding: 0.5rem 0.75rem;
  }

  .plan-app .col-right .card-head--plan .card-head-plan-meta {
    gap: 0.4rem;
  }

  .plan-app .col-right .card-head--plan .card-head-plan-meta h2 {
    font-size: 0.82rem;
  }

  .plan-app .col-right .card-head--plan .card-head-plan-meta .char-count {
    font-size: 0.65rem;
  }

  /* Baris tombol: satu baris penuh, semua tombol sama tinggi */
  .plan-app .col-right .card-head--plan .plan-actions {
    display: flex; flex-wrap: nowrap; gap: 0.3rem;
    align-items: center; width: 100%;
  }

  /* Salin Semua & Kosongkan: ikon saja */
  .plan-app .col-right .card-head--plan #btnCopyAll,
  .plan-app .col-right .card-head--plan #btnClearPlan {
    width: 34px; height: 30px; min-height: 30px !important;
    padding: 0; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
  }

  .plan-app .col-right .card-head--plan #btnCopyAll .plan-head-label,
  .plan-app .col-right .card-head--plan #btnClearPlan .plan-head-label {
    display: none;
  }

  /* Export TXT mengisi sisa ruang, CSV tetap auto */
  .plan-app .col-right .card-head--plan .plan-export-wrap {
    display: flex; gap: 0.3rem; flex: 1; min-width: 0;
  }

  .plan-app .col-right .card-head--plan .plan-export-wrap .plan-export-btn {
    flex: 1; height: 30px; min-height: 30px !important;
    padding: 0 0.4rem; font-size: 0.65rem; font-weight: 700;
    white-space: nowrap; justify-content: center;
  }

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

@media (max-width: 400px) {
  body.plan-app.suaraku-app .app-title { font-size: 1.4rem; }
  body.plan-app.suaraku-app .brand-mark { width: 38px; height: 38px; }
  body.plan-app.suaraku-app .brand-mark svg { width: 20px; height: 20px; }
}

.km-key-badge--low {
  background: rgba(244, 162, 97, 0.15);
  color: #f4a261;
}

.km-key-row--low { border-color: rgba(244, 162, 97, 0.35); }
