/* ============================================================
   Theoryma feature pages.
   Base is intentionally minimal (calm, neutral).
   Each feature gets its OWN treatment matched to its purpose.
   Sidebar is NOT styled here — only sticky position.
   ============================================================ */

/* Sidebar sticky-only */
body:not(.admin-theme) #sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ============ Neutral base ============ */
body:not(.admin-theme) {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1a1a1a;
  background: #fafafa;
  -webkit-font-smoothing: antialiased;
}
body:not(.admin-theme) #content { background: #fafafa; min-height: 100vh; }

#algo {
  padding: 0 32px 56px;
  max-width: 1200px;
  font-size: 15px;
  line-height: 1.55;
  color: #1a1a1a;
}

/* Sidebar tertutup (tombol biru) → konten memanjang memenuhi layar */
body.content-wide #algo { max-width: none; }

/* Simple page heading */
#algo .page-heading { margin: 24px 0 28px; }
#algo .page-heading .eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.76em; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.4px; color: #6d7fcc; margin: 0 0 8px;
}
#algo .page-heading .eyebrow::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: #6d7fcc; flex-shrink: 0;
}
#algo .page-heading h1 {
  font-size: 1.85em; font-weight: 700; letter-spacing: -0.025em;
  color: #0a0a0a; margin: 0 0 8px; line-height: 1.15;
}
#algo .page-heading p { color: #5a5a5a; margin: 0; font-size: 0.98em; max-width: 680px; }
#algo .page-heading p strong { color: #1a1a1a; font-weight: 600; }

/* Generic form bits */
#algo .field { display: flex; flex-direction: column; gap: 6px; }
#algo .field > span { font-size: 0.85em; font-weight: 600; color: #444; }
#algo .field-row { display: grid; gap: 12px; grid-template-columns: 1fr; }
#algo .field-row.two   { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
#algo .field-row.three { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
#algo .input, #algo input.input, #algo select.input, #algo textarea.input, #algo .textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 0.95em;
  color: #0a0a0a; background: #fff; border: 1px solid #d4d4d4;
  border-radius: 6px; outline: none; box-sizing: border-box; transition: border-color 0.12s;
}
#algo .input:focus, #algo textarea.input:focus, #algo select.input:focus { border-color: #1a1a1a; }
#algo textarea.input { resize: vertical; min-height: 100px; font-family: ui-monospace, Menlo, Consolas, monospace; }
#algo .hint { font-size: 0.84em; color: #777; margin: -2px 0 0; }
#algo .hint code { background: #f0f0f0; color: #0a0a0a; padding: 1px 5px; border-radius: 3px; font-size: 0.92em; }

#algo .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; font: inherit; font-size: 0.95em; font-weight: 600;
  border-radius: 6px; border: 1px solid #d4d4d4; background: #fff; color: #0a0a0a;
  cursor: pointer; transition: background 0.12s, border-color 0.12s, transform 0.08s;
}
#algo .btn:hover { background: #f0f0f0; border-color: #b4b4b4; }
#algo .btn:active { transform: translateY(1px); }
#algo .btn.primary { background: #0a0a0a; color: #fff; border-color: #0a0a0a; }
#algo .btn.primary:hover { background: #2a2a2a; border-color: #2a2a2a; }
#algo .btn.ghost { background: transparent; color: #5a5a5a; border-color: transparent; padding: 6px 12px; font-size: 0.85em; }
#algo .btn.ghost:hover { background: #f0f0f0; color: #0a0a0a; }

#algo .hidden { display: none !important; }
#algo .output-block:has(> pre.hidden) { display: none; }

/* ============================================================
   FEATURE: Caesar Cipher
   ============================================================ */
#algo .feat-caesar { display: flex; flex-direction: column; gap: 18px; }
#algo .caesar-controls {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 16px; background: #f0f0f0; border-radius: 10px; flex-wrap: wrap;
}
#algo .caesar-controls .ctrl { display: flex; align-items: center; gap: 8px; }
#algo .caesar-controls label { font-size: 0.85em; font-weight: 600; color: #444; }
#algo .caesar-controls input[type="number"] {
  width: 64px; padding: 6px 10px; font-size: 0.95em;
  border: 1px solid #d4d4d4; border-radius: 6px; font-weight: 600; text-align: center;
}
#algo .caesar-controls .op-toggle {
  display: inline-flex; background: #fff; border: 1px solid #d4d4d4; border-radius: 6px; overflow: hidden;
}
#algo .caesar-controls .op-toggle label { padding: 6px 14px; cursor: pointer; font-size: 0.88em; font-weight: 600; color: #5a5a5a; }
#algo .caesar-controls .op-toggle label:has(input:checked) { background: #0a0a0a; color: #fff; }
#algo .caesar-controls .op-toggle input { display: none; }
#algo .caesar-panes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; }
#algo .caesar-pane {
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid #e4e4e4; border-radius: 10px; overflow: hidden; min-height: 200px;
}
#algo .caesar-pane .pane-label {
  font-size: 0.72em; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: #888; padding: 10px 14px 4px;
}
#algo .caesar-pane textarea, #algo .caesar-pane .pane-output {
  flex: 1; border: 0; outline: 0; padding: 4px 14px 14px; font-size: 1.05em;
  line-height: 1.55; color: #0a0a0a; background: transparent; resize: none;
  font-family: inherit; margin: 0; white-space: pre-wrap; word-break: break-word; overflow-y: auto;
}
#algo .caesar-pane .pane-output { color: #5a5a5a; }
#algo .caesar-pane .pane-output.has-result { color: #0a0a0a; }
#algo .caesar-actions { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 720px) { #algo .caesar-panes { grid-template-columns: 1fr; } }

/* ============================================================
   FEATURE: Python → Java
   ============================================================ */
