@font-face {
  font-family: "ua-BRAND";
  src: url("./assets/fonts/ua-BRAND-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ua-BRAND";
  src: url("./assets/fonts/ua-BRAND-bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "ua-BRAND";
  src: url("./assets/fonts/ua-BRAND-black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Evolventa";
  src: url("./assets/fonts/Evolventa-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Evolventa";
  src: url("./assets/fonts/Evolventa-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --sand: #f4ead8;
  --cream: #fffaf1;
  --paper: #fbf2e5;
  --green: #31573d;
  --green-2: #557056;
  --green-soft: #dce4cd;
  --terracotta: #b85f3f;
  --terracotta-soft: #f0d2c2;
  --blue: #243b52;
  --ink: #16241d;
  --muted: #6c675c;
  --line: rgba(36, 59, 82, 0.14);
  --shadow: 0 18px 40px rgba(36, 59, 82, 0.12);
  --on-accent: #fffaf1;
  --button-bg: rgba(255, 250, 241, 0.86);
  --card-bg: rgba(255, 250, 241, 0.92);
  --button-soft-bg: rgba(255, 250, 241, 0.72);
  --cancelled-bg: rgba(255, 250, 241, 0.7);
  --nav-bg: rgba(255, 250, 241, 0.94);
  --soft-green-bg: rgba(220, 228, 205, 0.48);
  --soft-green-strong: rgba(220, 228, 205, 0.7);
  --soft-blue-bg: rgba(36, 59, 82, 0.06);
  --danger-soft-bg: rgba(190, 94, 62, 0.11);
  --desktop-bg: #e8ddca;
  --blue-solid: #243b52;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
  font-family: "Evolventa", "Arial", sans-serif;
}

:root[data-theme="dark"] {
  --sand: #101612;
  --cream: #1b251f;
  --paper: #222f27;
  --green: #73967a;
  --green-2: #8aa08a;
  --green-soft: #304437;
  --terracotta: #d47655;
  --terracotta-soft: #4b3028;
  --blue: #a9c0d5;
  --ink: #f7f1e5;
  --muted: #bdb5a7;
  --line: rgba(247, 241, 229, 0.16);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  --button-bg: rgba(34, 47, 39, 0.96);
  --card-bg: rgba(27, 37, 31, 0.96);
  --button-soft-bg: rgba(34, 47, 39, 0.82);
  --cancelled-bg: rgba(27, 37, 31, 0.68);
  --nav-bg: rgba(18, 25, 21, 0.96);
  --soft-green-bg: rgba(68, 94, 75, 0.5);
  --soft-green-strong: rgba(68, 94, 75, 0.74);
  --soft-blue-bg: rgba(169, 192, 213, 0.1);
  --danger-soft-bg: rgba(212, 118, 85, 0.14);
  --desktop-bg: #0b100d;
  --blue-solid: #314d67;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  overscroll-behavior-y: contain;
}

body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--sand);
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: 100vw;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--sand);
  box-shadow: 0 0 0 1px rgba(36, 59, 82, 0.08);
}

.screen {
  min-height: 100vh;
  padding: 24px 18px calc(92px + var(--safe-bottom));
  overflow-x: hidden;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--on-accent);
  background: var(--green);
  border-radius: 8px;
  font-family: "ua-BRAND", "Evolventa", sans-serif;
  font-size: 22px;
  font-weight: 900;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark { flex: 0 0 44px; }
.brand-lockup > div:last-child { min-width: 0; overflow-wrap: anywhere; }
.header-actions { display: grid; gap: 8px; flex: 0 0 44px; }
.refresh-indicator {
  position: fixed;
  z-index: 100;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 24px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
  color: var(--green);
  font-size: 14px;
  pointer-events: none;
}
.is-refreshing { opacity: 0.5; cursor: wait; }

.brand-name {
  margin: 0;
  color: var(--green);
  font-family: "ua-BRAND", "Evolventa", sans-serif;
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
}

.kicker {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.icon-button,
.ghost-button,
.primary-button,
.secondary-button,
.chip,
.tab-button,
.choice-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--button-bg);
}

.icon-button {
  width: 44px;
  padding: 0;
  color: var(--green);
  font-size: 21px;
}

.hero-card,
.panel,
.list-row,
.goal-row,
.metric-tile,
.badge-tile,
.field-card,
.schedule-card,
.feature-card,
.diary-day,
.coach-student {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(49, 87, 61, 0.96), rgba(36, 59, 82, 0.92)),
    var(--green);
  color: var(--on-accent);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -76px;
  width: 210px;
  height: 210px;
  border: 2px solid rgba(255, 250, 241, 0.36);
  border-radius: 50%;
}

