:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #1d2433;
  --muted: #5b6478;
  --line: #d9dee8;
  --brand: #1f5fa8;
  --brand-soft: #e7f0fb;
  --accent: #0f8a7e;
  --accent-soft: #e3f5f2;
  --warn: #b3541e;
  --good: #1d7a3a;
  --bad: #b0302a;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.topbar {
  background: var(--brand);
  color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar .logo { font-weight: 700; letter-spacing: .3px; }
.topbar .logo small { font-weight: 400; opacity: .8; margin-left: 8px; }
.topbar a { color: #fff; opacity: .85; font-size: 14px; }

.mockup-banner {
  background: #fff6d6;
  color: #6b5200;
  font-size: 13px;
  text-align: center;
  padding: 4px 12px;
  border-bottom: 1px solid #efe1a8;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 24px 16px 60px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.card h1, .card h2, .card h3 { margin-top: 0; }
h1 { font-size: 26px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.round-tag {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { background: #a9b3c4; cursor: not-allowed; filter: none; }
.btn.secondary { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.accent { background: var(--accent); }
.actions { margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Launcher */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.choice {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.choice:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(31,95,168,.12); }
.choice .num { font-size: 13px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .5px; }
.choice h2 { margin: 6px 0 8px; font-size: 19px; }
.choice p { margin: 0 0 10px; font-size: 14.5px; color: var(--muted); }
.choice .go { margin-top: auto; font-weight: 600; color: var(--brand); }
.settings label { display: block; margin: 6px 0; }

/* Situation (vignette) */
.situation {
  background: #fffdf7;
  border: 1px solid #eadfbf;
  border-left: 6px solid #d9b45a;
}
.situation ul { margin: 6px 0 6px 0; padding-left: 22px; }
.situation li { margin: 3px 0; }
.situation .changed { background: #fff0c2; padding: 0 3px; border-radius: 3px; }

/* Fund table */
.table-scroll { overflow-x: auto; }
table.funds { border-collapse: collapse; width: 100%; font-size: 15px; }
table.funds th, table.funds td { border: 1px solid var(--line); padding: 8px 10px; text-align: center; }
table.funds thead th { background: #f0f3f8; }
table.funds tbody th { text-align: left; background: #fafbfd; font-weight: 600; white-space: nowrap; }
.stars { color: #d49b00; letter-spacing: 1px; }

/* Fund choice */
.fund-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fund-option {
  border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer;
  display: flex; gap: 10px; align-items: flex-start; background: #fff;
}
.fund-option:hover { border-color: #9db8dc; }
.fund-option.selected { border-color: var(--brand); background: var(--brand-soft); }
.fund-option input { margin-top: 4px; }
.fund-option .name { font-weight: 600; }
.fund-option .meta { font-size: 13.5px; color: var(--muted); }

/* Robo-advisor panel */
.robo {
  border: 1px solid #b9d4ef;
  background: linear-gradient(180deg, #f2f8ff 0%, #ffffff 100%);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.robo-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.robo-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; flex: 0 0 auto;
}
.robo-title { font-weight: 700; }
.robo-sub { font-size: 13.5px; color: var(--muted); }
.signal { font-size: 17px; margin: 10px 0; }
.signal strong { font-size: 19px; }
.dots { display: inline-flex; gap: 5px; vertical-align: middle; margin-left: 6px; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brand); background: #fff; }
.dot.on { background: var(--brand); }
.reveal-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.click-progress { display: inline-flex; gap: 6px; }
.click-progress span { width: 12px; height: 12px; border-radius: 3px; background: #d6dde9; }
.click-progress span.on { background: var(--accent); }
.reveal-hint { font-size: 14px; color: var(--muted); }
.advice {
  margin-top: 12px; padding: 14px 16px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid #a6dcd4;
  animation: fadein .3s ease;
}
.advice .rec { font-size: 18px; }
@keyframes fadein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Results */
.result { border-left: 6px solid var(--good); }
.result.neg { border-left-color: var(--bad); }
.result .big { font-size: 22px; font-weight: 700; }
.result .pos-txt { color: var(--good); }
.result .neg-txt { color: var(--bad); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; }

/* Steps bar (Jung & Weinhardt style) */
.steps { display: flex; border-radius: 8px; overflow: hidden; margin-bottom: 18px; border: 1px solid var(--line); }
.steps div { flex: 1; text-align: center; padding: 8px 6px; font-size: 13px; font-weight: 600; letter-spacing: .5px; background: #eef1f6; color: var(--muted); text-transform: uppercase; }
.steps div.active { background: var(--accent); color: #fff; }
.steps div.done { background: #cfe9e5; color: #23564f; }

.outcome { font-size: 20px; font-weight: 700; }
.outcome.win { color: var(--good); }
.outcome.loss { color: var(--bad); }

.prob { letter-spacing: 2px; color: var(--brand); }

/* Menu (draft 2) */
table.menu { border-collapse: collapse; width: 100%; }
table.menu th, table.menu td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: middle; }
table.menu thead th { font-size: 13.5px; color: var(--muted); font-weight: 600; }
table.menu tr.block-start td { border-top: 2px solid #b9c3d6; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { padding: 6px 12px; cursor: pointer; font-size: 14px; border-right: 1px solid var(--line); background: #fff; white-space: nowrap; }
.seg label:last-child { border-right: 0; }
.seg input { display: none; }
.seg label.on-yes { background: var(--accent); color: #fff; }
.seg label.on-no { background: #6c778c; color: #fff; }

.draw-box { text-align: center; padding: 30px 10px; }
.draw-box .drawn { font-size: 40px; font-weight: 800; color: var(--brand); }

/* Debug summary */
details.debug { margin-top: 14px; }
details.debug summary { cursor: pointer; color: var(--muted); font-size: 14px; }
table.summary { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 8px; }
table.summary th, table.summary td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; }
table.summary th { background: #f0f3f8; }

.note { font-size: 13.5px; color: var(--muted); background: #f6f7fa; border-radius: 8px; padding: 10px 12px; }

@media (max-width: 600px) {
  .wrap { padding: 16px 12px 40px; }
  .card { padding: 16px; }
  h1 { font-size: 22px; }
  .steps div { font-size: 11px; padding: 6px 2px; }
}
