/* ============================================================
   app.css — mobile-first styles
   ============================================================ */

/* ── Color tokens ── light theme (default) ─────────────────── */
:root {
  /* Brand */
  --c-primary:        #2563eb;
  --c-primary-dark:   #1d4ed8;
  --c-primary-light:  #dbeafe;
  --c-primary-border: #bfdbfe;
  --c-primary-bg:     #eff6ff;

  /* Surfaces */
  --c-bg:       #f0f2f5;
  --c-surface:  #ffffff;
  --c-surface-2:#f1f5f9;
  --c-surface-3:#f8fafc;

  /* Text */
  --c-text:       #1a1a1a;
  --c-text-2:     #444444;
  --c-text-3:     #888888;
  --c-text-muted: #aaaaaa;
  --club-header-text: #167d38;

  /* Borders */
  --c-border:       #e0e4ea;
  --c-border-light: #cccccc;

  /* Status colors */
  --c-success:      #16a34a;
  --c-success-bg:   #dcfce7;
  --c-success-dark: #15803d;
  --c-danger:       #dc2626;
  --c-danger-light: #ef4444;
  --c-danger-bg:    #fee2e2;
  --c-warning:      #f59e0b;
  --c-warning-bg:   #fef3c7;
  --c-purple:       #7c3aed;
  --c-purple-light: #8b5cf6;
  --c-purple-bg:    #ede9fe;
  --c-purple-pale:  #f5f3ff;
  --c-purple-border:#ddd6fe;

  /* Auth gradient */
  --c-auth-start: #b5c8c5;
  --c-auth-end:   #acbfbc;

  /* Overlays / shadows */
  --c-overlay:     rgba(0,0,0,.45);
  --c-overlay-dark:rgba(10,15,25,.65);
  --shadow-card:   0 2px 8px rgba(0,0,0,.08);
  --shadow-modal:  0 8px 32px rgba(0,0,0,.18);
  --shadow-burger: -4px 0 24px rgba(0,0,0,.12);

  --points-burst-stroke: rgba(0,0,0,.3);
  --points-burst-shadow: rgba(0,0,0,.35);

  --water-bg: linear-gradient(aliceblue, transparent 74%);
  --water-top-line-color: rgb(181, 218, 250);
}

/* ── Dark theme ─────────────────────────────────────────────── */
[data-theme="dark"] {
  --c-primary:        #3b82f6;
  --c-primary-dark:   #2563eb;
  --c-primary-light:  #1e3a5f;
  --c-primary-border: #1e40af;
  --c-primary-bg:     #172554;

  --c-bg:       #0f172a;
  --c-surface:  #1e293b;
  --c-surface-2:#273549;
  --c-surface-3:#1a2840;

  --c-text:       #f1f5f9;
  --c-text-2:     #cbd5e1;
  --c-text-3:     #94a3b8;
  --c-text-muted: #64748b;
  --club-header-text: #56f68b;

  --c-border:       #334155;
  --c-border-light: #475569;

  --c-success:      #22c55e;
  --c-success-bg:   #14532d;
  --c-success-dark: #16a34a;
  --c-danger:       #f87171;
  --c-danger-light: #fca5a5;
  --c-danger-bg:    #450a0a;
  --c-warning:      #fbbf24;
  --c-warning-bg:   #451a03;
  --c-purple:       #a78bfa;
  --c-purple-light: #c4b5fd;
  --c-purple-bg:    #2e1065;
  --c-purple-pale:  #1e1033;
  --c-purple-border:#4c1d95;

  --c-auth-start: #9ab3b0;
  --c-auth-end:   #acbfbc;

  --c-overlay:      rgba(0,0,0,.65);
  --c-overlay-dark: rgba(0,0,0,.75);
  --shadow-card:    0 2px 8px rgba(0,0,0,.35);
  --shadow-modal:   0 8px 32px rgba(0,0,0,.55);
  --shadow-burger:  -4px 0 24px rgba(0,0,0,.45);

  --points-burst-stroke: rgba(255,255,255,.7);
  --points-burst-shadow: rgba(255,255,255,.35);

  --water-bg: linear-gradient( #0a0a6a, transparent 60%);
  --water-top-line-color: #2c2cb3;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; height: -webkit-fill-available; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 16px;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}
::-webkit-scrollbar { display: none; }
.hidden { display: none !important; }

/* ── Auth ───────────────────────────────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--c-auth-start) 0%, var(--c-auth-end) 100%);
}
.auth-box {
  background: #48635e;
  border-radius: 24px;
  padding: 32px 24px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.auth-logo { font-size: 48px; text-align: center; margin-bottom: 8px; }
.auth-logo-img { width: 260px; height: auto; display: block; margin: 0 auto; }
.auth-tagline { font-size: .6rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; text-align: center; color: #f0e8dbaa; margin-bottom: .6rem; border-bottom: solid 1px #f0e8db55; padding-bottom: 1.3rem}
.auth-title { font-size: 22px; font-weight: 700; text-align: center; color: #ffffff; margin-bottom: 28px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--c-text-3); margin-bottom: 5px; }
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  font-size: 15px;
  color: var(--c-text);
  background: var(--c-surface-3);
  transition: border-color .15s;
  -webkit-appearance: none;
}
input::placeholder, textarea::placeholder {
  color: #ccc
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: var(--c-primary); background: var(--c-surface); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 4px; color: var(--c-text-3); display: flex; align-items: center; }
.pw-toggle:hover { color: var(--c-text); }
.pw-toggle svg { width: 20px; height: 20px; }
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: background .15s;
}
.btn-primary:active { background: var(--c-primary-dark); transform: scale(.98); }
.auth-switch { text-align: center; font-size: 13px; color: var(--c-text-3); margin-top: 16px; }
.auth-switch a { color: var(--c-primary); text-decoration: none; font-weight: 600; }
.auth-error { background: var(--c-danger-bg); color: var(--c-danger); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-top: 10px; }
.remember-me-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-text-3); margin-bottom: 14px; cursor: pointer; user-select: none; }
.remember-me-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--c-primary); cursor: pointer; flex-shrink: 0; }
.password-setup {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.password-setup-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}
.password-setup-email {
  font-size: 13px;
  color: #acbfbc;
  margin-bottom: 12px;
  word-break: break-word;
}
.field-hint {
  font-size: 12px;
  color: rgba(255,255,255,.55);
  margin-top: 5px;
}

/* Auth-box overrides — dark card needs light-adapted elements */
.auth-box .form-group label { color: rgba(255,255,255,.70); }
.auth-box .form-group input,
.auth-box .form-group select {
  background: rgba(0,0,0,.18);
  border-color: rgba(255,255,255,.20);
  color: #ffffff;
}
.auth-box .form-group input::placeholder { color: rgba(255,255,255,.40); }
.auth-box .form-group input:focus,
.auth-box .form-group select:focus { border-color: #acbfbc; background: rgba(0,0,0,.22); }
.auth-box .pw-toggle { color: rgba(255,255,255,.50); }
.auth-box .pw-toggle:hover { color: rgba(255,255,255,.90); }
.auth-box .remember-me-label { color: rgba(255,255,255,.70); }
.auth-box .remember-me-label input[type=checkbox] { accent-color: #acbfbc; }
.auth-box .btn-primary { background: #acbfbc; color: #2d4a45; }
.auth-box .btn-primary:active { background: #9aafac; transform: scale(.98); }
.auth-box .auth-error { background: rgba(220,38,38,.20); color: #fca5a5; }
.auth-box .auth-switch { color: rgba(255,255,255,.60); }
.auth-box .auth-switch a { color: #acbfbc; }
.auth-disclaimer { margin-top: 16px; font-size: 11px; color: rgba(0,0,0,.40); text-align: center; max-width: 320px; line-height: 1.5; }
.auth-disclaimer2 { margin-top: 5px; font-size: 11px; color: #f0e8dbff; text-align: center; max-width: 320px; line-height: 1.5; }

/* ── App Shell ──────────────────────────────────────────────── */
#appShell { display: flex; flex-direction: column; min-height: 100vh; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--c-surface);
  box-shadow: 0 1px 0 var(--c-border);
  padding-top: env(safe-area-inset-top);
}
.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 12px;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.app-title { font-size: 16px; font-weight: 700; color: var(--c-text); }
.header-right { display: flex; align-items: center; gap: 8px; }
.header-user-block { display: flex; flex-direction: column; align-items: flex-end; }
.user-name { font-size: 13px; color: var(--c-text-3); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-club-name { font-size: 10px; color: var(--club-header-text); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.65; line-height: 1.2; }
.create-user-club-info { background: #eff6ff; border: 1.5px solid #bfdbfe; border-radius: 10px; padding: 10px 13px; margin-bottom: 14px; font-size: 13px; color: #1d4ed8; line-height: 1.7; }
.btn-icon {
  width: 36px; height: 36px;
  border: none; background: var(--c-surface-2); border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.btn-icon svg { width: 18px; height: 18px; stroke: var(--c-text-3); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-icon:active { background: var(--c-surface-2); }

/* ── Pages ──────────────────────────────────────────────────── */
main { flex: 1; }
.page {
  padding: 12px 12px calc(200px + env(safe-area-inset-bottom));
  max-width: 640px;
  margin: 0 auto;
}

/* ── Next meal card ─────────────────────────────────────────── */
.next-card {
  background: var(--c-surface);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.next-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.next-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--c-text-3); }
.next-time-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.next-time { font-size: 36px; font-weight: 700; color: var(--c-text); line-height: 1; letter-spacing: -.5px; }
.next-name { font-size: 17px; color: var(--c-text-2); font-weight: 500; }
.countdown { font-size: 14px; color: var(--c-primary); margin-top: 6px; font-weight: 600; }
.next-items { margin-top: 10px; font-size: 14px; color: var(--c-text-3); line-height: 1.8; }
.notif-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid #bfdbfe; border-radius: 16px;
  background: #eff6ff; cursor: pointer; color: var(--c-primary-dark);
  font-size: 11px; font-weight: 600; padding: 7px 10px; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .08);
}
.notif-btn-icon { width: 16px; height: 16px; display: inline-flex; flex-shrink: 0; }
.notif-btn-icon svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.notif-btn-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.notif-btn-label-main { display: block; }
.notif-btn-label-sub { display: block; font-size: 10px; color: var(--c-primary); font-weight: 700; }
.notif-btn.on {
  border: none; background: transparent; padding: 0;
  color: #16a34a; font-size: 18px; box-shadow: none;
}
.notif-btn.on .notif-btn-icon { width: 20px; height: 20px; }
.notif-btn.on .notif-btn-label { display: none; }

/* ── Meal sections ──────────────────────────────────────────── */
.section { margin-bottom: 8px; }
.sec-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px; background: var(--c-surface); border-radius: 12px;
  cursor: pointer; user-select: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.sec-header.open { border-radius: 12px 12px 0 0; }
.sec-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.sec-title { font-size: 15px; font-weight: 600; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sec-time { font-size: 12px; color: var(--c-text-3); white-space: nowrap; }
.badge { font-size: 11px; padding: 3px 9px; border-radius: 20px; white-space: nowrap; font-weight: 600; }
.badge-now  { background: var(--c-success-bg); color: var(--c-success-dark); }
.badge-done { background: var(--c-surface-2); color: var(--c-text-3); }
.badge-next { background: var(--c-primary-light); color: var(--c-primary-dark); }
.chevron { font-size: 18px; color: var(--c-text-muted); transition: transform .2s; flex-shrink: 0; margin-left: 6px; line-height: 1; display: inline-block; }
.chevron.open { transform: rotate(180deg); }

.items-list {
  background: var(--c-surface);
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,.04);
}
.item-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-top: 1px solid var(--c-border);
}
.item-row:active { background: var(--c-surface-3); }
.item-row-info { align-items: flex-start; background: var(--c-surface-3); }
.item-row-info:active { background: var(--c-surface-3); }
.item-row-info-warning { background: #fff7ed; }
.item-row-info-warning:active { background: #fff7ed; }
.item-row input[type=checkbox] {
  width: 20px; height: 20px; cursor: pointer;
  accent-color: var(--c-primary); flex-shrink: 0;
}
.item-lbl { font-size: 14px; color: var(--c-text-2); cursor: pointer; line-height: 1.5; flex: 1; }
.item-lbl-info { font-style: italic; color: var(--c-text-3); cursor: default; }
.item-lbl-info-warning { color: #9a3412; font-weight: 600; }
.item-lbl-info-note { color: var(--c-text-3); }
.item-lbl-info-warning::before { content: '⚠ '; }
.item-lbl-info-note::before { content: 'ℹ '; }
.item-lbl.done { text-decoration: line-through; color: var(--c-text-muted); }

.next-item-info { color: var(--c-text-muted); font-style: italic; }
.next-item-info-warning { color: #9a3412; font-weight: 600; }
.next-item-info-note { color: var(--c-text-muted); }
.next-item-info-warning::before { content: '⚠ '; }
.next-item-info-note::before { content: 'ℹ '; }

/* Custom text row */
.custom-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--c-border);
  background: var(--c-surface-3);
}
.custom-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--c-primary); flex-shrink: 0; cursor: pointer; }
.custom-input {
  flex: 1; border: none; border-bottom: 1.5px solid var(--c-border);
  background: transparent; font-size: 14px; color: var(--c-text-2);
  padding: 4px 2px; outline: none;
}
.custom-input:focus { border-bottom-color: var(--c-primary); }
.custom-input::placeholder { color: var(--c-text-muted); font-style: italic; }

/* ── Photos ─────────────────────────────────────────────────── */
.meal-note-box {
  background: linear-gradient(180deg, var(--c-purple-pale) 0%, var(--c-surface) 100%);
  border: 1px solid var(--c-purple-border);
  border-radius: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  overflow: hidden;
}
.meal-note-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.meal-note-toggle-copy {
  min-width: 0;
}
.meal-note-label {
  margin-bottom: 4px;
}
.meal-note-toggle-hint {
  display: block;
  font-size: 12px;
  color: var(--c-purple);
  line-height: 1.4;
}
.meal-note-toggle-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--c-purple-bg);
  color: var(--c-purple);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  flex-shrink: 0;
}
.meal-note-box.is-open .meal-note-toggle-icon {
  transform: rotate(45deg);
}
.meal-note-panel {
  padding: 0 16px 14px;
}
.meal-note-input {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1.5px solid var(--c-purple-border);
  border-radius: 12px;
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.45;
  padding: 12px 14px;
  outline: none;
}
.meal-note-input:focus {
  border-color: var(--c-purple-light);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .12);
}
.meal-note-hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--c-purple);
}
.photo-box { background: var(--c-surface); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.section-label { font-size: 13px; color: var(--c-text-3); margin-bottom: 10px; font-weight: 600; display: block; }
.photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.photo-action-btn {
  border: 1.5px solid #bfdbfe;
  background: var(--c-primary-bg);
  color: var(--c-primary-dark);
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.photo-action-btn.secondary {
  background: var(--c-surface-3);
  border-color: var(--c-border);
  color: var(--c-text-2);
}
.photo-action-btn:active {
  transform: scale(.98);
}
.dropzone {
  border: 2px dashed #c7d2e0; border-radius: 12px;
  padding: 16px 14px; text-align: center; cursor: pointer;
  font-size: 14px; color: var(--c-text-3); transition: background .15s;
  display: none;
}
.dropzone:active { background: var(--c-primary-bg); }
.previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preview-wrap { position: relative; display: inline-block; }
.preview-wrap img { width: 80px; height: 80px; object-fit: cover; border-radius: 10px; border: 1px solid var(--c-border); display: block; }
.preview-del {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-danger-light); color: #fff; border: none;
  font-size: 13px; cursor: pointer; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── Save btn ────────────────────────────────────────────────── */
.btn-save {
  width: 100%; padding: 16px; font-size: 16px; font-weight: 700;
  background: var(--c-primary); color: #fff; border: none; border-radius: 14px;
  cursor: pointer; letter-spacing: .01em; transition: background .15s;
}
.btn-save:active { background: var(--c-primary-dark); transform: scale(.98); }
.btn-save:disabled { background: var(--c-primary-border); cursor: not-allowed; }

/* ── Water bar ───────────────────────────────────────────────── */
.water-bar {
  position: fixed;
  bottom: calc(56px + env(safe-area-inset-bottom));
  left: 0; right: 0;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  z-index: 80;
  padding: 8px 12px;
    background-image: var(--water-bg);
  border-top: 1px solid var(--water-top-line-color);
}
.water-bar-inner { max-width: 640px; margin: 0 auto; }
.water-info {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 7px;
}
.water-icon { width: 18px; height: 18px; fill: var(--c-primary); flex-shrink: 0; }
.water-progress-wrap {
  flex: 1;
  height: 48px;
  position: relative;
  overflow: visible;
}
.water-summary {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-primary-dark);
  white-space: nowrap;
}
.water-progress-wrap::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: var(--c-primary-light);
  border-radius: 999px;
}
.water-progress-bar {
  position: absolute;
  left: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: var(--c-primary);
  border-radius: 999px;
  transition: width .4s ease;
}
.water-timeline {
  position: absolute;
  inset: 0;
}
.water-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--c-primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #93c5fd;
  z-index: 2;
}
.water-dot.is-active {
  background: var(--c-primary-dark);
  box-shadow: 0 0 0 1px #1d4ed8, 0 0 0 4px rgba(59, 130, 246, .22);
}
.water-time {
  position: absolute;
  left: 0;
  transform: translateX(-50%);
  font-size: 10px;
  line-height: 1;
  color: var(--c-primary-dark);
  white-space: nowrap;
  z-index: 3;
  font-weight: 700;
}
.water-time.above { top: 2px; }
.water-time.below { bottom: 2px; }
.water-time.is-tight.above { transform: translateX(calc(-50% - 7px)); }
.water-time.is-tight.below { transform: translateX(calc(-50% + 7px)); }
.water-time.is-hidden { display: none; }

.water-dot-note {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-primary-dark);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 8px;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 3px 10px rgba(29, 78, 216, .28);
  pointer-events: none;
}
.water-dot-note.align-left { transform: translateX(0); }
.water-dot-note.align-right { transform: translateX(-100%); }
.water-btns { display: flex; gap: 6px; }
.water-btn {
  flex: 1; padding: 7px 4px; border: 1.5px solid #bfdbfe;
  border-radius: 8px; background: var(--c-primary-bg); color: var(--c-primary-dark);
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background .1s;
}
.water-btn:active { background: var(--c-primary-light); transform: scale(.96); }

.water-bar.water-info-hidden .water-info { display: none; }
.water-bar.water-info-hidden { padding-top: 6px; padding-bottom: 6px; }

/* ── Bottom nav ─────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 9px 8px; cursor: pointer;
  color: var(--c-text-muted); font-size: 11px; font-weight: 500; gap: 3px;
  border: none; background: none; min-height: 56px;
  transition: color .15s;
}
.nav-tab.active { color: var(--c-primary); }
.nav-tab svg {
  width: 22px; height: 22px; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ── History ─────────────────────────────────────────────────── */
.day-card { background: var(--c-surface); border-radius: 16px; margin-bottom: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.day-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; cursor: pointer; background: var(--c-surface-3);
  border-bottom: 1px solid #e9eef5;
}
.day-title { font-size: 15px; font-weight: 700; color: var(--c-text); }
.day-meta { display: flex; align-items: center; gap: 8px; }
.day-count { font-size: 12px; color: var(--c-text-muted); }
.day-water { font-size: 12px; color: var(--c-primary); font-weight: 600; }
.day-points { font-size: 12px; color: #f59e0b; font-weight: 600; }
.day-body { padding: 10px 14px; }

.points-widget { margin: 0 0 12px; padding: 8px 12px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; }
.points-widget-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.points-summary { font-size: 14px; font-weight: 700; color: #f59e0b; }
.points-streak { font-size: 12px; color: var(--c-text-muted); }
/* margin-right: auto лепи иконката до summary-то и бута streak-а вдясно */
.points-info-wrap { position: relative; display: inline-flex; margin-right: auto; }
.points-info-btn {
  width: 18px; height: 18px; padding: 0; border: none; border-radius: 50%;
  background: var(--c-primary-light); color: var(--c-text-muted);
  font-size: 11px; font-weight: 700; line-height: 18px; cursor: pointer;
}
/* -40% вместо -50%: иконката е близо до левия ръб на екрана и центриран
   балон би се изрязал наляво на тесни телефони; стрелката стои на 40% */
.points-info-tooltip {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-40%);
  width: min(260px, 74vw);
  background: var(--c-surface-2); color: var(--c-text);
  border: 1px solid var(--c-border);
  font-size: 12px; font-weight: 400; line-height: 1.45; text-align: left;
  padding: 8px 11px; border-radius: 8px;
  z-index: 50; box-shadow: var(--shadow-modal);
}
.points-info-tooltip::after {
  content: ''; position: absolute; bottom: 100%; left: 40%; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: var(--c-surface-2);
}
.points-progress-wrap { height: 6px; background: var(--c-primary-light); border-radius: 999px; overflow: hidden; }
.points-progress-bar { height: 100%; background: #f59e0b; border-radius: 999px; transition: width .4s ease; }

.points-history { display: flex; gap: 4px; margin-top: 6px; justify-content: space-between; }
.points-history-day { flex: 1; text-align: center; font-size: 14px; opacity: .5; }
.points-history-day-hit { opacity: 1; }
.points-history-day-miss { opacity: .35; }

.points-burst {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 9999;
  pointer-events: none;
  transform: translateX(-50%);
}

.points-burst-num {
  position: relative;
  display: inline-block;
  font-weight: 900;
  font-size: 56px;
  line-height: 1;
  white-space: nowrap;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #ec4899, #22c55e, #3b82f6, #eab308, #f59e0b);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px var(--points-burst-stroke, #fff);
  text-shadow: 0 4px 18px var(--points-burst-shadow, rgba(0,0,0,.35));
  animation: pointsBurstRise 3.2s ease-out forwards,
             pointsBurstGradient 1.1s linear infinite;
}

.points-burst-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 24px;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: pointsBurstSpark .9s ease-out 1.3s forwards;
}

@keyframes pointsBurstGradient {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

@keyframes pointsBurstSpark {
  0%   { transform: translate(-50%, -50%) scale(.2) rotate(0deg); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--spark-tx)), calc(-50% + var(--spark-ty))) scale(1.2) rotate(var(--spark-rot)); opacity: 0; }
}

