/* ============ NonaAi — Minimalist Creative Studio (Magnific-inspired) ============ */
:root {
  --bg: #09090b;
  --surface: #111114;
  --surface-2: #18181b;
  --surface-3: #222226;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-strong: rgba(255, 255, 255, 0.28);

  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;

  --accent: #ffffff;
  --accent-fg: #09090b;
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --indigo: #818cf8;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-w: 256px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; color: inherit; }
input, textarea, select { font-family: inherit; }
svg { display: block; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-2); font-size: 12.5px; }
.text-3 { color: var(--text-3); }
.emerald { color: var(--emerald); }
.amber { color: var(--amber); }
.rose { color: var(--rose); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

/* ---------- Brand Lockup (Icon + NonaAi) ---------- */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: none;
  color: var(--text);
}
.brand-lockup img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-lockup.lg img {
  width: 44px;
  height: 44px;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}
.brand-lockup.lg .brand-name { font-size: 26px; }
.brand-name span { font-weight: 300; color: var(--text-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  transition: background .15s, border-color .15s, transform .12s, opacity .15s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--border-hover); }
.btn:active:not(:disabled) { transform: scale(0.99); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: #e4e4e7; border-color: #e4e4e7; }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.06); color: var(--text); border-color: transparent; }

.btn-danger {
  background: rgba(251, 113, 133, 0.08);
  border-color: rgba(251, 113, 133, 0.25);
  color: var(--rose);
}
.btn-danger:hover:not(:disabled) { background: rgba(251, 113, 133, 0.16); border-color: rgba(251, 113, 133, 0.4); }

.btn-lg { height: 44px; padding: 0 18px; font-size: 14px; border-radius: 10px; }
.btn-full { width: 100%; }
.btn-icon { width: 34px; height: 34px; padding: 0; }

/* ---------- Form Controls ---------- */
.lbl {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field {
  width: 100%;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.field::placeholder { color: var(--text-3); }
.field:hover:not(:disabled) { border-color: var(--border-hover); }
.field:focus { border-color: rgba(255, 255, 255, 0.35); background: #141418; }
.field:disabled { opacity: 0.5; cursor: not-allowed; }
textarea.field { resize: vertical; min-height: 92px; line-height: 1.55; }

select.field {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  text-overflow: ellipsis;
}

/* ---------- Login Screen (Minimalist Centered) ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(28px, 6vh, 56px) 16px 56px;
  background: radial-gradient(600px circle at 50% 0%, rgba(255,255,255,0.045), transparent 70%), var(--bg);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.login-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}
.login-head p { margin: 10px 0 0; font-size: 13px; color: var(--text-2); }
.form-group { margin-bottom: 16px; }
.pin-wrap { position: relative; }
.pin-wrap .field { padding-right: 38px; }
.pin-wrap .eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: var(--text-3);
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pin-wrap .eye-btn:hover { color: var(--text); }
.pin-wrap .eye-btn svg { width: 16px; height: 16px; }
.pw-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.pw-rule {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  transition: all .15s;
}
.pw-rule.ok {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
  color: var(--emerald);
}

/* ---------- Bilingual Language Toggle (EN | ID) ---------- */
.login-lang-bar {
  width: 100%;
  max-width: 380px;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.lang-toggle button {
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  min-width: 34px;
  text-align: center;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background .15s, color .15s;
}
.lang-toggle button:hover { color: var(--text); }
.lang-toggle button.active {
  background: var(--text);
  color: #09090b;
}
.gsi-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 44px;
  margin: 0 auto;
}
.gsi-slot {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .12s ease;
}
.gsi-slot.off {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.login-err { color: var(--rose); font-size: 12.5px; min-height: 18px; margin: 10px 0 6px; text-align: center; }
.login-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.link-subtle {
  background: none;
  border: 0;
  color: var(--text-2);
  font-size: 12.5px;
  padding: 0;
  text-decoration: none;
  transition: color .15s;
}
.link-subtle:hover { color: var(--text); }
.promo-pill-btn {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12.5px;
  transition: all .15s;
}
.promo-pill-btn:hover { border-color: var(--border-hover); color: var(--text); }
.dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  flex-shrink: 0;
}

/* ---------- Studio App Shell (Sidebar + Main) ---------- */
.studio-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow: hidden;
}
.sb-top {
  height: var(--topbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sb-search {
  padding: 12px 12px 6px;
  position: relative;
}
.sb-search svg {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-30%);
  width: 14px;
  height: 14px;
  color: var(--text-3);
  pointer-events: none;
}
.sb-search input {
  width: 100%;
  height: 34px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px 0 32px;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
}
.sb-search input:focus { border-color: var(--border-hover); }

.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
.sb-nav::-webkit-scrollbar { width: 5px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; }
.sb-nav::-webkit-scrollbar-track { background: transparent; }
.sb-section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  padding: 10px 8px 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background .12s, color .12s;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item .ni-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.nav-item .ni-left span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.8; }
.nav-item .cnt { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

.sb-tool-list { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.nav-tool {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 12.5px;
  text-align: left;
  transition: all .12s;
}
.nav-tool:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-tool.active { color: var(--text); background: rgba(255,255,255,0.08); font-weight: 500; }
.nav-tool span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sb-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.credit-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 10px;
}
.credit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.credit-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.credit-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.user-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 6px 2px;
}
.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 4px;
  border-radius: 8px;
  text-align: left;
  min-width: 0;
  flex: 1;
}
.user-btn:hover { background: rgba(255,255,255,0.05); }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-hover);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-meta b { display: block; font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { display: block; font-size: 11px; color: var(--text-3); }

/* ---------- Main Area & Topbar ---------- */
.studio-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  padding: 0 24px;
  background: rgba(9, 9, 11, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tb-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-ann {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  max-width: 440px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.tb-ann:hover { border-color: var(--border-hover); color: var(--text); }
.tb-ann span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.lang-select {
  height: 34px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  padding: 0 8px;
  font-size: 12px;
  cursor: pointer;
}
.lang-select:hover { border-color: var(--border-hover); color: var(--text); }
.lang-select option { background: #111114; color: #fafafa; }
.mobile-menu-btn { display: none; }

.content {
  padding: 28px 28px 80px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Explore / Dashboard View ---------- */
.explore-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.explore-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.explore-head p { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; }

.filter-pills {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.pill-tab {
  padding: 6px 10px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.pill-tab:hover { color: var(--text); }
.pill-tab.active { background: var(--surface-3); color: var(--text); }

.tier-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tier-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 14px;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.tool-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.tool-card .thumb {
  position: relative;
  height: 132px;
  background: radial-gradient(circle at 80% 20%, var(--a1), transparent 70%),
              linear-gradient(180deg, var(--a2), var(--surface));
  padding: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.tool-card .thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, center);
  transition: transform .4s ease, filter .3s ease;
  filter: var(--flt, brightness(0.86) contrast(1.04));
}
.tool-card:hover .thumb-img {
  transform: scale(1.06);
  filter: var(--flt-h, brightness(0.98) contrast(1.06));
}
.tool-card .thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 9, 11, 0.35) 0%, rgba(9, 9, 11, 0.08) 45%, rgba(17, 17, 20, 0.78) 100%);
  pointer-events: none;
}
.tool-card .thumb-icon {
  position: absolute;
  right: 14px;
  bottom: 12px;
  width: 28px;
  height: 28px;
  color: rgba(255,255,255,0.16);
}
.tag {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(9, 9, 11, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-2);
  backdrop-filter: blur(6px);
}
.tag.promo { color: var(--amber); border-color: rgba(251, 191, 36, 0.3); }
.tag.new { color: var(--emerald); border-color: rgba(52, 211, 153, 0.3); }
.tag.nsfw { color: var(--rose); border-color: rgba(251, 113, 133, 0.3); }
.tool-card .body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.tool-card .title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tool-card h3 { font-size: 14.5px; font-weight: 600; }
.tool-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool-card .meta {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

/* ---------- Workspace Split (Magnific Studio Style) ---------- */
.ws-layout {
  display: grid;
  grid-template-columns: minmax(350px, 470px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.panel-head h2 { font-size: 17px; }
.badge-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Segmented Mode Tabs */
.modes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
}
.mode {
  flex: 1 1 auto;
  min-width: max-content;
  padding: 7px 10px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  transition: all .15s;
  text-align: center;
  white-space: nowrap;
}
.mode:hover { color: var(--text); }
.mode.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.4); }

/* Engine Cards */
.engines {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.engine {
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  transition: all .15s;
}
.engine b { display: block; font-size: 13px; font-weight: 600; }
.engine small { font-size: 11.5px; color: var(--text-3); }
.engine:hover { border-color: var(--border-hover); }
.engine.active { border-color: var(--text); background: var(--surface-3); }

/* Callouts */
.callout {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 14px;
  line-height: 1.5;
}
.callout.warn {
  background: rgba(251, 191, 36, 0.06);
  border-color: rgba(251, 191, 36, 0.22);
  color: #fde68a;
}

/* Uploads */
.uploads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.upload-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.upload-slot-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.upload-slot-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.upload-slot-meta {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.file-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-2);
  max-width: 100%;
}
.file-chip img {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.file-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
.file-chip button {
  background: none;
  border: 0;
  color: var(--text-3);
  padding: 0 2px;
  font-size: 12px;
  line-height: 1;
}
.file-chip button:hover { color: var(--rose); }
.upload {
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 18px 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.upload.tall { min-height: 116px; }
.upload:hover { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.03); color: var(--text); }
.upload.filled { border-style: solid; border-color: var(--emerald); color: var(--emerald); background: rgba(52, 211, 153, 0.06); }
.upload svg { width: 18px; height: 18px; opacity: 0.7; }

.prompt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.prompt-head .cnt { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.prompt-tools { display: flex; gap: 6px; margin-bottom: 8px; }
.prompt-tools button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 6px;
  font-size: 11.5px;
  padding: 4px 9px;
}
.prompt-tools button:hover { color: var(--text); border-color: var(--border-hover); }

.sel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  font-size: 13px;
}
.switch {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #2e2e34;
  border: 0;
  padding: 0;
  flex-shrink: 0;
  transition: background .15s;
}
.switch::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #a1a1aa;
  transition: left .15s, background .15s;
}
.switch.on { background: var(--text); }
.switch.on::after { left: 18px; background: var(--bg); }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 10px;
  cursor: pointer;
}
.check input { accent-color: #ffffff; width: 15px; height: 15px; }

/* Right Canvas / Stage */
.stage-col { display: flex; flex-direction: column; gap: 16px; }
.preview-stage {
  min-height: 340px;
  border-radius: 12px;
  background-color: #070709;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
  color: var(--text-3);
}
.preview-stage .empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  color: var(--text-2);
}
.preview-stage .empty-icon svg { width: 20px; height: 20px; }

.hist-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.hist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color .15s;
}
.hist-row:hover { border-color: var(--border-hover); }
.hist-row b { font-size: 13px; font-weight: 500; }
.status-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}
.status-pill.ok { background: rgba(52, 211, 153, 0.12); color: var(--emerald); }
.status-pill.proc { background: rgba(251, 191, 36, 0.12); color: var(--amber); }
.status-pill.fail { background: rgba(251, 113, 133, 0.12); color: var(--rose); }

