:root {
  color-scheme: light;
  --bg: #f4f5f0;
  --surface: #ffffff;
  --surface-soft: #eceee7;
  --text: #1b1e1a;
  --muted: #73796f;
  --accent: #c7f36b;
  --accent-soft: #ebf7d5;
  --border: #e3e6de;
  --tape: #7f9c46;
  --shadow: 0 10px 30px rgba(28, 34, 24, 0.06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-width: 280px;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

html.telegram-dark {
  color-scheme: dark;
  --bg: #151713;
  --surface: #20231e;
  --surface-soft: #2a2e27;
  --text: #f2f4ed;
  --muted: #a3aa9d;
  --accent: #b7e65f;
  --accent-soft: #303b24;
  --border: #343930;
  --tape: #b9d977;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

button {
  margin: 0;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

svg {
  display: block;
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}

.app-main {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 30px 20px calc(112px + var(--safe-bottom));
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: screen-in 180ms ease-out;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-header {
  margin-bottom: 26px;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
}

h1 {
  max-width: 420px;
  font-size: clamp(29px, 8vw, 38px);
  font-weight: 730;
  letter-spacing: -1.25px;
  line-height: 1.08;
}

.screen-subtitle {
  max-width: 390px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.feature-list {
  display: grid;
  gap: 12px;
}

.feature-card {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 94px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 120ms ease, border-color 120ms ease;
}

.feature-card:active {
  transform: scale(0.985);
}

.feature-icon {
  display: grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--text);
}

.feature-icon svg {
  width: 27px;
  height: 27px;
}

.feature-icon-dark {
  background: var(--text);
  color: var(--accent);
}

.feature-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  margin-left: 14px;
}

.feature-title {
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.25px;
  line-height: 1.25;
}

.feature-description {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.card-arrow {
  margin-left: 10px;
  color: var(--muted);
}

.card-arrow svg {
  width: 19px;
  height: 19px;
}

.quiet-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 24px 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.quiet-note-mark {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.metric-delta {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-card {
  display: flex;
  min-height: 86px;
  padding: 11px 10px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  flex-direction: column;
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
}

.metric-card strong {
  margin-top: auto;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -0.4px;
  line-height: 1;
}

.metric-unit {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.section-block {
  margin-top: 28px;
}

.section-block > h2 {
  margin: 0 2px 13px;
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.35px;
}

.section-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 13px;
  padding: 2px;
  background: transparent;
  border: 0;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.client-profile-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 6px;
}

.client-avatar {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--tape);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.client-profile-head-copy h1 {
  margin: 0;
}

.client-profile-head-copy .screen-subtitle {
  margin-top: 3px;
}

.info-card-list {
  display: grid;
  gap: 12px;
}

.info-card {
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--surface);
  overflow: hidden;
}

.info-card-head {
  margin: 0;
  padding: 15px;
  gap: 12px;
  justify-content: flex-start;
}

.info-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--tape);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.info-card-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.info-card-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.info-card-title {
  font-size: 15px;
  font-weight: 700;
}

.info-card-sub {
  font-size: 12px;
  color: var(--muted);
}

.info-card-body {
  padding: 0 15px 15px;
  display: grid;
  gap: 10px;
}

.info-card-body[hidden] {
  display: none;
}

.info-card-add {
  justify-self: start;
  border-radius: 999px;
  padding: 9px 17px;
  min-height: 0;
  font-size: 13px;
}

.info-card-add-text {
  justify-self: start;
  font-weight: 600;
}

.section-toggle-title {
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.35px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.section-toggle-arrow {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: transform 180ms ease;
}

.section-toggle.open .section-toggle-arrow {
  transform: rotate(180deg);
}

.section-unread-dot {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger, #c05b5b);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(192, 91, 91, 0.25), 0 2px 8px rgba(192, 91, 91, 0.45);
}

.heading-with-dot {
  display: flex;
  align-items: center;
  gap: 7px;
}

.nutrition-material-block {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}

.nutrition-material-block h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 680;
}

.empty-card {
  padding: 28px 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  text-align: center;
}

.empty-card-compact {
  padding-top: 24px;
  padding-bottom: 24px;
}

.empty-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 15px;
  place-items: center;
  border-radius: 15px;
  background: var(--surface-soft);
  color: var(--muted);
}

.empty-card h3 {
  font-size: 15px;
  font-weight: 650;
}

.empty-card p {
  max-width: 260px;
  margin: 7px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.nutrition-intro {
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: 23px;
  background: var(--accent-soft);
}

.nutrition-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 17px;
  background: var(--accent);
  color: #1b1e1a;
}

.nutrition-icon svg {
  width: 28px;
  height: 28px;
}

.nutrition-intro h2 {
  margin-top: 22px;
  font-size: 21px;
  font-weight: 680;
  letter-spacing: -0.55px;
}

.nutrition-intro p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.profile-card {
  display: flex;
  align-items: center;
  padding: 21px;
  border: 1px solid var(--border);
  border-radius: 23px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-avatar {
  display: grid;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 21px;
  background: var(--accent);
  color: #1b1e1a;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.5px;
}

.profile-identity {
  min-width: 0;
  margin-left: 16px;
}

.profile-identity h2 {
  overflow: hidden;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -0.45px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-identity p {
  overflow: hidden;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--surface);
}

.info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.4;
}

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

.info-row > span {
  flex: 0 0 auto;
  color: var(--muted);
}

.info-row strong {
  max-width: 190px;
  font-weight: 570;
  text-align: right;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  right: 12px;
  bottom: calc(10px + var(--safe-bottom));
  left: 12px;
  display: grid;
  width: calc(100% - 24px);
  max-width: 536px;
  margin: 0 auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 23px;
  background: var(--surface);
  box-shadow: 0 12px 35px rgba(25, 31, 21, 0.13);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  transition: transform 180ms ease;
}

.bottom-nav.nav-hidden {
  transform: translateY(calc(100% + 24px));
  pointer-events: none;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 58px;
  padding: 7px 4px;
  border-radius: 17px;
  background: transparent;
  color: var(--muted);
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  position: relative;
  transition: background 120ms ease, color 120ms ease;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--text);
}

@media (max-width: 340px) {
  .app-main {
    padding-right: 14px;
    padding-left: 14px;
  }

  .feature-card {
    padding: 14px;
  }

  .feature-icon {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
  }

  .feature-copy {
    margin-left: 11px;
  }

  .feature-title {
    font-size: 15px;
  }

  .nav-item {
    gap: 6px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen.active {
    animation: none;
  }

  .feature-card,
  .nav-item {
    transition: none;
  }
}

[hidden] {
  display: none !important;
}

.loading-state {
  display: grid;
  min-height: 65vh;
  place-content: center;
  color: var(--muted);
  gap: 16px;
  text-align: center;
  font-size: 14px;
}

.loading-mark {
  width: 30px;
  height: 30px;
  margin: 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: loading-spin 800ms linear infinite;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.welcome-layout {
  display: flex;
  min-height: calc(100vh - 60px);
  min-height: calc(100dvh - 60px);
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.welcome-hero {
  padding: 30px 25px;
  border-radius: 26px;
  background: var(--text);
  color: var(--bg);
}

.welcome-hero .eyebrow {
  color: var(--accent);
}

.welcome-hero h1 {
  margin-top: 34px;
}

.welcome-hero > p:last-of-type {
  margin-top: 15px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.welcome-line {
  width: 54px;
  height: 5px;
  margin-top: 26px;
  border-radius: 10px;
  background: var(--accent);
}

.welcome-next {
  padding: 0 4px;
}

.welcome-next p {
  margin-bottom: 19px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.primary-button,
.secondary-button,
.text-button {
  border-radius: 15px;
  font-weight: 650;
  transition: transform 120ms ease, opacity 120ms ease;
}

.primary-button:active,
.secondary-button:active,
.text-button:active {
  transform: scale(0.985);
}

.primary-button {
  width: 100%;
  min-height: 52px;
  padding: 13px 18px;
  background: var(--accent);
  color: #1b1e1a;
  font-size: 15px;
}

.secondary-button {
  min-height: 48px;
  padding: 12px 17px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.section-button {
  width: 100%;
  margin-top: 14px;
  margin-bottom: 14px;
}

.text-button {
  padding: 7px 4px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

.form-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-card > h2 {
  margin-bottom: 20px;
  font-size: 20px;
  letter-spacing: -0.45px;
}

.collapsible-form {
  margin-top: 16px;
}

.form-field {
  min-width: 0;
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  margin: 0 2px 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 13px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.form-field input,
.form-field select {
  min-height: 48px;
  padding: 11px 13px;
}

.form-field textarea {
  min-height: 88px;
  padding: 12px 13px;
  line-height: 1.45;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.feed-list {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}

.feed-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.feed-material-title {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 700;
}

.workout-list {
  display: grid;
  gap: 11px;
}

.workout-card {
  display: block;
  width: 100%;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--surface);
  text-align: left;
}

.workout-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workout-card-heading h3 {
  font-size: 16px;
  font-weight: 700;
}

.workout-card-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.workout-card-meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.workout-progress-card {
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--surface);
}

.workout-progress-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 9px;
}

.workout-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-soft);
}

.workout-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 300ms ease;
}

.workout-exercise-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.exercise-card {
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--surface);
  overflow: hidden;
}

.exercise-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 15px;
  background: transparent;
  text-align: left;
}

.exercise-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.exercise-info {
  flex: 1;
  min-width: 0;
}

.exercise-info h3 {
  font-size: 14px;
  font-weight: 700;
}

.exercise-info p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.exercise-chevron {
  color: var(--muted);
  font-size: 18px;
  transform: rotate(90deg);
  transition: transform 150ms ease;
}

.exercise-chevron.open {
  transform: rotate(-90deg);
}

.exercise-done {
  color: var(--tape);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.exercise-done.exercise-skipped {
  color: var(--muted);
}

.exercise-skipped-note {
  color: var(--muted);
  font-style: italic;
}

.exercise-skipped-text {
  color: var(--muted);
}

.exercise-skip {
  justify-self: start;
}

#workout-done,
#workout-complete,
#workout-readonly {
  margin-top: 14px;
}

.exercise-body {
  padding: 0 15px 15px;
  display: grid;
  gap: 9px;
}

.exercise-description {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.exercise-report-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}

.exercise-file-hint {
  margin: 0;
}

.exercise-body input[type="file"] {
  font-size: 12px;
}

.exercise-save {
  margin-top: 2px;
}

.exercise-editor-list {
  display: grid;
  gap: 9px;
  margin: 9px 0;
}

.exercise-editor-row {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--bg);
  display: grid;
  gap: 7px;
}

.exercise-video-preview {
  display: grid;
  gap: 5px;
}

.exercise-suggestions {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 5px;
}

.exercise-suggestions[hidden] {
  display: none;
}

.exercise-suggestion {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
}

.exercise-suggestion:active {
  background: var(--surface-soft);
}

.exercise-video-preview[hidden] {
  display: none;
}

.exercise-video-preview video {
  width: 100%;
  border-radius: 14px;
  background: var(--surface-soft);
  max-height: 220px;
}

.nutrition-article {
  display: grid;
  gap: 12px;
}

.nutrition-article[hidden] {
  display: none;
}

.section-toggle-chip {
  background: var(--accent-soft);
  color: var(--tape);
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 13px;
  flex-shrink: 0;
}

.nutrition-article-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.nutrition-article-media {
  width: 100%;
  border-radius: 16px;
  background: var(--surface-soft);
  display: block;
}

img.nutrition-article-media,
img.report-media {
  cursor: zoom-in;
}

.nutrition-days {
  display: grid;
  gap: 9px;
}

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

.nutrition-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.nutrition-metric span {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}

.nutrition-metric input {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  outline: none;
  width: 100%;
  padding: 0;
}

.nutrition-day {
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  display: grid;
  gap: 7px;
}

.nutrition-day-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nutrition-day-number {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--tape);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nutrition-day-caption {
  display: grid;
  gap: 1px;
}

.nutrition-day-caption strong {
  font-size: 14px;
}

.nutrition-day-caption span {
  color: var(--muted);
  font-size: 11px;
}

.nutrition-day-text {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  padding: 8px 11px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.nutrition-day-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.anchor-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 13px 15px;
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.anchor-card strong {
  font-size: 14px;
}

.anchor-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.anchor-row label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.anchor-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 9px 11px;
}

.anchor-row .anchor-save {
  white-space: nowrap;
  padding: 9px 14px;
  min-height: 0;
}

.nutrition-doc {
  position: relative;
  width: 100%;
}

.nutrition-doc .doc-attachment {
  width: 100%;
}

.nutrition-doc-remove {
  top: -6px;
  right: -6px;
}

.doc-attachment {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.doc-attachment svg {
  width: 18px;
  height: 18px;
  stroke: var(--tape);
  stroke-width: 2;
  flex-shrink: 0;
}

.doc-attachment span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nutrition-photo {
  position: relative;
  width: 76px;
  height: 76px;
}

.nutrition-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: contain;
}

.nutrition-photo-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: var(--danger, #c05b5b);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nutrition-day-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nutrition-save {
  padding: 8px 18px;
  font-size: 13px;
}

.nutrition-subheading {
  margin: 18px 2px 9px;
  font-size: 15px;
  font-weight: 680;
}

.nutrition-report-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.nutrition-editor-actions {
  margin-top: 4px;
}

.chat-bubble {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 17px;
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
}

.chat-mine {
  margin-left: auto;
  background: var(--surface);
  border-bottom-right-radius: 5px;
}

.chat-theirs {
  margin-right: auto;
  background: var(--surface-soft);
  border-bottom-left-radius: 5px;
}

.chat-bubble-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.chat-bubble-author {
  font-weight: 700;
  color: var(--tape);
}

.chat-bubble-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-photo {
  width: 100%;
  border-radius: 11px;
  display: block;
  cursor: zoom-in;
}

.chat-bubble-voice {
  width: 100%;
  max-width: 240px;
}

.chat-bubble-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.chat-bubble-action {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}

.chat-bubble-danger {
  color: var(--danger, #c05b5b);
}

.chat-bubble-edited {
  color: var(--muted);
  font-size: 10px;
  font-style: italic;
}

.chat-dock {
  position: sticky;
  bottom: calc(88px + var(--safe-bottom));
  z-index: 5;
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.chat-composer {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1.5px solid var(--accent);
  border-radius: 19px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(25, 31, 21, 0.22);
}

.chat-voice-panel {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  display: grid;
  gap: 9px;
  box-shadow: 0 10px 28px rgba(25, 31, 21, 0.18);
}

.chat-composer input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 8px 4px;
  outline: none;
}

.chat-icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-send {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-voice-panel[hidden] {
  display: none;
}

.chat-voice-panel audio {
  width: 100%;
}

.chat-dock .chat-voice-panel {
  margin-top: 0;
}

.nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 24px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger, #c05b5b);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-badge[hidden] {
  display: none;
}

.admin-fold-card {
  padding: 0;
  overflow: hidden;
}

.admin-fold-toggle {
  margin: 0;
  padding: 13px 14px;
}

.admin-fold-title {
  font-size: 15px;
}

.admin-fold-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-fold-titlewrap {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-fold-subtitle {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.admin-week-header {
  margin: 12px 2px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.admin-sheet-link {
  display: flex;
  justify-content: center;
  margin: 10px 2px 4px;
}

.feature-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 7px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger, #c05b5b);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  vertical-align: 2px;
}

.feature-badge[hidden] {
  display: none;
}

.chat-link {
  color: var(--tape);
  text-decoration: underline;
  word-break: break-all;
}

.admin-fold-body {
  padding: 0 13px 13px;
  display: grid;
  gap: 9px;
}

.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.weekday-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.weekday-chip input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.nutrition-goals-grid {
  display: flex;
  gap: 6px;
}

.nutrition-goal-cell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}

.nutrition-goal-cell strong {
  font-size: 13px;
  font-weight: 680;
  line-height: 1.2;
  word-break: break-word;
}

.goals-edit-grid {
  display: flex;
  gap: 6px;
}

.goal-edit-cell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}

.goal-edit-cell label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
}

.goal-edit-cell input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  outline: none;
  padding: 0;
}

@media (max-width: 380px) {
  .goals-edit-grid {
    flex-wrap: wrap;
  }

  .goal-edit-cell {
    flex: 1 1 30%;
  }
}

.nutrition-goal-label {
  color: var(--muted);
  font-size: 10px;
}

.nutrition-days-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.nutrition-days-heading h2 {
  margin: 0 2px;
}

.nutrition-week-nav {
  display: flex;
  align-items: center;
  gap: 7px;
}

.nutrition-week-arrow {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nutrition-week-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.nutrition-week-dates {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.admin-nutrition-week-nav {
  margin: 0 2px 9px;
}

.exercise-match-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.exercise-match-hint.matched {
  color: var(--tape);
  font-weight: 600;
}

.exercise-editor-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.exercise-numbers-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.exercise-numbers-row.single {
  grid-template-columns: 1fr;
}

.editor-field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: -2px;
}

.exercise-rest-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.exercise-rest-field {
  flex: 1;
  min-width: 0;
}

.exercise-rest-hint {
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 15px;
}

.editor-actions {
  display: flex;
  gap: 4px 16px;
  flex-wrap: wrap;
}

.circuit-editor-card {
  padding: 13px;
  border: 1px solid var(--tape);
  border-radius: 15px;
  background: var(--accent-soft);
  display: grid;
  gap: 9px;
}

.circuit-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.circuit-editor-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.circuit-exercise-list {
  margin: 0;
}

.circuit-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.circuit-field {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.circuit-field input,
.circuit-editor-card > input {
  width: 100%;
}

.circuit-settings-title {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.circuit-rest-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.circuit-rest-input-row input {
  flex: 1;
  min-width: 0;
}

.circuit-rest-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.circuit-card-header {
  background: var(--accent-soft);
}

.workout-progress-count {
  font-size: 12px;
  color: var(--muted);
  margin: -5px 0 8px;
}

.workout-description {
  margin: -4px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
}

.circuit-card-body {
  padding-top: 4px;
}

.circuit-exercise {
  border-top: 1px solid var(--border);
  padding: 4px 0 2px;
}

.circuit-exercise:first-child {
  border-top: 0;
}

.circuit-exercise-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 0;
  background: transparent;
  text-align: left;
}

.circuit-bullet {
  color: var(--tape);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  width: 12px;
  text-align: center;
}

.circuit-exercise-body {
  padding: 4px 0 12px 22px;
  display: grid;
  gap: 9px;
}

.circuit-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.circuit-rest {
  margin: 6px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.circuit-save {
  margin-top: 8px;
}

.circuit-hint {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.boot-error {
  margin: 14px 16px;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  font-size: 14px;
  line-height: 1.5;
  display: grid;
  gap: 6px;
}

.boot-error[hidden] {
  display: none;
}

.boot-error p {
  margin: 0;
}

.video-error-hint {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.video-error-hint p {
  margin: 0;
}

.video-error-link {
  color: var(--tape);
  font-weight: 700;
  text-decoration: none;
}

.video-wrap {
  display: grid;
  gap: 5px;
}

.video-open-link {
  color: var(--tape);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  justify-self: start;
}

.locked-note {
  margin: 16px 0 4px;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--surface);
  text-align: center;
}

.locked-note h3 {
  font-size: 15px;
  font-weight: 700;
}

.locked-note p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.measure-instructions {
  margin: 18px 0 4px;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--surface);
}

.measure-instructions h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.measure-instructions ul {
  margin-top: 9px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.measure-figure {
  display: flex;
  justify-content: center;
  margin: 4px 0 14px;
}

.measure-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 14px;
  align-items: start;
}

.measure-form-grid .form-row-dual {
  grid-template-columns: 1fr;
}

.measure-form-fields .form-field {
  margin-bottom: 9px;
}

.measure-form-fields .form-field label {
  margin: 0 2px 4px;
  font-size: 11px;
}

.measure-form-fields .form-field input {
  min-height: 40px;
  padding: 8px 11px;
  font-size: 15px;
  border-radius: 11px;
}

.measure-side {
  position: sticky;
  top: 10px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.measure-side .measure-figure {
  margin: 0;
}

.measure-side .measure-svg {
  width: 100%;
  max-width: 138px;
}

.measure-hint {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.measure-hint[hidden] {
  display: none;
}

.measure-hint-label {
  margin: 0 0 3px;
  color: var(--tape);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.measure-hint h3 {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 700;
}

.measure-hint p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.measure-instructions-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.measure-svg {
  width: 118px;
  height: auto;
  color: var(--text);
  opacity: 0.85;
}

.tape-zone {
  stroke: var(--tape);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 28 24;
  opacity: 0;
  transition: opacity 180ms ease;
}

.tape-zone.active {
  opacity: 1;
  animation: tape-march 0.7s linear infinite;
}

@keyframes tape-march {
  to {
    stroke-dashoffset: -104;
  }
}

.form-row-dual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 9px;
}

.photo-upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px 9px;
}

@media (min-width: 480px) {
  .photo-upload-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.photo-upload-grid input[type="file"] {
  font-size: 12px;
}

.photo-upload-grid input[type="file"]::file-selector-button {
  padding: 7px 10px;
  font-size: 12px;
}

.measure-photos-block {
  margin-top: 11px;
  border-top: 1px solid var(--border);
  padding-top: 11px;
}

.measure-photos-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 9px;
}

.measure-photos-head strong {
  font-size: 13px;
}

.measure-photos-count {
  font-size: 12px;
  color: var(--muted);
}

.measure-photos-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.measure-photo {
  margin: 0;
  display: grid;
  gap: 4px;
}

.measure-photo-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.measure-photo figcaption {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.measure-photos-hint {
  margin: 9px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.history-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.report-actions {
  margin-top: 10px;
}

.is-deleted {
  opacity: 0.65;
}

.deleted-badge {
  margin-top: 6px;
  color: #a43228;
  font-size: 12px;
  font-weight: 600;
}

.original-version {
  border-left: 3px solid var(--accent);
}

.form-hint {
  margin: -3px 2px 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.form-error {
  margin: 2px 2px 14px;
  color: #b42318;
  font-size: 13px;
  line-height: 1.4;
}

.telegram-dark .form-error {
  color: #fda29b;
}

.form-actions {
  display: grid;
  gap: 11px;
  margin-top: 6px;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.section-heading-row > h2 {
  margin: 0 2px;
}

.history-list,
.material-list {
  display: grid;
  gap: 10px;
}

.history-item,
.material-item {
  padding: 16px 17px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.history-heading h3,
.material-item h3 {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.history-values {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.material-item p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.error-card {
  margin-top: 45px;
}

.error-card h1 {
  font-size: 24px;
  letter-spacing: -0.6px;
}

.error-card p {
  margin-bottom: 20px;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 20px;
  bottom: calc(91px + var(--safe-bottom));
  left: 20px;
  max-width: 440px;
  margin: 0 auto;
  padding: 13px 18px;
  border-radius: 15px;
  background: var(--text);
  box-shadow: var(--shadow);
  color: var(--bg);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 340px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-mark {
    animation: none;
  }
}

.admin-client-list,
.admin-report-list,
.admin-activity-list {
  display: grid;
  gap: 12px;
}

.admin-client-card {
  display: flex;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  flex-direction: column;
  text-align: left;
  transition: transform 120ms ease, border-color 120ms ease;
}

.admin-client-card:active {
  transform: scale(0.985);
}

.admin-client-heading,
.admin-client-footer,
.admin-material-heading,
.admin-report-heading,
.admin-activity-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-client-heading {
  align-items: center;
}

.admin-client-name {
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.3px;
}

.unread-badge,
.activity-new-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  min-height: 25px;
  padding: 4px 7px;
  border-radius: 20px;
  background: var(--accent);
  color: #1b1e1a;
  font-size: 11px;
  font-weight: 750;
}

.unread-badge.is-zero {
  background: var(--surface-soft);
  color: var(--muted);
}

.admin-client-activity {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.4;
}

.admin-client-date {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.admin-client-footer {
  align-items: center;
  margin-top: 15px;
}

.admin-client-username {
  color: var(--muted);
  font-size: 12px;
}

.subscription-badge,
.category-badge {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
}

.subscription-badge.status-active {
  background: var(--accent-soft);
  color: var(--text);
}

.subscription-badge.status-expired,
.subscription-badge.status-blocked {
  background: #fce8e6;
  color: #a43228;
}

.telegram-dark .subscription-badge.status-expired,
.telegram-dark .subscription-badge.status-blocked {
  background: #442725;
  color: #fda29b;
}

.admin-back-button {
  margin: 0 0 13px;
}

.admin-first-section {
  margin-top: 0;
}

.admin-empty {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 17px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.assignment-card {
  margin-bottom: 13px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--surface);
}

.assignment-button {
  width: 100%;
}

.assignment-card .assignment-button {
  width: 100%;
  margin-top: 8px;
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 13px;
}

.admin-material-item {
  padding: 18px;
}

.admin-material-heading h3 {
  font-size: 15px;
}

.admin-material-body {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.admin-material-meta {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.material-link {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

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

.admin-stat-card {
  display: flex;
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--surface);
  flex-direction: column;
}

.admin-stat-card > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.admin-stat-card strong {
  margin-top: auto;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.7px;
}

.storage-card {
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--surface);
}

.storage-text {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.storage-track {
  height: 6px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-soft);
}

.storage-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 300ms ease;
}

.activity-chart {
  display: grid;
  height: 218px;
  padding: 17px 12px 13px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--surface);
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.activity-day {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-direction: column;
}

.activity-value {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
}

.activity-track {
  display: flex;
  width: 100%;
  max-width: 25px;
  height: 145px;
  overflow: hidden;
  align-items: flex-end;
  border-radius: 8px;
  background: var(--surface-soft);
}

.activity-bar {
  width: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.activity-date {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
}

.admin-report,
.admin-activity-item {
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

.admin-report-heading h3,
.admin-activity-heading h3 {
  font-size: 14px;
  font-weight: 650;
}

.admin-report-date,
.admin-activity-date {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
}

.admin-report-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.admin-report-text {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.coach-comment {
  margin-top: 13px;
  padding: 12px;
  border-radius: 14px;
  background: var(--accent-soft);
}

.coach-comment > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.coach-comment p {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.45;
}

.material-item .report-media {
  margin-top: 12px;
}

.report-media-list {
  display: grid;
  margin-top: 13px;
  gap: 9px;
}

.report-media {
  display: block;
  width: 100%;
  max-height: 340px;
  border-radius: 14px;
  background: var(--surface-soft);
  object-fit: cover;
}

img.report-media {
  object-fit: contain;
  max-height: none;
}

.photo-wrap {
  display: grid;
  gap: 5px;
}

.photo-zoom-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 3px 0;
  color: var(--tape);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.photo-zoom-hint svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-nav[hidden] {
  display: none;
}

.lightbox-prev {
  left: 10px;
}

.lightbox-next {
  right: 10px;
}

.lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 5px 13px;
}

.lightbox-counter[hidden] {
  display: none;
}

.admin-activity-item.is-unread {
  border-color: var(--accent);
}

.admin-activity-details {
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.admin-activity-item .admin-activity-date {
  margin-top: 7px;
}

.activity-new-badge {
  min-height: 21px;
  padding: 3px 6px;
  font-size: 9px;
}

.danger-button {
  color: #b42318;
}

.telegram-dark .danger-button {
  color: #fda29b;
}

.form-success {
  margin: 2px 2px 14px;
  color: #347a35;
  font-size: 13px;
}

.telegram-dark .form-success {
  color: #a6e3a1;
}

.admin-nav {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-nav .nav-item {
  min-height: 58px;
  padding: 7px 4px;
  flex-direction: column;
  gap: 3px;
  font-size: 10px;
  text-align: center;
}

.admin-nav .nav-item svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 340px) {
  .admin-stats-grid {
    gap: 7px;
  }

  .admin-stat-card {
    padding: 13px;
  }

  .activity-chart {
    gap: 3px;
  }
}

.subscription-form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 340px) {
  .subscription-form-row {
    grid-template-columns: 1fr;
  }
}

.subscription-notice {
  margin: -5px 0 20px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.subscription-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 10px 4px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
}

.subscription-toggle-arrow {
  font-size: 18px;
  line-height: 1;
  transition: transform 180ms ease;
}

.subscription-toggle[aria-expanded="true"] .subscription-toggle-arrow {
  transform: rotate(180deg);
}

.subscription-form {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: max-height 240ms ease, opacity 180ms ease, visibility 240ms ease, margin-top 240ms ease;
}

.subscription-form.is-open {
  max-height: 680px;
  margin-top: 16px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .subscription-form,
  .subscription-toggle-arrow {
    transition: none;
  }
}

.notification-list,
.note-list {
  display: grid;
  gap: 10px;
}

.notification-item,
.note-item,
.voice-note-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.notification-heading,
.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-heading h3,
.voice-note-item h3 {
  font-size: 14px;
  font-weight: 650;
}

.notification-toggle {
  min-width: 52px;
  padding: 6px 9px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.notification-toggle.is-on {
  background: var(--accent);
  color: #1b1e1a;
}

.notification-message,
.note-text {
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.notification-meta,
.note-footer > span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.note-footer {
  margin-top: 8px;
}

.note-footer > span:last-child {
  display: inline-flex;
  gap: 6px;
}

.voice-recorder {
  display: grid;
  margin: 14px 0 2px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  gap: 9px;
}

.voice-recorder > span {
  color: var(--muted);
  font-size: 12px;
}

.voice-recorder audio,
.voice-note-item audio {
  width: 100%;
}

.voice-note-item audio {
  margin: 10px 0;
}

.check-row {
  display: flex;
  align-items: center;
  margin: 0 2px 12px;
  color: var(--muted);
  gap: 9px;
  font-size: 13px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.policy-footer {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}

.policy-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.policy-card {
  padding: 0 2px;
  border: 0;
  background: transparent;
}

.policy-card h2 {
  margin-top: 24px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.15px;
}

.policy-card h2:first-child {
  margin-top: 0;
}

.policy-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.form-field input[type="date"],
.form-field input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.time-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-picker select {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 13px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  min-height: 48px;
  padding: 11px 13px;
}

.time-picker select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.time-picker-sep {
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
}

.once-schedule {
  border-radius: 14px;
  background: var(--accent-soft);
  padding: 12px 13px;
  display: grid;
  gap: 7px;
}

.once-schedule[hidden] {
  display: none;
}

.once-schedule .form-hint {
  margin: 0;
  font-size: 12px;
}

.once-schedule input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
}

.variant-picker {
  display: grid;
  gap: 8px;
}

.variant-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--bg);
  font-size: 15px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.variant-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.variant-radio {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.variant-option.selected {
  background: var(--accent-soft);
  border-color: var(--tape);
}

.variant-option.selected .variant-radio {
  border-color: var(--tape);
}

.variant-option.selected .variant-radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--tape);
}

.form-row .form-field {
  min-width: 0;
}

.notification-form-row {
  grid-template-columns: 1fr;
}

@media (min-width: 381px) {
  .notification-form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.recording-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid #f0c8c4;
  border-radius: 999px;
  background: #fdf1ef;
  color: #a43228;
  font-size: 11px;
  font-weight: 650;
}

.telegram-dark .recording-indicator {
  border-color: #53312f;
  background: #332220;
  color: #fda29b;
}

.recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d92d20;
  animation: recording-pulse 1s ease-in-out infinite;
}

@keyframes recording-pulse {
  0%, 100% {
    opacity: 0.35;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}
