/* ============================================================
   SAPUJAGAD — Stylesheet v4.1 "Vivid Edition"
   Redesign: Colorful, High-Energy, High-Readability
   Full-spectrum palette — vibrant accents, rich gradients
   Supports Dark Mode (default) and Light Mode
   Toggle via class .light-mode pada <html>
   ============================================================ */

/* ── GOOGLE FONTS IMPORT ──────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

/* ── DARK MODE (DEFAULT) ──────────────────────────────────── */
:root {
  /* ── Backgrounds — calm, high-contrast dark ── */
  --bg-base:   #080e1c;
  --bg-card:   #131f35;
  --bg-raised: #1a2740;
  --bg-hover:  #1f2a44;
  --bg-input:  #0d1629;

  /* ── Borders ── */
  --border-faint:  #22304a;
  --border-soft:   #334155;
  --border-medium: #475569;
  --border-strong: #64748b;

  /* ── Text — clear hierarchy ── */
  --text-primary:   #f8fafc;
  --text-secondary: #dbe4ef;
  --text-muted:     #94a3b8;
  --text-faint:     #64748b;

  /* ── PRIMARY — professional blue ── */
  --violet:       #60a5fa;
  --violet-dim:   #3b82f6;
  --violet-bright:#93c5fd;
  --violet-glow:  rgba(96,165,250,.16);

  /* ── SECONDARY — teal ── */
  --teal:       #2dd4bf;
  --teal-dim:   #14b8a6;
  --teal-bright:#5eead4;
  --teal-glow:  rgba(45,212,191,.12);

  /* ── TERTIARY — orange ── */
  --coral:      #fb923c;
  --coral-dim:  #f97316;
  --coral-glow: rgba(251,146,60,.12);

  /* ── CTA — accessible green ── */
  --lime:       #22c55e;
  --lime-dim:   #16a34a;
  --lime-text:  #86efac;
  --lime-glow:  rgba(34,197,94,.16);

  /* ── GOLD — warm accent ── */
  --gold:       #f59e0b;
  --gold-dim:   #d97706;
  --gold-glow:  rgba(245,158,11,.13);
  --gold-text:  #fbbf24;

  /* ── SKY — info/link ── */
  --sky:        #38bdf8;
  --sky-bright: #7dd3fc;
  --sky-glow:   rgba(56,189,248,.12);

  /* ── PINK — sparing accent ── */
  --pink:       #f472b6;
  --pink-glow:  rgba(244,114,182,.12);

  /* ── GREEN — success ── */
  --green:      #22c55e;
  --green-dim:  #16a34a;
  --green-glow: rgba(34,197,94,.12);

  /* ── Backward-compat aliases ── */
  --ghost: var(--text-muted);
  --line2: var(--border-soft);

  /* ── Typology color system — readable, less neon ── */
  --M: #f87171;
  --K: #fbbf24;
  --P: #e2e8f0;
  --A: #94a3b8;
  --H: #64748b;

  /* ── Fit score colors ── */
  --fit-hi2: #22c55e;
  --fit-hi:  #2dd4bf;
  --fit-mid: #f59e0b;
  --fit-lo:  #ef4444;

  /* ── Blue row (latar biru) ── */
  --lbiru-bg:     rgba(96,165,250,.10);
  --lbiru-border: rgba(96,165,250,.26);
  --lbiru-text:   #93c5fd;

  /* ── Shape ── */
  --radius:    14px;
  --radius-sm: 8px;
  --radius-xs: 5px;

  /* ── Shadows ── */
  --shadow-card: 0 12px 38px rgba(0,0,0,.34), 0 0 0 1px rgba(148,163,184,.06);
  --shadow-btn:  0 8px 24px rgba(34,197,94,.24), 0 2px 8px rgba(0,0,0,.24);
  --shadow-input:0 0 0 3px rgba(96,165,250,.20);
  --shadow-glow: 0 0 36px rgba(96,165,250,.08);

  /* ── Mode toggle ── */
  --mode-bg:    #172033;
  --mode-text:  #94a3b8;
  --mode-hover: #f8fafc;
}

/* ── LIGHT MODE ───────────────────────────────────────────── */
html.light-mode {
  /* ── Neutral bright backgrounds ── */
  --bg-base:   #dfe6f0;
  --bg-card:   #ffffff;
  --bg-raised: #eef2f8;
  --bg-hover:  #e2eaf4;
  --bg-input:  #ffffff;

  --border-faint:  #e2e8f0;
  --border-soft:   #cbd5e1;
  --border-medium: #94a3b8;
  --border-strong: #64748b;

  --text-primary:   #0f172a;
  --text-secondary: #334155;
  --text-muted:     #64748b;
  --text-faint:     #94a3b8;

  /* ── PRIMARY — blue ── */
  --violet:       #2563eb;
  --violet-dim:   #1d4ed8;
  --violet-bright:#3b82f6;
  --violet-glow:  rgba(37,99,235,.10);

  /* ── SECONDARY — teal ── */
  --teal:       #0f766e;
  --teal-dim:   #0d5f59;
  --teal-bright:#14b8a6;
  --teal-glow:  rgba(15,118,110,.10);

  /* ── TERTIARY — orange ── */
  --coral:      #ea580c;
  --coral-dim:  #c2410c;
  --coral-glow: rgba(234,88,12,.10);

  /* ── CTA — green ── */
  --lime:       #16a34a;
  --lime-dim:   #15803d;
  --lime-text:  #166534;
  --lime-glow:  rgba(22,163,74,.10);

  --gold:       #b45309;
  --gold-dim:   #92400e;
  --gold-glow:  rgba(180,83,9,.10);
  --gold-text:  #92400e;

  --sky:        #0369a1;
  --sky-bright: #0284c7;
  --sky-glow:   rgba(3,105,161,.10);

  --pink:       #be185d;
  --pink-glow:  rgba(190,24,93,.10);

  --green:      #15803d;
  --green-dim:  #166534;
  --green-glow: rgba(21,128,61,.10);

  /* Backward-compat */
  --ghost: var(--text-muted);
  --line2: var(--border-soft);

  /* ── Typology — stronger contrast in light mode ── */
  --M: #b91c1c;
  --K: #a16207;
  --P: #334155;
  --A: #64748b;
  --H: #94a3b8;

  --fit-hi2: #166534;
  --fit-hi:  #0f766e;
  --fit-mid: #b45309;
  --fit-lo:  #b91c1c;

  --lbiru-bg:     rgba(37,99,235,.07);
  --lbiru-border: rgba(37,99,235,.22);
  --lbiru-text:   #1d4ed8;

  --shadow-card: 0 8px 28px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.06);
  --shadow-btn:  0 7px 20px rgba(22,163,74,.22), 0 1px 5px rgba(0,0,0,.10);
  --shadow-input:0 0 0 3px rgba(37,99,235,.14);
  --shadow-glow: 0 0 36px rgba(37,99,235,.05);

  --mode-bg:    #f1f5f9;
  --mode-text:  #64748b;
  --mode-hover: #0f172a;
}