/* Live Generation Timer & 0-100% Progress UI */
.gen-prog-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.gen-prog-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.gen-prog-pct {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}
.gen-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-hover);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.gen-timer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
  animation: genPulse 1.6s ease-in-out infinite;
}
@keyframes genPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}
.gen-prog-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.gen-prog-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d4d4d8 0%, #ffffff 55%, #34d399 100%);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.gen-prog-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-100%);
  animation: genShimmer 1.8s infinite;
}
@keyframes genShimmer {
  100% { transform: translateX(100%); }
}
.gen-phase-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}
.gen-done-bar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--emerald);
}
.hist-prog-mini {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 6px;
}
.hist-prog-mini > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fafafa, #34d399);
  transition: width 0.55s ease;
}

/* ---------- Custom Workspaces (Music / Storyboard / Clipper) ---------- */
.eq { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.eq i { width: 3px; border-radius: 2px; background: var(--text-2); animation: eq 1.1s ease-in-out infinite; }
@keyframes eq { 0%, 100% { height: 4px; opacity: 0.4; } 50% { height: 18px; opacity: 1; } }

.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.tile-btn {
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all .15s;
}
.tile-btn b { display: block; font-size: 13px; font-weight: 500; }
.tile-btn small { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.tile-btn:hover { border-color: var(--border-hover); }
.tile-btn.active { border-color: var(--text); background: var(--surface-3); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--border-hover); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Storyboard */
.sb-hero {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.sb-hero .kick { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.sb-hero h2 { font-size: 24px; line-height: 1.18; margin: 8px 0; }
.sb-hero h2 em { font-family: 'Playfair Display', serif; font-weight: 400; color: var(--text-2); }
.sb-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sb-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color .15s;
}
.sb-card:hover { border-color: var(--border-strong); }
.sb-card .num { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.sb-card h4 { font-size: 14.5px; }
.sb-card p { margin: 0; font-size: 12px; color: var(--text-2); }
.sb-card .go {
  margin-top: auto;
  padding-top: 10px;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stepper { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.stepper span {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-3);
}
.stepper span.on { border-color: var(--text); color: var(--text); background: var(--surface-3); }

/* ---------- Modals ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
}
.modal.wide { max-width: 660px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.modal-head h3 { font-size: 16px; }

.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.pack {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 10px;
  text-align: center;
  transition: all .15s;
}
.pack:hover { border-color: var(--border-hover); }
.pack.active { border-color: var(--text); background: var(--surface-3); }
.pack .rp { font-size: 12px; color: var(--text-2); }
.pack .c { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--text); margin: 2px 0; }
.pack .u { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.pack .n { font-size: 11px; color: var(--emerald); margin-top: 4px; }
.pack .bon {
  position: absolute;
  top: -8px;
  right: 8px;
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
}

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; font-size: 12.5px; }
.info-grid > div { background: var(--surface-2); border: 1px solid var(--border); padding: 10px 12px; border-radius: 8px; color: var(--text-2); }
.info-grid b { color: var(--text); }
.stat-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0 14px; }
.stat-tiles > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 6px; text-align: center; font-size: 11px; color: var(--text-3); }
.stat-tiles b { display: block; font-family: var(--font-mono); font-size: 18px; color: var(--text); margin-bottom: 2px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.data-table th, .data-table td { border-bottom: 1px solid var(--border); padding: 8px 6px; text-align: left; }
.data-table th { color: var(--text-3); font-weight: 500; font-size: 11px; text-transform: uppercase; }

/* ---------- Floating Chat & Toast ---------- */
.fab-chat {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-hover);
  color: var(--text);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform .15s, border-color .15s;
}
.fab-chat:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.fab-chat svg { width: 18px; height: 18px; }

.chat-box {
  position: fixed;
  right: 20px;
  bottom: 74px;
  z-index: 61;
  width: 330px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  animation: fade .15s;
}
.chat-head {
  padding: 13px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 600;
}
.chat-head small { color: var(--text-3); font-weight: 400; }
.chat-body { height: 240px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text); }
.msg.me { align-self: flex-end; background: var(--text); color: var(--bg); }
.chat-foot { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--border); }
.chat-foot .field { padding: 8px 10px; height: 36px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  transition: opacity .25s;
}
.idle-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 210;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(24, 24, 27, 0.96);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  max-width: min(520px, calc(100vw - 24px));
}
.idle-banner .btn { height: 30px; padding: 0 12px; font-size: 12px; white-space: nowrap; }

/* ---------- Instagram Feed Promo Popup Banner ---------- */
.modal.modal-promo {
  max-width: 448px;
  padding: 18px;
}
.modal.modal-promo.ratio-4-5 {
  max-width: 400px;
}
.promo-ig-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.08), transparent 65%), #0b0b0e;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.promo-ig-frame.ratio-4-5 {
  aspect-ratio: 4 / 5;
  max-height: 62vh;
  margin-inline: auto;
}
.promo-ig-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.promo-ig-frame.clickable {
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, filter .16s ease;
}
.promo-ig-frame.clickable:hover {
  border-color: var(--border-strong);
  filter: brightness(1.04);
}
.promo-ig-text-inner {
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* ---------- Public Storefront Showcase (Midtrans KYC Compliance, toggleable in Admin) ---------- */
.public-showcase {
  width: 100%;
  max-width: 960px;
  margin: 44px auto 0;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.ps-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 28px;
}
.ps-head h2 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 8px 0 8px;
  letter-spacing: -0.02em;
}
.ps-head p {
  margin: 0;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.6;
}
.ps-svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.ps-svc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.ps-svc-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--text);
}
.ps-svc-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
}
.ps-price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.ps-price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  transition: border-color .15s;
}
.ps-price-card:hover { border-color: var(--border-hover); }
.ps-price-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ps-price-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.ps-price-idr { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--text); margin: 4px 0 2px; }
.ps-price-cr { font-size: 13px; color: var(--emerald); font-weight: 600; }
.ps-legal-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-2);
}
.ps-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.ps-legal-links a {
  color: var(--text-2);
  text-decoration: none;
  transition: color .15s;
}
.ps-legal-links a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Mobile Sidebar Drawer & Responsive ---------- */
.sb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 35;
  display: none;
}
@media (max-width: 980px) {
  .studio-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-w);
    transform: translateX(-100%);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sb-backdrop.open { display: block; }
  .mobile-menu-btn { display: inline-flex; }
  .tb-ann { display: none; }
  .ws-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 12px; }
  .tb-back-label, .tb-sep { display: none; }
  .content { padding: 18px 14px 80px; }
  .tool-grid { grid-template-columns: 1fr; }
  .sel-grid, .sb-cards, .pack-grid { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: repeat(3, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
  .qris-grid { grid-template-columns: 1fr !important; }
}
