/* Strateon UI — komponentide stiilid (versioon 3: kolm teemat, mobiili äpiloogika, teemavahetaja).
   Laadi pärast tokens.css-i. Kõik klassid algavad st-. Juurelement saab klassi "st". */

.st { font-family: var(--font-sans); font-weight: 300; font-size: 16px; line-height: 26px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
.st *, .st *::before, .st *::after { box-sizing: border-box; }
.st :where(a) { color: inherit; }
.st :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }

/* Tüpograafia */
.st-title { font-family: var(--font-mono); font-weight: 700; font-size: 32px; line-height: 36px; letter-spacing: 0.02em; text-transform: uppercase; margin: 0; color: var(--ink); }
.st-title--sm { font-size: 22px; line-height: 28px; }
.st-h2 { font-weight: 500; font-size: 22px; line-height: 30px; margin: 0; }
.st-h3 { font-weight: 500; font-size: 17px; line-height: 24px; margin: 0; }
.st-body { font-size: 16px; line-height: 26px; max-width: var(--layout-measure); margin: 0; }
.st-body-sm { font-size: 15px; line-height: 24px; margin: 0; color: var(--ink-2); }
.st-ui { font-weight: 400; font-size: 14px; line-height: 20px; }
.st-meta { font-weight: 400; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.st-num { font-family: var(--font-mono); font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.st-num-lg { font-family: var(--font-mono); font-weight: 700; font-size: 28px; line-height: 32px; }
.st-link { color: var(--action); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.st-link:hover { text-decoration-thickness: 2px; }

/* Nupp */
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 40px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-0); font: 400 14px/20px var(--font-sans); cursor: pointer; text-decoration: none; white-space: nowrap; background: none; color: var(--ink); }
.st-btn svg { width: 18px; height: 18px; }
.st-btn--primary { background: var(--action); color: var(--on-action); }
.st-btn--primary:hover { background: var(--action-hover); }
.st-btn--secondary { border-color: var(--line-strong); color: var(--ink); }
.st-btn--secondary:hover { background-color: var(--bg-sunk); }
.st-btn--quiet { padding: 0 2px; height: auto; color: var(--action); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.st-btn--quiet:hover { text-decoration-thickness: 2px; }
.st-btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.st-btn--icon { width: 40px; padding: 0; }
.st-btn--block { display: flex; width: 100%; }
.st-btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Väli */
.st-field { display: flex; flex-direction: column; gap: 6px; }
.st-field__label { font: 400 14px/20px var(--font-sans); color: var(--ink-2); }
.st-field__hint { font: 400 13px/18px var(--font-sans); color: var(--ink-3); }
.st-field__error { font: 400 13px/18px var(--font-sans); color: var(--danger); }
.st-input { height: 44px; padding: 0 var(--space-3); background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-0); font: 300 16px/24px var(--font-sans); color: var(--ink); width: 100%; }
.st-input::placeholder { color: var(--ink-3); }
.st-input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
textarea.st-input { height: auto; min-height: 112px; padding: var(--space-3); resize: vertical; }
.st-input--error { border-color: var(--danger); }

/* Ülariba */
.st-topbar { height: var(--layout-topbar); display: flex; align-items: center; gap: var(--space-8); padding: 0 var(--space-16); border-bottom: 1px solid var(--line); background: var(--bg); }
.st-topbar__logo { display: inline-flex; align-items: center; text-decoration: none; }
.st-platlogo { height: 27px; width: auto; display: block; }
.st-platlogo__mark { fill: var(--logo-mark); }
.st-platlogo__text { fill: var(--logo-text); }
.st-topbar__nav { display: flex; gap: var(--space-6); height: 100%; }
.st-topbar__link { display: flex; align-items: center; height: 100%; font: 400 14px/20px var(--font-sans); color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.st-topbar__link:hover { color: var(--ink); }
.st-topbar__link[aria-current] { color: var(--ink); border-bottom-color: var(--action); }
.st-topbar__end { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); color: var(--ink-2); }

/* Külgnavigatsioon (õppekava, protsessi etapid) */
.st-sidenav { width: var(--layout-sidebar); display: flex; flex-direction: column; }
.st-sidenav__group { font: 500 13px/18px var(--font-sans); color: var(--ink-3); padding: var(--space-6) var(--space-3) var(--space-2); }
.st-sidenav__item { display: grid; grid-template-columns: 28px 1fr 18px; align-items: center; gap: var(--space-2); min-height: 40px; padding: 8px var(--space-3); font: 400 14px/20px var(--font-sans); color: var(--ink-2); text-decoration: none; }
.st-sidenav__item:hover { background: var(--bg-sunk); color: var(--ink); }
.st-sidenav__item[aria-current] { background: var(--bg-tint); color: var(--ink); }
.st-sidenav__n { font: 400 12px/1 var(--font-mono); color: var(--ink-3); }
.st-sidenav__done { color: var(--accent-ink); }

/* Loendirida */
.st-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.st-row { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-4); align-items: center; padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.st-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-row__title { font: 400 16px/24px var(--font-sans); color: var(--ink); text-decoration: none; }
a.st-row:hover .st-row__title, .st-row__title:hover { text-decoration: underline; text-underline-offset: 3px; }
a.st-row { text-decoration: none; color: inherit; }

/* Kursusekaart (ainus kaart süsteemis) */
.st-card { display: flex; flex-direction: column; gap: var(--space-3); text-decoration: none; color: inherit; }
.st-card__media { aspect-ratio: 16 / 10; background: var(--bg-sunk); overflow: hidden; }
.st-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-card__title { font: 500 17px/24px var(--font-sans); margin: 0; }
.st-card:hover .st-card__title { text-decoration: underline; text-underline-offset: 3px; }

/* Märgis */
.st-tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; font: 400 12px/1 var(--font-sans); color: var(--ink-2); background: var(--bg-sunk); white-space: nowrap; }
.st-tag--active { background: var(--bg-tint); color: var(--accent-ink); }
.st-tag--active::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--accent-ink); }
.st-tag--outline { background: none; box-shadow: inset 0 0 0 1px var(--line-strong); }
.st-tag--warning { background: none; color: var(--warning); box-shadow: inset 0 0 0 1px var(--warning); }

