: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);
  /* Vuoropiste-tunnuksen ("Vuoro.") hillitty, toistuva vesileimakuvio oletustaustana julkisilla
     asiakassivuilla (käyttäjän pyyntö 2026-10-03: "ja tämä oletus brändeihin taustaksi eri
     asiakassivuihin") — kerrostettu olemassa olevan hienovaraisen sävygradientin PÄÄLLE, jotta
     molemmat näkyvät. Asiakaskohtainen branding (logo/värit, ks. booking.js:n applyBranding())
     ei vaikuta tähän — tämä on nimenomaan Vuoropisten OMA, hiljainen markkinointitunnus, ei
     asiakkaan omaa brändäystä. Ei näy hallintapaneelissa (body.admin-page, ks. alempana).
     Tiedosto ei kuormita julkista sivua merkittävästi (kevyt PNG, selain välimuistittaa sen). */
  /* HILLITTY VESILEIMA (2026-10-06, laatukierros): kuvio on pienempi (900 px, mobiilissa 560 px)
     ja sen päällä on puoliksi peittävä taustavärikerros, jotta sisältö on selvästi pääasia.
     Perutaan palauttamalla background-size: auto ja poistamalla keskimmäinen gradienttikerros. */
  background-image:
    radial-gradient(1200px 400px at 50% -120px, rgba(38,49,62,.05), transparent),
    linear-gradient(rgba(238,241,244,.45), rgba(238,241,244,.45)),
    url('/brandi/vuoro-taustakuvio.png');
  background-image:
    radial-gradient(1200px 400px at 50% -120px, rgba(38,49,62,.05), transparent),
    linear-gradient(color-mix(in srgb, var(--bg) var(--vesileima-peitto, 45%), transparent), color-mix(in srgb, var(--bg) var(--vesileima-peitto, 45%), transparent)),
    url('/brandi/vuoro-taustakuvio.png');
  background-repeat: no-repeat, no-repeat, repeat;
  background-position: top center, top left, top left;
  background-size: auto, auto, 900px auto;
  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: lyhyt, selkeä lupaus otsikon alla */
.hero { margin: 4px 0 22px; }
.hero-text {
  color: var(--ink); font-size: clamp(1.15rem, 3.4vw, 1.5rem); font-weight: 600; line-height: 1.3;
  letter-spacing: -.01em; margin: 0; max-width: 640px;
}

/* ===== Etenemispalkki ===== */
.stepper { display: flex; margin: 0 0 14px; padding: 0; list-style: none; max-width: 520px; }
.stepper .step {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; min-width: 0;
}
.stepper .step:not(:last-child)::after {
  content: ""; position: absolute; top: 14px; left: calc(50% + 20px); right: calc(-50% + 20px);
  height: 2px; background: var(--border); border-radius: 2px;
}
.stepper .step.done:not(:last-child)::after { background: var(--primary); }
.stepper .step-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border);
  color: var(--muted); font-size: .8rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stepper .step-label { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.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; }
.stepper .step.done .step-num { background: var(--primary); border-color: var(--primary); color: white; }
.stepper .step.done .step-label { color: var(--ink); }

/* ===== Luottamusmerkit ===== */
.trust-row {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 22px; padding: 12px 16px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.trust-item { display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ink); line-height: 1.2; }
.trust-icon { color: var(--accent); flex-shrink: 0; }
@media (max-width: 559px) {
  .trust-row { flex-direction: column; gap: 10px; }
}

/* .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. */
/* Alatunniste: linkit omalla rivillään, valmistajan tunniste erotettuna sen alla. */
.site-footer {
  text-align: center; margin-top: 40px; padding: 22px clamp(16px, 4vw, 28px) 26px;
  border-top: 1px solid var(--border); max-width: 1080px; margin-left: auto; margin-right: auto; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.site-footer-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.site-footer-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; }
