:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --card: #ffffff;
  --text: #1a1f29;
  --ink: #1b222b;
  --muted: #64707d;
  --border: #e3e7eb;
  /* Ylätunnisteen (site-header) taustaväri — oletuksena läpikuultava valkoinen, mutta
     teemoitettavissa erikseen (esim. tumma teema haluaa läpikuultavan TUMMAN palkin sen
     sijaan) — ks. booking.js:n applyBranding() ja db-common.js:n branding.paletti.header. */
  --header-bg: rgba(255,255,255,.85);
  /* Ylätunnisteen otsikkotekstin väri — oma muuttuja koska --ink on muuten kiinteä (käytetään
     pinnoilla jotka pysyvät AINA valkoisina), mutta ylätunniste VOI olla tumma teemasta
     riippuen (ks. --header-bg yllä), jolloin otsikkotekstinkin pitää vaihtua vaaleaksi. */
  --header-ink: var(--ink);

  /* Kiinteä, tumma/hillitty peruspaletti (ei asiakaskohtaisesti muutettavissa) */
  --primary: #26313e;
  --primary-2: #333f4d;

  /* Brändin korostusväri — SuperAdmin voi vaihtaa (branding.primaryColor), oletus sama
     poltettu oranssi kuin kalenterin tehostevärissä, jotta ulkoasu on yhtenäinen. */
  --accent: #bb6a2c;
  --accent-2: #a55a20;

  --free: #eef2f0;
  --free-border: #6f8f82;
  --busy: #f6dbd4;
  --busy-border: #c1503a;

  --radius: 14px;
  --radius-lg: 18px;
  --shadow-card: 0 1px 2px rgba(15,23,32,.04), 0 10px 24px -14px rgba(15,23,32,.18);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(1200px 400px at 50% -120px, rgba(38,49,62,.05), transparent);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  /* Julkisen varaussivun "sticky footer" -rakenne: body on koko näytön korkuinen (vähintään)
     flex-pylväs, jossa .site-header ja .site-footer vievät vain tarvitsemansa tilan ja
     .page (pääsisältö) venyy täyttämään loput. Näin .site-footer pysyy AINA näytön
     alalaidassa myös silloin kun sisältöä on vähän, sen sijaan että se jäisi roikkumaan
     keskelle tyhjää sivua. Ei vaikuta admin-paneeliin (.wp-shell käyttää omaa, jo valmiiksi
     koko näytön kokoista flex-layouttiaan, ks. alempana .wp-shell).
     Huom: tämä koskee vain julkista varaussivua (index.html + tietosuoja/omavaraus/yhteystiedot-
     sivut) — admin-paneelin body.admin-page ei käytä .site-footeria lainkaan. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Julkisen varaussivun rakenne ===== */
.site-header {
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  /* Piiloutuu alaspäin vieritettäessä, palaa ylöspäin vieritettäessä — ks.
     header-autohide.js:n scroll-kuuntelija, joka lisää/poistaa alla olevan luokan. */
  transition: transform .25s ease;
}
.site-header.site-header--hidden { transform: translateY(-100%); }
.site-header-inner { max-width: 1080px; margin: 0 auto; padding: clamp(12px, 2.5vw, 16px) clamp(16px, 4vw, 24px); }
/* KORJAUS: ennen tätä sivu näytti AINA ensin oletusnimen ("Varausjärjestelmä"), oletus-
   kirjainmerkin ("V") ja oletuskuvakkeen, jotka sitten vaihtuivat asiakkaan oikeiksi tiedoiksi
   heti kun /api/config-haku valmistui — havaittavissa selvänä "vilahduksena" sivua ladattaessa
   tai päivittäessä (ks. käyttäjän ilmoittama puute). Piilotetaan brändi (logo/kirjainmerkki/
   otsikkoteksti) NÄKYVYYDELTÄÄN (visibility, ei display, ettei aiheuta asettelun hyppäystä)
   heti alusta, ja näytetään vasta kun JS on ehtinyt hakea ja soveltaa oikeat asetukset — ks.
   branding-common.js:n naytaBrandi()/applyVisualBranding() ja booking.js:n vastaava, jotka
   lisäävät body-elementille "brandi-valmis"-luokan sekä onnistuneen haun että virhetilanteen
   jälkeen (ettei header jää ikuisesti piiloon esim. verkkokatkon sattuessa). Kuvakkeen
   (favicon) vilahdusta tämä ei voi estää — se on selaimen oma, sivun sisällön ulkopuolinen
   toiminto eikä sitä voi ohjata CSS:llä tai JS:llä ilman palvelinpuolista mallinnusta. */