/* Edenemine */
.st-progress { display: flex; align-items: center; gap: var(--space-3); }
.st-progress__track { flex: 1; height: 4px; background: var(--line); border-radius: var(--radius-full); overflow: hidden; }
.st-progress__fill { height: 100%; background: var(--accent-ink); border-radius: var(--radius-full); }
.st-progress__label { font: 400 13px/18px var(--font-mono); color: var(--ink-3); }

/* Avatar */
.st-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--bg-tint); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font: 500 14px/1 var(--font-sans); overflow: hidden; flex-shrink: 0; }
.st-avatar img { width: 100%; height: 100%; object-fit: cover; }
.st-avatar--sm { width: 32px; height: 32px; font-size: 12px; }
.st-avatar--lg { width: 96px; height: 96px; font-size: 28px; }
.st-avatars { display: flex; align-items: center; }
.st-avatars .st-avatar { margin-left: -4px; box-shadow: 0 0 0 2px var(--bg); }
.st-avatars .st-avatar:first-child { margin-left: 0; }
.st-avatars__more { margin-left: var(--space-3); font: 400 13px/18px var(--font-sans); color: var(--ink-3); }

/* Vahelehed */
.st-tabs { display: flex; gap: var(--space-6); border-bottom: 1px solid var(--line); }
.st-tab { padding: 10px 0; font: 400 14px/20px var(--font-sans); color: var(--ink-2); background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.st-tab:hover { color: var(--ink); }
.st-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--action); }
.st-tab__count { font: 400 12px/1 var(--font-mono); color: var(--ink-3); }