.site-footer-links a + a { position: relative; }
.site-footer-links a + a::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 14px; margin-top: -7px; background: var(--border);
}
.site-footer a { color: var(--muted); font-size: .88rem; text-decoration: none; }
.site-footer-links a:hover { color: var(--ink); text-decoration: underline; }
.site-footer-credit { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
/* 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.
   KORJAUS (2026-10-01): toteutettu suunnitelmien "Vaihtoehto B" -malli — piste istuu sanan
   "Vuoro" YLÄKULMASSA (oikealla ylhäällä, kuin aksentti/tähti), EI enää koko sanan korkeuden
   keskikohdassa vierekkäin. align-items:flex-start tasaa pisteen sanan YLÄREUNAAN, ja pieni
   margin-top tuo sen hieman alemmas niin että se asettuu ison alkukirjaimen yläosan kohdalle,
   samassa suhteessa kuin alkuperäisessä 420×340-mallipohjassa (piste 8px alaspäin 64px
   tekstikoosta skaalattuna tähän pienempään kokoon). */
.site-footer-credit a {
  display: inline-flex; align-items: flex-start; gap: 2px; text-decoration: none;
  color: var(--ink); font-size: .8rem; font-weight: 700;
}
.site-footer-credit-label { color: var(--muted); }
.site-footer-credit a { padding: 14px 4px; margin: -14px 0; }
.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: 1.05rem; margin: 0 0 14px; color: var(--ink);
  text-transform: none; letter-spacing: -.005em; font-weight: 700;
}
main.page .card h2 { font-size: 1.15rem; color: var(--ink); text-transform: none; letter-spacing: -.005em; margin: 0 0 8px; }
main.page .card h3 { font-size: 1rem; margin: 0 0 10px; color: var(--ink); }
.page-title { font-size: clamp(1.4rem, 4vw, 1.8rem); margin: 6px 0 16px; color: var(--ink); letter-spacing: -.01em; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.back-link:hover { color: var(--ink); text-decoration: underline; }
.hero-text .back-link { font-size: .92rem; font-weight: 400; letter-spacing: 0; }
/* 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); }
#instructionsText { margin: 12px 0 0; }
#instructionsText[hidden] { display: none; }
.info-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.info-steps li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .95rem; }
.info-step-num {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center; font-size: .74rem; font-weight: 700; flex-shrink: 0;
}
.info-steps li.active { color: var(--ink); font-weight: 600; }
.info-steps li.active .info-step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.info-steps li.done { color: var(--ink); }
.info-steps li.done .info-step-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.info-venue { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.info-venue h3, .form-sub { font-size: .95rem; margin: 0 0 8px; color: var(--ink); font-weight: 700; }
.info-venue p { margin: 0; line-height: 1.5; }
.form-sub { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.layout.layout--valmis { display: block; max-width: 520px; margin: 0 auto; }
.layout.layout--valmis .steps-col { display: none; }
.layout.layout--valmis .summary-col { position: static; margin-top: 0; }
#confirmLead { white-space: pre-line; line-height: 1.5; }
.terms-check { display: flex; align-items: center; gap: 10px; margin: 14px 0; min-height: 44px; font-size: .95rem; color: var(--ink); cursor: pointer; }
.terms-check input { width: 20px; height: 20px; margin: 0; flex-shrink: 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); }
.chip { display: inline-flex; align-items: center; gap: 10px; }
.chip-price { color: var(--accent); font-weight: 700; white-space: nowrap; }

/* ===== Aikakalenteri (tumma/hillitty, tunti-rivit + puolen tunnin jako) ===== */
.cal-card { padding: 0; overflow: hidden; }
.cal-card h2 { padding: 18px 20px 0; }
.cal-card .muted.small { padding: 0 20px; margin: -6px 0 4px; }
.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: 14px;
}
.cal-toolbar-left, .cal-toolbar-mid, .cal-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-icon-btn {
  width: 44px; height: 44px; 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-text-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1px solid #3c4757; background: var(--primary-2); color: #eef1f4; font-size: .88rem; font-weight: 600;
  cursor: pointer; margin: 0; font-family: inherit;
}
.cal-text-btn:hover { background: #3d4a59; }
.cal-nav-btn { border-radius: 50%; }
.cal-view-label { font-size: .86rem; color: #cbd3dc; white-space: nowrap; }
@media (max-width: 559px) {
  .cal-toolbar { padding: 12px; gap: 8px; }
  .cal-toolbar-left { order: 1; }
  .cal-toolbar-mid { order: 2; margin-left: auto; }
  .cal-toolbar-right { order: 3; flex-basis: 100%; justify-content: space-between; flex-wrap: nowrap; }
  .cal-date-input { flex: 1; min-width: 0; }
  body { background-size: auto, auto, 560px auto; }
}
.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: 0 10px; height: 44px;
  display: inline-flex; align-items: center; font-size: .84rem; font-weight: 600; color: #dfe6ee; text-align: center; flex-shrink: 0; white-space: nowrap;
}
.cal-date-input {
  width: auto; margin: 0; padding: 0 9px; height: 44px; font-size: .88rem; 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: 40px; text-align: center; padding: 8px 4px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: #cbd3dc; font-size: .86rem; font-weight: 600; cursor: pointer; min-height: 44px;
}
.cal-weekday-btn.active { background: var(--accent); color: white; }
.cal-weekday-btn:hover:not(.active) { background: #3d4a59; color: #eef1f4; }
.cal-manual { padding: 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-manual label { margin-top: 0; font-size: .8rem; font-weight: 600; }
.cal-manual-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.cal-manual-field { flex: 1; min-width: 120px; }
.cal-manual-row input, .cal-manual-row select { margin-bottom: 0; width: 100%; }
.cal-manual-btn { width: auto; padding: 0 20px; height: 48px; flex-shrink: 0; border-color: var(--accent); color: var(--accent); }
@media (max-width: 559px) { .cal-manual-btn { width: 100%; } }
.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: 18px; padding: 10px 14px; font-size: .82rem; color: var(--ink); border-bottom: 1px solid var(--border); }
.cal-legend-item { display: flex; align-items: center; gap: 5px; }
.cal-legend-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.cal-legend-dot.free { background: #fff; border: 2px 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(96px, 1fr)); gap: 8px; 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: .74rem; padding: 3px 8px; border-radius: 999px; display: inline-block; line-height: 1.25; }
.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); }
/* Tuntiotsikko on piilossa: sama kellonaika näkyy jo jokaisella rivillä. */
.cal-hour-label { display: none; }
.cal-hour-cells { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cal-slot {
  padding: 9px 16px 9px 14px; font-size: .95rem; border-left: 4px solid var(--free-border); background: #fff;
  /* --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-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-slot .cs-cap, .cal-slot .cs-status { font-size: .8rem; color: var(--free-border); font-weight: 600; }
.cal-slot.busy { border-left-color: var(--busy-border); background: var(--busy); color: #7a2e1c; cursor: not-allowed; }
.cal-slot.busy .cs-cap, .cal-slot.busy .cs-status { color: var(--busy-border); font-weight: 700; }
.cal-slot.past { border-left-color: #d5dae0; background: #eceff2; color: #8a94a0; cursor: not-allowed; }
.cal-slot.past .cs-time { font-weight: 500; }
.cal-slot.past .cs-status, .cal-slot.past .cs-cap { color: #8a94a0; font-weight: 500; }
.cal-slot.picked { background: var(--primary); border-left-color: var(--accent); color: white; }
.cal-slot.picked .cs-cap, .cal-slot.picked .cs-status { color: #dfe6ee; }
.cal-slot:hover:not(.busy):not(.past):not(.picked) { background: #f1f6f3; border-left-color: var(--accent); }

/* "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 .cs-status { display: none; }
.cal-slot-grid .cal-slot { background: #fff; border: 1px solid var(--free-border); }
.cal-slot-grid .cal-slot.busy { background: var(--busy); border-color: var(--busy-border); }
.cal-slot-grid .cal-slot.past { background: #eceff2; border-color: #d5dae0; }
.cal-slot-grid .cal-slot.picked { background: var(--primary); border-color: var(--primary); }
.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; gap: 12px; padding: 10px 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; }

/* ===== Hallintapaneeli ===== */
.wp-shell { display: flex; min-height: 100vh; }
/* Sivupalkki on koko näytön korkuinen: valikko vierii omassa alueessaan, brändi pysyy ylhäällä.
   Värit tulevat samoista teemamuuttujista kuin asiakassivulla. */
.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 {
  visibility: visible; display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  padding: 22px 20px 18px; color: var(--text); border-bottom: 1px solid var(--border);
}
.wp-sidebar .brand-wordmark {
  display: inline-flex; align-items: flex-start; gap: 2px; line-height: 1;
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; color: #1e4a56;
}
.wp-sidebar .brand-dot { margin-top: 3px; flex-shrink: 0; }
.wp-sidebar .brand small {
  display: block; margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-weight: 600; font-size: .7rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.wp-sidebar nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 20px; background: none; border: none; color: var(--text); cursor: pointer;
  font-size: .92rem; border-left: 3px solid transparent; min-height: 42px;
}
.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; }
/* Taittuvat valikkoryhmät: ryhmän otsikko ja yhtenäinen nuolimerkki. */
.wp-sidebar nav .nav-group { border-bottom: 1px solid var(--border); }
.wp-sidebar nav .nav-group summary {
  padding: 13px 20px 9px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  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: ''; width: 6px; height: 6px; flex-shrink: 0; margin-right: 3px;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s;
}
.wp-sidebar nav .nav-group[open] summary::after { transform: rotate(45deg); }
.wp-sidebar nav .nav-group summary:hover { color: var(--text); }
.wp-sidebar nav .nav-group:has(button.active) summary { color: var(--text); }
.wp-sidebar nav .nav-group[open] { padding-bottom: 6px; }
/* Uloskirjautuminen on yläpalkissa, joten sivupalkin kaksoiskappale on piilossa. */
.wp-sidebar .logout-btn { display: none; }
.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 alavälilehdet. */
.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; }
/* Yläpalkki: otsikko ja haku vasemmalla, käyttäjätiedot ja napit tasavälein oikealla. */
.wp-topbar { background: var(--surface); padding: 12px 26px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.wp-topbar #topbarTitle { font-family: var(--heading-font, 'Fraunces', Georgia, serif); font-size: 1.1rem; font-weight: 700; white-space: nowrap; margin-right: 8px; }
.wp-topbar .who { margin-left: auto; padding-right: 14px; margin-right: 2px; border-right: 1px solid var(--border); font-size: .85rem; line-height: 24px; color: var(--muted); white-space: nowrap; }
.wp-topbar #omaTiliBtn, .wp-topbar .topbar-logout-btn { flex-shrink: 0; width: auto; min-height: 36px; padding: 6px 16px; font-size: .85rem; }
/* Mobiilin hampurilaisnappi näkyy vain kapealla näytöllä, ja yläpalkki piiloutuu vieritettäessä. */
.mobile-nav-toggle { display: none; }
@media (max-width: 780px) {
  .mobile-nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0; font-size: 1.3rem; line-height: 1; flex-shrink: 0;
  }
  #wpTopbar { position: sticky; top: 0; z-index: 30; transition: transform .22s ease; }
  #wpTopbar.topbar-piilossa { transform: translateY(-100%); }
  /* Valikko on mobiilissa piilossa ja avautuu hampurilaisnapista pudotuspaneelina. */
  .wp-sidebar nav#tabs { display: none; }
  .wp-sidebar.mobiilivalikko-auki nav#tabs {
    display: block; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    margin-bottom: 8px; overflow: hidden;
  }
  /* Ohjelinkit näkyvät mobiilissa vasta valikon ollessa auki. */
  .sidebar-docs { display: none; }
  .wp-sidebar.mobiilivalikko-auki .sidebar-docs {
    display: block; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
    padding: 10px 14px; margin: 0 0 8px 0;
  }
}
.topbar-search { position: relative; flex: 1 1 auto; max-width: 400px; }
.topbar-search input {
  width: 100%; margin: 0; padding: 8px 12px 8px 36px; border: 1px solid var(--border); border-radius: 8px; font-size: .9rem; color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364707d' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 15px;
}
@media (max-width: 780px) {
  .wp-topbar { flex-wrap: wrap; row-gap: 10px; padding: 10px 16px; }
  .wp-topbar #topbarTitle { flex: 1 1 0; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar-search { order: 3; flex: 1 1 100%; max-width: none; }
  .wp-topbar .who { order: 4; flex: 1 1 0; min-width: 0; margin: 0; padding: 0; border-right: 0; overflow: hidden; text-overflow: ellipsis; }
  .wp-topbar #omaTiliBtn { order: 5; }
  .wp-topbar .topbar-logout-btn { order: 6; }
}
.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; }
/* Kaksivaiheisen tunnistautumisen QR-koodi keskitetään aina. */
#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. */
.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; }
/* Hallintapaneeli käyttää samoja teemamuuttujia kuin asiakkaan varaussivu. */
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;
}
/* Asiakassivun koko leveyden napit eivät saa venyttää hallintapaneelin nappeja. */
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; }
/* Taulukon kääre pitää leveät taulukot omassa vaakavierityksessään. */
.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. */
.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, valinta sen alla. */
.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; }

