/* ============================================================
   Settings section (Настройки) — dark navy + purple theme.
   Scoped under .settings-screen so it never leaks into the
   light app theme.
   ============================================================ */
.settings-screen {
  --st-bg: #0d1018;
  --st-surface: #171c2b;
  --st-surface-2: #1e2436;
  --st-row: #1b2233;
  --st-border: rgba(255, 255, 255, 0.06);
  --st-accent: #00f076;
  --st-accent-2: #00ba5b;
  --st-accent-soft: rgba(0, 240, 118, 0.12);
  --st-text: #f2f4fb;
  --st-text-muted: #8b91a9;
  --st-text-dim: #5f6680;
  --st-danger: #ff5d6c;
  --st-radius: 18px;
  --st-radius-sm: 14px;
  background: var(--st-bg) !important;
  color: var(--st-text);
}
.settings-screen .main-content { background: var(--st-bg); padding-bottom: 90px; }
.settings-screen .header {
  background: var(--st-bg);
  border-bottom: 1px solid var(--st-border);
}
.settings-screen .screen-title { color: var(--st-text); }
.settings-screen .back-btn { color: var(--st-text); }

/* ---- Section ---- */
.st-section { margin: 18px 16px 0; }
.st-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--st-text-dim);
  margin: 0 4px 10px;
}
.st-card {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  overflow: hidden;
}

/* ---- List rows ---- */
.st-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--st-border);
  color: var(--st-text);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.st-row:last-child { border-bottom: none; }
.st-row:active { background: var(--st-surface-2); }
.st-row-icon {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--st-accent-soft);
  font-size: 18px;
}
.st-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-row-label { font-size: 15px; font-weight: 600; color: var(--st-text); }
.st-row-sub { font-size: 12.5px; color: var(--st-text-muted); }
.st-row-trail { color: var(--st-text-dim); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.st-row-value { color: var(--st-text-muted); font-size: 14px; }
.st-row-chevron { color: var(--st-text-dim); font-size: 20px; line-height: 1; }
.st-row-danger .st-row-label { color: var(--st-danger); }
.st-row-danger .st-row-icon { background: rgba(255, 93, 108, 0.14); }

/* ---- Toggle switch ---- */
.st-switch { position: relative; width: 46px; height: 27px; flex: 0 0 46px; }
.st-switch input { opacity: 0; width: 0; height: 0; }
.st-switch .st-slider {
  position: absolute; inset: 0;
  background: #313850;
  border-radius: 999px;
  transition: background 0.22s ease;
}
.st-switch .st-slider::before {
  content: ""; position: absolute;
  height: 21px; width: 21px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.st-switch input:checked + .st-slider { background: var(--st-accent); }
.st-switch input:checked + .st-slider::before { transform: translateX(19px); }

/* ---- Badge ---- */
.st-badge {
  font-size: 11px; font-weight: 700;
  color: var(--st-accent-2);
  background: var(--st-accent-soft);
  border-radius: 999px;
  padding: 3px 9px;
}
.st-badge-soon { color: var(--st-text-muted); background: rgba(255,255,255,0.06); }
.st-check { color: var(--st-accent); font-size: 18px; font-weight: 800; }

/* ---- Select ---- */
.st-select {
  appearance: none;
  background: var(--st-surface-2);
  color: var(--st-text);
  border: 1px solid var(--st-border);
  border-radius: 10px;
  padding: 9px 30px 9px 12px;
  font-size: 14px; font-weight: 600;
  min-width: 120px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b91a9' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ---- Inputs / form ---- */
.st-field { padding: 14px 16px; border-bottom: 1px solid var(--st-border); }
.st-field:last-child { border-bottom: none; }
.st-field-label { display: block; font-size: 12.5px; color: var(--st-text-muted); margin-bottom: 7px; }
.st-input {
  width: 100%;
  background: var(--st-surface-2);
  border: 1px solid var(--st-border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--st-text);
  font-size: 15px;
  outline: none;
}
.st-input:focus { border-color: var(--st-accent); box-shadow: 0 0 0 3px var(--st-accent-soft); }
.st-input::placeholder { color: var(--st-text-dim); }

/* ---- Segmented control (gender etc.) ---- */
.st-seg { display: flex; gap: 8px; }
.st-seg button {
  flex: 1;
  background: var(--st-surface-2);
  border: 1px solid var(--st-border);
  border-radius: 12px;
  padding: 11px 0;
  color: var(--st-text-muted);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.st-seg button.active {
  background: var(--st-accent);
  border-color: var(--st-accent);
  color: #fff;
}

/* ---- Primary button ---- */
.st-btn {
  display: block; width: calc(100% - 32px);
  margin: 18px 16px 8px;
  background: linear-gradient(135deg, var(--st-accent) 0%, var(--st-accent-2) 100%);
  color: #fff;
  border: none; border-radius: 14px;
  padding: 15px; font-size: 16px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(124, 92, 252, 0.32);
}
.st-btn:active { transform: translateY(1px); }
.st-btn-ghost {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  box-shadow: none;
  color: var(--st-text);
}

/* ---- Avatar ---- */
.st-avatar {
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px;
  background: var(--st-accent-soft);
  border: 2px solid var(--st-accent);
}
.st-avatar-lg { width: 88px; height: 88px; flex-basis: 88px; font-size: 40px; margin: 4px auto 12px; }

/* ---- Family member row ---- */
.st-member {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--st-border);
  cursor: pointer;
}
.st-member:last-child { border-bottom: none; }
.st-member-body { flex: 1; min-width: 0; }
.st-member-name { font-size: 15px; font-weight: 600; }
.st-member-sub { font-size: 12.5px; color: var(--st-text-muted); margin-top: 2px; }
.st-member-actions { display: flex; gap: 6px; }
.st-icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: var(--st-surface-2);
  border: 1px solid var(--st-border);
  border-radius: 10px;
  color: var(--st-text-muted);
  cursor: pointer; font-size: 15px;
}

/* ---- Stats grid ---- */
.st-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--st-border);
}
.st-stat { background: var(--st-surface); padding: 16px; }
.st-stat-val { font-size: 22px; font-weight: 800; color: var(--st-text); }
.st-stat-val .st-unit { font-size: 13px; font-weight: 600; color: var(--st-text-muted); margin-left: 3px; }
.st-stat-label { font-size: 12px; color: var(--st-text-muted); margin-top: 3px; }