/* Tabel */
.st-table { width: 100%; border-collapse: collapse; font: 300 15px/22px var(--font-sans); }
.st-table th { text-align: left; font: 500 13px/18px var(--font-sans); color: var(--ink-3); padding: 0 var(--space-4) var(--space-2) 0; border-bottom: 1px solid var(--line-strong); vertical-align: bottom; }
.st-table td { padding: var(--space-4) var(--space-4) var(--space-4) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.st-table tr:hover td { background: var(--bg-sunk); }
.st-table td.st-table__code { font: 400 14px/22px var(--font-mono); color: var(--ink-2); white-space: nowrap; }
.st-table td.st-table__end, .st-table th.st-table__end { text-align: right; padding-right: 0; white-space: nowrap; }

/* Hääletus */
.st-vote { display: inline-flex; border: 1px solid var(--line-strong); }
.st-vote__btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; background: none; border: 0; font: 400 13px/1 var(--font-mono); color: var(--ink-2); cursor: pointer; }
.st-vote__btn + .st-vote__btn { border-left: 1px solid var(--line-strong); }
.st-vote__btn:hover { background: var(--bg-sunk); }
.st-vote__btn[aria-pressed="true"] { background: var(--bg-tint); color: var(--accent-ink); }
.st-vote__btn svg { width: 14px; height: 14px; }

/* Kommentaar */
.st-comment { display: grid; grid-template-columns: 32px 1fr; gap: var(--space-3); padding: var(--space-4) 0; }
.st-comment__head { display: flex; gap: var(--space-2); align-items: baseline; flex-wrap: wrap; }
.st-comment__name { font: 500 14px/20px var(--font-sans); }
.st-comment__body { font: 300 15px/24px var(--font-sans); margin: 4px 0 var(--space-2); max-width: var(--layout-measure); }
.st-comment__actions { display: flex; gap: var(--space-4); align-items: center; }
.st-comment__replies { grid-column: 2; }
.st-comment__actions .st-btn--quiet { color: var(--ink-3); font-size: 13px; text-decoration: none; }
.st-comment__actions .st-btn--quiet:hover { color: var(--ink); text-decoration: underline; }

/* Kohtumise rida */
.st-meeting { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--space-6); align-items: start; padding: var(--space-6) 0; border-top: 1px solid var(--line); }
.st-meeting__date { display: flex; flex-direction: column; align-items: flex-start; }
.st-meeting__day { font: 700 28px/32px var(--font-mono); }
.st-meeting__month { font: 400 12px/16px var(--font-mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.st-meeting__meta { display: flex; flex-wrap: wrap; gap: 4px var(--space-4); margin-top: 4px; }
.st-meeting__meta span { display: inline-flex; gap: 6px; align-items: center; }
.st-meeting__meta svg { width: 16px; height: 16px; color: var(--ink-3); }
.st-meeting--past { color: var(--ink-3); }
.st-meeting--past .st-meeting__day { color: var(--ink-3); }

/* Tähtaeg / märkus: üks samblikutooni rida */
.st-notice { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--bg-tint); font: 400 14px/20px var(--font-sans); color: var(--ink); }
.st-notice svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--accent-ink); }

/* Tühi olek */
.st-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-4); padding: var(--space-12) var(--space-6); }
.st-empty img { width: 160px; height: 160px; padding: 20px; object-fit: contain; background: var(--illu-bg); }
.st-illu { background: var(--illu-bg); object-fit: contain; display: block; }
.st-empty p { margin: 0; max-width: 36ch; }

/* Teade (toast) */
.st-toast { display: inline-flex; align-items: center; gap: var(--space-3); padding: 12px var(--space-4); background: var(--ink); color: var(--bg); font: 400 14px/20px var(--font-sans); box-shadow: var(--shadow-pop); }
.st-toast svg { width: 18px; height: 18px; }

