/* Apollo PWA — «дневник» tab (MyDiaryScreen + HolisticHarmonyOverviewView)
   Source: apollo-pwa-origin/lib/presentation/groups_screen/fitness_app/my_diary/my_diary_screen.dart */

:root {
  --diary-font: 'Raleway', system-ui, sans-serif;
  --diary-bg: #f2f3f8;
  --diary-ink: #17262a;
  --diary-muted: #3a5160;
  --harmony-bg: #120d1d;
  --harmony-radius: 22px;

  --band-nutrition-start: #7048e8;
  --band-nutrition-end: #3a1d79;
  --band-mood-start: #4f8dcb;
  --band-mood-end: #26416e;
  --band-activity-start: #2ea6a6;
  --band-activity-end: #1a5457;
  --band-tip-start: #5a3ca6;
  --band-tip-end: #342153;
  --band-tip-border: rgba(233, 213, 255, 0.55);

  --macro-carbs: #87a0e5;
  --macro-protein: #f56e98;
  --macro-fats: #f1b440;
  --ring-purple: #5a4ecf;
  --ring-light: #8a98e8;

  --harmony-h: calc(var(--band-h) * 4 + var(--band-half-overlap));
  --band-h: 156px;
  --band-collapsed-h: calc(var(--band-h) + var(--band-overlap));
  --band-title-padding-top: 14px;
  --band-overlap: 48px;
  --band-half-overlap: 24px;
  --band-wave-zone: 23.5%;
}

* { box-sizing: border-box; }

/* ── Embedded screen root (inside IOSDevice) ── */
.diary-screen-root {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--diary-bg);
  font-family: var(--diary-font);
  color: var(--diary-ink);
  -webkit-font-smoothing: antialiased;
  overflow: visible;
}

/* ── Diary header (getAppBarUI) ── */
.diary-screen-root .diary-header {
  flex-shrink: 0;
  padding: 54px 8px 0;
  display: flex;
  justify-content: center;
}

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

.date-picker .material-icons-round {
  font-size: 18px;
  color: #000;
}