/* Издига се до средата на екрана с "тупващо" кацане (overshoot + bounce-back),
   олюлявайки се настрани по пътя нагоре — по-разчупено и весело от плавен float. */
@keyframes pointsBurstRise {
  0%   { transform: translateY(15vh) translateX(0)    scale(.3)  rotate(0deg);   opacity: 0; }
  5%   { opacity: 1; }
  12%  { transform: translateY(-8vh)  translateX(20vw) scale(1.2) rotate(-16deg); }
  20%  { transform: translateY(-22vh) translateX(-30vw)  scale(1.7) rotate(14deg); }
  27%  { transform: translateY(-38vh) translateX(30vw) scale(2.3) rotate(-9deg); }
  32%  { transform: translateY(-53vh) translateX(0)     scale(3.6) rotate(5deg); }
  38%  { transform: translateY(-49vh) translateX(0)     scale(7.0) rotate(15deg); }
  47%  { transform: translateY(-50vh) translateX(0)     scale(3.1) rotate(0deg); opacity: 1; }
  92%  { transform: translateY(-50vh) scale(3.1) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-50vh) scale(5.3) rotate(720deg); opacity: 0; }
}

.points-admin-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.points-admin-search { flex: 1; min-width: 140px; padding: 8px 10px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); color: var(--c-text); font-size: 13px; }
.points-admin-sort { display: flex; gap: 4px; }
.points-admin-sort-btn { padding: 6px 10px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); color: var(--c-text-muted); font-size: 12px; cursor: pointer; }
.points-admin-sort-btn.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.points-admin-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.points-admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.points-admin-name { font-weight: 700; font-size: 14px; color: var(--c-text); }
.points-admin-trainer { font-weight: 400; color: var(--c-text-muted); }
.points-admin-streak { font-size: 12px; color: var(--c-text-muted); }
.points-admin-today { font-size: 13px; color: #f59e0b; font-weight: 600; margin-bottom: 6px; }
.points-admin-history { display: flex; flex-wrap: wrap; gap: 6px; }
.points-admin-history-day { font-size: 11px; color: var(--c-text-muted); background: var(--c-bg); border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; }
.points-admin-history-day-hit { border-color: var(--c-text); }

/* ── Activity admin (само user_id=1) ── */
.activity-day-picker { display: flex; align-items: center; gap: 4px; }
.activity-day-nav { padding: 6px 10px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); color: var(--c-text-muted); font-size: 14px; cursor: pointer; }
.activity-day-input { padding: 6px 10px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); color: var(--c-text); font-size: 12px; }
.activity-filters-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.activity-admin-chart-caption { font-size: 12px; color: var(--c-text-muted); margin-bottom: 4px; }
.activity-action-filter { flex: 1 1 160px; padding: 8px 10px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); color: var(--c-text); font-size: 13px; }
.activity-admin-tiles { display: flex; gap: 8px; margin-bottom: 12px; }
.activity-admin-tile { flex: 1; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; padding: 10px 8px; text-align: center; }
.activity-admin-tile-num { font-size: 22px; font-weight: 700; color: var(--c-text); }
.activity-admin-tile-label { font-size: 11px; color: var(--c-text-muted); margin-top: 2px; }
.activity-admin-chart-wrap { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; padding: 10px; margin-bottom: 12px; height: 280px; position: relative; }
.activity-admin-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 13px; }
.activity-admin-row-time { font-size: 11px; color: var(--c-text-muted); white-space: nowrap; }
.activity-admin-row-actor { font-weight: 700; color: var(--c-text); }
.activity-admin-row-action { color: var(--c-text); }
.activity-admin-row-target { color: var(--c-text-muted); }
.activity-person-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.activity-person-link:hover { color: var(--c-primary); }
.day-water-chart {
  padding-top: 12px;
  margin: 0 -14px;
  padding: 10px 14px 0px;
  background-image: var(--water-bg);
  border-top: 1px solid var(--water-top-line-color);
}
.day-water-chart-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-primary-dark);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.day-water-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.water-progress-wrap-history {
  flex: 1;
  height: 44px;
  margin-bottom: 0;
}
.water-summary-history {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-primary-dark);
}
.log-row { display: flex; gap: 12px; padding: 9px 0; align-items: flex-start; }
.log-row:has(~ .log-row) {
  border-bottom: 1px solid var(--c-border);
}
.log-row.note-entry {
  background: var(--c-purple-pale);
  border-left: 3px solid var(--c-purple-light);
  margin: 0 -14px;
  padding: 10px 14px;
}
.log-time-col { display: flex; flex-direction: column; align-items: flex-end; min-width: 48px; flex-shrink: 0; padding-top: 2px; width: 70px; }
.log-time { font-size: 15px; font-weight: 700; color: var(--c-primary); line-height: 1.2; }
.log-meal-name { font-size: 11px; color: var(--c-text-muted); margin-top: 2px; text-align: right; }
.log-note-badge { color: var(--c-purple); font-weight: 700; }
.log-time-wrap { display: flex; align-items: center; gap: 3px; position: relative; }
.log-time-edited-marker {
  width: 15px;
  height: 15px;
  padding: 0;
  border: none;
  border-radius: 0%;
  background: transparent;
  color: var(--c-text-muted);
  font-size: 9px;
  line-height: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: .8;
}
.comment-indicator {
  margin-top: 6px;
  width: 26px;
  height: 20px;
  border: 1px solid #bfdbfe;
  background: var(--c-primary-bg);
  color: var(--c-primary-dark);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.comment-indicator.unread {
  background: var(--c-warning);
  border-color: var(--c-warning);
  color: #fff;
  animation: commentPulse 1.2s ease-in-out infinite;
}
@keyframes commentPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245,158,11,.45); }
  70% { transform: scale(1.04); box-shadow: 0 0 0 8px rgba(245,158,11,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}
.gap-row { display: flex; align-items: center; font-size: 12px; font-weight: 700; color: var(--c-warning); padding: 3px 0; margin: 1px 0; }
.gap-row::before { content: ''; flex: 1; height: 1px; background: var(--c-warning-bg); margin-right: 8px; }
.log-content { flex: 1; }
.log-item { font-size: 14px; color: var(--c-text-2); line-height: 1.6; }
.log-item.custom { color: var(--c-purple); font-style: italic; }
.log-note-text {
  background: var(--c-purple-pale);
  border: 1px solid #ddd6fe;
  border-left: 4px solid var(--c-purple-light);
  border-radius: 12px;
  color: var(--c-purple);
  font-size: 14px;
  line-height: 1.5;
  padding: 11px 12px;
  white-space: pre-wrap;
}
.log-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.log-photos a img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--c-border); display: block; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--c-text-muted); font-size: 15px; }
.spinner { text-align: center; padding: 40px; color: var(--c-text-muted); font-size: 14px; }
.btn-load-more {
  display: block; width: 100%; padding: 12px;
  background: var(--c-surface-2); color: var(--c-text-3); border: none;
  border-radius: 12px; font-size: 14px; cursor: pointer;
  margin-bottom: 12px;
}
.btn-load-more:active { background: var(--c-surface-2); }