.hero-card h1,
.hero-card h2 {
  position: relative;
  max-width: 290px;
  margin: 0;
  font-family: "ua-BRAND", "Evolventa", sans-serif;
  font-size: 34px;
  line-height: 0.98;
  font-weight: 900;
}

.hero-card p {
  position: relative;
  max-width: 285px;
  margin: 12px 0 0;
  color: rgba(255, 250, 241, 0.82);
  font-size: 14px;
  line-height: 1.45;
}

.hero-actions {
  position: relative;
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  color: var(--on-accent);
  border-color: var(--green);
  background: var(--green);
}

.hero-card .primary-button {
  color: var(--green);
  border-color: var(--cream);
  background: var(--cream);
}

:root[data-theme="dark"] .hero-card .primary-button {
  color: #16241d;
  border-color: #fffaf1;
  background: #fffaf1;
}

.secondary-button {
  color: var(--blue);
  background: var(--green-soft);
}

.ghost-button {
  color: var(--green);
  background: var(--button-soft-bg);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 10px;
  gap: 10px;
}

.section-title h2 {
  min-width: 0;
  margin: 0;
  color: var(--blue);
  font-family: "ua-BRAND", "Evolventa", sans-serif;
  font-size: 23px;
  line-height: 1;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-tile {
  min-height: 112px;
  padding: 14px;
}

.metric-tile small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric-tile strong {
  display: block;
  margin-top: 8px;
  color: var(--green);
  font-family: "ua-BRAND", "Evolventa", sans-serif;
  font-size: 35px;
  line-height: 0.95;
}

.metric-tile em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.panel {
  padding: 14px;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.list-row,
.goal-row,
.coach-student {
  display: grid;
  gap: 8px;
  min-height: 74px;
  padding: 13px;
}

.schedule-stack {
  display: grid;
  gap: 10px;
}

.mini-filter {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mini-filter::-webkit-scrollbar {
  display: none;
}

.mini-filter span {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: var(--button-bg);
  font-size: 12px;
  font-weight: 700;
}

.mini-filter span:first-child {
  color: var(--on-accent);
  border-color: var(--green);
  background: var(--green);
}

.schedule-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 12px;
}

.schedule-card > div { min-width: 0; }
.schedule-card.is-cancelled { background: var(--cancelled-bg); box-shadow: none; }
.schedule-card.is-cancelled .schedule-date { color: var(--ink); background: var(--green-soft); }
.schedule-card.is-cancelled .row-top small { color: var(--terracotta); font-weight: 700; }
.school-open { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 16px; }
.school-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.school-period { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: center; margin: 12px 0; }
.school-period .icon-button { display: grid; place-items: center; line-height: 1; }
.school-period strong { text-align: center; font-size: 16px; overflow-wrap: anywhere; }
.school-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 16px 0; }
.school-filter { display: grid; gap: 6px; min-width: 0; font-size: 14px; font-weight: bold; }
.school-filter select, .school-filter input {
  width: 100%; min-width: 0; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); background: var(--cream); font-weight: normal;
}
.school-free { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 14px; }
.school-free input { width: 20px; height: 20px; flex: 0 0 20px; accent-color: var(--green); }
.school-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 20px 0; }
.school-weekday { text-align: center; color: var(--muted); font-size: 12px; padding-bottom: 6px; }
.school-day { display: grid; align-content: center; gap: 3px; width: 100%; aspect-ratio: 4 / 5; min-height: 44px; padding: 4px 0; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--cream); }
.school-day strong { font-size: 16px; }
.school-day small { font-size: 11px; color: var(--muted); }
.school-day.is-selected { color: var(--on-accent); border-color: var(--green); background: var(--green); }
.school-day.is-selected small { color: var(--on-accent); }
.school-events { display: grid; gap: 12px; }
.school-event { display: grid; text-align: left; gap: 8px; width: 100%; padding: 16px; color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 8px; background: var(--cream); }
.school-event span, .school-event strong { min-width: 0; overflow-wrap: anywhere; }
.school-event-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.school-event-top small { color: var(--green); font-weight: bold; }
.school-event-top .is-full { color: var(--terracotta); }
.school-updated { margin-top: 16px; }
.school-back { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 104px; min-height: 44px; padding: 0 16px; border: 1px solid var(--green); border-radius: 8px; color: var(--on-accent); background: var(--green); font-size: 14px; font-weight: 700; line-height: 1; }
.school-back span:first-child { font-size: 20px; line-height: 1; }
.school-detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.school-detail h1 { font-size: 24px; line-height: 1.35; overflow-wrap: anywhere; }
.school-detail p, .school-detail dd { overflow-wrap: anywhere; }
.school-detail dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.school-detail dt { margin-top: 12px; color: var(--muted); font-size: 13px; }
.school-detail dd { margin: 0; font-size: 16px; }
.schedule-card .row-top { flex-wrap: wrap; align-items: flex-start; }
.schedule-card strong { overflow-wrap: anywhere; }