.date-picker-btn {
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  background: #fff;
  color: #000;
  font-family: var(--diary-font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ── Main scroll area ── */
.diary-main {
  flex: 1;
  min-height: 0;
  padding: 8px 0 8px;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

/* ── Holistic Harmony card ── */
.harmony-card {
  position: relative;
  height: var(--harmony-h);
  width: calc(100% - 32px);
  max-width: 358px;
  margin: 0 0 -58px;
  border-radius: var(--harmony-radius);
  background: var(--harmony-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 -8px 30px rgba(112, 72, 232, 0.55),
    -7px -3px 28px rgba(209, 77, 143, 0.4),
    7px 3px 28px rgba(46, 166, 166, 0.4),
    0 8px 30px rgba(90, 60, 166, 0.55);
  overflow: hidden;
  z-index: 0;
}

.harmony-band {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
  transition:
    top 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.22s ease;
  z-index: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.harmony-band:not(.is-expanded) {
  overflow: visible;
}

.harmony-band.is-expanded {
  cursor: default;
  overflow: hidden;
}

.harmony-card[data-expanded]:not([data-expanded=""]) .harmony-band:not(.is-expanded) {
  opacity: 0;
  pointer-events: none;
}

.harmony-band.is-expanded {
  z-index: 4;
  top: 0 !important;
  height: var(--harmony-h) !important;
}

/* Collapsed positions — mirrors AnimatedPositioned in Flutter */
.harmony-band[data-section="nutrition"] {
  top: 0;
  /* First band is shorter by half-overlap — sets the stack rhythm */
  height: calc(var(--band-h) + var(--band-half-overlap));
  z-index: 4;
}

.harmony-band[data-section="mood"] {
  top: calc(var(--band-h) - var(--band-half-overlap));
  height: var(--band-collapsed-h);
  z-index: 3;
}

.harmony-band[data-section="activity"] {
  top: calc(var(--band-h) * 2 - var(--band-half-overlap));
  height: var(--band-collapsed-h);
  z-index: 2;
}

.harmony-band[data-section="suggestion"] {
  top: calc(var(--band-h) * 3 - var(--band-half-overlap));
  height: var(--band-collapsed-h);
  z-index: 1;
}

.band-surface {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

/* Band photo — AssetImage(fit: fitWidth) + ColorFilter darken 0.5 (collapsed only) */
.band-photo {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: auto;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.5);
  pointer-events: none;
  z-index: 0;
}

.harmony-band.is-expanded .band-photo {
  display: none;
}

.band-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 0;
  pointer-events: none;
}

.band-surface[data-section="nutrition"] {
  background: linear-gradient(180deg, var(--band-nutrition-start), var(--band-nutrition-end));
}

.band-surface[data-section="mood"] {
  background: linear-gradient(180deg, var(--band-mood-start), var(--band-mood-end));
  border-radius: 0 0 18px 18px;
}

.band-surface[data-section="activity"] {
  background: linear-gradient(180deg, var(--band-activity-start), var(--band-activity-end));
  border-radius: 0 0 18px 18px;
}

.band-surface[data-section="suggestion"] {
  background: linear-gradient(180deg, var(--band-tip-start), var(--band-tip-end));
  border: 1.2px solid var(--band-tip-border);
  box-shadow: 0 2px 14px rgba(179, 136, 255, 0.26);
  border-radius: 0 0 var(--harmony-radius) var(--harmony-radius);
}

.band-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 12px 10px;
}

.band-inner.collapsed,
.harmony-band:not(.is-expanded) .band-inner.mood-collapsed,
.harmony-band:not(.is-expanded) .band-inner.activity-collapsed,
.harmony-band:not(.is-expanded) .band-inner.tip-collapsed {
  justify-content: flex-start;
  padding-top: var(--band-title-padding-top);
  padding-bottom: 8px;
}

/* First band: center title block in the visible strip (no incoming wave at top) */
.harmony-band:not(.is-expanded)[data-section="nutrition"] .band-inner.collapsed {
  justify-content: center;
  padding-top: 0;
  padding-bottom: calc(var(--band-half-overlap) + 6px);
}

/* Stacked bands: same 14px title inset within each visible strip */
.harmony-band:not(.is-expanded)[data-section="mood"] .band-inner.mood-collapsed,
.harmony-band:not(.is-expanded)[data-section="activity"] .band-inner.activity-collapsed,
.harmony-band:not(.is-expanded)[data-section="suggestion"] .band-inner.tip-collapsed {
  padding-top: calc(var(--band-overlap) + var(--band-title-padding-top));
}

.harmony-band.is-expanded .collapsed-only {
  display: none !important;
}

/* Scalloped seam between stacked bands (HarmonySectionClipper).
   Upper bands sit above lower ones in z-order, so clip their bottom edge. */
.harmony-band:not(.is-expanded)[data-section="nutrition"] .band-surface,
.harmony-band:not(.is-expanded)[data-section="mood"] .band-surface,
.harmony-band:not(.is-expanded)[data-section="activity"] .band-surface {
  -webkit-clip-path: url(#harmony-band-bottom-wave);
  clip-path: url(#harmony-band-bottom-wave);
}

.harmony-band.is-expanded .band-surface {
  -webkit-clip-path: none;
  clip-path: none;
}

/* Seam shadow cast from upper bands (aligned to clip-path wave) */
.band-seam-effect {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--band-overlap);
  z-index: 6;
  pointer-events: none;
  overflow: visible;
}

/* Shadow pool on the receiving band under each seam */
.band-seam-receive {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--band-overlap);
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.harmony-clip-defs {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
}

/* Band header row */
.band-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
}

.band-head h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.band-head .band-toggle {
  flex-shrink: 0;
}

.band-toggle {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  display: flex;
  align-items: center;
}

.band-toggle .material-icons-round { font-size: 20px; }

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e9d5ff;
  box-shadow: 0 0 8px rgba(233, 213, 255, 0.8);
  animation: pulseDot 1.6s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.65; }
}

.band-subtitle {
  margin: 4px 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

/* Keep collapsed strips visually equal between the four overview bands */
.harmony-band:not(.is-expanded) .band-inner.collapsed,
.harmony-band:not(.is-expanded) .band-inner.mood-collapsed,
.harmony-band:not(.is-expanded) .band-inner.activity-collapsed,
.harmony-band:not(.is-expanded) .band-inner.tip-collapsed {
  min-height: calc(var(--band-h) - var(--band-overlap) + var(--band-half-overlap));
}

.band-subtitle.tip-preview {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.band-subtitle.tip-preview strong {
  color: #fff;
  font-weight: 700;
}

.band-subtitle.tip-preview em {
  color: #e9d5ff;
  font-style: normal;
  font-weight: 600;
}

.band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.harmony-band:not(.is-expanded)[data-section="nutrition"] .band-actions.collapsed-only {
  margin-top: 6px;
}

.harmony-band:not(.is-expanded) .band-actions.collapsed-only {
  margin-top: 6px;
}

.band-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  font-family: var(--diary-font);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.harmony-band:not(.is-expanded) .band-actions.collapsed-only .band-action-btn {
  min-height: 36px;
  padding: 8px 16px;
}

.harmony-band:not(.is-expanded)[data-section="mood"] .band-actions.collapsed-only .band-action-btn {
  min-width: min(100%, 240px);
}

.band-action-btn .material-icons-round { font-size: 16px; }

/* Expanded panel */
.band-expanded {
  flex: 1;
  min-height: 0;
  margin-top: 8px;
  overflow: auto;
  display: none;
}

.harmony-band.is-expanded .band-expanded {
  display: flex;
  flex-direction: column;
}

.harmony-band.is-expanded .band-subtitle.collapsed-only { display: none; }

.harmony-band.is-expanded .band-inner {
  padding-top: 14px;
}

/* Don't steal clicks from controls inside expanded panels */
.band-expanded,
.band-action-btn,
.meal-add,
.meals-scroll,
.stress-panel,
.stress-technique-tile,
.stress-start-btn,
.stress-log-btn,
.mood-scroll,
.mood-add,
.activity-metric-tile,
.activity-period-btn,
.activity-detail-chart {
  cursor: auto;
}

/* ── Nutrition summary card ── */
.nutrition-summary {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calorie-ring {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.calorie-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.calorie-ring .ring-track {
  fill: none;
  stroke: rgba(90, 78, 207, 0.2);
  stroke-width: 8;
}

.calorie-ring .ring-progress {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 408;
  stroke-dashoffset: 153;
}

.calorie-ring-center {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 4px solid rgba(90, 78, 207, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #2e2a44;
  line-height: 1.05;
}

.calorie-ring-center .kcal-main {
  font-size: 22px;
  font-weight: 600;
}

.calorie-ring-center .kcal-label {
  font-size: 15px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.87);
  margin-top: 2px;
}

.macro-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.macro-item label {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
}

.macro-bar {
  width: 96px;
  height: 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.macro-bar > span {
  display: block;
  height: 100%;
  border-radius: 4px;
}

.macro-item[data-macro="carbs"] .macro-bar > span {
  width: 68%;
  background: linear-gradient(90deg, rgba(135, 160, 229, 0.65), var(--macro-carbs));
}

.macro-item[data-macro="protein"] .macro-bar > span {
  width: 45%;
  background: linear-gradient(90deg, rgba(245, 110, 152, 0.65), var(--macro-protein));
}

.macro-item[data-macro="fats"] .macro-bar > span {
  width: 35%;
  background: linear-gradient(90deg, rgba(241, 180, 64, 0.65), var(--macro-fats));
}

.macro-values {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
}

.macro-values strong { color: #fff; }

/* Meals list — horizontal cards (MealsListView) */
.meals-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 4px 4px;
  height: 220px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.meals-scroll::-webkit-scrollbar { display: none; }

.meal-card {
  position: relative;
  flex: 0 0 148px;
  height: 210px;
  border-radius: 18px;
  padding: 12px 10px 10px;
  scroll-snap-align: start;
  background: linear-gradient(160deg, var(--meal-start), var(--meal-end));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
}

.meal-thumb-wrap {
  position: absolute;
  top: 12px;
  left: 8px;
  width: 74px;
  height: 74px;
}

.meal-thumb-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(250, 250, 250, 0.2);
}

.meal-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.meal-add {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #fafafa;
  color: var(--meal-end);
  box-shadow: 0 8px 8px rgba(23, 38, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.meal-add .material-icons-round { font-size: 22px; }

.meal-card-title {
  margin-top: 78px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.meal-card-items {
  flex: 1;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.2px;
  white-space: pre-line;
}

.meal-card-kcal {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-top: auto;
}

.meal-card-kcal .num {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.meal-card-kcal .unit {
  font-size: 12px;
  font-weight: 500;
  padding-bottom: 3px;
}

/* ── Stress management (StressManagementView) ── */
.stress-panel {
  margin-bottom: 8px;
  padding: 12px 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.stress-panel-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.stress-panel-head .material-icons-round {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.92);
}

.stress-panel-head h3 {
  flex: 1;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.stress-pill {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid color-mix(in srgb, var(--pill-color) 42%, transparent);
  background: color-mix(in srgb, var(--pill-color) 16%, transparent);
}

.stress-gauge-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

.stress-gauge-head strong {
  font-weight: 700;
}

.stress-gauge-track {
  position: relative;
  height: 14px;
  margin: 8px 0 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #64e6d8, #87a0e5, #f1b440, #f56e98);
}

.stress-gauge-marker {
  position: absolute;
  top: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.4px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 8px color-mix(in srgb, var(--marker-color) 45%, transparent);
  transform: translateX(-6px);
}

.stress-gauge-axis {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.5);
}

.stress-section-title {
  margin: 14px 0 8px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(191, 227, 255, 0.9);
}

.stress-triggers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stress-trigger-chip {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.stress-recommendation {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--rec-color) 50%, transparent);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--rec-color) 26%, transparent),
    color-mix(in srgb, var(--rec-color) 8%, transparent)
  );
}

.stress-rec-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: color-mix(in srgb, var(--rec-color) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--rec-color) 60%, transparent);
}

.stress-rec-icon .material-icons-round { font-size: 22px; }

.stress-rec-copy {
  flex: 1;
  min-width: 0;
}

.stress-rec-kicker {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.stress-rec-title {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.stress-rec-meta {
  margin-top: 2px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.7);
}

.stress-start-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
}

.stress-start-btn .material-icons-round { font-size: 18px; }

.stress-technique-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  font-family: inherit;
  text-align: left;
  color: #fff;
  cursor: pointer;
}

.stress-technique-tile.highlighted {
  background: rgba(255, 255, 255, 0.1);
  border-color: color-mix(in srgb, var(--tech-color) 55%, transparent);
}

.stress-tech-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--tech-color) 18%, transparent);
}