#algo .feat-pyjava { display: flex; flex-direction: column; gap: 14px; }
#algo .editor-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-radius: 10px; overflow: hidden; }
#algo .editor-pane {
  background: #1e1e2e; border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column; min-height: 360px;
}
#algo .editor-pane .pane-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: #181825; border-bottom: 1px solid #313244;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78em; color: #cdd6f4;
}
#algo .editor-pane .pane-bar .dots { display: inline-flex; gap: 5px; }
#algo .editor-pane .pane-bar .dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
#algo .editor-pane .pane-bar .dots i:nth-child(1) { background: #f38ba8; }
#algo .editor-pane .pane-bar .dots i:nth-child(2) { background: #f9e2af; }
#algo .editor-pane .pane-bar .dots i:nth-child(3) { background: #a6e3a1; }
#algo .editor-pane textarea, #algo .editor-pane pre {
  flex: 1; background: transparent; border: 0; outline: 0; padding: 14px 16px; margin: 0;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9em; line-height: 1.6;
  color: #cdd6f4; resize: none; white-space: pre-wrap; word-break: break-word; overflow-y: auto;
}
#algo .editor-pane pre { color: #94e2d5; }
#algo .editor-pane textarea::placeholder { color: #585b70; }
#algo .pyjava-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#algo .pyjava-bar .hint { color: #5a5a5a; }
@media (max-width: 720px) { #algo .editor-split { grid-template-columns: 1fr; } }

/* ============================================================
   FEATURE: Scan Key
   ============================================================ */
#algo .feat-scan { display: flex; flex-direction: column; gap: 18px; }
#algo .scan-mode { display: flex; gap: 2px; border-bottom: 1px solid #e4e4e4; }
#algo .scan-mode button {
  appearance: none; background: transparent; border: 0; padding: 10px 16px; font: inherit;
  font-size: 0.92em; font-weight: 600; color: #777; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
#algo .scan-mode button.active { color: #0a0a0a; border-bottom-color: #0a0a0a; }
#algo .scan-mode button:hover { color: #0a0a0a; }
#algo .scan-search {
  display: flex; align-items: stretch; background: #fff;
  border: 1px solid #d4d4d4; border-radius: 10px; overflow: hidden; transition: border-color 0.12s;
}
#algo .scan-search:focus-within { border-color: #0a0a0a; }
#algo .scan-search .ico { padding: 0 14px; display: flex; align-items: center; color: #888; font-size: 1.2em; }
#algo .scan-search input { flex: 1; border: 0; padding: 14px 8px 14px 0; font: inherit; font-size: 1.02em; outline: 0; }
#algo .scan-search button { background: #0a0a0a; color: #fff; border: 0; padding: 0 24px; font-weight: 600; cursor: pointer; font-family: inherit; }
#algo .scan-search button:hover { background: #2a2a2a; }
#algo .scan-options { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); padding: 14px; background: #f4f4f4; border-radius: 10px; }
#algo .scan-batch { display: flex; flex-direction: column; gap: 12px; }
#algo .scan-batch textarea { min-height: 130px; }
#algo .or-sep { display: flex; align-items: center; gap: 12px; color: #999; font-size: 0.78em; font-weight: 700; letter-spacing: 1.6px; }
#algo .or-sep::before, #algo .or-sep::after { content: ""; flex: 1; height: 1px; background: #e4e4e4; }
#algo .file-pill { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: #fff; border: 1px dashed #c4c4c4; border-radius: 8px; font-size: 0.9em; color: #5a5a5a; cursor: pointer; }
#algo .file-pill:hover { border-color: #0a0a0a; color: #0a0a0a; }
#algo .file-pill input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ============================================================
   FEATURE: Auto Subtitle
   ============================================================ */
#algo .feat-subtitle { display: grid; grid-template-columns: 320px 1fr; gap: 22px; }
@media (max-width: 900px) { #algo .feat-subtitle { grid-template-columns: 1fr; } }
#algo .subtitle-left { display: flex; flex-direction: column; gap: 18px; }
#algo .subtitle-card { background: #fff; border: 1px solid #e4e4e4; border-radius: 10px; padding: 18px; }
#algo .subtitle-card h3 { margin: 0 0 6px; font-size: 0.95em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: #0a0a0a; }
#algo .subtitle-card p.sub { margin: 0 0 12px; font-size: 0.85em; color: #777; }
#algo .subtitle-card form { display: flex; flex-direction: column; gap: 12px; }
#algo .subtitle-drop {
  position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px; padding: 28px 14px; border: 1.5px dashed #c4c4c4;
  border-radius: 8px; cursor: pointer; text-align: center; background: #fafafa;
}
#algo .subtitle-drop:hover { border-color: #0a0a0a; background: #f4f4f4; }
#algo .subtitle-drop .ico { font-size: 1.8em; }
#algo .subtitle-drop .txt { font-weight: 700; font-size: 0.9em; color: #0a0a0a; }
#algo .subtitle-drop .sub { font-size: 0.78em; color: #888; }
#algo .subtitle-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
#algo .subtitle-right { display: flex; flex-direction: column; gap: 14px; }
#algo .job-banner { background: #0a0a0a; color: #fff; border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
#algo .job-banner .job-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#algo .job-banner .job-status { font-size: 0.78em; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: #a6a6a6; }
#algo .job-banner .progress-track { background: rgba(255,255,255,0.1); height: 6px; border-radius: 999px; overflow: hidden; }
#algo .job-banner .progress-fill { height: 100%; background: #fff; transition: width 0.3s; }
#algo .job-banner .job-message { margin: 0; font-size: 0.95em; color: #d4d4d4; }
#algo .feat-subtitle .check-row { display: flex; align-items: center; gap: 8px; font-size: 0.88em; color: #444; }
#algo .feat-subtitle .check-row input { accent-color: #0a0a0a; }

/* ============================================================
   FEATURE: Electre / BORDA / COPELAND
   ============================================================ */
