/*!
 * Bayesian Calculator Engine — gaya tampilan (indigo, mengikuti versi pertama)
 * (c) 2026 Alfredo Garcia — MIT License
 */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  /* indigo */
  --brand-950: #1e1b4b;
  --brand-900: #312e81;
  --brand-800: #3730a3;
  --brand-700: #4338ca;
  --brand-600: #4f46e5;
  --brand-500: #6366f1;
  --brand-200: #c7d2fe;
  --brand-100: #e0e7ff;
  --brand-50: #eef2ff;

  /* slate */
  --ink: #182230;
  --ink-2: #475569;
  --muted: #657184;
  --line: #e4e9f1;
  --line-2: #eef1f6;
  --input-line: #cbd5e1;
  --canvas: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --soft: #f1f5f9;
  --soft-hover: #e2e8f0;

  /* status */
  --good: #047857;
  --good-soft: #ecfdf5;
  --good-line: #a7f3d0;
  --bad: #e11d48;
  --bad-ink: #be123c;
  --bad-soft: #fff1f2;
  --bad-line: #fecdd3;
  --warn-soft: #fffbeb;
  --warn-line: #fde68a;
  --warn-ink: #92400e;

  --focus: rgba(99, 102, 241, .27);
  --side-a: var(--brand-600);
  --side-b: #047857;

  --radius-card: 18px;
  --r: 12px;
  --r-sm: 8px;
  --gutter: 32px;
  --shadow-card: 0 8px 26px rgba(15, 23, 42, .045);
  --shadow-card-hover: 0 12px 32px rgba(15, 23, 42, .075);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -.012em;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 88% 2%, rgba(199, 210, 254, .4), transparent 30rem),
    var(--canvas);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.025em; }