.stress-tech-icon .material-icons-round {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.92);
}

.stress-tech-copy {
  flex: 1;
  min-width: 0;
}

.stress-tech-title {
  font-size: 12px;
  font-weight: 700;
}

.stress-tech-mechanism {
  margin-top: 1px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.62);
}

.stress-tech-duration {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.55);
}

.stress-tech-chevron {
  font-size: 18px !important;
  color: rgba(255, 255, 255, 0.55);
}

.stress-insight-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 7px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.86);
}

.stress-insight-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 4px;
  border-radius: 50%;
  background: #64e6d8;
}

.stress-log-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.stress-log-btn .material-icons-round { font-size: 18px; }

/* ── Mood analysis (MoodTrendsAnalysisView) ── */
.mood-analysis {
  margin-bottom: 8px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.mood-analysis-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.mood-analysis-head .material-icons-round {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.92);
}

.mood-analysis-head h3 {
  margin: 0;
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.mood-badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  background: color-mix(in srgb, var(--badge-color) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--badge-color) 42%, transparent);
}

.mood-gauge-head {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 8px;
}

.mood-gauge-track {
  position: relative;
  height: 16px;
}

.mood-gauge-gradient {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f56e98, #f1b440, #87a0e5, #64e6d8);
}

.mood-gauge-marker {
  position: absolute;
  top: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
}

