/* KALENDER — Vana-Vigala Rahvamaja */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --roheline: #4c8b3f;
  --roheline-tume: #3a6e30;
  --taevas1: #6fb2e8;
  --taevas2: #cfe9fb;
  --joon: #dfe5da;
  --tekst: #2b3a2b;
  --tana: #fff8dc;
}
body {
  font-family: system-ui, "Segoe UI", sans-serif;
  color: var(--tekst);
  background: #f6f9f3;
}

/* ---------- PÄIS ---------- */
.taevas {
  position: relative;
  height: 25vh;
  min-height: 227px;
  background: linear-gradient(to bottom, #39a6fd, var(--taevas2) 75%);
  overflow: hidden;
}
.paise-sisu {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0 1.2rem;
  height: 100%; /* keskmine kast ulatub üle kogu tausta, ka lilleriba peale */
}
.tiitel { align-self: flex-start; padding-top: 1rem; }
.tiitel h1 { font-size: 1.7rem; color: #1d3b5e; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.alatiitel { color: #2c5480; font-size: 1rem; }
.jargmine {
  /* täpselt lehe keskel, sõltumata külgede laiusest */
  position: absolute; left: 50%; transform: translateX(-50%);
  top: 1.2rem; bottom: 1.2rem; width: min(780px, 56vw);
  display: flex; flex-direction: column; justify-content: center;
  /* valge kast sinaka valguskumaga taustal */
  background:
    radial-gradient(circle at 18% 12%, rgba(111,178,232,.38), transparent 55%),
    radial-gradient(circle at 85% 85%, rgba(57,166,253,.28), transparent 55%),
    linear-gradient(160deg, #ffffff 40%, #e8f3fd);
  border-radius: 18px;
  padding: 1.4rem 2.5rem;
  text-align: center;
  box-shadow:
    0 0 20px 5px rgba(173, 216, 230, 0.6),  /* sisemine tugevam helesinine kuma */
    0 0 40px 15px rgba(173, 216, 230, 0.3), /* keskmine hajuvam helesinine */
    0 0 60px 30px rgba(255, 255, 255, 0.9); /* välimine üleminek valgeks */
}
.j-slaidid { display: grid; }
.j-slaid {
  grid-area: 1 / 1;                  /* slaidid üksteise peal */
  display: flex; flex-direction: column; align-items: center;
  opacity: 0; transform: translateX(45px); pointer-events: none;
  transition: opacity .5s ease, transform .5s ease;
}
.j-slaid.aktiivne { opacity: 1; transform: none; pointer-events: auto; }
.jargmine .silt {
  font-size: 1rem; text-transform: uppercase; letter-spacing: .12em; color: #4c8b3f;
  font-weight: 600;
}
.j-pealkiri { font-size: 2.6rem; font-weight: 700; color: #1d3b5e; cursor: pointer; line-height: 1.15; }
.j-pealkiri:not([data-id]) { cursor: default; }
.j-aeg { color: #2c5480; margin-top: .4rem; font-size: 1.4rem; }
.paise-nupud {
  display: flex; flex-direction: column; align-items: flex-end; gap: .55rem;
  white-space: nowrap; margin-left: auto; align-self: flex-start; padding-top: 1rem;
}
.paise-nupud a, .paise-nupud button {
  background: rgba(255,255,255,.75); border: 1px solid rgba(29,59,94,.25);
  color: #1d3b5e; padding: .35rem .8rem; border-radius: 8px;
  text-decoration: none; font-size: .85rem; cursor: pointer;
}
#kasutaja-nimi { color: #1d3b5e; font-weight: 600; font-size: .9rem; }
.lilleriba {
  position: absolute; bottom: 0; left: 0;
  width: 100%; height: 105px; z-index: 1; display: block;
  filter: blur(3px); /* taevapilt hägusam, fookus jääb valgele kastile */
  transform: scale(1.04); /* peidab bluri läbipaistva ääre */
}

/* ---------- KUUNAVIGATSIOON ---------- */
main { --serv: 1.2rem; padding: 1rem var(--serv) 5rem; }
.kuu-nav {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  padding: .6rem 0 .2rem;
}
.kuu-nav h2 { font-size: 1.5rem; min-width: 15rem; text-align: center; text-transform: capitalize; }
.kuu-nav button {
  font-size: 1.6rem; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 1px solid var(--joon); background: #fff; cursor: pointer; line-height: 1;
}
.kuu-nav button:disabled { opacity: .3; cursor: default; }
.kuu-riba {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem;
  padding: .4rem 0 .8rem;
}
.kuu-riba button {
  border: 1px solid var(--joon); background: #fff; border-radius: 999px;
  padding: .25rem .7rem; font-size: .8rem; cursor: pointer; color: var(--tekst);
}
.kuu-riba button.aktiivne { background: var(--roheline); color: #fff; border-color: var(--roheline); }

/* ---------- RUUMIFILTER + RUUMISILDID ---------- */
:root { --sinine: #2b5fc7; --sinine-tume: #1d448f; }
.ruum-riba {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem;
  padding: .1rem 0 .9rem;
}
.ruum-riba button {
  background: var(--sinine); color: #fff; font-weight: 700; font-size: .9rem;
  border: none; border-radius: 7px; padding: .4rem 1.1rem; cursor: pointer;
  opacity: .55; letter-spacing: .02em;
}
.ruum-riba button:hover { opacity: .85; }
.ruum-riba button.aktiivne {
  opacity: 1; background: var(--sinine-tume);
  box-shadow: 0 2px 8px rgba(29,68,143,.45);
}
/* ---------- ISIKURIBA: kogukonna liikmed + abilised (ainult sisselogitule) ---------- */
.isik-riba { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; padding: 0 0 .9rem; }
.isik-riba.peidus { display: none; }
.isik-riba button {
  background: #fff; color: var(--roheline-tume); border: 1.5px solid var(--roheline-tume);
  border-radius: 999px; padding: .25rem .8rem; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.isik-riba button:hover { background: #eef6ea; }
.isik-riba button.aktiivne { background: var(--roheline-tume); color: #fff; }
.isik-link { color: var(--roheline-tume); font-weight: 600; text-decoration: underline dotted; cursor: pointer; }
.isik-link:hover { text-decoration: underline; }
/* nimede autosoovitaja (osalejad + protokoll) */
.soovitus {
  position: fixed; z-index: 90; background: #fff; border: 1px solid var(--joon); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); max-height: 240px; overflow-y: auto;
}
.soovitus.peidus { display: none; }
.soovitus-rida { padding: .4rem .8rem; cursor: pointer; font-size: .95rem; white-space: nowrap; }
.soovitus-rida.valitud, .soovitus-rida:hover { background: var(--roheline); color: #fff; }
.ruum-silt {
  display: inline-block; background: var(--sinine); color: #fff;
  font-weight: 700; font-size: .78rem; letter-spacing: .04em;
  border-radius: 6px; padding: .18rem .6rem; margin: .2rem 0;
}
.ruum-silt.suur { font-size: 1rem; padding: .3rem .9rem; }
:root { --oranz: #c4650f; --oranz-tume: #94470a; }
.ruum-silt.bron-silt { background: var(--oranz); }
/* broneeringu chip: värv tuleb ruumist, 🔒 eristab broneeringu */
.jargmine .ruum-silt { align-self: center; font-size: .95rem; padding: .25rem .9rem; }
.jaga-silt { background: var(--roheline); border: none; cursor: pointer; font: inherit;
  font-weight: 700; font-size: .78rem; }
.jaga-silt:hover { background: var(--roheline-tume); }

/* jagamise teade (link kopeeritud) */
#teade {
  position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%);
  background: #2b3a2b; color: #fff; padding: .7rem 1.2rem; border-radius: 10px;
  z-index: 100; font-size: .95rem; box-shadow: 0 4px 16px rgba(0,0,0,.3);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
  max-width: 92vw; text-align: center;
}
#teade.nahtav { opacity: 1; }

/* ---------- KALENDER ---------- */
.kalender-ymbris {
  background: #fff; border: 1px solid var(--joon); border-left: none; border-right: none;
  border-radius: 0; overflow: hidden;
  margin: 0 calc(-1 * var(--serv)); /* servast servani */
}
.nadalapaevad {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  background: var(--roheline); color: #fff;
  font-size: .85rem; font-weight: 600;
}
.nadalapaevad div { padding: .5rem .6rem; }
.nadalapaevad .np { background: var(--roheline-tume); }
.kalender { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.paev {
  min-width: 0; min-height: 132px; border-top: 1px solid var(--joon); border-left: 1px solid var(--joon);
  padding: .3rem .5rem; cursor: pointer; position: relative; background: #fff;
}
.paev:nth-child(7n+1) { border-left: none; }
.paev:hover { background: #f2f8ee; }
.paev.teine-kuu { background: #f7f7f4; color: #aaa; }
.paev.tana { background: var(--tana); }
.paev.tana .pnr {
  background: var(--roheline); color: #fff; border-radius: 50%;
  width: 4rem; height: 4rem; display: inline-flex; align-items: center; justify-content: center;
}
.pnr { font-size: 2.9rem; font-weight: 600; line-height: 1.1; }
.chip {
  display: block; margin-top: .25rem;
  /* alumine padi läbipaistva äärisena: line-clamp lõikab padding-kasti servast,
     muidu paistaks 3. rea ülaserv alumise padja alt välja */
  padding: .18rem .45rem 0; border-bottom: .18rem solid transparent;
  background: #2b5fc7; /* värv tuleb ruumist inline'ina; see on ruumita kirje varu */
  color: #fff; font-weight: 600; border-radius: 5px;
  font-size: .78rem; line-height: 1.25;
  /* kuni 2 rida, edasi …; veerg ei veni kunagi (vt minmax(0,1fr)) */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere;
}
.chip .kell { color: rgba(255,255,255,.85); font-weight: 700; margin-right: .25rem; }

/* ---------- AASTAVAADE: 12 minikuud ---------- */
.aasta-vaade .nadalapaevad { display: none; }
.aasta-vaade .kalender {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem; padding: 1rem;
}
.mini-kuu { border: 1px solid var(--joon); border-radius: 10px; padding: .5rem .6rem; background: #fff; }
.mini-kuu h4 {
  text-align: center; cursor: pointer; color: var(--roheline-tume);
  text-transform: capitalize; font-size: .95rem; margin-bottom: .3rem;
}
.mini-kuu h4:hover { text-decoration: underline; }
.mini-np {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-size: .6rem; color: #8a9; text-align: center; margin-bottom: .15rem;
}
.mini-paevad { display: grid; grid-template-columns: repeat(7, 1fr); }
.mini-paev {
  text-align: center; font-size: .78rem; line-height: 1.2;
  padding: .15rem 0 .05rem; border-radius: 6px; min-height: 1.85rem;
}
.mini-paev.on-yritusi { cursor: pointer; font-weight: 700; }
.mini-paev.on-yritusi:hover { background: #f2f8ee; }
.mini-paev.tana { background: var(--tana); outline: 1px solid var(--roheline); }
.mini-tapid { display: flex; justify-content: center; flex-wrap: wrap; min-height: 6px; }
.mini-tapid .tapp { width: 5px; height: 5px; margin: .5px; }

/* ---------- PÄEVA ÜRITUSED (päevamodalis) ---------- */
.p-yritus { border-bottom: 1px solid var(--joon); padding: .8rem 0 1rem; }
.p-yritus:last-child { border-bottom: none; }
.p-pealkiri { font-size: 1.15rem; font-weight: 700; }
.p-aeg { color: #557; font-size: .9rem; margin: .2rem 0 .5rem; }
.p-sisu { white-space: pre-wrap; font-size: .95rem; margin-bottom: .5rem; }
.p-osalejad { font-size: .9rem; background: #f2f8ee; border-radius: 8px; padding: .5rem .7rem; margin-bottom: .5rem; white-space: pre-wrap; }
.p-osalejad b { color: var(--roheline-tume); }
.p-failid { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.p-fail {
  border: 1px solid var(--joon); border-radius: 8px; overflow: hidden; cursor: pointer;
  width: 86px; text-align: center; background: #fafcf8; font-size: .68rem;
}
.p-fail img { width: 100%; height: 60px; object-fit: cover; display: block; }
.p-fail .pdf-ikoon { height: 60px; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; }
.p-fail .fnimi { padding: .2rem .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-muuda {
  background: none; border: 1px solid var(--joon); border-radius: 8px;
  padding: .3rem .7rem; cursor: pointer; font-size: .85rem;
}
.p-muuda.p-roh {
  background: var(--roheline); color: #fff; border-color: var(--roheline); font-weight: 700;
}
.p-muuda.p-roh:hover { background: var(--roheline-tume); border-color: var(--roheline-tume); }
.p-tyhi { color: #789; padding: 1rem 0; }

/* ---------- + NUPP ---------- */
#lisa-nupp {
  position: fixed; right: 2rem; bottom: 2rem; z-index: 50;
  width: 4.2rem; height: 4.2rem; border-radius: 50%; border: none;
  background: var(--roheline); color: #fff; font-size: 2.6rem; line-height: 1;
  cursor: pointer; box-shadow: 0 4px 16px rgba(40,80,30,.4);
}
#lisa-nupp:hover { background: var(--roheline-tume); }
#jaga-nupp {
  position: fixed; right: 2.5rem; bottom: 7.2rem; z-index: 50;
  width: 3.2rem; height: 3.2rem; border-radius: 50%;
  border: 2px solid var(--roheline); background: #fff; font-size: 1.35rem; line-height: 1;
  cursor: pointer; box-shadow: 0 3px 12px rgba(40,80,30,.25);
}
#jaga-nupp:hover { background: #f2f8ee; }

/* ---------- MODALID ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(20,30,20,.5); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: modal-fade .18s ease; /* käivitub igal avamisel (display:none → flex) */
}
@keyframes modal-fade { from { opacity: 0; } }
.modal-kast {
  background: #fff; border-radius: 14px; padding: 1.4rem 1.6rem; position: relative;
  width: 560px; max-width: 100%; max-height: 92vh; overflow-y: auto;
  animation: modal-touse .2s ease;
}
@keyframes modal-touse { from { opacity: 0; transform: translateY(10px); } }
.modal-kast.kitsas { width: 360px; }
.modal-kast.lai { width: 900px; }
.modal-sulge {
  position: absolute; top: .6rem; right: .8rem; background: none; border: none;
  font-size: 1.7rem; cursor: pointer; color: #888; line-height: 1;
}
.modal h3 { margin-bottom: .9rem; padding-right: 2rem; }
.modal label { display: block; margin-bottom: .7rem; font-size: .9rem; font-weight: 600; }
.modal input, .modal textarea, .modal select {
  display: block; width: 100%; margin-top: .25rem;
  padding: .55rem .7rem; border: 1px solid #c6cfc0; border-radius: 8px;
  font: inherit; font-weight: 400;
}
.modal input[type=hidden] { display: none !important; }
.rida3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: .7rem; }
.rida2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }

/* ---------- KELLAAJA LIUGURID ---------- */
.aeg-plokk { margin-bottom: .7rem; }
.aeg-rida {
  display: grid; grid-template-columns: 3.2rem 3.6rem 1fr auto;
  align-items: center; gap: .6rem; margin-bottom: .45rem;
}
.aeg-silt { font-size: .9rem; font-weight: 600; }
.aeg-vaartus { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--roheline-tume); }
.aeg-rida input[type=range] {
  width: 100%; margin: 0; padding: 0; border: none;
  accent-color: var(--roheline); cursor: pointer;
}
.aeg-rida.tyhi input[type=range] { opacity: .35; }
.aeg-rida.tyhi .aeg-vaartus { color: #9ab; font-weight: 400; }
.aeg-tyhi {
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  border: 1px solid var(--joon); background: #fff; color: #888;
  cursor: pointer; font-size: .95rem; line-height: 1; padding: 0;
}
.aeg-tyhi:hover { color: #b3261e; border-color: #d8a5a1; }

/* ---------- SUUR ÜRITUSE VORM ---------- */
.modal-kast.suur-vorm { width: min(1440px, 97vw); max-height: 96vh; padding: 2rem 2.6rem; }
/* ürituse vorm katab pea terve lehe */
/* ürituse vorm katab KOGU ekraani (Boss 20.09) */
#yritus-modal { padding: 0; }
#yritus-modal .modal-kast.suur-vorm { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
/* päeva üritused samas suuruses üle ekraani, keritav; pealkiri püsib üleval */
#paev-modal .modal-kast.suur-vorm { height: 96vh; }
#paev-modal-kp { font-size: 1.5rem; color: var(--roheline-tume); margin-bottom: .6rem; padding-right: 2.5rem; }
#paev-modal .p-yritus { padding: 1rem 0 1.2rem; }
#paev-modal .p-pealkiri { font-size: 1.5rem; }
#paev-modal .p-sisu { font-size: 1.05rem; line-height: 1.5; }
.chip { cursor: pointer; }

/* ---------- SUUR KIRJUTAMINE (sisu peaaegu täisekraanil) ---------- */
.sisu-label { position: relative; }
#sisu-suur {
  position: absolute; top: -.15rem; right: 0;
  border: 1px solid var(--joon); background: #fff; border-radius: 7px;
  padding: .1rem .55rem; cursor: pointer; font-size: .95rem; color: var(--roheline-tume);
}
#sisu-suur:hover { border-color: var(--roheline); }
#yritus-modal.kirjutus .sisu-label {
  position: fixed; inset: 2vh 2vw; z-index: 90;
  background: #fff; border-radius: 14px; padding: 1rem 1.3rem 1.3rem;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 48px rgba(0,0,0,.4);
  margin: 0; font-size: 1rem;
}
#yritus-modal.kirjutus .sisu-label textarea {
  flex: 1; resize: none; font-size: 1.08rem; line-height: 1.55; margin-top: .5rem;
}
#yritus-modal.kirjutus #sisu-suur { top: .7rem; right: 1rem; font-size: .9rem; }

/* ---------- VÄLJA MÜÜDUD lüliti ja silt ---------- */
label.lyliti-valik {
  display: flex; gap: .6rem; align-items: center; margin-top: .8rem;
  font-weight: 400 !important; font-size: .88rem; cursor: pointer;
}
.lyliti-valik input { display: none !important; }
.lyliti {
  flex: none; width: 2.7rem; height: 1.5rem; border-radius: 999px;
  background: #cfd6c9; position: relative; transition: background .18s ease;
}
.lyliti::after {
  content: ''; position: absolute; top: .17rem; left: .2rem;
  width: 1.15rem; height: 1.15rem; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .18s ease;
}
.lyliti-valik input:checked + .lyliti { background: #b3261e; }
.lyliti-valik input:checked + .lyliti::after { left: 1.35rem; }
.lyliti-valik b { color: #b3261e; }
.ruum-silt.myydud-silt { background: #b3261e; }
.ruum-silt.arendus-silt { background: #b8860b; }
.arendus-valik input:checked + .lyliti { background: #b8860b; }
.arendus-valik b { color: #b8860b; }
.kultuurikava-link {
  display: block; margin-top: .8rem; padding: .55rem .8rem;
  border: 1px solid var(--joon); border-left: 4px solid var(--roheline);
  border-radius: 8px; background: #f2f8ee;
  font-size: .88rem; color: var(--tekst); text-decoration: none;
}
.kultuurikava-link b { color: var(--roheline-tume); }
.kultuurikava-link:hover { border-color: var(--roheline); background: #e8f3e2; }
button.kultuurikava-link { width: 100%; text-align: left; font: inherit; font-size: .88rem; cursor: pointer; }
#jaga-modal { z-index: 70; } /* avaneb ka ürituse vormi PEALE */
.ruum-silt.protokoll-silt { background: var(--roheline-tume); text-decoration: none; cursor: pointer; }
.ruum-silt.protokoll-silt:hover { background: #2c5424; }

/* ---------- FAILIDE LIBISTAMINE (esimene pilt = kaas) ---------- */
.vf-kaart[data-lohista] { cursor: grab; touch-action: none; }
.vf-kaart[data-lohista] img { pointer-events: none; }
.vf-kaart.lohib { opacity: .6; outline: 2px solid var(--roheline); cursor: grabbing; }
.vf-kaas-silt {
  position: absolute; top: .25rem; left: .25rem;
  background: var(--roheline); color: #fff; font-size: .6rem; font-weight: 700;
  letter-spacing: .06em; border-radius: 5px; padding: .1rem .4rem;
}
.vf-vihje { font-size: .74rem; color: #789; margin: .1rem 0 .5rem; }
.vf-kaart.ootel { outline: 2px dashed var(--roheline); outline-offset: -2px; }
.vf-ootel-silt { font-size: .6rem; color: var(--roheline-tume); padding: 0 .35rem .25rem; }

/* ---------- AJALUGU ---------- */
.modal-kast.ajalugu-kast { width: min(1100px, 96vw); }
.ajalugu-selgitus { color: #789; font-size: .9rem; margin: -.4rem 0 .8rem; }
.ajalugu-ymbris { overflow-x: auto; }
.ajalugu-tabel { border-collapse: collapse; width: 100%; font-size: .88rem; }
.ajalugu-tabel th {
  text-align: left; padding: .4rem .6rem; border-bottom: 2px solid var(--joon);
  color: #557; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
.ajalugu-tabel td { padding: .45rem .6rem; border-bottom: 1px solid var(--joon); vertical-align: top; }
.ajalugu-tabel td:nth-child(2), .ajalugu-tabel td:nth-child(5) { white-space: nowrap; }
.ajalugu-tabel .p-link { color: var(--roheline-tume); font-weight: 700; cursor: pointer; }
.ajalugu-tabel .p-link:hover { text-decoration: underline; }
.aj-sisu { max-width: 24rem; overflow-wrap: anywhere; color: #556; }

/* ---------- CANVA SIRVIJA ---------- */
/* Kõik sirvijad (Canva, Toomase kujundused, olemasolevad failid) avanevad vormi
   PEALE ja katavad KOGU ekraani — ühtne, nagu ürituse vorm ise (Boss 21.09) */
#canva-modal, #kuj-modal, #olem-modal { z-index: 70; padding: 0; }
.modal-kast.canva-kast {
  width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh;
  border-radius: 0; padding: 1.4rem 2rem; display: flex; flex-direction: column;
}

/* ---------- VIDEO: kaaderpilt + ▶ märk kõikjal, kus pisipilte näidatakse ---------- */
.vid-pisi { position: relative; display: block; }
.vid-pisi img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vid-mark {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.7); pointer-events: none;
}
.ag-kaas-mang {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: #fff; text-shadow: 0 3px 14px rgba(0,0,0,.75); pointer-events: none;
}
.ag-kaas-video {
  height: 200px; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; background: #eceee8; border-radius: 10px;
}
#vaatur-sisu video { max-width: 100%; max-height: 70vh; border-radius: 8px; background: #000; }

/* ---------- TOOMASE KUJUNDUSED (kasutab Canva modali stiile) ---------- */
#kuj-sirvija, #olem-sirvija { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#kuj-sirvija.peidus, #olem-sirvija.peidus { display: none; }
#kuj-eelvaade, #olem-eelvaade { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#kuj-eelvaade.peidus, #olem-eelvaade.peidus { display: none; }
.kuj-eelsisu {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  background: #f4f6f2; border-radius: 10px; overflow: hidden;
}
.kuj-eelsisu img, .kuj-eelsisu video { max-width: 100%; max-height: 100%; object-fit: contain; }
.kuj-eelsisu video { background: #000; width: 100%; }
.kuj-eelsisu iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.kuj-ikoon {
  height: 130px; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; background: #eceee8;
}
.kuj-kestus {
  position: absolute; right: .35rem; top: .35rem; background: rgba(0,0,0,.65); color: #fff;
  font-size: .72rem; padding: .1rem .35rem; border-radius: 5px;
}
.canva-kaart .vid-pisi { height: 130px; }
.kuj-eemalda {
  color: #b3261e; border-color: #e3b6b2 !important;
}
#canva-sirvija { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.canva-otsing { display: flex; gap: .5rem; margin-bottom: .8rem; }
.canva-otsing input { flex: 1; margin-top: 0 !important; }
.canva-otsing button {
  border: 1px solid var(--joon); background: #fff; border-radius: 8px;
  padding: .45rem 1rem; cursor: pointer;
}
.canva-vork {
  flex: 1; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem;
  align-content: start;
}
.canva-kaart {
  position: relative; /* kestuse silt videokaardil */
  border: 1px solid var(--joon); border-radius: 10px; overflow: hidden;
  cursor: pointer; background: #fafcf8;
}
.canva-kaart:hover { border-color: var(--roheline); }
.canva-kaart img { width: 100%; height: 130px; object-fit: cover; display: block; background: #eef; }
.canva-kaart .ck-nimi {
  font-size: .75rem; padding: .25rem .45rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* olemasoleva faili kaardil: mis üritus ja mis päev */
.canva-kaart .ck-alt {
  font-size: .68rem; color: #789; padding: 0 .45rem .3rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.canva-jalus { text-align: center; padding-top: .6rem; }
#canva-veel, #kuj-veel, #olem-veel { border: 1px solid var(--joon); background: #fff; border-radius: 999px; padding: .35rem 1.2rem; cursor: pointer; }
#canva-eelvaade { display: flex; flex-direction: column; min-height: 0; flex: 1; }
#canva-eelvaade.peidus { display: none; }
#canva-eelpilt { flex: 1; min-height: 0; object-fit: contain; width: 100%; background: #f4f6f2; border-radius: 10px; }
.canva-eel-nimi { text-align: center; font-weight: 600; padding: .5rem 0; }
.canva-eel-nupud { display: flex; justify-content: space-between; }
.canva-eel-nupud button { border: 1px solid var(--joon); background: #fff; border-radius: 8px; padding: .5rem 1.2rem; cursor: pointer; }
.canva-eel-nupud .roheline { background: var(--roheline); color: #fff; border: none; font-weight: 700; }
.canva-tyhi { color: #789; padding: 1.5rem; grid-column: 1 / -1; text-align: center; }
.canva-proovi {
  border: 1px solid var(--roheline); background: #fff; color: var(--roheline-tume);
  border-radius: 999px; padding: .4rem 1.3rem; cursor: pointer; font-weight: 700;
}
.canva-proovi:hover { background: #f2f8ee; }

/* ---------- PROTOKOLL (peaaegu täisekraan) ---------- */
#protokoll-modal { z-index: 70; } /* avaneb suure vaate PEALE */
.protokoll-rida { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; align-items: center; }
.protokoll-rida .p-muuda { margin: 0; }
a#protokoll-pdf { text-decoration: none; color: inherit; display: inline-block; }
.modal-kast.protokoll-kast { width: 96vw; height: 96vh; display: flex; flex-direction: column; }
.protokoll-kast textarea {
  flex: 1; width: 100%; resize: none; font: inherit; font-size: 1.05rem; line-height: 1.55;
  padding: .7rem .9rem; border: 1px solid #c6cfc0; border-radius: 8px; margin: .3rem 0 .7rem;
}
.protokoll-nupud { display: flex; align-items: center; gap: 1rem; justify-content: flex-end; }
.protokoll-osalejad {
  background: #f2f8ee; border: 1px solid #cfe0c5; border-left: 4px solid var(--roheline);
  border-radius: 8px; padding: .45rem .8rem; margin-top: .3rem;
  font-size: .9rem; white-space: pre-wrap;
}
.protokoll-osalejad b { color: var(--roheline-tume); }
.protokoll-seis { color: #789; font-size: .85rem; margin-right: auto; }
/* salvestamata mustand brauseri mälust: pakutakse taastamist */
.protokoll-mustand {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .5rem 0;
  background: #fff6d6; border: 1px solid #e0b93a; border-left: 5px solid #e0b93a; border-radius: 8px; padding: .55rem .9rem; font-size: .92rem;
}
.protokoll-mustand.peidus { display: none; }
.protokoll-mustand button { border: 1px solid var(--joon); background: #fff; border-radius: 8px; padding: .4rem .8rem; cursor: pointer; font: inherit; font-size: .88rem; }
.protokoll-mustand button.roheline { background: var(--roheline); color: #fff; border-color: var(--roheline); font-weight: 600; }

/* ---------- VAATE JAGAMINE ---------- */
.jaga-kast { text-align: center; }
.jaga-logo { width: 76px; height: 76px; margin: 0 auto .5rem; display: block; }
.jaga-tagline { color: var(--roheline-tume); font-weight: 600; font-size: .9rem; margin: -.4rem 0 .8rem; }
#jaga-url {
  text-align: center; font-size: .85rem; color: #557;
  background: #f2f6ef; cursor: text; margin-bottom: .9rem;
}
#jaga-login { background: #fff; border: 2px solid var(--joon); color: var(--tekst);
  font-size: 1rem; font-weight: 600; padding: .7rem 1rem; border-radius: 10px; cursor: pointer; }
#jaga-login:hover { border-color: var(--roheline); }
#jaga-jaga { background: var(--sinine); color: #fff; border: none;
  font-size: 1rem; font-weight: 600; padding: .7rem 1rem; border-radius: 10px; cursor: pointer; }

/* ---------- KOOPIA TEADE (ürituse vorm) ---------- */
#koopia-teade {
  background: #e8f3e2; border: 1px solid #bcd9ad; border-left: 4px solid var(--roheline);
  border-radius: 8px; padding: .6rem .9rem; margin-bottom: .8rem; font-size: .88rem;
}
#koopia-teade b { color: var(--roheline-tume); }
/* „Kopeeri üritus" = dropdown pealkirja kõrval: valik täidab vormi allika andmetega */
#koopia-valik-label.peidus { display: none; }

/* ---------- VALIK PÄRAST SISSELOGIMIST ---------- */
.valik-kast { text-align: center; }
.valik-ikoon { font-size: 2.6rem; margin-bottom: .3rem; }
.valik-kysimus { color: #667; margin: .3rem 0 1.1rem; }
.valik-nupud { display: flex; flex-direction: column; gap: .7rem; }
.valik-nupud button {
  font-size: 1.1rem; font-weight: 700; letter-spacing: .05em;
  padding: .9rem 1rem; border-radius: 10px; cursor: pointer;
}
#valik-sirvin { background: #fff; border: 2px solid var(--joon); color: var(--tekst); }
#valik-sirvin:hover { border-color: var(--roheline); }
#valik-loon { border: none; }

/* ---------- RUUM VALIMATA ---------- */
.ruum-kast { text-align: center; }
#ruum-valik {
  display: block; width: 100%; margin: .3rem 0 .8rem;
  background: var(--roheline); color: #fff; font: inherit; font-weight: 700;
  font-size: 1.05rem; text-align: center; border: none; border-radius: 10px;
  padding: .8rem .7rem; cursor: pointer;
}
#ruum-valik:hover { background: var(--roheline-tume); }
#ruum-valik option { background: #fff; color: var(--tekst); font-weight: 400; }

/* ---------- KINNITUS (JAH/EI) ---------- */
.kinnitus-kast { text-align: center; }
.kinnitus-ikoon { font-size: 2.4rem; margin-bottom: .4rem; }
/* kustutatava faili pisipilt hoiatuses */
.kinnitus-pilt { display: flex; justify-content: center; margin-bottom: .6rem; }
.kinnitus-pilt img, .kinnitus-pilt .vid-pisi { width: 160px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--joon); }
.kinnitus-pilt .vid-pisi { display: block; overflow: hidden; }
.kinnitus-ikoonikast { width: 160px; height: 110px; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; background: #eceee8; border-radius: 8px; }
.kinnitus-lisa { font-size: .9rem; color: #556; line-height: 1.45; margin-top: .5rem; }
.kinnitus-kast h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
.kinnitus-nupud { justify-content: center; gap: 1rem; margin-top: 1rem; }
#kinnitus-ei {
  background: #fff; border: 1px solid var(--joon); border-radius: 8px;
  padding: .6rem 1.2rem; cursor: pointer; font-size: 1rem;
}
.punane-taidetud {
  background: #b3261e; color: #fff; border: none; border-radius: 8px;
  padding: .6rem 1.2rem; cursor: pointer; font-size: 1rem;
}

/* ---------- AGENDA ---------- */
.agenda { margin-top: 2rem; }
.agenda-tiitel { font-size: 1.4rem; margin-bottom: .8rem; color: var(--roheline-tume); }
.agenda-moodunud {
  display: block; margin: 1.2rem auto 0; padding: .55rem 1.1rem; font: inherit; font-size: .95rem;
  color: var(--roheline-tume); background: none; border: 1.5px solid var(--roheline-tume); border-radius: 999px; cursor: pointer;
}
.agenda-moodunud:hover { background: var(--roheline-tume); color: #fff; }
.agenda-kuu {
  font-size: 1.05rem; color: var(--roheline-tume); text-transform: capitalize;
  margin: 1.3rem 0 .5rem; padding-bottom: .25rem; border-bottom: 2px solid var(--joon);
}
.agenda-kuu:first-of-type { margin-top: .2rem; }
.agenda-paev {
  background: #fff; border: 1px solid var(--joon); border-radius: 12px;
  padding: 1rem 1.3rem; margin-bottom: 1rem;
  scroll-margin-top: 1rem; transition: background .6s ease;
}
.agenda-paev.esile { background: #fdf6d8; }
.agenda-kp { font-size: 1.35rem; font-weight: 700; color: #1d3b5e; margin-bottom: .6rem; }
.agenda-np { font-weight: 400; color: #789; font-size: .95rem; }
.ag-kaart {
  display: flex; gap: 1.1rem; padding: .7rem 0;
  border-top: 1px solid var(--joon);
}
.ag-kaart:first-of-type { border-top: none; }
.ag-aeg { min-width: 6.2rem; font-weight: 700; color: #557; padding-top: .15rem; white-space: nowrap; }
.ag-keha { flex: 1; min-width: 0; }
.ag-pealkiri { font-size: 2.15rem; font-weight: 700; }
.ag-sildid { margin: .1rem 0 .3rem; }
.ag-sisu { white-space: pre-wrap; font-size: .95rem; margin: .3rem 0 .4rem; }
.sisu-link { color: #2e9ad6; font-weight: 700; word-break: break-all; }
.sisu-link:hover { color: #1d448f; }
.ag-kaas { position: relative; margin: .45rem 0 .5rem; cursor: pointer; }
.ag-kaas img { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: 10px; }
.ag-kaas-arv {
  position: absolute; right: .55rem; bottom: .55rem;
  background: rgba(0,0,0,.55); color: #fff; font-size: .8rem;
  padding: .15rem .55rem; border-radius: 999px;
}
.ag-bron { opacity: .92; }
/* Desktopil on agenda kaardivõrk: read jooksevad vasakult paremale, kaart = päev.
   Mobiilis (≤760px) jääb senine üks veerg. */
@media (min-width: 761px) {
  .agenda { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .agenda-tiitel, .agenda-kuu, .agenda-moodunud, .agenda > .p-tyhi { grid-column: 1 / -1; }
  .agenda-paev { margin-bottom: 0; }
  .agenda .ag-kaart { flex-direction: column; gap: .15rem; }
  .agenda .ag-aeg { min-width: 0; }
}
@media (min-width: 761px) and (max-width: 1099px) {
  .agenda { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- MOBIILITÄPID ---------- */
.paev-tapid { display: none; }
.tapp {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--roheline); margin: 1px;
}
.tapp.oranz { background: var(--oranz); }
.vorm-veerud { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.6rem; }
.rida4 { display: grid; grid-template-columns: 1.2fr .8fr .8fr 1.1fr; gap: .7rem; }
label.bron-valik { /* label-tag spetsiifilisuse pärast: .modal label lööks .bron-valik üle */
  display: flex; gap: .6rem; align-items: flex-start;
  background: #fbeedd; border: 1px solid #e8c9a2; border-radius: 10px;
  padding: .6rem .8rem; font-weight: 400 !important; font-size: .88rem;
  cursor: pointer;
}
.bron-valik input { width: auto !important; margin-top: .15rem; }
.bron-valik b { color: var(--oranz-tume); }
.vorm-parem { border-left: 1px solid var(--joon); padding-left: 1.6rem; }
#yritus-failid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6rem; margin-bottom: .6rem; }
.vf-kaart { position: relative; border: 1px solid var(--joon); border-radius: 8px; overflow: hidden; background: #fafcf8; }
.vf-kaart img { width: 100%; height: 78px; object-fit: cover; display: block; }
.vf-pdf { height: 78px; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; background: #f0f3ec; }
.vf-nimi { font-size: .68rem; padding: .2rem .35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vf-kustuta {
  position: absolute; top: .25rem; right: .25rem; width: 1.7rem; height: 1.7rem;
  border-radius: 50%; border: 3px solid #b3261e; background: #fff; color: #b3261e;
  cursor: pointer; font-size: 1rem; font-weight: 900; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.vf-kustuta:hover { background: #b3261e; color: #fff; }
@media (max-width: 860px) {
  .vorm-veerud { grid-template-columns: 1fr; }
  .vorm-parem { border-left: none; padding-left: 0; }
  .rida4 { grid-template-columns: 1fr 1fr; }
}
.vorm-viga { color: #b3261e; font-size: .9rem; min-height: 1.2rem; margin-bottom: .4rem; }
.vorm-nupud { display: flex; justify-content: flex-end; gap: .7rem; margin-top: .4rem; }
.modal button[type=submit], .roheline {
  background: var(--roheline); color: #fff; border: none; border-radius: 8px;
  padding: .6rem 1.4rem; font-size: 1rem; cursor: pointer;
}
button.punane { background: #fff; color: #b3261e; border: 1px solid #b3261e; border-radius: 8px; padding: .6rem 1rem; cursor: pointer; }
.nupulink {
  display: inline-block; text-decoration: none; border: 1px solid var(--joon); color: var(--tekst);
  border-radius: 8px; padding: .6rem 1.2rem;
}
.nupulink.roheline { border: none; color: #fff; }
.vihje { font-size: .8rem; color: #789; margin-top: .6rem; }
.silt2 { font-size: .9rem; font-weight: 600; margin: .4rem 0 .3rem; }
#yritus-failid { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.vf-fail {
  display: flex; align-items: center; gap: .4rem; border: 1px solid var(--joon);
  border-radius: 8px; padding: .25rem .5rem; font-size: .8rem; background: #fafcf8;
}
.vf-fail button { background: none; border: none; color: #b3261e; cursor: pointer; font-size: 1rem; }
.fail-lisa {
  display: inline-block; border: 1px dashed var(--roheline); color: var(--roheline-tume);
  border-radius: 8px; padding: .4rem .8rem; cursor: pointer; font-size: .85rem;
}
/* „Lisa faile" ja „Sirvi olemasolevaid faile" kõrvuti, kumbki pool laiust, sama kuju (Boss 21.09) */
.fail-nupud { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .5rem; }
.fail-nupud .fail-lisa {
  display: block; margin: 0; text-align: center; font: inherit; font-size: .85rem; font-weight: 600;
  background: #fff; padding: .55rem .6rem;
}
.fail-nupud .fail-lisa:hover { background: #f2f8ee; }
/* ---------- ÜRITUSE SUUR VAADE ---------- */
.p-link { cursor: pointer; }
.p-link:hover { text-decoration: underline; color: var(--roheline-tume); }
.modal-kast.ylelehe {
  width: min(1100px, 96vw); height: 94vh; overflow-y: auto;
  padding: 2rem 2.5rem;
}
.s-pais { border-bottom: 2px solid var(--joon); padding-bottom: .8rem; margin-bottom: 1rem; }
.s-pais h2 { font-size: 2.2rem; color: #1d3b5e; padding-right: 2.5rem; }
.s-aeg { font-size: 1.2rem; color: #557; margin: .3rem 0 .6rem; }
.s-sisu { white-space: pre-wrap; font-size: 1.05rem; line-height: 1.55; margin-bottom: .9rem; }
.s-failid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem; margin: 1rem 0;
}
.s-fail { border: 1px solid var(--joon); border-radius: 10px; overflow: hidden; background: #fafcf8; }
.s-fail img { width: 100%; height: 160px; object-fit: cover; display: block; cursor: pointer; }
.s-pdf {
  height: 160px; display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; cursor: pointer; background: #f0f3ec;
}
.s-fail-nimi {
  padding: .4rem .6rem 0; font-size: .85rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s-fail-nupud { display: flex; gap: .4rem; padding: .4rem .6rem .6rem; flex-wrap: wrap; }
.s-fail-nupud a, .s-fail-nupud button {
  font-size: .78rem; padding: .25rem .55rem; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--joon); background: #fff; color: var(--tekst); text-decoration: none;
}
.s-fail-nupud button { color: #b3261e; border-color: #d8a5a1; }

/* ---------- KOMMENTAARID (Facebooki stiilis) ---------- */
.s-kommid { border-top: 2px solid var(--joon); margin-top: 1.2rem; padding-top: 1rem; }
.s-kommid h4 { margin-bottom: .8rem; font-size: 1.05rem; }
.komm-ring {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.45rem; height: 1.45rem; padding: 0 .3rem;
  background: var(--roheline); color: #fff; border-radius: 999px;
  font-size: .8rem; font-weight: 700; vertical-align: middle;
}
.komm { display: flex; gap: .6rem; margin-bottom: .7rem; }
.komm-avatar {
  width: 2.4rem; height: 2.4rem; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .95rem;
}
.komm-keha { max-width: 85%; }
.komm-mull {
  background: #f0f2f5; border-radius: 16px; padding: .5rem .9rem;
  display: inline-block;
}
.komm-nimi { font-weight: 700; font-size: .85rem; display: block; }
.komm-tekst { font-size: .95rem; white-space: pre-wrap; }
.komm-aeg { font-size: .75rem; color: #8a9; margin: .15rem 0 0 .9rem; }
.komm-kustuta {
  background: none; border: none; color: #b3261e; cursor: pointer;
  font-size: .75rem; padding: 0;
}
#s-komm-vorm { margin-top: 1rem; }
#s-komm-vorm input[type=text] {
  width: 260px; max-width: 100%; padding: .5rem .8rem; margin-bottom: .5rem;
  border: 1px solid #c6cfc0; border-radius: 999px; font: inherit;
}
.komm-rida { display: flex; gap: .6rem; align-items: flex-end; }
.komm-rida textarea {
  flex: 1; padding: .55rem .9rem; border: 1px solid #c6cfc0; border-radius: 18px;
  font: inherit; resize: vertical; min-height: 2.4rem;
}
.komm-rida button { border-radius: 999px; padding: .5rem 1.3rem; border: none; }

/* ---------- ÜLESLAADIMISE PROGRESS ---------- */
.lae-rida { margin-bottom: .8rem; }
.lae-pais { display: flex; justify-content: space-between; gap: .8rem; font-size: .85rem; margin-bottom: .25rem; }
.lae-nimi { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lae-olek { color: #667; white-space: nowrap; }
.lae-riba { height: 10px; background: #e4e9e0; border-radius: 999px; overflow: hidden; }
.lae-taide {
  height: 100%; width: 0; background: var(--sinine); border-radius: 999px;
  transition: width .2s ease;
}
.lae-taide.valmis { background: var(--roheline); }
.lae-taide.lae-viga { background: #b3261e; }

/* ---------- VAATURI KARUSSELL ---------- */
.vaatur-nool {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 3.2rem; height: 3.2rem; border-radius: 50%; border: none;
  background: rgba(30,40,30,.55); color: #fff; font-size: 2.2rem; line-height: 1;
  cursor: pointer; z-index: 5;
}
.vaatur-nool:hover { background: rgba(30,40,30,.8); }
#vaatur-eelmine { left: .7rem; }
#vaatur-jargmine { right: .7rem; }
.vaatur-loendur { margin-right: auto; color: #667; font-size: .95rem; align-self: center; }

#vaatur-sisu { text-align: center; }
#vaatur-sisu img { max-width: 100%; max-height: 70vh; border-radius: 8px; }
#vaatur-sisu iframe { width: 100%; height: 70vh; border: 1px solid var(--joon); border-radius: 8px; }

footer { text-align: center; color: #8a9a85; padding: 1.5rem 0 2.5rem; font-size: .85rem; }

/* ---------- PUHAS REŽIIM: ainult ürituse vaade (admini eelvaate-iframe) ---------- */
body.puhas { background: #fff; }
body.puhas .taevas, body.puhas main, body.puhas footer,
body.puhas #lisa-nupp, body.puhas #jaga-nupp,
body.puhas .modal { background: #fff; padding: 0; animation: none; }
body.puhas .modal-kast.ylelehe {
  width: 100%; height: 100vh; max-height: 100vh;
  border-radius: 0; box-shadow: none; animation: none;
}
.peidus { display: none !important; }
[hidden] { display: none !important; }

/* ---------- MOBIIL ---------- */
@media (max-width: 760px) {
  .paise-sisu { flex-wrap: wrap; gap: .6rem; padding: .8rem 1rem 0; height: auto; }
  .tiitel { padding-top: 0; }
  .tiitel h1 { font-size: 1.1rem; }
  .jargmine { position: static; transform: none; width: 100%; padding: .7rem 1rem; margin: 0; }
  .jargmine .silt { font-size: .75rem; }
  .j-pealkiri { font-size: 1.15rem; }
  .j-aeg { font-size: 1rem; }
  .paise-nupud { flex-direction: row; align-self: auto; padding-top: 0; }
  .taevas { height: auto; padding-bottom: 90px; }
  .pnr { font-size: 1.1rem; }
  .paev.tana .pnr { width: 1.8rem; height: 1.8rem; }
  main { --serv: .5rem; padding: .8rem var(--serv) 5rem; }
  .paev { min-height: 54px; padding: .15rem .2rem; }
  /* mobiilis chipide asemel täpid — kalendrivõrk jääb puhtaks */
  .chip { display: none; }
  .paev-tapid { display: flex; flex-wrap: wrap; margin-top: .2rem; }
  .nadalapaevad div { font-size: .65rem; padding: .35rem .2rem; }
  .ag-kaart { flex-direction: column; gap: .15rem; }
  .ag-aeg { min-width: 0; }
  .agenda-paev { padding: .7rem .8rem; }
  /* kaanepilt servast serva: tühistab .agenda-paev .8rem külgpadjad */
  .ag-kaas { margin-left: -.8rem; margin-right: -.8rem; }
  .ag-kaas img { border-radius: 0; max-height: none; }
  .rida3 { grid-template-columns: 1fr; }
  .kuu-nav h2 { font-size: 1.15rem; min-width: 0; }
  .rida2 { grid-template-columns: 1fr; }
  .aasta-vaade .kalender {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .5rem; padding: .5rem;
  }
  .mini-paev { font-size: .68rem; min-height: 1.6rem; }
}

/* ---------- VIIBE: kuu vahetuse libisemine (mobiil) ----------
   Ainus tagasiside, et sõrmeviibe läks arvesse. Uus kuu tuleb sisse sealt
   poolt, kuhu sõrm liikus. Kes eelistab liikumiseta liidest, saab oma soovi
   süsteemi seadest (prefers-reduced-motion). */
@keyframes kuu-vasakule { from { transform: translateX(14%); opacity: .35; } to { transform: none; opacity: 1; } }
@keyframes kuu-paremale { from { transform: translateX(-14%); opacity: .35; } to { transform: none; opacity: 1; } }
.kalender.libise-vasakule { animation: kuu-vasakule .22s ease-out; }
.kalender.libise-paremale { animation: kuu-paremale .22s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .kalender.libise-vasakule, .kalender.libise-paremale { animation: none; }
}

/* ---------- TÖÖ-TEAVITUS („sait töötab, läheb hetk aega") ---------- */
#too-modal, #laadimis-modal { z-index: 80; }  /* edenemine käib alati kõige peal */
#kinnitus-modal { z-index: 85; }  /* hoiatus ka sirvijate (70) ja edenemise peal */
.too-kast { text-align: center; }
.too-ring {
  width: 2.6rem; height: 2.6rem; margin: .2rem auto .8rem;
  border: 3px solid #dfe7d9; border-top-color: var(--roheline);
  border-radius: 50%; animation: too-pooris .8s linear infinite;
}
@keyframes too-pooris { to { transform: rotate(360deg); } }
#too-tekst { font-weight: 600; font-size: 1.05rem; margin-bottom: .7rem; }
.too-riba { height: 8px; background: #e4e9e0; border-radius: 999px; overflow: hidden; }
.too-taide {
  height: 100%; width: 40%; border-radius: 999px; background: var(--roheline);
  animation: too-liug 1.1s ease-in-out infinite;
}
/* määramatu kestus: riba käib edasi-tagasi, sest lõppu ei saa ausalt lubada */
@keyframes too-liug {
  0%   { margin-left: -40%; }
  100% { margin-left: 100%; }
}
.too-vihje { margin-top: .7rem; font-size: .82rem; color: #667; }
@media (prefers-reduced-motion: reduce) {
  .too-ring, .too-taide { animation: none; }
  .too-taide { width: 100%; opacity: .5; }
}

/* ---------- SALVESTATUD ÜRITUSE RIBA (vorm jääb töölauaks lahti) ---------- */
#salvestatud-riba {
  background: #eaf5e4; border: 1px solid var(--roheline);
  border-left: 5px solid var(--roheline);
  border-radius: 8px; padding: .8rem 1rem; margin-bottom: 1rem;
}
#salvestatud-tekst { font-size: .95rem; line-height: 1.45; }
.salvestatud-nupud { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.salvestatud-nupud button {
  border: 1px solid var(--joon); background: #fff; color: var(--tekst);
  border-radius: 8px; padding: .5rem .9rem; font-size: .9rem; cursor: pointer;
}
.salvestatud-nupud button.roheline {
  background: var(--roheline); color: #fff; border-color: var(--roheline); font-weight: 600;
}
