:root {
  --bg: #f6f5f2; --card: rgba(255,255,255,.75); --text: #1c1917; --muted: #78716c;
  --border: rgba(28,25,23,.08); --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --blob1: #99f6e4; --blob2: #fde68a; --blob3: #bfdbfe;
  --brand: #0f766e; --input: rgba(255,255,255,.9);
  --ok-bg: #ccfbf1; --ok-text: #115e59; --err-bg: #fee2e2; --err-text: #991b1b;
  --warn-bg: #fef3c7; --warn-text: #92400e; --warn-border: #fcd34d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12100e; --card: rgba(41,37,36,.7); --text: #f5f5f4; --muted: #a8a29e;
    --border: rgba(255,255,255,.08); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    --blob1: #115e59; --blob2: #78350f; --blob3: #1e3a8a;
    --brand: #2dd4bf; --input: rgba(28,25,23,.8);
    --ok-bg: #134e4a; --ok-text: #99f6e4; --err-bg: #450a0a; --err-text: #fecaca;
    --warn-bg: #422d10; --warn-text: #fde68a; --warn-border: #946519;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 32px 16px 20px;
  background: var(--bg); color: var(--text); overflow-x: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased;
}
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: .92em; }

/* Taustal hõljuvad värvilaigud */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg span { position: absolute; width: 50vmax; height: 50vmax; border-radius: 50%; filter: blur(80px); opacity: .55;
           animation: float 22s ease-in-out infinite alternate; }