.mood-gauge-marker.recent {
  top: 7px;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.88);
  border-color: #e9d5ff;
}

.mood-gauge-legend {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.55);
}

.mood-gauge-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: -1px;
}

.mood-gauge-legend .dot.recent {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #e9d5ff;
}

.mood-rhythm-title,
.mood-insights-title {
  margin: 14px 0 10px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(233, 213, 255, 0.82);
}

.mood-rhythm-wrap {
  position: relative;
  height: 92px;
}

.mood-rhythm-curve {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mood-rhythm-nodes {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 100%;
}

.mood-period-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.mood-period-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.4px solid;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.mood-period-label {
  margin-top: 6px;
  font-size: 9px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}

.mood-period-count {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.48);
}

.mood-trend-chart {
  margin-top: 14px;
  height: 108px;
}

.mood-trend-svg {
  width: 100%;
  height: 80px;
  display: block;
}

.mood-trend-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-top: 2px;
}

.mood-trend-label {
  text-align: center;
  min-width: 0;
}

.mood-trend-label .tag {
  display: block;
  font-size: 8px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mood-trend-label .date {
  display: block;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.48);
}

.mood-insight-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 7px;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.86);
}

.mood-insight-dot {
  width: 6px;
  height: 6px;
  margin-top: 4px;
  border-radius: 50%;
  background: rgba(100, 230, 216, 0.85);
  flex-shrink: 0;
}

/* Mood period cards (MoodListView) */
.mood-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 6px;
  height: 220px;
  scroll-snap-type: x mandatory;
}

.mood-scroll::-webkit-scrollbar { display: none; }

.mood-card {
  position: relative;
  flex: 0 0 168px;
  height: 210px;
  border-radius: 8px 54px 8px 8px;
  background: linear-gradient(135deg, var(--mood-start), var(--mood-end));
  box-shadow: 1px 4px 8px color-mix(in srgb, var(--mood-end) 60%, transparent);
  scroll-snap-align: start;
  overflow: hidden;
}

