/* CalorieScan — soft clay UI */
:root {
  --bg: #F7F3F8;
  --bg-warm: #FFF5EE;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #FFFFFF;
  --text: #3D3550;
  --muted: #8B8399;
  --accent: #6ECFB8;
  --accent-d: #4AB89E;
  --accent-l: #E8F8F3;
  --mint: #7ECBB8;
  --peach: #F7B7C4;
  --lavender: #B794F6;
  --pink: #F5A0B8;
  --sky: #A8D8F0;
  --border: rgba(180, 170, 200, 0.22);
  --border-soft: rgba(255, 255, 255, 0.65);
  --warn: #F5A962;
  --pro: #B794F6;
  --radius: 22px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --shadow: 0 8px 32px rgba(120, 90, 160, 0.08), 0 2px 8px rgba(120, 90, 160, 0.04);
  --shadow-soft: 0 4px 20px rgba(120, 90, 160, 0.06);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --glass: blur(18px) saturate(1.4);
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Outfit", "Nunito", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

.hidden { display: none !important; }

/* Decorative background */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 10% 0%, rgba(247, 183, 196, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 95% 8%, rgba(183, 148, 246, 0.28) 0%, transparent 50%),
    radial-gradient(ellipse 55% 40% at 50% 100%, rgba(126, 203, 184, 0.25) 0%, transparent 55%),
    linear-gradient(165deg, #FFF8F5 0%, var(--bg) 45%, #F0F5FF 100%);
}
.app-bg::before,
.app-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
}
.app-bg::before {
  width: 220px; height: 220px;
  top: 12%; left: -40px;
  background: rgba(245, 160, 184, 0.45);
}
.app-bg::after {
  width: 180px; height: 180px;
  bottom: 18%; right: -30px;
  background: rgba(168, 216, 240, 0.5);
}

.app {
  position: relative;
  z-index: 1;
  max-width: 430px;
  margin: 0 auto;
  padding: 14px 16px 100px;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.logo {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #E8F8F3, #FDE8F0);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow-soft), var(--shadow-inset);
  border: 1px solid var(--border-soft);
}
.header-main { flex: 1; }
.header h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.header-meta { display: flex; gap: 6px; margin-top: 4px; }
.streak-badge, .level-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
}
.streak-badge {
  background: linear-gradient(135deg, #FFF0E8, #FFE8D4);
  color: #D4845A;
}
.level-badge {
  background: linear-gradient(135deg, var(--accent-l), #E0F5EF);
  color: var(--accent-d);
}
.icon-btn {
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 42px;
  height: 42px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s;
}
.icon-btn:active { transform: scale(0.94); }

.profile-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 10px;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), var(--accent-l));
  border: 1.5px solid rgba(126, 203, 184, 0.45);
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.profile-btn:active { transform: scale(0.96); }
.profile-btn-icon { font-size: 16px; line-height: 1; }
.profile-btn-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-d);
  letter-spacing: 0.02em;
}

.profile-link-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--mint), var(--lavender));
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(126, 203, 184, 0.35);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.profile-link-btn:focus { outline: none; }
.profile-link-btn:focus-visible {
  outline: 2px solid rgba(126, 203, 184, 0.55);
  outline-offset: 2px;
}
.profile-link-btn:active { transform: scale(0.96); }

.screen {
  display: none;
  opacity: 0;
}
.screen.active {
  display: block;
  animation: screenIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Date nav */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
}
.date-btn {
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  transition: transform 0.12s, background 0.12s;
}
.date-btn:active { transform: scale(0.92); background: var(--card-solid); }
#day-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  min-width: 120px;
  text-align: center;
}

/* Ring card — hero clay block */
.ring-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  border-radius: 28px;
  padding: 20px 18px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow), var(--shadow-inset);
  border: 1px solid var(--border-soft);
  position: relative;
}
.ring-wrap {
  position: relative;
  width: 152px;
  height: 152px;
  margin: 0 auto 14px;
}
.ring-wrap.ring--burn { width: 160px; height: 160px; }
.ring-wrap.ring--burn .ring-kcal { font-size: 24px; }
.ring-wrap.ring--burn .ring-sub { font-size: 10px; }
.ring-gross {
  font-size: 9px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 3px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.ring-burn { display: none; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 2px 8px rgba(126, 203, 184, 0.25)); }
.ring-bg { fill: none; stroke: rgba(180, 170, 200, 0.18); stroke-width: 11; }
.ring-fill {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.45s cubic-bezier(0.34, 1.2, 0.64, 1), stroke 0.3s;
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-kcal {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-d), var(--lavender));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.ring-sub { font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 3px; }