#algo .feat-electre { display: flex; flex-direction: column; gap: 18px; }
#algo .electre-setup { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; padding: 14px; background: #f4f4f4; border-radius: 10px; }
@media (max-width: 720px) { #algo .electre-setup { grid-template-columns: 1fr; } }
#algo .electre-matrix-wrap { background: #fff; border: 1px solid #e4e4e4; border-radius: 10px; padding: 16px; overflow: auto; }
#algo .electre-matrix-wrap:empty { display: flex; align-items: center; justify-content: center; min-height: 120px; color: #999; font-size: 0.88em; }
#algo .electre-matrix-wrap:empty::after { content: "Klik \"Generate Tabel\" untuk membuat matriks."; }
#algo .electre-weights { display: flex; align-items: center; gap: 12px; padding: 14px; background: #fff; border: 1px solid #e4e4e4; border-radius: 10px; flex-wrap: wrap; }
#algo .electre-weights label { font-weight: 600; font-size: 0.9em; color: #444; min-width: 120px; }
#algo .electre-weights input { flex: 1; min-width: 200px; }
#algo .feat-stepper { display: flex; flex-direction: column; gap: 0; }
#algo .feat-stepper .step-block { position: relative; padding: 0 0 28px 50px; border-left: 2px solid #e4e4e4; margin-left: 18px; }
#algo .feat-stepper .step-block:last-child { border-left-color: transparent; padding-bottom: 0; }
#algo .feat-stepper .step-block .step-marker { position: absolute; left: -19px; top: 0; width: 36px; height: 36px; border-radius: 50%; background: #0a0a0a; color: #fff; font-weight: 700; font-size: 0.95em; display: flex; align-items: center; justify-content: center; border: 4px solid #fafafa; }
#algo .feat-stepper .step-block h3 { margin: 4px 0 4px; font-size: 1.08em; font-weight: 700; color: #0a0a0a; }
#algo .feat-stepper .step-block .step-desc { color: #5a5a5a; margin: 0 0 12px; font-size: 0.92em; }
#algo .feat-stepper .step-block .step-body { display: flex; flex-direction: column; gap: 12px; }
#algo .legacy-table { width: 100%; border-collapse: collapse; font-size: 0.92em; background: #fff; border: 1px solid #e4e4e4; border-radius: 6px; overflow: hidden; }
#algo .legacy-table th, #algo .legacy-table td { border: 1px solid #e4e4e4; padding: 8px 12px; text-align: center; }
#algo .legacy-table th { background: #f4f4f4; font-weight: 600; }
#algo .legacy-table input.input { padding: 6px 8px; font-size: 0.88em; border-radius: 4px; }

/* Output block */
#algo .output-block { background: #1e1e2e; border-radius: 8px; overflow: hidden; }
#algo .output-block .output-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: #181825; color: #cdd6f4; font-size: 0.76em; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
#algo .output-block pre { margin: 0; padding: 14px 16px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.86em; line-height: 1.55; color: #cdd6f4; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }
#algo .output-block.light { background: #fff; border: 1px solid #e4e4e4; }
#algo .output-block.light .output-bar { background: #fafafa; color: #555; border-bottom: 1px solid #e4e4e4; }
#algo .output-block.light pre { color: #0a0a0a; }
#algo .copy-btn { background: transparent; border: 1px solid transparent; color: inherit; font: inherit; font-size: 0.82em; font-weight: 600; padding: 3px 10px; border-radius: 4px; cursor: pointer; opacity: 0.85; }
#algo .copy-btn:hover { background: rgba(255,255,255,0.08); opacity: 1; }
#algo .output-block.light .copy-btn:hover { background: #f0f0f0; }


/* ============================================================
   FEATURE: Converting Tools — compact forms
   ============================================================ */
#algo .feat-converting { display: flex; flex-direction: column; gap: 0; }
#algo .conv-tabs { display: flex; gap: 2px; padding: 4px; background: #f0f0f0; border-radius: 10px; margin-bottom: 20px; }
#algo .conv-tab {
  flex: 1; appearance: none; background: transparent; border: 0;
  padding: 8px 10px; font: inherit; font-size: 0.86em; font-weight: 600;
  color: #888; cursor: pointer; border-radius: 8px; white-space: nowrap;
  text-align: center; transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
#algo .conv-tab:hover { color: #0a0a0a; background: rgba(255,255,255,0.5); }
#algo .conv-tab.active { background: #fff; color: #0a0a0a; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* Form container */
#algo .cform { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }

/* Input row — single horizontal bar */
#algo .cform-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: #fff; border: 1px solid #d4d4d4;
  border-radius: 8px; min-height: 44px;
}
#algo .cform-thumb { height: 48px; width: auto; max-width: 80px; border-radius: 4px; object-fit: contain; flex-shrink: 0; }
#algo .cform-file-info { flex: 1; font-size: 0.88em; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#algo .cform-pick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px; cursor: pointer;
  font-size: 1em; background: #f0f0f0; border: 1px solid #e0e0e0;
  flex-shrink: 0; transition: background 0.12s;
}
#algo .cform-pick:hover { background: #e0e0e0; }
#algo .cform-clear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
  font-size: 0.78em; background: none; border: 1px solid #e8e8e8; color: #bbb;
  flex-shrink: 0; transition: background 0.12s, color 0.12s;
}
#algo .cform-clear:hover { background: #fee; color: #e05; border-color: #fcc; }

/* Hint text */
#algo .cform-hint { font-size: 0.8em; color: #aaa; margin: 0; }

/* Error inline */
#algo .cform-error { font-size: 0.82em; color: #d32f2f; margin: 0; padding: 4px 0; }

/* Submit */
#algo .cform-submit { align-self: flex-start; }
#algo .cform-submit:disabled { opacity: 0.4; cursor: not-allowed; }

/* Parameter row (progressive disclosure) */
#algo .cform-param {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; background: #f8f8f8; border-radius: 8px; border: 1px solid #eee;
}
#algo .cform-param-label { font-size: 0.84em; font-weight: 600; color: #444; white-space: nowrap; }
#algo .cform-slider {
  flex: 1; min-width: 100px; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 999px; background: #ddd; outline: none; cursor: pointer;
}
#algo .cform-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: #0a0a0a; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); cursor: pointer;
}
#algo .cform-param-hint { font-size: 0.76em; color: #aaa; width: 100%; }

/* Presets */
#algo .cform-presets { display: flex; gap: 4px; }
#algo .cform-preset {
  appearance: none; background: #f0f0f0; border: 1px solid #e0e0e0; border-radius: 6px;
  padding: 3px 8px; font: inherit; font-size: 0.76em; font-weight: 600; color: #666; cursor: pointer;
}
#algo .cform-preset:hover { background: #e4e4e4; }
#algo .cform-preset.active { background: #0a0a0a; color: #fff; border-color: #0a0a0a; }

/* Thumbnail grid (images→pdf) */
#algo .cform-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px;
}
#algo .cform-grid-item {
  position: relative; width: 48px; height: 48px; border-radius: 5px;
  overflow: hidden; border: 1px solid #e0e0e0;
}
#algo .cform-grid-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
#algo .cform-grid-num {
  position: absolute; top: 2px; left: 2px; background: rgba(0,0,0,0.6); color: #fff;
  font-size: 0.6em; font-weight: 700; padding: 1px 3px; border-radius: 3px;
}
#algo .cform-grid-rm {
  position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.5); color: #fff;
  border: 0; width: 14px; height: 14px; border-radius: 50%; cursor: pointer;
  font-size: 0.6em; display: flex; align-items: center; justify-content: center; padding: 0;
}
#algo .cform-grid-rm:hover { background: #e05; }

/* Add more row */
#algo .cform-add-row { margin: 0; }
#algo .cform-add-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.82em; font-weight: 600; color: #555; cursor: pointer;
  padding: 4px 10px; border-radius: 6px; background: #f0f0f0; border: 1px dashed #ccc;
}
#algo .cform-add-btn:hover { background: #e4e4e4; color: #0a0a0a; }