/* ── RESET ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-anchor: none;
  line-height: 1.65;
  font-size: 0.9375rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Rich multi-color background nebula */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 42% at 12% -10%, rgba(96,165,250,.10) 0%, transparent 58%),
    radial-gradient(ellipse 58% 48% at 88% 18%, rgba(45,212,191,.07) 0%, transparent 56%),
    radial-gradient(ellipse 54% 45% at 54% 110%, rgba(245,158,11,.05) 0%, transparent 58%);
  pointer-events: none;
  z-index: 0;
}

html.light-mode body::before {
  background:
    radial-gradient(ellipse 75% 42% at 12% -10%, rgba(37,99,235,.055) 0%, transparent 58%),
    radial-gradient(ellipse 58% 48% at 88% 18%, rgba(15,118,110,.045) 0%, transparent 56%),
    radial-gradient(ellipse 54% 45% at 54% 110%, rgba(180,83,9,.035) 0%, transparent 58%);
}

.page { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 0 28px 100px; }

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 14px;
}
.logo { display: flex; align-items: center; gap: 0; }
.logo-img {
  height: 118px;
  width: auto;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}
.logo-icon { display: none; }
.logo-mark { display: none; }
.logo-sub  { display: none; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--teal);
  border: 1px solid rgba(0,229,208,.35);
  padding: 6px 14px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  background: rgba(0,229,208,.07);
}
.topbar-version {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--violet-bright);
  background: var(--violet-glow);
  border: 1px solid rgba(156,107,255,.3);
  padding: 5px 11px;
  border-radius: 20px;
}

/* ── MODE TOGGLE ──────────────────────────────────────────── */
.mode-toggle {
  background: var(--mode-bg);
  border: 1px solid var(--border-medium);
  border-radius: 20px;
  color: var(--mode-text);
  padding: 7px 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.73rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.mode-toggle:hover {
  border-color: var(--violet);
  color: var(--mode-hover);
  background: var(--violet-glow);
}
.mode-toggle .mode-icon { font-size: 0.95rem; line-height: 1; }
.mode-toggle .mode-label { font-size: 0.7rem; }

/* ── BRAND SLOGAN ─────────────────────────────────────────── */
.brand-slogan {
  display: flex;
  align-items: center;
  padding-left: 1.2rem;
  margin-left: 1rem;
  border-left: 1px solid var(--border-soft);
  align-self: center;
}
.slogan-text {
  font-family: 'Lora', 'Georgia', serif;
  font-style: italic;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  line-height: 1.4;
  white-space: nowrap;
  user-select: none;
}
html.light-mode .slogan-text { color: var(--text-secondary); }
html.light-mode .logo-img {
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.18))
          drop-shadow(0 1px 4px rgba(0,0,0,.12));
}

/* ── INPUT SECTION ────────────────────────────────────────── */
.input-section {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-top: 3px solid var(--violet);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 52px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

html.light-mode .input-section { border-top-color: var(--violet); }

.input-header {
  padding: 22px 36px 18px;
  background: linear-gradient(135deg, var(--violet-glow) 0%, var(--bg-raised) 50%, var(--teal-glow) 100%);
  border-bottom: 1px solid var(--border-faint);
}
.input-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.input-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 5px;
  letter-spacing: -0.01em;
}
.input-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── METHOD TABS ──────────────────────────────────────────── */
.method-tabs {
  display: flex;
  gap: 0;
  align-self: flex-start;
  background: var(--bg-base);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 4px;
}
.mtab {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 20px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.mtab.active {
  background: var(--violet);
  color: #fff;
  box-shadow: 0 2px 12px var(--violet-glow);
}
html.light-mode .mtab.active {
  background: var(--violet);
  color: #fff;
  box-shadow: 0 2px 12px var(--violet-glow);
}
.mtab:hover:not(.active) { color: var(--text-secondary); }
.method-pane { display: none; }
.method-pane.active { display: block; }
.paste-pane { padding: 20px 36px 14px; }

.score-box {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  padding: 16px 20px;
  resize: vertical;
  min-height: 72px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.9;
}
.score-box:focus {
  border-color: var(--violet);
  box-shadow: var(--shadow-input);
}
.score-box::placeholder {
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* ── TYPOLOGY GRID ────────────────────────────────────────── */
.typology-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

/* Base chip */
.ty-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  border-radius: 5px;
  padding: 4px 6px 3px;
  min-width: 38px;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid transparent;
  cursor: default;
  transition: opacity 0.12s;
}
.ty-abbr {
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-family: 'Inter', sans-serif;
  line-height: 1.3;
  opacity: .8;
}
.ty-score {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Belum diisi */
.ty-chip-empty {
  background: rgba(255,255,255,.04);
  border-color: var(--border-faint);
  color: var(--text-faint);
}
/* Error */
.ty-chip-err {
  background: rgba(255,80,80,.14);
  border-color: rgba(255,80,80,.4);
  color: #ff8080;
}
/* Warna M/K/P/A/H — vivid */
.ty-chip-M {
  background: rgba(255,94,94,.18);
  border-color: rgba(255,94,94,.45);
  color: var(--M);
}
.ty-chip-K {
  background: rgba(255,184,32,.16);
  border-color: rgba(255,184,32,.4);
  color: var(--K);
}
.ty-chip-P {
  background: rgba(156,107,255,.10);
  border-color: rgba(156,107,255,.25);
  color: var(--P);
}
.ty-chip-A {
  background: rgba(120,136,192,.12);
  border-color: rgba(120,136,192,.28);
  color: var(--A);
}
.ty-chip-H {
  background: rgba(46,58,106,.2);
  border-color: var(--border-faint);
  color: var(--text-muted);
}

/* Light mode */
html.light-mode .ty-chip-empty { background: rgba(0,0,0,.04); }
html.light-mode .ty-chip-M { background: rgba(200,24,24,.09); border-color: rgba(200,24,24,.28); }
html.light-mode .ty-chip-K { background: rgba(184,120,0,.09); border-color: rgba(184,120,0,.28); }
html.light-mode .ty-chip-P { background: rgba(96,48,216,.08); border-color: rgba(96,48,216,.22); }
html.light-mode .ty-chip-A { background: rgba(104,104,176,.09); border-color: rgba(104,104,176,.24); }
html.light-mode .ty-chip-H { background: rgba(170,170,204,.12); }

/* ── PDF PANE ─────────────────────────────────────────────── */
.pdf-pane { padding: 22px 36px 16px; }
.pdf-drop {
  border: 2px dashed var(--teal-dim);
  border-radius: var(--radius-sm);
  padding: 28px 36px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.pdf-drop:hover, .pdf-drop.drag {
  border-color: var(--teal);
  background: var(--teal-glow);
}
.drop-icon { font-size: 2.1rem; display: block; margin-bottom: 10px; }
.pdf-drop p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 5px;
}
.pdf-drop small { color: var(--text-muted); font-size: 0.76rem; }
#pdf-file { display: none; }
#pdf-status {
  margin-top: 10px;
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
  min-height: 22px;
}
#pdf-status:empty { display: none; margin-top: 0; min-height: 0; }

/* ── PDF CONFIRM CARD ─────────────────────────────────────── */
.pdf-confirm {
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 14px 18px 16px;
  animation: pfcFadeIn .25s ease;
}
@keyframes pfcFadeIn {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}

.pfc-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.pfc-icon {
  font-size: 1.1rem;
  color: var(--teal);
  margin-top: 1px;
  flex-shrink: 0;
}
.pfc-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pfc-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  font-family: 'Inter', sans-serif;
}
.pfc-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pfc-noname { color: var(--text-muted); font-style: italic; font-weight: 400; }
.pfc-file {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Score chips row */
.pfc-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pfc-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  border-radius: 5px;
  padding: 3px 5px;
  border: 1px solid transparent;
  min-width: 36px;
  cursor: default;
}
.pfc-ty {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: 'Inter', sans-serif;
  line-height: 1.2;
  opacity: .85;
}
.pfc-sc {
  font-size: 0.68rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.3;
}
/* Warna chip */
.pfc-M { background:rgba(255,94,94,.18); color:var(--M); border-color:rgba(255,94,94,.38); }
.pfc-K { background:rgba(255,184,32,.16); color:var(--K); border-color:rgba(255,184,32,.35); }
.pfc-P { background:rgba(156,107,255,.10); color:var(--P); border-color:rgba(156,107,255,.25); }
.pfc-A { background:rgba(120,136,192,.12); color:var(--A); border-color:rgba(120,136,192,.25); }
.pfc-H { background:rgba(46,58,106,.2);   color:var(--text-muted); border-color:var(--border-soft); }