/* Ikoon: joonikoon 24 ruudustikul, 1,5 px, teravad nurgad */
.st-icon { width: 20px; height: 20px; display: inline-block; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }

/* Tekstuur üksikule plokile (lehe tasandil on body::after reegel tokens.css-is) */
.st-grain { position: relative; isolation: isolate; }
.st-grain::after { content: ""; position: absolute; inset: 0; background: url("../assets/strateon-tera.png") repeat; background-size: 256px 256px; pointer-events: none; z-index: 1; }

/* ================================================================
   Paigutus, mis kohandub ise (laud → tahvel → mobiil)
   Murdepunktid: alla 768 mobiil, 768–1023 tahvel, alates 1024 laud.
   ================================================================ */
.st-container { max-width: var(--layout-content); margin: 0 auto; padding: 0 var(--space-16); }
.st-cols { display: grid; grid-template-columns: var(--st-cols, 1fr 1fr); gap: var(--space-16); }
.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-8); }
.st-mobile-only { display: none !important; }

/* Mobiili ülariba sisuekraanil: tagasi, ekraani nimi, üks tegevus */
.st-appbar { position: sticky; top: 0; z-index: 20; height: var(--layout-appbar, 56px); display: flex; align-items: center; gap: var(--space-1); padding: 0 var(--space-2) 0 var(--space-1); background: var(--bg); border-bottom: 1px solid var(--line); }
.st-appbar__title { flex: 1; min-width: 0; font: 500 16px/24px var(--font-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-appbar .st-btn--icon { width: 44px; height: 44px; }

/* Alumine menüü (TabBar) */
.st-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: calc(var(--layout-tabbar, 64px) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--bg); border-top: 1px solid var(--line); }
.st-tabbar__item { display: flex; transition: color 120ms; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; font: 400 13px/16px var(--font-sans); color: var(--ink-3); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.st-tabbar__icon { position: relative; display: flex; align-items: center; justify-content: center; width: 56px; height: 28px; }
.st-tabbar__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.st-tabbar__item:hover { color: var(--ink); }
.st-tabbar__item:active, .st-tabbar__item[aria-current] { color: var(--action); }
.st-tabbar__item[aria-current] { font-weight: 500; }
.st-tabbar__item[aria-current] .st-tabbar__icon svg { stroke-width: 2; }
.st-tabbar__badge { position: absolute; top: -4px; left: 38px; min-width: 18px; height: 18px; padding: 0 4px; box-shadow: 0 0 0 2px var(--bg); background: var(--action); color: var(--on-action); font: 400 13px/18px var(--font-mono); text-align: center; }

/* Toiminguriba: tööekraani põhinupp pöidla all (asendab TabBari) */
.st-actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); background: var(--bg); border-top: 1px solid var(--line); }
.st-actionbar .st-btn { height: 48px; }
.st-actionbar .st-btn--primary { flex: 1; }

/* Alumine leht (Sheet): külgveerg, filtrid, avatari menüü mobiilis */
.st-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(20, 26, 23, 0.48); }
.st-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 90vh; display: flex; flex-direction: column; background: var(--bg-raised); box-shadow: var(--shadow-pop); padding-bottom: env(safe-area-inset-bottom, 0px); }
.st-sheet__handle { width: 40px; height: 4px; margin: 8px auto 0; background: var(--line-strong); flex-shrink: 0; }
.st-sheet__head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-2) 0 var(--space-4); flex-shrink: 0; }
.st-sheet__title { flex: 1; min-width: 0; font: 500 17px/24px var(--font-sans); margin: 0; }
.st-sheet__body { flex: 1; overflow-y: auto; padding: 0 var(--space-4) var(--space-4); overscroll-behavior: contain; }

