/* ==========================================================================
   Stock Content Engine — "Darkroom Studio" theme
   Palet terinspirasi dari lampu aman kamar gelap fotografi (amber) berpadu
   teal sebagai penyeimbang dingin. Font mengikuti brand @fathur.mengajar
   (Bricolage Grotesque / Work Sans / DM Mono) untuk konsistensi identitas.
   ========================================================================== */

:root {
  --bg: #121316;
  --bg-elevated: #17181C;
  --surface: #1C1E23;
  --surface-hover: #23262C;
  --border: #2A2D34;
  --border-soft: #23252B;

  --amber: #E8A33D;
  --amber-soft: rgba(232, 163, 61, 0.14);
  --amber-strong: #F2B657;
  --teal: #3FA796;
  --teal-soft: rgba(63, 167, 150, 0.14);
  --danger: #E5484D;
  --danger-soft: rgba(229, 72, 77, 0.12);

  --text: #F3F1EA;
  --text-muted: #91949E;
  --text-faint: #5C5F68;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Work Sans", sans-serif;
  --font-mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--amber-soft); color: var(--amber-strong); }

/* ---------- Shell layout ---------- */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 28px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(150deg, var(--amber), #C97A22);
  color: #1A1206;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.25;
  color: var(--text);
}

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-divider {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 18px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px; font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active {
  background: var(--amber-soft);
  color: var(--amber-strong);
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  border-top: 1px solid var(--border-soft);
  padding-top: 16px;
  display: flex; align-items: center; gap: 8px;
}
.account-link {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.account-link:hover { background: var(--surface-hover); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.account-info { display: flex; flex-direction: column; min-width: 0; }
.account-info strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-tag { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.logout-link {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.logout-link:hover { background: var(--danger-soft); color: var(--danger); }

.main-area {
  flex: 1;
  padding: 40px 48px 60px;
  max-width: 1180px;
}

/* ---------- Typography helpers ---------- */

.page-header { margin-bottom: 32px; }
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--amber);
  margin-bottom: 8px;
  display: block;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.page-header p { color: var(--text-muted); font-size: 14.5px; margin: 0; max-width: 620px; line-height: 1.55; }

.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--font-mono); }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 20px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.card-header h3 { font-family: var(--font-display); font-size: 16.5px; margin: 0; font-weight: 700; }

/* ---------- Forms ---------- */

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px; font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
}
.field .hint { display: block; font-size: 12px; color: var(--text-faint); margin-top: 6px; line-height: 1.5; }

input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2391949E'><path d='M5.5 8l4.5 4.5L14.5 8z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--amber); }
.checkbox-row label { margin: 0; font-weight: 500; font-size: 14px; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .row-2, .row-3 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */

.btn-primary {
  background: linear-gradient(150deg, var(--amber-strong), var(--amber));
  color: #201404;
  border: none;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: filter 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { background: var(--border); color: var(--text-faint); cursor: not-allowed; filter: none; }

.btn-secondary {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
}
.btn-secondary:hover { border-color: var(--amber); color: var(--amber-strong); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(229, 72, 77, 0.3);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 700;
  cursor: pointer;
}
.btn-danger:hover { background: var(--danger); color: white; }
.btn-danger.btn-small { padding: 6px 12px; font-size: 12px; }

.btn-ghost {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- Aspect ratio picker ---------- */

.ratio-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
@media (max-width: 700px) { .ratio-grid { grid-template-columns: repeat(3, 1fr); } }

.ratio-option {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ratio-option:hover { border-color: var(--teal); }
.ratio-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.ratio-option:has(input:checked) { border-color: var(--amber); background: var(--amber-soft); }
.ratio-option.is-selected { border-color: var(--amber); background: var(--amber-soft); }
.ratio-option .ratio-name { font-size: 11.5px; color: var(--text-muted); line-height: 1.3; }
.ratio-option:has(input:checked) .ratio-name { color: var(--amber-strong); font-weight: 600; }
.ratio-option.is-selected .ratio-name { color: var(--amber-strong); font-weight: 600; }

.ratio-preview {
  border: 2px solid var(--text-faint); border-radius: 3px; background: var(--surface-hover);
  transition: border-color 0.15s ease;
}
.ratio-option:has(input:checked) .ratio-preview { border-color: var(--amber-strong); background: var(--amber-soft); }
.ratio-option.is-selected .ratio-preview { border-color: var(--amber-strong); background: var(--amber-soft); }
.ratio-1-1 { width: 32px; height: 32px; }
.ratio-2-3 { width: 26px; height: 39px; }
.ratio-3-2 { width: 39px; height: 26px; }
.ratio-16-9 { width: 42px; height: 24px; }
.ratio-9-16 { width: 24px; height: 42px; }

/* ---------- Feature highlights ---------- */

.feature-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.feature-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.feature-icon { font-size: 20px; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.feature-item strong { display: block; font-size: 13.5px; margin-bottom: 4px; }
.feature-item p { margin: 0; line-height: 1.5; }
@media (max-width: 700px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---------- Quota gauge ---------- */

.quota-box {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 24px;
}
.quota-ring { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.quota-ring svg { transform: rotate(-90deg); }
.quota-ring-bg { stroke: var(--border); }
.quota-ring-fill { stroke: var(--amber); stroke-linecap: round; transition: stroke-dashoffset 0.5s ease; }
.quota-ring-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--text);
}
.quota-text strong { font-family: var(--font-display); font-size: 15px; }
.quota-text .quota-sub { display: block; color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- Estimate box ---------- */

.estimate-box {
  background: var(--amber-soft);
  border: 1px solid rgba(232, 163, 61, 0.25);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px; margin-bottom: 20px;
}
.estimate-box strong { color: var(--amber-strong); font-size: 17px; font-family: var(--font-display); }

/* ---------- Generation progress ---------- */

.progress-bar-track {
  width: 100%; height: 8px; border-radius: 20px;
  background: var(--bg); border: 1px solid var(--border-soft);
  overflow: hidden; margin-bottom: 18px;
}
.progress-bar-fill {
  height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  width: 0%;
  transition: width 0.4s ease;
}
.progress-items { display: flex; flex-direction: column; gap: 8px; }
.progress-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.progress-item .idx-badge {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-hover); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; flex-shrink: 0;
}
.progress-item .stage-label { flex: 1; color: var(--text-muted); }
.progress-item .stage-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-faint);
}
.progress-item[data-stage="generating"] .stage-dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.progress-item[data-stage="upscaling"] .stage-dot,
.progress-item[data-stage="metadata"] .stage-dot { background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.progress-item[data-stage="done"] .stage-dot { background: var(--teal); }
.progress-item[data-stage="done"] .idx-badge { background: var(--teal-soft); color: var(--teal); }
.progress-item[data-stage="failed"] .stage-dot { background: var(--danger); }
.progress-item[data-stage="failed"] .idx-badge { background: var(--danger-soft); color: var(--danger); }
.progress-item[data-stage="failed"] .stage-label { color: var(--danger); }
.stage-dot.spin { animation: pulse-dot 1.1s ease-in-out infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- Result / log lines ---------- */

.result-area .log-line { padding: 9px 0; border-bottom: 1px dashed var(--border-soft); font-size: 13px; font-family: var(--font-mono); }
.result-area .log-line.ok { color: var(--teal); }
.result-area .log-line.fail { color: var(--danger); }

/* ---------- Badges / alerts ---------- */

.badge {
  background: var(--surface-hover); color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: 20px; margin-left: 8px;
}
.badge.ok { background: var(--teal-soft); color: var(--teal); }
.badge.admin { background: var(--amber-soft); color: var(--amber-strong); }

.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 20px; border: 1px solid transparent; }
.alert-warning { background: rgba(232, 163, 61, 0.1); color: var(--amber-strong); border-color: rgba(232, 163, 61, 0.25); }
.alert-success { background: var(--teal-soft); color: var(--teal); border-color: rgba(63, 167, 150, 0.3); }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(229, 72, 77, 0.3); }

/* ---------- History / session cards ---------- */

.session-card .session-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.session-title { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.image-item { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg); }
.image-item img { width: 100%; height: 150px; object-fit: cover; display: block; }
.image-placeholder { width: 100%; height: 150px; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 12px; }
.image-meta { padding: 11px 12px; }
.image-meta strong { font-size: 13px; display: block; margin-bottom: 4px; }
.status-tag { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); margin: 4px 0 0; }

/* ---------- Tables (admin) ---------- */

table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th {
  text-align: left; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-faint); font-weight: 500;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
table.data-table td { padding: 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
.key-value-mono { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); }

/* ---------- Usage dashboard ---------- */

.usage-row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 4px; border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
}
.usage-row:last-child { border-bottom: none; }
.usage-label { flex: 1; }
.usage-calls { color: var(--text-muted); width: 90px; }
.usage-cost { color: var(--amber-strong); font-weight: 600; width: 90px; text-align: right; }
#live-indicator { color: var(--teal); animation: pulse-dot 1.6s ease-in-out infinite; }

.provider-group { margin-bottom: 28px; }
.provider-group-title {
  font-family: var(--font-display); font-weight: 700; font-size: 14.5px;
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.key-count-pill {
  font-family: var(--font-mono); font-size: 10.5px; background: var(--surface-hover);
  color: var(--text-muted); padding: 2px 8px; border-radius: 20px;
}
.key-count-pill.warn { background: var(--danger-soft); color: var(--danger); }

.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; flex: 1; min-width: 160px; }

/* ---------- Auth pages (login/setup) ---------- */

.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(232,163,61,0.08), transparent 45%),
              radial-gradient(circle at 80% 80%, rgba(63,167,150,0.08), transparent 45%),
              var(--bg);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 38px 34px;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.auth-sub { color: var(--text-muted); font-size: 13.5px; margin: 0 0 26px; line-height: 1.5; }