html.light-mode .pfc-M { background:rgba(200,24,24,.09);  border-color:rgba(200,24,24,.25); }
html.light-mode .pfc-K { background:rgba(184,120,0,.09);  border-color:rgba(184,120,0,.25); }
html.light-mode .pfc-P { background:rgba(96,48,216,.08);  border-color:rgba(96,48,216,.22); }
html.light-mode .pfc-A { background:rgba(104,104,176,.1); border-color:rgba(104,104,176,.25); }
html.light-mode .pfc-H { background:rgba(170,170,204,.15);border-color:var(--border-soft); }

@media (max-width: 600px) {
  .pfc-chip { min-width: 32px; padding: 3px 4px; }
  .pfc-ty   { font-size: 0.5rem; }
  .pfc-sc   { font-size: 0.62rem; }
  .pfc-name { font-size: 0.9rem; }
}

/* ── INPUT FOOTER ─────────────────────────────────────────── */
.input-footer {
  padding: 12px 36px;
  background: var(--bg-raised);
  border-top: 1px solid var(--border-faint);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
}

/* Floating error toast — muncul di atas footer tanpa menggeser tombol */
.err-box {
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: calc(100% - 4px);
  background: rgba(255,80,80,.14);
  border: 1px solid rgba(255,80,80,.4);
  border-radius: var(--radius-xs);
  padding: 11px 40px 11px 16px;
  color: #ff9090;
  font-size: 0.84rem;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.err-box.on {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.err-box::before {
  content: "\26A0";
  margin-right: 8px;
  font-size: 0.95rem;
}
.err-box-close {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #ff9090;
  opacity: 0.6;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1.05rem;
  line-height: 1;
  border-radius: 4px;
  transition: opacity .15s, background .15s;
}
.err-box-close:hover {
  opacity: 1;
  background: rgba(255,80,80,.12);
}
html.light-mode .err-box {
  background: rgba(200,30,30,.08);
  border-color: rgba(200,30,30,.32);
  color: #c01e1e;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
html.light-mode .err-box-close { color: #c01e1e; }
html.light-mode .err-box-close:hover { background: rgba(200,30,30,.1); }

/* ── LIME GREEN CTA BUTTON ──────────────────────────────────── */
.btn-run {
  background: linear-gradient(135deg, var(--lime) 0%, var(--lime-dim) 100%);
  color: #ffffff;
  border: none;
  padding: 14px 40px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: var(--shadow-btn);
  white-space: nowrap;
  flex-shrink: 0;
}
html.light-mode .btn-run {
  background: linear-gradient(135deg, var(--lime) 0%, var(--lime-dim) 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(42,144,0,.35);
}
.btn-run:hover   { opacity: 0.92; box-shadow: 0 6px 32px rgba(200,255,0,.55); }
html.light-mode .btn-run:hover { box-shadow: 0 6px 28px rgba(42,144,0,.5); }
.btn-run:active  { transform: scale(0.98); }
.btn-run:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(0,0,0,.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-run.loading .spinner   { display: block; }
.btn-run.loading .btn-label { opacity: 0.6; }
@keyframes spin { to { transform: rotate(360deg); } }

.run-hint {
  font-size: 0.76rem;
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.5;
}

/* ── RESULTS ──────────────────────────────────────────────── */
#results { display: none; }
#results.on { display: block; animation: fadeUp 0.4s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RIASEC CARD — vivid gradient header ──────────────────── */
.riasec-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 36px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.riasec-card-top {
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  background:
    linear-gradient(135deg,
      rgba(156,107,255,.15) 0%,
      rgba(0,229,208,.08) 50%,
      rgba(77,184,255,.06) 100%),
    var(--bg-raised);
  border-bottom: 1px solid var(--border-soft);
}
html.light-mode .riasec-card-top {
  background:
    linear-gradient(135deg,
      rgba(96,48,216,.08) 0%,
      rgba(0,138,128,.05) 50%,
      rgba(10,104,216,.04) 100%),
    var(--bg-raised);
}

.rcode {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 2.9rem;
  letter-spacing: 0.1em;
  line-height: 1;
}
/* Vivid RIASEC letter colors */
.rc0 { color: var(--violet); text-shadow: 0 0 30px rgba(156,107,255,.45); }
.rc1 { color: var(--teal); text-shadow: 0 0 30px rgba(0,229,208,.35); }
.rc2 { color: var(--coral); text-shadow: 0 0 30px rgba(255,107,53,.35); }
.rcn { color: var(--text-faint); }

html.light-mode .rc0 { color: var(--violet); text-shadow: none; }
html.light-mode .rc1 { color: var(--teal); text-shadow: none; }
html.light-mode .rc2 { color: var(--coral); text-shadow: none; }

.rbar-div {
  width: 1px;
  height: 54px;
  background: var(--border-soft);
  align-self: center;
  flex-shrink: 0;
}
.rdims { display: flex; gap: 7px; flex-wrap: wrap; }
.rdim {
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 9px 16px;
  text-align: center;
  min-width: 66px;
  transition: border-color 0.2s;
}
.rdim.hi {
  border-color: rgba(0,229,208,.5);
  background: rgba(0,229,208,.08);
}
html.light-mode .rdim.hi {
  border-color: rgba(0,138,128,.4);
  background: rgba(0,138,128,.07);
}
.rdim .dl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  margin-bottom: 3px;
  text-transform: uppercase;
}
.rdim .dv {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-secondary);
}
.rdim.hi .dv { color: var(--teal); }

.riasec-meta {
  padding: 13px 32px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.76rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  background: var(--bg-raised);
}

/* ── OUTPUT TABS — vivid active indicator ─────────────────── */
.out-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-soft);
  margin-bottom: 26px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 4px;
}
.out-tabs::-webkit-scrollbar { display: none; }

.otab {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  background: none;
  border: none;
  color: var(--text-faint);
  padding: 10px 18px 12px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px 8px 0 0;
}
.otab:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}
.otab.active {
  color: #fff;
  border-bottom-color: var(--violet);
  background: var(--violet);
  box-shadow: 0 2px 16px rgba(156,107,255,.35);
}
html.light-mode .otab.active {
  color: #fff;
  background: var(--violet);
  box-shadow: 0 2px 12px rgba(96,48,216,.28);
}

.tab-pill {
  background: rgba(255,255,255,.15);
  color: var(--text-muted);
  font-size: 0.65rem;
  padding: 2px 9px;
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  transition: background 0.2s, color 0.2s;
}
.otab.active .tab-pill {
  background: rgba(255,255,255,.22);
  color: #fff;
}
html.light-mode .otab:not(.active) .tab-pill {
  background: var(--bg-raised);
  color: var(--text-muted);
}

.opane { display: none; }
.opane.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── TOOLBAR ──────────────────────────────────────────────── */
.ptoolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.srch {
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 14px;
  font-size: 0.875rem;
  outline: none;
  width: 220px;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: 'Inter', sans-serif;
}
.srch:focus {
  border-color: var(--violet);
  box-shadow: var(--shadow-input);
}
.srch::placeholder { color: var(--text-faint); }

.fsel {
  background: var(--bg-card);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
}
.fsel:focus { border-color: var(--violet); }

.tbtn {
  background: var(--bg-raised);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 9px 16px;
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.03em;
}
.tbtn.on {
  background: var(--violet-glow);
  border-color: var(--violet);
  color: var(--violet-bright);
}
.tbtn:hover:not(.on) {
  color: var(--text-secondary);
  border-color: var(--border-strong);
  background: var(--bg-hover);
}

.btn-export {
  background: var(--bg-raised);
  border: 1.5px solid rgba(0,229,208,.35);
  border-radius: var(--radius-sm);
  color: var(--teal);
  padding: 9px 18px;
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-export:hover {
  background: var(--teal-glow);
  border-color: var(--teal);
}

.tspacer { flex: 1; }
.rcount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sc-info-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  margin-bottom: 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.sc-badge {
  display: inline-block;
  background: rgba(0,229,208,.12);
  border: 1px solid rgba(0,229,208,.3);
  color: var(--teal);
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.sc-sep {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  margin: 0 1px;
  user-select: none;
}

/* ── LATAR BIRU LEGEND ────────────────────────────────────── */
.lbiru-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  margin-bottom: 14px;
  background: var(--lbiru-bg);
  border: 1px solid var(--lbiru-border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--lbiru-text);
  line-height: 1.5;
}
.lb-sw {
  width: 11px; height: 11px;
  border-radius: 3px;
  background: rgba(77,140,255,.22);
  border: 1px solid rgba(77,140,255,.4);
  flex-shrink: 0;
}

/* ── TABLE — colorful row accents ────────────────────────── */
.tbl-wrap {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
  margin-bottom: 16px;
}

.dtbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.dtbl thead th {
  background: var(--bg-raised);
  padding: 12px 16px;
  text-align: left;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border-soft);
  white-space: nowrap;
}

.dtbl tbody tr {
  border-bottom: 1px solid var(--border-faint);
  transition: background 0.12s;
}
.dtbl tbody tr:last-child { border-bottom: none; }

.dtbl tbody tr.row-lbiru td    { background: var(--lbiru-bg); }
.dtbl tbody tr.row-lbiru:hover td { background: rgba(77,140,255,.12); }
.dtbl tbody tr.row-normal:hover td { background: var(--bg-hover); }
.dtbl tbody tr.row-lbiru .td-nama { color: var(--text-muted); }
.dtbl tbody tr.row-lbiru .td-kode { color: var(--lbiru-text); }

.lbiru-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(77,140,255,.14);
  border: 1px solid rgba(77,140,255,.3);
  color: var(--lbiru-text);
  font-size: 0.6rem;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  margin-left: 8px;
  vertical-align: middle;
}

