/* Brändistudio Myyjäpaneeli – tumma, rauhallinen, nopea käyttää puhelun aikana.
   Merkkiväri: sormenjäljen violetinsininen. Vihreä = soita/onnistui, oranssi = kuuma, punainen = stop. */
@font-face { font-family: "Bricolage"; src: url("/fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "GeistMono"; src: url("/fonts/geist-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #0d0f1c; --bg-2: #12152a; --surface: #171a33; --surface-2: #1e2240; --line: #2a2f55; --line-2: #22264a;
  --ink: #eef0ff; --ink-2: #c4c8e8; --muted: #8a90b8;
  --accent: #8b93ff; --accent-2: #6f78f5; --accent-soft: rgb(139 147 255 / 0.14);
  --go: #2bd17e; --go-ink: #04140b; --go-soft: rgb(43 209 126 / 0.14);
  --hot: #ff9f43; --hot-soft: rgb(255 159 67 / 0.14);
  --bad: #ff5d6c; --bad-soft: rgb(255 93 108 / 0.13);
  --warn: #ffd166;
  --radius: 16px; --radius-sm: 10px;
  --f: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "GeistMono", ui-monospace, Consolas, monospace;
  --shadow: 0 10px 30px -12px rgb(0 0 0 / 0.6);
  --glass: rgb(13 15 28 / 0.85); --glass-2: rgb(18 21 42 / 0.96); --hover: #262b52; --hover-2: #1a1d3a; --warn-bg: #3a2a10;
  --glow: rgb(111 120 245 / 0.18);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; background: radial-gradient(1200px 600px at 85% -10%, var(--glow), transparent 60%), var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- yläpalkki ja navigaatio ---------- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: var(--glass); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-2); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 0.75rem; }
.nav { display: flex; gap: 4px; margin-left: 18px; }
.nav button { background: none; border: 0; padding: 8px 14px; border-radius: 999px; color: var(--ink-2); cursor: pointer; font-weight: 550; }
.nav button[aria-current="page"] { background: var(--accent-soft); color: var(--ink); }
.nav button:hover { color: var(--ink); }
.top .spacer { flex: 1; }
.who { color: var(--muted); font-size: 0.9rem; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 8px; }
.linkbtn:hover { color: var(--ink); }

.bottomnav { display: none; }
@media (max-width: 760px) {
  .nav, .who { display: none; }
  .top { padding: 10px 14px; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--bg-2); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottomnav button { flex: 1; background: none; border: 0; color: var(--muted); padding: 6px 2px; font-size: 0.72rem; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
  .bottomnav button span { font-size: 1.25rem; line-height: 1; }
  .bottomnav button[aria-current="page"] { color: var(--accent); }
  main { padding-bottom: 90px !important; }
}

main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }
@media (max-width: 760px) { main { padding: 14px 12px; } }