/* Värikentän rinnalla oleva värinäyte. */
.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input:not([type="color"]) { flex: 1; min-width: 0; }
.color-field input[type="color"] { width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; flex-shrink: 0; background: none; }
.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 yhteenvetolaatat ja viimeisimmät varaukset. */
.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 on tavallinen, sisällön korkuinen lohko. */
  .wp-sidebar { width: 100%; position: static; height: auto; }
  .wp-sidebar-scroll { overflow-y: visible; }
  .wp-sidebar .brand { display: none; }
  .wp-sidebar .logout-btn { display: none; }
  .wp-form-row { grid-template-columns: 1fr; }
  .wp-main { padding: 16px; }
}

/* ===== Hallintapaneelin viimeistely: otsikot, lomakkeet, tyhjät tilat ===== */
.wp-main { padding: 24px 28px 48px; }
.wp-card { padding: 22px 24px; }
.wp-card h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 16px; padding-bottom: 12px; }
.wp-card h4, .wp-hinnasto-kohde h4 { font-family: inherit; font-size: .95rem; font-weight: 700; margin: 6px 0 8px; color: var(--text); }
.wp-card .wp-card { margin-bottom: 16px; }
.wp-card .wp-card:last-child { margin-bottom: 0; }

.wp-main label { font-size: .82rem; font-weight: 600; color: var(--text); margin: 12px 0 5px; }
.wp-main .wp-form-row label:first-child { margin-top: 12px; }
.wp-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="hidden"]),
.wp-main select, .wp-main textarea {
  padding: 9px 12px; font-size: .93rem; border-radius: 8px; margin-bottom: 8px;
}
.wp-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="hidden"]) { max-width: 560px; }
.wp-main select { max-width: 420px; }
.wp-main input[type="number"] { max-width: 160px; }
.wp-main input[type="date"], .wp-main input[type="time"] { max-width: 200px; }
.wp-main input[type="datetime-local"] { max-width: 240px; }
.wp-main textarea { max-width: 720px; }
.wp-main .wp-table input, .wp-main .wp-table select { max-width: 100%; }

