/* Kalenterianalyysi mock-up · Flouris Partners
   Värit ja fontit Flouriksen graafisesta ohjeesta (flouris-brand/brand/brand.css): kuusi väriä,
   Helvetica + Instrument Serif Italic, suorat kulmat, ei varjoja, ei liukuvärejä, ei kuvakkeita.
   Ruudukko: 1100 px palsta = 12 x 77 + 11 x 16. Viikkonäkymä 8 + 4 saraketta: 728 + 16 + 356 = 1100. */

@font-face { font-family: "Instrument Serif"; src: url("brand/fonts/InstrumentSerif-Italic.ttf") format("truetype"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("brand/fonts/InstrumentSerif-Regular.ttf") format("truetype"); font-style: normal; font-weight: 400; font-display: swap; }

:root {
  --pellava: #F9F8F3; --voi: #FFE7AD; --taupe: #484036; --khaki: #7C7E70; --vtaupe: #CBC6BE; --taivas: #CEDDEF;
  --white: #FFFFFF;
  --muted: #6B655C;      /* tumma taupe vaalennettuna: toissijainen teksti, 5.4:1 pellavalla */
  --rule: #E7E4DD;       /* reunat ja rivit, noin 1.2:1 */
  --control: #CBC6BE;    /* lomakekenttien reuna = vaalea taupe */
  --ilta: #F0EEE7;       /* illan alue nauhassa */
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --gap: 16px;
  --pad: 24px;
  --slot: 24px;          /* yhden lohkon korkeus viikkoruudukossa, JS asettaa */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--pellava); color: var(--taupe); font: 16px/1.5 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, blockquote, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--taupe); outline-offset: 2px; }
::selection { background: var(--voi); color: var(--taupe); }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