/* ---------- yleiset palikat ---------- */
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; }
.kpi .l { color: var(--muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi .v { font-size: 1.7rem; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { color: var(--muted); font-size: 0.85rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.hot { background: var(--hot-soft); color: var(--hot); border-color: transparent; }
.chip.go { background: var(--go-soft); color: var(--go); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.warn { background: rgb(255 209 102 / 0.13); color: var(--warn); border-color: transparent; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-weight: 650; cursor: pointer; text-decoration: none !important; min-height: 44px; transition: transform .08s ease, background .15s ease; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent-2); border-color: transparent; color: #fff; }
.btn.primary:hover { background: var(--accent); }
.btn.go { background: var(--go); border-color: transparent; color: var(--go-ink); }
.btn.go:hover { filter: brightness(1.07); }
.btn.bad { color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 0.9rem; border-radius: 10px; }
.btn.big { min-height: 58px; font-size: 1.15rem; border-radius: 16px; padding: 14px 20px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; outline: none; min-height: 44px;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: block; font-size: 0.85rem; color: var(--ink-2); font-weight: 600; margin: 12px 0 6px; }

/* ---------- soittolista ---------- */
.listhead { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); padding: 7px 13px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.filters button[aria-pressed="true"] { background: var(--accent-2); border-color: transparent; color: #fff; }
.filters .n { opacity: 0.75; font-family: var(--mono); font-size: 0.8rem; margin-left: 4px; }
.search { flex: 1; min-width: 200px; max-width: 360px; }

.leads { display: grid; gap: 10px; }
.lead { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: border-color .15s ease, transform .08s ease; text-align: left; width: 100%; color: inherit; }
.lead:hover { border-color: var(--line); background: var(--hover-2); }
.lead:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lead .name { font-weight: 700; font-size: 1.05rem; }
.lead .meta { color: var(--muted); font-size: 0.88rem; }
.lead .why { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.lead .call { font-family: var(--mono); color: var(--ink-2); font-size: 0.95rem; }
.lead.locked { opacity: 0.55; }
.lead.done { opacity: 0.6; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: 6px; }

/* ---------- liidikortti (laatikko) ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgb(5 6 14 / 0.6); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); z-index: 60; background: var(--bg-2); border-left: 1px solid var(--line); overflow-y: auto; box-shadow: var(--shadow); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer header { position: sticky; top: 0; z-index: 2; background: var(--glass-2); backdrop-filter: blur(10px); padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; align-items: flex-start; }
.drawer header h2 { font-size: 1.3rem; }
.drawer .body { padding: 18px 20px 120px; display: grid; gap: 16px; }
.close { margin-left: auto; background: var(--surface-2); border: 1px solid var(--line); width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 1.2rem; flex: none; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 650; }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.opener { background: var(--accent-soft); border: 1px solid rgb(139 147 255 / 0.3); border-radius: var(--radius); padding: 14px 16px; }
.opener .l { font-size: 0.78rem; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.outcomes .btn { justify-content: flex-start; text-align: left; }
.outcomes .btn.sel { outline: 2px solid var(--accent); }
.when { display: flex; gap: 6px; flex-wrap: wrap; }
.history { display: grid; gap: 8px; }
.history .h { border-left: 2px solid var(--line); padding: 2px 0 2px 12px; font-size: 0.9rem; }
.history .h b { color: var(--ink); }

/* ---------- apuri ---------- */
.fab { position: fixed; right: 22px; bottom: 22px; z-index: 70; border-radius: 999px; padding: 14px 20px; background: var(--accent-2); color: #fff; border: 0; font-weight: 700; box-shadow: var(--shadow); cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 1rem; }
.fab:hover { background: var(--accent); }
@media (max-width: 760px) { .fab { bottom: calc(76px + env(safe-area-inset-bottom)); right: 12px; padding: 0; width: 54px; height: 54px; justify-content: center; font-size: 0; } .fab::before { content: "💬"; font-size: 1.5rem; } }
.helper { position: fixed; right: 18px; bottom: 18px; z-index: 80; width: min(460px, calc(100vw - 24px)); max-height: min(78vh, 760px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; animation: pop .15s ease-out; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 760px) { .helper { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-height: 86vh; } }
.helper header { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.helper .scroll { overflow-y: auto; padding: 14px 16px; display: grid; gap: 12px; }
.helper .objs { display: flex; flex-wrap: wrap; gap: 6px; }
.helper .objs-wrap { padding: 10px 16px 12px; border-bottom: 1px solid var(--line-2); }
.helper .objs.scrollx { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.helper .objs.scrollx button { flex: none; }
body.kortti-auki .fab { display: none; }
.helper .objs button { border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-2); padding: 6px 11px; border-radius: 999px; cursor: pointer; font-size: 0.88rem; font-weight: 600; }
.helper .objs button:hover { color: var(--ink); border-color: var(--accent); }
.answer { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; font-size: 1.02rem; }
.answer .q { color: var(--muted); font-size: 0.85rem; margin-bottom: 4px; }
.answer.ai { border-color: rgb(139 147 255 / 0.4); }
.helper form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line-2); background: var(--bg-2); }
.helper form input { flex: 1; }
.typing::after { content: "…"; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* ---------- modaalit ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgb(5 6 14 / 0.7); display: grid; place-items: center; padding: 16px; }
.modal { width: min(560px, 100%); max-height: 92vh; overflow-y: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.paketit { display: grid; gap: 8px; }
.paketti { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--surface); }
.paketti input { margin: 0; accent-color: var(--accent); width: 18px; height: 18px; }
.paketti .p { font-weight: 700; }
.paketti .h { color: var(--muted); font-size: 0.88rem; grid-column: 2; }
.paketti .pr { color: var(--go); font-weight: 700; font-family: var(--mono); grid-row: 1 / span 2; grid-column: 3; text-align: right; }
.paketti:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.paylink { background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; }

/* ---------- tulokset, ohjeet, hallinta ---------- */
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 120px; padding-top: 8px; }
.bars div { background: var(--accent-2); border-radius: 6px 6px 2px 2px; min-height: 3px; position: relative; }
.bars div.hot { background: var(--go); }
.bars-l { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; font-size: 0.7rem; color: var(--muted); text-align: center; margin-top: 6px; font-family: var(--mono); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 650; }
.tablewrap { overflow-x: auto; }
.section { display: grid; gap: 12px; margin-bottom: 26px; }
.qa { display: grid; gap: 10px; }
.qa details { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 16px; }
.qa summary { cursor: pointer; font-weight: 650; }
.qa details p { margin: 8px 0 2px; color: var(--ink-2); }
.steps { display: grid; gap: 10px; }
.step { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px; }
.step b { display: block; margin-bottom: 4px; color: var(--accent); }
.copybox { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 8px 8px 8px 12px; }
.copybox code { flex: 1; overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.85rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } .facts { grid-template-columns: 1fr 1fr; } }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100; background: var(--surface-2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600; max-width: calc(100vw - 32px); }
.toast.ok { border-color: rgb(43 209 126 / 0.5); }
.toast.err { border-color: rgb(255 93 108 / 0.6); }
@media (max-width: 760px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom)); } }

/* ---------- kirjautuminen ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: min(420px, 100%); padding: 28px; }
.auth .brand { margin-bottom: 18px; }
.auth .err { color: var(--bad); margin-top: 10px; min-height: 1.4em; font-weight: 600; }
.auth .btn { width: 100%; margin-top: 18px; }

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); height: 74px; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ================= v2 (6.11.2026) ================= */
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--accent-2); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 0 0 1px rgb(139 147 255 / .35), 0 6px 18px -6px rgb(139 147 255 / .6); }
.nav .navbadge, .bottomnav .navbadge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--hot); color: #1a0d00; font-size: .72rem; font-weight: 800; margin-left: 4px; font-style: normal; }
.bottomnav button span { position: relative; }
.bottomnav .navbadge { position: absolute; top: -6px; right: -12px; }
.offline { position: sticky; top: 59px; z-index: 29; background: var(--warn-bg); color: var(--warn); text-align: center; padding: 8px 12px; font-weight: 600; font-size: .9rem; border-bottom: 1px solid #5a4318; }

.hero { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.hero h1 { font-size: 1.7rem; }
.goal { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 16px 10px 10px; }
.goal .l { color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.goal .v { font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; }
.goal .s { color: var(--muted); font-size: .82rem; }
.ring { --p: 0; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--go) calc(var(--p) * 1%), var(--line) 0); position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-weight: 800; font-family: var(--mono); }
.linkbtn.small { font-size: .82rem; padding: 2px 6px; }

.onboard { background: linear-gradient(135deg, rgb(111 120 245 / .18), rgb(43 209 126 / .08)); border: 1px solid rgb(139 147 255 / .35); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; display: grid; gap: 10px; }
.steps-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.stepbtn { display: flex; gap: 10px; align-items: center; text-align: left; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink); padding: 10px 12px; border-radius: 12px; cursor: pointer; font-weight: 600; }
.stepbtn span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.stepbtn.done { opacity: .6; } .stepbtn.done span { background: var(--go); color: var(--go-ink); }