.schedule-date {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 8px;
  color: var(--on-accent);
  background: var(--terracotta);
}

.schedule-date strong {
  font-family: "ua-BRAND", "Evolventa", sans-serif;
  font-size: 24px;
  line-height: 1;
}

.schedule-date span {
  font-size: 11px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-row span,
.goal-meta {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 8px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
  line-height: 1.2;
}

.goal-row.is-complete { opacity: 0.78; }
.goal-management { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.goal-management summary { min-height: 36px; color: var(--green); cursor: pointer; font-size: 12px; font-weight: 700; }
.goal-editor { display: grid; gap: 12px; padding-top: 8px; }
.goal-editor > label { display: grid; gap: 6px; color: var(--blue); font-size: 12px; font-weight: 700; }
.goal-editor input:not([type="range"]), .goal-editor select { width: 100%; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--cream); }
.goal-management-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.goal-management-actions button { min-width: 0; min-height: 42px; padding: 8px 10px; line-height: 1.25; }
.goal-delete { grid-column: 1 / -1; border: 0; color: var(--terracotta); background: transparent; font: inherit; font-weight: 700; cursor: pointer; }

.feature-grid {
  display: grid;
  gap: 10px;
}

.feature-card {
  padding: 12px;
}

.feature-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.row-top strong {
  color: var(--ink);
  font-size: 15px;
}

.row-top small,
.subtle {
  color: var(--muted);
  font-size: 12px;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(36, 59, 82, 0.12);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--terracotta);
}

.progress.is-green span {
  background: var(--green);
}

.quick-log,
.demo-logins {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.login-hint {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.login-registration-prompt {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--terracotta) 55%, var(--line));
  border-left: 5px solid var(--terracotta);
  border-radius: 8px;
  background: color-mix(in srgb, var(--terracotta) 10%, var(--cream));
}

.login-registration-prompt strong {
  color: var(--blue);
  font-size: 16px;
}

.login-registration-prompt p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.field-grid {
  display: grid;
  gap: 12px;
}

.coach-report-card .report-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.coach-report-card .report-actions button {
  width: auto;
  min-height: 42px;
  padding: 10px 14px;
  font-size: 14px;
}

.field-card {
  display: grid;
  gap: 9px;
  padding: 13px;
}

fieldset.field-card {
  display: block;
  min-width: 0;
  margin: 0;
}