.wp-form-row { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 340px)); column-gap: 16px; row-gap: 0; align-items: start; }
.wp-form-row > div { min-width: 0; }

.wp-main p.muted { line-height: 1.55; max-width: 76ch; margin: 2px 0 14px; }
.wp-main p.muted.small { font-size: .8rem; margin: 2px 0 12px; }
.wp-main p.muted.preview-note { max-width: none; margin: 0; padding: 8px 12px; background: var(--surface-2); font-size: .78rem; border-bottom: 1px solid var(--border); }

.wp-main :not(.perm-grid) > label.perm-chip { display: inline-flex; margin: 4px 8px 6px 0; color: var(--text); font-weight: 500; }
.perm-chip { color: var(--text); font-weight: 500; }
.wp-main .wp-card > button.wp-btn:last-child, .wp-main .wp-card > div > button.wp-btn:last-child { margin-top: 4px; }

/* Tyhjät tilat */
.wp-empty {
  font-style: normal; text-align: center; font-size: .9rem; color: var(--muted);
  background: var(--surface-2); border: 1px dashed var(--border); border-radius: 8px;
  padding: 18px 16px; margin: 6px 0 0;
}
#kohdeDashboard .wp-empty::after { content: "Uudet varaukset näkyvät tässä heti, kun ensimmäinen varaus on tehty."; display: block; margin-top: 4px; font-size: .84rem; }
#sulutList .wp-empty::after { content: "Lisää sulku yllä olevalla lomakkeella, esimerkiksi huoltoa varten."; display: block; margin-top: 4px; font-size: .84rem; }
#vvList .wp-empty::after { content: "Lisää toistuva viikoittainen vuoro yllä olevalla lomakkeella."; display: block; margin-top: 4px; font-size: .84rem; }
#orgList .wp-empty::after { content: "Lisää organisaatio alla olevalla lomakkeella."; display: block; margin-top: 4px; font-size: .84rem; }
#staffList .wp-empty::after { content: "Lisää henkilökunnan tunnus alla olevalla lomakkeella."; display: block; margin-top: 4px; font-size: .84rem; }
#bkLista .wp-empty::after { content: "Luo ensimmäinen kopio painamalla \"Varmuuskopioi nyt\"."; display: block; margin-top: 4px; font-size: .84rem; }