.listhead select { width: auto; min-width: 150px; max-width: 220px; min-height: 42px; padding: 8px 12px; }
.listhead .search { max-width: none; flex: 2; }
@media (max-width: 760px) { .listhead select { flex: 1; min-width: 0; max-width: none; } .listhead .search { flex-basis: 100%; } .goal { width: 100%; } }

.lead { grid-template-columns: auto 1fr auto; align-items: start; }
.lead .main { min-width: 0; display: grid; gap: 4px; }
.lead .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.lead .why { grid-column: auto; }
.lead.due { border-color: rgb(139 147 255 / .55); box-shadow: 0 0 0 1px rgb(139 147 255 / .25) inset; }
.thumb { width: 64px; height: 80px; border-radius: 10px; object-fit: cover; object-position: top; background: var(--surface-2); border: 1px solid var(--line); }
.thumb.ph { display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; color: var(--accent); background: linear-gradient(160deg, var(--surface-2), var(--bg-2)); }
@media (max-width: 760px) { .thumb { width: 46px; height: 58px; } .thumb.ph { font-size: 1.1rem; } .lead .call { font-size: .82rem; } }
.heat { font-size: .78rem; letter-spacing: -2px; vertical-align: 2px; }
.heat.h1 { opacity: .45; }
.quick { border: 1px solid var(--line); background: var(--bg-2); border-radius: 10px; width: 40px; height: 36px; cursor: pointer; font-size: 1rem; }
.quick:hover { border-color: var(--accent); }
.empty-ico { font-size: 2.4rem; margin-bottom: 6px; }