.auth-footer-note { text-align: center; margin-top: 20px; font-size: 12.5px; color: var(--text-faint); }

/* ---------- Utility ---------- */

hr.divider { border: none; border-top: 1px solid var(--border-soft); margin: 24px 0; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 30;
    flex-direction: row; align-items: center; padding: 12px 14px; gap: 10px;
    flex-wrap: nowrap;
  }
  .brand { border-bottom: none; padding: 0; margin: 0; flex-shrink: 0; }
  .brand-name { display: none; }
  .nav {
    flex-direction: row; flex: 1; min-width: 0; gap: 4px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { white-space: nowrap; padding: 8px 10px; font-size: 13px; gap: 7px; }
  .nav-divider { display: none; }
  .sidebar-footer { border-top: none; margin-left: auto; flex-shrink: 0; padding-top: 0; }
  .account-info { display: none; }
  .account-link { padding: 4px; }
  .main-area { padding: 22px 18px 44px; max-width: 100%; }
}

@media (max-width: 520px) {
  .sidebar { padding: 10px 12px; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; font-size: 11px; }
  .nav-item { padding: 7px 9px; font-size: 12.5px; }
  .nav-icon { width: 16px; height: 16px; }
  .main-area { padding: 18px 14px 36px; }
  .page-header h1 { font-size: 22px; }
  .card { padding: 18px 16px; }
  .row-3 > .card, .row-2 > .card { padding: 16px; }
  .estimate-box, .quota-box { flex-wrap: wrap; }
}

