/* Shared controls and the three stages of character creation. */
:root {
  --bg: #f1f3f6;
  --app-width: 800px;
  --app-header-height: 60px;
  --app-gutter: 18px;
  --nav-height: 68px;
  --surface: #fff;
  --ink: #192636;
  --muted: #536477;
  --line: #dbe2eb;
  --soft: #f3f6fa;
  --blue: #245bc5;
  --blue-hover: #194aaa;
  --pale-blue: #eef4ff;
  --teal: var(--blue);
  --teal-light: var(--pale-blue);
  --navy: #203957;
  --shadow: 0 3px 12px #21365108;
  font-synthesis: none;
}

html, body {
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  letter-spacing: -.025em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
html, body { background: #e9edf1; }
body::before { content: none; }
#app { width: min(100%, var(--app-width)); margin: 0 auto; background: var(--bg); min-height: calc(100vh - var(--app-header-height)); min-height: calc(100dvh - var(--app-header-height)); }
.topbar { width: min(100%, var(--app-width)); margin-inline: auto; }
button, input, select { letter-spacing: inherit; }
button, a, summary, :is(input, select):focus-visible { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible, :is(input, select):focus-visible {
  outline: 3px solid #1d65d5;
  outline-offset: 3px;
}
.topbar { background: #fff; border-bottom: 1px solid var(--line); color: var(--ink); }
.topin, .shell { max-width: var(--app-width); margin-inline: auto; }
.topin { min-height: 60px; padding: 9px var(--app-gutter); gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: #182a43; font-size: 18px; font-weight: 800; letter-spacing: -.065em; line-height: 1.25; }
.brand b { color: #245642; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .02em; }
.brand-icon {
  position: relative;
  flex: none;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  background: #285847;
  color: transparent;
}
.brand-icon::before, .brand-icon::after { content: ""; position: absolute; }
.brand-icon::before { left: 8px; bottom: 7px; width: 15px; height: 8px; border: 2px solid white; border-top-width: 3px; border-radius: 2px; }
.brand-icon::after { left: 15px; top: 6px; width: 7px; height: 9px; background: white; transform: rotate(32deg); border-radius: 1px; }
.right-actions { gap: 6px; }
.topin a.brand { min-height: 40px; }
.topin:has(.play-help) :is(.brand-wordmark, .topbtn) { white-space: nowrap; }
.topin:has(.play-help) .right-actions { flex-shrink: 0; }
.right-actions .play-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding-inline: 7px;
  border-radius: 7px;
  color: #334459;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}
.right-actions .play-help:hover { color: #245642; background: #edf4f0; }
#save-status:not([hidden]) { display: block; margin: 0; padding: 7px var(--app-gutter); background: #fff1de; color: #783917; font-size: 12px; font-weight: 650; }
.topbtn {
  min-height: 35px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  color: #334459;
  border-radius: 9px;
  background: white;
  font-weight: 700;
}
.topbtn:hover { background: var(--soft); }
.shell { padding: 18px var(--app-gutter) 30px; }
.eyebrow { font-size: 12px; font-weight: 750; letter-spacing: .01em; color: var(--blue); }
:is(.btn, .topbtn, .career-tab, .avatar-choice) { touch-action: manipulation; }
.btn {
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.32;
}
.btn-primary, .btn-orange { color: white; background: var(--blue); }
.btn:hover:not(:disabled) { transform: none; filter: none; }
:is(.btn-primary, .btn-orange):hover:not(:disabled) { background: var(--blue-hover); }
.btn-light { background: #eff3f8; color: #344860; }
.btn-light:hover:not(:disabled) { background: #e2eaf4; }
.btn-plain { border: 1px solid var(--line); background: white; color: var(--navy); }
.btn-plain:hover:not(:disabled) { background: var(--soft); }
.muted, .micro, .note, .form-note, .no-sel, .sect-sub { color: var(--muted); }
.note, .form-note, .no-sel { line-height: 1.65; font-size: 12px; }
[hidden] { display: none !important; }

.setup-shell { max-width: var(--app-width); padding-top: 16px; }
.setup { max-width: 100%; margin: 0 auto; }
.setup-progress { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 34px; margin-block: 0 22px; gap: 10px; }
.setup-back { grid-column: 1; justify-self: start; background: none; border: 0; border-radius: 7px; padding: 7px 5px; font: inherit; font-size: 13px; color: var(--muted); font-weight: 700; }
.setup-back:hover { color: var(--blue); }
.step-track { grid-column: 2; display: inline-flex; align-items: center; gap: 5px; }
.step-track i { display: block; height: 6px; width: 7px; border-radius: 8px; background: #cbd5e3; }
.step-track i.is-on { width: 23px; background: #3569d6; }
.step-label { grid-column: 3; justify-self: end; color: var(--muted); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.setup-heading { margin: 0 0 18px; }
.setup-heading .eyebrow { margin: 0 0 6px; }
.setup-heading h1 { margin: 0; font-weight: 800; font-size: clamp(25px, 3.6vw, 36px); line-height: 1.28; letter-spacing: -.065em; }
.setup-heading p:not(.eyebrow) { color: var(--muted); margin: 7px 0 0; font-size: 14px; line-height: 1.55; }
.style-shell { max-width: 640px; padding-bottom: max(32px, env(safe-area-inset-bottom)); }
.style-heading h1 { font-size: clamp(23px, 4vw, 31px); }
.style-heading h1:focus { outline: none; }
.style-options { display: grid; gap: 9px; }
.style-candidate {
  min-width: 0;
  border: 2px solid #dce3eb;
  border-radius: 15px;
  background: #fff;
}
.style-candidate.is-selected { border-color: #3269d3; }
.style-pick {
  appearance: none;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.style-pick:hover { background: #f6f9fd; }
.style-pick:focus-visible { outline-offset: 1px; }
.style-copy { display: grid; min-width: 0; gap: 4px; }
.style-copy > strong { font-size: 16px; line-height: 1.3; }
.style-descriptor { color: #526174; font-size: 12px; line-height: 1.45; }
.style-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.style-chip {
  padding: 2px 7px;
  border-radius: 5px;
  background: #edf1f5;
  color: #43566d;
  font-size: 11px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.style-chip b { font: inherit; font-weight: 750; }
.style-candidate.is-selected .style-chip { background: #edf3ff; color: #2a5290; }
.style-mark {
  display: grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 2px solid #b8c6d6;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.is-selected .style-mark { color: #fff; background: #3269d3; border-color: #3269d3; }
.style-stats {
  display: grid;
  gap: 5px;
  margin: 0 16px;
  padding: 10px 0 13px;
  border-top: 1px solid #dce6f3;
  list-style: none;
}
.style-stat-row {
  display: grid;
  grid-template-columns: 6em minmax(0,1fr) 2.2em;
  align-items: center;
  gap: 8px;
  color: #46576d;
  font-size: 12px;
  line-height: 1.25;
}
.style-stat-value { color: #263b56; text-align: right; font-variant-numeric: tabular-nums; }
.style-meter { height: 6px; border-radius: 4px; overflow: hidden; background: #e8edf4; }
.style-meter i { display: block; height: 100%; border-radius: inherit; background: #5987db; }
.style-footer { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; }
.style-reroll {
  min-height: 44px;
  padding: 6px 4px;
  border: 0;
  color: #495d75;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}
.style-reroll span { font-size: 16px; vertical-align: -1px; }
.style-reroll:hover { color: var(--blue); text-decoration: underline; }
.style-footer .btn { flex: 1; }
@media(max-width: 400px) {
  .style-pick { padding: 11px 12px; }
  .style-stats { margin-inline: 12px; }
  .style-stat-row { gap: 6px; }
  .style-footer { gap: 6px; }
  .style-footer .btn { padding-inline: 10px; }
}
.avatar-stage, .setup-content { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: white; box-shadow: var(--shadow); }
.avatar-stage { display: block; padding: clamp(15px, 2.8vw, 24px); }
.avatar-preview {
  display: flex;
  gap: clamp(8px, 2vw, 18px);
  align-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 107px;
  padding: 5px clamp(14px, 3vw, 28px);
  border-radius: 14px;
  background: #eaf1fd;
}
.avatar-preview::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 0 36%;
  background: url("assets/citizen.webp") center 58% / cover no-repeat;
  mask-image: linear-gradient(to right, transparent, #000 48%);
  opacity: .54;
  image-rendering: pixelated;
}
.avatar-preview img { flex: none; width: 72px; height: 86px; object-fit: contain; image-rendering: pixelated; }
.avatar-preview > div { display: grid; gap: 5px; min-width: 0; max-width: 48%; }
.avatar-preview b { color: #203a5d; font-size: 17px; letter-spacing: -.055em; }
.avatar-preview small { color: #435875; font-size: 12px; line-height: 1.5; }
.avatar-controls { padding-top: 16px; }
.avatar-controls .eyebrow { margin: 0 0 4px; }
.avatar-controls h1 { margin: 0 0 16px; font-size: 24px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.avatar-choice {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  height: clamp(76px, 9vw, 112px);
  padding: 4px;
  background: #f3f5f8;
  border: 2px solid transparent;
  border-radius: 13px;
}
.avatar-choice img { display: block; height: 100%; width: 100%; min-height: 0; object-fit: contain; image-rendering: pixelated; }
.avatar-choice:hover { border-color: #9bb8ec; background: #eef2f9; }
.avatar-choice.chosen, .avatar-choice[aria-pressed="true"] { border-color: #3470df; background: var(--pale-blue); }
.avatar-choice[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  display: grid;
  place-items: center;
  right: 5px;
  top: 5px;
  width: 17px;
  height: 17px;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
  font: 800 11px/1 system-ui, sans-serif;
}
.setup-footer { display: flex; gap: 8px; align-items: stretch; margin-top: 17px; }
.setup-footer .btn { flex: 1 1 auto; min-width: 0; min-height: 48px; }
.setup-content { display: grid; grid-template-columns: minmax(0, 1fr); }
.setup-intro { display: flex; flex-direction: row-reverse; align-items: stretch; justify-content: space-between; padding: 0; position: relative; min-height: 0; background: #e9f1fe; color: var(--ink); }
.setup-intro::after { content: none; }
.career-art { background-repeat: no-repeat; background-size: cover; image-rendering: pixelated; }
.career-art--citizen { background-color: #c0a780; background-image: url("assets/citizen.webp"); background-position: center 58%; }
.setup-intro > .career-art { min-height: 84px; width: min(44%, 320px); flex: none; mask-image: linear-gradient(to right, transparent, #000 26%); }
.setup-intro .intro-copy { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 15px 20px; }
.setup-intro .intro-copy img { width: 50px; height: 58px; object-fit: contain; image-rendering: pixelated; }
.setup-intro .eyebrow { color: #345a8d; }
.setup-intro h1, .setup-intro h2 { font-size: 21px; letter-spacing: -.05em; margin: 0 0 5px; }
.setup-intro p { color: #475b74; max-width: 42ch; font-size: 13px; line-height: 1.65; margin: 4px 0 0; }
.setup-form { display: grid; justify-content: stretch; align-content: center; gap: 13px; padding: clamp(18px, 3vw, 32px); color: var(--ink); background: white; }
.setup-form h2 { margin: 0; color: var(--ink); font-size: 24px; }
.setup-form .setup-footer { margin-top: 1px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { color: #35485f; font-size: 12px; font-weight: 700; }
.field input, .field select, #support-kind {
  min-height: 43px;
  padding: 9px 13px;
  background: var(--soft);
  border: 1px solid #dce3ec;
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
}
.field input:focus, .field select:focus { border-color: #668ed9; background: #fff; }
#starting-base { margin: 0; border-radius: 11px; padding: 10px 13px; background: var(--pale-blue); color: #3b516f; }

/* Career navigation, the annual choices and the candidate profile. */
.career-shell { max-width: var(--app-width); padding-bottom: calc(var(--nav-height) + 22px + env(safe-area-inset-bottom, 0px)); }
.hero.career-hero, .hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  margin: 0;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.hero--citizen::before { content: none; }
.career-hero-portrait { flex: 0 0 70px; width: 70px; height: 76px; display: grid; place-items: center; overflow: hidden; background: var(--pale-blue); border-radius: 14px; }
.career-hero-portrait img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
img.career-hero-portrait { object-fit: contain; image-rendering: pixelated; }
.hero-copy { min-width: 0; flex: 1; }
.hero h1 { margin: 3px 0 5px; font-size: clamp(22px, 3vw, 33px); letter-spacing: -.065em; }
.hero p { font-size: 13px; color: var(--muted); line-height: 1.55; }
.yearcard { min-width: 86px; gap: 4px; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--pale-blue); }
.yearcard strong { color: #244f9c; font-size: 22px; letter-spacing: -.045em; }
.yearcard span { color: #52647a; }
.career-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, var(--app-width));
  min-height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  padding: 4px max(10px, var(--app-gutter)) calc(4px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: white;
}
.career-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 4px 5px;
  background: transparent;
  color: #5c697b;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}
.nav-icon { flex: none; width: 21px; height: 21px; }
.career-tab:hover { background: var(--soft); color: var(--blue); }
.career-tab[aria-current="page"], .career-tab[aria-selected="true"] { color: var(--blue); font-weight: 800; }
.career-tab:focus-visible { outline-offset: -2px; }
.career-page { min-width: 0; margin-top: 12px; }
.career-layout { display: grid; align-items: start; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.stack { display: grid; align-content: start; gap: 14px; min-width: 0; }
.card { min-width: 0; border: 1px solid var(--line); background: white; box-shadow: var(--shadow); border-radius: 17px; padding: 20px; }
.cardhead, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0 0 15px; }
.card h2, .section-title, .section-heading h2 { color: var(--ink); font-size: clamp(17px, 2.1vw, 20px); line-height: 1.35; letter-spacing: -.055em; margin: 0; }
.cardhead .micro, .section-heading .micro { margin-top: 4px; }
.section-heading p { font-size: 12px; color: var(--muted); margin: 3px 0 0; line-height: 1.5; }
.career-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 15px 9px; gap: 1px; background: white; border: 1px solid var(--line); border-radius: 15px; }
.career-facts > * { display: grid; align-content: center; min-width: 0; gap: 3px; padding: 0 13px; }
.career-facts > * + * { border-left: 1px solid var(--line); }
.career-facts span, .career-facts small, .career-facts dt { font-size: 12px; color: var(--muted); }
.career-facts strong, .career-facts b, .career-facts dd { font-size: clamp(15px, 2vw, 19px); font-weight: 800; color: #233c60; margin: 0; }
.career-page[data-page="home"] { display: grid; gap: 12px; }
.portrait { flex: 0 0 68px; width: 68px; height: 72px; border-radius: 14px; background: var(--pale-blue); overflow: hidden; }
.portrait img { object-fit: contain; width: 100%; height: 100%; image-rendering: pixelated; }
.profile-main { align-items: center; }
.profile-main :is(h2,h3) { font-size: 21px; margin: 0 0 4px; }
.profile-scene { position: relative; min-height: 100px; height: clamp(115px, 12vw, 165px); border-radius: 12px; overflow: hidden; margin: 0 0 15px; }
.profile-scene .career-art { height: 100%; width: 100%; }
.pill, .count, .caps span { display: inline-flex; align-items: center; min-width: 0; border: 0; border-radius: 7px; padding: 5px 8px; background: var(--pale-blue); color: #294e92; font-size: 11px; font-weight: 750; line-height: 1.35; }
.pill.gold { color: #795112; background: #fff2d8; }
.pill.dark { color: #455871; background: #edf1f6; }
.count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.info-row { align-items: baseline; gap: 10px; padding: 11px 0; font-size: 13px; border: 0; border-bottom: 1px solid #e8edf3; }
.info-row b { text-align: end; font-size: 13px; font-variant-numeric: tabular-nums; }
.divider { background: var(--line); }
.meter-head { font-size: 13px; }
.bar { background: #edf1f7; }
.bar span, .score .bar span { background: #407de3; }
.bar.orange span { background: #bf822c; }
.bar.red span { background: #c66b6a; }
.scoregrid { gap: 8px; }
.score { min-width: 0; border: 0; border-radius: 10px; padding: 11px; background: var(--soft); }
.score-top { display: flex; justify-content: space-between; align-items: center; }
.score-top strong { font-size: 13px; }
.score-top small { font-size: 15px; color: #28416b; font-variant-numeric: tabular-nums; }
.training-grid { gap: 7px; }
.train-stats { flex: 0 1 270px; min-width: 0; }
.train-stats-grid { display: grid; grid-template: repeat(4,auto) / repeat(2,minmax(0,1fr)); grid-auto-flow: column; gap: 6px 15px; }
.train-stat { display: grid; grid-template-columns: 1fr auto; align-items: baseline; min-width: 0; color: #374a62; font-size: 12px; font-variant-numeric: tabular-nums; }
.train-stat-name { font-weight: 600; white-space: nowrap; }
.train-stat-values { display: flex; gap: 2px; align-items: baseline; font-size: 12px; font-weight: 650; }
.train-stat--growing .train-stat-values strong { color: #1a56b1; }
.train-stat-arrow { color: var(--muted); font-size: 10px; }
.train-stat-bar { grid-column: 1 / -1; display: flex; overflow: hidden; height: 3px; border-radius: 3px; margin-top: 2px; background: #e5eaf1; }
.train-stat-bar span:first-child { background: #8498b4; }
.train-stat-bar span:nth-child(2) { background: #2c66cc; }
.train-stat-bar span:last-child { background: #9db9ee; }
.hero.career-hero h1 { font-size: clamp(20px,3vw,26px); line-height: 1.25; overflow-wrap: anywhere; word-break: keep-all; }
.hero-copy .eyebrow { color: #244f9c; font-weight: 650; }
.hero-copy .eyebrow b { font-size: 15px; }
.maintenance-training { width: 100%; text-align: left; }
.nextbox .btn:disabled { background: #dfe5ed; color: #475970; opacity: 1; cursor: not-allowed; }
.training {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  min-width: 0;
  min-height: 83px;
  gap: 5px;
  padding: 10px 12px;
  background: #f5f7fa;
  border: 1.5px solid transparent;
  border-radius: 11px;
}
.training.chosen, .activity.active, .choice.selected { border: 1.5px solid #3470d9; background: #edf3ff; box-shadow: none; }
.training:hover, .activity:hover, .choice:hover { border-color: #94afe0; }
.training-top { align-items: center; }
.training-emoji { font-size: 16px; }
.training-name { font-size: 14px; color: var(--ink); font-weight: 750; }
.training-body, .activity small, .training-bottom { color: var(--muted); }
.training-body { font-size: 12px; }
.training-bottom { gap: 6px; font-size: 11px; font-weight: 600; }
.training-bottom b { font-weight: 700; color: #264f99; font-variant-numeric: tabular-nums; }
.training-check, .option-check {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 17px;
  height: 17px;
  border: 1.5px solid #b6c2d2;
  border-radius: 50%;
  background: white;
  color: transparent;
  font: 800 11px/1 system-ui, sans-serif;
}
.option-check { position: absolute; top: 50%; right: 11px; transform: translateY(-50%); }
.training.chosen .training-check, .activity.active .option-check { background: var(--blue); color: white; border-color: var(--blue); }
.act-grid { grid-template-columns: 1fr; gap: 6px; }
.activity {
  position: relative;
  min-height: 47px;
  padding: 9px 37px 9px 12px;
  background: #f5f7fa;
  border: 1.5px solid transparent;
  border-radius: 10px;
}
.activity strong { margin-bottom: 3px; font-size: 13px; color: var(--ink); }
.activity small { font-size: 12px; }
.nextbox { display: grid; padding: 14px 0 0; gap: 10px; margin-top: 14px; border-top: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); }
.nextbox small { color: var(--muted); font-size: 12px; }
.nextbox .btn { width: 100%; }
.news { border: 0; background: var(--pale-blue); color: #354967; border-radius: 11px; font-size: 13px; }
.news strong { color: #234e90; }
.rival { border-color: #e9edf3; }
.rival-avatar { background: #eef2f8; }
.rival .pill { margin-left: auto; }
.rival small { color: var(--muted); }
.log::before { background: #4b7dd6; }
.log::after { border-color: #dfe6f0; }
.log b { color: #34599a; }
.log p { color: #42556b; font-size: 13px; }
.card .note { margin-top: 11px; margin-bottom: 0; }
.card .note:first-of-type { margin-top: 6px; }
#support-kind { width: auto; max-width: 55%; min-height: 34px; font-size: 12px; padding: 5px 8px; }

.overlay { width: min(100%, var(--app-width)); margin-inline: auto; padding: 16px; background: #14283e8c; }
.modal { width: min(100%, 575px); max-height: min(90vh, 900px); max-height: min(90dvh, 900px); padding: 25px; border-radius: 21px; box-shadow: 0 18px 56px #101d363d; }
.modal h2 { margin-top: 6px; font-weight: 800; color: var(--ink); }
.modal h3 { font-size: 17px; letter-spacing: -.045em; }
.modal p { color: var(--muted); line-height: 1.65; }
.modal-footer { gap: 8px; }
.modal-footer > button { min-height: 44px; }
.choices { gap: 7px; }
.scout-field { margin: 18px 0 11px; }
.scout-route { display: grid; gap: 7px; }
.scout-route .note { margin: 0 0 3px; }
.choice { border: 1.5px solid var(--line); border-radius: 12px; background: #f7f9fb; font-size: 14px; color: var(--ink); }
.choice.selected { color: #234d92; }
.choice small { color: var(--muted); }
.result-banner { border-radius: 12px; }
.result-banner.success, .result-banner.good { background: #eaf5ef; color: #236342; }
.result-banner.fail, .result-banner.bad { background: #fff1ef; color: #983d3d; }
.modal .annual-summary, .career-page .annual-summary {
  padding: 15px;
  background: #f0f5fd;
  border: 1px solid #d8e3f5;
  border-radius: 13px;
  color: #254265;
}
.vote-results, .region-support { min-width: 0; }
.table-scroll { max-width: 100%; overflow: auto; overscroll-behavior-inline: contain; margin-block: 8px 12px; }
.vote-table { width: 100%; border-collapse: collapse; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.vote-table th, .vote-table td { padding: 9px 8px; text-align: end; white-space: nowrap; border-bottom: 1px solid #e4eaf3; }
.vote-table th:first-child, .vote-table td:first-child { text-align: start; }
.vote-table thead { background: #eff3f9; color: #3a4f6b; }
.vote-table caption { text-align: start; font-weight: bold; }
.regional-rows > summary, .region-sources > summary { cursor: pointer; padding-block: 11px; font-size: 13px; font-weight: 700; }
.region-sources a { color: var(--blue); text-underline-offset: 3px; }
.career-art--count {
  aspect-ratio: 2.75 / 1;
  background: #243f59 url("assets/count.webp") center 53% / cover no-repeat;
  border-radius: 12px;
  margin-bottom: 14px;
}
.career-art--outcome { display: block; width: 100%; height: auto; max-height: 198px; object-fit: cover; object-position: center 46%; border-radius: 12px; margin-bottom: 14px; }
.toast { background: #203854; color: white; border-radius: 12px; }

.home-quick { display: grid; gap: 0; }
.year-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 0;
  border-radius: 15px;
  background: #254e42;
  color: #fff;
  text-align: start;
}
.year-entry:hover { background: #1e4136; }
.year-entry strong, .year-entry small { display: block; }
.year-entry strong { font-size: 17px; }
.year-entry small { margin-top: 4px; font-size: 13px; color: #d4e7dd; }
.year-entry-action { font-size: 13px; font-weight: 650; }
.year-entry-action span { margin-left: 3px; }
.style-tip { padding: 9px 12px; margin: 0 0 13px; border-left: 3px solid #92b6a3; background: #f3f7f4; color: #354f43; font-size: 13px; line-height: 1.5; }
.style-tip strong { margin-right: 5px; }
.retirement-row { display: flex; justify-content: end; }
.career-hero--brief .career-hero-portrait { width: 39px; height: 44px; flex-basis: 39px; }
.hero.career-hero--brief { padding-block: 9px; }
.hero.career-hero--brief h1 { font-size: 16px; margin: 0 0 2px; }
.career-hero--brief .yearcard { padding: 5px 10px; min-width: 0; }
.career-hero--brief .yearcard strong { font-size: 15px; }
#training-heading { scroll-margin-block-start: 16px; }
.retire-action { background: #fff; color: #536477; border: 1px solid var(--line); }
.retire-action:hover { background: #f5f7fa; color: var(--ink); }
.home-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  width: 100%;
  min-height: 58px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid #edf0f5;
  background: transparent;
  text-align: start;
  color: var(--ink);
}
.home-link:last-child { border-bottom: 0; }
.home-link strong, .home-link .micro { display: block; }
.home-link strong { font-size: 14px; }
.home-link:hover strong { color: var(--blue); }
.home-link .micro { color: var(--muted); font-size: 12px; margin-top: 3px; }
.home-icon {
  flex: 0 0 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--pale-blue);
  color: var(--blue);
  border-radius: 12px;
}
.home-icon svg { width: 20px; height: 20px; }
.link-arrow { margin-inline-start: auto; color: #778496; font-size: 21px; }
.home-updates { display: grid; }
.home-quick .cardhead, .home-updates .cardhead { margin: 0 0 4px; }
.career-page [data-action="archive"] { min-height: 44px; }

@media (max-width: 700px) {
  :root { --app-gutter: 13px; --nav-height: 62px; --app-header-height: 55px; }
  .topin { gap: 8px; min-height: 55px; }
  .brand { font-size: 16px; gap: 7px; }
  .brand-icon { width: 32px; height: 32px; }
  .right-actions { flex-wrap: nowrap; }
  .right-actions .play-help { padding-inline: 4px; font-size: 12px; }
  .topbtn { min-height: 36px; padding: 6px 8px; font-size: 12px; }
  .shell { padding-inline: var(--app-gutter); }
  .setup-progress { margin-bottom: 16px; }
  .setup-heading { margin-bottom: 14px; }
  .setup-content, .avatar-stage { border-radius: 16px; }
  .avatar-stage { padding: 13px; }
  .avatar-preview { min-height: 88px; padding: 3px 10px; }
  .avatar-preview img { width: 59px; height: 76px; }
  .avatar-preview b { font-size: 15px; }
  .avatar-controls { padding-top: 10px; }
  .avatar-grid { gap: 6px; }
  .avatar-choice { height: clamp(63px, 17vw, 90px); border-radius: 10px; padding: 3px; }
  .field input, .field select { min-height: 46px; font-size: 16px; }
  .setup-form { padding: 15px; gap: 11px; }
  .setup-intro .intro-copy { padding: 14px; }
  .hero.career-hero, .hero { gap: 9px; padding: 13px; align-items: center; }
  .hero.career-hero { display: flex; }
  .career-hero-portrait { width: 48px; height: 58px; flex-basis: 48px; }
  .hero h1 { margin: 2px 0 3px; font-size: 20px; }
  .hero p, .hero .eyebrow { font-size: 12px; }
  .yearcard { width: auto; min-width: 67px; padding: 8px; align-items: flex-end; }
  .yearcard strong { font-size: 17px; }
  .yearcard span { font-size: 10px; }
  .card { padding: 15px; border-radius: 15px; }
  .career-facts > * { padding-inline: 8px; }
  .career-layout, .stack { gap: 10px; }
  .training-grid, .scoregrid { gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .training { padding: 10px; }
  .act-grid { grid-template-columns: 1fr; }
  .overlay { align-items: end; padding: 0; }
  .modal {
    width: min(100%, var(--app-width));
    max-height: 91vh;
    max-height: 91dvh;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0;
    margin-inline: auto;
  }
  .modal h2 { font-size: 21px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer > button { flex: 1 1 110px; }
  .career-art--outcome { max-height: 162px; }
  .vote-table th, .vote-table td { padding: 8px 6px; }
  .btn { min-height: 45px; }
}
@media (max-width: 370px) {
  :root { --app-gutter: 9px; }
  .brand small { display: none; }
  .topin, .right-actions { gap: 4px; }
  .topin:has(.play-help) .brand { font-size: 14px; gap: 4px; }
  .topin:has(.play-help) .brand-icon { display: none; }
  .right-actions .play-help { padding-inline: 2px; }
  .topbtn { padding-inline: 6px; }
  .setup-heading h1 { font-size: 23px; }
  .career-hero-portrait { width: 39px; height: 49px; flex-basis: 39px; }
  .hero h1 { font-size: 18px; }
  .career-facts { padding-inline: 4px; }
  .career-facts > * { padding-inline: 6px; }
}
@media (max-width: 590px) {
  .hero.career-hero {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    grid-template-areas: "portrait identity year";
    gap: 11px 9px;
  }
  .hero.career-hero--training { grid-template-areas: "portrait identity year" "skills skills skills"; }
  .career-hero-portrait { grid-area: portrait; }
  .hero-copy { grid-area: identity; }
  .yearcard { grid-area: year; }
  .train-stats { grid-area: skills; padding: 10px 0 0; border-top: 1px solid var(--line); }
  .train-stats-grid { column-gap: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .career-tab, .avatar-choice { transition: none; }
}