.dtbl td {
  padding: 11px 16px;
  vertical-align: middle;
}

.td-no   {
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  width: 40px;
}
.td-nama {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}
.td-dept {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.td-kode {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--teal);
  letter-spacing: 0.08em;
}
.fdot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--violet);
  margin-left: 6px;
  vertical-align: middle;
}

/* ── FIT SCORE BAR — vivid color scale ───────────────────── */
.fit-cell  { min-width: 140px; }
.fit-row   { display: flex; align-items: center; gap: 9px; }
.fit-track {
  flex: 1;
  height: 5px;
  background: var(--bg-raised);
  border-radius: 3px;
  overflow: hidden;
  min-width: 58px;
}
.fit-fill  { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.fit-num   {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  min-width: 46px;
  text-align: right;
  font-weight: 600;
}

/* ≥80% neon green, ≥65% teal, ≥50% amber, <50% coral */
.chi2  { color: var(--fit-hi2); } .chi2-fill { background: var(--fit-hi2); }
.chi   { color: var(--teal);    } .chi-fill  { background: var(--teal); }
.cmid  { color: var(--fit-mid); } .cmid-fill { background: var(--fit-mid); }
.clo   { color: var(--fit-lo);  } .clo-fill  { background: var(--fit-lo); }

/* ── PAGER — vivid active ─────────────────────────────────── */
.pager {
  display: flex;
  gap: 5px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.pbtn {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  transition: all 0.15s;
  min-width: 40px;
  text-align: center;
}
.pbtn:hover {
  border-color: var(--violet);
  color: var(--text-primary);
  background: var(--violet-glow);
}
.pbtn.cur {
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 12px var(--violet-glow);
}
.pbtn:disabled {
  opacity: 0.32;
  cursor: default;
  pointer-events: none;
}
.pdots {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 22px;
  padding: 0 2px;
  color: var(--line2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  user-select: none;
}

/* ── LEADERSHIP SECTION ───────────────────────────────────── */
.lt-lbl {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lt-lbl::before {
  content: '';
  width: 18px;
  height: 2.5px;
  background: linear-gradient(90deg, var(--violet), var(--teal));
  border-radius: 2px;
  display: inline-block;
}

.lt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 8px;
  margin-bottom: 36px;
}
.lt-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.lt-card:hover {
  border-color: var(--violet);
  background: var(--violet-glow);
  box-shadow: 0 2px 16px var(--violet-glow);
}

/* ── LEADERSHIP TYPOLOGY TOOLTIP ─────────────────────────── */
.lt-name {
  position: relative;
  cursor: default;
}

.lt-tip {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  z-index: 9999;
  writing-mode: horizontal-tb;
  transform: none !important;
  text-transform: none;
  width: 260px;
  background: var(--bg-raised);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(156,107,255,.08);
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: left;
  white-space: normal;
  transition: opacity 0.15s ease;
}

.lt-tip.lt-tip-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: none;
}

.lt-tip-name {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--violet-bright);
  margin-bottom: 7px;
  font-family: 'Inter', sans-serif;
}

.lt-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--border-medium);
}
.lt-tip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--bg-raised);
  z-index: 1;
}