/* Screenshot → Image — friendly dropzone */
#featImageTools [hidden] { display: none !important; }
#featImageTools .iz-form { display: flex; flex-direction: column; gap: 10px; max-width: 460px; }
#featImageTools .iz-dropzone {
  position: relative; border: 1.5px dashed #cfd2e6; border-radius: 10px;
  background: #fafbff; padding: 14px 14px; min-height: 92px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; text-align: center;
  transition: border-color .15s, background .15s;
}
#featImageTools .iz-dropzone:hover,
#featImageTools .iz-dropzone:focus-visible { border-color: var(--brand); background: #f3f5ff; outline: none; }
#featImageTools .iz-dropzone.is-drag { border-color: var(--brand); background: #ebeeff; }
#featImageTools .iz-empty { display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; }
#featImageTools .iz-empty svg { width: 28px; height: 28px; color: var(--brand); opacity: .8; margin-bottom: 2px; }
#featImageTools .iz-title { margin: 0; font-size: 0.92em; font-weight: 700; color: #2a2a35; }
#featImageTools .iz-sub { margin: 0; font-size: 0.78em; color: #8a8a96; }
#featImageTools .iz-sub kbd {
  display: inline-block; padding: 0 5px; border-radius: 4px; border: 1px solid #dcdce4;
  background: #fff; font: inherit; font-size: 0.82em; color: #555; box-shadow: 0 1px 0 #e4e4ea;
}
#featImageTools .iz-link { color: var(--brand); font-weight: 600; text-decoration: underline; }
#featImageTools .iz-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
#featImageTools .iz-preview img { max-width: 100%; max-height: 150px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
#featImageTools .iz-meta { display: flex; align-items: center; gap: 10px; font-size: 0.8em; color: #666; }
#featImageTools .iz-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
#featImageTools .iz-remove {
  appearance: none; border: 1px solid #f1d4d4; background: #fff5f5; color: #e0556b;
  border-radius: 7px; padding: 4px 11px; font: inherit; font-size: 0.9em; cursor: pointer; transition: background .12s;
}
#featImageTools .iz-remove:hover { background: #ffe8e8; }
#featImageTools .iz-options { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#featImageTools .iz-opt-label { font-size: 0.82em; font-weight: 700; color: #444; }
#featImageTools .iz-fmts { display: flex; gap: 6px; flex: 1; min-width: 200px; }
#featImageTools .iz-fmt {
  flex: 1; appearance: none; cursor: pointer; background: #fff; border: 1.5px solid #e2e3ee;
  border-radius: 8px; padding: 5px 6px; font: inherit; display: flex; flex-direction: column;
  align-items: center; line-height: 1.2; transition: border-color .12s, background .12s, box-shadow .12s;
}
#featImageTools .iz-fmt strong { font-size: 0.82em; color: #2a2a35; }
#featImageTools .iz-fmt small { font-size: 0.64em; color: #9a9aa6; }
#featImageTools .iz-fmt:hover { border-color: var(--brand); }
#featImageTools .iz-fmt.active { border-color: var(--brand); background: #f3f5ff; box-shadow: inset 0 0 0 1px var(--brand); }
#featImageTools .iz-submit { align-self: flex-start; }
#featImageTools .iz-submit:disabled { opacity: 0.45; cursor: not-allowed; }

/* File list (merge) */
#algo .cform-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#algo .cform-list-item { display: flex; align-items: center; gap: 8px; font-size: 0.84em; padding: 4px 0; }
#algo .cli-num { width: 18px; height: 18px; border-radius: 50%; background: #0a0a0a; color: #fff; font-size: 0.7em; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
#algo .cli-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #0a0a0a; font-weight: 500; }
#algo .cli-size { font-size: 0.78em; color: #999; flex-shrink: 0; }
#algo .cli-rm { background: none; border: 0; color: #ccc; cursor: pointer; font-size: 0.82em; padding: 1px 5px; border-radius: 4px; }
#algo .cli-rm:hover { background: #fee; color: #e05; }


/* Dark mode overrides for features.css base */
html.dark body:not(.admin-theme) {
  background: #2d333b !important;
  color: #cdd9e5;
}
html.dark body:not(.admin-theme) #content {
  background: #2d333b !important;
}
html.dark #algo .page-heading h1 {
  color: #e6edf3 !important;
}
html.dark #algo .page-heading p {
  color: #8b949e;
}


/* Scan Key — loading status */
#algo .scan-status {
  padding: 12px 16px;
  background: #f0f4ff;
  border: 1px solid #d0daf0;
  border-radius: 8px;
  margin-top: 8px;
}
#algo .scan-status-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
#algo .scan-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #d0daf0;
  border-top-color: #7386D5;
  border-radius: 50%;
  animation: scanSpin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes scanSpin {
  to { transform: rotate(360deg); }
}
#algo .scan-status-text {
  font-size: 0.88em;
  font-weight: 500;
  color: #4a5568;
}
#algo .scan-result-count {
  font-size: 0.75em;
  font-weight: 600;
  color: #7386D5;
  background: rgba(115, 134, 213, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Dark mode scan status */
html.dark #algo .scan-status {
  background: #353d47;
  border-color: #444c56;
}
html.dark #algo .scan-status-text {
  color: #adbac7;
}
html.dark #algo .scan-spinner {
  border-color: #444c56;
  border-top-color: #7386D5;
}
html.dark #algo .scan-result-count {
  background: rgba(115, 134, 213, 0.15);
  color: #93b4e8;
}


/* Scan actions bar */
#algo .scan-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}


/* Info tooltip icon */
#algo .info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #666;
  font-size: 0.7em;
  font-weight: 700;
  font-style: normal;
  cursor: help;
  margin-left: 4px;
  position: relative;
  vertical-align: middle;
}
#algo .info-tip:hover {
  background: #7386D5;
  color: #fff;
}
#algo .info-tip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: #333;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  padding: 8px 12px;
  border-radius: 6px;
  width: max-content;
  max-width: 280px;
  z-index: 100;
  pointer-events: none;
  line-height: 1.4;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
html.dark #algo .info-tip {
  background: #444c56;
  color: #8b949e;
}
html.dark #algo .info-tip:hover {
  background: #7386D5;
  color: #fff;
}
html.dark #algo .info-tip:hover::after {
  background: #1e1e1e;
}


/* ============================================================
   FEATURE: Test API Key
   ============================================================ */
#algo .feat-testkey { display: flex; flex-direction: column; gap: 20px; }
#algo .testkey-form { display: flex; flex-direction: column; gap: 14px; }
#algo .testkey-provider { display: flex; gap: 14px; flex-wrap: wrap; max-width: 620px; }
#algo .testkey-provider .field { flex: 1; min-width: 220px; }

/* Mode segmented control */
#algo .mode-seg { display: inline-flex; background: #eceef3; border-radius: 999px; padding: 4px; gap: 2px; align-self: flex-start; }
#algo .mode-seg input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
#algo .mode-seg label {
  margin: 0; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-size: 0.84rem; font-weight: 500; color: #6a6f7a; white-space: nowrap;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
#algo .mode-seg label:hover { color: #3a3f4a; }
#algo .mode-seg input:checked + label { background: #4f6ef7; color: #fff; box-shadow: 0 1px 4px rgba(79,110,247,0.4); }
#algo .mode-seg input:focus-visible + label { outline: 2px solid #4f6ef7; outline-offset: 2px; }

