/* Ühtne kujundus kõigile treeninguvaadetele. */
:root {
  --ink: #173b33; --ink-soft: #536b63; --paper: #f3f6f3; --card: #fff;
  --line: #dce6df; --z3: #287c59; --z4: #cb771e;
  --surface-soft: #f4f8f5; --shadow: 0 4px 24px rgba(26,59,45,.045);
}
body { background: radial-gradient(ellipse at 10% 0, #e7f0e8 0, transparent 42rem), var(--paper); }
main { max-width: 880px; padding: 32px 24px 64px; }
h1 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -.015em; line-height: 1.12; }
h2 { font-size: 26px; letter-spacing: -.01em; }
h3 { color: var(--ink); }
.topbar {
  background: rgba(255,255,255,.97); color: var(--ink); padding: 16px max(24px,calc((100vw - 1320px)/2));
  border-bottom: 1px solid var(--line); gap: 24px; align-items: center; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 23px; color: var(--ink); line-height: 1; white-space: nowrap; }
.brand span { color: #ab5c10; }
.brand-symbol { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #fff; background: var(--ink); }
.topbar nav { justify-content: center; gap: 4px; }
.topbar nav a { padding: 9px 12px; color: var(--ink-soft); border-radius: 9px; font-size: 14px; }
.topbar nav a:hover { background: #edf4ef; color: var(--ink); }
.topbar nav a[aria-current=page] { background: #e5f0e8; color: #195c40; font-weight: 600; }
.topbar nav a.nav-create { border: 1px solid var(--line); color: #195c40; }
.topbar-user { gap: 12px; margin-left: auto; min-width: 0; }
.whoami { color: var(--ink); max-width: 160px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.topbar .ghost { color: var(--ink-soft); border-color: var(--line); background: transparent; }
.topbar .ghost:hover { background: #edf4ef; border-color: #b7cfc0; }
.nav-more { position: relative; font-size: 14px; }
.nav-more > summary { cursor: pointer; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font-weight: 500; }
.nav-more[open] > summary { background: #edf4ef; }
.nav-more-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; width: 220px; display: grid; gap: 4px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px #173b3320; }
.nav-more-panel a { text-decoration: none; padding: 9px 10px; border-radius: 8px; }
.nav-more-panel a:hover { background: var(--surface-soft); }
.nav-more-panel form { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.nav-more-panel button { width: 100%; text-align: left; }
.card { border-radius: 20px; padding: 24px; margin: 18px 0; box-shadow: var(--shadow); }
.card > h1 + .muted { margin-top: 12px; }
.card ul { padding-left: 22px; }
.card li + li { margin-top: 6px; }
button, .btn { border-radius: 11px; font-size: 14px; min-height: 42px; transition: background .15s,border-color .15s,box-shadow .15s; }
.primary { background: var(--ink); border-color: var(--ink); box-shadow: 0 2px 6px #173b3312; }
.primary:hover { background: #245749; border-color: #245749; }
.ghost { background: var(--card); border-color: var(--line); }
.ghost:hover { background: #edf4ef; border-color: #b7cfc0; }
.small { min-height: 34px; }
input, select, textarea { color: var(--ink); border-color: var(--line); background: #fff; border-radius: 10px; }
input:not([type=checkbox]):not([type=hidden]), select { min-height: 44px; }
label { font-weight: 600; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #75877e; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 3px solid #cee7d8; border-color: #4d8c6b; outline-offset: 1px; }
.flash { border-radius: 14px; padding: 14px 18px; }
.daynav { align-items: center; gap: 18px; margin-top: 0; margin-bottom: 24px; }
.date-line { font-size: 21px; text-transform: none; }
.daynav .cmp-nav { padding: 9px 12px; }
.phase { margin-top: 4px; font-size: 13px; }
.bib { gap: 18px; }
.bib-info { min-width: 0; }
.bib-wd { min-width: 66px; height: 66px; border-radius: 17px; background: var(--surface-soft); font-size: 40px; border-width: 2px; }
.eyebrow { font-size: 11px; letter-spacing: .09em; margin-bottom: 5px; }
.tag { padding: 3px 9px; background: var(--surface-soft); }
.desc { font-size: 16px; line-height: 1.75; margin-top: 20px; white-space: pre-line; }
.strip { height: 14px; margin: 24px 0 8px; border-radius: 7px; }
.steps { margin-top: 22px; padding-top: 14px; }
.step { padding-block: 8px; line-height: 1.6; }
.notebox { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-top: 24px; }
.notebox label { margin-top: 0; }
.wrow, .lrow { box-shadow: var(--shadow); padding: 16px; border-radius: 14px; }
.wrow:hover, .lrow:hover { box-shadow: 0 5px 18px #173b3312; border-top-color: #c0d2c5; }
.wrow .wtitle, .ltitle { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.wrow.today, .lrow.today { outline-color: #4f8066; }
.calendar { background: var(--card); padding: 14px; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.cal-head, .cal-week { gap: 6px; margin-bottom: 6px; }
.cal-head { margin-bottom: 12px; }
.cal-cell { min-height: 92px; border-radius: 11px; padding: 8px; background: #fff; }
.cal-num { font-size: 18px; }
.cal-title { line-height: 1.35; }
.cal-cell.today { background: #e9f3ec; outline-color: #4f8066; }
.cal-cell.dim { opacity: .55; }
.zt td, .zt th { padding: 12px 16px 12px 0; line-height: 1.6; }
.plan-item, .user-item { padding: 18px; border-radius: 14px; background: #fcfdfb; }
.login-wrap { min-height: 78vh; }
.login-card { max-width: 420px; padding: 36px; border-radius: 24px; box-shadow: 0 18px 70px #173b3310; }
.login-mark { font-size: 38px; letter-spacing: -.02em; color: var(--ink); }
.login-mark span { color: #ab5c10; }
.login-sub { margin-bottom: 28px; }
.login-card .primary { margin-top: 12px; }
.app-footer { max-width: 880px; margin: 0 auto; padding: 0 24px 30px; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--ink-soft); }
.app-footer a { text-underline-offset: 3px; }
.ai-wizard { border-top: 4px solid #467b5b; }
.ai-wizard .eyebrow { display: block; color: #286044; }
.ai-wizard legend { font-size: 23px; letter-spacing: -.02em; margin-bottom: 6px; }
.ai-wizard .actions { border-top: 1px solid var(--line); padding-top: 20px; justify-content: space-between; }
.ai-wizard .actions .primary { margin-left: auto; }
.ai-check { font-weight: 400; line-height: 1.6; }
.ai-weekdays .ai-check { border: 1px solid var(--line); border-radius: 9px; padding: 10px; margin-block: 6px; min-width: 58px; }
.ai-weekdays .ai-check:has(input:checked) { background: #e5f0e8; border-color: #739d80; }
.ai-week > summary { min-height: 52px; }
.ai-day > details { border-left: 3px solid #d7e9dd; padding-left: 12px; font-size: 14px; }
@media (max-width: 1100px) {
  .topbar { gap: 14px; }
  .topbar nav { order: 3; flex-basis: 100%; justify-content: flex-start; }
}
@media (max-width: 620px) {
  main { padding: 24px 14px 44px; }
  .topbar { padding: 14px; gap: 14px 8px; }
  .brand { font-size: 21px; gap: 8px; }
  .brand-symbol { width: 32px; height: 32px; border-radius: 10px; }
  .topbar nav { gap: 4px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .topbar nav a { text-align: center; padding: 8px 6px; font-size: 13px; background: transparent; }
  .topbar-user { gap: 8px; }
  .whoami { max-width: 88px; font-size: 12px; }
  .nav-more > summary { font-size: 12px; padding: 6px 8px; }
  .card { padding: 20px 18px; border-radius: 17px; }
  .daynav { flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
  .daynav-mid { flex-basis: 100%; order: -1; }
  .daynav .cmp-nav { min-height: 38px; font-size: 13px; }
  .bib { align-items: flex-start; gap: 12px; }
  .bib-wd { min-width: 50px; height: 54px; border-radius: 13px; font-size: 32px; }
  .daycard h1 { font-size: 28px; }
  .desc { font-size: 15px; }
  .notebox { padding: 12px; }
  .calendar { padding: 8px; }
  .cal-head, .cal-week { gap: 3px; }
  .cal-cell { min-height: 56px; padding: 4px; border-radius: 7px; }
  .wrow { gap: 8px; padding: 13px 10px; }
  .wrow .wd { flex: 0 0 22px; }
  .wrow .wdate { flex: 0 0 42px; font-size: 12px; }
  .wrow .wtitle, .ltitle { font-size: 14px; }
  .app-footer { padding-inline: 14px; }
  .login-card { padding: 28px 24px; }
  .ex b { white-space: normal; text-align: right; }
  .plan-actions { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { button, .btn { transition: none; } }

.brand .brand-symbol { color: #fff; }
.brand .brand-name { color: var(--ink); }

@media (max-width: 360px) { .topbar-user > .whoami { display: none; } }

/* Suured tekstiga juhtnupud ja Eesti kuupäevavorm. */
button, .btn { min-height: 48px; padding: 12px 20px; border-radius: 13px; font-size: 15px; }
button.small, .btn.small { min-height: 42px; padding: 9px 14px; }
button.primary, .btn.primary { background: #205e4b; border-color: #205e4b; box-shadow: 0 3px 8px #173b3314; }
button.primary:hover, .btn.primary:hover { background: #164b3a; border-color: #164b3a; }
.eedate { display: block; width: 100%; min-width: 0; }
.eedate-control { display: flex; gap: 8px; align-items: center; min-width: 0; }
.eedate .eedate-display { width: 100%; min-width: 0; flex: 1; margin: 0; min-height: 48px; font-size: 16px; }
.eedate .eedate-field { display: inline-flex; flex: none; align-items: center; justify-content: center; min-height: 48px; padding: 10px 14px; background: #edf5ef; border: 1px solid #c8dbcf; color: #20523d; font-size: 14px; white-space: nowrap; }
.eedate .eedate-field:hover { background: #e0ede4; }
.eecal { position: absolute; top: calc(100% + 10px); left: 0; width: min(360px,calc(100vw - 28px)); padding: 14px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 16px 48px #173b3328; background: #fff; z-index: 50; }
.eecal-head { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 4px; margin-bottom: 12px; }
.eecal-title { text-align: center; font-size: 14px; text-transform: capitalize; }
.eecal .eecal-nav { min-height: 42px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; background: #f3f7f4; }
.eecal-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
.eecal-wd { text-align: center; padding: 7px 0; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.eecal .eecal-day { min-width: 0; width: 100%; min-height: 40px; height: auto; padding: 8px 0; border: 1px solid transparent; border-radius: 9px; background: #fff; font: inherit; font-size: 14px; }
.eecal .eecal-day:hover { background: #eaf3ed; }
.eecal .eecal-day.today { border-color: #82aa91; }
.eecal .eecal-day.sel { background: #205e4b; color: #fff; }
.ai-wizard .ai-grid:has(.eedate) { grid-template-columns: minmax(0,1fr); gap: 2px; }
.ai-sport-days { margin: 18px 0; }
.ai-sport-days[hidden] { display: none; }
.ai-sport-days h3 { margin: 0 0 10px; font-family: inherit; font-size: 15px; text-transform: none; letter-spacing: 0; }
.ai-weekdays { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 8px; }
.ai-day-choice { position: relative; margin: 0; }
.ai-day-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ai-day-choice span { display: grid; place-items: center; min-height: 50px; border: 1px solid #cbd9cf; border-radius: 12px; background: #fff; cursor: pointer; font-size: 16px; font-weight: 600; }
.ai-day-choice input:checked + span { color: #fff; background: #205e4b; border-color: #205e4b; box-shadow: 0 3px 8px #173b3312; }
.ai-day-choice input:focus-visible + span { outline: 3px solid var(--z2); outline-offset: 3px; }
.ai-field-title { margin: 20px 0 10px; font-size: 15px; font-weight: 600; }
.ai-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.ai-option { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 14px; margin: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 400; }
.ai-option:has(input:checked) { background: #eaf4ed; border-color: #7a9d86; }
.ai-option input[type=checkbox] { width: 18px; height: 18px; margin: 0; flex: none; accent-color: #205e4b; }
.ai-error:not(:empty) { padding: 14px; background: #fff4eb; border: 1px solid #ead1b9; border-radius: 12px; line-height: 1.6; }
@media (max-width: 480px) {
  .ai-choice-grid { grid-template-columns: minmax(0,1fr); }
  .ai-weekdays { gap: 5px; }
  .ai-day-choice span { min-height: 46px; border-radius: 9px; font-size: 15px; }
  .eedate .eedate-field { font-size: 12px; padding: 10px; }
  .eedate .eedate-display { padding-inline: 8px; }
}

.eecal .eecal-nav { width: auto; height: auto; }

/* 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)}

details.cmp-cell>summary::before{display:none}details.cmp-cell>summary::after{transform:translateY(-50%) rotate(-45deg)}details.cmp-cell[open]>summary::after{transform:translateY(-50%) rotate(45deg)}
.schema-doc>summary::before{display:none}

/* ---- keelevalik (UK / Eesti lipp) */
.lang-switch { display: inline-flex; gap: 6px; align-items: center; flex: none; }
.lang-btn { display: inline-grid; place-items: center; width: 44px; height: 32px; border-radius: 10px; background: #24332e; opacity: .7; border: 2px solid transparent; text-decoration: none; }
.lang-btn:hover, .lang-btn:focus-visible { opacity: 1; }
.lang-btn.active { opacity: 1; background: #182420; border-color: #2ec4a6; }
.lang-btn svg { display: block; border-radius: 3px; }
.lang-float { display: flex; justify-content: flex-end; padding: 12px 16px 0; }
@media (max-width: 620px) { .lang-btn { width: 38px; height: 28px; } .lang-btn svg { width: 24px; height: 15px; } }