.mood-thumb-wrap {
  position: absolute;
  top: 0;
  left: 8px;
  width: 84px;
  height: 84px;
}

.mood-thumb-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(250, 250, 250, 0.2);
}

.mood-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.mood-card-body {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 54px 16px 8px;
  color: #fff;
}

.mood-card-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.mood-card-items {
  flex: 1;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  white-space: pre-line;
  color: rgba(255, 255, 255, 0.95);
}

.mood-card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.mood-card-cta {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  white-space: pre-line;
}

.mood-add {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #fafafa;
  color: var(--mood-accent);
  box-shadow: 0 8px 8px rgba(23, 38, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.mood-add .material-icons-round { font-size: 22px; }

/* ── Activity native (ActivityDiaryView) ── */
.activity-native {
  padding-bottom: 8px;
}

.activity-ring-card {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #252733, #171923);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.activity-ring-title {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 10px;
}

.activity-ring-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.activity-ring-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-ring-label {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
}

.activity-ring-value {
  font-size: 22px;
  font-weight: 800;
  color: #ff2d70;
  line-height: 1;
}

.activity-metrics-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.activity-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.activity-metric-tile {
  height: 148px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, #1b1d28, #141622);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--metric-accent) 8%, transparent);
  color: #fff;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.activity-metric-tile.selected {
  outline: 1.5px solid color-mix(in srgb, var(--metric-accent) 55%, transparent);
}

.activity-metric-head {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.93);
}

.activity-metric-head .material-icons-round {
  font-size: 18px;
  color: var(--metric-accent);
}

.activity-metric-head .chevron {
  margin-left: auto;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.35);
}

.activity-metric-value {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--metric-accent);
}

.activity-metric-sub {
  margin-top: 2px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.25;
}

.activity-mini-bars {
  margin-top: auto;
  height: 26px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.activity-mini-bars span {
  flex: 1;
  border-radius: 4px;
  min-height: 4px;
}

.activity-detail-chart {
  margin-top: 4px;
}

.activity-period-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.activity-period-btn {
  border: none;
  border-radius: 10px;
  padding: 8px 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--diary-font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.activity-period-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
}

.activity-chart-card {
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a1b24, #12131c);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.activity-chart-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.86);
}

.activity-chart-value {
  margin-top: 2px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.activity-chart-plot-wrap {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.activity-bars-plot {
  flex: 1;
  height: 120px;
  padding: 8px 8px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: flex-end;
  gap: 2.4px;
  background:
    linear-gradient(rgba(255,255,255,0.11), rgba(255,255,255,0.11)) 0 33% / 100% 1px no-repeat,
    linear-gradient(rgba(255,255,255,0.11), rgba(255,255,255,0.11)) 0 66% / 100% 1px no-repeat,
    linear-gradient(rgba(255,255,255,0.11), rgba(255,255,255,0.11)) 0 100% / 100% 1px no-repeat;
}

.activity-bars-plot span {
  flex: 1;
  border-radius: 4px;
  min-height: 2px;
}

.activity-bars-scale {
  width: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.54);
  padding: 8px 0 6px;
}

.activity-bars-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.54);
}

/* Suggestion expanded */
.tip-body {
  padding: 4px 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.94);
}

.tip-body h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: #e9d5ff;
  font-weight: 700;
}

.tip-body p { margin: 0 0 10px; }

.tip-body strong { color: #fff; }

/* Bottom bar — diary tab active (embedded) */
.diary-screen-root .bottom-bar-tab[data-index="0"].active .tab-icon {
  font-size: 36px;
  color: rgb(73, 9, 87);
}

.diary-screen-root .apollo-bottom-bar-embed.bottom-bar-wrapper {
  overflow: visible;
  background: transparent;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  margin-top: -48px;
  pointer-events: none;
  isolation: isolate;
}

.diary-screen-root .apollo-bottom-bar-embed .bottom-bar {
  filter: none;
  pointer-events: auto;
}

.diary-screen-root .apollo-bottom-bar-embed .bottom-bar-inner {
  overflow: visible;
}

.diary-screen-root .apollo-bottom-bar-embed .bottom-bar-safe-area {
  height: 0;
  background: transparent;
}

.diary-screen-root .apollo-bottom-bar-embed .apollo-fab {
  bottom: 56px;
  z-index: 110;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .harmony-band,
  .pulse-dot { transition: none; animation: none; }
}