.bg span:nth-child(1) { background: var(--blob1); top: -15vmax; left: -10vmax; }
.bg span:nth-child(2) { background: var(--blob2); bottom: -20vmax; right: -10vmax; animation-delay: -7s; }
.bg span:nth-child(3) { background: var(--blob3); top: 30%; left: 40%; width: 35vmax; height: 35vmax; animation-delay: -14s; opacity: .35; }
@keyframes float { to { transform: translate(6vmax, 4vmax) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .bg span { animation: none; } }

main { width: 100%; max-width: 440px; margin: auto 0; }

.title-en { font-weight: 500; opacity: .75; }

/* Keelevalik (lipud) avalike lehtede paremas ülanurgas */
body:has(> .lang-switch) { padding-top: 56px; }
.lang-switch { position: absolute; top: 10px; right: 16px; display: flex; gap: .4rem; }
.lang-switch a { display: grid; place-items: center; padding: 5px 7px; border: 1px solid var(--border); border-radius: 10px;
                 background: var(--card); box-shadow: var(--shadow); opacity: .6; transition: opacity .15s, border-color .15s, transform .15s; }
.lang-switch a svg { display: block; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.lang-switch a:hover { opacity: 1; transform: translateY(-1px); }
.lang-switch a:focus-visible { opacity: 1; outline: 2px solid var(--brand); outline-offset: 2px; }
.lang-switch a[aria-current="true"] { opacity: 1; border-color: var(--brand); box-shadow: var(--shadow), 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
main.narrow { max-width: 380px; }
main.wide { max-width: 760px; margin: 0; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
        backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* Avaleht */
header { text-align: center; margin-bottom: 2rem; display: flex; flex-direction: column; align-items: center; }
/* Perepilt ümmarguses raamis, gradient-rõngaga */
.photo { position: relative; flex: none; width: min(520px, 90vw); aspect-ratio: 1; margin: 0 0 1.5rem; padding: 8px; border-radius: 50%;
         background: conic-gradient(from 200deg, #2dd4bf, #60a5fa, #f59e0b, #f97316, #2dd4bf);
         box-shadow: 0 20px 50px rgba(0,0,0,.22); }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%;
             border-radius: 50%; border: 6px solid var(--bg); }
.photo::after { content: "🏡"; position: absolute; right: 9%; bottom: 7%; width: clamp(48px, 13vw, 68px); height: clamp(48px, 13vw, 68px);
                display: grid; place-items: center; font-size: clamp(24px, 6.5vw, 34px); border-radius: 50%;
                background: var(--bg); box-shadow: var(--shadow); }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
header p { margin: .35rem 0 0; color: var(--muted); font-size: .95rem; }
/* Sotsiaalmeedia lingid avalehe päises */
header .social-links { display: flex; justify-content: center; gap: .6rem; margin-top: .9rem; }
.social-links a { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 50%;
                  background: var(--card); box-shadow: var(--shadow); color: var(--muted); transition: color .15s, border-color .15s, transform .15s; }
.social-links a:hover, .social-links a:focus-visible { color: var(--brand-color); border-color: var(--brand-color); transform: translateY(-2px); outline: none; }
.social-links a:focus-visible { box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--brand-color) 25%, transparent); }

ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
a.app {
  --accent: hsl(var(--hue) 70% 38%); --tint: hsl(var(--hue) 80% 90%);
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: inherit; text-decoration: none; transition: transform .2s, border-color .2s, box-shadow .2s;
}
@media (prefers-color-scheme: dark) {
  a.app { --accent: hsl(var(--hue) 75% 65%); --tint: hsl(var(--hue) 50% 20%); }
}
a.app:hover, a.app:focus-visible { transform: translateY(-2px); border-color: var(--accent); outline: none;
  box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.icon { flex: none; width: 48px; height: 48px; display: grid; place-items: center; font-size: 24px;
        background: var(--tint); border-radius: 12px; }
.text { flex: 1; min-width: 0; }
.text strong { display: block; font-size: 1.05rem; color: var(--accent); }
.text small { display: block; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.arrow { flex: none; color: var(--muted); transition: transform .2s, color .2s; }
a.app:hover .arrow, a.app:focus-visible .arrow { transform: translateX(3px); color: var(--accent); }

footer { width: 100%; margin-top: 2.5rem; text-align: center; color: var(--muted); font-size: .8rem; }
footer p { margin: .75rem 0 0; }
footer .login-link { color: var(--muted); text-decoration: none; }
footer .login-link:hover, footer .login-link:focus-visible { color: var(--brand); text-decoration: underline; }

/* Ümarad nupud: kontakt, uuendused, väljalogimine */
.pill { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .9rem; font: inherit; font-size: .9rem;
        color: var(--text); text-decoration: none; background: var(--card); border: 1px solid var(--border);
        border-radius: 999px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); cursor: pointer;
        transition: border-color .2s, color .2s; }
.pill:hover, .pill:focus-visible { border-color: var(--brand); color: var(--brand); outline: none; }
.pill[hidden] { display: none; }
.pill.deploy-latest { background: #0f766e; border-color: #0f766e; color: #fff; font-weight: 600; }
.pill.deploy-latest:hover, .pill.deploy-latest:focus-visible { background: #115e59; border-color: #115e59; color: #fff; }
.pill.deploy-previous { background: #4f46e5; border-color: #4f46e5; color: #fff; font-weight: 600; }
.pill.deploy-previous:hover, .pill.deploy-previous:focus-visible { background: #4338ca; border-color: #4338ca; color: #fff; }
.pill.deploy-latest:disabled, .pill.deploy-previous:disabled { color: #fff; }

/* Sisseloginud kasutaja nupud avalehe ülaservas */
.userbar { width: 100%; max-width: 760px; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.userbar form { margin: 0; }
.userbar .who { display: inline-flex; align-items: center; gap: .5rem; max-width: 100%; margin-right: auto; padding: .55rem .75rem; border: 1px solid var(--brand); border-radius: 12px; background: var(--ok-bg); color: var(--ok-text); font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
.userbar .who svg { flex: none; }
@media (max-width: 480px) { .userbar .who { flex-basis: 100%; margin-right: 0; } }

/* Alamlehed */
.back { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem .85rem; border: 1px solid var(--brand); border-radius: 10px; background: var(--card); color: var(--brand); text-decoration: none; font-size: .9rem; font-weight: 600; margin-bottom: 1rem; box-shadow: 0 2px 6px rgba(0,0,0,.05); transition: background .15s, border-color .15s; }
.back:hover { color: var(--ok-text); background: var(--ok-bg); }
.back:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.page-title { font-size: 1.9rem; }
.subtitle { color: var(--muted); margin: .4rem 0 2rem; }

/* Sisselogimise vorm */
.form-card { padding: 1.75rem 1.5rem; }
.form-card a:not(.pill), .form-card a:not(.pill):visited { color: var(--brand); font-weight: 600; text-underline-offset: .2em; }
.form-card a:not(.pill):hover, .form-card a:not(.pill):focus-visible { text-decoration-thickness: 2px; }
.security-event { border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 10px; padding: 16px; margin: 12px 0; color: var(--text); overflow-wrap: anywhere; }
.security-event h2 { margin: 6px 0 12px; font-size: 1.05rem; color: var(--brand); }
.security-event p { margin: 6px 0; }
.form-card h1 { font-size: 1.5rem; margin-bottom: 1.25rem; }
form { display: grid; gap: 1rem; }
label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 600; }
input { font: inherit; font-weight: 400; padding: .7rem .85rem; border-radius: 10px; border: 1px solid var(--border);
        background: var(--input); color: var(--text); }
input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
button[type="submit"]:not(.pill) { font: inherit; font-weight: 600; padding: .75rem; border: 0; border-radius: 10px;
                        background: var(--brand); color: var(--bg); cursor: pointer; margin-top: .25rem; }
button[type="submit"]:not(.pill):hover { filter: brightness(1.08); }
.notice { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 10px; font-size: .9rem; line-height: 1.45;
          background: var(--ok-bg); color: var(--ok-text); }
.notice.error { background: var(--err-bg); color: var(--err-text); }

/* Muudatuste ajalugu */
.day { margin-bottom: 1.75rem; }
.day h2 { font-size: .9rem; font-weight: 600; color: var(--muted); margin: 0 0 .6rem; font-variant-numeric: tabular-nums; }
.changes { padding: 0; overflow: hidden; }
.change { padding: 1rem 1.25rem; }
.change + .change { border-top: 1px solid var(--border); }
.change h3 { display: inline; font-size: 1rem; font-weight: 600; margin: 0; line-height: 1.4; }
.change summary { cursor: pointer; list-style: none; }
.change summary::-webkit-details-marker { display: none; }
.change .more { margin-left: .5rem; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.change .more::before { content: none; }
.change details[open] .more { display: none; }
.change summary:hover h3, .change summary:focus-visible h3 { color: var(--brand); }
.change summary:focus-visible { outline: none; }
.meta { display: block; margin-top: .35rem; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; margin-left: .35rem; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem;
         background: var(--ok-bg); color: var(--ok-text); }
.body { margin-top: .6rem; color: var(--muted); line-height: 1.6; }
.empty { margin: 0; padding: 1.25rem; color: var(--muted); }

/* Rakenduste haldus */
.connected { display: flex; align-items: center; gap: .5rem; margin: -1rem 0 1.5rem; color: var(--muted); font-size: .9rem; }
.connected img { border-radius: 50%; }
.connected a, .admin-app a { color: inherit; }
.setup { padding: 1.25rem 1.5rem; line-height: 1.55; }
.setup h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.setup ol { padding-left: 1.25rem; margin: .75rem 0 0; display: grid; gap: .5rem; }
.setup a { color: var(--brand); }
.admin-list { display: grid; gap: 1rem; }
.admin-app { --accent: hsl(var(--hue) 70% 38%); --tint: hsl(var(--hue) 80% 90%); padding: 0; }
.app-summary { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.15rem; border-radius: 15px; list-style: none; cursor: pointer; transition: background .15s; }
.app-summary::-webkit-details-marker { display: none; }
.app-summary:hover { background: var(--tint); }
.app-summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.app-heading { flex: 1; min-width: 0; display: grid; gap: .2rem; overflow-wrap: anywhere; }
.app-title { color: var(--accent); font-size: 1.1rem; font-weight: 700; }
.app-description { color: var(--muted); font-size: .85rem; line-height: 1.45; }
.app-header-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; max-width: 45%; }
.app-panel[open] > .app-summary { border-radius: 15px 15px 0 0; background: var(--tint); }
.app-panel[open] > .app-summary [data-health-app] { display: none; }
.app-panel[open] > .app-summary .app-disclosure svg { transform: rotate(90deg); }
.app-panel-body { padding: 0 1.15rem 1.15rem; border-top: 1px solid var(--border); }
.app-links { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .8rem; margin: .85rem 0 0; }
.app-links a:hover { text-decoration: none; }
.version-badge.is-error { color: var(--err-text); background: var(--err-bg); }
.version-badge.is-running { color: var(--ok-text); background: var(--ok-bg); }
@media (max-width: 540px) {
  .app-summary { flex-wrap: wrap; gap: .65rem; padding: .9rem; }
  .app-summary .app-heading { flex-basis: calc(100% - 110px); }
  .app-header-badges { order: 4; flex-basis: 100%; max-width: 100%; justify-content: flex-start; }
  .app-panel-body { padding: 0 .9rem .9rem; }
}
@media (prefers-color-scheme: dark) { .admin-app { --accent: hsl(var(--hue) 75% 65%); --tint: hsl(var(--hue) 50% 20%); } }
.admin-head { display: flex; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; }
.admin-head .text { flex: 1; min-width: 140px; }
.admin-head h2 { margin: 0; font-size: 1.1rem; }
.admin-head h2 a { color: var(--accent); text-decoration: none; }
.admin-head h2 a:hover { text-decoration: underline; }
.admin-head small { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.admin-head small a { color: var(--muted); }
.version { display: grid; justify-items: start; gap: .35rem; margin-top: 1rem; padding: .9rem 1rem; border-radius: 12px; background: var(--card); border: 1px solid var(--border); }
.version-badge { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; padding: .3rem .65rem; border: 1px solid transparent; border-radius: 999px; font-size: .75rem; font-weight: 650; line-height: 1.3; }
.version-badge.is-current, .version-badge.is-old { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.version-badge.is-latest { background: var(--ok-bg); color: var(--ok-text); }
.version .version-badge { margin-bottom: .2rem; }
.version-update { margin: .75rem 0 0; padding: .7rem .85rem; border: 1px solid var(--warn-border); border-radius: 10px; background: var(--warn-bg); color: var(--warn-text); font-size: .85rem; line-height: 1.5; overflow-wrap: anywhere; }
.version-title { font-weight: 600; }
.version .meta { margin-top: 0; }
.state { margin: .75rem 0 0; font-size: .9rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.state a { color: inherit; }
.state.failed { color: var(--err-text); }
.state.running { color: var(--brand); }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }
.admin-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.admin-actions form, .versions form { display: block; margin: 0; }
.pill:disabled { opacity: .5; cursor: not-allowed; }
.pill:disabled:hover { border-color: var(--border); color: var(--text); }
.pill.deploy-latest:disabled:hover { background: #0f766e; border-color: #0f766e; color: #fff; }
.pill.deploy-previous:disabled:hover { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.pill.deploy-latest:focus-visible, .pill.deploy-previous:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.pill.small { padding: .3rem .75rem; font-size: .85rem; }
.versions { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .75rem; }
.versions summary { display: flex; align-items: center; gap: .65rem; cursor: pointer; color: var(--text); font-size: .95rem; font-weight: 600; list-style: none; padding: .25rem 0; }
.versions summary::-webkit-details-marker { display: none; }
.disclosure-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--border); border-radius: 9px; background: var(--card); color: var(--brand); }
.disclosure-icon svg { transition: transform .18s ease; }
.versions[open] .disclosure-icon svg { transform: rotate(90deg); }
.versions summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 6px; }
.versions summary:hover { color: var(--brand); }
.versions ul { gap: 0; margin-top: .5rem; }
.versions li { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; }
.versions li + li { border-top: 1px solid var(--border); }
.versions li .text { display: grid; gap: .1rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.versions .meta { margin-top: 0; }
.too-old { flex: none; color: var(--muted); font-size: .8rem; }
.versions .version-badge, .versions form { flex: none; }
@media (max-width: 480px) {
  .versions li { flex-wrap: wrap; }
  .versions li .text { flex-basis: 100%; }
  .admin-actions .pill { font-size: .85rem; }
}

/* Halduslehe kaart avalehel */
li.admin-link { margin-top: .5rem; padding-top: .75rem; border-top: 1px dashed var(--border); }

/* Tervisekontroll ja kaitstud logivaade */
.app-health { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.health-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--border); color: var(--muted); }
.health-badge::before { content: ''; width: .45rem; height: .45rem; background: currentColor; border-radius: 50%; }
.health-badge[data-health-state="ok"] { background: #166534; color: #fff; border: 1px solid #14532d; box-shadow: 0 2px 5px rgba(0,0,0,.15); font-weight: 700; }
.health-badge[data-health-state="ok"]::before { content: '✓'; width: auto; height: auto; background: none; font-weight: 800; }
.health-badge[data-health-state="error"] { background: #b91c1c; color: #fff; border: 1px solid #991b1b; }
.health-info { color: var(--muted); font-size: .8rem; }
.admin-page > .page-title { margin-bottom: .8rem; }
.admin-page .connected { margin: .65rem 0 1rem; }
.pill.health-link { padding: .3rem .65rem; font-size: .8rem; }
.install-actions { margin-bottom: 1rem; }
.backup-list { display: grid; gap: .75rem; margin-top: 1.25rem; }
.backup-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.backup-row strong { overflow-wrap: anywhere; }
.backup-row .pill { flex: none; }
.restore-confirm, .restore-job { margin: 1rem 0; }
.restore-confirm { padding: 1.25rem; }
.restore-scope { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin: 1rem 0; }
.restore-scope label { flex: 1; min-width: 180px; }
.restore-scope select { display: block; width: 100%; padding: .65rem; background: var(--input); color: var(--text); border: 1px solid var(--border); border-radius: 9px; font: inherit; margin-top: .4rem; }
.restore-scope .pill { width: auto; }
.backup-row > div { min-width: 0; }
.backup-row .state-label { margin-top: .3rem; }
.restore-form { display: grid; gap: .8rem; justify-items: start; }
.restore-form input { display: block; margin-top: .4rem; }
.pill.restore-danger { background: #b91c1c; border-color: #991b1b; color: #fff; }
.pill.restore-danger:hover { background: #991b1b; color: #fff; }
@media (max-width: 600px) { .backup-row { align-items: start; flex-direction: column; } }
.pill.install-button { color: #fff; background: #0f766e; border-color: #0f766e; font-weight: 600; }
.pill.install-button:hover, .pill.install-button:focus-visible { color: #fff; background: #115e59; border-color: #115e59; }
.install-status { font-size: .85rem; color: var(--muted); }
.install-status:empty { display: none; }
.install-help { width: min(440px, calc(100% - 32px)); padding: 1.5rem; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); color: var(--text); box-shadow: var(--shadow); }
.install-help::backdrop { background: rgba(0,0,0,.5); }
.install-help h2 { margin: 0 0 1rem; font-size: 1.25rem; }
.install-help p { line-height: 1.6; font-size: .9rem; }
.install-help form { margin: 1rem 0 0; justify-items: end; }
@media (display-mode: standalone) { .install-actions { display: none; } }
.health-refresh { border: 1px solid var(--border); background: var(--card); color: var(--brand); border-radius: 8px; cursor: pointer; font-size: 1.25rem; line-height: 1; padding: .25rem .4rem; transition: background .15s, color .15s, border-color .15s, transform .15s; }
.health-refresh:hover:not(:disabled) { background: var(--brand); color: var(--bg); border-color: var(--brand); transform: translateY(-1px); }
.health-refresh:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.health-refresh:disabled { opacity: .6; cursor: wait; }
.log-tools { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; margin: 1.25rem 0; }
.log-tools label { flex: 1; min-width: 140px; }
.log-tools select { width: 100%; padding: .6rem; background: var(--input); color: var(--text); border: 1px solid var(--border); border-radius: 9px; font: inherit; }
.log-output { margin: 1rem 0; background: #1c1917; color: #e7e5e4; border: 1px solid var(--border); padding: 1rem; border-radius: 12px; max-height: 65vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; line-height: 1.55; }
.log-sources { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.log-sources .pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.log-sources .selected { border-color: var(--brand); color: var(--brand); }
.log-files { margin-top: 1rem; padding: .9rem 1.25rem; }
.log-files > summary { cursor: pointer; font-weight: 600; overflow-wrap: anywhere; }
.log-files > summary:hover { color: var(--brand); }
.log-files-current { font-weight: 400; color: var(--muted); }
.log-files .log-sources { margin-bottom: .25rem; }
.restore-history { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.restore-history h3 { font-size: 1rem; margin: 0 0 .8rem; }
.restore-record { padding: .8rem 0; border-bottom: 1px solid var(--border); }
.restore-record p { margin: .4rem 0; }
.restore-record time { margin-left: .5rem; }
.restore-filename { overflow-wrap: anywhere; font-size: .85rem; }
.restore-events { margin: 1rem 0; }
.restore-events summary { cursor: pointer; font-weight: 600; }
.restore-events ol { padding-left: 1.4rem; }
.restore-events li { margin: .6rem 0; overflow-wrap: anywhere; }
.restore-events time { display: block; font-size: .8rem; }
.backup-create { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.25rem 0; padding: 1rem 1.1rem; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.backup-create h2 { margin: 0 0 .25rem; font-size: 1rem; }
.backup-create p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.backup-create form { display: flex; flex: none; width: auto; margin: 0; }
.backup-create form { align-items: end; gap: .75rem; flex-wrap: wrap; max-width: 100%; }
.backup-create-text { min-width: 0; }
.backup-create .backup-kind { display: grid; gap: .35rem; margin: 0; font-size: .85rem; }
.backup-kind select { min-width: 180px; padding: .6rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--card); color: inherit; }
.backup-create form > .meta { align-self: center; }
.pill.backup-create-button { flex: none; width: auto; white-space: nowrap; background: #0f766e; border-color: #0f766e; color: #fff; font-weight: 600; padding: .55rem .85rem; }
.pill.backup-create-button:hover:not(:disabled), .pill.backup-create-button:focus-visible { background: #115e59; border-color: #115e59; color: #fff; }
.backup-create-button span { font-size: 1.2rem; line-height: 1; }
.log-tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin: 1.25rem 0; }
.log-tab { color: var(--muted); text-decoration: none; padding: .75rem .85rem; border-bottom: 3px solid transparent; font-size: .9rem; font-weight: 600; text-align: center; }
.log-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.log-tab:hover { color: var(--brand); background: var(--card); }
.log-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
@media (max-width: 480px) { .backup-create { align-items: flex-start; flex-wrap: wrap; } .log-tab { flex: 1; padding: .65rem .4rem; font-size: .85rem; } }
@media (prefers-reduced-motion: reduce) { .disclosure-icon svg, .health-refresh { transition: none; } .health-refresh:hover:not(:disabled) { transform: none; } }

/* Kasutajate haldus */
.users-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.users-layout .form-card { margin: 0; }
.users-list { display: grid; gap: 16px; }
.users-list > .card { padding: 1.25rem; }
.users-list h2 { margin-top: 0; }
.users-page > p { margin-bottom: 1.5rem; }
.users-list h2, .users-list p { overflow-wrap: anywhere; }
.users-page .user-check { display: flex; align-items: start; gap: 10px; }
.users-page .user-check input { width: auto; margin: 4px 0 0; flex-shrink: 0; }
@media (max-width: 720px) { .users-layout { grid-template-columns: 1fr; } }

/* Ühine olekukaart ja konto vabatahtlik lisakaitse. */
.overview { margin-bottom: 1.75rem; overflow: hidden; }
.overview-heading { display: flex; align-items: center; gap: .75rem; padding: 1.15rem; cursor: pointer; list-style: none; }
.overview-heading::-webkit-details-marker { display: none; }
.overview-heading:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; }
.overview-heading-text { flex: 1; min-width: 0; }
.overview-heading-text .meta { display: block; margin-top: .3rem; }
.overview-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--ok-bg); color: var(--ok-text); }
.overview a, .overview a:visited { color: var(--brand); }
.overview a:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.overview-heading .pill { flex: none; }
.overview-panel[open] .overview-disclosure svg { transform: rotate(90deg); }
.overview-body { padding: 0 1.15rem 1.15rem; border-top: 1px solid var(--border); }
.overview-heading h2 { margin: 0; }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.overview-app { border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem; min-width: 0; }
.overview-app h3 { margin: 0 0 .75rem; }
.overview-app dl { margin: 0 0 1rem; display: grid; gap: .85rem; }
.overview-app dt { font-size: .8rem; color: var(--muted); margin-bottom: .25rem; }
.overview-app dd { margin: 0; line-height: 1.7; overflow-wrap: anywhere; }
.overview-app small { display: block; color: var(--muted); }
.overview-alerts { border: 1px solid var(--border); border-radius: 12px; padding: 1rem; margin-top: 1rem; }
.overview-alerts h3 { margin: 0; font-size: 1rem; }
.overview-alerts ul { display: block; padding-left: 1.25rem; }
.overview-alerts li { display: list-item; margin: .65rem 0; padding: 0; }
.state-label { display: inline-block; border-radius: 999px; padding: .15rem .6rem; font-size: .8rem; font-weight: 600; vertical-align: middle; }
.state-ok { color: #064e3b; background: #a7f3d0; }
.state-error { color: #7f1d1d; background: #fecaca; }
.state-neutral { color: #713f12; background: #fef08a; }
.mfa-card, .recovery-card { margin-top: 1.5rem; }
.mfa-card h2 { line-height: 1.7; }
.mfa-card p, .mfa-card li { line-height: 1.6; }
.mfa-card ol { padding-left: 1.4rem; }
#mfa-qr { width: min(100%, 260px); margin: 1rem 0; background: white; }
#mfa-qr svg { display: block; width: 100%; height: auto; }
.recovery-card { padding: 1.5rem; border: 2px solid #0f766e; }
.recovery-card pre { font-size: 1rem; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.mfa-card .mfa-danger { background: #b91c1c; color: white; }
.mfa-card button { border: 0; border-radius: 8px; padding: .7rem 1rem; background: #0f766e; color: white; cursor: pointer; font: inherit; margin: .3rem 0; }
@media (max-width: 650px) { .overview-grid { grid-template-columns: minmax(0, 1fr); } .overview-heading { padding: 1rem; gap: .5rem; flex-wrap: wrap; } .overview-heading h2 { font-size: 1.1rem; } .overview-icon { width: 36px; height: 36px; } .overview-heading-text { flex-basis: calc(100% - 48px); } .overview-refresh { margin-left: 44px; } .overview-disclosure { margin-left: auto; } .overview-body { padding: 0 1rem 1rem; } }

/* OneDrive backup setup and status. */
.od-card { margin-top: 1rem; backdrop-filter: none; -webkit-backdrop-filter: none; }
.restore-comparison { overflow-x: auto; margin: 1rem 0; }
.restore-comparison table { width: 100%; border-collapse: collapse; text-align: left; }
.restore-comparison th, .restore-comparison td { padding: .65rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.od-card a, .od-card a:visited { color: var(--brand); }
.od-card code, .od-command { overflow-wrap: anywhere; white-space: pre-wrap; }
.od-form { display: grid; gap: .75rem; margin: 1rem 0; }
.od-form label { display: grid; gap: .35rem; }
.od-form input { width: 100%; min-width: 0; background: var(--input); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: .65rem; font: inherit; }
.od-form .pill { justify-self: start; }
.od-card form + form { margin-top: 1rem; }

.od-card .od-confirm { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; }
.od-card .od-confirm input { width: auto; flex: none; margin: .3rem 0 0; }

.od-recovery summary { display: flex; align-items: center; gap: .65rem; cursor: pointer; list-style: none; padding: .25rem 0; font-weight: 600; }
.od-recovery summary::-webkit-details-marker { display: none; }
.od-recovery summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 6px; }
.od-recovery summary:hover { color: var(--brand); }
.od-recovery[open] > summary .disclosure-icon svg { transform: rotate(90deg); }

/* Avalikud rakenduste tutvustused */
.app-intro { margin-top: 1.5rem; padding: 1.25rem; }
.app-intro h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; }
.app-intro .intro-lead { margin: .45rem 0 1.25rem; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.intro-item + .intro-item { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.intro-item h3 { margin: 0; font-size: 1rem; }
.intro-item h3 span { margin-right: .3rem; }
.intro-item p { margin: .4rem 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.description-link { display: inline-block; padding: .35rem 0; color: var(--brand); font-size: .9rem; font-weight: 600; text-underline-offset: .2em; }
.description-link:hover { text-decoration-thickness: 2px; }
.description-link:focus-visible, .description-contents a:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 2px; }
.demo-access { margin-top: 1.25rem; padding: 1rem; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--brand) 6%, var(--card)); }
.demo-access h3 { margin: 0; font-size: .95rem; }
.demo-access p { margin: .4rem 0 .75rem; font-size: .85rem; line-height: 1.5; color: var(--muted); }
.demo-access dl { display: grid; gap: .55rem; margin: 0; }
.demo-access dl div { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: .5rem; font-size: .85rem; }
.demo-access dt { color: var(--muted); }
.demo-access dd { margin: 0; min-width: 0; }
.demo-access code { overflow-wrap: anywhere; user-select: all; }
.app-guide { line-height: 1.65; }
.description-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1.75rem; }
.description-tabs [aria-current="page"] { background: var(--ok-bg); border-color: var(--brand); color: var(--ok-text); font-weight: 600; }
.description-header { margin-bottom: 1.75rem; }
.description-icon { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: .75rem; font-size: 34px; border: 1px solid var(--border); border-radius: 18px; background: color-mix(in srgb, hsl(var(--hue) 70% 50%) 12%, var(--card)); }
.description-header h1 { margin: 0; }
.description-header p { max-width: 62ch; margin: .75rem 0 1rem; font-size: 1rem; line-height: 1.75; }
.description-open { font-weight: 600; color: var(--brand); }
.description-contents { padding: 1.25rem; margin-bottom: 1rem; }
.description-contents h2 { margin: 0 0 .65rem; font-size: .95rem; }
.description-contents ul { display: grid; gap: .4rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.description-contents a { color: var(--brand); font-size: .9rem; text-underline-offset: .2em; }
.description-sections { display: grid; gap: 1rem; }
.description-section { padding: 1.5rem; scroll-margin-top: 1.5rem; }
.description-section h2 { margin: 0 0 .75rem; font-size: 1.15rem; letter-spacing: -.015em; line-height: 1.4; }
.description-section p { margin: .65rem 0 0; font-size: .95rem; }
.description-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-top: 1.25rem; }
.description-bottom .back { margin-bottom: 0; }
.app-guide > .demo-access { margin-top: 1rem; background: var(--card); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 480px) {
  .description-contents ul { grid-template-columns: 1fr; }
  .description-section { padding: 1.15rem; }
  .app-intro { padding: 1.1rem; }
  .description-tabs .pill { padding-inline: .75rem; }
}

/* Avalehel on tutvustus ja demokonto kohe perepildi kõrval. */
main.home-layout {
  max-width: 1080px; margin: auto 0; display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 480px);
  grid-template-areas: "brand intro" "links intro";
  gap: 1.5rem 3rem; justify-content: center; align-items: start;
}
.home-layout > header { grid-area: brand; margin: 0; }
.home-layout .photo { width: min(100%, 300px); margin-bottom: 1rem; }
.home-layout > .home-app-links { grid-area: links; }
.home-layout > .app-intro { grid-area: intro; margin: 0; }
.home-layout .demo-access { margin: 0 0 1.25rem; }
@media (max-width: 760px) {
  main.home-layout {
    max-width: 480px; margin: 0; grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "brand" "intro" "links"; gap: 1.25rem;
  }
  .home-layout > header {
    display: grid; grid-template-columns: 88px minmax(0, 1fr);
    grid-template-rows: auto auto; column-gap: 1rem; text-align: left;
    align-items: end;
  }
  .home-layout .photo { grid-row: 1 / 3; width: 88px; padding: 3px; margin: 0; }
  .home-layout .photo img { border-width: 3px; }
  .home-layout .photo::after { width: 28px; height: 28px; font-size: 16px; right: 0; bottom: 0; }
  .home-layout header h1 { font-size: 1.6rem; }
  .home-layout header p { align-self: start; }
}

.intro-open { color: inherit; text-decoration: none; }
.intro-open:hover { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
.intro-open:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 2px; }

/* Joonnool: suletult paremale, avatult alla. Natiivne kolmnurk on peidetud. */
summary{list-style:none}summary::-webkit-details-marker{display:none}summary::marker{content:''}
summary:not(:has(svg,.disclosure-icon,.app-disclosure,.disclosure-chevron))::before{content:'';display:inline-block;flex:none;width:7px;height:7px;margin-right:10px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(-45deg);vertical-align:2px}
details[open]>summary:not(:has(svg,.disclosure-icon,.app-disclosure,.disclosure-chevron))::before{transform:rotate(45deg);vertical-align:3px}
.disclosure-chevron{display:inline-block;flex:none;width:7px;height:7px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(-45deg);vertical-align:2px}
details[open]>summary .disclosure-chevron{transform:rotate(45deg)}