/* Yhteenvetolaatat */
.dash-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dash-tile { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 100px; }
.dash-tile .dash-tile-label { margin-bottom: 0; font-size: .76rem; font-weight: 600; }
.dash-tile .dash-tile-value { font-size: 1.9rem; line-height: 1.1; }
.dash-recent h4 { font-size: 1.05rem; font-weight: 600; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* Varaustyyppirivit: valinta, nimi ja pituus samalla rivillä */
@media (min-width: 781px) {
  #kfVaraustyyppiTable .wp-form-row { grid-template-columns: 290px 260px 170px; }
}

/* Toissijaiset napit eivät venyisi koko leveyteen */
.wp-main button.secondary { width: auto; padding: 8px 16px; min-height: 38px; }

/* Integraatioryhmien erottelu */
#integraatioSmsWrap, #integraatioEmailWrap, #integraatioOviWrap { margin-top: 22px; padding-top: 10px; border-top: 1px solid var(--border); }

/* Kirjautumiskortti */
#loginCard { padding: 32px 28px 26px; }
#loginCard .login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
#loginCard .login-wordmark { display: inline-flex; align-items: flex-start; gap: 2px; line-height: 1; font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 2.4rem; font-weight: 800; letter-spacing: -.02em; color: #1e4a56; }
#loginCard .login-dot { margin-top: 4px; flex-shrink: 0; }
#loginCard h2 { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--muted); margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
#loginCard input { min-height: 0; height: 44px; }

@media (max-width: 780px) {
  .wp-main { padding: 16px 16px 40px; }
  .wp-card { padding: 18px 16px; }
  .dash-tiles { grid-template-columns: 1fr; gap: 10px; }
  .dash-tile { flex-direction: row; align-items: center; min-height: 0; padding: 12px 16px; }
  .dash-tile .dash-tile-value { font-size: 1.5rem; }
  .dash-tiles { grid-template-columns: minmax(0, 1fr); }
  .dash-tiles > * { min-width: 0; }
  .dash-recent { grid-column: 1 / -1; overflow-x: auto; }
}

/* 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.2rem; color: #1a1f29; text-transform: none; letter-spacing: -.005em; }
.hinnasto-modal-close {
  background: none; border: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: #555;
  width: 44px; height: 44px; margin-right: -10px; border-radius: 10px; padding: 0;
}
.hinnasto-modal-close:hover { background: #f1f2f3; }
.hinnasto-modal-body { padding: 16px 20px; }
.hinnasto-modal-body h3 { font-size: 1rem; margin: 22px 0 8px; color: #1a1f29; }
.hinnasto-modal-body .muted { color: #646970; }
.hinnasto-modal-body .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hinnasto-modal-body table + table { margin-top: 12px; }
.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: .8rem; font-weight: 600; color: #646970; padding: 6px 8px; border-bottom: 1px solid #dcdcde; }
.hinnasto-modal-body th.num { text-align: right; }
.hinnasto-modal-body td { padding: 9px 8px; border-bottom: 1px solid #f0f0f1; font-size: .92rem; color: #1a1f29; }

/* Mobiilin alatunniste: Vuoro.-logo ja kirjautunut käyttäjä. Työpöydällä logo on sivupalkin yläosassa. */
.wp-mobile-footer { display: none; }
@media (max-width: 780px) {
  .wp-sidebar .brand { display: none; }
  .wp-mobile-footer {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 28px 16px 36px; margin-top: 8px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem;
  }
  .wp-mobile-footer .brand-wordmark {
    display: inline-flex; align-items: flex-start; gap: 2px; line-height: 1;
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: #1e4a56;
  }
  .wp-mobile-footer .brand-dot { margin-top: 2px; flex-shrink: 0; }
}
@media (max-width: 560px) {
  .wp-topbar .who { display: none; }
  .wp-topbar #omaTiliBtn, .wp-topbar .topbar-logout-btn { flex: 1 1 0; }
}

.matriisi-toiminnot{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.matriisi-toiminnot .wp-btn{width:auto}
@media (max-width:560px){.matriisi-toiminnot .wp-btn{flex:1 1 45%}}

/* Kohteen esittely: näkyy kohteen valinnan jälkeen, väritys seuraa sivun korostusväriä. */
.esittely-card {
  position: relative;
  padding: clamp(18px, 4vw, 26px) clamp(18px, 4vw, 26px) clamp(18px, 4vw, 26px) clamp(22px, 4vw, 30px);
  border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface)) 0%, var(--surface) 70%);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.esittely-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--accent);
}
.esittely-card h2 {
  margin: 0 0 8px; font-size: clamp(1.15rem, 3.4vw, 1.4rem); letter-spacing: -.01em; color: var(--ink); text-transform: none;
}
.esittely-card p {
  margin: 0; white-space: pre-line; line-height: 1.6; color: var(--text); font-size: 1rem;
}