/* Tahvel: ülariba jääb, külgpaneel avaneb sisu peale */
@media (max-width: 1023px) {
  .st-container { padding: 0 var(--space-8); }
  .st-topbar { padding: 0 var(--space-8); }
  .st-cols { gap: var(--space-8); }
}

/* Mobiil: äpiloogika */
@media (max-width: 767px) {
  .st-mobile-only { display: revert !important; }
  .st-desktop-only { display: none !important; }

  /* Ülariba: logo, otsing, teavitused, avatar. Jaotised on all. */
  .st-topbar { height: var(--layout-appbar, 56px); gap: var(--space-4); padding: 0 var(--space-2) 0 var(--space-4); }
  .st-topbar__nav { display: none; }
  .st-topbar__end { gap: 0; }
  .st-platlogo { height: 22px; }

  /* Paigutus voolab ühte veergu */
  .st-container { padding: 0 var(--space-4); }
  .st-cols { grid-template-columns: 1fr; gap: var(--space-12); }
  .st-cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 280px; gap: var(--space-4); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--space-4); margin: 0 calc(-1 * var(--space-4)); padding: 0 var(--space-4); scrollbar-width: none; }
  .st-cards::-webkit-scrollbar { display: none; }
  .st-cards > * { scroll-snap-align: start; }
  .st-has-tabbar, .st-has-actionbar { padding-bottom: calc(var(--layout-tabbar, 64px) + env(safe-area-inset-bottom, 0px) + var(--space-6)); }

  /* Kiri */
  .st-title { font-size: 22px; line-height: 28px; }
  .st-sidenav { width: 100%; }

  /* Puudutus: vähemalt 44 px */
  .st-btn { height: 44px; }
  .st-btn--sm { height: 40px; }
  .st-btn--icon { width: 44px; height: 44px; }
  .st-btn--quiet { height: auto; min-height: 44px; }
  .st-vote__btn { height: 40px; padding: 0 14px; }
  .st-sidenav__item { min-height: 48px; }
  .st-row { min-height: 56px; gap: var(--space-3); }

  /* Vahelehed libisevad, ei murdu */
  .st-tabs { gap: var(--space-6); overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--space-4)); padding: 0 var(--space-4); }
  .st-tabs::-webkit-scrollbar { display: none; }
  .st-tab { padding: 12px 0; min-height: 44px; white-space: nowrap; flex-shrink: 0; }

  /* Kohtumise rida: nupp liigub teksti alla */
  .st-meeting { grid-template-columns: 48px 1fr; gap: var(--space-4); padding: var(--space-4) 0; }
  .st-meeting > :nth-child(3) { grid-column: 2; }
  .st-meeting__day { font-size: 22px; line-height: 28px; }

  /* Tabel muutub ridadeks */
  .st-table thead { display: none; }
  .st-table, .st-table tbody { display: block; }
  .st-table tr { display: grid; grid-template-columns: auto 1fr; gap: 4px var(--space-3); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
  .st-table td { display: block; padding: 0; border: 0; }
  .st-table td:nth-child(n+3) { grid-column: 1 / -1; }
  .st-table td.st-table__end { text-align: left; margin-top: var(--space-2); }

  .st-comment__body { max-width: none; }
  .st-empty { padding: var(--space-8) var(--space-4); }
  .st-empty img { width: 128px; height: 128px; padding: 16px; }
}

/* Laual ja tahvlil mobiili ribasid ei ole */
@media (min-width: 768px) {
  .st-tabbar, .st-actionbar, .st-appbar { display: none; }
}

/* ================================================================
   Kolm teemat: Mets (forest, vaikimisi), Paber (light), Puukoor (dark).
   Värvid tulevad tokens.css-ist. Siin on ainult see, mis ei ole värv:
   teemavahetaja asend, illustratsiooni versioon ja brauseri värviskeem.
   ================================================================ */