/* Macro pills */
.macro-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.macro-pill {
  text-align: center;
  border-radius: 16px;
  padding: 10px 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid transparent;
  box-shadow: var(--shadow-inset);
}
.macro-pill strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 2px;
}
.macro-pill span { opacity: 0.85; }
.macro-pill--p {
  background: linear-gradient(160deg, #FFF0F5, #FFE4EC);
  border-color: rgba(245, 160, 184, 0.25);
}
.macro-pill--p strong { color: #D96A8A; }
.macro-pill--f {
  background: linear-gradient(160deg, #FFF8EE, #FFEFD6);
  border-color: rgba(245, 169, 98, 0.25);
}
.macro-pill--f strong { color: #D4845A; }
.macro-pill--c {
  background: linear-gradient(160deg, #EEF8FF, #E0F0FF);
  border-color: rgba(168, 216, 240, 0.35);
}
.macro-pill--c strong { color: #5A9EC4; }

.btn-share-day {
  display: block;
  width: 100%;
  margin: 12px 0 4px;
  padding: 12px 16px;
  border: 1px solid rgba(126, 203, 184, 0.35);
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-d);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-share-day:active { background: var(--accent-l); }
.btn-share-day:disabled { opacity: 0.5; }
.share-day-sheet { max-height: 92vh; overflow-y: auto; }
.share-day-preview {
  width: 100%;
  border-radius: 16px;
  margin: 12px 0;
  box-shadow: 0 8px 28px rgba(61, 53, 80, 0.12);
}
.share-day-hint { margin-bottom: 8px; }

/* Meals */
.meals-list { display: flex; flex-direction: column; gap: 12px; }
.meal-block {
  background: var(--card);
  backdrop-filter: var(--glass);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
}
.meal-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.meal-block.is-collapsed .meal-head { margin-bottom: 0; }
.meal-chev {
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.meal-block.is-collapsed .meal-chev { transform: rotate(-90deg); }
.meal-name {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
}
.meal-kcal { font-size: 13px; color: var(--accent-d); font-weight: 800; flex-shrink: 0; }
.meal-block.is-collapsed .meal-body { display: none; }
.meal-empty { font-size: 12px; color: var(--muted); }
.meal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  gap: 6px;
}
.meal-item:first-of-type { border-top: none; }
.meal-item-text { flex: 1; min-width: 0; }
.item-actions { display: flex; gap: 2px; flex-shrink: 0; }
.item-edit, .item-del, .dish-edit {
  background: rgba(255, 255, 255, 0.78);
  border: none;
  outline: none;
  box-shadow: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 5px 8px;
  border-radius: 10px;
  transition: background 0.12s, color 0.12s, transform 0.1s;
  font-family: inherit;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}
.item-edit, .dish-edit { font-size: 13px; }
.item-edit:active, .item-del:active, .dish-edit:active { background: var(--accent-l); }
.item-edit:focus, .item-del:focus, .dish-edit:focus { outline: none; }
.meal-dish-row.editing .dish-edit,
.meal-item.editing .item-edit {
  background: linear-gradient(135deg, var(--lavender), #C9A8FF);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(183, 148, 246, 0.35);
}
.meal-dish-row.editing .dish-edit:active,
.meal-item.editing .item-edit:active {
  transform: scale(0.94);
  background: linear-gradient(135deg, #A67FE8, var(--lavender));
}
.meal-dish-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 5px 8px 5px 10px;
  background: linear-gradient(135deg, var(--accent-l), #F0FAF7);
  border-radius: 10px;
  border: 1px solid rgba(110, 207, 184, 0.2);
}
.meal-dish-row.editing .meal-dish-text { display: none; }
.meal-dish-row:not(.editing) .dish-name-edit { display: none; }
.meal-dish-text {
  flex: 1;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-d);
  min-width: 0;
}
.dish-name-edit {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1.5px solid rgba(183, 148, 246, 0.28);
  border-radius: 10px;
  font-size: 12px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.95);
  outline: none;
  box-shadow: var(--shadow-inset);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dish-name-edit:focus {
  border-color: rgba(183, 148, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(183, 148, 246, 0.14);
}
.meal-dish {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-d);
  margin-bottom: 4px;
  padding: 5px 10px;
  background: linear-gradient(135deg, var(--accent-l), #F0FAF7);
  border-radius: 10px;
  display: inline-block;
  border: 1px solid rgba(110, 207, 184, 0.2);
}
.meal-add {
  font-size: 12px;
  color: var(--accent-d);
  background: none;
  border: none;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

/* Scan hero */
.hero-card {
  background: linear-gradient(135deg, #7ECBB8 0%, #B794F6 55%, #F7B7C4 100%);
  color: #fff;
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 12px 36px rgba(126, 203, 184, 0.35);
  border: 1px solid rgba(255,255,255,0.25);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 4px;
}
.hero-desc, .scan-limit { font-size: 12px; opacity: 0.94; }
.scan-limit { margin-top: 6px; }

.upload-zone {
  display: block;
  background: var(--card);
  backdrop-filter: var(--glass);
  border: 2px dashed rgba(183, 148, 246, 0.35);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-zone:active { border-color: var(--lavender); background: rgba(255,255,255,0.95); }
.upload-zone input { display: none; }
.upload-icon { font-size: 36px; }
.preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 16px; }

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  margin: 10px 0 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--card-solid);
  margin-bottom: 8px;
  box-shadow: var(--shadow-inset);
  transition: border-color 0.15s;
}
.field-input:focus {
  outline: none;
  border-color: rgba(126, 203, 184, 0.6);
}

/* Buttons */
.btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 8px;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: linear-gradient(135deg, var(--mint), #8DD4C4);
  color: #fff;
  box-shadow: 0 6px 20px rgba(110, 207, 184, 0.4);
  border: 1px solid rgba(255,255,255,0.3);
}
.btn.primary:disabled { opacity: 0.45; box-shadow: none; transform: none; }
.btn.ghost {
  background: var(--card);
  color: var(--accent-d);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.loader { text-align: center; padding: 20px; color: var(--muted); font-size: 13px; }
.api-loader {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(61, 53, 80, 0.2);
  backdrop-filter: blur(4px);
}
.api-loader.hidden { display: none !important; }
.api-loader-box {
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius);
  padding: 22px 28px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  text-align: center;
  min-width: 168px;
}
.api-loader-text {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(183, 148, 246, 0.2);
  border-top-color: var(--lavender);
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Cards */
.card {
  background: var(--card);
  backdrop-filter: var(--glass);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:active { transform: scale(0.992); }
.card-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.scan-dish-wrap {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.scan-dish-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.scan-dish-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}

.scan-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.scan-item input[type=checkbox],
.scan-check {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--lavender);
  border-radius: 6px;
  cursor: pointer;
}
.scan-item input[type=number],
.scan-item .scan-grams {
  width: 64px;
  padding: 6px 8px;
  border: 1.5px solid rgba(183, 148, 246, 0.28);
  border-radius: 10px;
  font-size: 12px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.95);
  outline: none;
  box-shadow: var(--shadow-inset);
}
.scan-item input[type=number]:focus {
  border-color: rgba(183, 148, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(183, 148, 246, 0.14);
}
.scan-total { margin-top: 10px; font-size: 14px; font-weight: 700; }

.product-results { max-height: 200px; overflow-y: auto; margin-bottom: 10px; }
.product-row {
  padding: 11px 14px;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.12s, transform 0.12s;
}
.product-row:active { border-color: var(--mint); transform: scale(0.99); }
.product-row small { color: var(--muted); }
.product-row--dish { border-color: rgba(126, 203, 184, 0.45); background: rgba(126, 203, 184, 0.08); }
.product-row-ing { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.product-row--ai { border-color: rgba(147, 130, 220, 0.5); background: rgba(147, 130, 220, 0.1); }
.product-ai-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: #6b5bb8; background: rgba(147, 130, 220, 0.2); padding: 2px 6px; border-radius: 6px;
  margin-left: 4px; vertical-align: middle;
}
.product-search-hint { font-size: 13px; color: var(--muted); padding: 10px 4px; }
.product-search-hint--ai { color: #6b5bb8; font-weight: 600; }
.product-search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 8px;
  font-weight: 700;
}
.spinner--sm {
  width: 22px;
  height: 22px;
  border-width: 2px;
  margin: 0;
  flex-shrink: 0;
}

.add-selected {
  background: linear-gradient(135deg, var(--accent-l), #F5F0FF);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(110, 207, 184, 0.2);
}
.selected-name { font-weight: 800; margin-bottom: 8px; }
.selected-preview { font-size: 13px; color: var(--muted); margin: 8px 0; }

/* Calendar week */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-grid--locked {
  display: block;
  grid-template-columns: none;
}
.week-grid-big .week-day { padding: 10px 4px; min-height: 72px; }

.pro-lock-banner {
  width: 100%;
  box-sizing: border-box;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(183, 148, 246, 0.12), rgba(255, 255, 255, 0.9));
  border: 1.5px solid rgba(183, 148, 246, 0.35);
  text-align: center;
}
.pro-lock-banner-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--ink);
}
.pro-lock-banner p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 12px;
}
.pro-lock-banner-btn {
  display: inline-flex;
  margin: 0 auto;
}
.pro-bot-pay {
  margin-top: 10px;
  text-align: center;
}
.pro-bot-pay-btn {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}
.week-day {
  text-align: center;
  padding: 8px 2px;
  border-radius: 14px;
  background: rgba(255,255,255,0.55);
  font-size: 10px;
  position: relative;
  border: 1.5px solid transparent;
  transition: transform 0.12s, box-shadow 0.12s;
}
.week-day.over { background: linear-gradient(160deg, #FFF5E8, #FFECD6); }
.week-day.under { background: linear-gradient(160deg, var(--accent-l), #E8FAF5); }
.week-day.good { background: linear-gradient(160deg, #E8FAF0, #D4F5E4); border-color: rgba(110, 207, 184, 0.35); }
.week-day.partial { background: linear-gradient(160deg, #EEF6FF, #E0EEFF); }
.week-day.empty { opacity: 0.7; }
.week-day .dnum { font-weight: 800; font-size: 15px; display: block; margin-bottom: 2px; }
.week-day .dicons { font-size: 11px; line-height: 1.3; margin-top: 2px; }
.week-day .dfire { font-size: 12px; }
.week-legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 10px; color: var(--muted); margin-bottom: 10px; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.card-title-row .card-title { margin-bottom: 0; }
.week-nav { display: flex; gap: 4px; }

/* Workouts */
.workout-day { padding: 10px 0; border-top: 1px solid var(--border); font-size: 13px; }
.workout-day:first-child { border-top: none; }
.preset-btn {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.6);
  margin-bottom: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.12s;
}
.preset-btn:active { border-color: var(--mint); }
.plan-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.profile-grid label { font-size: 11px; font-weight: 800; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.profile-grid input, .profile-grid select {
  padding: 10px 12px;
  min-height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--card-solid);
  box-shadow: var(--shadow-inset);
  transition: border-color 0.15s;
}
.profile-grid select { padding-right: 34px; }
.targets-preview { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

.badges-list { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-chip {
  background: linear-gradient(135deg, var(--accent-l), #F5F0FF);
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(110, 207, 184, 0.2);
}
.badge-chip.locked { opacity: 0.35; background: rgba(255,255,255,0.5); }

.pro-card {
  border: 2px solid rgba(183, 148, 246, 0.45);
  background: linear-gradient(160deg, rgba(255,255,255,0.92), rgba(245, 240, 255, 0.85));
}
.pro-list { font-size: 13px; color: var(--muted); padding-left: 18px; margin-bottom: 12px; line-height: 1.6; }

/* Floating pill bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  padding: 8px 14px calc(10px + env(safe-area-inset-bottom));
  z-index: 50;
  pointer-events: none;
}
.bottom-nav-inner {
  display: flex;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(24px) saturate(1.5);
  border-radius: 22px;
  padding: 6px 4px;
  box-shadow: 0 8px 32px rgba(100, 80, 140, 0.14), 0 1px 0 rgba(255,255,255,0.9) inset;
  border: 1px solid rgba(255,255,255,0.7);
  pointer-events: auto;
}
.nav-tab {
  flex: 1;
  background: none;
  border: none;
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
  padding: 6px 2px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-radius: 14px;
  transition: color 0.15s, background 0.15s, transform 0.12s;
  line-height: 1.1;
}
.nav-tab span { font-size: 9px; }
.nav-tab.active {
  color: var(--accent-d);
  background: linear-gradient(160deg, var(--accent-l), rgba(245, 240, 255, 0.8));
  box-shadow: 0 2px 8px rgba(110, 207, 184, 0.15);
}
.nav-tab:active { transform: scale(0.94); }

.hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(61, 53, 80, 0.92);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  z-index: 100;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 8px 24px rgba(61, 53, 80, 0.25);
}

.back-link {
  background: none;
  border: none;
  color: var(--lavender);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 8px;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
/* Bottom sheet */
.sheet-overlay { position: fixed; inset: 0; background: rgba(61, 53, 80, 0.35); backdrop-filter: blur(4px); z-index: 200; }
.bottom-sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  border-radius: 26px 26px 0 0;
  padding: 14px 18px calc(22px + env(safe-area-inset-bottom));
  z-index: 201;
  box-shadow: 0 -12px 40px rgba(100, 80, 140, 0.12);
  border-top: 1px solid rgba(255,255,255,0.8);
}
.sheet-handle { width: 44px; height: 5px; background: rgba(180, 170, 200, 0.35); border-radius: 4px; margin: 0 auto 14px; }
.sheet-title { font-family: var(--font-display); font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.sheet-desc { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.choice-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-solid);
  margin-bottom: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: transform 0.12s;
}
.choice-btn:active { transform: scale(0.99); }
.choice-btn small { color: var(--muted); font-size: 11px; }
.choice-icon { font-size: 28px; flex-shrink: 0; }
.scan-choice { border-color: rgba(126, 203, 184, 0.4); background: linear-gradient(135deg, #F0FAF7, #E8F8F3); }
.manual-choice { border-color: rgba(168, 216, 240, 0.5); background: linear-gradient(135deg, #F0F8FF, #E8F4FF); }

.add-mode-row { display: flex; gap: 8px; margin-bottom: 14px; }
#screen-food .field-label { margin-top: 2px; margin-bottom: 6px; }
#screen-food .cs-wrap { margin-bottom: 4px; }
#screen-food #food-meal-type.field-input { margin-bottom: 4px; }
#screen-food .add-mode-row { margin-top: 16px; margin-bottom: 16px; }
#add-selected { margin-top: 12px; margin-bottom: 16px; }
.mode-btn {
  flex: 1;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-solid);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.mode-btn.active {
  border-color: rgba(126, 203, 184, 0.5);
  background: linear-gradient(160deg, var(--accent-l), #F5F0FF);
  color: var(--accent-d);
}

.meal-add-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.meal-add-row .meal-add {
  flex: 1;
  min-width: 100px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--accent-l);
  border: 1px solid rgba(110, 207, 184, 0.2);
  font-size: 11px;
}
.meal-add-scan { background: linear-gradient(135deg, #F0FAF7, #E8F8F3) !important; color: #3D9A82 !important; }
.meal-add-manual { background: linear-gradient(135deg, #F0F8FF, #E8F4FF) !important; color: #5A8EC4 !important; }

/* Friend bubble */
.day-bubble-float {
  position: absolute;
  top: 10px;
  right: 10px;
  max-width: 118px;
  background: linear-gradient(135deg, #FFF8F0, #FFEFD8);
  border: 1.5px solid rgba(245, 200, 140, 0.45);
  border-radius: 16px 16px 16px 4px;
  padding: 8px 11px;
  font-size: 10px;
  line-height: 1.35;
  font-weight: 700;
  color: #9A7040;
  box-shadow: 0 4px 16px rgba(180, 130, 60, 0.12);
  z-index: 2;
}

.day-mood-row { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.mood-row-block { margin-bottom: 10px; }
.mood-row-block:last-child { margin-bottom: 0; }
.mood-row-block .field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-label.inline { display: inline-block; margin: 6px 8px 4px 0; font-size: 10px; }
.mood-chips { display: inline-flex; gap: 5px; margin-bottom: 6px; flex-wrap: wrap; }
.mood-chip {
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.7);
  border-radius: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.12s;
  font-family: inherit;
}
.mood-chip.active {
  border-color: rgba(126, 203, 184, 0.55);
  background: linear-gradient(160deg, var(--accent-l), #F5F0FF);
  box-shadow: 0 2px 8px rgba(110, 207, 184, 0.15);
}

.advice-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
}
.custom-choice { border-color: rgba(183, 148, 246, 0.45); background: linear-gradient(135deg, #F5F0FF, #EDE8FF); }
.custom-food-tabs { margin-bottom: 12px; }
.custom-food-rows { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px; }
.custom-food-row {
  display: grid;
  grid-template-columns: 1fr 64px 72px 36px;
  gap: 6px;
  align-items: center;
}
.custom-food-row .field-input { margin-bottom: 0; padding: 10px 8px; font-size: 13px; }
.custom-food-row-head {
  display: grid;
  grid-template-columns: 1fr 64px 72px 36px;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 4px;
}
.custom-add-row-btn { width: 100%; margin-bottom: 10px; }
.custom-save-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 6px 0;
  cursor: pointer;
}
.custom-save-row input { width: 18px; height: 18px; accent-color: var(--lavender); }
.icon-btn.cf-remove {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--card-solid);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.icon-btn.cf-remove:active { transform: scale(0.96); }
.product-row--mine { border-left: 3px solid var(--lavender); }
.product-pending-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #9B6B00;
  background: #FFF4D6;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 4px;
}
.add-mode-row { flex-wrap: wrap; }
.add-mode-row .mode-btn { flex: 1 1 30%; min-width: 0; font-size: 12px; padding: 10px 6px; }

.meal-item.editing .meal-item-text { display: none; }
.meal-item .meal-item-edits {
  display: none;
  flex: 1;
  min-width: 0;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.meal-item.editing .meal-item-edits { display: flex; }
.meal-item .name-edit,
.meal-item .grams-edit,
.meal-item .kcal-edit {
  display: none;
  font-size: 12px;
  font-family: inherit;
  border: 1.5px solid rgba(183, 148, 246, 0.28);
  border-radius: 10px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.95);
  outline: none;
  box-shadow: var(--shadow-inset);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.meal-item .name-edit:focus,
.meal-item .grams-edit:focus,
.meal-item .kcal-edit:focus {
  border-color: rgba(183, 148, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(183, 148, 246, 0.14);
}
.meal-item .name-edit { flex: 1 1 100%; min-width: 120px; }
.meal-item .grams-edit { width: 56px; }
.meal-item .kcal-edit { width: 64px; }
.meal-item.editing .name-edit,
.meal-item.editing .grams-edit,
.meal-item.editing .kcal-edit { display: inline-block; }

.week-col { display: flex; flex-direction: column; align-items: stretch; }
.cal-day-panel {
  margin-top: 12px;
  padding: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,0.75), rgba(245, 240, 255, 0.5));
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  font-size: 13px;
  line-height: 1.55;
  width: 100%;
  box-shadow: var(--shadow-inset);
}
.cal-day-panel h4 { font-family: var(--font-display); font-size: 14px; font-weight: 800; margin-bottom: 8px; }

.burn-summary {
  margin-top: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--accent-l), rgba(245, 240, 255, 0.6));
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid rgba(110, 207, 184, 0.2);
}
.burn-total { font-weight: 800; color: var(--accent-d); margin-bottom: 4px; }
.burn-line { color: var(--muted); font-weight: 700; }

.extra-act-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.extra-act-grid label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.extra-act-grid input, .extra-act-grid select {
  padding: 10px 12px;
  min-height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  width: 100%;
  font-family: inherit;
  background: var(--card-solid);
  box-shadow: var(--shadow-inset);
}
.extra-act-grid select { padding-right: 34px; }
.extra-act-grid .full { grid-column: 1 / -1; }
.extra-wd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.extra-wd-chip {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--card-solid);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.extra-wd-chip.selected {
  background: linear-gradient(135deg, var(--mint), #8DD4C4);
  border-color: var(--accent-d);
  color: #fff;
}
.custom-plan-hint { margin-bottom: 12px; line-height: 1.45; }
.custom-plan-days { display: flex; flex-direction: column; gap: 14px; margin: 14px 0; }
.collapsible .collapse-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.collapsible .collapse-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.collapsible .collapse-chevron {
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.collapsible.is-collapsed .collapse-chevron { transform: rotate(-90deg); }
.collapsible.is-collapsed .collapse-body { display: none; }
.collapsible .collapse-body { padding-top: 12px; }
.custom-day-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.custom-day-card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.custom-day-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent-l), #F0FAF7);
  color: var(--accent-d);
  font-weight: 800;
  font-size: 14px;
}
.custom-day-card-sub { font-size: 11px; color: var(--muted); font-weight: 700; }
.cp-field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 10px;
}
.cp-field-label .field-input { font-size: 15px; padding: 12px 14px; min-height: 46px; }
.cp-idle-panel {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-l);
  border: 1px dashed rgba(110, 207, 184, 0.35);
  margin-top: 4px;
}
.cp-idle-panel .hint { margin: 0; font-size: 12px; }
.cp-steps-panel { margin-top: 4px; }
.cp-ex-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.cp-ex-panel.hidden,
.cp-steps-panel.hidden,
.cp-idle-panel.hidden { display: none; }
.cp-ex-title-row {
  display: grid;
  grid-template-columns: 1fr 36px;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.cp-ex-title { font-size: 14px; font-weight: 800; color: var(--text); min-width: 0; }
.cp-add-ex {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 18px !important;
  line-height: 1;
  border-radius: 10px !important;
}
.cp-cal-wrap {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 6px;
  align-items: center;
}
.cp-cal-wrap .field-input { margin-bottom: 0; }
.cp-est-cal {
  width: 44px !important;
  min-width: 44px !important;
  height: 42px !important;
  padding: 0 !important;
  font-size: 16px !important;
}
.wo-cal-edit {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.wo-cal-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.wo-cal-input {
  margin-bottom: 0 !important;
  min-height: 38px !important;
  padding: 8px 10px !important;
  font-size: 14px !important;
}
.wo-cal-hint { margin: 6px 0 4px; }
.cp-ex-list { display: flex; flex-direction: column; gap: 8px; }
.cp-ex-head {
  display: grid;
  grid-template-columns: 1fr 52px 52px 32px;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0 2px;
  margin-bottom: 2px;
}
.cp-ex-row {
  display: grid;
  grid-template-columns: 1fr 52px 52px 32px;
  gap: 6px;
  align-items: center;
}
.cp-ex-row .field-input {
  margin-bottom: 0;
  min-height: 40px;
  padding: 8px 10px;
  font-size: 14px;
}
.cp-ex-row .cp-ex-sets,
.cp-ex-row .cp-ex-reps { text-align: center; }
.cp-ex-del {
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #c45c6a;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  width: 32px;
  height: 40px;
  flex-shrink: 0;
  font-family: inherit;
  transition: transform 0.12s, background 0.12s;
}
.cp-ex-del:active { transform: scale(0.9); background: #fff0f2; }
.cp-add-ex { flex-shrink: 0; }

.wo-done-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
  box-shadow: var(--shadow-inset);
}
.wo-done-btn:active { transform: scale(0.98); }
.wo-done-btn.done {
  background: linear-gradient(135deg, var(--mint), #8DD4C4);
  border-color: var(--accent-d);
  color: #fff;
  box-shadow: 0 4px 14px rgba(110, 207, 184, 0.35);
}

.wo-block { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed var(--border); }
.wo-block:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.wo-quick-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.wo-quick-btns .wo-done-btn { width: auto; flex: 1; min-width: 120px; margin-top: 0; font-size: 12px; padding: 9px 10px; }
.wo-block > strong { font-size: 14px; display: block; margin-bottom: 2px; }
.wo-block > .hint { font-size: 11px; margin-top: 0; }
.wo-exercises { margin-top: 6px; font-size: 10px; color: var(--muted); }
.ex-collapsible summary { cursor: pointer; font-weight: 700; font-size: 10px; list-style: none; color: var(--text); line-height: 1.35; }
.ex-collapsible summary::-webkit-details-marker { display: none; }
.ex-how { font-size: 9px; color: var(--muted); margin-top: 3px; line-height: 1.4; padding-left: 2px; }
.wo-inline-detail { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.mini-btn.done { background: var(--accent-l); border-color: var(--mint); color: var(--accent-d); }

.advice-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.advice-title { font-size: 12px; font-weight: 600; color: var(--muted); }
.advice-refresh {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  transition: transform 0.12s, color 0.12s;
}
.advice-refresh:active { transform: scale(0.92); }
.advice-text { font-size: 13px; line-height: 1.55; color: var(--text); }

.workout-planned { font-size: 12px; color: var(--muted); margin: 4px 0; }
.workout-logged { font-size: 12px; color: var(--accent-d); font-weight: 700; }
.workout-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.workout-actions .mini-btn {
  font-size: 11px;
  padding: 7px 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.8);
  cursor: pointer;
  font-weight: 800;
  font-family: inherit;
}
.personal-grid .full { grid-column: 1 / -1; }

.xp-bar-wrap { margin-bottom: 12px; }
.xp-bar { height: 12px; background: rgba(255,255,255,0.6); border-radius: var(--radius-pill); overflow: hidden; border: 1px solid var(--border); }
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--lavender));
  transition: width 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  border-radius: var(--radius-pill);
}
.xp-bar-label { font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 800; }
.levels-list { list-style: none; font-size: 13px; line-height: 1.5; display: flex; flex-direction: column; gap: 8px; }
.levels-list li { padding: 0; border: none; }
.level-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.45);
  border: 1px solid var(--border);
  opacity: 0.55;
}
.level-row.reached {
  opacity: 1;
  background: linear-gradient(135deg, rgba(232,248,243,0.9), rgba(255,255,255,0.85));
  border-color: rgba(126, 203, 184, 0.4);
}
.level-medal { font-size: 26px; line-height: 1; flex-shrink: 0; }
.level-body { flex: 1; min-width: 0; }
.level-body strong { display: block; font-size: 13px; font-weight: 800; margin-bottom: 2px; }
.level-body span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; line-height: 1.35; }
.levels-hint { margin: -4px 0 12px; font-size: 11px; }

.cal-day-panel {
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(165deg, rgba(255,255,255,0.92), rgba(232,248,243,0.55));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}
.cal-day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.cal-day-date { font-family: var(--font-display); font-size: 15px; font-weight: 800; }
.cal-day-kcal { font-size: 13px; font-weight: 800; color: var(--accent-d); }
.cal-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.cal-stat {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--border);
}
.cal-stat-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cal-stat-val { font-size: 14px; font-weight: 800; margin-top: 2px; }
.cal-section { margin-bottom: 10px; }
.cal-section-title { font-size: 11px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.cal-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-chip {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
}
.cal-meal-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px dashed rgba(180,170,200,0.2);
}
.cal-tip {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(247, 183, 196, 0.15);
  border: 1px solid rgba(247, 183, 196, 0.3);
  font-size: 12px;
  font-style: italic;
  line-height: 1.45;
  color: var(--text);
}

.cal-day-detail {
  margin-top: 12px;
  padding: 14px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.55;
}
.cal-day-detail h4 { font-family: var(--font-display); font-size: 14px; margin-bottom: 8px; }
.cal-day-detail .cal-row { padding: 4px 0; }
.week-day { cursor: pointer; }
.week-day.selected {
  outline: 2.5px solid var(--mint);
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(110, 207, 184, 0.25);
}

.wo-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.wo-tab {
  flex: 1;
  padding: 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.7);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.wo-tab.active {
  border-color: rgba(126, 203, 184, 0.5);
  background: linear-gradient(160deg, var(--accent-l), #F5F0FF);
  color: var(--accent-d);
}
.btn-sm { padding: 11px !important; font-size: 13px !important; margin-top: 8px; }
.wo-plan-card .plan-title { margin-top: 4px; }

.workout-week-new { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.wo-day-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}
.wo-day-card:active { transform: scale(0.99); }
.wo-day-card.active {
  border-color: rgba(126, 203, 184, 0.5);
  background: linear-gradient(160deg, rgba(255,255,255,0.92), var(--accent-l));
  box-shadow: 0 4px 18px rgba(110, 207, 184, 0.15);
}
.wo-day-card.active .hint:not(.wo-block .hint) {
  margin-bottom: 10px;
}
.wo-day-card .wo-block,
.wo-day-card .ex-collapsible {
  cursor: default;
}
.wo-day-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.wo-day-name { font-family: var(--font-display); font-weight: 800; font-size: 14px; }
.wo-day-badge { font-size: 11px; color: var(--muted); font-weight: 800; }
.wo-ex-list { margin-top: 6px; font-size: 10px; color: var(--muted); }
.wo-ex-row { padding: 4px 0; border-top: 1px solid var(--border); }
.wo-ex-row:first-child { border-top: none; }
.wo-ex-name { font-weight: 700; font-size: 10px; }
.wo-ex-meta { color: var(--muted); font-size: 9px; font-weight: 500; margin-left: 4px; }
.wo-day-detail {
  background: var(--card);
  backdrop-filter: var(--glass);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
}
.wo-day-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.saved-plans-list { display: flex; flex-direction: column; gap: 8px; }
.saved-plan-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.65);
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border);
}
.saved-plan-item.active-plan { border: 1.5px solid rgba(126, 203, 184, 0.5); background: var(--accent-l); }
.saved-plan-btns { display: flex; gap: 4px; flex-shrink: 0; }
.saved-plan-btns button {
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  font-family: inherit;
}
.plan-active-tag {
  font-size: 11px;
  color: var(--accent-d);
  font-weight: 800;
}
.plan-del-btn {
  padding: 6px 8px !important;
  border-color: rgba(196, 92, 106, 0.25) !important;
  background: rgba(255, 240, 242, 0.9) !important;
  line-height: 1;
}
.plan-del-btn:active { transform: scale(0.94); }
textarea.field-input { resize: vertical; min-height: 56px; }

/* Day extras: weight + quick trackers */
.day-extras {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.weight-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.weight-stepper.weight-saved {
  border-color: rgba(126, 203, 184, 0.65);
  box-shadow: 0 0 0 2px rgba(126, 203, 184, 0.2);
}
.weight-stepper-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  min-width: 32px;
}
.weight-step-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.9);
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.weight-step-btn:active { transform: scale(0.94); background: rgba(237, 228, 255, 0.5); }
.weight-stepper-field {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.weight-stepper-input {
  width: 100%;
  max-width: 88px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  outline: none;
  color: var(--text);
}
.weight-stepper-input::placeholder { color: var(--muted); font-weight: 600; font-size: 16px; }
.weight-stepper-unit {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
}
.quick-trackers-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}
.quick-trackers {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.quick-trackers-empty {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 4px;
  white-space: nowrap;
}
.quick-tracker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  min-width: 64px;
  min-height: 64px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.65);
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.quick-tracker-btn:active { transform: scale(0.97); }
.qt-emoji { font-size: 18px; line-height: 1; }
.qt-name {
  font-size: 10px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qt-status {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  line-height: 1;
}
.qt-bar {
  width: 100%;
  max-width: 52px;
  height: 3px;
  background: rgba(180,170,200,0.25);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}
.qt-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--lavender));
  border-radius: 2px;
}
.quick-tracker-btn.qt-done {
  border-color: rgba(45, 170, 122, 0.45);
  background: linear-gradient(160deg, rgba(232, 248, 243, 0.85), rgba(255, 255, 255, 0.8));
}
.quick-tracker-btn.qt-done .qt-status { color: #1f9d6a; }
.quick-trackers::-webkit-scrollbar { display: none; }
.quick-trackers-more {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
  line-height: 1;
}

.privacy-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 14px 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(247, 183, 196, 0.25);
  border: 1px solid rgba(247, 183, 196, 0.45);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}
.privacy-banner span { flex: 1; line-height: 1.35; }

.auth-error {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(61, 53, 80, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-error-body {
  background: #fff;
  border-radius: 20px;
  padding: 22px 20px;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(61, 53, 80, 0.25);
}
.auth-error-body strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 10px;
}
.auth-error-body p { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.auth-error-body .hint { font-size: 12px; color: var(--muted); margin-top: 12px; }

.privacy-banner span { flex: 1; line-height: 1.35; }

.chart-send-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chart-send-btn:active {
  transform: scale(0.97);
  color: var(--text);
  border-color: rgba(180, 170, 200, 0.4);
}

.btn-add-tracker {
  padding: 6px 14px;
  border: 1.5px dashed rgba(126, 203, 184, 0.65);
  border-radius: var(--radius-pill);
  background: var(--accent-l);
  color: var(--accent-d);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.btn-add-tracker:active { transform: scale(0.96); }
.tracker-limit-hint { margin: -4px 0 8px; font-size: 11px; }

.tracker-plus-btn,
.tracker-main-btn.tracker-plus-btn {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--mint), #9AD4C8);
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(126, 203, 184, 0.3);
}
.tracker-plus-btn:active { transform: scale(0.96); }
.tracker-plus-btn.done {
  background: linear-gradient(135deg, #B794F6, #C9A8FF);
}
.tracker-toggle-btn,
.tracker-main-btn.tracker-toggle-btn {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.7);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.tracker-main-btn.tracker-plus-btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 12px;
}
.tracker-toggle-btn.is-done,
.tracker-main-btn.tracker-toggle-btn.is-done {
  border-color: rgba(45, 170, 122, 0.45);
  background: linear-gradient(135deg, #E8F8F3, #D4F0E8);
  color: #1f9d6a;
}
.tracker-val--done {
  color: #1f9d6a !important;
  font-weight: 800;
}
.tracker-row.tracker-done {
  border-color: rgba(45, 170, 122, 0.28);
  background: linear-gradient(160deg, rgba(232, 248, 243, 0.65), rgba(255, 255, 255, 0.75));
}
.tracker-minus-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  min-width: 34px;
}
.tracker-minus-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.tracker-minus-btn:not(:disabled):active { transform: scale(0.94); }
.tracker-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.tracker-hide-btn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.6);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.disabled-trackers {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.disabled-trackers-title { font-size: 11px; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.disabled-tracker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  color: var(--muted);
}

/* Pro banner */
.pro-banner {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}
.pro-banner--free {
  background: linear-gradient(135deg, rgba(237, 228, 255, 0.95), rgba(255, 255, 255, 0.9));
  border-color: rgba(183, 148, 246, 0.35);
}
.pro-banner--active {
  background: linear-gradient(135deg, rgba(232, 248, 243, 0.95), rgba(255, 255, 255, 0.9));
  border-color: rgba(126, 203, 184, 0.45);
}
.pro-banner-glow {
  position: absolute;
  top: -30px; right: -20px;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(183, 148, 246, 0.35), transparent 70%);
  pointer-events: none;
}
.pro-banner-icon { font-size: 32px; line-height: 1; flex-shrink: 0; }
.pro-banner-body { flex: 1; min-width: 0; }
.pro-banner-title { font-family: var(--font-display); font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.pro-banner-desc, .pro-banner-days { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.pro-banner-days { font-size: 15px; color: var(--accent-d); }
.pro-list--compact { margin: 0 0 10px 16px; font-size: 11px; line-height: 1.45; color: var(--muted); }
.pro-pay-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pro-pay-btn {
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  color: #fff;
}
.pro-pay-stars { background: linear-gradient(135deg, #FFB347, #FFCC70); color: #4a3800; }
.pro-pay-card { background: linear-gradient(135deg, var(--lavender), #9B7EDE); }
.pro-pay-btn:active { transform: scale(0.97); }

/* Settings */
.settings-hint { margin: -4px 0 10px; font-size: 11px; }
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.toggle-row.subtle { font-size: 12px; font-weight: 600; color: var(--muted); padding-left: 8px; }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--mint); flex-shrink: 0; }
.notify-sub { margin-bottom: 4px; }
.settings-divider { height: 1px; background: var(--border); margin: 8px 0 12px; }
.consent-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
  cursor: pointer;
}
.consent-row input { margin-top: 2px; flex-shrink: 0; accent-color: var(--mint); }

/* Trackers */
.trackers-card { margin-bottom: 14px; }
.trackers-list { display: flex; flex-direction: column; gap: 12px; }
.tracker-row {
  background: rgba(255,255,255,0.55);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border);
}
.tracker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}
.tracker-name { font-weight: 800; }
.tracker-val { font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.tracker-bar {
  height: 8px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.tracker-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--lavender));
  border-radius: var(--radius-pill);
  transition: width 0.25s;
}
.tracker-add-form { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.tracker-add-row { display: grid; grid-template-columns: 56px 1fr 1fr; gap: 8px; margin-bottom: 8px; }

/* Analytics charts */
.chart-card {
  background: var(--card);
  backdrop-filter: var(--glass);
  border-radius: var(--radius);
  padding: 16px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}
.chart-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.chart-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.chart-dot--mint { background: #7ECBB8; box-shadow: 0 0 0 3px rgba(126, 203, 184, 0.22); }
.chart-dot--lavender { background: #B794F6; box-shadow: 0 0 0 3px rgba(183, 148, 246, 0.2); }
.chart-dot--peach { background: #F7B7C4; box-shadow: 0 0 0 3px rgba(247, 183, 196, 0.25); }
.chart-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(180, 170, 200, 0.1);
}
.chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  padding: 0 2px;
}
.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.chart-legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.lg-bar { background: #7ECBB8; }
.lg-bar--purple { background: #B794F6; }
.lg-goal { background: rgba(245, 169, 98, 0.35); }
.lg-goal--sky { background: rgba(168, 216, 240, 0.5); }
.chart-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 14px;
}
.chart-stat {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(180, 170, 200, 0.14);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.chart-stat--wide { grid-column: 1 / -1; }
.chart-stat-val {
  display: block;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.chart-stat-val--sm { font-size: 12px; font-weight: 600; }
.chart-stat-lbl {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 3px;
}
.chart-stat-hint { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.weight-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 10px;
  align-items: end;
}
.weight-row .field-input { margin-bottom: 0; }

/* Boot splash */
body.is-booting .app-shell {
  visibility: hidden;
  pointer-events: none;
}
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background:
    radial-gradient(ellipse 70% 50% at 20% 10%, rgba(247, 183, 196, 0.4), transparent 55%),
    radial-gradient(ellipse 60% 45% at 90% 20%, rgba(183, 148, 246, 0.32), transparent 50%),
    linear-gradient(165deg, #FFF8F5 0%, var(--bg) 50%, #F0F5FF 100%);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.app-splash.splash-out {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
  visibility: hidden;
}
.app-splash.is-gone {
  display: none !important;
}
.splash-logo {
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  border-radius: 28px;
  background: linear-gradient(135deg, #E8F8F3, #FDE8F0);
  box-shadow: var(--shadow), var(--shadow-inset);
  border: 1px solid var(--border-soft);
  animation: splashPulse 2.4s ease-in-out infinite;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.splash-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.splash-text-wrap {
  position: relative;
  width: min(300px, 88vw);
  height: 2.8em;
  overflow: hidden;
}
.splash-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.splash-text.is-on {
  opacity: 1;
  z-index: 1;
}
.splash-dots {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.splash-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mint), var(--lavender));
  animation: splashDot 1.2s ease-in-out infinite;
}
.splash-dots span:nth-child(2) { animation-delay: 0.15s; }
.splash-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes splashDot {
  0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

/* Custom select (выпадающий список) */
select.cs-native {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.cs-wrap {
  position: relative;
  width: 100%;
}
.cs-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  min-height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-solid);
  box-shadow: var(--shadow-inset);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.cs-trigger:active { transform: scale(0.99); }
.cs-wrap.is-open .cs-trigger {
  border-color: rgba(126, 203, 184, 0.65);
  box-shadow: 0 0 0 3px rgba(126, 203, 184, 0.12);
}
.cs-chev {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.cs-wrap.is-open .cs-chev { transform: rotate(180deg); }
.cs-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  max-height: 220px;
  overflow-y: auto;
  background: var(--card-solid);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px;
}
.cs-option {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.cs-option:hover,
.cs-option.is-selected {
  background: linear-gradient(135deg, var(--accent-l), #F5F0FF);
  color: var(--accent-d);
}
.profile-grid .cs-wrap,
.extra-act-grid .cs-wrap,
.cp-field-label .cs-wrap { margin-top: 0; }
.field-input:focus,
.cs-trigger:focus {
  outline: none;
  border-color: rgba(126, 203, 184, 0.65);
  box-shadow: 0 0 0 3px rgba(126, 203, 184, 0.15);
}

/* Ссылки и фокус без чёрной обводки */
a {
  color: var(--accent-d);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
a:focus { outline: none; }
a:focus-visible {
  outline: 2px solid rgba(126, 203, 184, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}
button, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}
button:focus:not(:focus-visible) { outline: none; }

/* Компактнее поля в конструкторе плана */
.custom-day-card { padding: 12px; }
.cp-field-label { margin-bottom: 8px; }
.cp-field-label .field-input {
  padding: 10px 12px;
  min-height: 42px;
  font-size: 14px;
  margin-bottom: 0;
}
.cp-steps-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cp-steps-panel .cp-field-label { margin-bottom: 0; }

@media (max-width: 360px) {
  .cp-ex-head,
  .cp-ex-row {
    grid-template-columns: 1fr 46px 46px 28px;
    gap: 4px;
  }
  .cp-ex-row .field-input { font-size: 13px; padding: 8px 6px; }
  .profile-grid { gap: 6px; }
  .extra-act-grid { gap: 8px; }
}