/* ---------- Responsive data tables (stack into cards on narrow screens) ---------- */

.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 720px) {
  table.data-table.responsive-stack,
  table.data-table.responsive-stack thead,
  table.data-table.responsive-stack tbody,
  table.data-table.responsive-stack th,
  table.data-table.responsive-stack td,
  table.data-table.responsive-stack tr { display: block; width: 100%; }
  table.data-table.responsive-stack thead tr { position: absolute; top: -9999px; left: -9999px; }
  table.data-table.responsive-stack tbody tr {
    border-bottom: 1px solid var(--border); border-radius: 0;
    padding: 10px 4px; margin: 0;
  }
  table.data-table.responsive-stack tbody tr:last-child { border-bottom: none; }
  table.data-table.responsive-stack td {
    border-bottom: none; padding: 6px 8px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    text-align: right;
  }
  table.data-table.responsive-stack td[data-label]::before {
    content: attr(data-label);
    font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-faint); text-align: left; margin-right: 12px; flex-shrink: 0;
  }
  table.data-table.responsive-stack td:last-child { justify-content: flex-start; text-align: left; }
  table.data-table.responsive-stack details { width: 100%; }
  table.data-table.responsive-stack details summary { width: 100%; text-align: center; }
  table.data-table.responsive-stack details .card { width: 100% !important; min-width: 0 !important; margin-left: 0 !important; }
}