html.dark #algo .mode-seg { background: #22272e; }
html.dark #algo .mode-seg label { color: #8b949e; }
html.dark #algo .mode-seg label:hover { color: #cdd9e5; }
html.dark #algo .mode-seg input:checked + label { background: #4f6ef7; color: #fff; }
#algo .testkey-actions { display: flex; align-items: center; gap: 14px; }
#algo .testkey-hint { font-size: 0.82em; color: #888; }

/* Summary stats */
#algo .testkey-summary {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 14px;
  background: #f4f4f4; border-radius: 10px;
}
#algo .tk-stat {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 20px; font-size: 0.84em; font-weight: 600;
}
#algo .tk-stat.valid { background: #dcfce7; color: #166534; }
#algo .tk-stat.nobalance { background: #fef3c7; color: #92400e; }
#algo .tk-stat.invalid { background: #fee2e2; color: #991b1b; }
#algo .tk-stat.error { background: #f3e8ff; color: #6b21a8; }
#algo .tk-stat.total { background: #e0e7ff; color: #3730a3; }

/* Groups */
#algo .testkey-group { margin-top: 12px; border: 1px solid #e4e4e4; border-radius: 10px; overflow: hidden; }
#algo .testkey-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: #fafafa; border-bottom: 1px solid #e4e4e4;
}
#algo .testkey-group-count { font-size: 0.82em; color: #666; }
#algo .testkey-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 6px; font-size: 0.82em; font-weight: 700;
}
#algo .testkey-badge.valid { background: #dcfce7; color: #166534; }
#algo .testkey-badge.nobalance { background: #fef3c7; color: #92400e; }
#algo .testkey-badge.invalid { background: #fee2e2; color: #991b1b; }
#algo .testkey-badge.error { background: #f3e8ff; color: #6b21a8; }

#algo .testkey-group-list { padding: 8px 0; }
#algo .testkey-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px;
  border-bottom: 1px solid #f0f0f0; flex-wrap: wrap;
}
#algo .testkey-item:last-child { border-bottom: 0; }
#algo .testkey-key {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.88em; font-weight: 500; color: #0a0a0a;
  background: #f4f4f4; padding: 2px 8px; border-radius: 4px;
}
#algo .testkey-balance { font-size: 0.82em; color: #166534; font-weight: 500; }
#algo .testkey-detail { font-size: 0.82em; color: #666; }

/* Export */
#algo .testkey-export { display: flex; gap: 8px; margin-top: 12px; }

/* Dark mode */
html.dark #algo .testkey-summary { background: #353d47; }
html.dark #algo .tk-stat.valid { background: rgba(22, 101, 52, 0.2); color: #86efac; }
html.dark #algo .tk-stat.nobalance { background: rgba(146, 64, 14, 0.2); color: #fcd34d; }
html.dark #algo .tk-stat.invalid { background: rgba(153, 27, 27, 0.2); color: #fca5a5; }
html.dark #algo .tk-stat.error { background: rgba(107, 33, 168, 0.2); color: #d8b4fe; }
html.dark #algo .tk-stat.total { background: rgba(55, 48, 163, 0.2); color: #a5b4fc; }
html.dark #algo .testkey-group { border-color: #444c56; }
html.dark #algo .testkey-group-header { background: #2d333b; border-color: #444c56; }
html.dark #algo .testkey-group-count { color: #8b949e; }
html.dark #algo .testkey-badge.valid { background: rgba(22, 101, 52, 0.3); color: #86efac; }
html.dark #algo .testkey-badge.nobalance { background: rgba(146, 64, 14, 0.3); color: #fcd34d; }
html.dark #algo .testkey-badge.invalid { background: rgba(153, 27, 27, 0.3); color: #fca5a5; }
html.dark #algo .testkey-badge.error { background: rgba(107, 33, 168, 0.3); color: #d8b4fe; }
html.dark #algo .testkey-item { border-color: #373e47; }
html.dark #algo .testkey-key { background: #373e47; color: #e6edf3; }
html.dark #algo .testkey-balance { color: #86efac; }
html.dark #algo .testkey-detail { color: #8b949e; }

/* ============================================================
   FEATURE: JSON Diff Checker
   ============================================================ */
#algo .feat-jsondiff { display: flex; flex-direction: column; gap: 14px; }

#algo .jd-modes {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
#algo .jd-mode {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: #fff; border: 1px solid #d4d4d4;
  border-radius: 8px; cursor: pointer; transition: border-color .12s, background .12s;
}
#algo .jd-mode:hover { border-color: #b4b4b4; background: #fafafa; }
#algo .jd-mode input[type="radio"] { margin: 3px 0 0; accent-color: #0a0a0a; }
#algo .jd-mode span { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
#algo .jd-mode b { font-size: 0.95em; color: #0a0a0a; }
#algo .jd-mode small { color: #6a6a6a; font-size: 0.82em; }
#algo .jd-mode:has(input:checked) { border-color: #0a0a0a; background: #f5f5f5; }

#algo .jd-editor-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
#algo .jd-pane {
  background: #f3f4f6; border: 1px solid #d8dadf; border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column; min-height: 280px;
}
#algo .jd-pane .pane-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: #e9eaee; border-bottom: 1px solid #d8dadf;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78em; color: #374151;
}
#algo .jd-pane .pane-bar .dots { display: inline-flex; gap: 5px; }
#algo .jd-pane .pane-bar .dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
#algo .jd-pane .pane-bar .dots i:nth-child(1) { background: #f38ba8; }
#algo .jd-pane .pane-bar .dots i:nth-child(2) { background: #f9e2af; }
#algo .jd-pane .pane-bar .dots i:nth-child(3) { background: #a6e3a1; }
#algo .jd-pane .pane-bar > span:nth-of-type(2) { flex: 1; }
#algo .jd-pane .pane-bar .btn.ghost {
  color: #374151; border: 1px solid #c6c9d0; background: transparent;
  padding: 4px 10px; font-size: 0.78em;
}
#algo .jd-pane .pane-bar .btn.ghost:hover { background: #dcdee3; color: #0a0a0a; }
/* Editor = textarea transparan di atas layer <pre> berwarna sintaks.
   Font/padding/line-height KEDUANYA harus identik agar teks menumpuk pas. */
#algo .jd-code { position: relative; flex: 1; min-height: 0; }
#algo .jd-syntax {
  position: absolute; inset: 0; margin: 0; padding: 14px 16px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.88em; line-height: 1.55;
  white-space: pre; overflow: hidden; pointer-events: none;
  background: transparent; border: 0; border-radius: 0; color: #1f2328;
  word-break: normal; word-wrap: normal;
}
#algo .jd-syntax code {
  font: inherit; color: inherit; background: transparent;
  padding: 0; border-radius: 0; white-space: inherit; display: block;
}
#algo .jd-pane textarea {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: transparent; border: 0; outline: 0; padding: 14px 16px; margin: 0;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.88em; line-height: 1.55;
  color: transparent; caret-color: #0a0a0a; resize: none; white-space: pre; overflow: auto;
}
#algo .jd-pane textarea::placeholder { color: #a8aeb8; }
#algo .jd-pane textarea::selection { background: rgba(99, 102, 241, 0.25); }
/* Warna token JSON */
#algo .jd-tk-key { color: #0550ae; }
#algo .jd-tk-str { color: #116329; }
#algo .jd-tk-num { color: #953800; }
#algo .jd-tk-lit { color: #8250df; }
#algo .jd-tk-pun { color: #6e7781; }

