/* Südamekarp PWA - "Tamm ja valge" (omaniku otsus 15.09.2026): soe, käegakatsutav
   bränd, alati sama välimusega (paberikarva taust + tammepuit + sügav punane
   süda), sõltumata süsteemi hele/tume seadistusest - vt design/rakendus/. */

@font-face {
  font-family: "Nunito";
  src: url("./fonts/Nunito[wght].ttf") format("truetype-variations"),
    url("./fonts/Nunito[wght].ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* --- pinnad --- */
  --paper: #f6f0e6;
  --card: #fffcf6;
  --input-bg: #fbf6ec;
  --line: #e6d9c3; /* õrn eraldaja - kaartidel/ridadel, mida toetab ka vari/tausta-erinevus */
  --line-strong: #8b6239; /* päris kontroll-piire (väljad, lüliti, valimata värviring) - 3:1+ */

  /* --- tekst (kõik AA-kontrollitud vastu --paper JA --card, vt raport) --- */
  --ink: #2b2018;
  --ink-dim: #615648;
  --ink-faint: #7a6a51;

  /* --- bränd --- */
  --accent: #dc3154; /* täidisnupud + suured/graafilised kohad (valge tekst peal AA) */
  --accent-deep: #a81f3b; /* aktsent TEKSTINA heledal taustal (lingid, aktiivne sakk, väike tekst) */
  --accent-tint: rgba(220, 49, 84, 0.14);

  /* --- puit (ainult dekoratiivne/graafiline, mitte kunagi tekstivärv) --- */
  --oak-1: #d8ae79;
  --oak-2: #b4854f;
  --oak-grain: #8b6239;
  --oak-light: #f0d9ae;

  /* --- oleku-värvid (tumendatud algsest disainist, et sildi tekst oleks AA) --- */
  --sage: #41685b; /* loetud */
  --amber: #7e5b34; /* karbis ootel */
  --gold: #7c5d13; /* lemmik */
  --danger: var(--accent-deep);
  --success: var(--sage);

  --focus: #1b5fb0; /* teadlikult sinine - eristub selgelt punasest aktsendist */

  --shadow-card: 0 6px 14px rgba(43, 32, 24, 0.08);
  --shadow-float: 0 14px 26px rgba(220, 49, 84, 0.32);
  --shadow-lift: 0 20px 34px rgba(43, 32, 24, 0.18), 0 2px 6px rgba(43, 32, 24, 0.1);

  --radius-lg: 18px;
  --radius-md: 16px;
  --radius-sm: 14px;

  --tabbar-h: 72px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

/* Iga elemendi enda "display" reegel (.btn, img jne) võidaks muidu vaikimisi
   [hidden] käitumise ära, sest autori-CSS kaalub rohkem kui brauseri
   vaikimisi UA-stiil - ilma selleta jäävad "peidetud" nupud/pildid nähtavaks. */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1,
h2,
h3 {
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h2 {
  font-size: 1.05rem;
  margin-top: 22px;
}

p {
  margin: 0 0 12px;
  color: var(--ink-dim);
  line-height: 1.5;
}

a {
  color: var(--accent-deep);
}
a:hover {
  color: var(--accent);
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: 1rem;
  color: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------------- layout shell ---------------- */

.shell {
  min-height: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding-left: max(20px, var(--safe-l));
  padding-right: max(20px, var(--safe-r));
  padding-top: calc(var(--safe-t) + 18px);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px);
  position: relative;
}

.shell.no-tabbar {
  padding-bottom: calc(var(--safe-b) + 28px);
}

.view {
  animation: view-in 0.18s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .view {
    animation: none;
  }
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  min-height: 44px;
}

.brand-row .icon {
  flex: none;
}

.brand-row .name {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ---------------- vaate pealkirjarida (pealkiri + valikuline karbi-sakk) ---------------- */

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 44px;
}

.page-head .page-title {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-title {
  font-size: 1.375rem;
  margin-bottom: 4px;
}

.page-sub {
  margin-bottom: 20px;
}

/* karbi-vahetuse "kodu" sakk (nupp, kui mitu karpi; muidu lihtsalt silt) - vähemalt 44x44 */
.box-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  min-height: 44px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
  max-width: 46vw;
}

.box-chip .label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.box-chip .icon {
  color: var(--ink-dim);
  flex: none;
}

button.box-chip:active {
  transform: scale(0.97);
}

.welcome-hero {
  display: flex;
  justify-content: center;
  margin: 22px 0 28px;
}

/* Ümmargune ikoonimähis (bränimärgi jaoks) - jagatud tervituse hero ja
   tühja-oleku vahel, mõlemal oma suurus/taust allpool. Teadlikult muu nimi kui
   ".badge" (olekusilt), et vältida nimekonflikti - see on ikooni MÄHIS. */
.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex: none;
}

.welcome-hero .icon-circle {
  width: 168px;
  height: 168px;
  background: radial-gradient(circle at 32% 28%, var(--oak-light) 0%, var(--oak-1) 45%, var(--oak-2) 100%);
  box-shadow: var(--shadow-lift);
}

@media (min-height: 750px) {
  .welcome-hero .icon-circle {
    width: 200px;
    height: 200px;
  }
}

/* ---------------- nupud ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 1.02rem;
  box-shadow: var(--shadow-float);
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.secondary {
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
  box-shadow: none;
}

.btn.ghost {
  background: transparent;
  color: var(--accent-deep);
  border: 1px solid transparent;
  box-shadow: none;
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid rgba(168, 31, 59, 0.4);
  box-shadow: none;
}

.btn.danger.solid {
  background: var(--danger);
  color: #fff;
  border: 0;
  box-shadow: 0 10px 20px rgba(168, 31, 59, 0.3);
}

.btn.small {
  width: auto;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 0.92rem;
}

.btn.icon {
  width: 44px;
  min-height: 44px;
  padding: 0;
  flex: none;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-row .btn {
  width: auto;
  flex: 1;
}

/* focus visibility everywhere (keyboard + switch access) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------- vormid ---------------- */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  color: var(--ink-dim);
  font-weight: 700;
  margin-bottom: 7px;
}

.field .counter {
  float: right;
  font-weight: 700;
  color: var(--ink-faint);
}

input[type="text"],
input[type="file"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  min-height: 48px;
  color: var(--ink);
  font-weight: 600;
}

/* ---------------- liugur (nt karbi seadete "Ekraani heledus") ---------------- */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  background: transparent;
  padding: 0;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1.5px solid var(--line-strong);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  margin-top: -12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1.5px solid var(--line-strong);
}