.field-card label,
.field-card legend,
.field-label {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.field-card legend {
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: 9px;
  float: left;
}

.field-card legend + * {
  clear: both;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.field-card input,
.field-card textarea,
.field-card select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--cream);
}

.field-card input,
.field-card select {
  min-height: 44px;
  padding: 0 12px;
}

.field-card textarea {
  min-height: 88px;
  padding: 12px;
  resize: vertical;
}

.readonly-value {
  min-height: 44px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--soft-green-bg);
  line-height: 1.35;
}

.entry-label {
  color: var(--blue);
  font-weight: 700;
}

.coach-note {
  padding: 10px;
  border-radius: 8px;
  color: var(--blue);
  background: var(--soft-green-bg);
  font-size: 13px;
  line-height: 1.35;
}

.coach-note-button {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 10px;
  padding: 14px;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.coach-note-button.is-unread {
  background: var(--terracotta);
  color: #fff;
}

.coach-note-button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.coach-note-heading, .coach-note-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.coach-note-heading strong { font-size: 15px; }
.coach-note-heading > span, .coach-note-footer { font-size: 12px; }
.coach-note-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feedback-detail { padding: 18px 0; overflow-wrap: anywhere; }
.feedback-detail h1 { font-size: 24px; line-height: 1.25; }
.feedback-detail h2 { font-size: 18px; margin: 24px 0 10px; }
.feedback-detail p { line-height: 1.5; }
.feedback-text { white-space: pre-wrap; }
.feedback-detail select { display: block; width: 100%; max-width: 100%; padding: 12px; margin-top: 8px; }
.feedback-detail label { display: block; margin-top: 20px; }

.range-row {
  display: grid;
  grid-template-columns: 1fr 54px;
  align-items: center;
  gap: 12px;
}

.range-row input {
  accent-color: var(--green);
}

.range-value {
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: 8px;
  color: var(--on-accent);
  background: var(--terracotta);
  font-family: "ua-BRAND", "Evolventa", sans-serif;
  font-size: 22px;
  font-weight: 900;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.choice-button {
  min-width: 0;
  padding: 0;
  color: var(--blue);
  background: var(--paper);
  font-family: "ua-BRAND", "Evolventa", sans-serif;
  font-size: 22px;
  font-weight: 900;
}

.choice-button.is-selected {
  color: var(--on-accent);
  border-color: var(--green);
  background: var(--green);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 38px;
  padding: 0 10px;
  color: var(--blue);
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
}

.chip.is-selected {
  color: var(--on-accent);
  border-color: var(--terracotta);
  background: var(--terracotta);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.goal-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 14px;
}

.tab-button {
  min-height: 42px;
  color: var(--green);
  font-weight: 700;
}

.tab-button.is-active {
  color: var(--on-accent);
  border-color: var(--green);
  background: var(--green);
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.badge-tile {
  min-height: 110px;
  padding: 13px;
  border-color: rgba(184, 95, 63, 0.3);
}

.badge-tile strong {
  display: block;
  margin-top: 12px;
  color: var(--blue);
  font-size: 14px;
}

.badge-tile small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.badge-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--on-accent);
  background: var(--terracotta);
}

.chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 8px;
  height: 160px;
  max-width: 100%;
  margin-top: 10px;
  padding: 12px 8px 4px;
  border-radius: 8px;
  background: var(--soft-blue-bg);
  overflow: hidden;
}

.bar {
  display: grid;
  align-items: end;
  gap: 6px;
  height: 100%;
  text-align: center;
}

.bar i {
  display: block;
  min-height: 8px;
  border-radius: 8px 8px 0 0;
  background: var(--green);
}

.bar:nth-child(even) i {
  background: var(--terracotta);
}

.bar span {
  color: var(--muted);
  font-size: 10px;
}

.compact-tabs {
  margin-bottom: 10px;
}

