:root {
  --ink: #17202a; --muted: #5f6b7a; --line: #dfe3e8; --soft: #f4f6f8; --accent: #0b5cab; --accent-ink: #ffffff;
  --pick: #e7f0fa; --bg: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { min-height: 100vh; display: flex; flex-direction: column; }
.bar { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 20px 10px; max-width: 760px; width: 100%; margin: 0 auto; }
.brand { font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.where { color: var(--muted); font-size: 13px; }
.progress { height: 3px; background: var(--soft); }
.progress div { height: 3px; background: var(--accent); width: 0; transition: width .25s; }
main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 28px 20px 120px; }
h1 { font-size: 28px; line-height: 1.2; margin: 8px 0 14px; }
h2 { font-size: 22px; line-height: 1.3; margin: 4px 0 18px; font-weight: 650; }
.kicker { color: var(--accent); font-weight: 650; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
p { font-size: 17px; line-height: 1.55; margin: 0 0 14px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; margin: -8px 0 16px; }

.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%; padding: 14px 16px; font: inherit; font-size: 16px; line-height: 1.4;
  color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.opt:hover { border-color: #b8c4d0; }
.opt.on { border-color: var(--accent); background: var(--pick); }
.opt .key { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid #b8c4d0; font-size: 12px; display: grid; place-items: center; color: var(--muted); margin-top: 1px; }
.opt.on .key { background: var(--accent); border-color: var(--accent); color: #fff; }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale button { padding: 16px 0; font: inherit; font-size: 18px; font-weight: 600; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; color: var(--ink); }
.scale button.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-top: 8px; gap: 12px; }
.ends span:last-child { text-align: right; }

.grid { width: 100%; border-collapse: collapse; }
.grid th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; padding: 0 4px 8px; vertical-align: bottom; }
.grid td { border-top: 1px solid var(--line); padding: 8px 4px; }
.grid td.row { font-size: 15px; line-height: 1.35; padding-right: 10px; }
.grid td.cell { text-align: center; width: 13%; }
.dot { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid #b8c4d0; background: #fff; cursor: pointer; padding: 0; }
.dot.on { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 4px #fff; }

.alloc .line { display: grid; grid-template-columns: 1fr 150px 48px; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.alloc .line label { font-size: 15px; line-height: 1.35; }
.alloc input[type=range] { width: 100%; accent-color: var(--accent); }
.alloc .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.sum { margin-top: 12px; font-weight: 600; }
.sum.bad { color: #b42318; }

.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.pair .opt { min-height: 120px; font-size: 18px; line-height: 1.4; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.pair .or { align-self: center; color: var(--muted); font-size: 14px; }

.card { border: 1.5px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 18px; }
.card .role { font-size: 20px; font-weight: 650; line-height: 1.3; margin-bottom: 4px; }
.card .emp { font-size: 16px; margin-bottom: 12px; }
.card dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; font-size: 15px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; }
.card a { color: var(--accent); }
.apply { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.apply button { font: inherit; font-size: 13px; line-height: 1.25; padding: 10px 4px; border: 1.5px solid var(--line); background: #fff; border-radius: 9px; cursor: pointer; color: var(--ink); min-height: 54px; }
.apply button.on { border-color: var(--accent); background: var(--accent); color: #fff; }

textarea { width: 100%; min-height: 130px; font: inherit; font-size: 16px; line-height: 1.5; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; resize: vertical; }
textarea:focus { outline: none; border-color: var(--accent); }

.nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px max(20px, calc((100% - 720px)/2)); }
button.primary, button.ghost { font: inherit; font-size: 16px; font-weight: 600; padding: 12px 22px; border-radius: 10px; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-ink); border: 1.5px solid var(--accent); }
button.primary:disabled { opacity: .4; cursor: default; }
button.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
button.ghost[hidden] { visibility: hidden; display: inline-block; }
.saved { color: var(--muted); font-size: 13px; }
.list { padding-left: 20px; font-size: 16px; line-height: 1.6; }
.summary dt { font-weight: 600; margin-top: 12px; }
.summary dd { margin: 2px 0 0; color: var(--ink); }

@media (max-width: 560px) {
  h1 { font-size: 24px; } h2 { font-size: 19px; }
  .pair { grid-template-columns: 1fr; } .pair .or { text-align: center; } .pair .opt { min-height: 84px; font-size: 17px; }
  .alloc .line { grid-template-columns: 1fr 44px; } .alloc .line input { grid-column: 1 / 3; grid-row: 2; }
  .grid td.row { font-size: 14px; } .grid th { font-size: 10.5px; } .dot { width: 26px; height: 26px; }
  .apply { grid-template-columns: 1fr; } .apply button { min-height: 0; text-align: left; padding: 11px 12px; }
  .card dl { grid-template-columns: 90px 1fr; }
}