input[type="range"]::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.4;
  font-size: 0.906rem;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: var(--ink-faint);
  font-weight: 500;
}

.file-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--input-bg);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 8px;
  min-height: 64px;
}

.file-drop .thumb {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  object-fit: cover;
  flex: none;
  background: var(--card);
  border: 1px solid var(--line);
}

.file-drop .hint {
  color: var(--ink-dim);
  font-weight: 600;
  font-size: 0.87rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- kinnitusruut (nt liitumise vanusekinnitus) ---------------- */

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 10px 2px;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: none;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.check-row span {
  color: var(--ink-dim);
  font-weight: 600;
  font-size: 0.906rem;
  line-height: 1.4;
}

/* ---------------- värviringid ---------------- */

.color-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.color-chip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  padding: 0;
  position: relative;
}

.color-chip.selected {
  border-color: var(--card);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5.5px var(--ink);
}

.color-chip.selected::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(43, 32, 24, 0.25);
}

/* ---------------- kaardid / nimekirjad ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}

.card.danger {
  background: linear-gradient(135deg, rgba(168, 31, 59, 0.07), rgba(168, 31, 59, 0.02));
  border: 1.5px solid rgba(168, 31, 59, 0.3);
  box-shadow: none;
}

.card .card-title {
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}

.card .card-desc {
  color: var(--ink-dim);
  font-size: 0.87rem;
  line-height: 1.45;
  margin: 0 0 12px;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  text-align: left;
  min-height: 64px;
  box-shadow: var(--shadow-card);
}

button.list-row {
  color: inherit;
}

.list-row .avatar-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex: none;
}

.list-row .avatar-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(65, 104, 91, 0.18);
}

.list-row .main {
  flex: 1;
  min-width: 0;
}

.list-row .title {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row .sub {
  color: var(--ink-dim);
  font-weight: 600;
  font-size: 0.88rem;
}

.list-row .chevron {
  color: var(--ink-faint);
  flex: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--input-bg);
  color: var(--ink-dim);
  border: 1px solid var(--line);
}

.badge.owner {
  color: var(--accent-deep);
  background: var(--accent-tint);
  border-color: rgba(168, 31, 59, 0.3);
}

.empty-state {
  text-align: center;
  padding: 40px 12px;
  color: var(--ink-dim);
}

.empty-state .icon-circle {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: var(--input-bg);
  border: 1px solid var(--line);
}

/* ---------------- alustamise juhend (#/alusta, vt ka Seaded > paigaldamine) ---------------- */