:root, [data-theme="forest"] { --st-theme-i: 1; --st-illu-l: none; --st-illu-d: block; color-scheme: dark; }
[data-theme="light"] { --st-theme-i: 0; --st-illu-l: block; --st-illu-d: none; color-scheme: light; }
[data-theme="dark"] { --st-theme-i: 2; --st-illu-l: none; --st-illu-d: block; color-scheme: dark; }

/* Illustratsioon: paberil hele versioon, metsal ja puukoorel tumeda tausta versioon (heledad jooned) */
.st-illu--light { display: var(--st-illu-l, none); }
.st-illu--dark { display: var(--st-illu-d, block); }

/* Teemavahetaja (ThemeSwitch): kolm ikooni, aktiivse all libisev 2px joon */
.st-themeswitch { --st-ts: 40px; position: relative; display: inline-grid; grid-template-columns: repeat(3, var(--st-ts)); flex-shrink: 0; }
.st-themeswitch::after { content: ""; position: absolute; left: calc((var(--st-ts) - 20px) / 2); bottom: 2px; width: 20px; height: 2px; background: var(--action); transform: translateX(calc(var(--st-theme-i, 1) * var(--st-ts))); transition: transform 400ms cubic-bezier(0.2, 0.7, 0.2, 1), background-color 400ms; pointer-events: none; }
.st-themeswitch__opt { display: flex; align-items: center; justify-content: center; width: var(--st-ts); height: var(--st-ts); padding: 0; margin: 0; background: none; border: 0; border-radius: var(--radius-0); color: var(--ink-3); cursor: pointer; transition: color 120ms; -webkit-tap-highlight-color: transparent; }
.st-themeswitch__opt svg { width: 20px; height: 20px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
.st-themeswitch__opt:hover { color: var(--ink); }
.st-themeswitch__opt[aria-checked="true"] { color: var(--action); }
.st-themeswitch__opt[aria-checked="true"] svg { stroke-width: 2; }
.st-ts-rays, .st-ts-moon { transform-box: view-box; transform-origin: 12px 12px; }
.st-ts-tree { transform-box: view-box; transform-origin: 12px 22px; }
.st-themeswitch__opt.is-new .st-ts-rays { animation: st-ts-spin 400ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.st-themeswitch__opt.is-new .st-ts-tree { animation: st-ts-grow 400ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.st-themeswitch__opt.is-new .st-ts-moon { animation: st-ts-tilt 400ms cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes st-ts-spin { from { transform: rotate(-45deg); } }
@keyframes st-ts-grow { from { transform: scaleY(0.5); } }
@keyframes st-ts-tilt { from { transform: rotate(-40deg); } }

/* Seade-rida menüüs (avatari menüü, alumine leht): silt vasakul, juhtelement paremal */
.st-setting { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 48px; font: 400 14px/20px var(--font-sans); color: var(--ink); }

/* Avatari menüü laual (ujuv kiht) */
.st-menu { position: absolute; z-index: 50; width: 300px; background: var(--bg-raised); box-shadow: var(--shadow-pop); padding: var(--space-2) var(--space-4); }
.st-menu .st-setting + .st-setting { border-top: 1px solid var(--line); }

/* Teema vahetus: kogu leht hajub 400 ms (View Transitions); vähendatud liikumisel 120 ms */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 400ms; animation-timing-function: ease; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 120ms; }
  .st-themeswitch::after { transition: none; }
  .st-themeswitch__opt.is-new * { animation: none !important; }
}
@media (max-width: 767px) {
  .st-themeswitch { --st-ts: 44px; }
  .st-setting { min-height: 56px; }
}

/* Puuteekraan: hõljumise taustad ei jää külge */
@media (hover: none) {
  .st-table tr:hover td, .st-sidenav__item:hover, .st-btn--secondary:hover, .st-vote__btn:hover { background-color: transparent; }
  .st-sidenav__item[aria-current]:hover { background: var(--bg-tint); }
  .st-vote__btn[aria-pressed="true"]:hover { background: var(--bg-tint); }
}