.wrap { width: 100%; max-width: calc(1100px + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- Mock-upin palkki ---------- */
.demobar { display: flex; align-items: center; gap: 16px; padding: 8px var(--pad); background: var(--taupe); color: var(--pellava); font-size: 14px; position: sticky; top: 0; z-index: 30; }
.demobar__note { white-space: nowrap; }
.demobar__nav { display: flex; gap: 4px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.demobar__nav::-webkit-scrollbar { display: none; }
.demobar__nav a { display: inline-block; padding: 6px 12px; text-decoration: none; white-space: nowrap; color: var(--pellava); }
.demobar__nav a::first-letter { text-transform: uppercase; }
.demobar__nav a[aria-current="page"] { background: var(--voi); color: var(--taupe); }
.demobar__reset { background: none; border: 1px solid rgba(249, 248, 243, .5); color: var(--pellava); padding: 5px 12px; white-space: nowrap; transition: transform 160ms var(--ease-out); }
.demobar__reset:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .demobar__nav a:not([aria-current="page"]):hover { background: rgba(249, 248, 243, .12); }
  .demobar__reset:hover { border-color: var(--pellava); }
}
.palkki { height: 6px; background: var(--voi); }

/* ---------- Tuotteen yläpalkki ---------- */
.apphead__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.apphead__brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.apphead__brand img { width: 130px; }
.apphead__product { padding-left: 14px; border-left: 1px solid var(--vtaupe); font-size: 15px; }
.apphead__coach { font-size: 14px; color: var(--muted); }

/* ---------- Typografia (Flouris: versaali + kursiivinen häntä) ---------- */
.otsikko { font-family: var(--sans); font-weight: 400; text-transform: uppercase; letter-spacing: -0.02em; line-height: 1.04; text-wrap: balance; }
.otsikko em { font-family: var(--serif); font-style: italic; text-transform: none; letter-spacing: 0; font-size: 1.06em; }
.otsikko--iso { font-size: clamp(38px, 5.4vw, 72px); }
.otsikko--osio { font-size: clamp(26px, 3vw, 38px); }
.otsikko--app { font-size: clamp(24px, 2.4vw, 32px); }
.ingressi { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.22; }
.nosto { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2vw, 28px); line-height: 1.25; }

/* ---------- Painikkeet ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 0; font-size: 15px; text-decoration: none; white-space: nowrap; transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--taupe); color: var(--pellava); }
.btn--secondary { background: var(--white); border-color: var(--control); }
.btn--text { background: none; padding: 0 8px; text-decoration: underline; text-underline-offset: 3px; }
.btn[disabled] { background: var(--vtaupe); color: var(--taupe); cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: #2f2a23; }
  .btn--secondary:hover { border-color: var(--taupe); }
}

.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; font-size: 12px; line-height: 1; white-space: nowrap; flex: none; vertical-align: middle; }
.pill--demo { background: var(--voi); color: var(--taupe); }
.pill--quiet { background: var(--white); border: 1px solid var(--control); }

/* ---------- Paneelit ---------- */
.panel { padding: 20px; }
.panel--white { background: var(--white); border: 1px solid var(--rule); }
.panel--pellava { background: #F2F0EA; }
.panel--voi { background: var(--voi); }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.panel__title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.panel__meta { font-size: 13px; color: var(--muted); }
.panel--voi .panel__meta { color: var(--taupe); }
.panel__link { font-size: 14px; text-underline-offset: 3px; }
.panel__finding { font-size: 15px; margin: -4px 0 16px; }
.bg-taivas { background: var(--taivas); }

/* ---------- Otsikkorivi ---------- */
.titlerow { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 32px 0 24px; }
.titlerow__sub { margin-top: 10px; font-size: 15px; color: var(--muted); }
.titlerow__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Selite ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.legend__item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sw { width: 14px; height: 14px; flex: none; }
.sw--dot { width: 8px; height: 8px; border-radius: 50%; background: var(--taupe); margin: 0 3px; }
.legend__glyph { font-weight: 700; }

/* kategoriat: täyttö + tekstin väri (ohjeen sallitut parit) */
.c-asi { background: var(--taivas); color: var(--taupe); }
.c-sis { background: var(--vtaupe); color: var(--taupe); }
.c-tii { background: var(--taupe); color: var(--pellava); }
.c-oma { background: var(--white); color: var(--taupe); outline: 1.5px solid var(--taupe); outline-offset: -1.5px; }
.c-tau { background: var(--voi); color: var(--taupe); }

/* ---------- 1. Aloitus ---------- */
.intro { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: center; padding-top: 56px; padding-bottom: 96px; }
.intro__copy { grid-column: 1 / span 6; }
.intro__lede { margin-top: 28px; max-width: 30ch; }
.intro__actions { margin-top: 36px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.intro__privacy { font-size: 15px; color: var(--muted); max-width: 40ch; }
.intro__figure { grid-column: 7 / span 6; }
.intro__caption { margin-top: 12px; font-size: 14px; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.step { background: var(--white); border: 1px solid var(--rule); padding: 28px 24px; display: flex; flex-direction: column; gap: 12px; }
.step--voi { background: var(--voi); border-color: var(--voi); }
.step__title { font-size: 20px; font-weight: 400; line-height: 1.25; }
.step p { font-size: 16px; }
.step .step__tier { margin-top: auto; padding-top: 8px; font-family: var(--serif); font-style: italic; font-size: 22px; }

.coachrow { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: center; padding-top: 120px; padding-bottom: 120px; }
.coachrow__img { grid-column: 1 / span 4; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 30% 30%; }
.coachrow__copy { grid-column: 6 / span 7; display: flex; flex-direction: column; gap: 20px; }
.coachrow__sign { font-size: 15px; }
.coachrow__themes { font-size: 16px; color: var(--muted); max-width: 48ch; }

/* ---------- Viikkonauha (allekirjoituselementti) ---------- */
.strip { --label: 44px; position: relative; }
.strip__axis { position: relative; height: 18px; margin-left: var(--label); font-size: 12px; color: var(--muted); }
.strip__tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.strip__tick:first-child { transform: none; }
.strip__day { display: flex; align-items: stretch; }
.strip__name { flex: 0 0 var(--label); font-size: 13px; padding-top: 20px; }
.strip__lane { position: relative; flex: 1; height: 72px; border-left: 1px solid var(--rule); }
.strip__evening { position: absolute; top: 0; bottom: 0; right: 0; background: var(--ilta); }
.strip__eveninglabel { position: absolute; right: 4px; bottom: 4px; font-size: 12px; color: var(--muted); }
.strip__hour { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); }
.strip__bar { position: absolute; top: 20px; height: 30px; overflow: hidden; }

.strip__bar + .strip__bar { border-left: 1px solid var(--white); }
.strip__ai { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.strip__v { position: absolute; top: 52px; transform: translateX(-50%); font-size: 12px; font-weight: 700; line-height: 18px; }
.strip__run { position: absolute; top: 4px; height: 12px; border: 1px solid var(--taupe); border-bottom: 0; }
.strip__runlabel { position: absolute; top: -3px; left: 50%; transform: translateX(-50%); padding: 0 6px; background: var(--white); font-size: 12px; line-height: 14px; white-space: nowrap; }
.strip--mini .strip__lane { height: 44px; }
.strip--mini .strip__bar { top: 8px; height: 22px; }
.strip--mini .strip__name { padding-top: 10px; font-size: 12px; }
.strip--mini .strip__v, .strip--mini .strip__run { display: none; }
.panel--pellava .strip__runlabel { background: #F2F0EA; }

/* ---------- 2. Täytä viikko ---------- */
.wk { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 16px; align-items: start; padding-bottom: 96px; }
.toolbar { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar__hint { font-size: 14px; color: var(--muted); margin-right: auto; }
.seg { display: inline-flex; border: 1px solid var(--control); background: var(--white); }
.seg button { min-height: 36px; padding: 0 14px; border: 0; background: none; font-size: 14px; }
.seg button[aria-checked="true"] { background: var(--taupe); color: var(--pellava); }

.daytabs { display: none; }
.grid { --cols: 5; display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(0, 1fr)); background: var(--white); border: 1px solid var(--rule); }
.grid__head { position: sticky; top: 44px; z-index: 5; background: var(--white); border-bottom: 1px solid var(--rule); padding: 10px 8px; font-size: 14px; }
.grid__head small { display: block; font-size: 12px; color: var(--muted); }
.grid__corner { position: sticky; top: 44px; z-index: 5; background: var(--white); border-bottom: 1px solid var(--rule); }
.grid__times { position: relative; }
.grid__time { height: var(--slot); font-size: 12px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.grid__col { position: relative; border-left: 1px solid var(--rule); }
.slot { display: block; width: 100%; height: var(--slot); border: 0; border-top: 1px solid transparent; background: none; padding: 0; }
.slot.is-hour { border-top-color: var(--rule); }
.slot.is-evening { background: #FBFAF6; }
.slot.is-selected { background: var(--pellava); outline: 2px solid var(--taupe); outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) {
  .slot:hover { background: var(--pellava); }
  .slot:hover::after { content: "Lisää"; font-size: 12px; color: var(--muted); padding-left: 6px; }
}
.block { position: absolute; left: 3px; right: 3px; display: flex; flex-direction: column; justify-content: flex-start; gap: 0; padding: 3px 6px; border: 0; text-align: left; font-size: 12px; line-height: 1.25; overflow: hidden; transition: transform 160ms var(--ease-out); }
.block:active { transform: scale(.98); }
.block.is-selected { outline: 2px solid var(--taupe); outline-offset: 1px; }
.block__label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block__meta { display: flex; gap: 6px; align-items: center; font-size: 12px; opacity: .9; }
.block__ai { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.block--short { flex-direction: row; align-items: center; gap: 6px; padding-top: 0; padding-bottom: 0; }
.block--short .block__label { flex: 1; min-width: 0; }
.block--tiny { padding: 0 6px; font-size: 11px; }
.block--tiny .block__meta { display: none; }
.grid__next { display: none; }

.side { position: sticky; top: 60px; display: flex; flex-direction: column; gap: 16px; }
.side__block { background: var(--white); border: 1px solid var(--rule); padding: 20px; }
.side__block--pellava { background: #F2F0EA; border: 0; }
.side__title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.side__sub { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.side__how li { font-size: 14px; padding: 6px 0; border-top: 1px solid var(--rule); }
.side__how li:first-child { border-top: 0; }

/* editori */
.ed { display: flex; flex-direction: column; gap: 18px; }
.ed__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ed__title { font-size: 18px; font-weight: 700; }
.ed__when { font-size: 14px; color: var(--muted); }
.ed fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ed legend { font-size: 14px; font-weight: 700; margin-bottom: 8px; padding: 0; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cat { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 1px solid var(--control); background: var(--white); font-size: 15px; text-align: left; transition: transform 160ms var(--ease-out); }
.cat:active { transform: scale(.97); }
.cat .sw { width: 16px; height: 16px; }
.cat[aria-checked="true"] { border-color: var(--taupe); outline: 1px solid var(--taupe); outline-offset: -2px; background: var(--pellava); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 40px; min-width: 64px; padding: 0 12px; border: 1px solid var(--control); background: var(--white); font-size: 14px; transition: transform 160ms var(--ease-out); }
.chip:active { transform: scale(.97); }
.chip[aria-checked="true"] { background: var(--taupe); color: var(--pellava); border-color: var(--taupe); }
.chip[disabled] { color: var(--muted); background: var(--pellava); border-style: dashed; cursor: not-allowed; }
.ed__limit { font-size: 13px; color: var(--muted); margin-top: 6px; }
.vire { display: grid; grid-template-columns: repeat(3, 1fr); }
.vire .chip { min-width: 0; margin-left: -1px; }
.vire .chip:first-child { margin-left: 0; }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 15px; cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--taupe); margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.field input, .field textarea, textarea { font-weight: 400; min-height: 44px; padding: 10px 12px; border: 1px solid var(--control); border-radius: 0; background: var(--white); font-size: 16px; width: 100%; }
.field input::placeholder { color: var(--muted); }
.ed__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ed__actions .btn--primary { flex: 1; }
.ed__delete { color: var(--taupe); }

/* puhelimen alapaneeli */
.scrim { position: fixed; inset: 0; background: rgba(72, 64, 54, .38); z-index: 40; opacity: 0; transition: opacity 240ms ease; }
.scrim.is-open { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 88vh; overflow-y: auto; background: var(--pellava); border-top: 6px solid var(--voi); padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform 300ms var(--ease-drawer); overscroll-behavior: contain; }
.sheet.is-open { transform: translateY(0); }

/* ---------- 3. Analyysi ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--white); border: 1px solid var(--rule); margin-bottom: 16px; }
.kpi { padding: 16px 20px; border-left: 1px solid var(--rule); }
.kpi:first-child { border-left: 0; }
.kpi__label { font-size: 14px; color: var(--muted); }
.kpi__value { font-size: 26px; line-height: 1.2; margin-top: 4px; }
.kpi__value small { font-size: 15px; color: var(--muted); }
.kpi__cap { font-size: 13px; color: var(--muted); margin-top: 2px; }
.weekpanel { margin-bottom: 16px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

.tbars li { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 12px; align-items: baseline; padding: 8px 0; }
.tbars__name { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.tbars__val { font-size: 15px; text-align: right; }
.tbars__pct { font-size: 13px; color: var(--muted); text-align: right; min-width: 3.2em; }
.tbars__track { grid-column: 1 / -1; height: 8px; }
.tbars__fill { height: 100%; }


.ebars li { display: grid; grid-template-columns: 7.5em 1fr 1fr; align-items: center; gap: 0 8px; padding: 7px 0; font-size: 14px; }
.ebars__side { position: relative; height: 22px; display: flex; align-items: center; }
.ebars__side--down { justify-content: flex-end; border-right: 1px solid var(--taupe); }
.ebars__bar { height: 14px; }
.ebars__side--down .ebars__bar { background: var(--taupe); }
.ebars__side--up .ebars__bar { background: var(--khaki); }
.ebars__val { font-size: 12px; padding: 0 6px; white-space: nowrap; }
.ebars__axis { display: grid; grid-template-columns: 7.5em 1fr 1fr; gap: 0 8px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.ebars__axis span:nth-child(2) { text-align: right; padding-right: 8px; }
.ebars__axis span:nth-child(3) { padding-left: 8px; }

.room { padding: 120px 0 0; }
.room__head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: end; padding-bottom: 24px; border-bottom: 2px solid var(--taupe); }
.room__status { margin-top: 12px; font-size: 15px; color: var(--muted); }
.room__figure { text-align: right; }
.room__num { font-size: 40px; line-height: 1.1; }
.room__num small { font-size: 20px; }
.room__cap { font-size: 14px; color: var(--muted); margin-top: 4px; margin-left: auto; max-width: 32ch; }

.sugs > li { display: grid; grid-template-columns: 8.5em minmax(0, 1fr) 10em; gap: 8px 24px; padding: 24px 0; border-bottom: 1px solid var(--rule); }
.sug__kind { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.2; }
.sug__title { font-size: 18px; line-height: 1.3; }
.sug__text { font-size: 16px; margin-top: 6px; max-width: 62ch; }
.sug__ev { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ev { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; font-size: 13px; white-space: nowrap; flex: none; }
.ev .sw { width: 10px; height: 10px; }
.ev--plain { background: var(--white); border: 1px solid var(--rule); }
.sug__gain { text-align: right; font-size: 15px; }
.sug__gain strong { display: block; font-size: 22px; font-weight: 400; }
.sug__gain span { color: var(--muted); font-size: 13px; }
.sugs__empty { padding: 24px 0; font-size: 16px; color: var(--muted); border-bottom: 1px solid var(--rule); }

.closing { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; margin: 120px 0 96px; }
.closing__img { grid-column: 1 / span 5; width: 100%; height: 100%; min-height: 280px; object-fit: cover; object-position: 50% 25%; }
.closing__copy { grid-column: 6 / span 7; padding: 40px 40px 40px 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.closing__sign { font-size: 15px; }

/* ---------- 4. Saaran näkymä ---------- */
.coach { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 50px); background: var(--pellava); }
.coach__side { padding: 20px 12px 20px 20px; display: flex; flex-direction: column; gap: 8px; position: sticky; top: 44px; height: calc(100vh - 50px); }
.coach__brand { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 4px 8px 20px; }
.coach__brand img { width: 24px; }
.coach__label { font-size: 13px; color: var(--muted); padding: 0 8px; display: flex; gap: 8px; align-items: center; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; background: var(--taupe); color: var(--pellava); font-size: 12px; }
.inbox { display: flex; flex-direction: column; gap: 2px; }
.inbox__row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; padding: 10px 8px; border: 0; background: none; text-align: left; transition: transform 160ms var(--ease-out); }
.inbox__row:active { transform: scale(.98); }
.inbox__row[aria-current="true"] { background: #ECE9E2; }
@media (hover: hover) and (pointer: fine) { .inbox__row:not([aria-current="true"]):hover { background: #F2F0EA; } }
.inbox__name { font-size: 15px; }
.inbox__meta { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.inbox__status { font-size: 12px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; white-space: nowrap; }
.st-new { background: var(--voi); }
.st-draft { background: var(--taivas); }
.st-done { background: var(--white); border: 1px solid var(--rule); color: var(--muted); }
.coach__user { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px; }
.coach__user img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: 48% 20%; }
.coach__sheet { background: var(--white); border-left: 1px solid var(--rule); padding: 0 32px 64px; min-width: 0; }
.coachgrid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 16px; align-items: start; }
.coachgrid__side { display: flex; flex-direction: column; gap: 16px; }
.coach .panel--pellava { background: #F4F2EC; }

.review > li { padding: 16px 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
.review > li:first-child { border-top: 0; padding-top: 4px; }
.review__kind { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.review__title { font-size: 17px; line-height: 1.3; }
.review__text { font-size: 15px; margin-top: 4px; }
.review__gain { font-size: 14px; text-align: right; white-space: nowrap; }
.review__controls { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.review__controls .chip { min-height: 36px; }
.review li.is-removed .review__title, .review li.is-removed .review__text { text-decoration: line-through; color: var(--muted); }
.review__edit { display: flex; flex-direction: column; gap: 8px; }
.review__edit input, .review__edit textarea { width: 100%; }
.st-ok { background: var(--taivas); }

.facts { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; margin-top: 12px; font-size: 14px; }
.facts dt, .facts dd { padding: 7px 0; border-top: 1px solid var(--rule); }
.facts dd { text-align: right; }
.plan li { padding: 10px 0; border-top: 1px solid rgba(72, 64, 54, .18); font-size: 15px; }
.plan li:first-child { border-top: 0; padding-top: 0; }
.plan__theme { display: block; font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.2; margin-bottom: 2px; }
.notepanel { margin-top: 16px; }
.notepanel textarea { min-height: 96px; resize: vertical; font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.3; }

/* ---------- Dialogi ja ilmoitus ---------- */
.dialog { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(72, 64, 54, .38); }
.dialog__card { width: min(480px, 100%); background: var(--pellava); border-top: 6px solid var(--voi); padding: 28px; display: flex; flex-direction: column; gap: 16px; animation: dlg-in 200ms var(--ease-out); }
@keyframes dlg-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.dialog__lede { font-size: 15px; }
.dialog__note { font-size: 13px; color: var(--muted); }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--taupe); flex: none; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; max-width: calc(100% - 32px); padding: 12px 18px; background: var(--taupe); color: var(--pellava); font-size: 15px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: transform 220ms var(--ease-out), opacity 220ms ease; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Alatunniste ---------- */
.foot { border-top: 1px solid var(--rule); }
.foot__in { display: flex; align-items: center; gap: 24px; padding-top: 32px; padding-bottom: 40px; font-size: 14px; color: var(--muted); }
.foot__in img:first-child { width: 160px; }
.foot__mark { width: 56px; margin-left: auto; }

.view { animation: view-in 180ms var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .view, .dialog__card { animation: none; }
  .sheet, .toast { transition: opacity 150ms ease; }
  .btn:active, .chip:active, .cat:active, .block:active, .inbox__row:active { transform: none; }
}

/* ---------- Tabletti ---------- */
@media (max-width: 1100px) {
  .coach { grid-template-columns: 212px minmax(0, 1fr); }
  .coachgrid { grid-template-columns: 1fr; }
  .coachgrid__side { display: grid; grid-template-columns: 1fr 1fr; }
}

/* ---------- Puhelin ja kapea ---------- */
@media (max-width: 899px) {
  :root { --pad: 16px; }
  .wk { grid-template-columns: 1fr; }
  .wk__side { display: none; }
  .side { position: static; }
  .side [data-side-summary] { display: none; }
  .toolbar__hint { display: none; }
  .daytabs { display: grid; grid-template-columns: repeat(5, 1fr); position: sticky; top: 44px; z-index: 6; background: var(--pellava); padding: 8px 0; margin: 0 0 8px; gap: 4px; }
  .daytab { min-height: 52px; border: 1px solid var(--control); background: var(--white); font-size: 15px; line-height: 1.15; padding: 4px 2px; transition: transform 160ms var(--ease-out); }
  .daytab:active { transform: scale(.97); }
  .daytab small { display: block; font-size: 12px; color: var(--muted); }
  .daytab[aria-selected="true"] { background: var(--taupe); color: var(--pellava); border-color: var(--taupe); }
  .daytab[aria-selected="true"] small { color: var(--pellava); }
  .grid { --cols: 1; grid-template-columns: 48px minmax(0, 1fr); }
  .grid__head, .grid__corner { display: none; }
  .grid__col:not(.is-day) { display: none; }
  .block { font-size: 14px; padding: 4px 10px; left: 4px; right: 4px; }
  .block__meta { font-size: 13px; }
  .grid__next { display: flex; justify-content: flex-end; margin-top: 12px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .row2 { grid-template-columns: 1fr; }
  .room__head { grid-template-columns: 1fr; }
  .room__figure { text-align: left; }
  .room__cap { margin-left: 0; }
  .sugs > li { grid-template-columns: 1fr; gap: 4px; }
  .sug__gain { text-align: left; margin-top: 8px; }
  .sug__gain strong { display: inline; font-size: 18px; margin-right: 6px; }
  .closing { grid-template-columns: 1fr; margin: 72px 0 64px; }
  .closing__img { grid-column: 1; min-height: 0; aspect-ratio: 16 / 10; }
  .closing__copy { grid-column: 1; padding: 24px 20px 28px; }
  .room { padding-top: 72px; }
  .intro { grid-template-columns: 1fr; padding-top: 32px; padding-bottom: 64px; gap: 40px; }
  .intro__copy, .intro__figure { grid-column: 1; }
  .steps { grid-template-columns: 1fr; }
  .coachrow { grid-template-columns: 1fr; padding-top: 72px; padding-bottom: 72px; gap: 24px; }
  .coachrow__img, .coachrow__copy { grid-column: 1; }
  .coachrow__img { aspect-ratio: 4 / 3; }
  .coach { grid-template-columns: minmax(0, 1fr); }
  .coach__side { position: static; height: auto; padding: 12px 16px 8px; min-width: 0; }
  .coach__brand { padding-bottom: 8px; }
  .inbox { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 6px; scrollbar-width: thin; }
  .inbox__row { flex: 0 0 auto; width: auto; min-width: 180px; border: 1px solid var(--rule); background: var(--white); }
  .coach__user { display: none; }
  .coach__sheet { border-left: 0; border-top: 1px solid var(--rule); padding: 0 16px 48px; }
  .coachgrid__side { grid-template-columns: 1fr; }
  .titlerow { padding: 24px 0 20px; }
  .titlerow__actions { width: 100%; }
  .titlerow__actions .btn { flex: 1 1 auto; }
  .apphead__coach { display: none; }
  .foot__in { flex-wrap: wrap; gap: 16px; }
  .strip { --label: 30px; }
  .ebars li, .ebars__axis { grid-template-columns: 6.2em 1fr 1fr; }
  .demobar { padding: 8px 16px; gap: 10px; }
  .demobar__long, .demobar__reset { display: none; }
  .demobar__nav { margin: 0; }
  .demobar__nav a { padding: 6px 10px; }
}
@media (min-width: 900px) {
  .sheet { position: static; transform: none; max-height: none; overflow: visible; padding: 20px; background: var(--white); border: 1px solid var(--rule); border-top: 6px solid var(--voi); transition: none; z-index: auto; }
  .scrim { display: none !important; }
}

/* break-ui-testikytkin, näkyy vain ?data=-parametrilla */
.devtoggle { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 70; display: flex; gap: 2px; padding: 3px; background: #e5e5e5; font: 13px/1 system-ui, sans-serif; }
.devtoggle a { padding: 7px 10px; color: #333; text-decoration: none; white-space: nowrap; }
.devtoggle a[aria-current] { background: #fff; }

/* kalenterin tuonti */
.toolbar__hint--ics { display: block; font-size: 13px; color: var(--muted); margin: 0 0 12px; max-width: 70ch; }
@media (max-width: 899px) { .toolbar__hint--ics { display: block; } }