.diary-calendar {
  display: grid;
  grid-auto-columns: minmax(86px, 1fr);
  grid-auto-flow: column;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.diary-calendar::-webkit-scrollbar {
  display: none;
}

.diary-calendar.is-month {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-columns: unset;
  grid-auto-flow: row;
  overflow-x: visible;
}

.diary-day {
  min-width: 0;
  min-height: 98px;
  padding: 8px;
  box-shadow: none;
  width: 100%;
  text-align: left;
  align-self: stretch;
}

.diary-day:disabled {
  cursor: default;
  opacity: 1;
}

.diary-day.has-entry:hover,
.diary-day.has-entry:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.diary-day-reports {
  margin-top: 16px;
}

.diary-calendar.is-month .diary-day {
  min-height: 66px;
  padding: 6px;
}

.diary-day.has-entry {
  border-color: rgba(49, 87, 61, 0.44);
  background: var(--soft-green-bg);
}

.diary-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}

.diary-day-head strong {
  color: var(--blue);
  font-family: "ua-BRAND", "Evolventa", sans-serif;
  font-size: 17px;
  line-height: 1;
}

.diary-day-head span,
.diary-day-empty,
.diary-day-body span,
.diary-day-body small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.diary-day-body {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.diary-day-body small {
  color: var(--green);
  font-weight: 700;
}

.diary-day-empty {
  margin-top: 12px;
}

.diary-calendar.is-month .diary-day-body span {
  display: none;
}

.diary-calendar.is-month .diary-day-empty,
.diary-calendar.is-month .diary-day-body small {
  font-size: 8px;
}

.coach-layout {
  display: grid;
  gap: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--on-accent);
  background: var(--blue-solid);
  font-family: "ua-BRAND", "Evolventa", sans-serif;
  font-weight: 900;
}

.coach-student {
  grid-template-columns: 42px 1fr auto;
  align-items: center;
}

.coach-student button {
  min-width: 44px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
}

.settings-row:last-child {
  border-bottom: 0;
}

.theme-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(190px, 58vw);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.theme-switch button {
  min-width: 0;
  min-height: 38px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.theme-switch button.is-selected {
  color: var(--on-accent);
  background: var(--green);
}

.toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  width: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.toggle button {
  min-height: 38px;
  border: 0;
  color: var(--muted);
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
}

.toggle button.is-active {
  color: var(--on-accent);
  background: var(--blue-solid);
}

.empty-state {
  padding: 24px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 20;
  right: max(18px, calc((100vw - 430px) / 2 + 18px));
  bottom: calc(86px + var(--safe-bottom));
  left: max(18px, calc((100vw - 430px) / 2 + 18px));
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--on-accent);
  background: var(--blue-solid);
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  right: auto;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 4px;
  width: min(100vw, 430px);
  margin: 0 auto;
  padding: 8px 10px calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
}

.nav-item {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}

.nav-item span {
  font-size: 19px;
  line-height: 1;
}

.nav-item small {
  font-size: 10px;
}

.nav-item.is-active {
  color: var(--on-accent);
  background: var(--green);
}