.step-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.step-icon {
  width: 52px;
  height: 52px;
  flex: none;
  background: var(--accent-tint);
  color: var(--accent-deep);
}

.step-kicker {
  color: var(--ink-faint);
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.install-guide {
  margin-top: 2px;
}

.substep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}

.substep-row:last-child {
  border-bottom: none;
}

.substep-row .step-icon {
  width: 40px;
  height: 40px;
}

.substep-row .text {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.906rem;
}

/* ---------------- ajaloo read ---------------- */

.msg-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 13px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}

.msg-row.highlight {
  background: linear-gradient(135deg, rgba(220, 49, 84, 0.08), rgba(220, 49, 84, 0.02));
  border: 1.5px solid rgba(220, 49, 84, 0.3);
  box-shadow: 0 10px 20px rgba(220, 49, 84, 0.12);
}

.msg-row .row-main {
  display: flex;
  gap: 13px;
}

.msg-row .thumb {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  flex: none;
  object-fit: cover;
  background: var(--input-bg);
}

.msg-row .thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.msg-row .thumb.placeholder .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(43, 32, 24, 0.12);
}

.msg-row .body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
}

.msg-row .text {
  font-weight: 700;
  font-size: 0.906rem;
  line-height: 1.35;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.msg-row .meta {
  color: var(--ink-faint);
  font-weight: 700;
  font-size: 0.75rem;
  margin-top: 0;
}

.msg-row .heart-caption {
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 0.75rem;
  padding-left: 71px;
}

.msg-row .row-actions {
  padding-left: 71px;
  margin-top: 2px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--input-bg);
  color: var(--ink-dim);
}

.chip svg {
  width: 9px;
  height: 9px;
}

.chip.transit {
  color: var(--ink-dim);
  background: var(--input-bg);
}

.chip.waiting {
  color: var(--amber);
  background: rgba(126, 91, 52, 0.14);
}

.chip.scheduled {
  color: var(--amber);
  background: rgba(126, 91, 52, 0.14);
}

.chip.read {
  color: var(--sage);
  background: rgba(65, 104, 91, 0.14);
}

.chip.heart {
  color: var(--accent-deep);
  background: rgba(168, 31, 59, 0.14);
}

.chip.fav {
  color: var(--gold);
  background: rgba(124, 93, 19, 0.16);
}

/* ---------------- lemmikute ruudustik ---------------- */

.fav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.fav-tile {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0;
  box-shadow: var(--shadow-card);
}

.fav-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fav-tile .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px;
  background: linear-gradient(0deg, rgba(11, 11, 15, 0.86), transparent);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  color: #fff;
}

/* ---------------- karbi-eelvaate raam ---------------- */

.phone-frame {
  width: min(220px, 58vw);
  aspect-ratio: 163 / 244;
  margin: 4px auto 14px;
  border-radius: 24px;
  padding: 10px;
  background: linear-gradient(160deg, #ffffff 0%, #f2eadc 100%); /* disainilõuendi karbikaardi gradient */
  box-shadow: var(--shadow-lift);
}

.phone-frame .screen {
  width: 100%;
  height: 100%;
  border-radius: 15px;
  overflow: hidden;
  background: #0b0b0f;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-frame .screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Vaikimisi (enne eelvaate laadimist) näidatakse .screen sees otse bränimärki
   (icon("brand", N)) - see on <span>, mitte <img>, seega ülaltoodud
   ".screen img{width:100%;height:100%;object-fit:cover}" reegel ei puuduta
   seda ja proportsioon ei lähe kunagi katki. */

/* ---------------- lightbox ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.88);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(20px, var(--safe-t)) max(20px, var(--safe-r)) max(20px, var(--safe-b)) max(20px, var(--safe-l));
}

.lightbox img {
  max-width: min(360px, 90vw);
  width: 100%;
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
}

.lightbox .cap {
  color: #fff9f0;
  text-align: center;
  margin-top: 16px;
  max-width: 360px;
}

.lightbox .cap p {
  color: rgba(255, 249, 240, 0.78);
}

.lightbox .close {
  position: absolute;
  top: calc(var(--safe-t) + 12px);
  right: calc(var(--safe-r) + 12px);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

/* ---------------- QR / kutse ---------------- */

.qr-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  width: min(220px, 60vw);
  aspect-ratio: 1;
  margin: 6px auto 14px;
  box-shadow: var(--shadow-card);
}

.qr-box img {
  width: 100%;
  height: 100%;
}

.invite-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--input-bg);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.invite-link code {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.86rem;
  color: var(--ink-dim);
}