.brand { visibility: hidden; }
body.brandi-valmis .brand { visibility: visible; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: clamp(28px, 6vw, 36px); border-radius: 8px; }
.brand-mark {
  width: clamp(30px, 7vw, 38px); height: clamp(30px, 7vw, 38px); border-radius: 10px;
  background: var(--accent); color: white; font-weight: 800; display: flex; align-items: center; justify-content: center;
  font-size: clamp(.95rem, 3vw, 1.1rem); flex-shrink: 0;
  box-shadow: 0 2px 6px -1px rgba(187,106,44,.45);
}
.brand h1 { font-size: clamp(1.05rem, 3vw, 1.3rem); margin: 0; color: var(--header-ink); font-weight: 700; letter-spacing: -.01em; }

.page { max-width: 1080px; margin: 0 auto; padding: clamp(16px, 4vw, 28px); padding-bottom: 90px; width: 100%; flex: 1 0 auto; }
.hero-text {
  color: var(--muted); font-size: clamp(.9rem, 2.2vw, 1rem); margin: 0 0 20px; max-width: 640px;
}

/* ===== Etenemispalkki ===== */
.stepper { display: flex; align-items: center; margin: 0 0 16px; max-width: 460px; }
.stepper .step { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.stepper .step-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border);
  color: var(--muted); font-size: .78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stepper .step-label { font-size: .78rem; color: var(--muted); white-space: nowrap; display: none; }
.stepper .step.active .step-num { background: var(--accent); border-color: var(--accent); color: white; }
.stepper .step.active .step-label { color: var(--ink); font-weight: 700; display: inline; }
.stepper .step.done .step-num { background: var(--primary); border-color: var(--primary); color: white; }
.stepper .step-line { flex: 1; height: 2px; background: var(--border); margin: 0 4px; min-width: 12px; }
@media (min-width: 560px) { .stepper .step-label { display: inline; } }

/* ===== Luottamusmerkit ===== */
.trust-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 20px; }
.trust-item { font-size: .8rem; color: var(--muted); }

/* .site-footer on nykyään <main>-elementin ULKOPUOLINEN sisarus (ks. index.html) ja saa
   "flex-shrink: 0" body-pylväältä ilmaiseksi (ei tarvitse omaa flex-none-sääntöä), joten se
   pysyy aina paikallaan sivun alalaidassa riippumatta .page-sisällön korkeudesta. */
.site-footer {
  text-align: center; margin-top: 32px; padding: 16px clamp(16px, 4vw, 28px) 20px;
  border-top: 1px solid rgba(0,0,0,.08); max-width: 1080px; margin-left: auto; margin-right: auto;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.site-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.site-footer a { color: var(--muted); font-size: .85rem; text-decoration: underline; }
/* Ohjelmiston valmistajan (Vuoro) tunniste — pienempi ja hillitympi kuin varsinaiset
   toiminnalliset alalinkit yllä (ei alleviivausta), mutta TÄYDELLÄ peittävyydellä (ei
   himmennystä/opacity:ia) jotta se on aina selvästi luettavissa eikä vaadi hoveria — ks.
   käyttäjän pyyntö "pienellä mutta että saa selvää". Tumma teksti (--ink) + oma väri pisteelle,
   ei --muted-harmaa, koska liian vaalea teksti olisi juuri se ongelma jota pyyntö varoitti. */
.site-footer-credit a {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  color: var(--ink); font-size: .8rem; font-weight: 700;
}
.site-footer-credit a:hover { text-decoration: underline; }

.layout { display: block; }
.steps-col { display: flex; flex-direction: column; gap: 18px; }
.summary-col { display: flex; flex-direction: column; gap: 18px; margin-top: 18px; }
@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 26px; align-items: start; }
  .summary-col { margin-top: 0; position: sticky; top: 20px; }
}

.step-card, .summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 4vw, 22px);
  box-shadow: var(--shadow-card);
}
.step-card h2, .summary-card h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: .78rem; margin: 0 0 14px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
}
/* Otsikoiden edestä poistettu koristeellinen "tekoälymäinen" pallo/neliö-symboli
   käyttäjän pyynnöstä — h2-otsikot ovat nyt pelkkää tekstiä (isoilla kirjaimilla,
   harmaana), ilman ylimääräistä kuviota edessä. */
