:root {
  color-scheme: light;
  --canvas: #f3f5f4;
  --surface: #fff;
  --surface-soft: #f7f9f8;
  --ink: #17252b;
  --muted: #64747a;
  --faint: #8b999d;
  --brand: #1d5960;
  --brand-deep: #16484e;
  --brand-pale: #e7f0ef;
  --accent: #e3a642;
  --success: #2f7257;
  --success-pale: #e8f2ec;
  --warning: #a9651f;
  --warning-pale: #faf0df;
  --critical: #a8423c;
  --critical-pale: #f8eae8;
  --line: #d9e0df;
  --shadow: 0 16px 48px rgba(23, 37, 43, .08);
  --radius: 18px;
  --font-body: 'DM Sans', 'Segoe UI', sans-serif;
  --font-display: 'Manrope', 'Segoe UI', sans-serif;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #d28b25; outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .48; }
.shell { width: min(1200px, calc(100% - 48px)); margin: 0 auto; }
.app-header { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(217,224,223,.75); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--brand); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font: 800 18px/1 var(--font-display); letter-spacing: -.055em; }
.brand-name span { color: var(--brand); }
.header-right { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }
.header-link { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 8px 0; }
.header-link:hover { color: var(--ink); }
.eyebrow { color: var(--brand); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
h1,h2,h3,p { margin-top: 0; }
h1,h2,h3 { font-family: var(--font-display); }
h1 { font-size: clamp(37px, 5vw, 58px); letter-spacing: -.065em; line-height: 1.03; margin: 14px 0 19px; }
h2 { font-size: clamp(25px, 3vw, 34px); letter-spacing: -.05em; line-height: 1.1; margin-bottom: 12px; }
h3 { font-size: 17px; letter-spacing: -.025em; margin-bottom: 7px; }
.lead { color: var(--muted); line-height: 1.65; font-size: 16px; max-width: 570px; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.5; }
.fine { font-size: 11px; color: var(--faint); line-height: 1.5; }
.display-number { font: 700 24px/1.1 var(--font-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; border: 1px solid transparent; border-radius: 12px; padding: 0 18px; font-size: 14px; font-weight: 700; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease; text-decoration: none; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--brand); box-shadow: 0 5px 14px rgba(29,89,96,.18); }
.btn-primary:hover:not(:disabled) { background: var(--brand-deep); }
.btn-secondary { color: var(--ink); background: #fff; border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-soft); border-color: #b8c4c3; }
.btn-quiet { color: var(--muted); background: transparent; border-color: transparent; }
.btn-danger { color: var(--critical); background: var(--critical-pale); }
.btn-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(23,37,43,.025); }
.card-pad { padding: 23px; }
.divider { height: 1px; background: var(--line); margin: 19px 0; }
.tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tag-brand { color: var(--brand); background: var(--brand-pale); }
.tag-success { color: var(--success); background: var(--success-pale); }
.tag-warning { color: var(--warning); background: var(--warning-pale); }
.tag-critical { color: var(--critical); background: var(--critical-pale); }
.tag-neutral { color: var(--muted); background: #edf1f0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading p { margin-bottom: 0; }
.stack { display: grid; gap: 16px; }
.empty-state { text-align: center; padding: 68px 24px; }

/* Landing and campaign */
.home-page { padding: 62px 0 80px; }
.hero { display: grid; grid-template-columns: 1fr 1.02fr; align-items: center; gap: 36px; min-height: 466px; }
.hero-copy { padding: 20px 0; }
.hero-copy .lead { margin-bottom: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hero-note { margin-top: 20px; color: var(--faint); font-size: 12px; }
.hero-art { position: relative; min-height: 400px; overflow: hidden; border-radius: 27px; background: #dfe9e6; box-shadow: var(--shadow); }
.hero-art svg { width: 100%; height: 100%; position: absolute; inset: 0; }
.hero-sticker { position: absolute; left: 22px; bottom: 20px; display: flex; align-items: center; gap: 10px; padding: 12px 15px; border: 1px solid rgba(255,255,255,.6); border-radius: 14px; color: var(--ink); background: rgba(255,255,255,.9); backdrop-filter: blur(8px); box-shadow: 0 8px 24px rgba(23,37,43,.12); }
.sticker-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--brand); background: var(--brand-pale); }
.sticker-title { font-size: 12px; font-weight: 700; }
.sticker-sub { color: var(--muted); font-size: 10px; margin-top: 2px; }
.home-bottom { display: grid; grid-template-columns: repeat(3,1fr); gap: 15px; margin-top: 39px; }
.feature { padding: 20px; }
.feature-icon { display: grid; place-items: center; width: 37px; height: 37px; margin-bottom: 14px; border-radius: 12px; color: var(--brand); background: var(--brand-pale); font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.page-main { padding: 42px 0 76px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 22px; }
.breadcrumb button { padding: 0; border: 0; background: transparent; color: var(--brand); cursor: pointer; }
.campaign-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 22px; margin-top: 29px; align-items: start; }
.contract-list { display: grid; gap: 13px; }
.contract-card { padding: 21px 22px; display: grid; grid-template-columns: 48px 1fr auto; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: border .15s, transform .15s, box-shadow .15s; }
.contract-card.available { cursor: pointer; }
.contract-card.available:hover { border-color: #a9c2c0; transform: translateY(-2px); box-shadow: 0 9px 24px rgba(23,37,43,.06); }
.contract-card.locked { opacity: .62; background: #f8faf9; }
.contract-index { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--brand); background: var(--brand-pale); font: 700 15px var(--font-display); }
.contract-card h3 { margin-bottom: 4px; }
.contract-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.campaign-aside { padding: 22px; }
.campaign-aside h3 { margin-bottom: 13px; }
.campaign-stat { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.campaign-stat:last-of-type { border-bottom: 0; }
.campaign-stat span { color: var(--muted); }

/* Bid and setup */
.brief-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 19px; margin-top: 25px; align-items: start; }
.brief-hero { min-height: 196px; padding: 27px; position: relative; overflow: hidden; color: white; background: linear-gradient(105deg, #194c50, #377476); }
.brief-hero:after { content: ''; position: absolute; width: 290px; height: 290px; right: -44px; top: -130px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; box-shadow: 0 0 0 28px rgba(255,255,255,.035), 0 0 0 62px rgba(255,255,255,.025); }
.brief-hero .eyebrow { color: #c4dfd9; }
.brief-hero h2 { max-width: 470px; margin-top: 11px; }
.brief-hero p { max-width: 470px; margin-bottom: 0; color: rgba(255,255,255,.76); font-size: 13px; line-height: 1.6; }
.brief-data { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 14px; }
.brief-data-item { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.brief-data-item span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.brief-data-item strong { font: 700 14px var(--font-display); }
.risk-list { display: grid; gap: 9px; margin-top: 12px; }
.risk-item { display: flex; gap: 11px; padding: 12px; border-radius: 12px; background: var(--surface-soft); }
.risk-symbol { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--warning); background: var(--warning-pale); font-weight: 800; }
.risk-item strong { display: block; font-size: 12px; margin-bottom: 3px; }
.risk-item span { display: block; color: var(--muted); font-size: 11px; line-height: 1.45; }
.decision-panel { padding: 23px; }
.choice-list { display: grid; gap: 9px; margin: 14px 0; }
.choice { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 13px; background: white; padding: 14px; cursor: pointer; transition: border .14s, background .14s; }
.choice:hover { border-color: #9fb7b5; }
.choice.selected { border-color: var(--brand); background: #f0f7f5; box-shadow: inset 0 0 0 1px var(--brand); }
.choice-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.choice strong { font-size: 13px; }
.choice p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.choice-metric { color: var(--brand); font-size: 11px; font-weight: 700; white-space: nowrap; }
.slider-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; font-weight: 600; }
input[type=range] { width: 100%; accent-color: var(--brand); margin: 13px 0 5px; }
.bid-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.summary-box { padding: 14px; background: var(--surface-soft); border-radius: 12px; }
.summary-box span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.summary-box strong { font: 700 17px var(--font-display); font-variant-numeric: tabular-nums; }
.setup-layout { display: grid; grid-template-columns: 1fr .8fr; gap: 18px; margin-top: 25px; align-items: start; }
.allocation-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 17px 0 8px; }
.allocation-summary strong { font-size: 13px; }
.allocation-summary p { max-width: 420px; margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.allocation-total { flex: 0 0 auto; padding: 7px 10px; border-radius: 9px; background: var(--surface-soft); color: var(--brand); font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.allocation-controls { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.allocation-control { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfb; }
.allocation-control label { display: flex; min-height: 42px; align-items: flex-start; justify-content: space-between; gap: 8px; }
.allocation-control label strong,.allocation-control label small { display: block; }
.allocation-control label strong { font-size: 11px; }
.allocation-control label small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.allocation-count { flex: 0 0 auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.allocation-count b { color: var(--ink); font: 700 15px var(--font-display); font-variant-numeric: tabular-nums; }
.allocation-control input[type=range] { margin: 10px 0 1px; }
.allocation-status { min-height: 18px; margin: 8px 0 4px; font-size: 11px; font-weight: 650; }
.allocation-status.ready { color: var(--success); }
.allocation-status.needs-points { color: var(--warning); }
.allocation-impact { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; overflow: hidden; margin: 10px 0 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.allocation-impact > div { min-width: 0; padding: 10px 11px; background: #fbfcfb; }
.allocation-impact span,.allocation-impact strong { display: block; }
.allocation-impact span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.allocation-impact strong { margin-top: 4px; font-size: 12px; font-variant-numeric: tabular-nums; }
.team-capacity-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 14px; color: var(--muted); font-size: 11px; }
.team-capacity-line strong { color: var(--ink); font-size: 10px; font-variant-numeric: tabular-nums; }
.select-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.select-row:last-child { border-bottom: 0; }
.select-row strong { display: block; font-size: 13px; }
.select-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.select-row select { min-width: 152px; padding: 9px 30px 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 12px; }
.contract-value { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0; font-size: 12px; }
.contract-value strong { font: 700 15px var(--font-display); }

/* Project dashboard */
.project-page { padding: 23px 0 56px; }
.project-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.project-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 11px; }
.project-title h1 { margin: 0; font-size: 25px; letter-spacing: -.05em; }
.project-title span { font-size: 12px; color: var(--muted); }
.project-controls { display: flex; align-items: center; gap: 13px; }
.save-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.save-status svg { color: var(--success); }
.metric-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; }
.metric-card { min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; text-align: left; transition: border .15s; }
.metric-card:hover { border-color: #a5b9b7; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--muted); font-size: 10px; }
.metric-state { font-size: 9px; font-weight: 700; }
.metric-value { display: block; margin-top: 7px; font: 700 19px/1.1 var(--font-display); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.metric-note { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crew-load-strip { display: grid; grid-template-columns: auto minmax(100px,.65fr) minmax(220px,1.6fr); align-items: center; gap: 15px; margin-top: 10px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.crew-load-copy { display: flex; align-items: baseline; gap: 9px; white-space: nowrap; }
.crew-load-copy .eyebrow { margin: 0; font-size: 9px; }
.crew-load-copy strong { font-size: 11px; }
.crew-load-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e8edeb; }
.crew-load-track span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .2s ease; }
.crew-load-strip p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.crew-load-strip.rising .crew-load-track span { background: var(--warning); }
.crew-load-strip.high .crew-load-track span { background: #c66d35; }
.crew-load-strip.critical .crew-load-track span { background: var(--critical); }
.workspace-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(320px,.8fr); gap: 15px; margin-top: 15px; align-items: start; }
.workspace-main { display: grid; gap: 14px; min-width: 0; }
.workspace-rail { display: grid; gap: 14px; min-width: 0; }
.site-card { padding: 20px 21px 18px; overflow: hidden; }
.site-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; margin-bottom: 15px; }
.site-head h2 { font-size: 19px; margin-bottom: 5px; }
.site-head p { margin: 0; color: var(--muted); font-size: 11px; }
.week-pill { color: var(--brand); background: var(--brand-pale); padding: 7px 10px; border-radius: 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.site-illustration { position: relative; height: 190px; overflow: hidden; border-radius: 13px; background: #e9efeb; }
.site-scene-stage { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, #b9d2d5 0%, #dce4d9 55%, #8d9b88 100%); cursor: grab; touch-action: pan-y; }
.site-scene-stage:active { cursor: grabbing; }
.site-scene-stage canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
.scene-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: #34554e; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.scene-loading-dot,.scene-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #70bd79; box-shadow: 0 0 0 4px rgba(112,189,121,.2); }
.site-scene-overlay { position: absolute; z-index: 1; top: 10px; left: 11px; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid rgba(255,255,255,.56); border-radius: 999px; color: #f8fbf6; background: rgba(17,39,39,.63); box-shadow: 0 4px 15px rgba(15,31,28,.12); backdrop-filter: blur(8px); font-size: 8px; font-weight: 800; letter-spacing: .1em; pointer-events: none; }
.site-scene-overlay .scene-live-dot { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(112,189,121,.17); }
.site-scene-overlay.is-complete .scene-live-dot { background: #9be5a5; box-shadow: 0 0 0 3px rgba(112,189,121,.26),0 0 12px rgba(112,220,136,.7); }
.scene-progress-overlay { position: absolute; z-index: 2; left: 11px; bottom: 10px; display: flex; align-items: center; gap: 8px; min-width: 152px; max-width: min(240px,72%); padding: 7px 9px; color: #f8fbf6; border: 1px solid rgba(255,255,255,.4); border-radius: 10px; background: rgba(17,39,39,.72); box-shadow: 0 4px 15px rgba(15,31,28,.12); backdrop-filter: blur(8px); font-size: 9px; font-weight: 750; }
.scene-progress-overlay strong { overflow: hidden; max-width: 88px; text-overflow: ellipsis; white-space: nowrap; }
.scene-progress-overlay > span:last-child { min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.scene-progress-track { position: relative; flex: 1; min-width: 24px; height: 5px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.3); }
.scene-progress-track i { display: block; height: 100%; border-radius: inherit; background: #91d88f; transition: width .45s ease; }
.scene-control-hint { position: absolute; z-index: 2; right: 10px; bottom: 12px; color: rgba(248,251,246,.88); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-shadow: 0 1px 5px rgba(0,0,0,.6); pointer-events: none; }
.scene-overlay-divider { width: 1px; height: 11px; margin-inline: 1px; background: rgba(255,255,255,.34); }
.site-scene-fallback { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; color: #344b46; text-align: center; background: linear-gradient(160deg,#cad8d4,#91a89c); }
.site-scene-fallback strong { font-size: 14px; }
.site-scene-fallback span { font-size: 11px; }
.milestone-wrap { margin-top: 17px; }
.milestone-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin-bottom: 10px; }
.milestone-bar { display: grid; grid-template-columns: repeat(6,1fr); gap: 5px; }
.milestone-segment { position: relative; height: 6px; border-radius: 999px; background: #e6ebea; }
.milestone-segment.done { background: var(--brand); }
.milestone-segment.current { background: linear-gradient(90deg,var(--brand) 50%,#e6ebea 50%); }
.milestone-labels { display: grid; grid-template-columns: repeat(6,1fr); gap: 5px; margin-top: 7px; }
.milestone-label { color: var(--faint); font-size: 9px; line-height: 1.25; text-align: center; }
.milestone-label.active,.milestone-label.done { color: var(--brand); font-weight: 700; }
.package-card { padding: 19px 20px; }
.package-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.package-header h3 { margin: 0; }
.package-list { display: grid; }
.package-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 11px; align-items: center; padding: 11px 0; border-top: 1px solid #edf0ef; }
.package-marker { width: 25px; height: 25px; display: grid; place-items: center; color: var(--muted); background: #edf1f0; border-radius: 50%; font-size: 10px; font-weight: 700; }
.package-marker.done { color: #fff; background: var(--success); }
.package-marker.active { color: #fff; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-pale); }
.package-marker.watch { color: #fff; background: var(--warning); }
.package-marker.blocked { color: #fff; background: var(--critical); }
.package-copy strong { display: block; font-size: 12px; }
.package-copy span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.package-state { font-size: 10px; font-weight: 700; color: var(--muted); }
.package-state.done { color: var(--success); }
.package-state.active { color: var(--brand); }
.package-state.watch { color: var(--warning); }
.package-state.blocked { color: var(--critical); }
.delivery-notice { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 13px; padding: 11px 12px; border-left: 3px solid var(--brand); border-radius: 0 9px 9px 0; background: var(--brand-pale); }
.delivery-notice strong { font-size: 11px; }
.delivery-notice span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.delivery-notice.at-risk { border-left-color: var(--warning); background: var(--warning-pale); }
.delivery-notice.protected { border-left-color: var(--success); background: var(--success-pale); }
.panel { padding: 19px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-title h3 { margin: 0; }
.constraint-box { padding: 13px; border-radius: 12px; background: var(--warning-pale); }
.constraint-label { color: var(--warning); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.constraint-box strong { display: block; margin-top: 5px; font-size: 13px; }
.constraint-box p { margin: 5px 0 0; color: #775b3b; font-size: 11px; line-height: 1.5; }
.event-summary { padding: 13px; border: 1px solid var(--line); border-radius: 12px; margin-top: 11px; }
.event-summary .eyebrow { font-size: 9px; }
.event-summary strong { display: block; margin: 5px 0; font-size: 12px; }
.event-summary p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.decision-card { padding: 20px; border: 1px solid #bbd0cc; background: linear-gradient(135deg,#fff 55%,#f3f8f6); }
.tutorial-hint { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border-color: #d6c08f; background: #fffaf0; }
.hint-mark { flex: 0 0 26px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; color: #7b5b20; background: #f4e5c1; font-weight: 800; font-size: 12px; }
.hint-copy { flex: 1; min-width: 0; }
.hint-copy .eyebrow { color: #8b671f; font-size: 9px; }
.hint-copy strong { display: block; margin-top: 4px; font-size: 12px; }
.hint-copy p { margin: 4px 0 0; color: #68583b; font-size: 10px; line-height: 1.5; }
.hint-dismiss { border: 0; padding: 5px 2px; color: #725a2c; background: transparent; font-size: 10px; font-weight: 700; cursor: pointer; }
.hint-dismiss:hover { color: var(--ink); }
.decision-card h3 { font-size: 16px; }
.decision-card > p { color: var(--muted); font-size: 12px; line-height: 1.55; margin-bottom: 14px; }
.decision-option { padding: 12px; }
.decision-option p { font-size: 10px; }
.decision-effect { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.effect-chip { padding: 4px 7px; border-radius: 7px; background: #f0f3f2; color: var(--muted); font-size: 9px; font-weight: 600; }
.report-mini { padding: 17px; }
.report-mini h3 { margin-bottom: 12px; }
.report-line { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid #edf0ef; }
.report-line:first-of-type { border-top: 0; padding-top: 0; }
.report-icon { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; color: var(--brand); background: var(--brand-pale); font-size: 11px; }
.report-line strong { display: block; font-size: 11px; }
.report-line span { display: block; color: var(--muted); font-size: 10px; line-height: 1.4; margin-top: 3px; }
.workspace-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.workspace-bottom p { margin: 0; color: var(--muted); font-size: 11px; }
.bottom-tabs { display: flex; gap: 6px; }
.tab-button { border: 0; border-radius: 9px; padding: 9px 11px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.tab-button:hover,.tab-button.active { color: var(--brand); background: var(--brand-pale); font-weight: 700; }
.turn-action { min-width: 166px; }

/* Reports and results */
.report-page,.result-page { padding: 49px 0 76px; }
.report-banner { padding: 22px; color: #fff; background: var(--brand); border-radius: var(--radius) var(--radius) 0 0; }
.report-banner .eyebrow { color: #c8dedb; }
.report-banner h2 { margin: 7px 0 5px; }
.report-banner p { margin: 0; color: rgba(255,255,255,.76); font-size: 12px; }
.report-body { padding: 22px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); background: #fff; }
.report-changes { display: grid; grid-template-columns: repeat(7,1fr); gap: 9px; margin: 16px 0; }
.change-box { padding: 13px; border-radius: 11px; background: var(--surface-soft); }
.change-box span { display: block; color: var(--muted); font-size: 10px; }
.change-box strong { display: block; margin-top: 5px; font: 700 16px var(--font-display); }
.result-hero { text-align: center; max-width: 700px; margin: 5px auto 27px; }
.result-icon { width: 61px; height: 61px; display: grid; place-items: center; margin: 0 auto 17px; border-radius: 20px; color: var(--success); background: var(--success-pale); font-size: 25px; }
.result-hero h1 { font-size: clamp(34px,5vw,49px); }
.result-hero .lead { margin-left: auto; margin-right: auto; }
.completed-site-card { margin: 0 auto 18px; padding: 16px; overflow: hidden; }
.completed-site-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin: 0 2px 12px; }
.completed-site-heading h2 { margin: 4px 0; font: 750 20px var(--font-display); letter-spacing: -.035em; }
.completed-site-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.completed-site-badge { flex: 0 0 auto; padding: 8px 10px; color: #1a6944; border: 1px solid #cce8d4; border-radius: 999px; background: #eaf7ec; font-size: 9px; font-weight: 850; letter-spacing: .07em; }
.completed-site-view { height: clamp(270px,40vw,430px); border: 1px solid rgba(37,76,67,.12); border-radius: 15px; }
.completed-site-caption { display: flex; justify-content: space-between; gap: 12px; margin: 10px 3px 0; color: var(--muted); font-size: 10px; }
.score-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; }
.score-card { padding: 17px; }
.score-card span { display: block; color: var(--muted); font-size: 11px; }
.score-card strong { display: block; margin: 9px 0 5px; font: 700 25px var(--font-display); letter-spacing: -.04em; }
.score-card p { margin: 0; color: var(--muted); font-size: 10px; }
.result-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 15px; }
.lesson { display: flex; gap: 11px; padding: 12px 0; border-top: 1px solid #edf0ef; }
.lesson:first-child { border-top: 0; padding-top: 0; }
.lesson-mark { display: grid; flex: 0 0 28px; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--brand); background: var(--brand-pale); font-weight: 700; }
.lesson strong { display: block; font-size: 12px; }
.lesson p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.result-footer { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }

/* Dialogs */
.dialog-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(19,34,37,.45); backdrop-filter: blur(5px); }
.dialog { width: min(460px,100%); padding: 23px; background: #fff; border-radius: 18px; box-shadow: 0 24px 80px rgba(14,29,32,.23); }
.dialog h2 { font-size: 23px; }
.dialog p { color: var(--muted); line-height: 1.6; font-size: 13px; }
.dialog-actions { display: flex; justify-content: end; gap: 9px; margin-top: 20px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.switch { position: relative; width: 42px; height: 24px; appearance: none; border: 0; border-radius: 20px; background: #cbd4d2; cursor: pointer; transition: background .15s; }
.switch:before { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform .15s; }
.switch:checked { background: var(--brand); }
.switch:checked:before { transform: translateX(18px); }
.toast { position: fixed; z-index: 30; right: 22px; bottom: 22px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 12px; box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr 1fr; gap: 20px; min-height: 390px; }
  .hero-art { min-height: 355px; }
  .workspace-grid { grid-template-columns: minmax(0,1.15fr) minmax(285px,.85fr); gap: 11px; }
  .metric-card { padding: 12px; }
  .metric-value { font-size: 17px; }
  .brief-grid,.setup-layout { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .shell { width: min(100% - 30px, 560px); }
  .app-header { height: 64px; }
  .header-right { gap: 10px; }
  .home-page { padding-top: 28px; }
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 25px; }
  .hero-copy { padding: 13px 0 0; }
  .hero-copy h1 { max-width: 560px; }
  .hero-art { min-height: 290px; }
  .home-bottom { grid-template-columns: 1fr; margin-top: 20px; }
  .feature { display: grid; grid-template-columns: 38px 1fr; gap: 0 13px; padding: 16px; }
  .feature-icon { grid-row: span 2; margin-bottom: 0; }
  .feature h3 { margin-bottom: 4px; }
  .page-main { padding: 27px 0 55px; }
  .campaign-grid,.brief-grid,.setup-layout { grid-template-columns: 1fr; }
  .brief-data { grid-template-columns: repeat(3,1fr); }
  .contract-card { grid-template-columns: 42px 1fr auto; gap: 12px; padding: 16px; }
  .contract-index { width: 40px; height: 40px; }
  .project-page { padding-top: 15px; }
  .project-top { align-items: flex-start; flex-direction: column; gap: 11px; }
  .project-controls { width: 100%; justify-content: space-between; }
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .metric-card:last-child { grid-column: span 2; }
  .crew-load-strip { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .crew-load-track { width: 100px; }
  .crew-load-strip p { grid-column: 1 / -1; }
  .workspace-grid { grid-template-columns: 1fr; }
  .workspace-rail { grid-row: 1; }
  .site-illustration { height: 170px; }
  .workspace-bottom { flex-wrap: wrap; }
  .bottom-tabs { order: 3; width: 100%; overflow: auto; }
  .turn-action { margin-left: auto; }
  .score-grid { grid-template-columns: repeat(2,1fr); }
  .score-card:last-child { grid-column: span 2; }
  .result-lower { grid-template-columns: 1fr; }
  .report-changes { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 420px) {
  .shell { width: calc(100% - 24px); }
  .brand-name { font-size: 16px; }
  .header-right { font-size: 11px; }
  .hero-art { min-height: 245px; }
  .hero-actions .btn { flex: 1; }
  .brief-data { grid-template-columns: 1fr; }
  .contract-card { grid-template-columns: 38px 1fr; }
  .contract-card > :last-child { grid-column: 2; justify-self: start; }
  .select-row { grid-template-columns: 1fr; }
  .select-row select { width: 100%; }
  .allocation-impact { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .allocation-controls { grid-template-columns: 1fr; }
  .allocation-control label { min-height: 0; }
  .site-card,.panel,.decision-card { padding: 15px; }
  .site-illustration { height: 145px; }
  .milestone-label { font-size: 8px; }
  .workspace-bottom p { max-width: 60%; }
  .turn-action { min-width: 145px; padding: 0 12px; }
  .result-footer { flex-direction: column; }
  .result-footer .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.reduced-motion *, .reduced-motion *:before, .reduced-motion *:after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

/* Fieldwork game UI refresh: phone-sized base, expanded for larger screens. */
:root {
  --canvas: #f1f3eb;
  --surface: #fffefa;
  --surface-soft: #f4f6ef;
  --ink: #162a25;
  --muted: #60746c;
  --faint: #81918a;
  --brand: #176149;
  --brand-deep: #104936;
  --brand-pale: #e2f0e5;
  --accent: #f3c34f;
  --success: #287352;
  --success-pale: #e2f1e6;
  --warning: #9c601b;
  --warning-pale: #fbf0d9;
  --critical: #a33e36;
  --critical-pale: #fae9e5;
  --line: #d8e1d8;
  --shadow: 0 18px 55px rgba(22, 42, 37, .12);
  --radius: 19px;
}

html { background: var(--canvas); }
body {
  min-width: 320px;
  background:
    radial-gradient(ellipse at 95% 0%, rgba(206, 224, 202, .42), transparent 31rem),
    var(--canvas);
  color: var(--ink);
}
.shell { width: min(1160px, calc(100% - 24px)); }
h1 { font-size: clamp(38px, 11vw, 55px); line-height: .99; letter-spacing: -.075em; }
h2 { letter-spacing: -.06em; }
.lead { line-height: 1.55; }
.btn {
  min-height: 52px;
  border-radius: 15px;
  padding-inline: 18px;
  font-size: 14px;
  letter-spacing: -.01em;
}
.btn-primary { color: #173127; background: var(--accent); box-shadow: 0 7px 18px rgba(173, 126, 22, .2); }
.btn-primary:hover:not(:disabled) { background: #ffd36d; }
.btn-secondary { background: var(--surface); }
input[type=range] { min-height: 38px; accent-color: var(--brand); }
select { min-height: 46px; }

.app-header {
  position: sticky;
  z-index: 15;
  top: max(6px, env(safe-area-inset-top));
  height: 62px;
  margin: 6px auto 0;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  background: linear-gradient(110deg, #14392f, #1b4938);
  box-shadow: 0 9px 26px rgba(15, 47, 37, .19);
}
.brand { gap: 9px; color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 12px; color: #173127; background: var(--accent); }
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { color: #fff; font-size: 17px; letter-spacing: -.06em; }
.brand-name span { color: #c6df9d; }
.header-right { gap: 8px; color: #fff; }
.header-context { display: none; color: #b8c9bf; font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.header-reputation {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 37px;
  padding: 0 10px;
  border: 1px solid rgba(243,195,79,.27);
  border-radius: 12px;
  color: #ffe08a;
  background: rgba(243,195,79,.12);
  font-size: 12px;
}
.header-reputation > span { font-size: 14px; }
.header-reputation strong { color: #fff; font: 800 14px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.header-reputation small { color: #ffe08a; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 42px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  color: #ecf3eb;
  background: rgba(255,255,255,.08);
  cursor: pointer;
}
.header-link:hover { color: #fff; background: rgba(255,255,255,.15); }
.header-link [aria-hidden="true"] { font-size: 17px; line-height: 1; }

.home-page { padding: 18px 0 46px; }
.hero { display: flex; flex-direction: column; align-items: stretch; gap: 0; min-height: 0; }
.hero-art {
  order: -1;
  min-height: 0;
  height: clamp(220px, 66vw, 310px);
  border: 5px solid rgba(255,255,255,.74);
  border-radius: 25px;
  background: #c7d9cc;
  box-shadow: 0 15px 38px rgba(25, 58, 44, .16);
}
.hero-art:after {
  content: '';
  position: absolute;
  inset: 45% 0 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(12,35,28,.22));
}
.hero-sticker { left: 12px; bottom: 12px; padding: 10px 12px; border-radius: 14px; }
.hero-sticker > span:last-child { display: grid; gap: 2px; }
.sticker-title,.sticker-sub { display: block; }
.hero-copy { padding: 23px 4px 0; }
.hero-copy .eyebrow { display: inline-flex; margin-bottom: 2px; }
.hero-copy h1 { margin: 10px 0 12px; }
.hero-copy .lead { margin-bottom: 19px; font-size: 15px; }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.hero-actions .btn { min-height: 54px; }
.hero-note { margin-top: 12px; font-size: 11px; }
.home-bottom { grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
.feature { display: grid; grid-template-columns: 40px 1fr; gap: 0 12px; padding: 15px; border-radius: 17px; }
.feature-icon { grid-row: span 2; width: 38px; height: 38px; margin: 0; border-radius: 13px; color: var(--brand); background: var(--brand-pale); }
.feature h3 { align-self: end; margin-bottom: 3px; font-size: 14px; }
.feature p { font-size: 12px; }

.page-main { padding: 20px 0 50px; }
.breadcrumb { min-height: 32px; margin-bottom: 17px; }
.page-main > h1 { margin: 9px 0 10px; }
.page-main > .lead { margin-bottom: 18px; font-size: 14px; }
.section-heading { align-items: center; margin-bottom: 14px; }
.section-heading h2 { font-size: 22px; }
.campaign-grid,.brief-grid,.setup-layout { grid-template-columns: 1fr; gap: 15px; margin-top: 18px; }
.career-progress {
  margin: 18px 0 22px;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 18px;
  color: #f5f7e8;
  background: linear-gradient(115deg, #183b31, #245744);
  box-shadow: 0 10px 24px rgba(21,62,47,.13);
}
.career-progress-head,.career-progress-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.career-progress-head { font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.career-progress-head > span { display: inline-flex; align-items: center; gap: 7px; color: #cad8c9; }
.career-progress-head i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(243,195,79,.15); }
.career-progress-head strong { color: #ffe08a; font-size: 10px; letter-spacing: .04em; }
.career-progress-track { height: 8px; margin: 12px 0 9px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.13); }
.career-progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f3c34f, #f8df8b); box-shadow: 0 0 12px rgba(243,195,79,.45); }
.career-progress-foot { color: #bdd0c2; font-size: 10px; }
.contract-list { position: relative; gap: 11px; }
.contract-list:before { content: ''; position: absolute; top: 30px; bottom: 30px; left: 21px; width: 2px; background: linear-gradient(var(--brand), #d8e1d8 88%); }
.contract-card {
  position: relative;
  z-index: 1;
  grid-template-columns: 44px minmax(0,1fr) auto;
  gap: 11px;
  min-height: 88px;
  padding: 13px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(22,42,37,.055);
}
.contract-card.available:hover { border-color: #a9c7b5; transform: translateY(-2px); box-shadow: 0 12px 24px rgba(22,42,37,.1); }
.contract-card.available:active { transform: scale(.99); }
.contract-card.locked { background: #f0f2ec; }
.contract-index { width: 42px; height: 42px; border: 3px solid var(--surface); border-radius: 15px; color: #173127; background: var(--accent); box-shadow: 0 0 0 1px var(--line); }
.contract-card h3 { margin-bottom: 5px; font-size: 14px; }
.contract-card p { font-size: 11px; }
.contract-card .tag { padding: 7px 9px; font-size: 9px; }
.campaign-aside { padding: 19px; border: 0; border-radius: 20px; color: #edf4e9; background: linear-gradient(145deg,#1c3d32,#142d26); box-shadow: 0 12px 28px rgba(21,54,42,.15); }
.campaign-aside .eyebrow { color: #b5d790; }
.campaign-aside h3 { margin: 7px 0 12px; color: #fff; font-size: 20px; }
.campaign-aside .campaign-stat { border-color: rgba(255,255,255,.12); }
.campaign-aside .campaign-stat span { color: #b7c9bd; }
.campaign-aside .campaign-stat strong { color: #f5d77b; }
.campaign-aside .divider { background: rgba(255,255,255,.14); }
.campaign-aside p { color: #c1d0c5; }
.campaign-aside .btn-secondary { color: #15362b; background: #eef2e6; border-color: transparent; }

.card { border-radius: 19px; box-shadow: 0 6px 18px rgba(22,42,37,.045); }
.card-pad { padding: 17px; }
.brief-hero { min-height: 180px; padding: 21px; border-radius: 20px; background: linear-gradient(120deg,#174d3d,#2e765a); box-shadow: 0 13px 30px rgba(21,77,58,.18); }
.brief-hero h2 { font-size: 27px; }
.brief-data { grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
.brief-data-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; }
.brief-data-item span { margin: 0; font-size: 10px; }
.brief-data-item strong { font-size: 12px; text-align: right; }
.decision-panel { padding: 17px; border-radius: 19px; background: var(--surface); }
.choice { min-height: 70px; padding: 14px; border-radius: 15px; }
.choice:hover { border-color: #a8c9b6; background: #f7faf4; }
.choice.selected { border-color: var(--brand); background: linear-gradient(110deg,#eaf4e8,#f5f6e9); box-shadow: inset 4px 0 0 var(--accent); }
.choice-head strong { font-size: 13px; }
.choice p { font-size: 11px; }
.bid-summary { gap: 8px; }
.summary-box { border: 1px solid var(--line); background: #f5f7ef; }
.setup-layout > .card { border-radius: 19px; }
.allocation-controls { grid-template-columns: 1fr; gap: 9px; }
.allocation-control { padding: 14px; border-radius: 15px; }
.allocation-control label { min-height: 0; }
.allocation-control label strong { font-size: 12px; }
.allocation-control label small { font-size: 10px; }
.allocation-control input[type=range] { min-height: 42px; }
.allocation-impact { grid-template-columns: repeat(2,minmax(0,1fr)); }
.allocation-impact > div { padding: 11px; }
.select-row { grid-template-columns: 1fr; gap: 8px; }
.select-row select { width: 100%; }

.project-page { padding: 15px 0 calc(112px + env(safe-area-inset-bottom)); }
.project-top { align-items: flex-start; flex-direction: column; gap: 9px; margin-bottom: 13px; }
.project-title { display: block; }
.project-title h1 { font-size: 23px; line-height: 1.08; }
.project-title span { display: block; margin-top: 5px; font-size: 11px; }
.project-controls { width: 100%; justify-content: space-between; gap: 8px; }
.save-status { min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.7); }
.project-controls .header-link { color: var(--brand); border-color: var(--line); background: var(--surface); }
.metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.metric-card { min-height: 97px; padding: 12px; border-radius: 16px; background: var(--surface); box-shadow: 0 5px 14px rgba(22,42,37,.045); }
.metric-card:last-child { grid-column: 1 / -1; min-height: 82px; }
.metric-top { align-items: flex-start; color: var(--muted); font-size: 9px; }
.metric-state { text-align: right; font-size: 8px; letter-spacing: .04em; }
.metric-value { margin-top: 8px; font-size: 20px; }
.metric-note { margin-top: 4px; font-size: 9px; }
.crew-load-strip { grid-template-columns: minmax(0,1fr) auto; gap: 8px 11px; margin-top: 9px; padding: 12px; border-radius: 15px; background: var(--surface); }
.crew-load-copy { display: block; white-space: normal; }
.crew-load-copy .eyebrow { display: block; margin-bottom: 3px; font-size: 8px; }
.crew-load-copy strong { font-size: 10px; }
.crew-load-track { width: 88px; }
.crew-load-strip p { grid-column: 1 / -1; font-size: 10px; }
.workspace-grid { grid-template-columns: minmax(0,1fr); gap: 12px; margin-top: 12px; }
.workspace-main,.workspace-rail { min-width: 0; }
.workspace-rail { grid-row: auto; }
.workspace-main { gap: 11px; }
.site-card,.package-card,.panel,.decision-card,.report-mini { padding: 15px; border-radius: 19px; }
.site-head { align-items: center; gap: 8px; }
.site-head h2 { font-size: 18px; }
.site-head p { max-width: 210px; font-size: 10px; }
.week-pill { padding: 7px 9px; font-size: 9px; }
.site-illustration { height: 210px; border-radius: 15px; }
.milestone-wrap { margin-top: 15px; }
.milestone-top { font-size: 10px; }
.milestone-bar { gap: 4px; }
.milestone-segment { height: 8px; }
.milestone-labels { gap: 3px; }
.milestone-label { font-size: 8px; }
.package-card { padding-inline: 16px; }
.package-row { grid-template-columns: 29px minmax(0,1fr) auto; gap: 8px; }
.package-copy strong { font-size: 11px; }
.package-copy span { font-size: 9px; }
.package-state { font-size: 9px; }
.decision-card { border: 1px solid #bed5c0; background: linear-gradient(145deg,#fffefa,#f1f7ea); box-shadow: 0 10px 26px rgba(29,74,51,.08); }
.decision-card > .eyebrow { display: inline-flex; padding: 6px 9px; border-radius: 8px; color: #744d10; background: #faedc9; }
.decision-card h3 { margin-top: 10px !important; font-size: 20px; }
.decision-card > p { font-size: 12px; }
.decision-option { min-height: 78px; padding: 13px; }
.decision-effect { gap: 5px; }
.effect-chip { font-size: 9px; }
.decision-card > .btn-primary { min-height: 56px; }
.workspace-bottom { position: fixed; z-index: 14; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom)); width: min(460px, calc(100vw - 20px)); padding: 6px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.16); border-radius: 19px; background: rgba(20,48,38,.97); box-shadow: 0 13px 34px rgba(14,34,26,.3); backdrop-filter: blur(18px); }
.workspace-bottom > p { display: none; }
.bottom-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; width: 100%; overflow: visible; }
.tab-button { min-width: 0; min-height: 47px; padding: 8px 2px; border-radius: 13px; color: #c7d6cb; font-size: 9px; font-weight: 650; white-space: nowrap; }
.tab-button:hover,.tab-button.active { color: #18352a; background: #e3f0b4; font-weight: 800; }
.workspace-grid + .fine { margin-bottom: 10px; }

.report-page,.result-page { padding: 22px 0 calc(46px + env(safe-area-inset-bottom)); }
.report-banner { padding: 18px; border-radius: 19px 19px 0 0; }
.report-banner h2 { font-size: 22px; }
.report-body { padding: 16px; border-radius: 0 0 19px 19px; }
.report-changes { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.change-box { min-height: 76px; padding: 11px; }
.change-box span { font-size: 9px; }
.change-box strong { font-size: 15px; }
.result-hero { margin: 12px auto 20px; }
.completed-site-card { margin-bottom: 13px; padding: 13px; border-radius: 19px; }
.completed-site-heading { align-items: start; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.completed-site-heading h2 { font-size: 18px; }
.completed-site-badge { padding: 7px 9px; font-size: 8px; }
.completed-site-view { height: 300px; border-radius: 13px; }
.completed-site-caption { flex-direction: column; gap: 3px; font-size: 9px; }
.result-icon { width: 56px; height: 56px; border-radius: 18px; }
.score-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.score-card { padding: 13px; border-radius: 16px; }
.score-card:last-child { grid-column: 1 / -1; }
.score-card strong { font-size: 23px; }
.result-lower { grid-template-columns: 1fr; gap: 11px; margin-top: 12px; }
.result-footer { flex-direction: column; gap: 8px; }
.result-footer .btn { width: 100%; }

.dialog-backdrop { align-items: end; padding: 0; }
.dialog {
  width: 100%;
  max-height: calc(100dvh - max(10px, env(safe-area-inset-top)));
  overflow: auto;
  padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 25px 25px 0 0;
}
.dialog h2 { font-size: 25px; }
.dialog-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.setting-row { min-height: 66px; padding: 14px 0; }
.switch { flex: 0 0 auto; width: 48px; height: 28px; }
.switch:before { width: 22px; height: 22px; }
.switch:checked:before { transform: translateX(20px); }
.toast { right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); left: 12px; text-align: center; }

@media (max-width: 390px) {
  .shell { width: calc(100% - 30px); }
  .header-reputation { min-height: 35px; padding-inline: 8px; }
  .hero-art { height: 218px; }
  .hero-actions { grid-template-columns: 1fr; }
  .contract-card { grid-template-columns: 40px minmax(0,1fr); padding: 12px; }
  .contract-card > :last-child { grid-column: 2; justify-self: start; }
  .contract-index { width: 38px; height: 38px; }
  .career-progress { padding: 13px; }
  .career-progress-head { font-size: 9px; }
  .career-progress-foot { font-size: 9px; }
  .site-card,.panel,.decision-card { padding: 13px; }
  .site-illustration { height: 190px; }
  .workspace-bottom { width: min(460px, calc(100vw - 30px)); }
  .milestone-label { font-size: 7px; }
}

@media (min-width: 720px) {
  .shell { width: min(1160px, calc(100% - 40px)); }
  .app-header { top: 10px; height: 70px; margin-top: 10px; padding-inline: 20px; border-radius: 20px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-name { font-size: 19px; }
  .header-right { gap: 13px; }
  .header-context { display: inline; }
  .header-link { min-width: 84px; padding-inline: 12px; }
  .home-page { padding: 30px 0 60px; }
  .hero { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); align-items: center; gap: 27px; min-height: 430px; }
  .hero-art { order: 0; height: auto; min-height: 355px; border-width: 6px; border-radius: 29px; }
  .hero-copy { padding: 15px 0; }
  .hero-copy h1 { font-size: clamp(44px,6vw,68px); }
  .hero-actions { display: flex; }
  .hero-actions .btn { flex: 0 1 auto; }
  .home-bottom { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-top: 24px; }
  .feature { grid-template-columns: 40px 1fr; padding: 16px; }
  .page-main { padding: 28px 0 60px; }
  .career-progress { padding: 17px 20px; }
  .campaign-grid { grid-template-columns: minmax(0,1.35fr) minmax(260px,.65fr); gap: 18px; }
  .brief-grid,.setup-layout { grid-template-columns: minmax(0,1.15fr) minmax(310px,.85fr); gap: 16px; }
  .brief-data { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .brief-data-item { display: block; padding: 13px; }
  .brief-data-item span { margin-bottom: 6px; }
  .brief-data-item strong { text-align: left; }
  .allocation-controls { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .allocation-impact { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .select-row { grid-template-columns: 1fr auto; }
  .select-row select { width: auto; }
  .project-page { padding: 20px 0 55px; }
  .site-illustration { height: 280px; }
  .completed-site-view { height: clamp(340px,38vw,480px); }
  .project-top { align-items: center; flex-direction: row; }
  .project-title { display: flex; }
  .project-title h1 { font-size: 25px; }
  .project-controls { width: auto; }
  .metric-grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
  .metric-card,.metric-card:last-child { grid-column: auto; min-height: 102px; padding: 12px; }
  .metric-top { font-size: 9px; }
  .metric-value { font-size: 17px; }
  .metric-note { font-size: 9px; }
  .crew-load-strip { grid-template-columns: auto minmax(100px,.65fr) minmax(160px,1.6fr); gap: 12px; padding: 12px; }
  .crew-load-copy { display: flex; white-space: nowrap; }
  .crew-load-copy .eyebrow { display: inline; margin: 0; }
  .crew-load-track { width: auto; }
  .crew-load-strip p { grid-column: auto; }
  .workspace-grid { grid-template-columns: minmax(0,1.3fr) minmax(300px,.85fr); gap: 14px; }
  .workspace-bottom { position: static; left: auto; bottom: auto; width: auto; padding: 12px; transform: none; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: none; backdrop-filter: none; }
  .workspace-bottom > p { display: block; }
  .bottom-tabs { display: flex; width: auto; gap: 3px; }
  .tab-button { min-height: 42px; padding: 8px 9px; color: var(--muted); font-size: 10px; }
  .report-page,.result-page { padding: 35px 0 70px; }
  .report-changes { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .result-lower { grid-template-columns: 1fr 1fr; }
  .result-footer { flex-direction: row; }
  .result-footer .btn { width: auto; }
  .dialog-backdrop { align-items: center; padding: 20px; }
  .dialog { width: min(520px,100%); max-height: calc(100vh - 40px); padding: 25px; border: 0; border-radius: 22px; }
  .dialog-actions { display: flex; }
  .toast { right: 22px; bottom: 22px; left: auto; text-align: left; }
}

@media (min-width: 1040px) {
  .hero { grid-template-columns: minmax(0,.86fr) minmax(0,1.14fr); gap: 38px; min-height: 490px; }
  .hero-art { min-height: 415px; }
  .home-bottom { gap: 15px; margin-top: 32px; }
  .campaign-grid { gap: 22px; margin-top: 22px; }
  .brief-grid,.setup-layout { gap: 20px; }
  .workspace-grid { grid-template-columns: minmax(0,1.38fr) minmax(330px,.82fr); gap: 16px; }
  .metric-grid { gap: 10px; }
  .metric-card { padding: 14px; }
  .site-illustration { height: 320px; }
}

.mandate-tracker {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 13px 15px;
  border-color: #cddfd6;
  background: linear-gradient(110deg, #f5faf4, #fff 74%);
}
.mandate-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #6f5718;
  background: #f4dfa0;
  font-size: 18px;
  font-weight: 800;
}
.mandate-copy { min-width: 0; }
.mandate-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mandate-copy > strong { display: block; margin-top: 3px; font-size: 13px; }
.mandate-copy p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.mandate-copy p span { display: block; margin-top: 3px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.mandate-brief { margin: 0 0 18px; padding: 13px; border: 1px solid #dce7c5; border-radius: 12px; background: #f7f8e9; }
.mandate-brief strong { display: block; margin-top: 5px; font-size: 14px; }
.mandate-brief p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.mandate-choice-list { margin-top: 15px; }
.mandate-choice { min-height: 76px; }
.mandate-result { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-top: 14px; padding: 15px; }
.mandate-result h2 { margin: 4px 0; font-size: 17px; }
.mandate-result p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.mandate-result.is-met { border-color: #bdd7c4; background: #f5faf4; }
.mandate-result.is-missed { border-color: #e6d8bb; background: #fcfaf4; }
.mandate-result.is-missed .mandate-mark { color: #815c1b; background: #f4e4bd; }

@media (max-width: 640px) {
  .workspace-grid.is-overview > .workspace-main,
  .workspace-grid.is-overview > .workspace-rail { display: contents; }
  .workspace-grid.is-overview .site-card { order: 1; }
  .workspace-grid.is-overview .tutorial-hint { order: 2; }
  .workspace-grid.is-overview .decision-card { order: 3; }
  .workspace-grid.is-overview .package-card { order: 4; }
  .workspace-grid.is-overview .panel { order: 5; }
  .workspace-grid.is-overview .report-mini { order: 6; }

  .mandate-tracker { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 11px; }
  .mandate-tracker .mandate-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 15px; }
  .mandate-title { align-items: flex-start; flex-direction: column; gap: 5px; }
  .mandate-result { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 13px; }
  .mandate-result .mandate-mark { width: 32px; height: 32px; }
  .mandate-result > .tag { grid-column: 2; justify-self: start; }
}

.mobile-action-row { display: none; }

@media (max-width: 640px) {
  .project-page { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
  .workspace-bottom {
    display: grid;
    gap: 4px;
    padding: 7px;
    border-color: rgba(255,255,255,.24);
  }
  .mobile-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 2px 2px 7px;
  }
  .mobile-action-copy { display: grid; min-width: 0; gap: 3px; padding-left: 5px; }
  .mobile-action-copy span { overflow: hidden; color: #b9d3c4; font-size: 8px; font-weight: 800; letter-spacing: .09em; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-action-copy strong { overflow: hidden; color: #fff; font-size: 11px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-resolve-action { min-height: 43px; padding: 0 13px; border-radius: 13px; font-size: 10px; white-space: nowrap; box-shadow: 0 5px 13px rgba(0,0,0,.17); }
  .mobile-resolve-action:focus-visible { outline: 3px solid #dff2a8; outline-offset: 2px; }
  .bottom-tabs .tab-button { min-height: 44px; }
}

@media (max-width: 390px) {
  .project-page { padding-bottom: calc(158px + env(safe-area-inset-bottom)); }
  .mobile-resolve-action { padding-inline: 10px; }
}

/* Friendly motion and clearer decision feedback. */
@keyframes screen-enter {
  from { opacity: 0; transform: translate3d(0, 9px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes rise-in {
  from { opacity: 0; transform: translate3d(0, 12px, 0) scale(.99); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes selected-choice {
  0% { transform: scale(.985); }
  65% { transform: scale(1.008); }
  100% { transform: scale(1); }
}
@keyframes sticker-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes sun-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(112,189,121,.17), 0 0 0 0 rgba(112,189,121,0); }
  50% { box-shadow: 0 0 0 3px rgba(112,189,121,.22), 0 0 0 7px rgba(112,189,121,0); }
}
@keyframes milestone-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(23,97,73,0); }
  50% { box-shadow: 0 0 0 3px rgba(23,97,73,.13); }
}

#app.screen-enter > .shell > main { animation: screen-enter .34s cubic-bezier(.2,.7,.2,1) both; }
#app.screen-enter .hero-art { animation: rise-in .55s .04s cubic-bezier(.2,.7,.2,1) both; }
#app.screen-enter .hero-copy { animation: rise-in .46s .09s cubic-bezier(.2,.7,.2,1) both; }
#app.screen-enter .feature:nth-child(1) { animation: rise-in .35s .10s both; }
#app.screen-enter .feature:nth-child(2) { animation: rise-in .35s .16s both; }
#app.screen-enter .feature:nth-child(3) { animation: rise-in .35s .22s both; }
#app.screen-enter .contract-card:nth-child(1) { animation: rise-in .3s .04s both; }
#app.screen-enter .contract-card:nth-child(2) { animation: rise-in .3s .09s both; }
#app.screen-enter .contract-card:nth-child(3) { animation: rise-in .3s .14s both; }
#app.screen-enter .contract-card:nth-child(4) { animation: rise-in .3s .19s both; }
#app.screen-enter .decision-card,#app.screen-enter .brief-hero { animation: rise-in .42s .08s both; }
#app.screen-enter .site-card { animation: rise-in .42s .05s both; }
#app.screen-enter .metric-card:nth-child(1) { animation: rise-in .3s .02s both; }
#app.screen-enter .metric-card:nth-child(2) { animation: rise-in .3s .06s both; }
#app.screen-enter .metric-card:nth-child(3) { animation: rise-in .3s .10s both; }
#app.screen-enter .metric-card:nth-child(4) { animation: rise-in .3s .14s both; }
#app.screen-enter .metric-card:nth-child(5) { animation: rise-in .3s .18s both; }
#app.screen-enter .mobile-action-row { animation: rise-in .34s .08s both; }

.btn { transition: transform .18s cubic-bezier(.2,.7,.2,1), background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.btn:active:not(:disabled),.choice:active { transform: scale(.985); }
.tab-button { transition: color .18s ease, background .18s ease, transform .18s ease; }
.tab-button:active { transform: scale(.96); }
.choice { transition: transform .18s cubic-bezier(.2,.7,.2,1), border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.choice.selected { animation: selected-choice .24s ease-out; }
.decision-option p { font-size: 11px; line-height: 1.5; }
.decision-option .choice-head strong { font-size: 13px; line-height: 1.35; }
.decision-card { scroll-margin-top: calc(82px + env(safe-area-inset-top)); }
.effect-chip { padding: 5px 8px; border: 1px solid transparent; border-radius: 9px; font-size: 10px; line-height: 1.2; }
.effect-chip--positive { color: #245f3e; border-color: #cde5d0; background: #e9f5e7; }
.effect-chip--tradeoff { color: #80531d; border-color: #f0ddb3; background: #fff4de; }
.effect-chip--risk { color: #8a4139; border-color: #efd2ca; background: #fff0ec; }
.effect-chip--neutral { color: #536b63; border-color: #e0e8df; background: #f2f5ed; }
.career-progress-track > span { transition: width .7s cubic-bezier(.2,.7,.2,1); }
.milestone-segment.current { animation: milestone-breathe 2.6s ease-in-out infinite; }
.site-scene-overlay:not(.is-complete) .scene-live-dot { animation: live-pulse 2.8s ease-in-out infinite; }
.hero-art svg circle:first-of-type { transform-box: fill-box; transform-origin: center; animation: sun-drift 8s ease-in-out infinite; }
.hero-sticker { animation: sticker-float 5s ease-in-out infinite; }

@media (hover: hover) {
  .feature { transition: transform .2s cubic-bezier(.2,.7,.2,1), box-shadow .2s ease, border-color .2s ease; }
  .feature:hover { transform: translateY(-3px); border-color: #c3d6c2; box-shadow: 0 13px 28px rgba(22,42,37,.09); }
  .decision-option:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(22,42,37,.07); }
}

@media (max-width: 640px) {
  .decision-option { padding: 14px; }
  .decision-option p { font-size: 11px; }
  .effect-chip { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #app.screen-enter > .shell > main,
  #app.screen-enter .hero-art,
  #app.screen-enter .hero-copy,
  #app.screen-enter .feature,
  #app.screen-enter .contract-card,
  #app.screen-enter .decision-card,
  #app.screen-enter .brief-hero,
  #app.screen-enter .site-card,
  #app.screen-enter .metric-card,
  #app.screen-enter .mobile-action-row { animation: none !important; }
  .hero-sticker,.hero-art svg circle:first-of-type,.milestone-segment.current,.scene-live-dot,.choice.selected { animation: none !important; }
}
.reduced-motion #app.screen-enter > .shell > main,
.reduced-motion #app.screen-enter .hero-art,
.reduced-motion #app.screen-enter .hero-copy,
.reduced-motion #app.screen-enter .feature,
.reduced-motion #app.screen-enter .contract-card,
.reduced-motion #app.screen-enter .decision-card,
.reduced-motion #app.screen-enter .brief-hero,
.reduced-motion #app.screen-enter .site-card,
.reduced-motion #app.screen-enter .metric-card,
.reduced-motion #app.screen-enter .mobile-action-row,
.reduced-motion .hero-sticker,
.reduced-motion .hero-art svg circle:first-of-type,
.reduced-motion .milestone-segment.current,
.reduced-motion .scene-live-dot,
.reduced-motion .choice.selected { animation: none !important; }