.drawer .body { padding-bottom: 30px; }
.drawer header h2 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.timer { font-family: var(--mono); background: var(--go-soft); color: var(--go); padding: 6px 10px; border-radius: 10px; font-weight: 700; }
.call-btn { width: 100%; }
.notice { padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.cardgrid { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start; }
@media (max-width: 520px) { .cardgrid { grid-template-columns: 1fr; } }
.shot { display: grid; gap: 6px; font-size: .8rem; color: var(--accent); }
.shot img { width: 100%; border-radius: 12px; border: 1px solid var(--line); aspect-ratio: 9 / 16; object-fit: cover; object-position: top; background: var(--surface-2); }
.outcomes .btn { position: relative; padding-right: 34px; }
.outcomes kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
kbd { font-family: var(--mono); font-size: .72rem; background: var(--bg); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--muted); }
@media (hover: none) { .outcomes kbd { display: none; } }
.btn.goline { border-color: rgb(43 209 126 / .55); }
.btn.money { border-color: rgb(43 209 126 / .55); background: linear-gradient(135deg, rgb(43 209 126 / .16), transparent); }
.kiinn { background: var(--go-soft); border: 1px solid rgb(43 209 126 / .3); border-radius: var(--radius); padding: 12px 14px; }
.kiinn label { margin-top: 8px; }
.pikat { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.pikat button { border: 1px dashed var(--line); background: transparent; color: var(--ink-2); padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: .82rem; }
.pikat button:hover { border-color: var(--accent); color: var(--ink); }
.actionbar { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--glass-2); backdrop-filter: blur(10px); border-top: 1px solid var(--line-2); }
.actionbar .btn.big { min-height: 52px; font-size: 1rem; }