html.light-mode .lt-tip {
  background: #ffffff;
  border-color: #cbc5f0;
  box-shadow: 0 8px 28px rgba(60,40,180,.12), 0 0 0 1px rgba(60,40,180,.04);
  color: #2e2880;
}
html.light-mode .lt-tip::after { border-top-color: #cbc5f0; }
html.light-mode .lt-tip::before { border-top-color: #ffffff; }
@media (max-width: 768px) {
  html.light-mode .lt-tip::after { border-top-color: transparent; border-bottom-color: #cbc5f0; }
  html.light-mode .lt-tip::before { border-top-color: transparent; border-bottom-color: #ffffff; }
}

.lt-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.lt-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 5px;
  white-space: nowrap;
}

/* ── BADGE COLORS (Typology) — vivid ─────────────────────── */
.b-M { background: rgba(255,94,94,.18); color: var(--M); border: 1px solid rgba(255,94,94,.4); }
.b-K { background: rgba(255,184,32,.16); color: var(--K); border: 1px solid rgba(255,184,32,.38); }
.b-P { background: rgba(156,107,255,.12); color: var(--P); border: 1px solid rgba(156,107,255,.28); }
.b-A { background: rgba(120,136,192,.14); color: var(--A); border: 1px solid rgba(120,136,192,.28); }
.b-H { background: rgba(46,58,106,.22); color: var(--text-muted); border: 1px solid var(--border-soft); }

html.light-mode .b-M { background: rgba(200,24,24,.1);  color: var(--M); border: 1px solid rgba(200,24,24,.28); }
html.light-mode .b-K { background: rgba(184,120,0,.1);  color: var(--K); border: 1px solid rgba(184,120,0,.3); }
html.light-mode .b-P { background: rgba(96,48,216,.1);  color: var(--P); border: 1px solid rgba(96,48,216,.28); }
html.light-mode .b-A { background: rgba(104,104,176,.1);color: var(--A); border: 1px solid rgba(104,104,176,.26); }
html.light-mode .b-H { background: rgba(170,170,204,.18); color: var(--text-muted); border: 1px solid var(--border-soft); }

/* ── MATRIX — rich color scheme ──────────────────────────── */
.matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
}
.mtrx { border-collapse: collapse; font-size: 0.78rem; }
.mtrx th, .mtrx td { border: 1px solid var(--border-faint); padding: 0; }
.mtrx th.corner {
  background: var(--bg-raised);
  border-color: var(--border-soft);
  width: 122px;
}
.mtrx th.col-hdr {
  background: var(--bg-raised);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 13px 8px 9px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.63rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  min-height: 96px;
  vertical-align: bottom;
}
.mtrx th.row-hdr {
  background: var(--bg-raised);
  text-align: right;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.67rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 8px 14px 8px 18px;
  white-space: nowrap;
  text-transform: uppercase;
  width: 122px;
}
.mtrx td.mc {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.8rem;
  width: 36px;
  height: 36px;
  cursor: default;
  transition: opacity 0.15s;
}
.mtrx td.mc:hover { opacity: 0.72; }

/* ── 17 ROLE DOMAINS TAB ─────────────────────────────────── */
.rd-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  display: flex;
  justify-content: center;
}

.rd-tbl {
  border-collapse: collapse;
  width: auto;
  min-width: 520px;
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
}

.rd-th {
  background: var(--bg-raised);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border-soft);
  white-space: nowrap;
}
.rd-th-cluster { width: 130px; text-align: left; }
.rd-th-domain  { width: 150px; text-align: left; }
.rd-th-comp    { width: 180px; text-align: left; color: var(--text-muted); }
.rd-th-num     { width: 72px; text-align: center; }

.rd-cluster {
  background: var(--bg-raised);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 0 12px;
  vertical-align: middle;
  text-align: center;
  border-right: 2px solid var(--border-soft);
  white-space: nowrap;
}

.rd-domain {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-primary);
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-faint);
  white-space: nowrap;
}

.rd-comp {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-faint);
  white-space: nowrap;
}

.rd-num {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-faint);
  white-space: nowrap;
}

/* Domain color coding — hierarki jelas M > K > P > A > H */
/* Dark mode */
.rd-row.rd-M .rd-domain { border-left: 3px solid var(--M); color: var(--M); }
.rd-row.rd-K .rd-domain { border-left: 3px solid var(--K); color: var(--K); }
.rd-row.rd-P .rd-domain { border-left: 3px solid var(--text-secondary); color: var(--text-primary); }
.rd-row.rd-A .rd-domain { border-left: 3px solid var(--border-strong); color: var(--text-muted); }
.rd-row.rd-H .rd-domain { border-left: 3px solid var(--border-faint); color: var(--text-faint); }

.rd-row.rd-M .rd-adj { color: var(--M); font-weight: 800; }
.rd-row.rd-K .rd-adj { color: var(--K); font-weight: 800; }
.rd-row.rd-P .rd-adj { color: var(--text-primary); font-weight: 700; }
.rd-row.rd-A .rd-adj { color: var(--text-muted); }
.rd-row.rd-H .rd-adj { color: var(--text-faint); }