h3 { font-size: 14.5px; font-weight: 600; }
h4 { font-size: 13.5px; font-weight: 600; }
p { margin: 0; }
a { color: var(--brand-600); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { -webkit-tap-highlight-color: transparent; }
::selection { color: #fff; background: var(--brand-600); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 12px; background: var(--surface); border-radius: var(--r-sm); }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- Header (gradasi indigo) ---------------- */

.hero {
  background: linear-gradient(118deg, #24205e 0%, #3730a3 52%, #5145d8 100%);
  color: #fff;
  box-shadow: 0 12px 34px rgba(49, 46, 129, .18);
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  margin-bottom: 8px;
}
.hero-row { max-width: 1320px; margin: 0 auto; padding: 26px var(--gutter) 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-title { font-size: clamp(27px, 4vw, 38px); font-weight: 700; letter-spacing: -.045em; line-height: 1.15; }
.hero-sub { margin-top: 8px; color: var(--brand-100); max-width: 46rem; line-height: 1.65; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-project { padding-top: 18px; gap: 12px; justify-content: flex-start; }
.title-field { display: flex; align-items: center; gap: 10px; flex: 1 1 320px; max-width: 560px; min-width: 0; }
.title-field > span { font-size: 13px; font-weight: 500; color: var(--brand-200); flex: none; }
.hero .title-field input[type="text"] {
  width: 100%; min-height: 38px; padding: 7px 12px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28); border-radius: var(--r-sm);
  color: #fff; font-weight: 600; text-overflow: ellipsis; box-shadow: none;
}
.hero .title-field input[type="text"]:hover { border-color: rgba(255, 255, 255, .45); }
.hero .title-field input[type="text"]:focus { background: rgba(255, 255, 255, .18); border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); outline: none; }
.hero .title-field input[readonly] { pointer-events: none; }
.save-state { color: var(--brand-200); font-size: 12.5px; white-space: nowrap; }

.steps { max-width: 1320px; margin: 0 auto; padding: 16px var(--gutter) 18px; }
.steps ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.steps ol::-webkit-scrollbar { display: none; }
.step {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid transparent; background: none; cursor: pointer;
  padding: 7px 16px 7px 8px; border-radius: 999px;
  color: var(--brand-100); font-weight: 500; font-size: 14px; white-space: nowrap;
  transition: background-color .16s ease, color .16s ease;
}
.step-no {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .45); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.step:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.step.on { background: #fff; color: var(--brand-900); font-weight: 600; box-shadow: 0 4px 14px rgba(30, 27, 75, .25); }
.step.on .step-no { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.resp-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .35); font-weight: 600; color: #fff; }

/* ---------------- Tata letak ---------------- */

main { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 24px var(--gutter) 56px; display: flex; flex-direction: column; gap: 24px; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 12px; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 72ch; font-size: 14.5px; }
.step-badge { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-600); color: #fff; font-size: 15px; font-weight: 700; flex: none; letter-spacing: 0; }
.head-ctrls { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 20px 22px;
  min-width: 0;
  transition: box-shadow .2s ease;
}
.panel:hover { box-shadow: var(--shadow-card-hover); }
.panel > .panel-head:first-child {
  margin: -20px -22px 18px;
  padding: 15px 22px;
  background: linear-gradient(90deg, #fafbff 0%, #f5f6ff 100%);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: 12.5px; }
.note { color: var(--ink-2); font-size: 13.5px; margin-top: 10px; max-width: 90ch; }
.note .ic { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.note.warn { color: var(--bad-ink); }
.empty { color: var(--muted); padding: 10px 0; list-style: none; }
.empty-state { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.step-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 4px; }

/* ---------------- Tombol & isian ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; min-height: 40px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--soft); color: #334155;
  font-weight: 500; font-size: 14px; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--soft-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand-600); color: #fff; box-shadow: 0 4px 10px -2px rgba(79, 70, 229, .35); }
.btn.primary:hover { background: var(--brand-700); }
.btn.danger { background: #f43f5e; color: #fff; }
.btn.danger:hover { background: var(--bad); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--soft); color: var(--ink); }
.btn.glass { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .4); color: #fff; font-weight: 600; box-shadow: none; backdrop-filter: blur(4px); }
.btn.glass:hover { background: rgba(255, 255, 255, .3); }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.btn.sm .ic { width: 15px; height: 15px; }
.btn.lg { min-height: 46px; padding: 11px 22px; font-size: 15px; }
.btn.icon-only { padding: 8px; min-width: 40px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid transparent; border-radius: var(--r-sm); background: none; color: #94a3b8; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--soft); color: var(--ink); }
.icon-btn.danger:hover:not(:disabled) { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn .ic { width: 17px; height: 17px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand-600); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.row-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.field.inline { min-width: 190px; }
input[type="text"], select, textarea {
  width: 100%;
  border: 1px solid var(--input-line);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 9px 12px;
  min-height: 40px;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { resize: vertical; }
select { cursor: pointer; padding-right: 30px; }
input[type="text"]:hover, select:hover, textarea:hover { border-color: #a5b4fc; }
input[type="text"]:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--focus); }
input.invalid { border-color: var(--bad) !important; box-shadow: 0 0 0 3px rgba(225, 29, 72, .18) !important; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.check input { width: 16px; height: 16px; accent-color: var(--brand-600); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--ink-2); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag.bad { color: var(--bad-ink); background: var(--bad-soft); }

.seg { display: inline-flex; border-radius: 10px; padding: 3px; background: var(--soft); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 13px; border-radius: 8px; font-weight: 500; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--brand-700); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }


/* ---------------- Diagram ---------------- */

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.chart-card {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: 18px 18px 14px; min-width: 0; transition: box-shadow .2s ease;
}
.chart-card:hover { box-shadow: var(--shadow-card-hover); }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card figcaption { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); }
.chart-cap h3 { font-size: 14.5px; }
.chart-cap p { color: var(--muted); font-size: 12.5px; margin-top: 3px; max-width: 70ch; }
.chart-tools { display: flex; gap: 2px; flex-wrap: wrap; max-width: 100%; }
.chart-svg { width: 100%; }
.chart-svg svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.chart-svg.scroll { overflow-x: auto; }
.chart-svg.scroll svg { max-width: none; }
.chart-svg [data-tip] { cursor: default; }
.chart-table { margin-top: 12px; }

.table-wrap { position: relative; overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r); }
table.data { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
table.data tr:last-child th, table.data tr:last-child td { border-bottom: 0; }
table.data thead th { font-size: 12px; color: #334155; font-weight: 600; border-bottom: 1px solid var(--line); background: var(--soft); }
table.data tbody th { font-weight: 600; color: var(--ink); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num { text-align: right; }


/* ---------------- Langkah 3: Hasil ---------------- */

.verdict { border-radius: var(--r); border: 1px solid var(--good-line); background: var(--good-soft); padding: 20px 22px; color: #064e3b; }
.verdict-kicker { font-weight: 600; font-size: 13.5px; color: #065f46; }
.verdict-main { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-top: 2px; }
.verdict-name { font-size: clamp(26px, 3.6vw, 36px); font-weight: 700; letter-spacing: -.04em; line-height: 1.15; color: var(--ink); }
.verdict-val { font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; color: var(--good); }
.verdict-sub { color: #065f46; margin-top: 6px; max-width: 75ch; font-size: 14px; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--r); border: 1px solid; font-size: 14px; }
.banner .ic { margin-top: 2px; }
.banner ul { margin: 6px 0 0; padding-left: 18px; }
.banner.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
.banner.info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-900); }

/* ---------------- Langkah 4: Sensitivitas ---------------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 16px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--brand-700); font-weight: 600; border-bottom-color: var(--brand-600); }
.sens-body { display: flex; flex-direction: column; gap: 14px; }
.sens-body .chart-card { border: 0; padding: 0; box-shadow: none; }
.ctrl-row { display: flex; gap: 12px; flex-wrap: wrap; }
.lead { font-size: 15px; max-width: 80ch; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--brand-600) var(--v, 0%), var(--brand-100) var(--v, 0%)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--brand-600) var(--v, 0%), var(--brand-100) var(--v, 0%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand-600); box-shadow: 0 1px 4px rgba(79, 70, 229, .35); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand-600); }

/* ---------------- Langkah 5: Laporan ---------------- */

.dl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.dl-card {
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start; text-align: left;
  padding: 18px; border-radius: var(--radius-card); border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-card); cursor: pointer; color: var(--ink); transition: box-shadow .2s, border-color .2s;
}
.dl-card:hover { box-shadow: var(--shadow-card-hover); border-color: var(--brand-200); }
.dl-card:disabled { opacity: .6; cursor: progress; }
.dl-card.primary { border: 2px solid var(--brand-500); }
.dl-ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); }
.dl-card.primary .dl-ic { background: var(--brand-600); color: #fff; }
.dl-ic .ic { width: 22px; height: 22px; }
.dl-text { display: flex; flex-direction: column; gap: 4px; }
.dl-text b { font-size: 15px; font-weight: 600; }
.dl-text span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.share-row input { flex: 1 1 260px; font-size: 13px; color: var(--ink-2); }
.cite blockquote { margin: 10px 0 12px; padding: 14px 18px; border-left: 4px solid var(--brand-500); background: var(--brand-50); border-radius: 0 var(--r) var(--r) 0; font-size: 14px; overflow-wrap: anywhere; color: var(--brand-950); }


/* ---------------- Modal, toast, tooltip ---------------- */

.modal { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .6); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .3s; }
.modal.open { opacity: 1; }
.modal-card { position: relative; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 18px; padding: 24px; border: 1px solid rgba(255, 255, 255, .65); box-shadow: 0 25px 50px -12px rgba(15, 23, 42, .35); transform: scale(.97); transition: transform .3s; }
.modal.open .modal-card { transform: none; }
.modal-card.wide { max-width: 860px; }
.modal-x { position: absolute; top: 14px; right: 14px; }
.modal-title { font-size: 20px; font-weight: 700; margin-right: 40px; letter-spacing: -.03em; }
.modal-text { margin-top: 10px; color: var(--ink-2); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.help { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.help h3 { margin-top: 10px; color: var(--ink); }
.help p, .help li { color: var(--ink-2); max-width: 78ch; font-size: 14px; }
.help ol { margin: 0; padding-left: 20px; }
.sample-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sample { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; color: var(--ink); transition: border-color .15s, background-color .15s; }
.sample:hover { border-color: var(--brand-500); background: var(--brand-50); }
.sample b { font-weight: 600; }
.sample span { color: var(--muted); font-size: 13.5px; }

.toasts { position: fixed; top: 20px; right: 20px; z-index: 80; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; width: min(30rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-sm); background: #10b981; color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 10px 15px -3px rgba(15, 23, 42, .2); pointer-events: auto; animation: toast-in .3s ease; transition: opacity .3s, transform .3s; }
.toast.error { background: #f43f5e; }
.toast.out { opacity: 0; transform: translateX(110%); }
.toast-act { border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .15); color: #fff; border-radius: 6px; padding: 3px 10px; font-weight: 600; cursor: pointer; margin-left: 6px; }
@keyframes toast-in { from { opacity: 0; transform: translateX(110%); } to { opacity: 1; transform: none; } }

.tip { position: fixed; z-index: 90; max-width: 300px; padding: 8px 11px; border-radius: var(--r-sm); background: #0f172a; color: #fff; font-size: 12.5px; line-height: 1.45; pointer-events: none; white-space: pre-line; box-shadow: 0 6px 18px rgba(15, 23, 42, .25); font-variant-numeric: tabular-nums; }

body.dropping::after { content: 'Lepaskan berkas proyek (.json, .xdsl, .bif) atau data (.csv) di sini'; position: fixed; inset: 12px; z-index: 95; display: grid; place-items: center; border: 3px dashed var(--brand-500); border-radius: 18px; background: rgba(238, 242, 255, .92); color: var(--brand-900); font-weight: 700; font-size: 18px; }

.foot { max-width: 1320px; width: 100%; margin: 0 auto; padding: 18px var(--gutter) 28px; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.foot a { color: var(--ink-2); }


/* ---------------- Elemen khas versi pertama ---------------- */

.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 700; color: var(--brand-200); margin-bottom: 8px; }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--brand-50); border: 1px solid #dbe3ff; color: var(--brand-900); font-size: 13.5px; line-height: 1.65; }
.small { font-size: 12.5px; color: var(--muted); line-height: 1.65; margin-top: 12px; }
.bad-text { color: var(--bad-ink); font-weight: 600; }
.ok-text { color: var(--good); }
.note.ok-text { color: var(--good); }
.btn.soft { background: var(--brand-50); color: var(--brand-800); box-shadow: none; font-weight: 600; }
.btn.soft:hover { background: var(--brand-100); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.toolbar.first { margin-top: 0; }
.side-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings > .field:first-child { grid-column: 1 / -1; }
.settings.two > .field:first-child { grid-column: auto; }
.settings > .field.full { grid-column: 1 / -1; }
table.data thead th.num { text-align: right; }
.field .static { min-height: 40px; display: flex; align-items: center; color: var(--ink-2); font-weight: 500; }
.row-no { min-width: 26px; text-align: right; color: #94a3b8; font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; }
.row-actions { display: flex; gap: 2px; align-items: center; }
.steps .step.has-warn .step-no { border-color: #fcd34d; }
.steps .step.has-warn:not(.on) .step-no { background: rgba(252, 211, 77, .25); }

/* ---------------- Langkah 3: Hasil ---------------- */

.summary.verdict { border-color: var(--good-line); }
.sm-only { display: none; }
table.data tr.best { background: var(--good-soft); }
table.data tr.best th, table.data tr.best td { font-weight: 700; }
table.data tbody tr.best:hover { background: #d1fae5; }
.bar-cell { width: 30%; min-width: 110px; vertical-align: middle !important; }
.bar { height: 9px; background: #e2e8f0; border-radius: 99px; overflow: hidden; min-width: 75px; }
.bar span { height: 100%; display: block; background: linear-gradient(90deg, #6366f1, #8b5cf6); border-radius: 99px; }
.chart-grid.one { grid-template-columns: minmax(0, 1fr); }
.chart-card.plain { border: 0; padding: 0; box-shadow: none; }
.chart-card.plain:hover { box-shadow: none; }
.note + .chart-card.plain { margin-top: 16px; }
.chart-card.plain + .table-wrap { margin-top: 14px; }

table.data .sum-row th, table.data .sum-row td { background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--line); }
table.data.compact th, table.data.compact td { padding: 6px 9px; font-size: 12.5px; }
table.data.compact small { color: var(--muted); font-weight: 500; }

/* ---------------- Langkah 4: Sensitivitas ---------------- */

.sub-h { margin: 22px 0 10px; }
.banner.ok { background: var(--good-soft); border-color: var(--good-line); color: #065f46; }
.sens-body .table-wrap + .row-buttons { margin-top: 10px; }
.sens-body { padding-top: 18px; }

/* ---------------- Tempel, bantuan ---------------- */

.guide-example { padding: 13px 15px; border: 1px solid var(--brand-200); border-radius: 11px; background: var(--brand-50); color: var(--brand-900); font-size: 14px; }
.dl-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.metric { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 14px; }
.metric > div { padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.metric small { color: var(--muted); display: block; font-size: 12.5px; }
.metric strong { font-size: 19px; color: var(--brand-800); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric span { color: var(--ink-2); font-size: 12px; overflow-wrap: anywhere; }
.metric strong.ok-text { color: var(--good); }
.metric strong.bad-text { color: var(--bad-ink); }
.warn-text { color: var(--warn-ink); font-weight: 600; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
code { background: var(--soft); border-radius: 5px; padding: 1px 5px; color: var(--brand-900); }
table.matrix { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
table.matrix th, table.matrix td { padding: 5px 6px; text-align: left; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); vertical-align: middle; }
table.matrix tr:last-child th, table.matrix tr:last-child td { border-bottom: 0; }
table.matrix thead th { font-size: 12px; font-weight: 600; color: #334155; background: #f1f3ff; padding: 6px; }
table.matrix tbody th { font-size: 13px; font-weight: 600; background: var(--surface-2); padding: 6px 10px; white-space: nowrap; }
table.matrix thead th { max-width: none; }
.win-list { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); }
table.data td.win { background: var(--good-soft); color: var(--good); font-weight: 700; }
table.data .act-col { width: 1%; }
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.seg button .ic { width: 16px; height: 16px; }

/* ================================================================== *
 * Khusus jaringan Bayes
 * ================================================================== */

.settings-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-top: -8px; }
.settings-bar .field.inline { min-width: 150px; }
.model-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); gap: 24px; align-items: start; }
.canvas-col, .editor-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.canvas-col .chart-card { position: sticky; top: 12px; }
.net-svg { overflow: auto; max-height: 76vh; border-radius: 10px; background: #fbfcfe; }
.net-svg svg { display: block; margin: 0 auto; }
.net-svg [data-node] { touch-action: none; }
.net-svg [data-node]:hover rect:first-of-type { filter: drop-shadow(0 2px 6px rgba(15, 23, 42, .12)); }
.btn.ghost.on { background: #fef3c7; color: #92400e; }
.danger-text { color: var(--bad-ink) !important; }

.node-editor .field + .ed-grid { margin-top: 14px; }
.node-editor .row-buttons + .field, .node-editor .ed-grid + .field { margin-top: 18px; }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.state-row { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.state-row input { flex: 1; min-width: 0; min-height: 36px; padding: 6px 10px; }
.state-row .icon-btn { width: 30px; height: 30px; }
.pill-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid #e2e8f0; border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check-pill input { accent-color: var(--brand-600); width: 15px; height: 15px; margin: 0; }
.check-pill:has(input:checked) { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-900); font-weight: 600; }
.check-pill.disabled { opacity: .45; cursor: not-allowed; }
.sub-h { font-size: 13.5px; color: var(--brand-900); margin: 18px 0 8px; }
.ed-grid .sub-h { margin-top: 4px; }

table.matrix.cpt { width: 100%; }
table.matrix.cpt th, table.matrix.cpt td { padding: 4px 5px; }
table.matrix.cpt thead th { white-space: nowrap; text-align: left; }
table.matrix.cpt thead th.num { text-align: right; }
table.matrix.cpt th.pcol { background: var(--surface-2); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
table.matrix.cpt thead th.pcol { background: #e9ecfb; }
table.matrix.cpt td input { width: 100%; min-width: 72px; min-height: 34px; padding: 5px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.cpt-wrap { max-height: 460px; overflow: auto; }
.rsum { font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.rsum.ok { color: var(--good); }
.rsum.bad { color: var(--bad-ink); }
table.matrix .act-col { width: 1%; white-space: nowrap; background: var(--surface-2); }

.infer-grid { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 24px; align-items: start; }
.main-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ev-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.ev-list { display: flex; flex-direction: column; gap: 8px; }
.ev-item { display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; }
.ev-item label { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.ev-item select { min-height: 36px; padding: 6px 28px 6px 10px; font-size: 13.5px; }
.ev-item.set { background: #fff7ed; box-shadow: inset 3px 0 0 #d97706; }
.soft-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.soft-row label { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; font-weight: 500; color: var(--muted); width: 88px; }
.soft-row input { min-height: 32px; padding: 4px 8px; text-align: right; }
.target-panel .ctrl-row { margin-bottom: 14px; }
.verdict-val.big { font-size: clamp(34px, 5vw, 48px); letter-spacing: -.04em; }
.verdict-from { color: #065f46; font-weight: 600; font-size: 14px; }
.tag.ev { background: #ffedd5; color: #9a3412; font-weight: 600; }
.tag.tg { background: var(--brand-50); color: var(--brand-800); font-weight: 600; }
table.data tr.grp th[rowspan] { vertical-align: top; border-right: 1px solid var(--line-2); min-width: 160px; }
table.data tr.evrow td { background: #fffbf5; }
table.data tr.grp td, table.data tr.grp th { border-top: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.table-wrap.tall { max-height: 460px; overflow: auto; }
.small-cell { font-size: 12.5px; color: var(--ink-2); max-width: 340px; }
table.data th input { min-height: 32px; padding: 4px 8px; font-weight: 600; min-width: 140px; }

table.matrix.util { width: 100%; }
table.matrix.util thead th { white-space: normal; min-width: 120px; vertical-align: bottom; }
table.matrix.util .combo { display: block; font-weight: 600; font-size: 12px; line-height: 1.35; }
table.matrix.util small { display: block; font-weight: 500; font-size: 11.5px; margin-top: 2px; }
table.matrix.util td input { width: 100%; min-width: 90px; text-align: right; min-height: 34px; padding: 5px 8px; }
table.matrix.util tbody th input { min-width: 150px; min-height: 34px; padding: 5px 8px; font-weight: 600; }
.settings.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 0; }
.settings.three > .field:first-child { grid-column: auto; }
.field > .label { font-size: 12.5px; font-weight: 500; color: var(--muted); display: block; margin-bottom: 8px; }

.dl-card.static { cursor: default; }
.dl-card.static:hover { border-color: var(--line); }
.sim-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.sim-row label { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); }
.sim-row input { width: 80px; min-height: 32px; padding: 4px 8px; text-align: right; }
.sub-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
table.data.compact th, table.data.compact td { padding: 6px 9px; font-size: 12.5px; white-space: nowrap; }

@media (max-width: 1180px) {
  .model-grid { grid-template-columns: minmax(0, 1fr); }
  .canvas-col .chart-card { position: static; }
  .infer-grid { grid-template-columns: minmax(0, 1fr); }
  .ev-panel { position: static; max-height: none; }
  .ev-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (max-width: 720px) {
  .ed-grid, .two-col, .settings.three { grid-template-columns: minmax(0, 1fr); }
  .ev-list { display: flex; }
  .ev-item { grid-template-columns: minmax(0, 1fr) 168px; }
  .settings-bar .field.inline { min-width: 0; flex: 1 1 140px; }
  .net-svg { max-height: 60vh; }
  .verdict-main { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* ---------------- Responsif ---------------- */

@media (max-width: 920px) {
  :root { --gutter: 18px; }
  .chart-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  :root { --gutter: 14px; }
  body { font-size: 14.5px; }
  h1 { font-size: 22px; }
  .hero-row { padding-top: 20px; }
  .hero-title { font-size: 27px; }
  .hero-sub { font-size: 14px; }
  .hero-actions { gap: 6px; }
  .btn.glass { padding: 7px 11px; min-height: 36px; font-size: 13px; }
  .save-state { display: none; }
  .title-field { flex-basis: 100%; }
  main { padding-top: 18px; gap: 18px; }
  .panel { padding: 16px; }
  .panel > .panel-head:first-child { margin: -16px -16px 16px; padding: 13px 16px; }
  .step { padding: 6px 12px 6px 6px; font-size: 13.5px; }
  .settings, .settings.two { grid-template-columns: minmax(0, 1fr); }
  .toolbar .btn { flex: 1 1 auto; }
  .dl-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-card { padding: 14px 12px 10px; }
  .chart-tools .btn { padding: 4px 8px; }
  .head-ctrls { width: 100%; }
  .step-foot { flex-wrap: wrap; }
  .step-foot .btn.lg { flex: 1 1 auto; }
  .toasts { top: auto; bottom: 16px; right: 12px; }
  .formula { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  @page { size: A4 portrait; margin: 14mm; }
  body { background: #fff; }
  .hero, .foot, .chart-tools, .step-foot, .toasts, .tip, .modal, .toolbar, .row-buttons, .cs-head .btn, .head-ctrls { display: none !important; }
  .panel, .chart-card { break-inside: avoid; border-color: #ccc; box-shadow: none; }
}