/* ── Photo lightbox ─────────────────────────────────────────── */
.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 15, 25, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.photo-lightbox.hidden { display: none !important; }
.photo-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.photo-lightbox-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.photo-lightbox-close:active { transform: scale(.96); }

/* Confirm / destructive modal */
.confirm-modal {
  position: fixed; inset: 0; z-index: 1050;
  background: rgba(10,15,25,.65);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.confirm-modal.hidden { display: none !important; }
.confirm-modal-card {
  width: 100%; max-width: 340px;
  background: var(--c-surface); border-radius: 20px;
  padding: 28px 22px 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
  text-align: center;
}
.confirm-modal-icon {
  font-size: 44px; line-height: 1;
  margin-bottom: 14px;
}
.confirm-modal-title {
  font-size: 17px; font-weight: 700; color: var(--c-text);
  margin-bottom: 8px;
}
.confirm-modal-body {
  font-size: 14px; color: var(--c-text-3); line-height: 1.5;
  margin-bottom: 22px;
}
.confirm-modal-actions {
  display: flex; gap: 10px;
}
.confirm-modal-btn {
  flex: 1; padding: 11px 0; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; border: none;
}
.confirm-modal-btn.secondary {
  background: var(--c-surface-2); color: var(--c-text-2);
}
.confirm-modal-btn.secondary:active { background: var(--c-surface-2); }
.confirm-modal-btn.danger {
  background: #ef4444; color: #fff;
}
.confirm-modal-btn.danger:active { background: var(--c-danger); }
.confirm-modal-btn.primary {
  background: var(--c-primary); color: #fff;
}
.confirm-modal-btn.primary:active { background: var(--c-primary-dark); }

/* Water goal celebration modal */
.water-celeb-modal {
  position: fixed; inset: 0; z-index: 1060;
  background: var(--c-overlay-dark);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  backdrop-filter: blur(2px);
}
.water-celeb-modal.hidden { display: none !important; }
.water-celeb-card {
  width: 100%; max-width: 340px;
  background: var(--c-surface); border-radius: 20px;
  padding: 32px 22px 26px;
  box-shadow: var(--shadow-modal);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.water-celeb-close {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border: none; border-radius: 999px;
  background: var(--c-surface-2); color: var(--c-text-2);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.water-celeb-ripple-wrap {
  position: relative; width: 96px; height: 96px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
}
.water-celeb-icon {
  font-size: 48px; line-height: 1; position: relative; z-index: 2;
  animation: waterCelebBounceIn .6s cubic-bezier(.34,1.56,.64,1);
}
.water-celeb-ring {
  position: absolute; inset: 0; border-radius: 999px;
  border: 3px solid var(--c-primary);
  opacity: 0;
  animation: waterCelebRipple 1.8s ease-out infinite;
}
.water-celeb-ring-2 { border-color: var(--c-success); animation-delay: .3s; }
.water-celeb-ring-3 { border-color: var(--c-purple); animation-delay: .6s; }
.water-celeb-number {
  font-size: 40px; font-weight: 800; color: var(--c-success);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.water-celeb-title {
  font-size: 17px; font-weight: 700; color: var(--c-text);
  margin-bottom: 6px;
}
.water-celeb-body { font-size: 14px; color: var(--c-text-3); }

@keyframes waterCelebBounceIn {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes waterCelebRipple {
  0%   { transform: scale(.4); opacity: .65; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Water goal celebration — variant B: rising wave fill */
.water-celeb-wave-card {
  width: 100%; max-width: 300px; height: 460px; max-height: 82vh;
  background: var(--c-surface-3);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-modal);
  display: flex; flex-direction: column; justify-content: space-between;
  animation: waterCelebWavePopIn .5s cubic-bezier(.175,.885,.32,1.275) forwards;
  box-sizing: border-box;
}
.water-celeb-wave-fill {
  position: absolute; bottom: -5px; left: 0; width: 100%; height: 0%;
  animation: waterCelebWaveFillUp 2.8s .4s cubic-bezier(.4,0,.2,1) forwards;
}
.water-celeb-wave-body { background: var(--c-primary); height: 100%; width: 100%; margin-top: -5px; }
.water-celeb-wave-svg {
  position: absolute; left: 0; width: 200%; height: 60px;
}
.water-celeb-wave-front { top: -60px; fill: var(--c-primary); opacity: .8; animation: waterCelebWaveMove 4s linear infinite; }
.water-celeb-wave-back  { top: -55px; fill: var(--c-primary-dark); opacity: .5; animation: waterCelebWaveMoveBack 3s linear infinite; }

.water-celeb-wave-content {
  position: relative; z-index: 10; text-align: center;
  padding: 30px 24px;
  color: #fff;
  display: flex; flex-direction: column; align-items: center;
  height: 100%; justify-content: space-between;
  opacity: 0;
  animation: waterCelebWaveFadeIn .6s 2.0s ease-out forwards;
}
.water-celeb-wave-close {
  position: absolute; top: 0; right: 0;
  width: 34px; height: 34px; border: none; border-radius: 999px;
  background: rgba(255,255,255,.18); color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer;
}
.water-celeb-wave-icon { font-size: 3rem; margin-bottom: 10px; }
.water-celeb-wave-title { font-size: 1.4rem; margin: 0 0 10px; font-weight: 700; }
.water-celeb-wave-text { font-size: .92rem; opacity: .9; line-height: 1.4; margin: 0; }
.water-celeb-wave-btn {
  background: #fff; color: var(--c-primary);
  border: none; padding: 12px 40px; border-radius: 12px;
  font-weight: 600; font-size: 1rem; cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1);
}
.water-celeb-wave-btn:active { transform: scale(.95); }

@keyframes waterCelebWavePopIn {
  0%   { transform: scale(.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes waterCelebWaveFillUp {
  0%   { height: 0%; }
  100% { height: 100%; }
}
@keyframes waterCelebWaveMove {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes waterCelebWaveMoveBack {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}
@keyframes waterCelebWaveFadeIn {
  0%   { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Points ≥90% yesterday celebration modal (златна тема на точките) */
.points-celeb-modal {
  position: fixed; inset: 0; z-index: 1060;
  background: var(--c-overlay-dark);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  backdrop-filter: blur(2px);
}
.points-celeb-modal.hidden { display: none !important; }
.points-celeb-card {
  width: 100%; max-width: 340px;
  background: var(--c-surface); border-radius: 20px;
  padding: 34px 22px 26px;
  box-shadow: var(--shadow-modal);
  border-top: 4px solid #f59e0b;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: pointsCelebPopIn .45s cubic-bezier(.175,.885,.32,1.275);
}
.points-celeb-close {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 32px; height: 32px; border: none; border-radius: 999px;
  background: var(--c-surface-2); color: var(--c-text-2);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.points-celeb-ripple-wrap {
  position: relative; width: 96px; height: 96px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
}
.points-celeb-icon {
  font-size: 48px; line-height: 1; position: relative; z-index: 2;
  animation: waterCelebBounceIn .6s cubic-bezier(.34,1.56,.64,1);
}
.points-celeb-ring {
  position: absolute; inset: 0; border-radius: 999px;
  border: 3px solid #f59e0b;
  opacity: 0;
  animation: waterCelebRipple 1.8s ease-out infinite;
}
.points-celeb-ring-2 { border-color: #fbbf24; animation-delay: .3s; }
.points-celeb-ring-3 { border-color: #fde68a; animation-delay: .6s; }
.points-celeb-number {
  font-size: 44px; font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.points-celeb-title {
  font-size: 17px; font-weight: 700; color: var(--c-text);
  margin-bottom: 6px;
}
.points-celeb-body { font-size: 14px; color: var(--c-text-3); }
.points-celeb-streak {
  display: inline-block;
  margin-top: 10px; padding: 5px 12px;
  background: var(--c-primary-light); border-radius: 999px;
  font-size: 13px; font-weight: 700; color: #d97706;
}
.points-celeb-streak.hidden { display: none; }
.points-celeb-btn {
  display: block; width: 100%;
  margin-top: 18px; padding: 12px;
  border: none; border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.points-celeb-btn:active { transform: scale(.97); }

/* Конфети: 12 парченца, падащи с въртене; позиция/цвят/тайминг през nth-child */
.points-celeb-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.points-celeb-confetti i {
  position: absolute; top: -14px;
  width: 8px; height: 13px; border-radius: 2px;
  opacity: 0;
  animation: pointsCelebConfettiFall 3.2s linear infinite;
}
.points-celeb-confetti i:nth-child(1)  { left: 6%;  background: #f59e0b; animation-delay: 0s;    }
.points-celeb-confetti i:nth-child(2)  { left: 14%; background: #34d399; animation-delay: 1.1s; width: 6px; height: 10px; }
.points-celeb-confetti i:nth-child(3)  { left: 23%; background: #60a5fa; animation-delay: .4s;  }
.points-celeb-confetti i:nth-child(4)  { left: 31%; background: #f472b6; animation-delay: 1.8s; width: 10px; height: 8px; }
.points-celeb-confetti i:nth-child(5)  { left: 40%; background: #fbbf24; animation-delay: .9s;  }
.points-celeb-confetti i:nth-child(6)  { left: 48%; background: #a78bfa; animation-delay: 2.3s; width: 6px; height: 11px; }
.points-celeb-confetti i:nth-child(7)  { left: 57%; background: #f87171; animation-delay: .2s;  }
.points-celeb-confetti i:nth-child(8)  { left: 65%; background: #34d399; animation-delay: 1.5s; width: 9px; height: 9px; }
.points-celeb-confetti i:nth-child(9)  { left: 74%; background: #fbbf24; animation-delay: .7s;  }
.points-celeb-confetti i:nth-child(10) { left: 82%; background: #60a5fa; animation-delay: 2.0s; width: 6px; height: 12px; }
.points-celeb-confetti i:nth-child(11) { left: 90%; background: #f472b6; animation-delay: 1.3s; }
.points-celeb-confetti i:nth-child(12) { left: 96%; background: #a78bfa; animation-delay: 2.6s; width: 8px; height: 8px; }

.points-explainer-card { border-top-color: #6366f1; }
.points-explainer-card .points-celeb-ring { border-color: #6366f1; }
.points-explainer-card .points-celeb-ring-2 { border-color: #818cf8; }
.points-explainer-card .points-celeb-ring-3 { border-color: #c7d2fe; }
.points-explainer-card .points-celeb-btn { background: linear-gradient(135deg, #6366f1, #4f46e5); }

@keyframes pointsCelebPopIn {
  0%   { transform: scale(.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pointsCelebConfettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  6%   { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(420px) rotate(660deg); opacity: 0; }
}

.comment-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(10, 15, 25, .62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.comment-modal.hidden { display: none !important; }
.comment-modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--c-surface);
  border-radius: 16px;
  padding: 18px 16px 16px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.comment-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: var(--c-primary-bg);
  color: var(--c-text-2);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.comment-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text);
  padding-right: 36px;
  margin-bottom: 6px;
}
.comment-modal-meta {
  font-size: 12px;
  color: var(--c-text-3);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
}
.comment-modal-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-text);
  white-space: pre-wrap;
}

.comment-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 1002;
  background: rgba(10, 15, 25, .62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.comment-editor-modal.hidden { display: none !important; }
.comment-editor-card {
  width: 100%;
  max-width: 540px;
  background: var(--c-surface);
  border-radius: 16px;
  padding: 18px 16px 16px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  max-height: calc(100vh - 36px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
}
.comment-editor-textarea {
  width: 100%;
  min-height: 120px;
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}
.comment-editor-textarea:focus {
  border-color: var(--c-primary);
}
.comment-editor-error {
  margin-top: 8px;
  font-size: 12px;
  color: var(--c-danger);
}
.comment-editor-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.comment-editor-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--c-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.comment-editor-btn.secondary {
  background: var(--c-primary-bg);
  color: var(--c-text-2);
}

/* ── Time Editor ─────────────────────────────────────────────── */
.time-editor-display {
  font-size: 2.8rem;
  font-weight: 700;
  text-align: center;
  color: var(--c-primary);
  margin: 16px 0 20px;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.time-editor-slider-wrap {
  padding: 0 4px 8px;
}
.time-editor-slider-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--c-primary);
  cursor: pointer;
  height: 6px;
}
.time-editor-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--c-text-2);
  margin-top: 6px;
  padding: 0 2px;
}
.log-time-col { cursor: default; user-select: none; }

/* ── Dietitian ───────────────────────────────────────────────── */
.dietitian-select-wrap { margin-bottom: 14px; }
.dietitian-select-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.dietitian-select-header .section-label { margin-bottom: 0; }
.btn-add-user {
  padding: 7px 14px; border-radius: 20px;
  background: var(--c-primary); color: #fff;
  font-size: 13px; font-weight: 600; border: none; cursor: pointer;
  white-space: nowrap;
}
.btn-add-user:active { background: var(--c-primary-dark); }
.diet-date-nav { display: flex; align-items: center; gap: 4px; }
.diet-date-nav-btn {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--c-border); background: var(--c-surface);
  color: var(--c-text); font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.diet-date-nav-btn:active { background: var(--c-border); }
.diet-date-nav-btn:disabled { opacity: .35; cursor: default; }
.diet-date-nav-input {
  border: 1.5px solid var(--c-border); border-radius: 8px;
  padding: 4px 6px; font-size: 10px; background: var(--c-surface); color: var(--c-text);
  max-width: 100px;
}
.dietitian-select {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--c-border); border-radius: 12px;
  font-size: 15px; background: var(--c-surface); color: var(--c-text);
  -webkit-appearance: none;
}
.dietitian-select:focus { outline: none; border-color: var(--c-primary); }

.dietitian-select-row { display: flex; gap: 8px; align-items: center; }
.diet-select-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 2px solid var(--c-primary); cursor: pointer;
}
.dietitian-select-row .dietitian-select { flex: 1; }
.btn-user-info {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  border: 1.5px solid var(--c-border); background: var(--c-surface);
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.btn-user-info:active { background: var(--c-primary-bg); }

/* diet banner */
.diet-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--c-warning-bg); border: 1px solid #f59e0b;
  border-radius: 14px; padding: 12px 16px;
  font-size: 14px; color: #92400e;
  position: fixed; bottom: 24px; left: 12px; right: 12px;
  max-width: 616px; margin: 0 auto;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  z-index: 280;
}
.diet-banner-close {
  background: none; border: none; font-size: 20px;
  cursor: pointer; color: #92400e; padding: 0 0 0 10px; line-height: 1;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.diet-banner:not(.hidden) { animation: slideDown .25s ease; }

/* cookie consent */
.cookie-consent-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  justify-content: space-between;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: 14px; padding: 14px 16px;
  font-size: 14px; color: var(--c-text-2); line-height: 1.4;
  position: fixed; bottom: 24px; left: 12px; right: 12px;
  max-width: 616px; margin: 0 auto;
  box-shadow: var(--shadow-modal);
  z-index: 290;
}
.cookie-consent-banner:not(.hidden) { animation: slideDown .25s ease; }
.cookie-consent-banner-text { flex: 1 1 260px; }
.cookie-consent-banner-actions {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin-left: auto;
}
.cookie-consent-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 14px; color: var(--c-primary); text-decoration: underline;
}
.cookie-consent-accept {
  background: var(--c-primary); color: #fff; border: none;
  border-radius: 10px; padding: 9px 16px; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.cookie-consent-accept:active { background: var(--c-primary-dark); }

.cookie-consent-modal-overlay {
  position: fixed; inset: 0; background: var(--c-overlay); z-index: 299;
  opacity: 1; transition: opacity .25s ease;
}
.cookie-consent-modal-overlay.hidden { opacity: 0; pointer-events: none; }
.cookie-consent-modal {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  background: var(--c-surface); border-radius: 16px 16px 0 0;
  max-width: 616px; margin: 0 auto;
  max-height: 80vh; overflow-y: auto;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-modal);
  transform: translateY(0); transition: transform .3s ease;
}
.cookie-consent-modal.hidden { transform: translateY(100%); pointer-events: none; }
.cookie-consent-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.cookie-consent-modal-title { font-size: 17px; font-weight: 700; color: var(--c-text); }
.cookie-consent-modal-close {
  background: none; border: none; font-size: 22px; line-height: 1;
  color: var(--c-text-3); cursor: pointer; padding: 0 0 0 10px;
}
.cookie-consent-item {
  padding: 10px 0; border-bottom: 1px solid var(--c-border);
}
.cookie-consent-item:last-of-type { border-bottom: none; }
.cookie-consent-item-name {
  font-size: 14px; font-weight: 700; color: var(--c-text); font-family: monospace;
}
.cookie-consent-item-desc { font-size: 13px; color: var(--c-text-2); margin-top: 2px; }
.cookie-consent-modal-note {
  font-size: 13px; color: var(--c-text-3); margin-top: 12px;
}

/* today overview: user name header */
.diet-overview-name {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--c-text-3);
  text-transform: uppercase; letter-spacing: .05em;
  padding: 18px 0 6px;
}
.diet-overview-name:first-child { padding-top: 4px; }
.diet-overview-avatar-img {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 1.5px solid var(--c-primary); cursor: pointer;
}
.diet-overview-name .clients-panel-row-badge { margin-left: auto; }
.diet-overview-goal-wrap { position: relative; display: inline-flex; }
.diet-overview-goal-icon {
  font-size: 14px; text-transform: none; letter-spacing: normal;
  cursor: help;
}
.diet-overview-goal-tooltip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--c-text); color: #fff;
  font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: normal;
  white-space: nowrap; padding: 5px 9px; border-radius: 6px;
  z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.diet-overview-goal-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--c-text);
}

/* bottom sheet overlay */
.user-sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 290;
  backdrop-filter: blur(2px);
}
.user-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--c-surface); border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
  padding: 16px 20px 48px;
  transform: translateY(100%); transition: transform .28s ease;
  z-index: 300;
}
.user-sheet.open { transform: translateY(0); }
.user-sheet-header {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  margin-bottom: 16px;
}
.user-sheet-name { font-size: 18px; font-weight: 700; color: var(--c-text); flex: 1; }
.user-sheet-close {
  background: var(--c-surface-3); border: none; border-radius: 50%;
  width: 32px; height: 32px; font-size: 20px; line-height: 1;
  cursor: pointer; color: var(--c-text-3); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.user-sheet-close:active { background: var(--c-surface-2); }
.user-sheet-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--c-border); font-size: 15px;
}
.user-sheet-row:last-child { border-bottom: none; }
.user-sheet-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.user-sheet-phone { color: var(--c-primary); text-decoration: none; font-weight: 600; }
.user-sheet-btn-row {
  display: flex; gap: 8px; margin-top: 10px;
}
.user-sheet-clear-pass-btn {
  display: block; width: 100%; margin-top: 16px;
  padding: 10px; border-radius: 10px;
  border: 1.5px solid var(--c-danger-light); background: var(--c-danger-bg);
  color: var(--c-danger); font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: center;
}
.user-sheet-btn-row .user-sheet-clear-pass-btn,
.user-sheet-btn-row .user-sheet-archive-btn,
.user-sheet-btn-row .user-sheet-member-btn {
  flex: 1; margin-top: 0;
}
.user-sheet-clear-pass-btn:active { background: var(--c-danger-bg); }

.user-sheet-member-btn {
  padding: 10px; border-radius: 10px;
  border: 1.5px solid var(--c-border); background: var(--c-surface);
  color: var(--c-text-3); font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: center; transition: all .12s;
}
.user-sheet-member-btn.active {
  border-color: #fbbf24; background: var(--c-warning-bg); color: #92400e;
}

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(130px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: #1a1a1a; color: #fff;
  padding: 11px 22px; border-radius: 30px;
  font-size: 14px; z-index: 999;
  white-space: nowrap; max-width: 90vw; text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── Offline Bar (полупрозрачна, веднага под хедъра) ─────────── */
.offline-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  line-height: 32px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.offline-bar.visible    { max-height: 32px; }
.offline-bar.is-offline { background: rgba(220, 38, 38, 0.72);  color: #fff; }
.offline-bar.is-online  { background: rgba(22, 163, 74, 0.72); color: #fff; }

/* ── SW Update Banner ────────────────────────────────────────── */
.sw-update-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0; right: 0;
  background: #f59e0b;
  color: #1a1a1a;
  padding: 10px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  z-index: 9999;
  gap: 14px;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
}
.sw-update-banner.visible { display: flex; }
.sw-update-banner button {
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

/* ── New User Email Card ─────────────────────────────────────── */
.new-user-email-card {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: #1e2a1e; color: #fff;
  border: 1.5px solid #4caf50;
  padding: 18px 20px; border-radius: 18px;
  display: flex; flex-direction: column; align-items: stretch; gap: 12px;
  font-size: 14px; z-index: 998;
  width: 92vw; max-width: 420px;
  box-shadow: 0 8px 28px rgba(0,0,0,.45);
  animation: fadeIn .25s ease;
}
.new-user-email-text {
  font-size: 16px; font-weight: 700; line-height: 1.4;
  padding-right: 20px;
}
.new-user-email-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.new-user-mailto-btn,
.new-user-manual-btn {
  padding: 10px 16px; border-radius: 22px;
  text-decoration: none; font-size: 14px; font-weight: 700;
  white-space: nowrap; flex-shrink: 0; border: none; cursor: pointer;
}
.new-user-mailto-btn {
  background: #4caf50; color: #fff;
}
.new-user-mailto-btn:active { background: #388e3c; }
.new-user-manual-btn {
  background: transparent; color: #fff;
  border: 1.5px solid #fff;
}
.new-user-manual-btn:active { background: rgba(255,255,255,.12); }
.new-user-email-dismiss {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: #aaa;
  font-size: 20px; padding: 0 4px; cursor: pointer; flex-shrink: 0;
}

/* ── Send Manual Email Modal ──────────────────────────────────── */
.manual-email-field { margin-bottom: 14px; }
.manual-email-field-label {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.manual-email-field-label label {
  font-size: 13px; font-weight: 600; color: var(--c-text-2);
}
.manual-email-copy-btn {
  border: none; border-radius: 14px;
  padding: 5px 12px;
  background: var(--c-primary-bg); color: var(--c-primary);
  font-size: 12px; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.manual-email-copy-btn:active { opacity: .75; }
.manual-email-field-value {
  width: 100%;
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px; line-height: 1.5;
  background: var(--c-primary-bg);
  color: var(--c-text);
}
.manual-email-body {
  min-height: 140px;
  resize: vertical;
  white-space: pre-wrap;
}

/* ── Measurements ─────────────────────────────────────────────── */
.meas-card {
  background: var(--c-surface);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.meas-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
}
.meas-unit {
  font-size: 11px;
  color: var(--c-text-3);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.meas-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.meas-section-header .meas-section-title { margin-bottom: 0; }
.meas-prev-date {
  font-size: 11px;
  color: var(--c-primary);
  font-weight: 600;
  white-space: nowrap;
}
.meas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.meas-field { display: flex; flex-direction: column; gap: 4px; }
.meas-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  min-height: 18px;
}
.meas-label-row label {
  font-size: 12px;
  color: var(--c-text-3);
  font-weight: 600;
  line-height: 1.3;
  flex-shrink: 0;
}
.meas-prev {
  font-size: 12px;
  color: #f97316;
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}
.meas-diff-up   { font-size: 11px; color: var(--c-danger); }
.meas-diff-down { font-size: 11px; color: var(--c-primary); }
.meas-diff-zero { font-size: 11px; color: var(--c-text-3); }
.meas-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  font-size: 15px;
  color: var(--c-text);
  background: var(--c-surface-3);
  -webkit-appearance: none;
  transition: border-color .15s;
}
.meas-input:focus { outline: none; border-color: var(--c-primary); background: var(--c-surface); }

/* Chart card header with drawer toggle */
.meas-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.meas-chart-header .meas-section-title { margin-bottom: 0; }
.meas-chart-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.meas-params-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 9px;
  border-radius: 20px;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface-3);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.meas-params-toggle svg {
  width: 14px; height: 12px;
  stroke: var(--c-text-3);
  flex-shrink: 0;
  transition: stroke .12s;
}
.meas-params-toggle.open {
  background: var(--c-primary-light);
  border-color: var(--c-primary-border);
}
.meas-params-toggle.open svg { stroke: var(--c-primary-dark); }
.meas-params-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--c-primary);
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  line-height: 1.5;
}
.meas-params-toggle.open .meas-params-count { background: var(--c-primary-dark); }

/* Chart tabs — collapsible drawer */
.meas-chart-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .28s ease, padding-bottom .28s ease;
  padding-bottom: 0;
}
.meas-chart-tabs.open {
  max-height: 240px;
  padding-bottom: 12px;
}
.meas-chart-tab {
  padding: 5px 11px;
  border-radius: 20px;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface-3);
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-3);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.meas-chart-tab.active {
  background: var(--c-primary-light);
  border-color: var(--c-primary-border);
  color: var(--c-primary-dark);
}

/* History entry card */
.meas-entry {
  background: var(--c-surface);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.meas-entry-date {
  font-size: 12px;
  color: var(--c-text-3);
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.meas-entry-body { display: flex; gap: 16px; }
.meas-entry-col { flex: 1; min-width: 0; }
.meas-entry-col-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.meas-entry-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 13px;
  gap: 6px;
}
.meas-entry-row:last-child { border-bottom: none; }
.meas-entry-lbl {
  color: var(--c-text-3);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
  transition: white-space .1s;
}
.meas-entry-val {
  font-weight: 600;
  color: var(--c-text);
  text-align: right;
  flex-shrink: 0;
}
/* Expanded state: show full label text */
.meas-entry-row.meas-expanded .meas-entry-lbl {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.meas-val-up,  .meas-table td.meas-val-up   { color: var(--c-danger); }
.meas-val-down,.meas-table td.meas-val-down { color: var(--c-primary-dark); }

/* Day header comment dot */
.day-comment-dot {
  background: none; border: none; cursor: pointer;
  font-size: 13px; padding: 0 4px; opacity: .5;
  vertical-align: middle; margin-left: 6px;
  border-radius: 50%;
}
.day-comment-dot.unread {
  opacity: 1;
  animation: commentPulse 1.2s ease-in-out infinite;
}

/* Header unread badge */
.header-unread-badge {
  background: none; border: none; cursor: pointer;
  font-size: 18px; padding: 0 2px; position: relative;
  line-height: 1; margin-right: 1px;
}
.header-badge-count {
  position: absolute; top: -4px; right: -2px;
  background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 999px; min-width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* Measurements date toggle */
.meas-date-toggle-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--c-text-3); padding: 2px 0;
  text-decoration: underline; text-underline-offset: 2px;
}

/* View toggle */
.meas-view-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.meas-view-left { display: flex; gap: 6px; }
.meas-view-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface-3);
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-3);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.meas-view-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.meas-view-btn.active {
  background: var(--c-primary-light);
  border-color: var(--c-primary-border);
  color: var(--c-primary-dark);
}
.meas-chart-mode-btn {
  min-width: 88px;
  justify-content: center;
}

.device-chart-split {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.device-chart-split-item {
  padding: 10px 12px 12px;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  background: var(--c-surface-3);
}
.device-chart-split-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
}
.device-chart-split-canvas {
  position: relative;
  height: 160px;
}

/* Fullscreen button */
.meas-fullscreen-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
.meas-fullscreen-btn svg { width: 18px; height: 18px; stroke: var(--c-text-3); }
.meas-fullscreen-btn.active { background: var(--c-primary-light); border-color: var(--c-primary-border); }
.meas-fullscreen-btn.active svg { stroke: var(--c-primary-dark); }
.meas-fullscreen-btn .icon-compress { display: none; }
.meas-fullscreen-btn.active .icon-expand  { display: none; }
.meas-fullscreen-btn.active .icon-compress { display: block; }

/* Device type selector (Tanita/Omron) */
.device-type-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: 12px;
  font-size: 15px;
  color: var(--c-text);
  background: var(--c-surface-3);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  font-family: inherit;
}
.device-type-select:focus { border-color: var(--c-primary); background: var(--c-surface); }

/* Fullscreen overlay mode */
body.meas-fs-active .app-header,
body.meas-fs-active .bottom-nav,
body.meas-fs-active .water-bar { display: none !important; }

body.meas-fs-active #page-measure-history {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  background: var(--c-bg);
  padding: 12px 12px 24px;
  max-width: none;
  -webkit-overflow-scrolling: touch;
}

body.device-fs-active .app-header,
body.device-fs-active .bottom-nav,
body.device-fs-active .water-bar { display: none !important; }

body.device-fs-active #page-device-history {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  background: var(--c-bg);
  padding: 12px 12px 24px;
  max-width: none;
  -webkit-overflow-scrolling: touch;
}

/* Table view */
.meas-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--c-surface);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  margin-bottom: 10px;
}
.meas-table {
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
  width: 100%;
}
.meas-table th {
  background: var(--c-surface-3);
  color: var(--c-text-3);
  font-weight: 700;
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1.5px solid var(--c-border);
  position: sticky;
  top: 0;
}
.meas-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--c-primary-bg);
}
.meas-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  text-align: right;
}
.meas-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--c-text-2);
  position: sticky;
  left: 0;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
}
.meas-table tr:last-child td { border-bottom: none; }
.meas-table tr:hover td { background: var(--c-surface-3); }
.meas-table tr:hover td:first-child { background: var(--c-primary-bg); }
.meas-table td.meas-td-null { color: var(--c-text-muted); }

/* ── Measurement photos ──────────────────────────────────────── */
.meas-photo-warning {
  background: var(--c-warning-bg);
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .88rem;
  color: #9a3412;
  margin-top: 8px;
}
.meas-photo-warning a { color: #ea580c; font-weight: 600; text-decoration: none; }
.meas-photo-warning a:hover { text-decoration: underline; }

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: var(--c-surface-2);
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}
.btn-secondary:active { background: var(--c-surface-2); }

.meas-photo-preview { margin-top: 10px; }
.meas-photo-thumb {
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
  display: block;
}

/* ── Режим per-user ─────────────────────────────────────────── */
.regime-block { margin-bottom: 12px; }

.regime-block-header {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.regime-block-name {
  flex: 1;
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 15px;
  background: var(--c-surface-3);
  outline: none;
  -webkit-appearance: none;
}
.regime-block-name:focus { border-color: var(--c-primary); background: var(--c-surface); }

.regime-block-time {
  width: 108px;
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 15px;
  background: var(--c-surface-3);
  outline: none;
  -webkit-appearance: none;
}
.regime-block-time:focus { border-color: var(--c-primary); background: var(--c-surface); }

.regime-block-remove {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--c-danger);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  transform: translateX(-12px);
}
.regime-block-remove:hover { color: #e53e3e; background: var(--c-danger-bg); }

.regime-block-text {
  width: 100%;
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  font-family: inherit;
  background: var(--c-surface-3);
}
.regime-block-text:focus { border-color: var(--c-primary); background: var(--c-surface); }
.regime-block-hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--c-primary-dark);
  background: var(--c-primary-bg);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 7px 10px;
  font-weight: 600;
}
.regime-block-hint::before { content: 'ℹ '; }

.regime-block-invalid { box-shadow: 0 0 0 2px var(--c-danger); border-radius: 16px; }
.regime-field-invalid { border-color: var(--c-danger) !important; background: var(--c-danger-bg) !important; }

.regime-water-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.regime-water-row input {
  width: 80px;
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 16px;
  background: var(--c-surface-3);
  outline: none;
  -webkit-appearance: none;
}
.regime-water-row input:focus { border-color: var(--c-primary); background: var(--c-surface); }
.regime-water-unit { font-size: 14px; color: var(--c-text-3); }

/* Recent measurement photos */
.meas-recent-photos {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.meas-recent-photo-wrap {
  position: relative;
  flex: 1 1 calc(50% - 5px);
  min-width: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--c-surface-2);
  aspect-ratio: 3/4;
}
.meas-recent-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.meas-recent-photo-date {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 8px;
  background: rgba(0,0,0,.52);
  color: #fff;
  font-size: 12px;
  text-align: center;
  font-weight: 500;
  letter-spacing: .3px;
}

/* ============================================================
   ANNOUNCEMENTS — Burger, Panel, Cards, Modals
   ============================================================ */

/* ── Announcement badge ──────────────────────────────────── */
/* .header-badge-count (app.css) носи вече общия стил на червеното балонче */

/* ── Burger menu ─────────────────────────────────────────── */
.burger-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 400;
  backdrop-filter: blur(2px);
}
.burger-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--c-surface);
  z-index: 401;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  padding-top: env(safe-area-inset-top);
  animation: slideInRight .22s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.burger-menu.hidden { display: none !important; }
.burger-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--c-border);
}
.burger-menu-title { font-size: 17px; font-weight: 700; color: var(--c-text); }
.burger-menu-close {
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--c-text-3); cursor: pointer; padding: 0 4px;
}
.burger-menu-items {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  flex: 1;
}
.burger-menu-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 12px 20px;
  background: none; border: none;
  font-size: 15px; font-weight: 500; color: var(--c-text);
  cursor: pointer; text-align: left;
  transition: background .12s;
}
.burger-menu-item:active { background: var(--c-surface-2); }
.burger-menu-icon { font-size: 20px; flex-shrink: 0; }
.burger-menu-chevron { width: 16px; height: 16px; margin-left: auto; stroke: var(--c-text-muted); }
#burgerBugReport { margin-top: auto; }

/* ── Announcements panel ─────────────────────────────────── */
.ann-panel-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 400;
  backdrop-filter: blur(2px);
}
.ann-panel {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-height: 88vh;
  background: var(--c-surface);
  border-radius: 20px 20px 0 0;
  z-index: 401;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
  animation: slideUpSheet .22s ease;
}
.ann-panel.hidden { display: none !important; }
.ann-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding:14px 16px 10px;
  flex-shrink: 0;
  border-bottom:1px solid var(--c-border);
}
.ann-panel-tabs { display: flex; gap: 6px; }
.ann-panel-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ann-panel-tab {
  padding: 8px 16px; border: none; border-radius: 20px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  background: var(--c-surface-2); color: var(--c-text-3);
  transition: background .12s, color .12s;
}
.ann-panel-tab.active { background: var(--c-primary); color: #fff; }
.ann-panel-close {
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--c-text-3); cursor: pointer; padding: 0 4px; flex-shrink: 0;
}
.ann-panel-body { overflow-y: auto; flex: 1; padding: 12px 0 env(safe-area-inset-bottom); }
.ann-panel-list { padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.ann-empty { padding: 40px 20px; text-align: center; color: var(--c-text-3); font-size: 14px; }

/* ── Announcement cards ──────────────────────────────────── */
.ann-card {
  background: var(--c-surface);
  border-radius: 14px;
  padding: 14px 14px 12px;
  border-left: 4px solid #93c5fd;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  cursor: pointer;
  position: relative;
  transition: box-shadow .12s;
}
.ann-card:active { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.ann-card-announcement { border-left-color: var(--c-primary); }
.ann-card-important    { border-left-color: #ef4444; background: var(--c-danger-bg); }
.ann-card-event        { border-left-color: var(--c-success); }
.ann-card-unread       { box-shadow: 0 2px 8px rgba(37,99,235,.15); }

.ann-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.ann-card-club { font-size: 11px; color: var(--c-text-3); background: var(--c-surface-2); border-radius: 8px; padding: 2px 7px; white-space: nowrap; }
.ann-card-date { font-size: 11px; color: var(--c-text-muted); margin-left: auto; }
.ann-card-type { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.ann-type-announcement { background: var(--c-primary-light); color: var(--c-primary-dark); }
.ann-type-important    { background: var(--c-danger-bg); color: var(--c-danger); }
.ann-type-event        { background: var(--c-success-bg); color: var(--c-success-dark); }
.ann-card-date { font-size: 11px; color: var(--c-text-muted); }
.ann-card-title { font-size: 15px; font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.ann-card-event-row { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.ann-card-ev-date { font-size: 13px; color: var(--c-success-dark); font-weight: 500; }
.ann-card-ev-loc  { font-size: 13px; color: var(--c-text-3); }
.ann-card-stats { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ann-stat { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--c-surface-2); color: var(--c-text-3); font-weight: 600; }
.ann-rsvp-yes   { background: var(--c-success-bg); color: var(--c-success-dark); }
.ann-rsvp-no    { background: var(--c-danger-bg); color: var(--c-danger); }
.ann-rsvp-maybe { background: #fef9c3; color: #854d0e; }
.ann-unread-dot {
  position: absolute;
  top: 12px;
  right: 4px;
  color: var(--c-primary);
  font-size: 10px;
  animation: announcePulse 1.2s ease-in-out infinite;
}
@keyframes announcePulse {
  0% { transform: scale(0);}
  70% { transform: scale(1.5); }
  100% { transform: scale(0); }
}
.ann-my-rsvp { margin-top: 6px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; display: inline-block; }

/* ── Compose modal ───────────────────────────────────────── */
.ann-compose-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 502;
  backdrop-filter: blur(2px);
}
.ann-compose-modal {
  position: fixed;
  inset: 0;
  z-index: 503;
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto;
  padding: 16px 12px calc(32px + env(safe-area-inset-bottom));
  padding-top: calc(env(safe-area-inset-top) + 16px);
}
.ann-compose-modal.hidden { display: none !important; }
.ann-compose-card {
  background: var(--c-surface);
  border-radius: 20px;
  padding: 20px 18px 24px;
  width: 100%; max-width: 540px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.ann-compose-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.ann-compose-title { font-size: 17px; font-weight: 700; color: var(--c-text); }
.ann-compose-close {
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--c-text-3); cursor: pointer; padding: 0 4px;
}

/* Type tabs */
.ann-type-tabs {
  display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap;
}
.ann-type-tab {
  flex: 1; min-width: 80px;
  padding: 9px 10px; border: 1.5px solid var(--c-border);
  border-radius: 10px; background: var(--c-surface-3);
  font-size: 13px; font-weight: 600; color: var(--c-text-3);
  cursor: pointer; text-align: center;
  transition: all .12s;
}
.ann-type-tab.active { border-color: var(--c-primary); background: var(--c-primary-bg); color: var(--c-primary-dark); }

/* Target recipient toggle buttons */
.ann-target-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ann-target-btn {
  padding: 9px 16px; border: 1.5px solid var(--c-border); border-radius: 20px;
  background: var(--c-surface-3); font-size: 14px; font-weight: 600; color: var(--c-text-3);
  cursor: pointer; transition: all .12s;
}
.ann-target-btn.active { border-color: var(--c-primary); background: var(--c-primary-bg); color: var(--c-primary-dark); }

/* Form elements */
.ann-label { display: block; font-size: 13px; font-weight: 600; color: var(--c-text-3); margin-bottom: 5px; }
.ann-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ann-md-help-btn {
  border: 1px solid var(--c-border);
  background: var(--c-surface-3);
  color: var(--c-text-3);
  border-radius: 999px;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.ann-input {
  width: 100%; padding: 11px 13px;
  border: 1.5px solid var(--c-border); border-radius: 10px;
  font-size: 15px; color: var(--c-text); background: var(--c-surface-3);
  transition: border-color .15s; -webkit-appearance: none;
}
.ann-input:focus { outline: none; border-color: var(--c-primary); background: var(--c-surface); }
.ann-textarea {
  width: 100%; padding: 11px 13px;
  border: 1.5px solid var(--c-border); border-radius: 10px;
  font-size: 15px; color: var(--c-text); background: var(--c-surface-3);
  resize: vertical; min-height: 90px;
  font-family: inherit; transition: border-color .15s;
}
.ann-textarea:focus { outline: none; border-color: var(--c-primary); background: var(--c-surface); }

.ann-recipient-checks { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.ann-check-label { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--c-text-2); cursor: pointer; }
.ann-check-label input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--c-primary); }

.ann-photo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-photo-name { font-size: 13px; color: var(--c-text-3); word-break: break-all; }
.ann-photo-clear { background: none; border: none; color: var(--c-danger); font-size: 18px; cursor: pointer; line-height: 1; padding: 0 4px; }
.ann-photo-thumb { max-width: 100%; max-height: 180px; border-radius: 10px; display: block; margin-top: 8px; }
.ann-photo-preview { margin-top: 8px; }

.ann-auto-delete-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 14px; font-weight: 500; color: var(--c-text-2);
}
.ann-auto-delete-label input[type="checkbox"] {
  width: 16px; height: 16px; flex-shrink: 0;
  padding: 0; border: 1.5px solid var(--c-border); border-radius: 4px;
  -webkit-appearance: checkbox; appearance: checkbox;
  accent-color: var(--c-primary); cursor: pointer;
}

.ann-compose-error {
  background: var(--c-danger-bg); color: var(--c-danger);
  border-radius: 8px; padding: 10px 12px;
  font-size: 13px; margin: 10px 0 0;
}
.ann-compose-actions {
  display: flex; gap: 10px; margin-top: 16px;
}

.ann-md-help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 510;
  backdrop-filter: blur(2px);
}
.ann-md-help-modal {
  position: fixed;
  inset: 0;
  z-index: 511;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 16px 12px calc(24px + env(safe-area-inset-bottom));
  padding-top: calc(env(safe-area-inset-top) + 16px);
}
.ann-md-help-modal.hidden,
.ann-md-help-overlay.hidden { display: none !important; }
.ann-md-help-card {
  width: 100%;
  max-width: 520px;
  background: var(--c-surface);
  border-radius: 16px;
  box-shadow: var(--shadow-modal);
  padding: 16px;
  position: relative;
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px);
  overflow: auto;
}
.ann-md-help-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 10px;
  margin-right: 36px;
}
.ann-md-help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ann-md-help-col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.ann-md-help-row {
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-surface-3);
  padding: 8px 10px;
  margin-bottom: 8px;
}
.ann-md-help-row:last-child { margin-bottom: 0; }
.ann-md-help-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 13px;
  color: var(--c-text-2);
}
.ann-md-help-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  margin-bottom: 6px;
  display: block;
  border: none;
  background: var(--c-surface-2);
  color: var(--c-text-3);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ann-md-help-preview {
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-surface-3);
  padding: 10px;
  margin-bottom: 0;
}
.ann-md-help-preview h1,
.ann-md-help-preview h2,
.ann-md-help-preview h3 { margin-top: 0; }