.rd-rank { color: var(--gold-text); font-weight: 800; font-size: 0.85rem; }

/* Row backgrounds */
.rd-row.rd-M { background: rgba(255,94,94,.06); }
.rd-row.rd-K { background: rgba(255,184,32,.05); }
.rd-row.rd-P { background: transparent; }
.rd-row.rd-A { background: transparent; }
.rd-row.rd-H { background: transparent; }

.rd-row:hover .rd-domain,
.rd-row:hover .rd-comp,
.rd-row:hover .rd-num { background: var(--teal-glow); }
.rd-row:hover .rd-cluster { background: var(--bg-raised); }

/* Cluster separators */
.rd-tbl tbody tr:nth-child(3) td,
.rd-tbl tbody tr:nth-child(5) td,
.rd-tbl tbody tr:nth-child(7) td,
.rd-tbl tbody tr:nth-child(9) td,
.rd-tbl tbody tr:nth-child(10) td,
.rd-tbl tbody tr:nth-child(14) td,
.rd-tbl tbody tr:nth-child(16) td {
  border-bottom: 3px solid var(--border-medium) !important;
}
.rd-tbl tbody tr:nth-child(4) td,
.rd-tbl tbody tr:nth-child(6) td,
.rd-tbl tbody tr:nth-child(8) td,
.rd-tbl tbody tr:nth-child(10) td,
.rd-tbl tbody tr:nth-child(11) td,
.rd-tbl tbody tr:nth-child(15) td,
.rd-tbl tbody tr:nth-child(17) td {
  border-top: 3px solid var(--border-medium) !important;
}
html.light-mode .rd-tbl tbody tr:nth-child(3) td,
html.light-mode .rd-tbl tbody tr:nth-child(5) td,
html.light-mode .rd-tbl tbody tr:nth-child(7) td,
html.light-mode .rd-tbl tbody tr:nth-child(9) td,
html.light-mode .rd-tbl tbody tr:nth-child(10) td,
html.light-mode .rd-tbl tbody tr:nth-child(14) td,
html.light-mode .rd-tbl tbody tr:nth-child(16) td {
  border-bottom: 3px solid var(--border-medium) !important;
}
html.light-mode .rd-tbl tbody tr:nth-child(4) td,
html.light-mode .rd-tbl tbody tr:nth-child(6) td,
html.light-mode .rd-tbl tbody tr:nth-child(8) td,
html.light-mode .rd-tbl tbody tr:nth-child(10) td,
html.light-mode .rd-tbl tbody tr:nth-child(11) td,
html.light-mode .rd-tbl tbody tr:nth-child(15) td,
html.light-mode .rd-tbl tbody tr:nth-child(17) td {
  border-top: 3px solid var(--border-medium) !important;
}