/* ---------------- pereliikmete read ---------------- */

.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.member-row:last-child {
  border-bottom: none;
}

.member-row .name {
  font-weight: 700;
  color: var(--ink);
}

.member-row .role {
  color: var(--ink-faint);
  font-weight: 600;
  font-size: 0.82rem;
}

.member-row .grow {
  flex: 1;
}

/* ---------------- lüliti ---------------- */

.switch {
  position: relative;
  width: 52px;
  min-height: 44px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1.5px solid var(--line-strong);
  flex: none;
  padding: 0;
}

.switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: transform 0.15s ease, background 0.15s ease;
}

.switch.on {
  background: var(--accent-tint);
  border-color: var(--accent);
}

.switch.on::after {
  transform: translateY(-50%) translateX(20px);
  background: var(--accent);
}

.switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .switch::after {
    transition: none;
  }
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  min-height: 44px;
}

.row-between:last-child {
  border-bottom: none;
}

.row-between .label {
  font-weight: 700;
  color: var(--ink);
}

.row-between .desc {
  color: var(--ink-faint);
  font-weight: 600;
  font-size: 0.82rem;
  margin-top: 2px;
}

.notice {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-deep);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink-dim);
  margin-bottom: 16px;
}

.notice.warn {
  border-left-color: var(--amber);
}

.notice.success {
  border-left-color: var(--success);
}

.notice ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.notice li {
  margin-bottom: 4px;
}

/* ---------------- konto-tegevused (seaded) ---------------- */

.account-explain {
  margin-top: 12px;
}

/* ---------------- sakiriba ---------------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  background: rgba(255, 252, 246, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-top: 8px;
  padding-bottom: var(--safe-b);
  max-width: 480px;
  margin: 0 auto;
}

.tabbar[hidden] {
  display: none;
}

.tabbar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  background: transparent;
  border: 0;
  color: var(--ink-dim);
  min-height: calc(var(--tabbar-h) - 8px);
  padding: 6px 2px;
  font-weight: 700;
  font-size: 0.656rem;
}

.tabbar .tab svg {
  width: 22px;
  height: 22px;
}

.tabbar .tab.active {
  color: var(--accent-deep);
}

.tabbar .tab.active span {
  font-weight: 800;
}

.tabbar .tab .dot-badge {
  position: absolute;
  transform: translate(10px, -10px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--card);
}

/* ---------------- teatised ---------------- */

.toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: #fff9f0;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--shadow-lift);
  max-width: 420px;
  animation: toast-in 0.18s ease both;
}

.toast.error {
  background: var(--accent-deep);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}

/* ---------------- võrguühenduse riba ---------------- */

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: var(--amber);
  color: #fff9f0;
  text-align: center;
  font-weight: 700;
  font-size: 0.86rem;
  padding: calc(var(--safe-t) + 9px) 14px 9px;
}

.offline-banner[hidden] {
  display: none;
}

/* ---------------- muu ---------------- */

.center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(43, 32, 24, 0.15);
  border-top-color: var(--accent-deep);
  animation: spin 0.7s linear infinite;
  flex: none;
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: spin 1.4s linear infinite;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--input-bg) 25%, var(--card) 37%, var(--input-bg) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mock-badge {
  position: fixed;
  top: calc(var(--safe-t) + 8px);
  right: calc(var(--safe-r) + 8px);
  z-index: 90;
  background: var(--gold);
  color: #fff9f0;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  pointer-events: none;
}

.lang-toggle {
  display: flex;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  width: fit-content;
}

.lang-toggle button {
  background: transparent;
  border: 0;
  padding: 9px 16px;
  font-weight: 800;
  color: var(--ink-dim);
  min-height: 44px;
}

.lang-toggle button.active {
  background: var(--accent);
  color: #fff;
}

@media (min-width: 481px) {
  body {
    background: radial-gradient(ellipse at top, #fffcf6 0%, var(--paper) 60%);
  }
}