/* ==========================================================================
   Landing page (halaman depan publik)
   ========================================================================== */

.landing {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.landing-shell { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--border-soft);
}
.landing-nav .brand { display: flex; align-items: center; gap: 12px; padding: 0; margin: 0; border: none; }
.landing-nav-links { display: none; }
.landing-nav-actions { display: flex; align-items: center; gap: 10px; }
.landing-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: filter 0.15s ease, transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.landing-btn-primary { background: linear-gradient(150deg, var(--amber-strong), var(--amber)); color: #201404; }
.landing-btn-primary:hover { filter: brightness(1.08); }
.landing-btn-ghost { border-color: var(--border); color: var(--text); }
.landing-btn-ghost:hover { border-color: var(--amber); color: var(--amber-strong); }
.landing-btn-lg { padding: 14px 26px; font-size: 15.5px; }

/* Hero */
.landing-hero {
  padding: 88px 0 76px;
  text-align: center;
  background:
    radial-gradient(circle at 15% 10%, rgba(232,163,61,0.10), transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(63,167,150,0.10), transparent 45%);
}
.landing-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--amber-strong); background: var(--amber-soft);
  padding: 7px 16px; border-radius: 20px; margin-bottom: 22px;
}
.landing-hero h1 {
  font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em;
  font-size: 48px; line-height: 1.12; margin: 0 auto 20px; max-width: 780px;
}
.landing-hero h1 .accent { color: var(--amber-strong); }
.landing-hero p.lead {
  font-size: 17px; color: var(--text-muted); line-height: 1.65;
  max-width: 620px; margin: 0 auto 34px;
}
.landing-hero-actions { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.landing-hero-note { margin-top: 16px; font-size: 12.5px; color: var(--text-faint); }

/* Stat strip */
.landing-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: var(--radius);
  overflow: hidden; margin-top: 56px;
}
.landing-stat { background: var(--surface); padding: 22px 18px; text-align: center; }
.landing-stat strong {
  display: block; font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--amber-strong);
  margin-bottom: 4px;
}
.landing-stat span { font-size: 12.5px; color: var(--text-muted); }

/* Section shell */
.landing-section { padding: 76px 0; border-top: 1px solid var(--border-soft); }
.landing-section-head { text-align: center; max-width: 620px; margin: 0 auto 44px; }
.landing-section-head .landing-eyebrow { margin-bottom: 16px; }
.landing-section-head h2 {
  font-family: var(--font-display); font-size: 32px; font-weight: 800; letter-spacing: -0.015em;
  margin: 0 0 12px;
}
.landing-section-head p { color: var(--text-muted); font-size: 15px; line-height: 1.6; margin: 0; }