.summary-card#infoCard { background: var(--surface-2); box-shadow: none; }
#instructionsText { margin: 0; }
.summary-card.confirm-card { text-align: center; }
h2.no-icon { text-transform: none; font-size: 1.15rem; letter-spacing: 0; color: var(--ink); justify-content: center; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
h2 { font-size: 1rem; margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
select, input, textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
  background: white;
  /* Kenttä pysyy AINA valkoisena taustana riippumatta sivun teemasta (myös tumma teema) —
     siksi tekstiväri on lukittu tummaksi eikä perinnyt body:n teemakohtaista --text-väriä,
     joka tummalla teemalla olisi vaalea (=> vaaleaa tekstiä valkoisella pohjalla, ei luettavissa). */
  color: #1a1f29;
  font-family: inherit;
}
/* Ilman tätä textarea olisi oletuksena kapeampi kuin muut nimi-/yhteystietokentät (esim.
   asiakkaan oma "Lisätiedot"-kenttä varauslomakkeella) — sama täysi leveys kaikille. */
textarea { resize: vertical; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: white;
  font-size: .95rem;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
}
.chip.selected { border-color: var(--primary); background: #e8ebee; font-weight: 600; color: var(--primary); }

/* ===== Aikakalenteri (tumma/hillitty, tunti-rivit + puolen tunnin jako) ===== */
.cal-card { padding: 0; overflow: hidden; }
.cal-card h2 { padding: 16px 16px 0; }
.cal-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; background: var(--primary); color: #eef1f4; padding: 12px 14px; margin-top: 12px;
}
.cal-toolbar-left, .cal-toolbar-mid, .cal-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-icon-btn {
  width: clamp(32px, 8vw, 38px); height: clamp(32px, 8vw, 38px); border-radius: 10px; border: 1px solid #3c4757;
  background: var(--primary-2); color: #eef1f4; font-size: clamp(.9rem, 3vw, 1.05rem); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; min-height: unset; flex-shrink: 0;
}
.cal-icon-btn:hover { background: #3d4a59; }
.cal-nav-btn { border-radius: 50%; }
.cal-view-label { font-size: .8rem; color: #a9b2bd; white-space: nowrap; }
.cal-switch { position: relative; display: inline-block; width: 40px; height: 23px; flex-shrink: 0; }
.cal-switch input { opacity: 0; width: 0; height: 0; }
.cal-switch-slider { position: absolute; cursor: pointer; inset: 0; background: #48545f; border-radius: 999px; transition: .15s; }
.cal-switch-slider::before {
  content: ""; position: absolute; height: 17px; width: 17px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .15s;
}
.cal-switch input:checked + .cal-switch-slider { background: var(--accent); }
.cal-switch input:checked + .cal-switch-slider::before { transform: translateX(17px); }
.cal-week-badge {
  background: var(--primary-2); border: 1px solid #3c4757; border-radius: 8px; padding: 7px 9px;
  font-size: .8rem; color: #a9b2bd; min-width: 26px; text-align: center; flex-shrink: 0;
}
.cal-date-input {
  width: auto; margin: 0; padding: 7px 9px; font-size: .84rem; border-radius: 8px; border: 1px solid #3c4757;
  background: var(--primary-2); color: #eef1f4; min-width: 0;
}
.cal-weekdays { display: flex; gap: 4px; padding: 10px 14px; background: var(--primary-2); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal-weekday-btn {
  flex: 1; min-width: 38px; text-align: center; padding: 8px 4px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: #a9b2bd; font-size: .8rem; font-weight: 600; cursor: pointer; min-height: 36px;
}
.cal-weekday-btn.active { background: var(--accent); color: white; }
.cal-weekday-btn:hover:not(.active) { background: #3d4a59; color: #eef1f4; }
.cal-manual { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cal-manual label { margin-top: 0; }
.cal-manual-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-manual-row input, .cal-manual-row select { margin-bottom: 0; flex: 1; min-width: 110px; }
.cal-manual-btn { width: auto; padding: 10px 16px; flex-shrink: 0; }
.cal-header { background: var(--accent); color: white; text-align: center; font-weight: 700; padding: 10px; font-size: .95rem; }
.cal-legend { display: flex; justify-content: center; gap: 16px; padding: 8px 14px; font-size: .76rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.cal-legend-item { display: flex; align-items: center; gap: 5px; }
.cal-legend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.cal-legend-dot.free { background: var(--free); border: 1px solid var(--free-border); }
.cal-legend-dot.busy { background: var(--busy); border: 1px solid var(--busy-border); }
.cal-legend-dot.picked { background: var(--primary); }
.cal-empty-state { padding: 32px 16px; text-align: center; color: var(--muted); font-size: .9rem; }
.cal-week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; padding: 14px; }
/* Aina valkoinen tausta riippumatta teemasta — sama peruste kuin input/select/textarea
   yllä, siksi tekstiväri lukittu tummaksi eikä peritä body:n teemakohtaista --text-väriä. */
.cal-week-day-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 6px; text-align: center; cursor: pointer; background: white; color: #1a1f29; }
.cal-week-day-card:hover { border-color: var(--primary); }
.cal-week-day-card .wd-label { font-size: .74rem; color: var(--muted); font-weight: 700; }
.cal-week-day-card .wd-date { font-size: .82rem; margin: 4px 0; }
.cal-week-day-card .wd-status { font-size: .7rem; padding: 3px 6px; border-radius: 999px; display: inline-block; }
.cal-week-day-card .wd-status.free { background: var(--free); color: var(--free-border); }
.cal-week-day-card .wd-status.full { background: var(--busy); color: var(--busy-border); }
.cal-day-grid {
  /* Ei enää omaa sisäistä skrollia — koko sivu skrollaa yhtenä kokonaisuutena.
     Aiemmin tällä oli max-height + overflow-y: auto, jolloin sivulla oli kaksi
     päällekkäistä skrollausaluetta (koko sivu + kalenterilaatikko), mikä oli
     hämmentävää sekä työpöydällä että mobiilissa. */
}
.cal-hour-row { display: flex; border-bottom: 1px solid var(--border); }
.cal-hour-row:nth-child(odd) { background: var(--surface-2); }
.cal-hour-label { width: 54px; flex-shrink: 0; padding: 8px 6px; font-size: .76rem; color: var(--muted); font-weight: 600; }
.cal-hour-cells { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cal-slot {
  padding: 9px 8px; font-size: .82rem; border-left: 3px solid var(--free-border); background: var(--free);
  /* --free on kiinteä vaalea väri (ei teemoitettavissa), joten myös tekstiväri on lukittu
     tummaksi eikä peritä body:n teemakohtaista --text-väriä (joka tummalla teemalla olisi
     vaalea => lähes näkymätöntä tekstiä vaalealla pohjalla). */
  color: #1a1f29;
  cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px dashed #e5e8eb; touch-action: manipulation;
}
.cal-hour-cells .cal-slot:last-child { border-bottom: none; }
.cal-slot .cs-cap { font-size: .72rem; color: var(--free-border); font-weight: 600; }
.cal-slot.busy { border-left-color: var(--busy-border); background: var(--busy); color: #7a2e1c; font-weight: 600; cursor: not-allowed; }
.cal-slot.busy .cs-cap { color: var(--busy-border); font-weight: 700; }
.cal-slot.past { border-left-color: var(--border); background: var(--surface-2); color: var(--muted); cursor: not-allowed; opacity: .65; }
.cal-slot.picked { background: var(--primary); border-left-color: var(--primary); color: white; font-weight: 700; }
.cal-slot.picked .cs-cap { color: #dfe6ee; }
.cal-slot:hover:not(.busy):not(.picked) { background: #e6ede9; }

/* "Ruudukko"-kalenteriasettelu (valittavissa hallintapaneelin Brändäys-asetuksista): jokainen
   kalenterisyklin (esim. 30 min) mukainen aika on oma kompakti nappinsa samassa ruudukossa,
   ilman tuntirivien ryhmittelyä/tunti-otsikoita — vähemmän vieritystä pitkillä aukioloajoilla.
   Käyttää samoja väri-CSS-muuttujia kuin lista-asettelu, joten toimii kaikilla kolmella
   teemalla sellaisenaan. */
.cal-slot-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px;
}
.cal-slot-grid .cal-slot {
  border-left: none; border-bottom: none; border-radius: 10px; flex-direction: column;
  justify-content: center; text-align: center; padding: 10px 4px; gap: 2px; font-weight: 700;
}
.cal-slot-grid .cal-slot .cs-cap { font-size: .68rem; }
.cal-slot-grid .cal-slot:hover:not(.busy):not(.picked) { background: var(--surface-2); }

.cal-period-info { padding: 16px; }
.cal-period-info .pi-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.cal-period-info .pi-row:last-child { border-bottom: none; }
.cal-period-info .pi-row strong { color: var(--ink); }
.cal-period-info .pi-hint { color: var(--muted); font-size: .84rem; margin-top: 10px; }

/* ===== Napit ===== */
button.primary, .btn-cta {
  width: 100%; padding: clamp(13px, 3vw, 16px); font-size: clamp(.95rem, 2.5vw, 1.05rem);
  border: none; border-radius: 12px; background: var(--accent); color: white; font-weight: 700;
  cursor: pointer; min-height: 48px; transition: background .12s;
}
button.primary:hover, .btn-cta:hover { background: var(--accent-2); }
button.primary:disabled, .btn-cta:disabled { background: #c7cdd3; cursor: not-allowed; }
.payment-badge {
  text-align: center; font-size: .78rem; color: var(--muted, #6b7280); margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap;
}
.payment-badge strong { color: var(--ink); }
.payment-badge-icon { font-size: .95rem; }
button.secondary, .btn-outline {
  width: 100%; padding: clamp(11px, 2.5vw, 13px); border-radius: 12px; border: 2px solid var(--border);
  background: white; color: var(--ink); font-weight: 600; cursor: pointer; min-height: 44px; transition: background .12s;
}
button.secondary:hover, .btn-outline:hover { background: var(--surface-2); }

.price-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; margin: 4px 0 14px; }
.price-line strong { font-size: clamp(1.4rem, 4vw, 1.7rem); color: var(--accent); }
.muted { color: var(--muted); font-size: .9rem; }
.muted.small { font-size: .8rem; margin-top: 10px; }
.pin-display {
  text-align: center; font-size: clamp(2rem, 8vw, 2.6rem); font-weight: 800; letter-spacing: .28em;
  background: var(--surface-2); border-radius: 12px; padding: clamp(16px, 5vw, 24px); margin: 14px 0; color: var(--primary);
}
.mobile-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(15,23,32,.08);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
}
.mobile-cta-price { display: flex; flex-direction: column; line-height: 1.2; }
.mobile-cta-price strong { font-size: 1.15rem; color: var(--accent); }
.mobile-cta .btn-cta { width: auto; flex: 1; margin: 0; }
@media (min-width: 960px) { .mobile-cta { display: none !important; } }
/* KORJAUS (kattava ristiintestauskierros, visuaalinen auditointi): .mobile-cta on
   position:fixed sivun alareunassa, mutta <body>:lle ei ollut varattu vastaavaa tilaa —
   kun asiakas vieritti mobiilinäytöllä lomakkeen loppuun, kiinteä palkki peitti osan
   viimeisen kentän/selitystekstin alta. Todennettu Playwrightilla oikealla scroll-tilanteella
   375px leveydellä. Korjattu: kun body:llä on JS:n (booking.js) lisäämä
   "mobile-cta-varattu"-luokka (asetetaan/poistetaan CTA:n näkyvyyden mukana), varataan
   sisällölle vastaava tila palkin (turvavälein) korkeuden verran alareunasta.
   env(safe-area-inset-bottom) huomioitu samoin kuin itse palkissa. */
body.mobile-cta-varattu { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
@media (min-width: 960px) { body.mobile-cta-varattu { padding-bottom: 0; } }

.toast {
  position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 700px; margin: 0 auto;
  background: var(--ink); color: white; padding: 14px 18px; border-radius: 12px; text-align: center; z-index: 50;
}
@media (max-width: 959px) { .toast { bottom: 84px; } }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table th, table td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; }
label { font-size: .85rem; color: var(--muted); display: block; margin-bottom: 4px; margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge.paid { background: #e6f4ea; color: #1e7e34; }
.badge.hold { background: #fff4e0; color: #a86a00; }

/* ===== WordPress-tyylinen SuperAdmin-hallintapaneeli ===== */
.wp-shell { display: flex; min-height: 100vh; }
/* KORJAUS (tehtävä #36): "Kirjaudu ulos" -nappi on aina näkyvissä riippumatta siitä kuinka
   monta valikkoryhmää on auki tai kuinka lyhyt selainikkuna on — sivupalkki on nyt kiinnitetty
   koko näytön korkuiseksi pystysuuntaiseksi flex-pinoksi, jossa vain valikko+ohjeet-osio
   (.wp-sidebar-scroll) vierii tarvittaessa erikseen, kun taas brändi (yläreuna) ja
   uloskirjautumisnappi (alareuna) pysyvät aina paikoillaan näkyvissä. */
/* Hallintapaneelin ulkoasu (mockup-uskollinen "asettelu", tehtävä: sivupalkki ja sisältö
   käyttävät SAMAA taustaväriä (ei enää erillistä kiinteää tummaa sivupalkkia) — täsmälleen
   kuten design-mockupeissa (A/B/C-Admin.png): koko paneeli on YHTÄ väripintaa, ja aktiivinen
   valikkokohta erottuu vain hienovaraisella korostustaustalla + vasemman reunan tehosteviivalla.
   Käyttää SAMOJA CSS-muuttujia kuin asiakkaan varaussivu (--bg/--surface/--accent/--text/
   --muted/--border), jotka admin.html asettaa itse ladattuaan AKTIIVISEN teeman (ks.
   branding-common.js + admin.js:n teemanlataus) — hallintapaneeli siis vaihtaa ulkoasua SAMAN
   teemavalinnan mukana kuin asiakassivu, kuten mockupit osoittavat (A/B/C näyttävät kukin
   erilaiselta paneelilta, ei vain erilaiselta varaussivulta). */
.wp-sidebar {
  width: 230px; background: var(--bg); color: var(--text); flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--border);
}
.wp-sidebar-scroll { flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.wp-sidebar .logout-btn { flex-shrink: 0; }
.wp-sidebar .brand {
  display: block; padding: 18px 20px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border); font-size: 1.15rem; line-height: 1.3; word-break: break-word;
  font-family: var(--heading-font, 'Fraunces', Georgia, serif);
}
.wp-sidebar .brand small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; margin-top: 2px; font-family: inherit; }
.wp-sidebar nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 20px; background: none; border: none; color: var(--text); cursor: pointer;
  font-size: .92rem; border-left: 3px solid transparent; min-height: 44px;
}
.wp-sidebar nav button:hover { background: var(--surface-2); }
.wp-sidebar nav button.active { background: var(--surface-2); color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
/* Ryhmitellyt päävalikot: kukin <details> on yksi taittuva ryhmä, jonka <summary> on
   ryhmän otsikko. Pitää hallintapaneelin selkeänä vaikka välilehtien määrä kasvaa. */
.wp-sidebar nav .nav-group { border-bottom: 1px solid var(--border); }
.wp-sidebar nav .nav-group summary {
  padding: 11px 20px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
}
.wp-sidebar nav .nav-group summary::-webkit-details-marker { display: none; }
.wp-sidebar nav .nav-group summary::after { content: '▸'; transition: transform .15s; }
.wp-sidebar nav .nav-group[open] summary::after { transform: rotate(90deg); }
.wp-sidebar nav .nav-group summary:hover { color: var(--text); }
.wp-sidebar .logout-btn { margin: 16px 20px; padding: 10px; width: calc(100% - 40px); background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.sidebar-docs { margin: 10px 20px 0; padding-top: 14px; border-top: 1px solid var(--border); }
.sidebar-docs-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; }
.sidebar-docs a { display: block; color: var(--text); text-decoration: none; font-size: .85rem; padding: 5px 0; }
.sidebar-docs a:hover { color: var(--accent); }
.sidebar-docs button.sidebar-doc-btn { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text); font-size: .85rem; padding: 5px 0; cursor: pointer; font-family: inherit; }
.sidebar-docs button.sidebar-doc-btn:hover { color: var(--accent); }
.wp-content { flex: 1; background: var(--bg); min-height: 100vh; }
/* Asetukset-välilehden sisäiset alavälilehdet (Yleiset / Brändi & tekstit / Integraatiot /
   Yhteystiedot) — sama pitkä sisältö kuin ennen, mutta jaettuna selkeästi nimettyihin
   ryhmiin yhden pitkän vierityksen sijaan. */
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.subtabs .subtab-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 8px 16px; cursor: pointer; font-size: .85rem; color: var(--text); font-family: inherit; }
.subtabs .subtab-btn:hover:not(.active) { background: var(--surface-2); }
.subtabs .subtab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.wp-topbar { background: var(--surface); padding: 14px 26px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.wp-topbar .who { font-size: .85rem; color: var(--muted); white-space: nowrap; }
/* Tehtävä #36: uloskirjautuminen aina näkyvissä riippumatta sivupalkin tilasta — tämä nappi
   näkyy yläpalkissa sekä työpöydällä että mobiilissa (missä sivupalkin oma logout-nappi on
   piilotettu, ks. mobiilin media-kysely alempana), joten "Kirjaudu ulos" on aina saatavilla
   yhdellä katseella riippumatta valikkoryhmien tilasta tai selainikkunan korkeudesta. */
.topbar-logout-btn { flex-shrink: 0; padding: 6px 14px; font-size: .82rem; width: auto; }
@media (max-width: 560px) {
  .wp-topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar-search { order: 3; flex-basis: 100%; max-width: none; }
}
.topbar-search { position: relative; flex: 1; max-width: 420px; }
.topbar-search input { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: .9rem; background: var(--surface); color: var(--text); }
.topbar-search input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.topbar-search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  max-height: 420px; overflow-y: auto; z-index: 200;
}
.topbar-search-results .tsr-group-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 14px 2px; }
.topbar-search-results .tsr-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 14px; cursor: pointer; font-size: .85rem; border-bottom: 1px solid var(--border); color: var(--text); }
.topbar-search-results .tsr-item:last-child { border-bottom: none; }
.topbar-search-results .tsr-item:hover, .topbar-search-results .tsr-item.tsr-active { background: var(--surface-2); }
.topbar-search-results .tsr-item .tsr-title { font-weight: 600; display:block; }
.topbar-search-results .tsr-item .tsr-snippet { color: var(--muted); font-size: .78rem; display:block; margin-top: 2px; }
.topbar-search-results .tsr-empty { padding: 14px; color: var(--muted); font-size: .85rem; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 500;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal-box { background: #fff; border-radius: 10px; max-width: 680px; width: 100%; padding: 28px 30px; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.modal-close { position: absolute; top: 14px; right: 14px; background: none; border: none; font-size: 1.1rem; cursor: pointer; color: #8A8371; }
.modal-close:hover { color: #26231E; }
body.admin-page .modal-close { color: var(--muted); }
body.admin-page .modal-close:hover { color: var(--text); }
body.admin-page .modal-box { background: var(--surface); color: var(--text); }
.modal-body { white-space: pre-wrap; font-size: .9rem; line-height: 1.6; margin-top: 10px; max-height: 60vh; overflow-y: auto; }
/* KORJAUS (käyttäjän palaute): 2FA-käyttöönoton QR-koodi ei keskittynyt mobiilissa — sen
   sisältävä #twofaQr-div oli tavallinen vasemmalle asettuva lohko kapeassa, koko leveän kortin
   sisällä. Keskitetään sekä itse kehyslohko että sen sisältämä SVG aina, riippumatta kortin
   leveydestä (mobiili tai työpöytä). */
#twofaQr { display: flex; justify-content: center; margin: 10px auto !important; }
#twofaQr svg { display: block; max-width: 100%; height: auto; }
/* Salasanakenttien "näytä salasana" -silmänappi (ks. lisaaSalasanoilleNaytaNappi() admin.js:ssä). */
.pw-wrap { position: relative; display: block; }
.pw-wrap input[type="password"], .pw-wrap input[type="text"] { padding-right: 34px; width: 100%; box-sizing: border-box; }
.pw-eye-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem; line-height: 1;
  padding: 4px 6px; color: var(--muted, #8A8371);
}
.pw-eye-btn:hover { color: var(--text, #26231E); }
.wp-main { padding: 22px 26px; max-width: 1150px; }
/* Hallintapaneelin oma visuaalinen ilme — käyttää samoja teemamuuttujia (--bg/--surface/
   --accent/--text/--muted/--border/--heading-font) kuin asiakkaan varaussivu, joten
   valittu teema (A/B/C tai oma) vaihtaa ulkoasun myös täällä, mockupien mukaisesti. */
body.admin-page { font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }
body.admin-page .wp-panel-title, body.admin-page .wp-card h3, body.admin-page .wp-sidebar .brand {
  font-family: var(--heading-font, 'Fraunces', Georgia, serif);
}
.wp-panel-title { font-size: 1.6rem; margin: 0 0 18px; font-weight: 600; color: var(--text); }
.wp-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.wp-card h3 { margin-top: 0; font-size: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 10px; color: var(--text); }
button.wp-btn { background: var(--accent); color: white; border: none; padding: 9px 18px; border-radius: 6px; cursor: pointer; font-size: .9rem; min-height: 40px; }
button.wp-btn:hover { filter: brightness(0.9); }
button.wp-btn.danger { background: #d63638; }
button.wp-btn.danger:hover { background: #a02224; }
button.wp-btn.secondary { background: var(--surface); color: var(--accent); border: 1px solid var(--accent); }
button.wp-btn:disabled, button.wp-btn.secondary:disabled, button.wp-btn.danger:disabled {
  background: #e2e5e8; color: #8a9199; border-color: #d3d7db; cursor: not-allowed;
}
/* Juurikorjaus napeille jotka "menevät piiloon" hallintapaneelissa (mm. yläpalkin "Kirjaudu
   ulos"): style.css on yhteinen asiakassivun kanssa, ja asiakassivun "button.secondary"
   (leveys 100%, ks. "Napit"-osio alempana tiedostossa) pääsee vahingossa myös kaikkiin
   hallintapaneelin "wp-btn secondary" -nappeihin, koska molemmilla säännöillä on sama
   CSS-spesifisyys — jolloin nappi venyy täyttämään koko jäljellä olevan flex-tilan (esim.
   yläpalkissa) ja työntää muut elementit pois näkyvistä. Aiemmin tätä on paikkailtu
   lisäämällä yksittäisiin nappeihin inline style="width:auto" (haurasta, unohtuu helposti
   uusilta napeilta) — nollataan sen sijaan KAIKKI vuotavat ominaisuudet kerralla korkeammalla
   spesifisyydellä koko hallintapaneelin body-luokan alla. */
body.admin-page button.wp-btn.secondary { width: auto; }
.wp-main input:disabled, .wp-main select:disabled, .wp-main textarea:disabled { background: #f1f2f3; color: #8a9199; cursor: not-allowed; }
/* KORJAUS (visuaalinen auditointi): kääre jonka admin.js:n wrapWpTables() lisää jokaisen
   .wp-table:n ympärille — pitää mahdollisen ylivuodon TAULUKON sisällä (oma vaakascroll)
   sen sijaan että se levittäisi koko sivun/kortin näytön ulkopuolelle mobiilissa/tabletilla. */
.wp-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.wp-table { width: 100%; border-collapse: collapse; }
.wp-table th { text-align: left; background: transparent; padding: 9px 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 1px solid var(--border); }
.wp-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: .88rem; vertical-align: top; color: var(--text); }
/* Hinnasto-välilehti: yksi lohko per kohde, otsikko + sen oma hinnastotaulukko/-taulukot. */
.wp-hinnasto-kohde { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.wp-hinnasto-kohde:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.wp-hinnasto-kohde h4 { margin: 0 0 10px; font-size: .98rem; color: var(--text); }
.wp-row-actions button { font-size: .78rem; padding: 4px 9px; margin-right: 4px; min-height: unset; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; }
/* Käyttöoikeuksien valintaruudukko: nimi omalla rivillään kokonaan näkyvissä (ei koskaan
   piiloon/katkolle, ks. käyttäjän pyyntö), valinta omalla, täysleveällä rivillään sen alla —
   ei enää samalla rivillä olevaa vierekkäistä tekstiä+pudotusvalikkoa, joka ahtaalla tilalla
   aiheutti tekstin katkeamisen ja pudotusvalikon ylivuodon chipin ulkopuolelle. */
.perm-grid .perm-chip { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.perm-grid .perm-chip > span { font-weight: 600; white-space: normal; overflow-wrap: break-word; }
.perm-grid .perm-chip > select { width: 100%; }
.perm-chip { display: flex; align-items: center; gap: 7px; padding: 9px; border: 1px solid var(--border); border-radius: 6px; font-size: .85rem; cursor: pointer; background: var(--surface-2); }
.perm-chip input { width: auto; margin: 0; }
.wp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wp-empty { color: var(--muted); font-style: italic; padding: 10px 0; }
.log-entry { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .86rem; }
.log-entry .log-time { color: var(--muted); font-size: .78rem; }
.log-entry .log-tag { display: inline-block; background: var(--surface-2); border-radius: 3px; padding: 1px 7px; font-size: .72rem; margin-right: 6px; color: var(--accent); font-weight: 600; }

/* Kohteet-välilehden yhteenvetokortit ("Varaukset tänään" / "Liikevaihto tänään" /
   "Käyttöaste") + viimeisimmät varaukset -taulukko — asettelu design-mockupien (A/B/C-
   Admin.png) mukainen: kevyet, ohutreunaiset laatikot ilman raskasta varjoa, iso luku. */
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.dash-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; }
.dash-tile .dash-tile-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.dash-tile .dash-tile-value { font-size: 2rem; font-weight: 700; color: var(--accent); font-family: var(--heading-font, 'Fraunces', Georgia, serif); }
.dash-recent { grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; }
.dash-recent h4 { margin: 0 0 12px; font-size: 1rem; color: var(--text); font-family: var(--heading-font, 'Fraunces', Georgia, serif); }
.dash-status-chip { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .76rem; border: 1px solid; }
.dash-status-chip.paid { color: #1a7a4c; border-color: #1a7a4c; background: rgba(26,122,76,.08); }
.dash-status-chip.pending { color: #8A8371; border-color: var(--border); background: var(--surface-2); }
@media (max-width: 780px) {
  .wp-shell { flex-direction: column; }
  /* Mobiilissa sivupalkki ei ole enää kiinnitetty koko ruudun korkuiseksi pystypinoksi (se on
     työpöytäasettelun temppu, ks. yllä) — se on tavallinen, sisällön korkuinen lohko yläreunassa,
     ja uloskirjautuminen hoituu aina näkyvissä olevasta yläpalkin napista (#logoutBtnTopbar). */
  .wp-sidebar { width: 100%; position: static; height: auto; }
  .wp-sidebar-scroll { overflow-y: visible; }
  /* HUOM: aiemmin täällä purettiin <details>-ryhmät "display:contents"-tempulla yhdeksi
     vaakascrollattavaksi flex-riviksi. Se osoittautui epäluotettavaksi — display:contents
     yhdistettynä flex-wrap:nowrap-asetukseen rikkoi asettelun (napit järjestyivät sekaisin
     pystysuuntaisiksi "sarakkeiksi" ryhmittäin scrollattavan alueen sisällä sen sijaan että
     olisivat pysyneet yhdellä vaakarivillä). Yksinkertaisempi ja luotettavampi ratkaisu:
     käytetään mobiilissa SAMAA taittuvaa (accordion) valikkoa kuin työpöydällä, vain koko
     leveydeltään — vie vähemmän tilaa kerralla eikä nojaa herkkään CSS-yhdistelmään. */
  .wp-sidebar .brand { display: none; }
  .wp-sidebar .logout-btn { display: none; }
  .wp-form-row { grid-template-columns: 1fr; }
  .wp-main { padding: 16px; }
}

/* Admin-lomakkeen kentät jotka pitää pysyä piilossa roolista riippumatta muista display-asetuksista */
.force-hidden { display: none !important; }

/* Etusivun julkinen hinnasto-esikatselu (modaali) */
.hinnasto-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.hinnasto-modal {
  background: #fff; border-radius: 10px; max-width: 640px; width: 100%;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.hinnasto-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #eee; position: sticky; top: 0; background: #fff;
}
.hinnasto-modal-header h2 { margin: 0; font-size: 1.1rem; }
.hinnasto-modal-close {
  background: none; border: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: #666;
  padding: 0 4px;
}
.hinnasto-modal-body { padding: 16px 20px; }
.hinnasto-modal-body h3 { font-size: .95rem; margin: 18px 0 6px; }
.hinnasto-modal-body h3:first-child { margin-top: 0; }
.hinnasto-modal-body table { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.hinnasto-modal-body th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: #646970; padding: 6px 8px; border-bottom: 1px solid #dcdcde; }
.hinnasto-modal-body td { padding: 6px 8px; border-bottom: 1px solid #f0f0f1; font-size: .88rem; }