/* Light mode overrides */
html.light-mode .rd-cluster { background: #f0eeff; border-right-color: #cbc5f0; }
html.light-mode .rd-th      { background: #f0eeff; }
html.light-mode .rd-row.rd-M { background: rgba(200,24,24,.05); }
html.light-mode .rd-row.rd-K { background: rgba(184,120,0,.05); }
html.light-mode .rd-row.rd-P { background: transparent; }
html.light-mode .rd-row.rd-A { background: transparent; }
html.light-mode .rd-row.rd-H { background: transparent; }

/* Light mode — domain name & adj: warna tegas berbeda per level */
html.light-mode .rd-row.rd-M .rd-domain { border-left-color: var(--M); color: var(--M); }
html.light-mode .rd-row.rd-K .rd-domain { border-left-color: var(--K); color: var(--K); }
html.light-mode .rd-row.rd-P .rd-domain { border-left-color: #3030a0; color: #1a1a50; }
html.light-mode .rd-row.rd-A .rd-domain { border-left-color: #9898c0; color: #6868a0; }
html.light-mode .rd-row.rd-H .rd-domain { border-left-color: #c4c4d8; color: #b0b0c8; }

html.light-mode .rd-row.rd-M .rd-adj { color: var(--M); font-weight: 800; }
html.light-mode .rd-row.rd-K .rd-adj { color: var(--K); font-weight: 800; }
html.light-mode .rd-row.rd-P .rd-adj { color: #1a1a50; font-weight: 700; }
html.light-mode .rd-row.rd-A .rd-adj { color: #6868a0; }
html.light-mode .rd-row.rd-H .rd-adj { color: #b0b0c8; }

@media (max-width: 768px) {
  .rd-th-comp, .rd-comp { display: none; }
  .rd-th-num  { width: 56px; }
  .rd-num     { font-size: 0.72rem; padding: 7px 6px; }
  .rd-domain  { font-size: 0.75rem; padding: 7px 10px; }
  .rd-cluster { font-size: 0.58rem; padding: 0 8px; }
}

/* ── MATRIX TOOLTIP ───────────────────────────────────────── */
.mtrx-tip-host {
  position: relative;
  cursor: default;
}

.mtrx-shared-tip {
  width: 230px;
}
.mtrx-shared-tip::after {
  top: 50%;
  right: 100%;
  left: auto;
  bottom: auto;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-left-color: transparent;
  border-right-color: var(--border-medium);
}
.mtrx-shared-tip::before {
  top: 50%;
  right: 100%;
  left: auto;
  bottom: auto;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-left-color: transparent;
  border-right-color: var(--bg-raised);
  z-index: 1;
  right: calc(100% - 1px);
}
html.light-mode .mtrx-shared-tip::after  { border-right-color: #cbc5f0; }
html.light-mode .mtrx-shared-tip::before { border-right-color: #ffffff; }

.mtrx-col-tip {
  position: fixed !important;
  width: 230px;
  bottom: auto;
}
.mtrx-col-tip.mtrx-tip-visible {
  opacity: 1;
  visibility: visible;
}
.mtrx-col-tip::after,
.mtrx-col-tip::before {
  top: 50%;
  left: auto;
  right: 100%;
  bottom: auto;
  transform: translateY(-50%);
  border-top-color: transparent;
}
.mtrx-col-tip::after {
  border-right-color: var(--border-medium);
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-left-color: transparent;
}
.mtrx-col-tip::before {
  border-right-color: var(--bg-raised);
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-left-color: transparent;
  z-index: 1;
  right: calc(100% - 1px);
}

.mtrx-row-tip {
  position: fixed !important;
  width: 230px;
  bottom: auto;
}
.mtrx-row-tip.mtrx-tip-visible {
  opacity: 1;
  visibility: visible;
}
.mtrx-row-tip::after,
.mtrx-row-tip::before {
  top: 50%;
  right: 100%;
  left: auto;
  bottom: auto;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-bottom-color: transparent;
  border-left-color: transparent;
}
.mtrx-row-tip::after {
  border-right-color: var(--border-medium);
}
.mtrx-row-tip::before {
  border-right-color: var(--bg-raised);
  z-index: 1;
  right: calc(100% - 1px);
}

.mtrx-col-tip,
.mtrx-row-tip { z-index: 9999; }

html.light-mode .mtrx-col-tip::after { border-right-color: #cbc5f0; }
html.light-mode .mtrx-col-tip::before { border-right-color: #ffffff; }
html.light-mode .mtrx-row-tip::after { border-right-color: #cbc5f0; border-left-color: transparent; }
html.light-mode .mtrx-row-tip::before { border-right-color: #ffffff; border-left-color: transparent; }

@media (max-width: 900px) {
  .mtrx-col-tip,
  .mtrx-row-tip { width: 210px; }

  .mtrx-col-tip::after,
  .mtrx-col-tip::before,
  .mtrx-row-tip::after,
  .mtrx-row-tip::before {
    top: 100%; left: 50%; right: auto; bottom: auto;
    transform: translateX(-50%);
    border-right-color: transparent;
    border-left-color: transparent;
    border-bottom-color: transparent;
  }
  .mtrx-col-tip::after,
  .mtrx-row-tip::after  { border-top-color: var(--border-medium); }
  .mtrx-col-tip::before,
  .mtrx-row-tip::before { border-top-color: var(--bg-raised); z-index:1; }

  html.light-mode .mtrx-col-tip::after,
  html.light-mode .mtrx-row-tip::after  { border-top-color: #cbc5f0; }
  html.light-mode .mtrx-col-tip::before,
  html.light-mode .mtrx-row-tip::before { border-top-color: #ffffff; }
}

/* ── MATRIX VALUE COLORS ──────────────────────────────────── */
/* Filosofi: 8 = paling terang & mencolok (max highlight)
             7 = sangat jelas, sedikit lebih redup dari 8
             6 = cukup jelas, mulai redup
             5 = sedang, terlihat tapi tidak mencolok
             4 = redup, nyaris menyatu dengan bg
             3 = sangat redup
             2/1/0 = hampir tak terlihat, menyatu bg         */

/* Matrix compatibility value colors — final agreed scale
   8 = merah menyala, 7 = oranye menyala, 6 = putih,
   5 ke bawah = abu bertingkat semakin tua sampai hitam.
   Warna dibuat sama di dark/light mode agar makna visual tidak berubah. */
.v8 {
  background: #ff1f2d;
  color: #ffffff;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.38), 0 0 12px rgba(255,31,45,.28);
}
.v7 {
  background: #ff8a00;
  color: #111827;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.34), 0 0 10px rgba(255,138,0,.24);
}
.v6 {
  background: #ffffff;
  color: #111827;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.18);
}
.v5 { background: #d1d5db; color: #111827; }
.v4 { background: #9ca3af; color: #111827; }
.v3 { background: #6b7280; color: #ffffff; }
.v2 { background: #374151; color: #ffffff; }
.v1, .v0 { background: #111827; color: #ffffff; }

html.light-mode .v8 {
  background: #ff1f2d;
  color: #ffffff;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.38), 0 0 8px rgba(255,31,45,.18);
}
html.light-mode .v7 {
  background: #ff8a00;
  color: #111827;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.34), 0 0 8px rgba(255,138,0,.16);
}
html.light-mode .v6 {
  background: #ffffff;
  color: #111827;
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.20);
}
html.light-mode .v5 { background: #d1d5db; color: #111827; }
html.light-mode .v4 { background: #9ca3af; color: #111827; }
html.light-mode .v3 { background: #6b7280; color: #ffffff; }
html.light-mode .v2 { background: #374151; color: #ffffff; }
html.light-mode .v1, html.light-mode .v0 { background: #111827; color: #ffffff; }

.matrix-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 12px 0 40px;
}
.leg { display: flex; align-items: center; gap: 7px; }
.lsw { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }

/* ── SECTION DIVIDER ──────────────────────────────────────── */
.section-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 32px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-faint);
}

/* ── SCROLLBAR — violet tinted ────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--violet); }

/* ── FOCUS RING (accessibility) ───────────────────────────── */
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile First
   ═══════════════════════════════════════════════════════════ */

/* ── TABLET (≤768px) ──────────────────────────────────────── */
@media (max-width: 768px) {
  html { font-size: 14px; }
  .page { padding: 0 16px 80px; }

  .topbar { flex-wrap: wrap; gap: 14px; padding: 20px 0 24px; margin-bottom: 32px; }
  .topbar-right { gap: 7px; }
  .logo-img { height: 86px; }
  .brand-slogan { display: none; }

  .input-header { padding: 22px 20px 18px; }
  .input-header-top { flex-direction: column; gap: 12px; }
  .paste-pane, .pdf-pane { padding: 20px 20px 24px; }
  .input-footer { padding: 16px 20px; gap: 12px; }
  .err-box { left: 20px; right: 20px; padding: 10px 36px 10px 14px; font-size: 0.8rem; }
  .score-box { font-size: 0.82rem; }
  .typology-grid { gap: 3px; margin-top: 10px; }

  .riasec-card-top { padding: 20px 22px; gap: 20px; }
  .rcode { font-size: 2.2rem; }
  .rdim { padding: 7px 12px; min-width: 58px; }
  .rdim .dv { font-size: 1.2rem; }
  .riasec-meta { padding: 10px 22px; gap: 16px; font-size: 0.72rem; }

  .otab { padding: 11px 14px; font-size: 0.76rem; }
  .ptoolbar { gap: 6px; }
  .srch { width: 100%; flex-basis: 100%; order: -1; }
  .fsel { font-size: 0.8rem; }

  .dtbl { font-size: 0.82rem; }
  .dtbl td { padding: 9px 12px; }
  .dtbl thead th { padding: 10px 12px; }

  .lt-grid { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 6px; }
}

/* ── PHONE (≤480px) ───────────────────────────────────────── */
@media (max-width: 480px) {
  html { font-size: 14px; }
  .page { padding: 0 12px 70px; }

  .topbar { padding: 16px 0 20px; margin-bottom: 24px; }
  .logo-img { height: 72px; }
  .topbar-badge { display: none; }
  .topbar-version { display: none; }
  .topbar-right { gap: 6px; }
  .mode-toggle { padding: 6px 12px; font-size: 0.68rem; }
  .mode-toggle .mode-label { display: none; }

  .input-header { padding: 18px 16px 14px; }
  .input-title { font-size: 0.95rem; }
  .input-desc { font-size: 0.78rem; }
  .paste-pane, .pdf-pane { padding: 16px 16px 20px; }
  .input-footer { padding: 13px 16px; flex-wrap: wrap; gap: 10px; }
  .err-box { left: 16px; right: 16px; padding: 9px 32px 9px 12px; font-size: 0.78rem; }
  .score-box { font-size: 0.8rem; padding: 13px 15px; min-height: 72px; }
  .run-hint { display: none; }
  .btn-run { padding: 12px 28px; font-size: 0.85rem; width: 100%; justify-content: center; }
  .typology-grid { gap: 3px; margin-top: 10px; }
  .ty-chip { padding: 3px 5px; min-width: 34px; }
  .ty-abbr { font-size: 0.5rem; }
  .ty-score { font-size: 0.65rem; }

  .method-tabs { width: 100%; }
  .mtab { flex: 1; text-align: center; padding: 8px 10px; font-size: 0.72rem; }

  .riasec-card-top {
    padding: 16px 16px;
    gap: 14px;
    flex-direction: column;
    align-items: flex-start;
  }
  .rbar-div { display: none; }
  .rcode { font-size: 2.4rem; letter-spacing: 0.12em; }
  .rdims { gap: 5px; flex-wrap: wrap; }
  .rdim { padding: 6px 10px; min-width: 50px; }
  .rdim .dv { font-size: 1.1rem; }
  .rdim .dl { font-size: 0.58rem; }
  .riasec-meta { padding: 10px 16px; gap: 12px; font-size: 0.68rem; flex-wrap: wrap; }

  .out-tabs { margin-bottom: 18px; gap: 0; }
  .otab { padding: 10px 12px; font-size: 0.72rem; letter-spacing: 0.01em; }
  .tab-pill { padding: 1px 6px; font-size: 0.58rem; }

  .ptoolbar { flex-direction: column; align-items: stretch; gap: 6px; }
  .srch { width: 100%; font-size: 0.875rem; }
  .fsel { font-size: 0.82rem; }
  .tbtn { font-size: 0.75rem; text-align: center; }
  .btn-export { justify-content: center; }

  .dtbl .col-kat,
  .dtbl thead th.col-kat { display: none; }

  .dtbl { font-size: 0.82rem; }
  .dtbl td { padding: 9px 10px; }
  .dtbl thead th { padding: 9px 10px; font-size: 0.62rem; }
  .td-nama { font-size: 0.84rem; }
  .td-dept { font-size: 0.74rem; }

  .fit-track { min-width: 40px; height: 4px; }
  .fit-num { font-size: 0.74rem; min-width: 38px; }

  .pbtn { padding: 6px 11px; font-size: 0.72rem; }

  .lt-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 5px; }
  .lt-card { padding: 10px 14px; }
  .lt-name { font-size: 0.78rem; }
  .lt-badge { font-size: 0.66rem; padding: 3px 8px; }

  .pdf-drop { padding: 24px 20px; }
  .drop-icon { font-size: 2rem; margin-bottom: 10px; }
  .pdf-drop p { font-size: 0.85rem; }

  .matrix-wrap { border-radius: 10px; }
  .mtrx th.col-hdr { font-size: 0.56rem; padding: 10px 5px 6px; min-height: 78px; }
  .mtrx th.row-hdr { font-size: 0.6rem; padding: 6px 10px 6px 12px; width: 100px; }
  .mtrx td.mc { width: 30px; height: 30px; font-size: 0.72rem; }
  .matrix-legend { gap: 12px; font-size: 0.68rem; padding: 10px 0 28px; }
  .lsw { width: 12px; height: 12px; }

  .lbiru-legend { font-size: 0.72rem; padding: 9px 13px; }
}

/* ── SMALL PHONE (≤360px) ─────────────────────────────────── */
@media (max-width: 360px) {
  html { font-size: 13px; }
  .page { padding: 0 10px 60px; }

  .rcode { font-size: 2rem; }
  .rdim { padding: 5px 8px; min-width: 44px; }
  .rdim .dv { font-size: 1rem; }

  .otab { padding: 9px 10px; font-size: 0.7rem; }

  .dtbl { font-size: 0.78rem; }
  .dtbl td { padding: 8px 9px; }
  .td-nama { font-size: 0.8rem; }

  .btn-run { font-size: 0.82rem; padding: 11px 22px; }

  .td-no, .dtbl thead th:first-child { display: none; }
}

/* ── TOUCH DEVICE ─────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .pbtn   { min-height: 40px; padding: 8px 14px; }
  .tbtn   { min-height: 40px; }
  .btn-export { min-height: 40px; }
  .mtab   { min-height: 38px; }
  .otab   { min-height: 44px; }
  .fsel   { min-height: 40px; }
  .srch   { min-height: 44px; padding: 11px 14px; }

  .dtbl tbody tr.row-normal:hover td { background: transparent; }
  .dtbl tbody tr.row-lbiru:hover td  { background: var(--lbiru-bg); }
  .lt-card:hover { border-color: var(--border-soft); background: var(--bg-card); box-shadow: none; }
}

/* ── CAREER DESCRIPTION TOOLTIP ───────────────────────────── */
.career-name {
  position: relative;
  display: inline;
  cursor: help;
  text-decoration: underline dotted rgba(62, 207, 178, .55);
  text-underline-offset: 3px;
}
.career-name:hover {
  color: var(--teal);
}
.career-tooltip {
  position: fixed;
  z-index: 10000;
  width: min(360px, calc(100vw - 24px));
  padding: 13px 15px 14px;
  border-radius: 12px;
  background: var(--bg-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
  box-shadow: 0 14px 38px rgba(0,0,0,.42), 0 0 0 1px rgba(62,207,178,.08);
  font-size: .8rem;
  line-height: 1.55;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(.98);
  transition: opacity .12s ease, transform .12s ease;
}
.career-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.career-tooltip-title {
  color: var(--text-primary);
  font-weight: 800;
  font-size: .86rem;
  line-height: 1.35;
  margin-bottom: 4px;
}
.career-tooltip-code {
  color: var(--teal);
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .03em;
  margin-bottom: 8px;
}
.career-tooltip-desc {
  color: var(--text-secondary);
}
html.light-mode .career-name {
  text-decoration-color: rgba(15, 118, 110, .5);
}
html.light-mode .career-name:hover {
  color: var(--teal);
}
html.light-mode .career-tooltip {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 14px 34px rgba(15,23,42,.16), 0 0 0 1px rgba(15,118,110,.05);
}
@media (hover: none) and (pointer: coarse) {
  .career-name { cursor: help; }
}

/* ── Minimal tooltip affordance patch ─────────────────────── */
.lt-name-tip,
.mtrx-cell-tip {
  cursor: help;
}
.lt-name-tip {
  text-decoration: underline dotted rgba(245, 158, 11, .55);
  text-underline-offset: 3px;
}
.mtrx-cell-tip {
  outline: 1px dotted rgba(255,255,255,.45);
  outline-offset: -3px;
}