/* ── Detail modal ────────────────────────────────────────── */
.ann-detail-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 500;
  backdrop-filter: blur(2px);
}
.ann-detail-modal {
  position: fixed; inset: 0;
  z-index: 502;
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto;
  padding: 16px 12px calc(32px + env(safe-area-inset-bottom));
  padding-top: calc(env(safe-area-inset-top) + 16px);
}
.ann-detail-modal.hidden { display: none !important; }
.ann-detail-card {
  background: var(--c-surface);
  border-radius: 20px;
  padding: 20px 18px 28px;
  width: 100%; max-width: 540px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  position: relative;
}
.ann-detail-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--c-surface-2); border: none;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--c-text-3);
}
.ann-detail-type { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 10px; display: inline-block; }
.preview-banner { background: #f59e0b1a; border: 1px solid #f59e0b; border-radius: 10px; color: #92400e; font-size: 13px; font-weight: 600; padding: 8px 12px; margin-bottom: 14px; text-align: center; }
.ann-recipients-btn { display: block; width: 100%; margin: 12px 0 4px; padding: 10px 14px; background: var(--c-surface-2); border: none; border-radius: 12px; color: var(--c-text); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.ann-recipients-btn:active { opacity: .75; }
.ann-recip-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 503; backdrop-filter: blur(2px);}
.ann-recip-modal { position: fixed; inset: 0; z-index: 504; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.ann-recip-modal.hidden { display: none !important; }
.ann-recip-card { position: relative; background: var(--c-surface); border-radius: 20px 20px 0 0; width: 100%; max-width: 480px; max-height: 72vh; display: flex; flex-direction: column; pointer-events: all; padding-bottom: env(safe-area-inset-bottom); }
.ann-recip-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px; border-bottom: 1px solid var(--c-border, #e5e7eb); flex-shrink: 0; }
.ann-recip-title { font-weight: 700; font-size: 16px; color: var(--c-text); }
.ann-recip-body { overflow-y: auto; padding: 12px 16px 24px; }
.ann-recip-group { margin-bottom: 12px; }
.ann-recip-group-label { font-size: 12px; font-weight: 700; color: var(--c-text-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.ann-recip-person { padding: 6px 0; font-size: 14px; color: var(--c-text); border-bottom: 1px solid var(--c-border, #f0f0f0); }
.ann-recip-person:last-child { border-bottom: none; }
.ann-detail-title { font-size: 19px; font-weight: 700; color: var(--c-text); margin-bottom: 4px; line-height: 1.3; }
.ann-detail-top-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ann-detail-club { font-size: 12px; color: var(--c-text-3); background: var(--c-surface-2); border-radius: 8px; padding: 3px 9px; white-space: nowrap; }
.ann-detail-meta { font-size: 12px; color: var(--c-text-muted); border-bottom: 1px solid var(--c-border); border-top : 1px solid var(--c-border); padding: 5px; margin-bottom: 15px; background: var(--c-surface-3); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ann-detail-meta > * { flex: 0 0 auto; }
.ann-detail-meta > *:last-child { flex: 1 1 260px; min-width: 0; }
.ann-detail-sender { font-size: 13px; color: var(--c-text-3); font-weight: 600;}
.ann-detail-target { font-size: 12px; color: var(--c-text-3); white-space: normal; overflow-wrap: anywhere; }
.ann-card-target { font-size: 12px; color: var(--c-text-3); margin-top: 6px; }
.ann-detail-photo { width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; margin-bottom: 14px; display: block; cursor: zoom-in; }

/* ── Photo lightbox ─────────────────────────────────────────── */
.photo-lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.photo-lightbox.hidden { display: none !important; }
.photo-lightbox img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 30%;
  user-select: none;
}
.photo-lightbox-img {
  touch-action: none;
  cursor: grab;
  will-change: transform;
}
.photo-lightbox-img.dragging { cursor: grabbing; }
.photo-lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(0,0,0,.5); border: none; color: #fff;
  font-size: 28px; line-height: 1; width: 44px; height: 44px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.ann-detail-event-box {
  background: var(--c-success-bg);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.ann-detail-ev-row { font-size: 14px; color: var(--c-text); }
.ann-detail-ev-row a { color: var(--c-primary); word-break: break-all; }

.ann-detail-body {
  font-size: 15px; color: var(--c-text-2); line-height: 1.7;
  white-space: normal; word-break: break-word;
  margin-bottom: 16px;
}
.ann-detail-body a { color: var(--c-primary); }
.ann-detail-body p { margin: 0 0 12px; }
.ann-detail-body p:last-child { margin-bottom: 0; }
.ann-detail-body h1,
.ann-detail-body h2,
.ann-detail-body h3 {
  color: var(--c-text);
  line-height: 1.35;
  margin: 14px 0 10px;
}
.ann-detail-body h1 { font-size: 21px; }
.ann-detail-body h2 { font-size: 18px; }
.ann-detail-body h3 { font-size: 16px; }
.ann-detail-body ul,
.ann-detail-body ol {
  margin: 0 0 12px 20px;
  padding: 0;
}
.ann-detail-body li { margin: 0 0 6px; }
.ann-detail-body li:last-child { margin-bottom: 0; }
.ann-detail-body blockquote {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 3px solid var(--c-primary-border);
  background: var(--c-primary-bg);
  border-radius: 8px;
}
.ann-detail-body blockquote p { margin: 0; }
.ann-detail-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: .92em;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--c-text);
}

/* RSVP */
.ann-rsvp-section { margin-top: 4px; }
.ann-rsvp-label { font-size: 13px; font-weight: 600; color: var(--c-text-3); margin-bottom: 10px; }
.ann-rsvp-btns { display: flex; flex-direction: column; gap: 8px; }
.ann-rsvp-btn {
  padding: 13px 16px; border: 2px solid #e0e4ea;
  border-radius: 12px; background: var(--c-surface-3);
  font-size: 14px; font-weight: 600; color: var(--c-text-2);
  cursor: pointer; text-align: left;
  transition: all .15s;
}
.ann-rsvp-btn:active { transform: scale(.98); }
.ann-rsvp-btn-yes.active   { border-color: var(--c-success); background: var(--c-success-bg); color: var(--c-success-dark); }
.ann-rsvp-btn-no.active    { border-color: var(--c-danger); background: var(--c-danger-bg); color: var(--c-danger); }
.ann-rsvp-btn-maybe.active { border-color: #ca8a04; background: #fef9c3; color: #854d0e; }
.ann-rsvp-btn-yes:not(.active):hover   { border-color: #86efac; }
.ann-rsvp-btn-no:not(.active):hover    { border-color: #fca5a5; }
.ann-rsvp-btn-maybe:not(.active):hover { border-color: #fde047; }

/* Sender stats */
.ann-rsvp-summary {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 14px 0 18px;
}
.ann-rsvp-stat {
  padding: 5px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
  background: var(--c-surface-2); color: var(--c-text-3);
}
.ann-rsvp-stat.yes   { background: var(--c-success-bg); color: var(--c-success-dark); }
.ann-rsvp-stat.maybe { background: #fef9c3; color: #854d0e; }
.ann-rsvp-stat.no    { background: var(--c-danger-bg); color: var(--c-danger); }

.ann-read-group { margin-bottom: 14px; }
.ann-read-group-label { font-size: 13px; font-weight: 700; color: var(--c-text-3); margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--c-border); }
.ann-read-person { font-size: 14px; color: var(--c-text); padding: 4px 0; }

.ann-read-list { margin-top: 14px; }
.ann-read-list-title { font-size: 13px; font-weight: 700; color: var(--c-text-3); margin-bottom: 10px; }
.ann-read-group-section { border-radius: 10px; padding: 2px 10px 4px; margin-bottom: 10px; }
.ann-group-dietitian { background: var(--c-primary-bg); border-left: 3px solid #3b82f6; }
.ann-group-client    { background: var(--c-success-bg); border-left: 3px solid var(--c-success); }
.ann-group-header { font-size: 12px; font-weight: 700; color: var(--c-text-3); padding: 8px 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.ann-read-person-row { display: flex; align-items: center; justify-content: space-between; padding: 2px 0; border-bottom: 1px solid var(--c-border); gap: 10px; flex-wrap: wrap; cursor: pointer; user-select: none; }
.ann-read-person-row:active { background: var(--c-surface-3); margin: 0 -4px; padding-left: 4px; padding-right: 4px; border-radius: 6px; }
.ann-read-name { font-size: 14px; color: var(--c-text); font-weight: 500; }
.ann-read-date { display: flex; align-items: center; gap: 4px; color: var(--c-success); flex-shrink: 0; }
.ann-read-time { font-size: 12px; font-weight: 500; white-space: nowrap; }

/* Delete */
.ann-delete-row { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--c-border); text-align: center; }
.ann-delete-btn {
  background: none; border: 1.5px solid var(--c-danger-light); border-radius: 10px;
  color: var(--c-danger); font-size: 14px; font-weight: 600;
  padding: 10px 20px; cursor: pointer; transition: background .12s;
}
.ann-delete-btn:active { background: var(--c-danger-bg); }

/* ── Edit button in user sheet ──────────────────────────────── */
.user-sheet-edit-btn {
  display: block; width: 100%; margin-top: 16px;
  padding: 12px; border: 1.5px solid var(--c-primary-border); border-radius: 12px;
  background: var(--c-primary-bg); color: var(--c-primary); font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .12s;
}
.user-sheet-edit-btn:active { background: var(--c-primary-light); }

/* ── Archive button in user sheet ───────────────────────────── */
.user-sheet-archive-btn {
  display: block; width: 100%; margin-top: 10px;
  padding: 12px; border: 1.5px solid #fbbf24; border-radius: 12px;
  background: var(--c-warning-bg); color: #92400e; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .12s;
}
.user-sheet-archive-btn:active { background: var(--c-warning-bg); }

/* ── Inactive users select in announce compose ───────────────── */
.ann-inactive-select-all {
  display: block; width: 100%; margin-top: 8px;
  padding: 7px 12px; border: 1.5px solid #2563eb; border-radius: 8px;
  background: var(--c-primary-bg); color: var(--c-primary-dark); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .12s; text-align: center;
}
.ann-inactive-select-all:active { background: var(--c-primary-light); }
.ann-inactive-select {
  width: 100%; margin-top: 6px; padding: 8px;
  border: 1.5px solid var(--c-border); border-radius: 10px;
  font-size: 14px; color: var(--c-text); background: var(--c-surface-3);
  min-height: 100px; max-height: 160px;
}

/* ── Clients panel ───────────────────────────────────────────── */
.clients-panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  z-index: 700;
  backdrop-filter: blur(2px);
}
.clients-panel-overlay.hidden { display: none !important; }
.clients-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--c-surface); z-index: 701;
  display: flex; flex-direction: column;
  padding-top: calc(env(safe-area-inset-top) + 16px);
}
.clients-panel.hidden { display: none !important; }
.clients-panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 16px 14px; border-bottom: 1px solid var(--c-border);
}
.clients-panel-title { font-size: 17px; font-weight: 700; color: var(--c-text); }
.clients-panel-add {
  flex-shrink: 0; padding: 6px 12px;
  border: 1.5px solid var(--c-primary); border-radius: 20px;
  background: var(--c-primary-bg); color: var(--c-primary); font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.clients-panel-close {
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--c-text-3); cursor: pointer; padding: 4px;
}
.clients-panel-tabs {
  display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid var(--c-border);
}
.clients-panel-tab {
  flex: 1; padding: 8px 4px; border: none; background: none;
  font-size: 13px; font-weight: 600; color: var(--c-text-3);
  border-bottom: 2px solid transparent; cursor: pointer;
}
.clients-panel-tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.clients-panel-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px 0; }
.clients-panel-search { flex: 1; min-width: 120px; padding: 8px 10px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); color: var(--c-text); font-size: 13px; }
.clients-panel-sort { display: flex; gap: 4px; flex-shrink: 0; }
.clients-panel-sort-btn { padding: 6px 10px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); color: var(--c-text-muted); font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; min-width: 34px; }
.clients-panel-sort-btn.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.clients-panel-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.clients-panel-list.hidden { display: none !important; }
.clients-panel-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--c-border); cursor: pointer;
}
.clients-panel-row-avatar-wrap {
  position: relative; display: inline-block; flex-shrink: 0; line-height: 0;
}
.clients-panel-row-avatar-img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 2px solid var(--c-primary);
}
.clients-panel-row-avatar-initials {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.clients-panel-row-info { flex: 1; min-width: 0; }
.clients-panel-row-name { font-weight: 600; font-size: 15px; color: var(--c-text); }
.clients-panel-row-age { font-weight: 400; font-size: 13px; color: var(--c-text-3); }
.clients-panel-row-goal { font-size: 13px; color: var(--c-text-3); }
.clients-panel-row-badge { font-size: 12px; color: var(--c-primary); }
.clients-panel-row-badge-warn { color: var(--c-warning); font-weight: 600; }
.clients-panel-empty { text-align: center; color: var(--c-text-muted); padding: 40px 0; font-size: 15px; }
.clients-panel-row-action { flex-shrink: 0; }
.clients-panel-row-btn {
  padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--c-primary-border); background: var(--c-primary-bg); color: var(--c-primary);
  cursor: pointer; white-space: nowrap;
}
.clients-panel-row-btn.primary {
  border-color: var(--c-success); background: var(--c-success-bg); color: var(--c-success-dark);
}
.clients-panel-row-btn:disabled { opacity: .5; cursor: default; }
.clients-panel-row-hint { font-size: 12px; color: var(--c-text-3); max-width: 120px; text-align: right; }

/* ── Visibility requests (Треньори tab, входящи заявки) ──────── */
.visibility-requests-section { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1.5px solid var(--c-border); }
.visibility-requests-title {
  font-size: 12px; font-weight: 700; color: var(--c-text-3); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 10px;
}
.visibility-request-row {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 0;
}
.visibility-request-info { flex: 1; min-width: 0; }
.visibility-request-name { font-weight: 600; font-size: 14px; color: var(--c-text); }
.visibility-request-message { font-size: 13px; color: var(--c-text-2); margin-top: 2px; white-space: pre-wrap; }
.visibility-request-date { font-size: 12px; color: var(--c-text-3); margin-top: 4px; }
.visibility-request-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

/* ── Archived clients list (within clients panel) ────────────── */
.inactive-client-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--c-border); gap: 12px;
}
.inactive-client-info { flex: 1; min-width: 0; }
.inactive-client-name { font-weight: 600; font-size: 15px; color: var(--c-text); }
.inactive-client-email { font-size: 13px; color: var(--c-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inactive-client-reactivate {
  flex-shrink: 0; padding: 8px 14px;
  border: 1.5px solid var(--c-success); border-radius: 20px;
  background: var(--c-success-bg); color: var(--c-success-dark); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .12s;
}
.inactive-client-reactivate:active { background: var(--c-success-bg); }

/* ── Dark theme overrides for elements with complex palettes ── */
[data-theme="dark"] .ann-card-important    { background: #2d1515; }
[data-theme="dark"] .ann-rsvp-maybe,
[data-theme="dark"] .ann-rsvp-stat.maybe,
[data-theme="dark"] .ann-rsvp-btn-maybe.active { background: #2d2000; color: #fde68a; border-color: #ca8a04; }
[data-theme="dark"] .diet-banner           { background: #2d1f00; border-color: #ca8a04; color: #fde68a; }
[data-theme="dark"] .diet-banner-close     { color: #fde68a; }
[data-theme="dark"] .user-sheet-edit-btn    { background: #0f1f3d; border-color: #3b82f6;  color: #93c5fd; }
[data-theme="dark"] .user-sheet-archive-btn { background: #2d1f00; border-color: #ca8a04; color: #fde68a; }
[data-theme="dark"] .meas-photo-warning    { background: #2d1800; border-color: #c2410c; color: #fcd9b6; }
[data-theme="dark"] .meas-photo-warning a  { color: #fb923c; }
[data-theme="dark"] .meas-prev             { color: #fb923c; }
[data-theme="dark"] .regime-block-remove:hover { color: var(--c-danger); background: #2d0a0a; }
[data-theme="dark"] .user-sheet-clear-pass-btn { border-color: var(--c-danger-light); background: #2d0a0a; color: var(--c-danger); }
[data-theme="dark"] .ann-rsvp-btn-yes:not(.active):hover   { border-color: var(--c-success); }
[data-theme="dark"] .ann-rsvp-btn-no:not(.active):hover    { border-color: var(--c-danger); }
[data-theme="dark"] .ann-rsvp-btn-maybe:not(.active):hover { border-color: #ca8a04; }
[data-theme="dark"] .notif-btn.on          { color: #4ade80; }
[data-theme="dark"] .gap-row::before       { background: #3d2d00; }
[data-theme="dark"] .day-header            { background: var(--c-surface-2); }
[data-theme="dark"] .meas-table th:first-child { background: #1a2840; }
[data-theme="dark"] .meas-table td:first-child { background: var(--c-surface); }
[data-theme="dark"] .meas-table tr:hover td { background: var(--c-surface-2); }
[data-theme="dark"] .meas-table tr:hover td:first-child { background: var(--c-surface-3); }
[data-theme="dark"] .ann-group-dietitian   { background: var(--c-primary-bg); border-left-color: var(--c-primary); }
[data-theme="dark"] .ann-group-client      { background: var(--c-success-bg); border-left-color: var(--c-success); }
[data-theme="dark"] .ann-card-event        { border-left-color: var(--c-success); }
[data-theme="dark"] .ann-type-event        { background: var(--c-success-bg); color: var(--c-success); }
[data-theme="dark"] .ann-detail-event-box  { background: var(--c-success-bg); }
[data-theme="dark"] .ann-card-ev-date      { color: var(--c-success); }
[data-theme="dark"] .item-row-info-warning { background: #2d1800; }
[data-theme="dark"] .item-row-info-warning:active { background: #2d1800; }
[data-theme="dark"] .item-lbl-info-warning,
[data-theme="dark"] .next-item-info-warning { color: #fdba74; }
[data-theme="dark"] .regime-block-hint { border-color: #1d4ed8; background: #0b1f3d; color: #bfdbfe; }

/* ════════════════════════════════════════════════
   BUG REPORT MODALS
   ════════════════════════════════════════════════ */
.bug-report-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 500;
  
}
.bug-report-modal {
  position: fixed;
  inset: 0;
  z-index: 501;
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto;
  padding: 16px 12px calc(32px + env(safe-area-inset-bottom));
  padding-top: calc(env(safe-area-inset-top) + 16px);
}
.bug-report-modal.hidden { display: none !important; }
.bug-report-card {
  background: var(--c-surface);
  border-radius: 20px;
  padding: 20px 18px 24px;
  width: 100%; max-width: 540px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.bug-report-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.bug-report-title { font-size: 17px; font-weight: 700; color: var(--c-text); }
.bug-report-close {
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--c-text-3); cursor: pointer; padding: 0 4px;
}
.bug-report-error {
  color: var(--c-danger, #dc2626); font-size: 13px;
  margin: 8px 0 4px; padding: 8px 12px;
  background: var(--c-danger-bg, #fef2f2);
  border-radius: 8px;
}

/* Bug status badge (in ann-card + ann-detail) */
.bug-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .02em;
  margin-top: 4px;
}
.bug-status-new    { background: #fee2e2; color: #b91c1c; }
.bug-status-open   { background: #fef9c3; color: #92400e; }
.bug-status-closed { background: #d1fae5; color: #065f46; }

/* Bug admin section inside ann-detail */
.bug-admin-section {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--c-surface-2);
  border-radius: 12px;
  border: 1.5px solid var(--c-border);
}
.bug-admin-label {
  font-size: 12px; font-weight: 700; color: var(--c-text-3);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 8px;
}
.bug-status-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.bug-status-btn {
  padding: 7px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: 20px;
  background: var(--c-surface-3);
  font-size: 13px; font-weight: 600; color: var(--c-text-2);
  cursor: pointer;
  transition: all .12s;
}
.bug-status-btn.active { border-color: var(--c-primary); background: var(--c-primary-bg); color: var(--c-primary-dark); }
.bug-reply-row { margin-top: 12px; }
.bug-reply-btn {
  padding: 9px 20px;
  background: var(--c-primary);
  color: #fff;
  border: none; border-radius: 20px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: opacity .12s;
}
.bug-reply-btn:hover { opacity: .88; }

/* ann-card тип bug_report — лява бордер */
.ann-card-bug_report { border-left: 3px solid #f59e0b; }
.ann-type-bug_report { background: #fef3c7; color: #92400e; }

[data-theme="dark"] .bug-status-new    { background: rgba(220,38,38,.18); color: #fca5a5; }
[data-theme="dark"] .bug-status-open   { background: rgba(234,179,8,.18); color: #fde68a; }
[data-theme="dark"] .bug-status-closed { background: rgba(16,185,129,.18); color: #6ee7b7; }
[data-theme="dark"] .bug-admin-section { background: var(--c-surface-3); }
[data-theme="dark"] .bug-status-btn    { background: var(--c-surface-2); color: var(--c-text-2); }
[data-theme="dark"] .ann-type-bug_report { background: rgba(245,158,11,.15); color: #fde68a; }

/* ============================================================
   USEFUL POSTS
   ============================================================ */

/* ── Panel header layout ────────────────────────────────────── */
.up-panel .ann-panel-header { flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.up-panel-header-left { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.up-panel-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Category filter tabs ─────────────────────────────────── */
.up-cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.up-cat-tab {
  padding: 5px 12px; border: none; border-radius: 20px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--c-surface-2); color: var(--c-text-3);
  transition: background .12s, color .12s;
}
.up-cat-tab.active { background: var(--c-primary); color: #fff; }

/* ── Sort bar ────────────────────────────────────────────── */
.up-sort-bar { display: flex; align-items: center; }
.up-sort-select {
  border: 1.5px solid var(--c-border); border-radius: 8px;
  padding: 4px 8px; font-size: 12px; font-weight: 500;
  background: var(--c-surface); color: var(--c-text-2);
  cursor: pointer; outline: none;
}

/* ── "+" new post button ─────────────────────────────────── */
.up-new-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--c-primary); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: opacity .12s;
}
.up-new-btn:hover { opacity: .88; }

/* ── Post cards ────────────────────────────────────────────── */
.up-card {
  background: var(--c-surface);
  border-radius: 14px;
  padding: 14px 14px 12px;
  border-left: 4px solid var(--c-primary);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow .12s;
  margin-bottom: 10px;
}
.up-card:active { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.up-card-basics    { border-left-color: var(--c-primary); }
.up-card-recipes   { border-left-color: var(--c-success); }
.up-card-lifehacks { border-left-color: var(--c-warning); }

/* ── Category badges ──────────────────────────────────────── */
.up-cat-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px; margin-bottom: 6px;
}
.up-cat-badge-basics    { background: var(--c-primary-light);  color: var(--c-primary); }
.up-cat-badge-recipes   { background: var(--c-success-bg);     color: var(--c-success-dark); }
.up-cat-badge-lifehacks { background: var(--c-warning-bg);     color: #92400e; }

/* "НОВО" badge on individual posts */
.up-new-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px; margin-left: 6px; margin-bottom: 6px;
  background: #ef4444; color: #fff; vertical-align: middle; letter-spacing: .3px;
}

/* "Полезно" menu button new-content dot */
.useful-new-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
  margin-left: auto; margin-right: 4px;
}

.up-card-title { font-size: 15px; font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.up-card-meta  { font-size: 11px; color: var(--c-text-muted); margin-top: 4px; }

/* ── Compose modal: selector tabs ────────────────────────── */
.up-type-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.up-type-tab {
  padding: 7px 14px; border: 1.5px solid var(--c-border); border-radius: 20px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--c-surface); color: var(--c-text-3);
  transition: all .12s;
}
.up-type-tab.active {
  background: var(--c-primary); border-color: var(--c-primary); color: #fff;
}

/* ── Video embed ──────────────────────────────────────────── */
.up-video-wrap {
  position: relative; padding-bottom: 56.25%; height: 0;
  border-radius: 12px; overflow: hidden; margin-bottom: 16px;
}
.up-video-wrap iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none;
}

/* ── Detail: action buttons ────────────────────────────────── */
.up-detail-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.up-edit-btn {
  flex: 1; padding: 10px; border-radius: 10px;
  border: 1.5px solid var(--c-primary);
  background: var(--c-surface); color: var(--c-primary);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity .12s;
}
.up-edit-btn:hover { opacity: .85; }
.up-delete-btn {
  flex: 1; padding: 10px; border-radius: 10px;
  border: 1.5px solid var(--c-danger);
  background: var(--c-surface); color: var(--c-danger);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity .12s;
}
.up-delete-btn:hover { opacity: .85; }

/* ── Events (Календар) — PLACEHOLDER списък, ще се замени
   с calendar-grid/agenda изглед по бъдещ дизайн ──────────── */
.event-card {
  background: var(--c-surface);
  border-radius: 14px;
  padding: 14px 14px 12px;
  border-left: 4px solid var(--c-primary);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow .12s;
  margin-bottom: 10px;
}
.event-card:active { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.event-card-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.event-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 10px;
  background: var(--c-primary-light); color: var(--c-primary);
}
.event-daterow { display: flex; gap: 12px; }
.event-daterow > div { flex: 1; }
.event-audience-btns .up-type-tab { opacity: .5; }
.event-audience-btns .up-type-tab.active { opacity: 1; }
.event-detail-facts {
  margin-top: 16px; padding: 12px 14px; border-radius: 10px;
  background: var(--c-surface-2); font-size: 14px; color: var(--c-text-2);
  display: flex; flex-direction: column; gap: 6px;
}
.event-detail-facts a { color: var(--c-primary); word-break: break-all; }

/* ── Dark theme overrides ─────────────────────────────────── */
[data-theme="dark"] .up-cat-tab         { background: var(--c-surface-2); color: var(--c-text-3); }
[data-theme="dark"] .up-cat-tab.active  { background: var(--c-primary); color: #fff; }
[data-theme="dark"] .up-sort-select     { background: var(--c-surface-2); color: var(--c-text-2); border-color: var(--c-border); }
[data-theme="dark"] .up-card            { background: var(--c-surface); }
[data-theme="dark"] .up-type-tab        { background: var(--c-surface-2); color: var(--c-text-3); border-color: var(--c-border); }
[data-theme="dark"] .up-type-tab.active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
[data-theme="dark"] .up-edit-btn        { background: var(--c-surface-2); }
[data-theme="dark"] .up-delete-btn      { background: var(--c-surface-2); }
[data-theme="dark"] .up-cat-badge-lifehacks { background: rgba(245,158,11,.15); color: #fde68a; }
[data-theme="dark"] .event-card         { background: var(--c-surface); }
[data-theme="dark"] .event-badge        { background: var(--c-surface-2); color: var(--c-text-2); }
[data-theme="dark"] .event-detail-facts { background: var(--c-surface-2); }
[data-theme="dark"] .user-sheet-member-btn { background: var(--c-surface-2); border-color: var(--c-border); color: var(--c-text-3); }
[data-theme="dark"] .user-sheet-member-btn.active { border-color: #ca8a04; background: #2d1f00; color: #fde68a; }

/* ── Useful Posts filter toggle ───────────────────────────── */
.up-panel-header-top { display: flex; align-items: center; width: 100%; }
.up-panel-header-top .ann-panel-title { flex: 1; }
.up-panel-header-top .ann-panel-close { margin-left: auto; }
.up-filters-wrap { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; border-top: 1px solid var(--c-border); margin-top: 8px; }
.up-filter-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--c-border);
  background: var(--c-surface); color: var(--c-text-3);
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
  flex-shrink: 0;
}
.up-filter-toggle.active,
.up-filter-toggle:hover { background: var(--c-primary-light); color: var(--c-primary); border-color: var(--c-primary-border); }
[data-theme="dark"] .up-filter-toggle { background: var(--c-surface-2); border-color: var(--c-border); color: var(--c-text-3); }
[data-theme="dark"] .up-filter-toggle.active,
[data-theme="dark"] .up-filter-toggle:hover { background: rgba(59,130,246,.15); color: var(--c-primary); border-color: var(--c-primary); }

/* ── No-menu message ──────────────────────────────────────── */
.no-menu-card { text-align:center; padding:40px 24px; color:var(--c-text-3); }
.no-menu-icon  { font-size:48px; margin-bottom:12px; }
.no-menu-title { font-size:18px; font-weight:600; color:var(--c-text); margin-bottom:8px; }
.no-menu-body  { font-size:14px; line-height:1.5; margin-bottom:20px; }
.no-menu-contact-btn {
  background:var(--c-primary); color:#fff; border:none;
  border-radius:10px; padding:12px 24px; font-size:15px;
  cursor:pointer; width:100%; max-width:260px;
}

/* ── Trainer contact panel ────────────────────────────────── */
.trainer-contact-card { text-align:center; padding:8px 0; }
.trainer-avatar {
  width:72px; height:72px; border-radius:50%;
  background:var(--c-primary); color:#fff;
  font-size:32px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  margin:0 auto 12px;
}
.trainer-name       { font-size:20px; font-weight:700; margin-bottom:4px; color:var(--c-text); }
.trainer-role-label { font-size:13px; color:var(--c-text-3); margin-bottom:24px; }
.trainer-birthday-note { font-size:14px; font-weight:600; margin:-16px 0 20px; }
/* ── Birthdays panel ─────────────────────────────────────── */
.bday-tabs-wrap { padding: 14px 16px 0; border-bottom: 1px solid var(--c-border); }
.bday-tabs-wrap .up-cat-tabs { padding-bottom: 14px; }
.bday-panel-content { padding: 16px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.bday-groups-wrap { display: flex; flex-direction: column; gap: 12px; }
.bday-group {
  background: var(--c-surface-2);
  border-radius: 14px;
  padding: 12px 14px 14px;
  border: 1px solid var(--c-border);
}
.bday-group-today {
  background: linear-gradient(135deg, #fff7e6, #ffedd5);
  border: 1px solid #fbbf24;
  box-shadow: 0 2px 10px rgba(251,191,36,.25);
}
[data-theme="dark"] .bday-group-today { background: linear-gradient(135deg, #3a2c0f, #45300d); border-color: #92660d; box-shadow: 0 2px 10px rgba(251,191,36,.12); }
.bday-group-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bday-group-icon { font-size: 18px; line-height: 1; }
.bday-group-date { font-size: 14px; font-weight: 700; color: var(--c-text); }
.bday-group-today .bday-group-date { color: #92400e; }
[data-theme="dark"] .bday-group-today .bday-group-date { color: #fcd34d; }
.bday-group-count {
  margin-left: auto;
  font-size: 12px; font-weight: 700;
  background: var(--c-primary-light); color: var(--c-primary-dark);
  border-radius: 10px; padding: 2px 8px;
}
.bday-group-people { display: flex; flex-direction: column; gap: 10px; }
.bday-person { display: flex; align-items: center; gap: 10px; }
.bday-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--c-primary); color: #fff;
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.bday-group-today .bday-avatar { background: #f59e0b; }
.bday-avatar.bday-avatar-trainer,
.bday-group-today .bday-avatar.bday-avatar-trainer { background: var(--c-success); }
.bday-person-info { min-width: 0; }
.bday-person-name { font-size: 15px; font-weight: 600; color: var(--c-text); }
.bday-person-tag { font-size: 12px; color: var(--c-text-3); }
.trainer-cta-group  { display:flex; flex-direction:column; gap:12px; }
.trainer-cta-btn {
  display:block; padding:14px; border-radius:12px;
  font-size:16px; font-weight:600; text-decoration:none; text-align:center;
  border:none; cursor:pointer; width:100%;
}
.trainer-cta-phone { background:#22c55e; color:#fff; }
.trainer-cta-email {
  background:var(--c-surface-2); color:var(--c-text);
  border:1px solid var(--c-border);
}
.trainer-avatar-img {
  width:72px; height:72px; border-radius:50%; object-fit:cover;
  margin:0 auto 12px; display:block;
  border:2px solid var(--c-primary);
}
.trainer-avatar-wrap {
  position: relative; display: block; width: 72px; margin: 0 auto 12px;
}
.trainer-avatar-wrap .trainer-avatar,
.trainer-avatar-wrap .trainer-avatar-img {
  margin: 0;
}

/* ── Club role badge (organizer/partner) ─────────────────────
   По подразбиране инлайн иконка (за употреба до текст, напр. име
   на клуб). Вътре в .trainer-avatar-wrap/.clients-panel-row-avatar-wrap/
   .user-sheet-avatar-wrap става absolute overlay в ъгъла на аватара. */
.club-role-badge {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; vertical-align: middle;
  background: var(--c-surface); border-radius: 50%; padding: 2px;
  position: relative; cursor: pointer;
}
.club-role-badge-organizer { background: var(--c-warning-bg); }
.club-role-badge-partner   { background: var(--c-primary-bg); }

.trainer-avatar-wrap .club-role-badge,
.clients-panel-row-avatar-wrap .club-role-badge,
.user-sheet-avatar-wrap .club-role-badge {
  position: absolute; bottom: -2px; right: -2px;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.club-role-tooltip {
  position: absolute; bottom: calc(100% + 6px); left: 0;
  background: var(--c-text); color: #fff;
  font-size: 11px; font-weight: 600; white-space: nowrap; padding: 5px 9px; border-radius: 6px;
  z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.club-role-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 10px;
  border: 5px solid transparent; border-top-color: var(--c-text);
}

/* Текстов надпис до името (не само hover title на иконата) */
.club-role-label {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.club-role-label-organizer { background: var(--c-warning-bg); color: #92400e; }
.club-role-label-partner   { background: var(--c-primary-bg); color: var(--c-primary-dark); }
[data-theme="dark"] .club-role-label-organizer { background: #2d1f00; color: #fde68a; }
.club-member-group-label { font-size: 12px; font-weight: 700; color: var(--c-text-3); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid var(--c-border); }
.club-member-menu-btn { background: none; border: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--c-text-3); padding: 4px 8px; }
.club-member-menu { position: absolute; right: 0; top: 100%; margin-top: 4px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px; box-shadow: var(--shadow-modal); z-index: 10; min-width: 190px; overflow: hidden; }
.club-member-menu-item { display: block; width: 100%; text-align: left; padding: 10px 14px; background: none; border: none; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--c-text); }
.club-member-menu-item:hover { background: var(--c-surface-2); }
.my-trainer-status      { margin-top:16px; }
.my-trainer-status-text { font-size:14px; color:var(--c-text-2); line-height:1.4; }
.my-trainer-status .trainer-cta-btn {
  background:var(--c-primary); color:#fff;
}

/* ── Header avatar ────────────────────────────────────────── */
.header-avatar-img {
  width:32px; height:32px; border-radius:50%; object-fit:cover;
  border:2px solid var(--c-primary); flex-shrink:0;
}

/* ── Profile modal ────────────────────────────────────────── */
.profile-modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:199;
  backdrop-filter: blur(2px);
}
.profile-modal {
  position:fixed; bottom:0; left:0; right:0; max-height:92dvh;
  background:var(--c-surface); border-radius:20px 20px 0 0;
  overflow-y:auto; z-index:200;
  transform:translateY(100%); transition:transform .3s ease;
  padding-bottom:env(safe-area-inset-bottom,0);
  animation: slideUpSheet .22s ease;
}
.profile-modal.open { transform:translateY(0); }

.profile-modal-header {
  display:flex; align-items:center; padding:14px 16px 10px;
  border-bottom:1px solid var(--c-border);
  position:sticky; top:0; background:var(--c-surface); z-index:1;
}
.profile-modal-close {
  background:none; border:none; font-size:24px; cursor:pointer;
  color:var(--c-text-3); padding:0 10px 0 0; line-height:1;
}
.profile-modal-title {
  flex:1; text-align:center; font-weight:700; font-size:17px;
  color:var(--c-text);
}

/* Avatar zone */
.profile-avatar-zone {
  display:flex; justify-content:center; padding:28px 0 16px;
}
.profile-avatar-btn {
  width:88px; height:88px; border-radius:50%;
  position:relative; overflow:hidden;
  border:3px solid var(--c-primary);
  background:var(--c-primary);
  cursor:pointer; padding:0;
  display:flex; align-items:center; justify-content:space-between;
}
.profile-avatar-img {
  width:100%; height:100%; object-fit:cover;
  position:absolute; inset:0;
}
.profile-avatar-initials {
  font-size:36px; font-weight:700; color:#fff;
  line-height:1; user-select:none;
  width:100%;
}
.profile-avatar-camera {
  position:absolute; bottom:0; left:0; right:0;
  background:rgba(0,0,0,.42); text-align:center;
  font-size:15px; padding:3px 0;
  pointer-events:none;
}

/* Profile view — идентична структура с trainer-contact-card */
.profile-view-card {
  padding:24px 24px 8px;   /* trainer-contact-card padding + малко отгоре */
}
/* Допълнителни info редове под CTA бутоните */
.profile-info-rows {
  display:flex; flex-direction:column;
  margin-top:16px; gap:0;
  border-top:1px solid var(--c-border);
}
.profile-info-row {
  display:flex; align-items:center; gap:14px;
  padding:11px 0; border-bottom:1px solid var(--c-border);
}
.profile-info-row:last-child { border-bottom:none; }
.profile-view-icon { font-size:18px; flex-shrink:0; width:26px; text-align:center; }
.profile-view-text { font-size:14px; color:var(--c-text); word-break:break-word; }
/* "Редактирай" бутон — изглежда като primary CTA */
.profile-view-actions {
  margin-top:20px;
}
.profile-cta-edit {
  width:100%;
  background:var(--c-primary); color:#fff;
}

/* Profile form */
.profile-form {
  padding:8px 20px 24px;
}
.profile-form-error {
  color:var(--c-danger); font-size:14px;
  margin-bottom:12px; padding:8px 12px;
  background:rgba(220,38,38,.08); border-radius:8px;
}
.profile-form-actions {
  display:flex; gap:12px; margin-top:8px;
}
.profile-cancel-btn {
  flex:1; padding:14px; font-size:16px; font-weight:600;
}
.profile-form-actions .btn-save {
  flex:2; padding:14px; font-size:16px; font-weight:600;
}

/* ── User Sheet avatar ────────────────────────────────────── */
.user-sheet-avatar-wrap {
  position: relative; display: inline-block; flex-shrink: 0; line-height: 0;
}
.user-sheet-avatar-img {
  width:44px; height:44px; border-radius:50%; object-fit:cover;
  flex-shrink:0; border:2px solid var(--c-primary);
}
.user-sheet-avatar-initials {
  width:44px; height:44px; border-radius:50%;
  background:var(--c-primary); color:#fff;
  font-size:20px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}

/* ── Avatar Cropper ───────────────────────────────────────── */
.avatar-cropper-overlay {
  position:fixed; inset:0; background:#111; z-index:400;
  display:flex; flex-direction:column;
  touch-action:none;
  backdrop-filter: blur(2px);
}
.avatar-cropper-header {
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 16px; flex-shrink:0;
  padding-top: calc(14px + env(safe-area-inset-top));
  border-bottom:1px solid rgba(255,255,255,.1);
}
.avatar-crop-title { color:#fff; font-size:16px; font-weight:600; }
.avatar-crop-btn-text {
  background:none; border:none; color:#fff; font-size:15px;
  cursor:pointer; padding:4px 8px;
}
.avatar-crop-btn-done { color:#60a5fa; font-weight:700; }
.avatar-cropper-wrap {
  flex:1; position:relative; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}
#avatarCropImg {
  position:absolute;
  max-width:none; max-height:none;
  touch-action:none; user-select:none; -webkit-user-select:none;
  transform-origin:center center;
}
.crop-circle-mask {
  position:absolute; pointer-events:none;
  width:78%; max-width:320px; aspect-ratio:1;
  border-radius:50%;
  box-shadow:0 0 0 9999px rgba(0,0,0,.65);
  top:50%; left:50%; transform:translate(-50%,-50%);
  border:2px solid rgba(255,255,255,.4);
}
.avatar-crop-hint {
  text-align:center; color:rgba(255,255,255,.55); font-size:13px;
  padding:10px 0 14px; flex-shrink:0;
}
.clear-btn {
  color: #d00;
  border-color: #d00;
  background: #fee;
}
/* ── Desktop ─────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .page { padding: 16px 20px calc(210px + env(safe-area-inset-bottom)); }
  .bottom-nav { justify-content: center; }
  .nav-tab { max-width: 180px; }
}
@media (display-mode: standalone) {
  .app-header { padding-top: env(safe-area-inset-top); }
}
/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 360px) {
  .water-progress-wrap { height: 44px; }
  .water-time { font-size: 9px; }
}
@media (min-width: 768px), (hover: hover) and (pointer: fine) {
  .dropzone { display: block; }
}

@media (max-width: 760px) {
  .ann-md-help-grid { grid-template-columns: 1fr; }
}