/* Pipeline steps */
.landing-steps {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: step;
}
.landing-step {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 20px 16px; position: relative;
  text-align: center; display: flex; flex-direction: column; align-items: center;
}
.landing-step-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--amber-soft); color: var(--amber-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  margin: 0 auto 14px;
}
.landing-step strong { display: block; font-size: 14px; margin-bottom: 6px; }
.landing-step p { margin: 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }

/* Feature cards */
.landing-features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.landing-feature-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 26px 24px;
}
.landing-feature-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--teal-soft); color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; margin-bottom: 16px;
}
.landing-feature-card strong { display: block; font-family: var(--font-display); font-size: 16px; margin-bottom: 8px; }
.landing-feature-card p { margin: 0; font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }

/* Cost highlight banner */
.landing-cost-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: var(--amber-soft); border: 1px solid rgba(232,163,61,0.25); border-radius: var(--radius-lg);
  padding: 32px 36px;
}
.landing-cost-banner .cost-figure { font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--amber-strong); }
.landing-cost-banner .cost-figure span { font-size: 15px; font-weight: 600; color: var(--text-muted); margin-left: 6px; }
.landing-cost-banner-text strong { display: block; font-family: var(--font-display); font-size: 17px; margin-bottom: 6px; }
.landing-cost-banner-text p { margin: 0; color: var(--text-muted); font-size: 13.5px; max-width: 420px; line-height: 1.55; }

/* Pricing */
.landing-pricing {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch;
}
.pricing-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 30px 26px; display: flex; flex-direction: column; position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
  --spot-x: 50%; --spot-y: 50%;
}
.pricing-card::before {
  content: "";
  position: absolute; inset: 0; z-index: 0; border-radius: inherit;
  background: radial-gradient(320px circle at var(--spot-x) var(--spot-y), rgba(232, 163, 61, 0.14), transparent 65%);
  opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.pricing-card:hover::before { opacity: 1; }
.pricing-card > * { position: relative; z-index: 1; }
.pricing-card:hover {
  transform: translateY(-6px);
  border-color: rgba(232, 163, 61, 0.5);
  box-shadow: 0 18px 40px -12px rgba(232, 163, 61, 0.28);
}
.pricing-card.is-featured:hover {
  box-shadow: 0 22px 48px -12px rgba(232, 163, 61, 0.4);
}
.pricing-card.is-featured {
  border-color: rgba(232,163,61,0.45);
  background: linear-gradient(165deg, rgba(232,163,61,0.08), var(--surface) 55%);
}
.pricing-badge {
  position: absolute; top: -13px; left: 26px;
  background: linear-gradient(150deg, var(--amber-strong), var(--amber)); color: #201404;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 5px 12px; border-radius: 20px;
}
.pricing-name { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.pricing-desc { font-size: 12.5px; color: var(--text-muted); margin: 0 0 20px; line-height: 1.55; min-height: 34px; }
.pricing-price { font-family: var(--font-display); font-size: 34px; font-weight: 800; margin-bottom: 2px; }
.pricing-price span { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.pricing-quota { font-size: 12.5px; color: var(--amber-strong); font-weight: 600; margin-bottom: 22px; }
.pricing-features { list-style: none; margin: 0 0 26px; padding: 0; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.pricing-features li { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--text); line-height: 1.5; }
.pricing-features li svg { flex-shrink: 0; margin-top: 2px; color: var(--teal); }
.pricing-card .landing-btn { width: 100%; }
.landing-pricing-note { text-align: center; margin-top: 24px; font-size: 12.5px; color: var(--text-faint); }

/* FAQ */
.landing-faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 4px 20px;
}
.faq-item summary {
  cursor: pointer; list-style: none;
  padding: 16px 0; font-weight: 600; font-size: 14.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 20px; font-weight: 400; color: var(--text-faint); flex-shrink: 0;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); color: var(--amber-strong); }
.faq-item p { margin: 0 0 18px; color: var(--text-muted); font-size: 13.5px; line-height: 1.65; }

/* Final CTA */
.landing-cta {
  text-align: center; padding: 70px 40px; margin: 0 0 76px;
  background: linear-gradient(150deg, rgba(232,163,61,0.12), rgba(63,167,150,0.08));
  border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
}
.landing-cta h2 { font-family: var(--font-display); font-size: 28px; font-weight: 800; margin: 0 0 12px; }
.landing-cta p { color: var(--text-muted); font-size: 15px; margin: 0 0 28px; }

/* Footer */
.landing-footer {
  border-top: 1px solid var(--border-soft); padding: 28px 0 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--text-faint); font-size: 12.5px;
}