/* ---- Param table (member profile) ---- */
.st-param { display: flex; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--st-border); }
.st-param:last-child { border-bottom: none; }
.st-param-key { color: var(--st-text-muted); font-size: 14px; }
.st-param-val { color: var(--st-text); font-size: 15px; font-weight: 600; }

/* ---- Invite link card ---- */
.st-invite { padding: 16px; }
.st-invite code {
  display: block; word-break: break-all;
  background: var(--st-surface-2);
  border-radius: 10px; padding: 12px;
  font-size: 13px; color: var(--st-accent-2);
  margin-top: 8px;
}
.st-empty { padding: 22px 16px; text-align: center; color: var(--st-text-muted); font-size: 14px; }

/* ===== Health section additions ===== */
.st-current { display: flex; align-items: center; gap: 16px; padding: 18px 16px; }
.st-current-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; font-size: 24px;
  background: var(--st-accent-soft);
}
.st-current-label { font-size: 12.5px; color: var(--st-text-muted); }
.st-current-val { font-size: 30px; font-weight: 800; line-height: 1.15; }
.st-current-unit { font-size: 14px; font-weight: 600; color: var(--st-text-muted); }
.st-current-time { font-size: 12.5px; color: var(--st-text-dim); margin-top: 2px; }

.st-tabs {
  display: flex; gap: 6px; padding: 5px;
  background: var(--st-surface); border: 1px solid var(--st-border);
  border-radius: 14px;
}
.st-tab {
  flex: 1; padding: 9px 0; border: none; background: transparent;
  color: var(--st-text-muted); font-size: 13.5px; font-weight: 600;
  border-radius: 10px; cursor: pointer;
}
.st-tab.active { background: var(--st-accent); color: #fff; }

.st-chart-card { padding: 14px; margin-top: 12px; }

.st-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--st-text-dim); margin-right: 6px; vertical-align: middle;
}
.st-dot.online { background: #00f076; box-shadow: 0 0 0 3px rgba(0,240,118,.18); }
.st-dot.offline { background: #ff5d6c; }

.st-metric { padding: 16px; }
.st-metric-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: var(--st-text); }
.st-metric-val { font-size: 24px; font-weight: 800; margin: 6px 0 10px; }
.st-metric-val small { font-size: 12.5px; font-weight: 600; color: var(--st-text-muted); }
.st-ring {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--st-accent) 0deg, var(--st-surface-2) 0deg);
  font-size: 0;
}
.st-ring b {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--st-surface); display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--st-text);
}
.st-fh-card { padding: 14px 16px; }
.st-fh-name { font-weight: 700; display: flex; align-items: center; gap: 10px; }
.st-fh-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.st-fh-cell { text-align: center; }
.st-fh-cell b { display: block; font-size: 15px; font-weight: 700; }
.st-fh-cell span { font-size: 10.5px; color: var(--st-text-muted); }

/* ============================================================
   Settings HUB redesign (#screen-settings only) — separated
   card rows + gradient icon tiles. Scoped so sub-screens keep
   their grouped-card layout.
   ============================================================ */
#screen-settings.settings-screen {
  background: linear-gradient(180deg, #0f1320 0%, #0b0e18 100%) !important;
}
#screen-settings .main-content {
  background: transparent;
  padding-bottom: 96px;
}
#screen-settings .header { background: transparent; border-bottom: none; }
#screen-settings .screen-title { font-weight: 800; letter-spacing: -0.01em; }

#screen-settings .st-section { margin: 22px 16px 0; }
#screen-settings .st-section-title {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--st-text-dim);
  margin: 0 6px 12px;
}

/* HUB card = transparent group; each row is its own card. */
#screen-settings .st-card {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#screen-settings .st-row {
  gap: 14px;
  padding: 14px 15px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  background: linear-gradient(150deg, rgba(30, 37, 58, 0.92), rgba(18, 22, 36, 0.96));
  box-shadow: 0 12px 26px -14px rgba(2, 8, 23, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
#screen-settings .st-row:last-child { border-bottom: 1px solid var(--st-border); }
#screen-settings .st-row:active {
  transform: scale(0.985);
  background: linear-gradient(150deg, rgba(36, 44, 70, 0.95), rgba(22, 27, 44, 0.97));
  border-color: rgba(0, 240, 118, 0.34);
}

/* Gradient icon tile (matches mockup's purple rounded-square icons). */
#screen-settings .st-row-icon {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  border-radius: 13px;
  font-size: 20px;
  color: #00f076 !important;
  background: rgba(0, 240, 118, 0.1) !important;
  border: 1px solid rgba(0, 240, 118, 0.2) !important;
  box-shadow: none !important;
}
#screen-settings .st-row-icon svg {
  width: 22px; height: 22px;
  display: block;
}
#screen-settings .st-row-label { font-size: 15.5px; font-weight: 650; }
#screen-settings .st-row-sub { font-size: 12.5px; color: var(--st-text-dim); margin-top: 1px; }
#screen-settings .st-row-value { font-size: 13.5px; color: var(--st-text-muted); }
#screen-settings .st-row-chevron { color: var(--st-text-dim); font-size: 19px; }
