/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #0f1b2d;
  --navy: #13243f;
  --muted: #5b6b82;
  --line: #e2e7ef;
  --input: #eef4ff;
  --input-line: #c9d9f5;
  --accent: #f26b1d;
  --accent-ink: #ffffff;
  --A: #2f6fed;
  --B: #e5484d;
  --C: #18a058;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.04), 0 4px 16px rgba(15, 27, 45, 0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 6px 0 0; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.loading { min-height: 100vh; }

/* ───── Header ───── */
.top { background: var(--navy); color: #fff; position: -webkit-sticky; position: sticky; top: 0; z-index: 20; }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 20px; }
.brand { font-weight: 800; display: flex; align-items: center; gap: 8px; cursor: pointer; white-space: nowrap; }
.logo { color: var(--accent); font-size: 18px; }
.stepper { display: flex; gap: 4px; flex: 1 1; justify-content: center; }
.stepper button {
  background: transparent; border: 0; color: #9fb0cc; display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px;
}
.stepper button:disabled { opacity: 0.4; cursor: default; }
.stepper button.on { background: rgba(255, 255, 255, 0.1); color: #fff; }
.stepper button.done { color: #d7e1f2; }
.stepper .dot {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px;
  background: rgba(255, 255, 255, 0.12);
}
.stepper button.on .dot { background: var(--accent); color: #fff; }
.stepper button.done .dot { background: var(--C); color: #fff; }
.running {
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); color: #fff;
  border-radius: 10px; padding: 4px 12px; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2;
}
.running span { font-size: 11px; color: #9fb0cc; }
.running b { font-size: 16px; }

main { max-width: 1240px; margin: 0 auto; padding: 28px 20px 40px; }
.step.narrow { max-width: 780px; margin: 0 auto; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 20px 30px; }

/* ───── Generic ───── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font-weight: 600; transition: 0.15s; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.primary:disabled { opacity: 0.4; cursor: default; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: #b9c6d9; }
.btn.danger-ghost { background: transparent; color: #b4232a; }
.btn.small { padding: 6px 12px; font-size: 13px; background: var(--navy); color: #fff; }
.link { background: none; border: 0; color: var(--A); padding: 0; font-weight: 500; font-size: 13px; }
.link:hover { text-decoration: underline; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.text {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; outline: none; width: 100%;
}
.text:focus { border-color: var(--A); box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15); }
.text.grow { flex: 1 1; min-width: 220px; }
.stack { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.stack > span { font-weight: 600; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 16px; gap: 16px; }

/* number input */
.num {
  display: inline-flex; align-items: center; background: var(--input); border: 1px solid var(--input-line);
  border-radius: 9px; overflow: hidden; height: 38px; vertical-align: middle;
}
.num:focus-within { border-color: var(--A); box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.18); }
.num input {
  width: 72px; border: 0; background: transparent; outline: none; padding: 0 10px; font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums; text-align: right; color: #123a8c; font-size: 15px;
}
.num.wide input { width: 110px; }
.num .affix { padding: 0 8px; color: #5f7bb0; font-size: 13px; font-weight: 600; }
.num .affix:first-child { padding-right: 0; }
.num .affix:last-child { padding-left: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 500; }
.chip:hover { border-color: #b9c6d9; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }

.seg { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }

.toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; }
.toggle .knob {
  width: 44px; height: 24px; border-radius: 999px; background: #cfd7e3; position: relative; transition: 0.2s; flex: none;
}
.toggle .knob::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle.on .knob { background: var(--C); }
.toggle.on .knob::after { left: 23px; }

.tA { color: var(--A); }
.tB { color: var(--B); }
.tC { color: var(--C); }

/* ───── Step 1 ───── */
.hero { text-align: center; padding: 20px 0 26px; }
.hero h1 { font-size: 40px; }
.hero p { color: var(--muted); font-size: 17px; max-width: 600px; margin: 10px auto 18px; }
.stepnum {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 14px; margin-right: 6px; vertical-align: 2px;
}
.how { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 14px; gap: 14px; margin-top: 8px; }
.how > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.how p { color: var(--muted); font-size: 13.5px; }

/* ───── Step 2 ───── */
.step-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.step-head p { max-width: 640px; }
.search { max-width: 320px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; font-size: 13.5px; font-weight: 500; color: var(--muted); }
.tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); grid-gap: 14px; gap: 14px; }
.pick-wrap { padding-bottom: 90px; }
.dept-group { margin-bottom: 26px; }
.dept-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.tab-count { margin-left: 6px; font-size: 11.5px; opacity: 0.65; }
.bulk { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 14px; gap: 10px; }
.uc {
  text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 4px; transition: 0.15s; box-shadow: var(--shadow);
}
.uc:hover { border-color: #b9c6d9; transform: translateY(-1px); }
.uc.on { border-color: var(--accent); background: #fff8f3; box-shadow: 0 0 0 3px rgba(242, 107, 29, 0.12); }
.uc.custom { border-style: dashed; background: transparent; box-shadow: none; }
.uc-top { display: flex; justify-content: space-between; align-items: center; }
.uc-icon { font-size: 26px; }
.check {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line);
  color: var(--muted); font-weight: 700;
}
.uc.on .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.uc-dept { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin-top: 4px; }
.star { color: var(--accent); }
.uc-name { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.uc-sum { color: var(--muted); font-size: 13.5px; flex: 1 1; }
.uc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 6px; flex-wrap: wrap; }
.pills { display: flex; gap: 4px; }
.pill { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.pill.A { background: #e6eeff; color: var(--A); }
.pill.B { background: #fde8e8; color: var(--B); }
.pill.C { background: #e3f6eb; color: var(--C); }
.typ { font-size: 12px; color: var(--muted); font-weight: 600; }
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px); padding: 12px 20px; display: flex; justify-content: center; align-items: center; gap: 24px; z-index: 15;
}

/* ───── Step 3 ───── */
.opp-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.opp-tabs button {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; white-space: nowrap; font-size: 13.5px;
}
.opp-tabs button.on { border-color: var(--navy); box-shadow: inset 0 -3px 0 var(--accent); }
.ot-name { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ot-val { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-gap: 18px; gap: 18px; align-items: start; }
.live { position: -webkit-sticky; position: sticky; top: 80px; }
.opp-head { display: flex; gap: 14px; }
.big-icon { font-size: 36px; line-height: 1; }
.title-input { border: 0; font-size: 22px; font-weight: 800; width: 100%; outline: none; padding: 2px 0; letter-spacing: -0.02em; }
.title-input:focus, .sol:focus { background: #f7f9fc; border-radius: 6px; }
.sol { border: 0; width: 100%; resize: vertical; color: var(--muted); outline: none; padding: 2px 0; font-size: 14px; }
.sec { border-left: 4px solid var(--line); }
.secA { border-left-color: var(--A); }
.secB { border-left-color: var(--B); }
.secC { border-left-color: var(--C); }
.sec.off { opacity: 0.85; }
.sec-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.sec-head p { font-size: 13.5px; max-width: 560px; }
.sec-right { display: flex; align-items: center; gap: 14px; }
.sec-total { font-weight: 800; font-size: 18px; white-space: nowrap; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.sentence {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; padding: 14px; background: #f7f9fc;
  border-radius: 12px; margin-bottom: 10px;
}
.inline-text {
  border: 0; border-bottom: 2px dashed var(--input-line); background: transparent; outline: none; font-weight: 600;
  padding: 4px 2px; width: 170px; color: #123a8c;
}
.inline-text.long { width: 300px; }
.inline-text:focus { border-bottom-color: var(--A); }
.field { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.field:last-of-type { border-bottom: 0; }
.field-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.field-row label { font-weight: 600; font-size: 14px; flex: 1 1; min-width: 200px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.src { margin-top: 4px; }
.src-input {
  width: 100%; border: 1px solid var(--line); background: #fafbfc; border-radius: 8px; padding: 7px 10px; font-size: 13px;
  outline: none; margin-top: 6px; color: var(--muted);
}
.src-input:focus { border-color: #b9c6d9; background: #fff; color: var(--ink); }
.helper-link { margin: 4px 0 6px; }
.helper {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #f7f9fc; border-radius: 10px; padding: 10px 12px;
  font-size: 13.5px; margin: 4px 0 8px;
}
.range { width: 100%; accent-color: var(--A); margin: 6px 0 4px; }
.maths {
  margin-top: 12px; background: #f7f9fc; border-radius: 10px; padding: 10px 12px; font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px; color: #334155;
}
.maths b { color: var(--ink); }
.warn { background: #fff7e6; border: 1px solid #fbd38d; color: #8a5a00; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }

.live-card { padding: 20px; }
.live-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; }
.live-total { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; margin: 2px 0 14px; }
.bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.bar-row { display: grid; grid-template-columns: 62px 1fr 64px; align-items: center; grid-gap: 8px; gap: 8px; font-size: 12.5px; }
.bar-label { color: var(--muted); font-weight: 600; }
.bar-track { height: 10px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; transition: width 0.25s; }
.bar-fill.A, .sc-bar .A, .legend .A { background: var(--A); }
.bar-fill.B, .sc-bar .B, .legend .B { background: var(--B); }
.bar-fill.C, .sc-bar .C, .legend .C { background: var(--C); }
.bar-val { text-align: right; font-weight: 700; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.live-kpis { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 8px; gap: 8px; margin-bottom: 14px; }
.live-kpis div { background: #f7f9fc; border-radius: 10px; padding: 8px 10px; }
.live-kpis span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.live-kpis b { font-size: 17px; }
.verdict { border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.verdict b { font-size: 15px; }
.green { background: #e3f6eb; color: #0f6b3a; }
.blue { background: #e6eeff; color: #1d4bb0; }
.amber { background: #fff4e0; color: #8a5a00; }
.grey { background: #eef1f6; color: #4a5568; }
.live-foot { margin-top: 12px; font-size: 12.5px; }

/* ───── Step 4 ───── */
.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--accent); font-weight: 800; }
.report-head h1 { font-size: 34px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.headline {
  background: var(--navy); color: #fff; border-radius: var(--radius); padding: 20px 24px; font-size: 18px; font-weight: 600;
  line-height: 1.45; margin-bottom: 16px; border-left: 6px solid var(--accent);
}
.kpis { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); grid-gap: 12px; gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi span { display: block; font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 2px; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12.5px; }
.kpi.big { background: linear-gradient(135deg, #fff8f3, #fff); border-color: #f8c9a8; }
.kpi.big b { font-size: 32px; color: var(--accent); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.stack-chart { display: flex; flex-direction: column; gap: 10px; }
.sc-row { display: grid; grid-template-columns: 260px 1fr 80px; grid-gap: 12px; gap: 12px; align-items: center; }
.sc-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-track { background: #f3f5f8; border-radius: 8px; height: 26px; overflow: hidden; }
.sc-bar { display: flex; height: 100%; border-radius: 8px; overflow: hidden; min-width: 4px; }
.sc-bar span { display: block; height: 100%; }
.sc-val { text-align: right; font-weight: 800; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.split { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; gap: 10px; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.split span { display: block; font-size: 12.5px; font-weight: 700; }
.split b { font-size: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.r { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--ink); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }

.matrix {
  position: relative; height: 360px; margin: 14px 0 26px 26px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
}
.m-q { padding: 10px 12px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: #9aa7ba; }
.m-q.tl { background: #f0faf4; color: #2f8a57; }
.m-q.tr { background: #f2f6ff; color: #4b72c4; text-align: right; }
.m-q.bl { background: #fbfcfd; }
.m-q.br { background: #f7f8fa; text-align: right; }
.m-dot { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; max-width: 150px; }
.m-dot span {
  width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); display: grid; place-items: center;
  font-size: 20px; box-shadow: var(--shadow);
}
.m-dot em { font-style: normal; font-size: 11.5px; font-weight: 600; text-align: center; line-height: 1.2; margin-top: 3px; background: rgba(255, 255, 255, 0.85); border-radius: 4px; padding: 0 3px; }
.m-axis-x { position: absolute; bottom: -24px; right: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.m-axis-y { position: absolute; left: -26px; top: 0; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; color: var(--muted); font-weight: 600; }

.detail { border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; margin-bottom: 10px; }
.detail summary { display: flex; justify-content: space-between; padding: 14px 0; cursor: pointer; font-weight: 700; list-style: none; }
.detail summary::-webkit-details-marker { display: none; }
.detail[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.detail .link { margin: 4px 0 14px; }
.sol-text { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.calc-line { display: grid; grid-template-columns: 210px 1fr 110px; grid-gap: 12px; gap: 12px; padding: 8px 0 8px 10px; border-left: 3px solid var(--line); margin-bottom: 6px; align-items: baseline; }
.calc-line.A { border-left-color: var(--A); }
.calc-line.B { border-left-color: var(--B); }
.calc-line.C { border-left-color: var(--C); }
.calc-line span { font-weight: 600; font-size: 13.5px; }
.calc-line code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; color: #334155; }
.calc-line b { text-align: right; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.sources { font-size: 13px; color: var(--muted); background: #f7f9fc; border-radius: 8px; padding: 8px 12px; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sources em { font-style: normal; font-weight: 600; color: var(--ink); }
.notes ul { margin: 0 0 10px; padding-left: 20px; }
.notes li { margin: 4px 0; }

/* ───── Login ───── */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1200px 500px at 50% -10%, #1d3560 0%, var(--navy) 55%, #0b1628 100%);
}
.login-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 30px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.login-card h1 { font-size: 26px; margin-top: 18px; }
.login-card p { margin-bottom: 20px; }
.login-brand { color: var(--ink); cursor: default; }
.login-error { background: #fde8e8; color: #9b1c1c; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }
.btn.full { width: 100%; padding: 12px; }
.user-box { display: flex; align-items: center; gap: 10px; color: #c9d5ea; font-size: 13px; white-space: nowrap; }
.user-box button { background: transparent; border: 1px solid rgba(255, 255, 255, 0.2); color: #fff; border-radius: 8px; padding: 4px 10px; font-size: 12.5px; }
.user-box button:hover { background: rgba(255, 255, 255, 0.08); }

/* ───── Saving & My cases ───── */
.save-btn.saved { border-color: rgba(24, 160, 88, 0.6) !important; color: #b8f0cf !important; }
.save-btn.dirty, .save-btn.idle { border-color: var(--accent) !important; }
.save-btn.error { border-color: #ff8a8a !important; }
.save-btn:disabled { opacity: 0.6; cursor: default; }
.save-strip { text-align: center; font-size: 12.5px; padding: 5px 12px; }
.save-strip.dirty { background: #1b3157; color: #c9d5ea; }
.save-strip.error { background: #fde8e8; color: #9b1c1c; }
.save-strip.nodb { background: #fff4e0; color: #8a5a00; }
.notice {
  max-width: 1200px; margin: 16px auto 0; background: #e3f6eb; color: #0f6b3a; border-radius: 12px; padding: 12px 16px;
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-weight: 500;
}
.notice span { flex: 1 1; }
.cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); grid-gap: 14px; gap: 14px; }
.case { background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.case.current { border-color: var(--A); }
.case-main { text-align: left; background: none; border: 0; padding: 18px 18px 10px; display: flex; flex-direction: column; gap: 4px; color: inherit; }
.case-main:hover .case-title { color: var(--A); }
.case-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.case-title { font-weight: 800; font-size: 17px; }
.case-uc { font-size: 13px; color: var(--ink); margin-top: 6px; }
.case-figs { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 8px; gap: 8px; margin-top: 12px; }
.case-figs div { background: #f7f9fc; border-radius: 9px; padding: 7px 10px; }
.case-figs span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.case-figs b { font-size: 16px; }
.case-actions { display: flex; gap: 16px; padding: 10px 18px 14px; border-top: 1px solid var(--line); }
.link.danger { color: #b4232a; }
.empty { text-align: center; padding: 40px 20px; }
.empty .btn { margin-top: 14px; }

/* ───── Responsive ───── */
@media (max-width: 980px) {
  .editor { grid-template-columns: 1fr; }
  .live { position: static; order: -1; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi.big { grid-column: 1 / -1; }
  .stepper .lbl { display: none; }
  .user-name { display: none; }
  .top-inner { flex-wrap: wrap; }
  .sc-row { grid-template-columns: 1fr 70px; }
  .sc-name { grid-column: 1 / -1; }
  .calc-line { grid-template-columns: 1fr; }
  .calc-line b { text-align: left; }
}
@media (max-width: 640px) {
  .form-grid, .how, .split { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .running { display: none; }
  .inline-text, .inline-text.long { width: 100%; }
  .bottom-bar { gap: 10px; justify-content: space-between; }
  .bottom-bar .muted { display: none; }
  .matrix { height: 300px; }
}

/* ───── Print ───── */
@media print {
  body { background: #fff; font-size: 12px; }
  .no-print { display: none !important; }
  main { padding: 0; max-width: none; }
  .card, .kpi { box-shadow: none; page-break-inside: avoid; break-inside: avoid; }
  .headline { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sc-bar span, .legend i, .badge, .kpi.big, .m-q { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kpis { grid-template-columns: repeat(5, 1fr); }
}

/* ───── Print frame (screen: invisible wrapper) ───── */
.print-frame, .print-frame > tbody, .print-frame > tbody > tr, .print-frame > tbody > tr > td {
  display: block; width: auto; border: 0; padding: 0;
}
.print-frame > thead, .print-frame > tfoot, .print-header, .print-footer { display: none; }

/* ───── PDF / print layout ─────
   margin: 0 removes the browser's own header & footer (URL, date, page title).
   Our own header/footer and the thead/tfoot spacers give every page its margins. */
@page { size: A4; margin: 0; }

@media print {
  html, body { background: #fff !important; }
  body { font-size: 10.5px; line-height: 1.4; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .top, .foot, .notice, .no-print, .head-actions, .results .actions { display: none !important; }
  main { padding: 0 !important; margin: 0 !important; max-width: none !important; }

  .print-frame { display: table !important; width: 100%; border-collapse: collapse; }
  .print-frame > thead { display: table-header-group !important; }
  .print-frame > tfoot { display: table-footer-group !important; }
  .print-frame > tbody { display: table-row-group !important; }
  .print-frame > thead > tr, .print-frame > tfoot > tr, .print-frame > tbody > tr { display: table-row !important; }
  .print-frame > thead > tr > td, .print-frame > tfoot > tr > td, .print-frame > tbody > tr > td {
    display: table-cell !important; padding: 0 15mm !important; border: 0 !important;
  }
  .print-space-top { height: 17mm; }
  .print-space-bottom { height: 15mm; }

  .print-header, .print-footer {
    display: flex !important; justify-content: space-between; position: fixed; left: 15mm; right: 15mm;
    font-size: 8px; color: #6b7a90; z-index: 5;
  }
  .print-header { top: 8mm; padding-bottom: 2.5mm; border-bottom: 1px solid #e2e7ef; }
  .print-header b { color: var(--navy); }
  .print-footer { bottom: 7mm; padding-top: 2.5mm; border-top: 1px solid #e2e7ef; }

  /* Title block */
  .report-head { display: block; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 3px solid var(--accent); }
  .report-head h1 { font-size: 26px; margin: 2px 0; }
  .report-head p { font-size: 10px; margin: 0; }
  .eyebrow { font-size: 9px; }

  .headline { font-size: 12.5px; line-height: 1.45; padding: 11px 15px; margin-bottom: 10px; border-radius: 8px; page-break-inside: avoid; break-inside: avoid; }

  /* KPI strip: always one row of five */
  .kpis { grid-template-columns: 1.35fr 1fr 1fr 1fr 1fr !important; gap: 6px; margin-bottom: 10px; page-break-inside: avoid; break-inside: avoid; }
  .kpi { padding: 8px 10px; border-radius: 8px; box-shadow: none; }
  .kpi.big { grid-column: auto !important; }
  .kpi span { font-size: 7px; letter-spacing: 0.04em; white-space: nowrap; }
  .kpi b { font-size: 15px; margin: 3px 0 1px; }
  .kpi.big b { font-size: 19px; }
  .kpi small { font-size: 7.5px; }

  /* Cards */
  .card { box-shadow: none !important; border: 1px solid #dfe5ee; border-radius: 8px; padding: 11px 14px; margin-bottom: 9px; page-break-inside: auto; break-inside: auto; }
  h2 { font-size: 13px; margin-bottom: 7px; page-break-after: avoid; break-after: avoid; }
  .card > p.muted { font-size: 9px; margin: -3px 0 6px; }

  /* Value chart */
  .chart-head { align-items: center; }
  .legend { font-size: 8.5px; gap: 10px; }
  .stack-chart { gap: 5px; }
  .sc-row { grid-template-columns: 62mm 1fr 18mm !important; gap: 8px; page-break-inside: avoid; break-inside: avoid; }
  .sc-name { grid-column: auto !important; font-size: 9.5px; }
  .sc-track { height: 13px; border-radius: 4px; }
  .sc-bar { border-radius: 4px; }
  .sc-val { font-size: 10px; }
  .split { grid-template-columns: repeat(3, 1fr) !important; margin-top: 9px; padding-top: 7px; }
  .split span { font-size: 8.5px; }
  .split b { font-size: 14px; }

  /* Summary table: fit the page, no scrolling */
  .table-wrap { overflow: visible !important; }
  table { font-size: 8.8px; }
  th { font-size: 7px; padding: 4px 4px; }
  td { padding: 5px 4px; }
  td .small { font-size: 7.5px; }
  tr { page-break-inside: avoid; break-inside: avoid; }
  thead { display: table-header-group; }
  .badge { font-size: 7.5px; padding: 2px 6px; }

  /* Priority map */
  .map-card { page-break-inside: avoid; break-inside: avoid; }
  .matrix { height: 200px; margin: 6px 0 20px 22px; }
  .m-q { font-size: 7.5px; padding: 5px 8px; }
  .m-dot span { width: 24px; height: 24px; font-size: 12px; border-width: 1.5px; box-shadow: none; }
  .m-dot em { font-size: 7.5px; }
  .m-axis-x, .m-axis-y { font-size: 8px; }

  /* Show the maths */
  .page-break { page-break-before: always; break-before: page; }
  .detail { page-break-inside: avoid; break-inside: avoid; border-radius: 8px; padding: 0 10px; margin-bottom: 6px; }
  .detail summary { padding: 7px 0; font-size: 10.5px; }
  .detail[open] summary { margin-bottom: 6px; }
  .sol-text { font-size: 9px; margin: 0 0 6px; }
  .calc-line { grid-template-columns: 46mm 1fr 22mm !important; gap: 8px; padding: 3px 0 3px 8px; margin-bottom: 4px; }
  .calc-line span { font-size: 9px; }
  .calc-line code { font-size: 8.5px; }
  .calc-line b { text-align: right !important; font-size: 9.5px; }
  .sources { font-size: 8.5px; padding: 5px 8px; margin: 5px 0 8px; }

  .notes { page-break-inside: avoid; break-inside: avoid; }
  .notes ul { font-size: 9.5px; }
  .notes li { margin: 2px 0; }
}

/* Priority map: numbered markers + key */
.m-dot span { font-size: 14px !important; font-weight: 800; color: var(--navy); }
.m-key {
  list-style: none; counter-reset: k; padding: 0; margin: 4px 0 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-gap: 6px 18px; gap: 6px 18px; font-size: 13px;
}
.m-key li { counter-increment: k; display: flex; gap: 8px; align-items: baseline; }
.m-key li::before {
  content: counter(k); flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--accent);
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--navy);
}
.m-key span { font-weight: 600; }
.m-key em { font-style: normal; color: var(--muted); font-size: 12px; white-space: nowrap; }
@media print {
  .m-dot span { font-size: 10px !important; }
  .m-key { grid-template-columns: 1fr 1fr; font-size: 8.5px; gap: 3px 14px; }
  .m-key li::before { width: 14px; height: 14px; font-size: 7.5px; }
  .m-key em { font-size: 8px; }
}

