/*!
 * AHP Decision Engine — gaya tampilan
 * (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: 30px; font-weight: 700; letter-spacing: -.045em; line-height: 1.15; }
.hero-sub { margin-top: 8px; color: var(--brand-100); max-width: 42rem; 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); }

/* ---------------- Langkah 1: Model ---------------- */

.model-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.goal-field { margin-bottom: 16px; }
.goal-field input { font-weight: 600; font-size: 15px; }

.tree { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tree-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 96px auto;
  align-items: center;
  gap: 8px;
  padding-left: calc((var(--depth) - 1) * 26px);
}
.tree-guide { width: 14px; height: 40px; position: relative; }
.tree-guide::before { content: ''; position: absolute; left: 3px; top: -8px; bottom: 50%; border-left: 2px solid var(--input-line); border-bottom: 2px solid var(--input-line); width: 10px; border-bottom-left-radius: 6px; }
.tree-row[style*="--depth:1"] .tree-guide::before { border-left-color: #a5b4fc; border-bottom-color: #a5b4fc; }
.tree-name { font-weight: 500; grid-column: 2; }
.tree-row .tag { grid-column: 3; justify-self: start; }
.tree-actions { grid-column: 4; display: flex; gap: 1px; }

.list { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-row > input[type="text"] { flex: 1 1 160px; }
.row-no { width: 22px; text-align: right; color: #94a3b8; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 600; }
.row-actions { display: flex; gap: 2px; align-items: center; margin-left: auto; }
.part-row { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.part-row:last-child { border-bottom: 0; }
.mini-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.mini-field input { width: 58px !important; text-align: center; min-height: 34px; padding: 4px 6px; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings .field:first-child, .settings .field:last-child { grid-column: 1 / -1; }

/* ---------------- 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; }
.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 { 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 2: Penilaian ---------------- */

.progress-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.meter { display: inline-block; width: 170px; height: 7px; border-radius: 4px; background: var(--brand-100); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--brand-600); border-radius: 4px; transition: width .2s; }

.judge-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
.set-nav { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.set-select { display: none; }
.set-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.set-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  padding: 9px 10px 9px calc(10px + var(--d) * 10px);
  border: 1px solid transparent; border-radius: 10px; background: none; cursor: pointer; color: var(--ink);
  transition: background-color .15s, border-color .15s;
}
.set-item:hover { background: var(--surface); border-color: var(--line); }
.set-item.on { background: var(--surface); border-color: var(--brand-200); box-shadow: inset 3px 0 0 var(--brand-600), var(--shadow-card); }
.set-text { display: flex; flex-direction: column; min-width: 0; }
.set-title { font-weight: 500; font-size: 13.5px; line-height: 1.3; }
.set-item.on .set-title { font-weight: 600; color: var(--brand-900); }
.set-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.st { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; flex: none; margin-top: 1px; }
.st .ic { width: 12px; height: 12px; stroke-width: 3; }
.st-ok { background: #d1fae5; color: var(--good); }
.st-bad { background: #ffe4e6; color: var(--bad); }
.st-part { background: #fef3c7; color: #b45309; }
.st-empty { background: var(--soft); color: #94a3b8; border: 1px dashed var(--input-line); }

.panel.workspace { padding: 0; overflow: hidden; }
.ws-head { padding: 18px 22px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #fafbff 0%, #f5f6ff 100%); }
.crumb { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.question { margin-top: 6px; color: var(--ink-2); font-size: 14.5px; }
.ws-switches { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ws-body { padding: 6px 22px 16px; }
.ws-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }

.scale-legend { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; color: var(--muted); font-size: 12px; padding: 12px 0 2px; }
.scale-legend span:last-child { text-align: right; }

/* Baris perbandingan */
.cmp {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(390px, 3.4fr) minmax(72px, 1fr);
  grid-template-areas: "a scale b" "read read read";
  align-items: center;
  gap: 4px 14px;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--line-2);
}
.cmp:last-child { border-bottom: 0; }
.cmp-name { font-weight: 600; font-size: 14px; line-height: 1.3; overflow-wrap: break-word; hyphens: auto; }
.cmp-name.a { grid-area: a; text-align: right; }
.cmp-name.b { grid-area: b; text-align: left; }
.cmp-read { grid-area: read; text-align: center; font-size: 13.5px; color: var(--ink-2); }
.cmp-read b { color: var(--ink); font-weight: 600; }
.cmp-read .num { color: var(--muted); }
.cmp-scale {
  grid-area: scale;
  --side-color: var(--ink-2);
  position: relative;
  display: grid;
  grid-template-columns: repeat(17, minmax(0, 1fr));
  align-items: center;
  height: 40px;
}
.cmp-scale[data-side="a"] { --side-color: var(--side-a); }
.cmp-scale[data-side="b"] { --side-color: var(--side-b); }
.cmp-scale::before { content: ''; position: absolute; left: 2.9%; right: 2.9%; top: 50%; height: 2px; transform: translateY(-50%); background: var(--line); border-radius: 1px; }
.cmp-scale::after {
  content: ''; position: absolute; top: 50%; height: 6px; transform: translateY(-50%);
  left: var(--fl, 50%); width: var(--fw, 0%); background: var(--side-color); border-radius: 3px;
  transition: left .18s ease, width .18s ease;
}
.tick { position: relative; z-index: 1; display: flex; justify-content: center; align-items: center; height: 100%; cursor: pointer; }
.tick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tick span {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--input-line);
  font-size: 12px; font-weight: 600; color: #64748b; font-variant-numeric: tabular-nums;
  transition: transform .12s ease, background-color .12s, border-color .12s, color .12s;
  pointer-events: none;
}
.tick.even span { width: 18px; height: 18px; font-size: 10px; font-weight: 500; }
.tick.side-c span { width: 28px; height: 28px; border-color: #94a3b8; color: var(--ink); }
.tick:hover span { border-color: var(--brand-500); color: var(--brand-700); }
.tick.side-a input:checked + span { background: var(--side-a); border-color: var(--side-a); color: #fff; transform: scale(1.18); }
.tick.side-b input:checked + span { background: var(--side-b); border-color: var(--side-b); color: #fff; transform: scale(1.18); }
.tick.side-c input:checked + span { background: var(--brand-950); border-color: var(--brand-950); color: #fff; transform: scale(1.1); }
.tick input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.cmp-scale[data-side="a"] .tick.in span { background: var(--brand-50); border-color: #818cf8; color: var(--brand-700); }
.cmp-scale[data-side="b"] .tick.in span { background: var(--good-soft); border-color: #34d399; color: var(--good); }
.cmp.unset .cmp-name { color: var(--ink-2); }

/* Matriks */
table.matrix { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.matrix th, table.matrix td { padding: 5px; text-align: center; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); min-width: 80px; }
table.matrix thead th { font-size: 12px; font-weight: 600; color: #334155; background: var(--soft); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 6px; }
table.matrix tbody th { text-align: left; font-size: 13px; font-weight: 600; background: var(--surface-2); max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px 12px; }
table.matrix td.diag { color: #94a3b8; background: var(--soft); font-weight: 600; }
table.matrix td.recip { color: var(--brand-700); background: var(--brand-50); font-weight: 600; font-size: 13px; }
table.matrix td input { width: 72px; min-height: 34px; text-align: center; padding: 4px; font-weight: 600; }
table.matrix td.hot { box-shadow: inset 0 0 0 2px #f59e0b; background: var(--warn-soft); }

/* Data nyata */
.data-head { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding: 14px 0; }
.data-entry input { max-width: 180px; text-align: right; }
.data-entry td, .data-entry th { vertical-align: middle !important; }

/* Panel hidup */
.live { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.prio-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.prio-bars li { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13.5px; }
.prio-bars.big li { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 58px; font-size: 14px; }
.pb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.pb-bar { height: 10px; background: var(--brand-50); border-radius: 5px; overflow: hidden; }
.pb-bar i { display: block; height: 100%; background: var(--brand-600); border-radius: 0 5px 5px 0; transition: width .2s ease; }
.pb-val { text-align: right; font-weight: 700; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

.cr-box { border-radius: var(--r); padding: 14px 16px; border: 1px solid; }
.cr-box.ok { background: var(--good-soft); border-color: var(--good-line); }
.cr-box.bad { background: var(--bad-soft); border-color: var(--bad-line); }
.cr-main { display: flex; align-items: baseline; justify-content: space-between; }
.cr-label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.cr-val { font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.cr-box.ok .cr-val, .cr-box.ok .cr-status { color: var(--good); }
.cr-box.bad .cr-val, .cr-box.bad .cr-status { color: var(--bad-ink); }
.cr-status { display: flex; gap: 6px; font-size: 13px; margin-top: 2px; }
.cr-status .ic { width: 16px; height: 16px; margin-top: 2px; }
.cr-detail { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; font-size: 12.5px; }
.cr-detail dt, .cr-detail dd { white-space: nowrap; }
.cr-detail div { display: flex; gap: 5px; }
.cr-detail dt { color: var(--muted); }
.cr-detail dd { margin: 0; font-weight: 600; }

.suggest h4 { margin-bottom: 8px; }
.suggest ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.suggest li span { display: block; }
.suggest li .btn { margin-top: 5px; }

/* ---------------- 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; }
.dyn { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.dyn-col h3 { margin-bottom: 12px; }
.dyn-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 58px; gap: 10px; align-items: center; padding: 6px 0; }
.dyn-row label { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dyn-row .num { text-align: right; font-weight: 700; }
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; }
.howto { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--ink-2); max-width: 80ch; }
.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); }
.import-box { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-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); }

/* ---------------- Responden ---------------- */

.resp-intro { display: flex; flex-direction: column; gap: 10px; }
.resp-intro .field { max-width: 420px; }
.submit { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.submit .field { max-width: 420px; }

/* ---------------- 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, jawaban responden, atau 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); }

/* Diagram performa dapat diseret: cegah gulir halaman saat menyeret batang di layar sentuh */
[data-svg="sens-perf"] svg { touch-action: none; cursor: ns-resize; }

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

@media (max-width: 1180px) {
  .judge-grid { grid-template-columns: 230px minmax(0, 1fr); }
  .live { grid-column: 2; position: static; }
  .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  :root { --gutter: 18px; }
  .model-grid, .chart-grid, .dyn { grid-template-columns: minmax(0, 1fr); }
  .judge-grid { grid-template-columns: minmax(0, 1fr); }
  .live { grid-column: auto; }
  .set-nav { position: static; max-height: none; overflow: visible; }
  .set-list { display: none; }
  .set-select { display: flex; }
}

@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: 25px; }
  .hero-sub { font-size: 14px; }
  .hero-actions, .top-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; }
  .ws-head, .ws-body { padding-left: 14px; padding-right: 14px; }
  .ws-foot { padding: 12px 14px; }
  .ws-foot .muted { display: none; }
  .cmp { grid-template-columns: 1fr 1fr; grid-template-areas: "a b" "scale scale" "read read"; gap: 6px 10px; }
  .cmp-name.a { text-align: left; }
  .cmp-name.b { text-align: right; }
  .cmp-scale { grid-template-columns: 1.5fr .75fr 1.5fr .75fr 1.5fr .75fr 1.5fr .75fr 1.6fr .75fr 1.5fr .75fr 1.5fr .75fr 1.5fr .75fr 1.5fr; height: 44px; }
  .tick span { width: 24px; height: 24px; font-size: 11.5px; }
  .tick.even span { width: 12px; height: 12px; font-size: 0; }
  .tick.side-c span { width: 28px; height: 28px; }
  .tick.even input:checked + span { width: 22px; height: 22px; font-size: 10.5px; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .tree-row { padding-left: calc((var(--depth) - 1) * 14px); grid-template-columns: auto minmax(0, 1fr); }
  .tree-row .tag { display: none; }
  .tree-actions { grid-column: 2; justify-content: flex-end; margin-top: -2px; }
  .dl-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-card { padding: 14px 12px 10px; }
  .chart-tools .btn { padding: 4px 8px; }
  .head-ctrls, .head-ctrls .field.inline, .page-head > .field.inline { width: 100%; }
  .step-foot { flex-wrap: wrap; }
  .step-foot .btn.lg { flex: 1 1 auto; }
  .toasts { top: auto; bottom: 16px; right: 12px; }
}

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

@media print {
  body { background: #fff; }
  .hero, .foot, .chart-tools, .step-foot, .toasts, .tip, .modal { display: none !important; }
  .panel, .chart-card { break-inside: avoid; border-color: #ccc; box-shadow: none; }
}