@media (max-width: 900px) {
  .landing-steps { grid-template-columns: repeat(3, 1fr); }
  .landing-features { grid-template-columns: 1fr 1fr; }
  .landing-stats { grid-template-columns: repeat(2, 1fr); }
  .landing-pricing { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
}

@media (max-width: 640px) {
  .landing-shell { padding: 0 18px; }
  .landing-hero { padding: 56px 0 48px; }
  .landing-hero h1 { font-size: 32px; }
  .landing-hero p.lead { font-size: 15px; }
  .landing-section { padding: 52px 0; }
  .landing-section-head h2 { font-size: 24px; }
  .landing-steps { grid-template-columns: 1fr 1fr; }
  .landing-features { grid-template-columns: 1fr; }
  .landing-stats { grid-template-columns: 1fr 1fr; margin-top: 40px; }
  .landing-cost-banner { flex-direction: column; align-items: flex-start; text-align: left; padding: 26px 22px; }
  .landing-cta { padding: 46px 22px; margin-bottom: 52px; }
  .landing-cta h2 { font-size: 22px; }
  .landing-nav-actions .landing-btn span.full-label { display: none; }
}

/* ==========================================================================
   Autopilot (awalan .ap-) — halaman /autopilot
   ========================================================================== */

.ap-spacer { flex: 1; }
.ap-hint { color: var(--text-faint); font-size: 12.5px; margin: 4px 0 16px; }
kbd { font-family: var(--font-mono); font-size: 11px; background: var(--surface-hover); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--text-muted); }
.ap-link { font-size: 12.5px; color: var(--amber-strong); }
.ap-link:hover { text-decoration: underline; }

.ap-flash { transition: opacity .4s ease, max-height .4s ease; }
.ap-flash.is-hide { opacity: 0; pointer-events: none; }

/* --- tombol --- */
.ap-btn {
  border: 1px solid var(--border); background: var(--surface-hover); color: var(--text);
  padding: 9px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: filter .15s ease, background .15s ease, border-color .15s ease, transform .1s ease; white-space: nowrap;
}
.ap-btn:hover:not(:disabled) { filter: brightness(1.15); }
.ap-btn:active:not(:disabled) { transform: scale(.98); }
.ap-btn:disabled { opacity: .4; cursor: not-allowed; }
.ap-btn:focus-visible, .ap-tab:focus-visible, .ap-thumb:focus-visible, .ap-filter:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.ap-primary { background: linear-gradient(150deg, var(--amber-strong), var(--amber)); color: #201404; border-color: transparent; font-weight: 700; }
.ap-ok { background: var(--teal-soft); color: var(--teal); border-color: rgba(63,167,150,.35); }
.ap-no { background: var(--danger-soft); color: var(--danger); border-color: rgba(229,72,77,.3); }
.ap-ghost { background: transparent; color: var(--text-muted); }
.ap-sm { padding: 5px 11px; font-size: 12px; }
.ap-btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.ap-form + .ap-form { margin-top: 12px; }

/* --- ringkasan --- */
.ap-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.ap-stat { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ap-stat.is-hot { border-color: rgba(232,163,61,.45); background: linear-gradient(180deg, var(--amber-soft), var(--surface) 70%); }
.ap-stat-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.ap-stat-value { font-family: var(--font-display); font-size: 30px; line-height: 1.1; font-weight: 700; }
.ap-stat-value small { font-size: 15px; color: var(--text-faint); font-weight: 500; }
.ap-stat-sub { font-size: 12px; color: var(--text-muted); }
.ap-meter { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
.ap-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-strong)); border-radius: 99px; transition: width .5s ease; }