.leader { display: grid; gap: 6px; }
.lrow { display: grid; grid-template-columns: 34px 1fr auto auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); }
.lrow.me { outline: 1px solid rgb(139 147 255 / .5); }
.lrow .pos { text-align: center; font-weight: 800; }
.lrow .nm { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.answer.miss { border-color: rgb(255 93 108 / .5); }
.btn.mic { width: 44px; padding: 0; }
.btn.mic.rec { background: var(--bad); color: #fff; animation: blink 1s infinite; }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 95; }
.confetti i { position: absolute; top: -12px; left: var(--x); width: 9px; height: 14px; background: var(--c); border-radius: 2px; transform: rotate(var(--r)); animation: fall var(--d) ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(calc(var(--r) + 540deg)); opacity: .8; } }

.auth .logo { width: 120px; height: 120px; border-radius: 26px; display: block; margin: 0 auto 14px; box-shadow: 0 18px 50px -18px rgb(139 147 255 / .7); }
.auth h1 { text-align: center; }
.auth .sub { text-align: center; color: var(--muted); margin: 6px 0 4px; }
.pwrow { position: relative; }
.pwrow button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px 8px; }

@media print {
  .top, .bottomnav, .fab, #kerros, .offline, .listhead, .filters, #v-lista, #v-tulokset, #v-hallinta, .search, button { display: none !important; }
  #v-ohjeet { display: block !important; }
  body { background: #fff; color: #000; }
  .card, .step, .qa details { background: #fff; border-color: #ccc; color: #000; }
  .muted, th { color: #444 !important; }
  details { break-inside: avoid; } details > p { display: block; }
}
body.kortti-auki .toast { bottom: 110px; }
@media (max-width: 760px) {
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 0 12px 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: none; }
  .steps-mini { grid-template-columns: 1fr 1fr; }
  .stepbtn { font-size: .85rem; padding: 8px 10px; }
  .onboard { padding: 12px; }
  .outcomes kbd { display: none; }
  .outcomes .btn { padding-right: 12px; }
  .hero h1 { font-size: 1.4rem; }
  .actionbar { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .drawer .body { padding: 14px 14px 24px; }
  .drawer header { padding: 12px 14px; }
}

/* ================= v3 (6.11.2026): vaalea teema, sessio, ryhmät, merkit, hallinnan lisät ================= */
:root[data-theme="light"] {
  --bg: #f6f7fc; --bg-2: #eef0f9; --surface: #ffffff; --surface-2: #f1f2fa; --line: #d5d8ec; --line-2: #e4e6f3;
  --ink: #12142a; --ink-2: #2e3255; --muted: #646a92;
  --accent: #4f58e0; --accent-2: #5a63ee; --accent-soft: rgb(90 99 238 / 0.10);
  --go: #0f9f5a; --go-ink: #fff; --go-soft: rgb(15 159 90 / 0.10);
  --hot: #d9730d; --hot-soft: rgb(217 115 13 / 0.10);
  --bad: #d63848; --bad-soft: rgb(214 56 72 / 0.09);
  --warn: #9a6b00; --warn-bg: #fff4d6;
  --shadow: 0 12px 30px -16px rgb(30 34 80 / 0.35);
  --glass: rgb(246 247 252 / 0.88); --glass-2: rgb(255 255 255 / 0.96); --hover: #e8eaf8; --hover-2: #fafbff; --glow: rgb(90 99 238 / 0.10);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f7fc; --bg-2: #eef0f9; --surface: #ffffff; --surface-2: #f1f2fa; --line: #d5d8ec; --line-2: #e4e6f3;
    --ink: #12142a; --ink-2: #2e3255; --muted: #646a92;
    --accent: #4f58e0; --accent-2: #5a63ee; --accent-soft: rgb(90 99 238 / 0.10);
    --go: #0f9f5a; --go-ink: #fff; --go-soft: rgb(15 159 90 / 0.10);
    --hot: #d9730d; --hot-soft: rgb(217 115 13 / 0.10);
    --bad: #d63848; --bad-soft: rgb(214 56 72 / 0.09);
    --warn: #9a6b00; --warn-bg: #fff4d6;
    --shadow: 0 12px 30px -16px rgb(30 34 80 / 0.35);
    --glass: rgb(246 247 252 / 0.88); --glass-2: rgb(255 255 255 / 0.96); --hover: #e8eaf8; --hover-2: #fafbff; --glow: rgb(90 99 238 / 0.10);
    color-scheme: light;
  }
}
.small-note { font-size: .82rem; }

/* latauspalkki */
.latauspalkki { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 300; pointer-events: none; opacity: 0; transition: opacity .2s; background: linear-gradient(90deg, transparent, var(--accent), var(--go), transparent); background-size: 50% 100%; background-repeat: no-repeat; }
.latauspalkki.on { opacity: 1; animation: lataa 1s linear infinite; }
@keyframes lataa { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* sessio-pilleri yläpalkissa */
.sessio { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 999px; background: var(--go-soft); color: var(--go); font-weight: 700; font-size: .88rem; }
.sessio .linkbtn { color: var(--ink-2); background: var(--surface); border-radius: 999px; padding: 4px 10px; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--go); animation: blink 1.4s infinite; }
@media (max-width: 760px) { .sessio { gap: 6px; font-size: .8rem; padding-left: 10px; } }

/* hero-lisät ja tiedote */
.hero-lisat { display: grid; gap: 8px; margin-top: 10px; }
.vinkki { font-size: .9rem; color: var(--ink-2); max-width: 640px; }
.tiedote { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--radius); background: var(--hot-soft); border: 1px solid color-mix(in srgb, var(--hot) 35%, transparent); animation: pop .25s ease-out; }
.tiedote > div { flex: 1; }
.tiedote-ico { font-size: 1.3rem; }
.close.small { width: 30px; height: 30px; font-size: .85rem; }

/* lista: ryhmäotsikot, kuumuusreuna, tiivis tila, lisää-nappi */
.ryhma { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 4px 0; }
.ryhma:first-child { padding-top: 0; }
.lead { position: relative; overflow: hidden; }
.lead::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; }
.lead.heat-3::before { background: var(--hot); }
.lead.heat-2::before { background: color-mix(in srgb, var(--hot) 45%, transparent); }
.leads.kompakti { gap: 6px; }
.leads.kompakti .lead { grid-template-columns: 1fr auto; padding: 10px 14px; }
.leads.kompakti .lead .name { font-size: .98rem; }
.leads .lisaa { width: 100%; margin-top: 4px; }
.leads > .small-note { text-align: center; padding: 6px; }
.empty-svg { width: 92px; height: 92px; color: var(--accent); margin: 0 auto 10px; display: block; opacity: .8; }
@media (prefers-reduced-motion: no-preference) {
  .empty-svg { animation: kierto 18s linear infinite; }
  .lead { animation: nouse .22s ease-out both; }
  .leads .lead:nth-child(n+12) { animation: none; }
}
@keyframes kierto { to { transform: rotate(360deg); } }
@keyframes nouse { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* toast-toiminto (Peru) */
.toast { display: flex; align-items: center; gap: 14px; }
.toast-btn { background: var(--accent-2); color: #fff; border: 0; border-radius: 10px; padding: 6px 12px; font-weight: 700; cursor: pointer; }

/* avatar */
.av { --hue: 240; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: .66rem; font-weight: 800; flex: none; vertical-align: middle; margin-right: 6px;
  background: hsl(var(--hue) 70% 62% / .22); color: hsl(var(--hue) 75% 45%); border: 1px solid hsl(var(--hue) 70% 60% / .4); }
:root:not([data-theme="light"]) .av { color: hsl(var(--hue) 85% 78%); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .av { color: hsl(var(--hue) 75% 40%); } }
.av.iso { width: 36px; height: 36px; font-size: .85rem; }
.history .h .av { margin-right: 6px; }

/* liidikortti */
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.tvinkki { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--radius); border: 1px dashed var(--line); font-size: .9rem; color: var(--ink-2); }
.tvinkki b { color: var(--ink); }
.smsmenu { position: relative; }
.smsmenu summary { list-style: none; }
.smsmenu summary::-webkit-details-marker { display: none; }
.smslist { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; display: grid; gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 220px; }
.smslist .btn { justify-content: flex-start; }
.hinnat { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 14px; }
.hinnat summary { cursor: pointer; font-weight: 650; }
.hlist { display: grid; gap: 6px; margin-top: 10px; font-size: .9rem; }
.laskuri { font-size: .75rem; font-family: var(--mono); }
.actionbar { grid-template-columns: 1fr 1.4fr; }
.actionbar .seuraavana { grid-column: 1 / -1; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* tulokset: edistyminen, merkit, tunnit */
.progress { height: 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); overflow: hidden; margin: 10px 0 6px; }
.progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--go)); transition: width .6s ease; }
.merkit { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.merkki { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); color: var(--muted); font-size: .85rem; font-weight: 600; filter: grayscale(1); opacity: .55; }
.merkki span { font-size: 1.5rem; }
.merkki.ok { filter: none; opacity: 1; color: var(--ink); background: linear-gradient(135deg, var(--accent-soft), transparent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.bars.tunnit, .bars.tunnit + .bars-l { grid-template-columns: repeat(10, 1fr); }

/* hallinta */
.suppilo { display: grid; gap: 8px; }
.vaihe { display: grid; gap: 4px; }
.vaihe .palkki { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.vaihe:last-child .palkki { background: var(--go); }
.syote { display: grid; gap: 10px; max-height: 420px; overflow-y: auto; }
.srivi { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; }
tr.himmea { opacity: .5; }
.tietolomake { padding: 10px 0; }
.tietorivi { padding: 10px 0; border-top: 1px solid var(--line-2); align-items: flex-start; flex-wrap: nowrap; }
details.card > summary { cursor: pointer; }

/* apuri */
.answer.oma { border-color: color-mix(in srgb, var(--go) 50%, transparent); }
.objs button.oma { border-color: color-mix(in srgb, var(--go) 50%, transparent); }
.objs button.ehd { background: var(--accent-soft); border-color: transparent; }
.palaute { display: inline-flex; gap: 2px; margin-right: 6px; }

/* treeni */
.modal.treeni { width: min(560px, 100%); display: grid; gap: 12px; }
.treeni-k { font-size: 1.35rem; line-height: 1.3; }
.treeni-v { padding: 14px; border-radius: var(--radius); background: var(--go-soft); border: 1px solid color-mix(in srgb, var(--go) 30%, transparent); margin: 10px 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

@media print {
  .tiedote, .hero-lisat, .sessio, .latauspalkki { display: none !important; }
  #v-ohjeet::before { content: "Brändistudio · Myyjän muistilappu"; display: block; font-weight: 800; font-size: 1.3rem; margin-bottom: 12px; border-bottom: 2px solid #000; padding-bottom: 6px; }
  .qa details { border: 0; padding: 4px 0; }
  table { font-size: .85rem; }
  h2 { margin-top: 14px; }
}
.two > .card { align-self: start; }
.card select[aria-label="Teema"] { max-width: 320px; }
@media (max-width: 760px) {
  #ohje-nappi { display: none; }
  .vinkki { font-size: .82rem; }
  .hero-lisat .btn { min-height: 40px; }
  .tiedote { padding: 10px 12px; font-size: .9rem; }
  .drawer header h2 { font-size: 1.1rem; }
  .drawer header .btn.small { padding: 6px 10px; min-height: 38px; }
  .drawer header .close { width: 38px; height: 38px; }
  .smslist { min-width: 240px; }
  .merkit { grid-template-columns: 1fr 1fr; }
}
.ulos-i { display: none; font-size: 1.2rem; }
@media (max-width: 760px) {
  .top { gap: 8px; }
  .ulos-t { display: none; } .ulos-i { display: inline; }
  body.sessio-on .brand > div { display: none; }
  .sessio { margin-left: auto; }
}
@media (max-width: 760px) { .actionbar .btn.big { font-size: .92rem; padding: 8px 10px; } }