.notification-nav-icon { position: relative; display: grid; place-items: center; width: 24px; height: 24px; }
.bell-icon {
  display: block; width: 22px; height: 22px; background: currentColor;
  mask: url('./assets/icons/bell.svg') center / contain no-repeat;
  -webkit-mask: url('./assets/icons/bell.svg') center / contain no-repeat;
}
.notification-badge {
  position: absolute; top: -6px; right: -12px;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--terracotta); color: var(--on-accent);
  font-family: 'Evolventa', sans-serif; font-size: 10px; line-height: 18px;
}
.notification-badge[hidden] { display: none; }
.notification-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px; }
.inbox-head .brand-name { font-size: 20px; }
.notification-list { display: grid; gap: 12px; }
.notification-item {
  display: grid; gap: 10px; width: 100%; min-width: 0; padding: 16px;
  border: 1px solid var(--line); border-radius: 8px; text-align: left;
  background: var(--soft-green-bg); color: var(--ink);
}
.notification-item.is-unread { background: var(--terracotta); color: var(--on-accent); border-color: var(--terracotta); }
.notification-item:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.notification-item strong { font-family: 'ua-BRAND', sans-serif; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.notification-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; font-size: 11px; line-height: 1.4; }
.notification-preview { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.notification-more { width: 100%; margin-top: 18px; }
.notification-detail { margin: 20px 0; }
.notification-detail h1 { font-size: 24px; line-height: 1.35; overflow-wrap: anywhere; }
.notification-body { margin: 20px 0 28px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.welcome-links { display: grid; gap: 10px; }
.welcome-links button { width: 100%; }
.notification-error { color: var(--terracotta); font-size: 14px; line-height: 1.5; }

.hidden {
  display: none !important;
}

@media (min-width: 720px) {
  body {
    background: var(--desktop-bg);
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    margin-top: 24px;
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
  }
}
.booking-action {
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  min-height: 40px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}
.schedule-card.is-admin-request { border-color: rgba(190, 94, 62, 0.55); }
.booking-request-note {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(190, 94, 62, 0.42);
  border-radius: 8px;
  background: var(--danger-soft-bg);
  color: var(--ink);
}
.booking-request-note strong { color: var(--terracotta); font-size: 13px; line-height: 1.35; }
.booking-request-note p { margin: 0; font-size: 12px; line-height: 1.45; }
.booking-admin-action { font-size: 12px; text-decoration: none; }

.admin-toolbar { display: grid; gap: 7px; margin: 16px 0; }
.admin-switch { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; margin-top: 16px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--button-soft-bg); }
.admin-switch button { min-height: 40px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; }
.admin-switch button[aria-selected="true"] { background: var(--green); color: var(--on-accent); }
.admin-toolbar label { color: var(--blue); font-size: 12px; font-weight: 700; }
.admin-toolbar > div { display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 8px; }
.admin-toolbar input { min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream); color: var(--ink); }
.admin-layout { display: grid; gap: 20px; min-width: 0; }
.admin-player-list { display: grid; align-content: start; gap: 8px; min-width: 0; }
.admin-player-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream); color: var(--ink); text-align: left; }
.admin-player-row.is-selected { border-color: var(--terracotta); box-shadow: inset 4px 0 var(--terracotta); }
.admin-player-row > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.admin-player-row strong,.admin-player-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-player-row small { color: var(--muted); font-size: 11px; }
.admin-player-signals { display: flex; gap: 6px; align-items: center; }
.status-dot { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--terracotta); }
.status-dot.is-ready { background: var(--green); }
.status-dot.is-muted { background: var(--line); }
.status-dot.is-push { border: 2px solid var(--green); background: transparent; }
.admin-workspace { min-width: 0; }
.admin-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.admin-detail-head h2 { margin: 0; font-size: 24px; }
.admin-detail-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.admin-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 18px 0 24px; }
.admin-facts > div { display: grid; gap: 4px; min-width: 0; padding: 12px; border-left: 4px solid var(--green); background: var(--soft-green-bg); }
.admin-facts span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.admin-facts strong { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.admin-section { padding: 20px 0; border-top: 1px solid var(--line); }
.admin-section .section-title { margin: 0 0 12px; }
.admin-section h3 { margin: 0; font-size: 18px; }
.admin-rows { display: grid; gap: 8px; }
.admin-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; padding: 11px 0; border-bottom: 1px solid rgba(36,59,82,.1); }
.admin-row:last-child { border-bottom: 0; }
.admin-row > div { display: grid; gap: 4px; min-width: 0; }
.admin-row strong { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.admin-row small { color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.admin-row .admin-report-status { font-weight: 700; }
.admin-row .admin-report-status.is-ready { color: var(--green); }
.admin-row .admin-report-status.is-missing { color: var(--terracotta); }
.admin-linking { border-top-color: var(--green); }
.admin-linking .section-title { align-items: flex-start; }
.admin-linking .section-title span { max-width: 150px; text-align: right; }
.admin-link-note { margin: 8px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.admin-link-candidate { align-items: center; }
.admin-link-button { width: auto; min-width: 150px; margin: 0; padding: 10px 12px; font-size: 12px; white-space: nowrap; }
.status-pill { flex: 0 0 auto; max-width: 145px; padding: 5px 7px; border-radius: 8px; background: var(--soft-green-strong); color: var(--green); font-size: 10px; line-height: 1.25; text-align: center; }
.admin-entry { padding: 12px; border-left: 4px solid var(--terracotta); background: var(--cream); }
.admin-entry p { margin: 7px 0 0; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.admin-error { padding: 12px; border-left: 4px solid var(--terracotta); background: var(--danger-soft-bg); color: var(--ink); }

@media (min-width: 760px) {
  .app-shell.is-admin-mode { max-width: 1180px; }
  .bottom-nav.is-admin-mode { width: min(100vw,1180px); }
  .admin-layout { grid-template-columns: 290px minmax(0,1fr); align-items: start; }
  .admin-player-list { position: sticky; top: 18px; max-height: calc(100vh - 130px); overflow-y: auto; padding-right: 4px; }
  .admin-facts { grid-template-columns: repeat(4,minmax(0,1fr)); }
}

@media (max-width: 520px) {
  .admin-link-candidate { align-items: stretch; flex-direction: column; }
  .admin-link-button { width: 100%; }
}

.subscriptions-title h1 { min-width: 0; margin: 0; font-size: 24px; overflow-wrap: anywhere; }
.subscriptions-title .icon-button { flex-shrink: 0; }
.subscription-list { display: grid; gap: 16px; }
.subscription-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream); overflow-wrap: anywhere; }
.subscription-card h2 { margin: 0; font-size: 18px; line-height: 1.35; }
.subscription-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; margin-top: 18px; }
.subscription-fact { display: grid; gap: 4px; min-width: 0; }
.subscription-fact:first-child { grid-column: 1 / -1; }
.subscription-fact span { color: var(--muted); font-size: 11px; }
.subscription-fact strong { color: var(--ink); font-size: 15px; line-height: 1.35; }
.subscription-fact:first-child strong { color: var(--green); }
.subscription-scope { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.subscription-scope summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; color: var(--blue); cursor: pointer; font-weight: 700; list-style: none; }
.subscription-scope summary::-webkit-details-marker { display: none; }
.subscription-scope summary::after { content: "⌄"; flex: 0 0 auto; color: var(--green); font-size: 18px; transition: transform 160ms ease; }
.subscription-scope[open] summary::after { transform: rotate(180deg); }
.subscription-scope p, .subscription-scope ul { margin: 8px 0 0; }
.subscription-scope ul { padding-left: 18px; }
.subscription-scope li + li { margin-top: 5px; }

.booking-filter-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.booking-filter-row .mini-filter { margin-bottom: 10px; }
.booking-period-nav {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}
.booking-period-nav > div { display: grid; gap: 3px; min-width: 0; text-align: center; }
.booking-period-nav strong { color: var(--blue); font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.booking-period-nav span { color: var(--muted); font-size: 10px; }
.booking-period-reset { width: 100%; margin: -4px 0 14px; }

.booking-summary {
  margin-top: 10px;
  overflow-wrap: anywhere;
}
.push-settings {
  margin: 24px 0;
}
.push-toggle {
  cursor: pointer;
  gap: 16px;
}
.push-toggle input {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  accent-color: var(--green, #31573d);
}
.push-result {
  overflow-wrap: anywhere;
}
.push-settings .quick-log {
  grid-template-columns: minmax(0, 1fr) 44px;
}
.push-settings .quick-log button {
  min-width: 0;
  white-space: normal;
}
.push-settings button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.notification-preferences .section-title h2 { font-size: 20px; line-height: 1.2; }

@media (max-width: 350px) {
  .screen { padding-right: 12px; padding-left: 12px; }
  .school-period strong, .booking-period-nav strong { font-size: 12px; }
  .theme-switch { width: 164px; }
  .theme-switch button { padding: 0 6px; font-size: 11px; }
}
.school-booking { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.school-booking h2 { font-size: 20px; }
.school-booking p { overflow-wrap: anywhere; }
.school-booking .primary-button { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.school-booking .secondary-button { margin-top: 12px; }
.school-booking-start { margin-top: 16px; }
