/* Aftersales Strategy Project Tool – styles.
   Tokens first; change colours here. System fonts only (no third-party font requests). */
:root {
  --ink: #0f2524;          /* header */
  --ink-2: #183634;
  --paper: #f3f6f5;        /* page background */
  --surface: #ffffff;
  --line: #d8e0de;
  --line-soft: #e8eeec;
  --text: #182826;
  --muted: #5b6e6b;
  --teal: #16a396;         /* accent */
  --teal-deep: #0b6b63;
  --teal-soft: #e0f2ef;
  --st-not_started: #8b9997;
  --st-on_track: #16a396;
  --st-at_risk: #d1900c;
  --st-blocked: #c4433b;
  --st-done: #2f5f8c;
  --radius: 8px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  --shadow: 0 1px 2px rgba(15, 37, 36, .06), 0 4px 16px rgba(15, 37, 36, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--text); background: var(--paper);
  font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal-deep); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }

/* ---------- header (hero + tabs) ---------- */
.topbar { color: #e9f3f1; }
.hero { background: radial-gradient(120% 140% at 85% 0%, #1d4a45 0%, #12302d 45%, #0b1b1a 100%);
  display: flex; align-items: center; gap: 22px; padding: 16px 28px; border-bottom: 3px solid var(--teal); }
.logo-card { background: #fff; border-radius: 12px; padding: 8px 14px; box-shadow: 0 4px 18px rgba(0,0,0,.35); flex: none; }
.logo-card img { height: 58px; width: auto; display: block; }
.hero-text { border-left: 1px solid rgba(255,255,255,.14); padding-left: 22px; min-width: 0; }
.eyebrow { color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.hero h1 { font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -.01em; margin: 2px 0 4px; }
.hero-meta { color: #9fb7b3; font-size: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.hero-meta .cap { text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 700; }
.hero-meta b { color: #fff; font-size: 16px; }
.hero-meta .sep { opacity: .4; margin: 0 4px; }
.hero-meta .dot { opacity: .5; margin: 0 2px; }
.hero-right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; font-size: 13px; }
.review-counter { background: #f2c14e; color: #2a2000; border: 0; border-radius: 999px; padding: 4px 12px; font-weight: 700; cursor: pointer; }
.sync { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); border: 1px solid rgba(22,163,150,.6);
  background: rgba(22,163,150,.08); border-radius: 999px; padding: 4px 12px; font-weight: 650; }
.sync::before { content: "✓"; }
.sync[data-state="saving"] { color: #f2c14e; border-color: rgba(242,193,78,.6); }
.sync[data-state="saving"]::before { content: "…"; }
.sync[data-state="conflict"], .sync[data-state="offline"] { color: #ff8a7e; border-color: rgba(255,138,126,.6); }
.sync[data-state="conflict"]::before, .sync[data-state="offline"]::before { content: "!"; }
.me-chip { color: #cfe2df; }
.tabs { background: #0b1b1a; position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.tabs-inner { max-width: 1400px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs-inner::-webkit-scrollbar { display: none; }
.tab { background: none; border: 0; color: #a9c2be; padding: 13px 16px 12px; cursor: pointer; white-space: nowrap; font-weight: 650; font-size: 15px;
  border-bottom: 3px solid transparent; display: inline-flex; align-items: center; gap: 8px; }
.tab .ico { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { color: var(--teal); border-bottom-color: var(--teal); }
.demo-bar { background: #fff4d6; color: #4a3a00; font-size: 13px; padding: 6px 20px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.demo-bar select { padding: 2px 6px; }

/* ---------- layout ---------- */
main { max-width: 1400px; margin: 0 auto; padding: 18px 20px 80px; }
.view-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.view-head .spacer { flex: 1; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.notice { background: var(--teal-soft); border: 1px solid #b9e1db; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }

/* ---------- buttons, inputs, chips ---------- */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-weight: 550; }
.btn:hover { border-color: var(--teal); }
.btn-primary { background: var(--teal-deep); border-color: var(--teal-deep); color: #fff; }
.btn-primary:hover { background: var(--teal); border-color: var(--teal); }
.btn-danger { color: var(--st-blocked); }
.btn-danger:hover { border-color: var(--st-blocked); }
.btn-link { border: 0; background: none; color: var(--teal-deep); cursor: pointer; padding: 0; font-weight: 550; text-decoration: underline; text-underline-offset: 2px; }
.btn-sm { padding: 3px 9px; font-size: 13px; }
input[type=text], input[type=email], input[type=month], input[type=number], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; background: #fff; max-width: 100%; }
textarea { width: 100%; min-height: 70px; resize: vertical; }
label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; font-weight: 550; }
label.field input[type=text], label.field input[type=email], label.field select, label.field textarea { width: 100%; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 1px 2px rgba(15,37,36,.05); }
.chip:hover { border-color: var(--teal); }
.chip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip-urgent[aria-pressed="true"] { background: var(--st-blocked); border-color: var(--st-blocked); }
.chip-urgent[aria-pressed="true"] .reddot { background: #fff; }
.reddot { width: 9px; height: 9px; border-radius: 50%; background: var(--st-blocked); display: inline-block; }
.sdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--st-not_started); }
.sdot[data-st=on_track] { background: var(--st-on_track); } .sdot[data-st=at_risk] { background: var(--st-at_risk); }
.sdot[data-st=blocked] { background: var(--st-blocked); } .sdot[data-st=done] { background: var(--st-done); }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chip-gap { width: 14px; }
.filter-panel { margin-bottom: 6px; }
.filter-panel .search { margin-left: auto; min-width: 220px; border-radius: 999px; padding: 6px 14px; }
.filter-label { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #8a9b98; margin: 14px 0 7px; }

.owner-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; background: var(--teal-soft); color: var(--teal-deep);
  border-radius: 999px; padding: 2px 9px 2px 3px; white-space: nowrap; }
.owner-chip .ini { width: 20px; height: 20px; border-radius: 50%; background: var(--teal-deep); color: #fff; font-size: 10.5px;
  display: inline-grid; place-items: center; font-weight: 650; }
.owner-chip.co { background: #eef2f1; color: var(--muted); }
.owner-chip.co .ini { background: #8ea3a0; }
.owner-chip.tbd { background: #fff1e0; color: #8a4f00; padding-left: 9px; }

.badge { display: inline-block; border-radius: 4px; padding: 2px 8px; font-size: 12px; font-weight: 650; color: #fff; white-space: nowrap; }
.badge[data-st=not_started] { background: var(--st-not_started); }
.badge[data-st=on_track] { background: var(--st-on_track); }
.badge[data-st=at_risk] { background: var(--st-at_risk); }
.badge[data-st=blocked] { background: var(--st-blocked); }
.badge[data-st=done] { background: var(--st-done); }
select.status-select { font-size: 12.5px; font-weight: 650; padding: 3px 6px; border-radius: 4px; color: #fff; border: 0; }
select.status-select option { color: var(--text); background: #fff; }
.tag { display: inline-block; font-size: 11.5px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; color: var(--muted); background: #fff; }
.tag-ai { border-color: #c7b8ef; color: #5b3fb0; background: #f5f1ff; }
.logtype { font-size: 11.5px; font-weight: 650; border-radius: 4px; padding: 1px 7px; background: #eef2f1; color: var(--muted); }
.logtype[data-t=risk] { background: #fff1d6; color: #8a5a00; }
.logtype[data-t=blocker] { background: #fde4e1; color: #9a2a22; }
.logtype[data-t=decision] { background: #e6eef8; color: #24527f; }
.logtype[data-t=progress] { background: var(--teal-soft); color: var(--teal-deep); }

/* progress bar */
.bar { height: 8px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.pct { font-weight: 650; min-width: 44px; text-align: right; }

/* slider */
input[type=range].slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; outline-offset: 4px;
  background: linear-gradient(to right, var(--teal) var(--v, 0%), var(--line) var(--v, 0%)); cursor: pointer; }
input[type=range].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--teal-deep); box-shadow: var(--shadow); }
input[type=range].slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--teal-deep); }
input[type=range].slider:disabled { cursor: default; opacity: .55; }

/* ---------- action plan (compact blocks, collapsed by default) ---------- */
.block { background: var(--surface); border-radius: 10px; margin-bottom: 8px; overflow: hidden; box-shadow: var(--shadow); }
.block-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 13px 18px 15px; cursor: pointer;
  background: linear-gradient(90deg, #0f2120, #16302e); color: #fff; }
.block-head:hover { background: linear-gradient(90deg, #132927, #1b3a37); }
.caret { color: #8fb3ae; transition: transform .15s; display: inline-block; width: 12px; }
.block[data-open="true"] .caret { transform: rotate(90deg); }
.block-code { background: var(--seg, var(--teal)); color: #fff; font-weight: 800; font-size: 13px; border-radius: 6px; padding: 2px 8px; min-width: 34px; text-align: center; }
.block-name { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; }
.block-meta { color: #8fb3ae; font-size: 13px; white-space: nowrap; }
.block-pct { font-weight: 800; min-width: 48px; text-align: right; }
.block-line { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--seg, var(--teal)); }
.alert-pill { background: var(--st-blocked); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 800; padding: 1px 8px; }

.rows { border-top: 0; }
.group-label { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #8a9b98;
  background: #f7f9f8; padding: 8px 18px; border-bottom: 1px solid var(--line-soft); }
.row { display: grid; grid-template-columns: 14px minmax(240px, 1fr) minmax(150px, 260px) 66px 150px 180px;
  gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--line-soft); }
.row:last-child { border-bottom: 0; }
.row:hover { background: #fafcfb; }
.row.is-done .row-title { color: var(--muted); text-decoration: line-through; text-decoration-color: #b0bdbb; }
.row-title { background: none; border: 0; text-align: left; padding: 0; cursor: pointer; font-weight: 500; font-size: 15.5px; }
.row-title:hover { color: var(--teal-deep); text-decoration: underline; }
.row-sub { display: flex; gap: 8px; align-items: center; margin-top: 2px; min-width: 0; }
.row-id { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.row-log { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-owners { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.row-month { font-size: 13.5px; color: var(--muted); text-align: right; }
.row-month.late { color: var(--st-blocked); font-weight: 700; }
.row-progress { display: flex; align-items: center; gap: 8px; }
.row-progress .pct { min-width: 46px; font-size: 13px; white-space: nowrap; }
.row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--teal-deep); }
.pchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 650; color: var(--teal-deep);
  background: var(--teal-soft); border: 1px solid #b6e2db; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.pchip.co { background: #f1f5f4; color: #4d625f; border-color: var(--line); }
.pchip.tbd { background: #fff1e0; color: #8a4f00; border-color: #f3d3a6; }
.pchip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; opacity: .7; }
.pchip button:hover { opacity: 1; }
.pchip.add { background: none; border: 1px dashed #b8c6c3; color: var(--muted); cursor: pointer; font-weight: 600; }
.pchip.add:hover { border-color: var(--teal); color: var(--teal-deep); }
.pchip-select { font-size: 12.5px; padding: 2px 6px; max-width: 170px; }

/* ---------- Tilannekuva (front page) ---------- */
.dash-top { display: grid; grid-template-columns: minmax(380px, 1.25fr) 1fr; gap: 14px; }
.overall-body { display: flex; align-items: center; gap: 22px; }
.ring { width: 150px; height: 150px; flex: none; }
.overall-side { flex: 1; min-width: 0; }
.overall-caption { font-size: 17px; font-weight: 650; margin-bottom: 12px; }
.dist { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--line-soft); }
.dist i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend b { color: var(--text); }
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; border-top: 4px solid #cfd9d7; box-shadow: var(--shadow); }
.kpi-tile:disabled { cursor: default; }
.kpi-tile:not(:disabled):hover { border-color: var(--teal); }
.kpi-tile b { font-size: 30px; font-weight: 750; line-height: 1.1; }
.kpi-tile span { font-size: 13px; color: var(--muted); }
.kpi-tile.bad { border-top-color: var(--st-blocked); } .kpi-tile.bad b { color: var(--st-blocked); }
.kpi-tile.warn { border-top-color: var(--st-at_risk); } .kpi-tile.warn b { color: #a86f00; }
.kpi-tile.info { border-top-color: var(--teal); }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 24px 0 10px; }
.section-head h3 { font-size: 18px; flex: 1; }
.goal-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.goal-mini { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.goal-mini-title { font-weight: 650; font-size: 14px; min-height: 40px; }
.goal-mini-bar { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
.goal-mini-bar .bar { flex: 1; }
.seg-group .filter-label { margin-top: 6px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 8px; }
.block-tile { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--seg); border-radius: 10px; padding: 12px 14px;
  text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 7px; box-shadow: var(--shadow); }
.block-tile:hover { border-color: var(--seg); }
.bt-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bt-top .block-code, .bt-top .alert-pill { flex: none; }
.bt-pct { margin-left: auto; font-size: 18px; white-space: nowrap; flex: none; }
.bt-name { font-weight: 600; font-size: 14px; line-height: 1.3; min-height: 36px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bt-seg { flex: 1; min-width: 0; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #8a9b98; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block-tile .bar > i { background: var(--seg); }

/* ---------- side panel ---------- */
.scrim { position: fixed; inset: 0; background: rgba(15, 37, 36, .35); z-index: 40; }
.sidepanel { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--surface); z-index: 50;
  box-shadow: -8px 0 30px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.sp-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.sp-head h2 { font-size: 19px; }
.sp-body { overflow-y: auto; padding: 16px 20px 40px; flex: 1; }
.sp-section { margin-bottom: 20px; }
.sp-section > h3 { margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 7px 12px; font-size: 14px; }
.kv > dt { color: var(--muted); }
.kv > dd { margin: 0; }
.subtask { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.subtask .grow { flex: 1; }
.subtask.done span { text-decoration: line-through; color: var(--muted); }
.log-entry { border-left: 3px solid var(--line); padding: 4px 0 8px 12px; margin-bottom: 8px; }
.log-entry[data-t=risk] { border-left-color: var(--st-at_risk); }
.log-entry[data-t=blocker] { border-left-color: var(--st-blocked); }
.log-entry[data-t=decision] { border-left-color: var(--st-done); }
.log-entry[data-t=progress] { border-left-color: var(--teal); }
.log-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.log-text { white-space: pre-wrap; margin-top: 2px; }
.log-entry.auto .log-text { color: var(--muted); font-size: 13.5px; }

/* ---------- dashboard ---------- */
.big-number { font-size: 54px; font-weight: 300; line-height: 1; letter-spacing: -.02em; }
.stat-list { display: grid; gap: 8px; }
.stat-line { display: grid; grid-template-columns: 1fr 140px 46px; gap: 10px; align-items: center; font-size: 14px; }
.stat-line .bar > i { background: var(--seg, var(--teal)); }
.status-counts { display: flex; flex-wrap: wrap; gap: 10px; }
.status-count { flex: 1; min-width: 110px; border-radius: 6px; padding: 10px 12px; background: #f6f8f7; border-top: 4px solid; }
.status-count b { display: block; font-size: 24px; font-weight: 650; }
.task-mini { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.task-mini:last-child { border-bottom: 0; }
.task-mini .grow { flex: 1; }

/* ---------- goals ---------- */
.year-block { margin-bottom: 26px; }
.year-title { font-size: 34px; font-weight: 300; margin-bottom: 10px; color: var(--teal-deep); }
.goal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.goal-kpi { font-size: 14px; }
.goal-kpi b { font-size: 22px; font-weight: 650; }
.breakdown { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- roadmap ---------- */
.roadmap { display: grid; align-items: start; grid-template-columns: 300px 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rm-labels { border-right: 1px solid var(--line); }
.rm-label { height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.rm-label.blk { font-weight: 700; background: #f6f8f7; cursor: default; }
.rm-label:not(.blk):hover { color: var(--teal-deep); }
.rm-head { height: 44px; }
.rm-scroll { overflow-x: auto; }
.rm-scroll svg { display: block; }
.rm-scroll svg .dot { cursor: pointer; }
.rm-scroll path.dep { opacity: .16; transition: opacity .1s; }
.rm-scroll path.dep.hi { opacity: 1; stroke: var(--teal-deep); stroke-width: 2; }

/* ---------- tables (manage) ---------- */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; background: var(--surface); font-size: 14px; }
table.data th, table.data td { border-bottom: 1px solid var(--line-soft); padding: 7px 9px; text-align: left; vertical-align: top; }
table.data th { font-size: 12.5px; color: var(--muted); font-weight: 650; background: #f6f8f7; }
.review-item { display: grid; grid-template-columns: 26px 1fr 220px auto; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); align-items: start; }
.review-item:last-child { border-bottom: 0; }
.review-item .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.review-detail { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.review-detail b { color: var(--text); font-weight: 600; }
.bulkbar { position: sticky; top: 52px; z-index: 5; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 8px 12px; display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }

/* toast */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 80; box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: #8f2a23; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .hero { padding: 12px 14px; gap: 12px; flex-wrap: wrap; }
  .logo-card { padding: 5px 9px; } .logo-card img { height: 34px; }
  .hero-text { border-left: 0; padding-left: 0; flex-basis: 100%; order: 3; }
  .hero h1 { font-size: 22px; }
  .hero-right { flex-direction: row; flex-wrap: wrap; }
  .tab span { display: none; } .tab { padding: 12px 12px; } .tab .ico { width: 20px; height: 20px; }
  .tab[aria-selected="true"] span { display: inline; }
  .me-chip { display: none; }
  .dash-top { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .overall-body { flex-direction: column; align-items: stretch; } .ring { align-self: center; }
  .filter-panel .search { margin-left: 0; width: 100%; }
  .block-meta { display: none; }
  .row-owners { justify-content: flex-start; } .row-month { text-align: left; }
  main { padding: 12px 10px 80px; }
  .topbar-inner { padding: 8px 12px 0; }
  .brand-sub { display: none; }
  .block-head { grid-template-columns: auto 1fr; }
  .block-progress { grid-column: 1 / -1; grid-row: auto; min-width: 0; }
  .row { grid-template-columns: 26px 1fr auto; gap: 6px 10px; padding: 10px 12px; }
  .row-title-cell { grid-column: 2 / 4; }
  .row-owners { grid-column: 2 / 3; } .row-month { grid-column: 3 / 4; }
  .row-progress { grid-column: 2 / 3; } .row-status { grid-column: 3 / 4; }
  .review-item { grid-template-columns: 26px 1fr; }
  .review-item > :nth-child(3), .review-item > :nth-child(4) { grid-column: 2; }
  .roadmap { grid-template-columns: 160px 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv > dd { margin-bottom: 6px; }
  .stat-line { grid-template-columns: 1fr 80px 42px; }
  .bulkbar { top: 48px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.bulkbar .btn { color: var(--text); }
.bulkbar .btn-danger { color: var(--st-blocked); }
.btn:disabled { opacity: .5; cursor: default; }
.goal-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.goal-card .btn-link { align-self: flex-start; }
button.pchip { cursor: pointer; font-family: inherit; }
button.pchip:hover { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.pchip-select { border: 1px solid var(--teal); border-radius: 6px; }

/* language switch FI | EN */
.lang-switch { display: inline-flex; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; overflow: hidden; }
.lang-switch button { background: none; border: 0; color: #a9c2be; font-weight: 750; font-size: 12.5px; padding: 3px 11px; cursor: pointer; letter-spacing: .06em; }
.lang-switch button[aria-pressed="true"] { background: var(--teal); color: #fff; }
.lang-switch button:hover { color: #fff; }

/* ---------- AI-assessed progress & progress updates ---------- */
.row-dot { width: 10px; height: 10px; }
.row-status { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.upd-btn { padding: 3px 10px; font-size: 12.5px; }
.ai-bar { flex: 1; height: 8px; }
.ai-tag { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: #5b3fb0; background: #f1ecff; border: 1px solid #d9ccfa;
  border-radius: 4px; padding: 0 5px; cursor: help; }
.ai-tag.pending { color: #8a5a00; background: #fff4d6; border-color: #f2d48a; }
.ai-box { background: #f7f4ff; border: 1px solid #e2d9fb; border-radius: 8px; padding: 10px 12px; font-size: 14px; display: grid; gap: 4px; }
.ai-box.compact { font-size: 13px; margin-bottom: 10px; }
.ai-box.pending { background: #fff8e6; border-color: #f2d48a; margin-bottom: 8px; }
.ai-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qu-count.ok { color: var(--teal-deep); font-weight: 650; }
.logtype[data-t=assessment] { background: #f1ecff; color: #5b3fb0; }
.log-entry[data-t=assessment] { border-left-color: #a58bea; }

/* ---------- team reward tracker ---------- */
.reward-card { margin-bottom: 14px; border-top: 4px solid #e0b43c; background: linear-gradient(180deg, #fffaf0, #fff 60%); }
.rw-head { display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.rw-now b { font-size: 34px; font-weight: 800; letter-spacing: -.01em; }
.rw-now span { color: var(--muted); font-size: 15px; }
.rw-help { max-width: 520px; }
.rw-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.rw-item { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 10px; }
.rw-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14px; }
.rw-days { margin-left: auto; font-weight: 700; color: #8a5a00; }
.rw-track { position: relative; height: 14px; background: var(--line-soft); border-radius: 999px; margin: 18px 0 8px; }
.rw-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), #3cc6a0); }
.rw-mark { position: absolute; top: -6px; bottom: -6px; width: 2px; background: #b07d00; }
.rw-mark span { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: #8a5a00; white-space: nowrap; }
.rw-chip { display: inline-block; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 2px 10px; background: #f1f5f4; color: var(--muted); }
.rw-chip.ok { background: #e3f6ee; color: #136b4c; }
.rw-chip.bad { background: #fde4e1; color: #9a2a22; }
@media (max-width: 900px) {
  .row-dot { grid-row: 1; }
  .row-status { grid-column: 2 / 4; justify-content: flex-start; }
  .rw-list { grid-template-columns: 1fr; }
}
.review-counter { white-space: nowrap; }
.rw-mark.end span { left: auto; right: 0; transform: none; }
.qu-pct-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.qu-pct-row .qu-pct { flex: 1; min-width: 160px; }
.qu-pct-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.qu-pct-val { min-width: 48px; text-align: right; }
.chg-chip { display: inline-block; font-size: 12.5px; background: var(--teal-soft); color: var(--teal-deep); border-radius: 6px; padding: 1px 8px; margin: 4px 6px 2px 0; }
.chg-chip.pct { background: #e8f0fb; color: #24527f; }
.qu-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.task-details { border-top: 1px solid var(--line); padding-top: 10px; }
.task-details > summary { cursor: pointer; color: var(--muted); font-weight: 650; font-size: 14px; padding: 4px 0 10px; list-style-position: inside; }
.task-details > summary:hover { color: var(--teal-deep); }
.quick-update .btn-primary:disabled { opacity: .45; }
.qu-count { transition: color .15s; }

/* ---------- progress update form: slider and reason field stand out ---------- */
.quick-update { background: linear-gradient(180deg, #ecf8f5, #f6fbfa); border: 1.5px solid #a9dcd2; border-radius: 12px; padding: 14px 16px 12px; }
.qu-head { display: flex; align-items: baseline; gap: 10px; }
.qu-head .qu-pct-label { font-size: 14px; font-weight: 750; color: var(--text); flex: 1; }
.qu-head .qu-pct-diff { font-size: 13px; font-weight: 650; color: var(--teal-deep); }
.qu-head .qu-pct-val { font-size: 26px; font-weight: 800; color: var(--teal-deep); min-width: 0; letter-spacing: -.01em; }
.qu-slider-wrap { margin: 6px 2px 14px; }
input[type=range].qu-pct { height: 12px; width: 100%; background: linear-gradient(to right, var(--teal) var(--v, 0%), #cfe1de var(--v, 0%)); }
input[type=range].qu-pct::-webkit-slider-thumb { width: 28px; height: 28px; border: 3px solid var(--teal-deep); background: #fff;
  box-shadow: 0 0 0 5px rgba(22,163,150,.18), 0 2px 6px rgba(0,0,0,.2); cursor: grab; }
input[type=range].qu-pct::-moz-range-thumb { width: 24px; height: 24px; border: 3px solid var(--teal-deep); background: #fff;
  box-shadow: 0 0 0 5px rgba(22,163,150,.18), 0 2px 6px rgba(0,0,0,.2); cursor: grab; }
input[type=range].qu-pct:active::-webkit-slider-thumb { cursor: grabbing; box-shadow: 0 0 0 8px rgba(22,163,150,.25), 0 2px 6px rgba(0,0,0,.2); }
input[type=range].qu-pct:focus-visible { outline: none; }
input[type=range].qu-pct:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 8px rgba(22,163,150,.35); }
.qu-ticks { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 6px; padding: 0 3px; }
.qu-text-label { display: block; font-size: 14px; font-weight: 750; margin-bottom: 6px; }
.qu-text-label::after { content: " *"; color: var(--st-blocked); }
textarea.qu-text { border: 2px solid #8fcfc4; border-radius: 10px; background: #fff; font-size: 15.5px; padding: 10px 12px; min-height: 96px; }
textarea.qu-text:hover { border-color: var(--teal); }
textarea.qu-text:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(22,163,150,.18); outline: none; }
.quick-update .qu-foot .btn-primary { padding: 7px 16px; font-size: 14px; }
.hist-entry { border-left: 3px solid var(--line); padding: 4px 0 10px 12px; margin-bottom: 8px; }
.hist-entry ul { margin: 4px 0 8px; padding-left: 18px; font-size: 14px; }