.alv-valinta{margin-top:6px;font-size:.85rem}

.esittely-card .esittely-osoite { margin-top: 12px; font-weight: 600; font-size: .95rem; color: var(--ink); }

/* Hallintapaneelin etusivu */
.etusivu-tervehdys h3 { font-size: 1.35rem; margin-bottom: 4px; }
.etusivu-pikalinkit { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.etusivu-pikalinkit .wp-btn { width: auto; padding: 8px 14px; }
.wp-sidebar .brand:focus-visible { outline: 2px solid var(--primary, #1e4a56); outline-offset: -2px; }

/* Raportin vientisarakkeiden valinta */
.rap-sarakkeet { margin: 4px 0 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fafbfc; }
.rap-sarakkeet summary { cursor: pointer; font-weight: 600; }
.rap-sarake-napit { display: flex; gap: 8px; margin: 10px 0; }
.rap-sarake-napit button { width: auto; padding: 4px 12px; }
.rap-sarake-lista { display: flex; flex-wrap: wrap; gap: 6px 10px; }

/* Logo linkkinä brändin kotisivulle */
.brand-link { display: inline-flex; align-items: center; gap: inherit; color: inherit; text-decoration: none; }
a.brand-link[href]:focus-visible { outline: 2px solid var(--accent, #bb6a2c); outline-offset: 3px; border-radius: 6px; }

/* Siirretty sivujen sisäisistä <style>-lohkoista (CSP: ei inline-tyylielementtejä). */
  .vp-kohde { position: relative; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .15s; }
  .vp-kohde.vp-aktiivinen {
    outline: 3px solid #ffd43b;
    box-shadow: 0 0 0 3px rgba(255,212,59,.35);
    z-index: 5;
  }
  .vp-kohde.vp-aktiivinen::after {
    content: "" attr(data-selite);
    position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%);
    background: #1a1a1a; color: #fff; font-size: 11px; font-weight: 600; line-height: 1.3;
    padding: 4px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
  }
  .legal { max-width: 760px; width: 100%; margin: 0 auto; padding: 32px 20px 48px; line-height: 1.6; flex: 1 0 auto; }
  .legal h1 { margin-bottom: 4px; }
  .legal h2 { margin-top: 32px; font-size: 1.15rem; color: var(--ink); text-transform: none; letter-spacing: -.005em; display: block; }
  .legal .muted { color: var(--muted, #666); }
  .legal .fillin { background: none; border: 0; padding: 0; }
  .legal p { white-space: pre-line; }
  .yt-rivi { display:flex; gap:14px; padding:9px 0; border-bottom:1px solid var(--border); }
  .yt-rivi:last-child { border-bottom:none; }
  .yt-rivi .yt-label { color: var(--muted); min-width: 120px; flex-shrink:0; font-size:.85rem; padding-top:1px; }
  .yt-rivi .yt-arvo { word-break: break-word; }
  .yt-rivi .yt-arvo a { color: var(--accent); text-decoration:none; }
  .yt-rivi .yt-arvo a:hover { text-decoration:underline; }

/* Vuoropiste hallinnoi asennusta: asiakkaan paneelista piilotetaan lisenssin ja reCAPTCHA:n muokkaus */
body.hallinnoitu #lisenssiAsennaCard, body.hallinnoitu #lisenssiPakotusCard, body.hallinnoitu #lisenssiOhitusCard, body.hallinnoitu #integraatioRecaptchaKortti { display: none !important; }
#hallinnointiHuomio { display: none; }
body.hallinnoitu #hallinnointiHuomio { display: block; }