/* --- tab --- */
.ap-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin-bottom: 22px; overflow-x: auto; }
.ap-tab { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); padding: 11px 16px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; margin-bottom: -1px; white-space: nowrap; }
.ap-tab:hover { color: var(--text); }
.ap-tab.is-active { color: var(--amber-strong); border-bottom-color: var(--amber); }
.ap-pill { background: var(--amber); color: #201404; font-family: var(--font-mono); font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.ap-pill-muted { background: var(--surface-hover); color: var(--text-muted); }
.ap-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.ap-panel[hidden] { display: none; }

/* --- filter --- */
.ap-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.ap-filter { padding: 7px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border-soft); color: var(--text-muted); font-size: 13px; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; }
.ap-filter:hover { border-color: var(--border); color: var(--text); }
.ap-filter.is-active { background: var(--amber-soft); border-color: rgba(232,163,61,.45); color: var(--amber-strong); }
.ap-count { font-family: var(--font-mono); font-size: 11.5px; opacity: .85; }
.ap-selectall { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.ap-selectall input, .ap-check input { accent-color: var(--amber); width: 17px; height: 17px; }

/* --- grid review --- */
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; padding-bottom: 90px; }
.ap-card { position: relative; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: opacity .22s ease, transform .22s ease, border-color .15s ease, box-shadow .15s ease; }
.ap-card:hover { border-color: var(--border); }
.ap-card.is-selected { border-color: var(--amber); box-shadow: 0 0 0 2px var(--amber-soft); }
.ap-card.is-gone { opacity: 0; transform: scale(.96); }
.ap-check { position: absolute; top: 10px; left: 10px; z-index: 2; background: rgba(18,19,22,.72); backdrop-filter: blur(4px); padding: 6px; border-radius: 8px; display: flex; cursor: pointer; }
.ap-thumb { display: block; padding: 0; border: 0; background: var(--bg); cursor: zoom-in; aspect-ratio: 3 / 2; position: relative; }
.ap-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.ap-card:hover .ap-thumb img { transform: scale(1.03); }
.ap-err { position: absolute; right: 8px; bottom: 8px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.ap-body { padding: 14px 16px 6px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.ap-body h3 { margin: 0; font-family: var(--font-display); font-size: 14.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ap-chips span { font-size: 11.5px; color: var(--text-muted); background: var(--bg); border: 1px solid var(--border-soft); padding: 2px 8px; border-radius: 99px; }
.ap-chips .more { color: var(--text-faint); border-style: dashed; }
.ap-meta { display: flex; justify-content: space-between; gap: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.ap-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-actions { display: flex; gap: 8px; padding: 10px 16px 16px; }
.ap-actions .ap-btn { flex: 1; padding: 8px 10px; }
.ap-more { text-align: center; margin: 4px 0 90px; }

.ap-empty { text-align: center; padding: 70px 20px; border: 1px dashed var(--border); border-radius: var(--radius); }
.ap-empty-mark { width: 54px; height: 54px; line-height: 54px; margin: 0 auto 14px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 24px; }
.ap-empty h3 { font-family: var(--font-display); margin: 0 0 6px; font-size: 18px; }
.ap-empty p { margin: 0; font-size: 13.5px; }

/* --- bar aksi massal --- */
.ap-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 10px; background: var(--bg-elevated); border: 1px solid var(--amber); box-shadow: 0 12px 40px rgba(0,0,0,.55); border-radius: 14px; padding: 10px 14px; width: min(560px, calc(100vw - 28px)); }
.ap-bar[hidden] { display: none; }
.ap-bar strong { color: var(--amber-strong); font-family: var(--font-mono); }

/* --- dua kolom & form --- */
.ap-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.ap-cands { list-style: none; margin: 0 0 16px; padding: 0; max-height: 300px; overflow: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.ap-cands li { border-bottom: 1px solid var(--border-soft); }
.ap-cands li:last-child { border-bottom: 0; }
.ap-cands label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; font-size: 13.5px; }
.ap-cands label:hover { background: var(--surface-hover); }
.ap-cands input { accent-color: var(--amber); }
.ap-cands span { flex: 1; min-width: 0; }
.ap-cands em { font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.ap-cands .is-off label { opacity: .5; cursor: not-allowed; }
.ap-cands .is-off span { text-decoration: line-through; }
.ap-cands .why { color: var(--danger); }

.ap-steps { margin: 0 0 16px; padding-left: 20px; color: var(--text-muted); font-size: 13px; line-height: 1.9; }
.ap-steps .is-done { color: var(--teal); }
.ap-steps .is-done::marker { color: var(--teal); }

/* --- tabel & status --- */
.ap-tablewrap { overflow-x: auto; }
.ap-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ap-table th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ap-table td { padding: 11px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.ap-table td.t { font-weight: 500; }
.ap-rowact { display: flex; gap: 6px; justify-content: flex-end; }
.ap-status { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--surface-hover); color: var(--text-muted); white-space: nowrap; }
.ap-s-done { background: var(--teal-soft); color: var(--teal); }
.ap-s-failed { background: var(--danger-soft); color: var(--danger); }
.ap-s-running { background: var(--amber-soft); color: var(--amber-strong); }
.ap-s-pending { background: var(--surface-hover); color: var(--text-muted); }

/* --- pratinjau --- */
.ap-dialog { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100vh; color: var(--text); }
.ap-dialog::backdrop { background: rgba(8,8,10,.86); backdrop-filter: blur(3px); }
.ap-dlg { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; width: min(1280px, 96vw); height: min(86vh, 860px); margin: 7vh auto 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.ap-dlg-img { background: #0b0b0d; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.ap-dlg-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ap-dlg-side { padding: 28px 26px; overflow: auto; display: flex; flex-direction: column; gap: 12px; border-left: 1px solid var(--border-soft); }
.ap-dlg-side h2 { font-family: var(--font-display); font-size: 20px; line-height: 1.3; margin: 0; }
.ap-dlg-side p { margin: 0; font-size: 13.5px; line-height: 1.55; }
.ap-chips-all span { font-size: 12px; }
.ap-actions-lg { padding: 8px 0 0; margin-top: auto; }
.ap-actions-lg .ap-btn { padding: 12px; font-size: 14px; }
.ap-x { position: absolute; top: 10px; right: 12px; z-index: 3; background: rgba(18,19,22,.7); border: 1px solid var(--border); color: var(--text); width: 34px; height: 34px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; }
.ap-nav { position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); background: rgba(18,19,22,.7); border: 1px solid var(--border); color: var(--text); width: 42px; height: 42px; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; }
.ap-prev { left: 12px; }
.ap-next { right: 352px; }
.ap-x:hover, .ap-nav:hover { background: var(--surface-hover); }

.ap-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 40; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-size: 13px; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.ap-toast[hidden] { display: none; }

@media (max-width: 1100px) { .ap-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ap-two { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .ap-dlg { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; height: 92vh; margin-top: 4vh; }
  .ap-dlg-side { border-left: 0; border-top: 1px solid var(--border-soft); max-height: 42vh; }
  .ap-next { right: 12px; top: 30%; }
  .ap-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
}
@media (max-width: 520px) { .ap-stats { grid-template-columns: 1fr 1fr; gap: 10px; } .ap-stat { padding: 14px; } .ap-stat-value { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .ap-card, .ap-card .ap-thumb img, .ap-meter i { transition: none; } }

.ap-off { margin: 0 0 16px; }
.ap-off summary { cursor: pointer; font-size: 12.5px; color: var(--text-muted); padding: 6px 2px; }
.ap-off .ap-cands { margin-top: 8px; max-height: 220px; }