#algo .jd-bar {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap;
}
#algo .jd-bar .hint { color: #5a5a5a; margin: 0; }
#algo .jd-actions { display: flex; gap: 8px; }

#algo .jd-status {
  padding: 12px 14px; border-radius: 8px; font-size: 0.92em;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
#algo .jd-status b { font-weight: 700; }
#algo .jd-status-ok    { background: #ecfdf5; color: #064e3b; border: 1px solid #6ee7b7; }
#algo .jd-status-error { background: #fef2f2; color: #7f1d1d; border: 1px solid #fca5a5; }
#algo .jd-status-warn  { background: #fffbeb; color: #78350f; border: 1px solid #fcd34d; }
#algo .jd-status-info  { background: #eff6ff; color: #1e3a8a; border: 1px solid #93c5fd; }

#algo .jd-pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.82em; font-weight: 700;
}
#algo .jd-pill.jd-add  { background: #d1fae5; color: #065f46; }
#algo .jd-pill.jd-del  { background: #fee2e2; color: #991b1b; }
#algo .jd-pill.jd-same { background: #e5e7eb; color: #374151; }

#algo .jd-result { display: flex; flex-direction: column; gap: 10px; }
#algo .jd-result-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
#algo .jd-view-switch {
  display: inline-flex; border: 1px solid #d4d4d4; border-radius: 8px;
  overflow: hidden; background: #fff;
}
#algo .jd-view-btn {
  padding: 5px 14px; border: 0; background: transparent; cursor: pointer;
  font-size: 0.8em; font-weight: 600; color: #6a6a6a;
  transition: background .12s, color .12s;
}
#algo .jd-view-btn + .jd-view-btn { border-left: 1px solid #d4d4d4; }
#algo .jd-view-btn:hover { color: #0a0a0a; }
#algo .jd-view-btn.active { background: #0a0a0a; color: #fff; }
#algo .jd-legend { display: flex; gap: 8px; flex-wrap: wrap; }
#algo .jd-chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.8em; font-weight: 600;
}
#algo .jd-chip.jd-add  { background: #d1fae5; color: #065f46; }
#algo .jd-chip.jd-del  { background: #fee2e2; color: #991b1b; }
#algo .jd-chip.jd-same { background: #e5e7eb; color: #374151; }

#algo .jd-diff { border: 1px solid #e4e4e4; border-radius: 10px; overflow: hidden; background: #fff; }
#algo .jd-unified {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.86em; line-height: 1.55;
  max-height: 560px; overflow: auto;
}
#algo .jd-row {
  display: grid;
  grid-template-columns: 48px 48px 24px 1fr;
  align-items: start;
}
#algo .jd-row .jd-ln {
  text-align: right; padding: 1px 8px; color: #9ca3af;
  background: #fafafa; border-right: 1px solid #f0f0f0;
  user-select: none; font-size: 0.86em;
}
#algo .jd-row .jd-sign {
  text-align: center; padding: 1px 4px; font-weight: 700; user-select: none;
}
#algo .jd-row .jd-text {
  padding: 1px 10px; white-space: pre-wrap; word-break: break-word;
}
#algo .jd-row.jd-add  { background: #ecfdf5; }
#algo .jd-row.jd-add .jd-sign { color: #065f46; }
#algo .jd-row.jd-del  { background: #fef2f2; }
#algo .jd-row.jd-del .jd-sign { color: #991b1b; }
#algo .jd-row.jd-same { background: #fff; }
#algo .jd-row.jd-same .jd-sign { color: #9ca3af; }

/* Side by Side view */
#algo .jd-split {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.86em; line-height: 1.55;
  max-height: 560px; overflow: auto;
}
#algo .jd-srow { display: grid; grid-template-columns: 44px 1fr 44px 1fr; align-items: stretch; }
#algo .jd-srow .jd-ln {
  text-align: right; padding: 1px 8px; color: #9ca3af;
  background: #fafafa; border-right: 1px solid #f0f0f0;
  user-select: none; font-size: 0.86em;
}
#algo .jd-srow .jd-ln-r { border-left: 1px solid #e4e4e4; }
#algo .jd-cell { padding: 1px 10px; white-space: pre-wrap; word-break: break-word; }
#algo .jd-cell.jd-same { background: #fff; }
#algo .jd-cell.jd-del  { background: #fef2f2; }
#algo .jd-cell.jd-add  { background: #ecfdf5; }
#algo .jd-cell.jd-empty {
  background: repeating-linear-gradient(45deg, #fafafa, #fafafa 6px, #f1f1f1 6px, #f1f1f1 12px);
}
#algo .jd-cell .jd-hl { border-radius: 3px; padding: 0 1px; }
#algo .jd-cell.jd-del .jd-hl { background: #fecaca; }
#algo .jd-cell.jd-add .jd-hl { background: #a7f3d0; }

@media (max-width: 720px) {
  #algo .jd-editor-split { grid-template-columns: 1fr; }
  #algo .jd-row { grid-template-columns: 36px 36px 20px 1fr; }
  #algo .jd-srow { grid-template-columns: 32px 1fr 32px 1fr; }
}

/* Dark mode */
html.dark #algo .jd-mode { background: #161b22; border-color: #30363d; }
html.dark #algo .jd-mode:hover { background: #1c2128; border-color: #444c56; }
html.dark #algo .jd-mode b { color: #e6edf3; }
html.dark #algo .jd-mode small { color: #8b949e; }
html.dark #algo .jd-mode:has(input:checked) { background: #1c2128; border-color: #8b949e; }
html.dark #algo .jd-bar .hint { color: #8b949e; }
html.dark #algo .jd-status-ok    { background: rgba(22,101,52,.15); color: #86efac; border-color: rgba(34,197,94,.35); }
html.dark #algo .jd-status-error { background: rgba(153,27,27,.15); color: #fca5a5; border-color: rgba(248,113,113,.35); }
html.dark #algo .jd-status-warn  { background: rgba(146,64,14,.15); color: #fcd34d; border-color: rgba(245,158,11,.35); }
html.dark #algo .jd-status-info  { background: rgba(30,58,138,.20); color: #a5b4fc; border-color: rgba(99,102,241,.35); }
html.dark #algo .jd-pill.jd-add  { background: rgba(22,101,52,.30); color: #86efac; }
html.dark #algo .jd-pill.jd-del  { background: rgba(153,27,27,.30); color: #fca5a5; }
html.dark #algo .jd-pill.jd-same { background: rgba(75,85,99,.30); color: #d1d5db; }
html.dark #algo .jd-chip.jd-add  { background: rgba(22,101,52,.30); color: #86efac; }
html.dark #algo .jd-chip.jd-del  { background: rgba(153,27,27,.30); color: #fca5a5; }
html.dark #algo .jd-chip.jd-same { background: rgba(75,85,99,.30); color: #d1d5db; }
html.dark #algo .jd-diff { background: #0d1117; border-color: #30363d; }
html.dark #algo .jd-row .jd-ln { background: #161b22; color: #6e7681; border-right-color: #21262d; }
html.dark #algo .jd-row.jd-same { background: #0d1117; }
html.dark #algo .jd-row.jd-same .jd-text { color: #c9d1d9; }
html.dark #algo .jd-row.jd-add  { background: rgba(22,101,52,.18); }
html.dark #algo .jd-row.jd-add .jd-text { color: #86efac; }
html.dark #algo .jd-row.jd-del  { background: rgba(153,27,27,.18); }
html.dark #algo .jd-row.jd-del .jd-text { color: #fca5a5; }
html.dark #algo .jd-pane { background: #0d1117; border-color: #30363d; }
html.dark #algo .jd-pane .pane-bar { background: #161b22; border-bottom-color: #30363d; color: #c9d1d9; }
html.dark #algo .jd-pane .pane-bar .btn.ghost { color: #c9d1d9; border-color: #30363d; }
html.dark #algo .jd-pane .pane-bar .btn.ghost:hover { background: #21262d; color: #fff; }
/* !important melawan rule global `html.dark textarea` di app.css — textarea
   editor diff harus tetap transparan agar layer warna sintaks terlihat. */
html.dark #algo .jd-pane textarea {
  background: transparent !important; border-color: transparent !important;
  color: transparent !important; caret-color: #c9d1d9;
}
html.dark #algo .jd-pane textarea::placeholder { color: #6e7681; }
html.dark #algo .jd-syntax { color: #c9d1d9; }
html.dark #algo .jd-tk-key { color: #79c0ff; }
html.dark #algo .jd-tk-str { color: #7ee787; }
html.dark #algo .jd-tk-num { color: #ffa657; }
html.dark #algo .jd-tk-lit { color: #d2a8ff; }
html.dark #algo .jd-tk-pun { color: #8b949e; }
html.dark #algo .jd-view-switch { background: #161b22; border-color: #30363d; }
html.dark #algo .jd-view-btn { color: #8b949e; }
html.dark #algo .jd-view-btn + .jd-view-btn { border-left-color: #30363d; }
html.dark #algo .jd-view-btn:hover { color: #e6edf3; }
html.dark #algo .jd-view-btn.active { background: #e6edf3; color: #0d1117; }
html.dark #algo .jd-srow .jd-ln { background: #161b22; color: #6e7681; border-right-color: #21262d; }
html.dark #algo .jd-srow .jd-ln-r { border-left-color: #30363d; }
html.dark #algo .jd-cell.jd-same { background: #0d1117; color: #c9d1d9; }
html.dark #algo .jd-cell.jd-del  { background: rgba(153,27,27,.18); color: #fca5a5; }
html.dark #algo .jd-cell.jd-add  { background: rgba(22,101,52,.18); color: #86efac; }
html.dark #algo .jd-cell.jd-empty {
  background: repeating-linear-gradient(45deg, #0d1117, #0d1117 6px, #161b22 6px, #161b22 12px);
}
html.dark #algo .jd-cell.jd-del .jd-hl { background: rgba(248,113,113,.40); }
html.dark #algo .jd-cell.jd-add .jd-hl { background: rgba(52,211,153,.35); }

/* ── File Generator (QA Tools) ─────────────────────────────────────────────── */
#algo .feat-filegen { max-width: 720px; }
#algo .fg-field { margin-bottom: 22px; }
#algo .fg-label {
  display: block; font-weight: 600; font-size: 0.9rem;
  color: #374151; margin-bottom: 10px;
}
#algo .fg-types, #algo .fg-presets { display: flex; flex-wrap: wrap; gap: 8px; }
#algo .fg-type, #algo .fg-preset {
  padding: 8px 16px; border: 1px solid #d1d5db; border-radius: 8px;
  background: #fff; color: #374151; font-weight: 600; font-size: 0.88rem;
  cursor: pointer; transition: all .15s;
}
#algo .fg-type:hover, #algo .fg-preset:hover { border-color: #6366f1; color: #4f46e5; }
#algo .fg-type.active, #algo .fg-preset.active {
  background: #4f46e5; border-color: #4f46e5; color: #fff;
}
#algo .fg-size { display: flex; gap: 8px; align-items: center; }
#algo .fg-input {
  width: 140px; padding: 9px 12px; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 0.95rem; color: #111827; background: #fff;
}
#algo .fg-unit {
  padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 0.95rem; color: #111827; background: #fff; cursor: pointer;
}
#algo .fg-input:focus, #algo .fg-unit:focus {
  outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
#algo .fg-hint { margin: 8px 0 0; font-size: 0.82rem; color: #6b7280; }
#algo .fg-actions { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
#algo .fg-status { font-size: 0.88rem; color: #6b7280; }
#algo .fg-status.fg-ok { color: #059669; }
#algo .fg-status.fg-error { color: #dc2626; }

/* Dark mode */
html.dark #algo .fg-label { color: #c9d1d9; }
html.dark #algo .fg-type, html.dark #algo .fg-preset {
  background: #161b22; border-color: #30363d; color: #c9d1d9;
}
html.dark #algo .fg-type:hover, html.dark #algo .fg-preset:hover {
  border-color: #6366f1; color: #a5b4fc;
}
html.dark #algo .fg-type.active, html.dark #algo .fg-preset.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }
html.dark #algo .fg-input, html.dark #algo .fg-unit {
  background: #0d1117; border-color: #30363d; color: #e6edf3;
}
html.dark #algo .fg-hint, html.dark #algo .fg-status { color: #8b949e; }
html.dark #algo .fg-status.fg-ok { color: #86efac; }
html.dark #algo .fg-status.fg-error { color: #fca5a5; }

/* ── Landing feature grid (default route) ──────────────────────────────────── */
#algo .feat-grid-wrap { max-width: 1180px; }
#algo .fg-search {
  position: relative; max-width: 460px; margin: 0 0 28px;
}
#algo .fg-search-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: #9ca3af; pointer-events: none;
}
#algo .fg-search input {
  width: 100%; padding: 12px 16px 12px 42px; border: 1px solid #d1d5db;
  border-radius: 10px; font-size: 0.95rem; color: #111827; background: #fff;
}
#algo .fg-search input:focus {
  outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
#algo .feat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
#algo .feat-card {
  display: block; padding: 22px 20px; border: 1px solid #e5e7eb; border-radius: 14px;
  background: #fff; text-decoration: none; color: inherit;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
#algo .feat-card:hover {
  transform: translateY(-2px); border-color: #c7d2fe;
  box-shadow: 0 8px 24px rgba(79,70,229,.12); text-decoration: none;
}
#algo .fc-icon {
  width: 44px; height: 44px; border-radius: 11px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  background: #eef2ff; color: #4f46e5;
}
#algo .fc-icon svg { width: 24px; height: 24px; }
#algo .fc-cat {
  font-size: 0.7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #6366f1; margin-bottom: 4px;
}
#algo .fc-name { font-size: 1.02rem; font-weight: 700; color: #111827; margin-bottom: 6px; }
#algo .fc-desc { font-size: 0.86rem; line-height: 1.5; color: #6b7280; }
#algo .feat-empty { color: #6b7280; font-size: 0.95rem; padding: 24px 4px; }

/* Dark mode */
html.dark #algo .fg-search input {
  background: #0d1117; border-color: #30363d; color: #e6edf3;
}
html.dark #algo .fg-search-ico { color: #6e7681; }
html.dark #algo .feat-card { background: #161b22; border-color: #30363d; }
html.dark #algo .feat-card:hover {
  border-color: #4f46e5; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
html.dark #algo .fc-icon { background: #1c2030; color: #a5b4fc; }
html.dark #algo .fc-cat { color: #a5b4fc; }
html.dark #algo .fc-name { color: #e6edf3; }
html.dark #algo .fc-desc { color: #8b949e; }
html.dark #algo .feat-empty { color: #8b949e; }

/* What's New — minimal bullet list above the feature grid */
#algo .whats-new {
  margin: 0 0 22px;
  padding: 0;
  background: transparent;
  border: 0;
}
#algo .whats-new .wn-eyebrow {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6366f1;
}
#algo .whats-new .wn-date {
  color: #94a3b8;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: none;
}
#algo .whats-new .wn-list {
  list-style: disc;
  padding-left: 24px;
  margin: 0;
  color: #0f172a;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.55;
}
#algo .whats-new .wn-list li { margin: 4px 0; }
#algo .whats-new .wn-list a {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
}
#algo .whats-new .wn-list a:hover {
  color: #4f46e5;
  border-bottom-color: currentColor;
}

html.dark #algo .whats-new .wn-eyebrow { color: #a5b4fc; }
html.dark #algo .whats-new .wn-date { color: #6e7681; }
html.dark #algo .whats-new .wn-list { color: #e6edf3; }
html.dark #algo .whats-new .wn-list a:hover { color: #a5b4fc; }

/* Donate FAB — persegi vertikal kuning pudar nempel di tepi kanan */
#donateFab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 13px;
  border: 0;
  border-radius: 10px 0 0 10px;
  background: #d9c66b;
  color: #2a2200;
  font-weight: 900;
  font-size: 0.92rem;
  letter-spacing: .14em;
  line-height: 1;
  text-shadow: 1px 1px 1px rgba(120,120,120,.35);
  cursor: pointer;
  box-shadow: -6px 8px 22px rgba(0,0,0,.18);
  transition: padding .14s, box-shadow .14s, transform .14s, background .14s;
}
#donateFab span { display: block; line-height: 1; }
#donateFab:hover {
  padding-right: 14px;
  background: #e0cf78;
  box-shadow: -8px 10px 26px rgba(0,0,0,.22);
  transform: translateY(-50%) translateX(-2px);
}
#donateFab:active { transform: translateY(-50%); }

/* Donate modal */
.donate-modal { position: fixed; inset: 0; z-index: 9999; }
.donate-modal.hidden { display: none; }
.donate-modal .donate-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(4px);
}
.donate-modal .donate-card {
  position: relative;
  margin: 6vh auto 0;
  width: min(440px, calc(100vw - 32px));
  background: #fff;
  border-radius: 18px;
  padding: 24px 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  text-align: center;
}
.donate-modal .donate-close {
  position: absolute; top: 10px; right: 14px;
  width: 32px; height: 32px;
  border: 0; background: transparent;
  font-size: 24px; color: #94a3b8; cursor: pointer;
  border-radius: 999px;
}
.donate-modal .donate-close:hover { background: #f1f5f9; color: #0f172a; }
.donate-modal h2 { margin: 0 0 6px; font-size: 1.2rem; color: #0f172a; }
.donate-modal .donate-sub { margin: 0 0 16px; color: #64748b; font-size: 0.9rem; }
.donate-modal .donate-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: #f1f5f9; border-radius: 12px; margin-bottom: 16px;
}
.donate-modal .donate-tab {
  border: 0; background: transparent;
  padding: 8px 18px; border-radius: 9px; cursor: pointer;
  font-weight: 600; font-size: 0.88rem; color: #475569;
}
.donate-modal .donate-tab.active { background: #fff; color: #4f46e5; box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.donate-modal .donate-panel.hidden { display: none; }
.donate-modal .donate-qr {
  width: 240px; height: 240px; object-fit: contain;
  background: #fff; border-radius: 12px;
  border: 1px solid #e5e7eb; padding: 8px;
}
.donate-modal .donate-addr {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 10px 12px;
  background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px;
}
.donate-modal .donate-addr code {
  flex: 1; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.78rem; color: #0f172a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: left;
}
.donate-modal .donate-note {
  margin: 12px 0 0; color: #64748b; font-size: 0.82rem;
}

html.dark .donate-modal .donate-card { background: #161b22; }
html.dark .donate-modal h2 { color: #e6edf3; }
html.dark .donate-modal .donate-sub { color: #8b949e; }
html.dark .donate-modal .donate-tabs { background: #0f1320; }
html.dark .donate-modal .donate-tab { color: #8b949e; }
html.dark .donate-modal .donate-tab.active { background: #20242d; color: #a5b4fc; }
html.dark .donate-modal .donate-qr { background: #fff; border-color: #30363d; }
html.dark .donate-modal .donate-addr { background: #0f1320; border-color: #30363d; }
html.dark .donate-modal .donate-addr code { color: #e6edf3; }
html.dark .donate-modal .donate-note { color: #8b949e; }
html.dark .donate-modal .donate-close { color: #8b949e; }
html.dark .donate-modal .donate-close:hover { background: #20242d; color: #e6edf3; }

@media (max-width: 520px) {
  #donateFab { padding: 12px 8px; font-size: 0.82rem; letter-spacing: .12em; }
  .donate-modal .donate-card { margin: 4vh 12px 0; padding: 20px 16px; }
  .donate-modal .donate-qr { width: 200px; height: 200px; }
}
