/* =========================================================
   UI Clarity Pass (Non-breaking)
   Purpose: simplify visual density without changing behavior.
   Loaded last to override existing styles safely.
   ========================================================= */

/* Shared spacing rhythm */
.welcome,
.messages {
  max-width: 980px;
}

:root {
  --mobile-footer-height: 32px;
  --mobile-dock-height: 58px;
}

/* Workspace scroll behavior */
.main {
  display: grid;
  grid-template-rows: var(--header-height) minmax(0, 1fr) auto auto auto;
  overflow-y: hidden;
  background:
    radial-gradient(120% 90% at 88% -8%, rgba(196, 149, 106, 0.11) 0%, rgba(196, 149, 106, 0) 56%),
    radial-gradient(140% 110% at -12% -8%, rgba(72, 112, 152, 0.18) 0%, rgba(72, 112, 152, 0) 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0));
}

.main.main--landing {
  overflow-y: hidden;
}

.main.main--landing .landing-page {
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-content: start;
  padding-bottom: 14px;
}

/* ------------------------------
   Coach Home (Landing)
   ------------------------------ */
.landing-page {
  max-width: min(1240px, calc(100vw - 24px));
  width: 100%;
  margin-inline: auto;
  gap: 16px;
  padding-top: 22px;
  grid-template-columns: 1fr;
  grid-template-areas:
    "hero"
    "actions"
    "side";
}

.landing-page__hero {
  grid-area: hero;
  padding: 26px 24px;
  border-radius: 18px;
  border: 1px solid rgba(196, 149, 106, 0.22);
  background:
    radial-gradient(160% 120% at 82% -22%, rgba(196, 149, 106, 0.2), rgba(196, 149, 106, 0) 52%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(24, 20, 17, 0.74);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  min-height: 220px;
}

.landing-page__title {
  max-width: 18ch;
  font-family: "DM Serif Display", var(--font-family-display);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.98;
}

.landing-page__subtitle {
  max-width: 56ch;
  color: rgba(236, 227, 217, 0.84);
  font-size: 1.02rem;
}

.landing-page__eyebrow {
  font-family: var(--font-family-mono);
  color: rgba(196, 149, 106, 0.92);
  letter-spacing: 0.11em;
  font-size: 0.73rem;
  text-transform: uppercase;
}

.landing-page__stats {
  grid-area: stats;
  gap: 10px;
}

.landing-page__stat {
  border-radius: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(196, 149, 106, 0.2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.landing-page__actions {
  grid-area: actions;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.landing-action-card {
  min-height: 136px;
  padding: 18px 16px;
  border-radius: 16px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid rgba(196, 149, 106, 0.17);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    rgba(19, 16, 14, 0.72);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.landing-action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 149, 106, 0.38);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(196, 149, 106, 0.15);
}

.landing-action-card h3 {
  font-size: 1.02rem;
  line-height: 1.25;
}

.landing-action-card p {
  margin-top: 6px;
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 40ch;
}


.landing-page__coach-check {
  border: 1px solid rgba(196, 149, 106, 0.2);
  border-radius: 14px;
  padding: 16px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    rgba(19, 16, 14, 0.72);
}

.landing-page__side {
  grid-area: side;
  display: grid;
  gap: 10px;
  align-content: start;
}

.landing-page__today {
  border: 1px solid rgba(196, 149, 106, 0.2);
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    rgba(19, 16, 14, 0.72);
  padding: 16px;
}

.landing-page__today h3,
.landing-page__coach-check h3 {
  margin: 0;
  font-size: 1rem;
}

.landing-page__coach-check p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.4;
}

.landing-page__coach-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.landing-page__coach-actions .btn {
  min-height: 38px;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.landing-today__content {
  margin-top: 10px;
}

.landing-today__empty {
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.4;
  margin: 0;
}

.landing-today__stat {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.4;
  margin: 0 0 6px;
}

.landing-poll-option {
  min-height: 36px;
}

[data-theme="light"] .main {
  background:
    radial-gradient(120% 90% at 88% -8%, rgba(196, 149, 106, 0.14) 0%, rgba(196, 149, 106, 0) 56%),
    radial-gradient(140% 110% at -12% -8%, rgba(160, 184, 208, 0.28) 0%, rgba(160, 184, 208, 0) 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.36));
}

[data-theme="light"] .landing-page__hero,
[data-theme="light"] .landing-action-card,
[data-theme="light"] .landing-page__today,
[data-theme="light"] .landing-page__coach-check {
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.44)),
    rgba(247, 240, 230, 0.78);
  border-color: rgba(132, 102, 72, 0.36);
  box-shadow:
    0 10px 24px rgba(67, 52, 37, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .landing-page__title,
[data-theme="light"] .landing-action-card h3,
[data-theme="light"] .landing-page__today h3,
[data-theme="light"] .landing-page__coach-check h3 {
  color: #2f2419;
}

[data-theme="light"] .landing-page__subtitle,
[data-theme="light"] .landing-action-card p,
[data-theme="light"] .landing-page__coach-check p {
  color: #4f3d2b;
}

[data-theme="light"] .landing-poll-option,
[data-theme="light"] .landing-page__coach-actions .btn.btn--secondary {
  border-color: rgba(132, 102, 72, 0.36);
  background: rgba(255, 255, 255, 0.6);
  color: #2f2419;
}

[data-theme="light"] .landing-poll-option:hover {
  background: rgba(196, 149, 106, 0.2);
}

@media (min-width: 768px) {
  /* Dock is a mobile-only surface — suppress it on tablet and desktop */
  .mobile-dock { display: none !important; }
  body.mobile-dock-visible .main { padding-bottom: 0; }
}

@media (min-width: 1080px) {
  .landing-page {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.92fr);
    grid-template-areas:
      "hero side"
      "actions side";
  }

  .landing-page__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1079px) {
  .landing-page {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "actions"
      "side";
  }

  .landing-page__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-page__side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ------------------------------
   Chat Welcome + Messages
   ------------------------------ */
.chat-container {
  min-height: 0;
  overflow-y: auto;
  padding-inline: 10px;
}

.welcome {
  padding-top: 18px;
}

.welcome__title {
  font-family: "DM Serif Display", var(--font-family-display);
  font-weight: 400;
  letter-spacing: 0;
  max-width: 17ch;
}

.welcome__subtitle {
  color: rgba(236, 227, 217, 0.84);
}

.welcome__status-grid {
  display: none;
}

.welcome__status-item {
  padding: 10px 11px;
  border-radius: 10px;
}

.feature-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.feature-card {
  padding: 10px;
  border-radius: 14px;
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid rgba(196, 149, 106, 0.18);
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008)),
    rgba(19, 16, 14, 0.7);
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.feature-card__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(196, 149, 106, 0.34);
  background: rgba(196, 149, 106, 0.1);
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 149, 106, 0.36);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

.feature-card__title {
  font-size: 0.85rem;
}

.feature-card__desc {
  font-size: 0.75rem;
  line-height: 1.3;
}

.suggested-prompts__label {
  margin-top: 8px;
}

.suggested-prompts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.prompt-btn {
  border-radius: 12px;
  min-height: 78px;
  padding: 11px 10px;
  font-size: 0.78rem;
  line-height: 1.3;
  text-wrap: pretty;
  border: 1px solid rgba(196, 149, 106, 0.16);
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0.008)),
    rgba(19, 16, 14, 0.66);
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}

.prompt-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 149, 106, 0.36);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.messages {
  width: min(100%, 960px);
  padding: 12px 8px 46px;
}

.message {
  padding: 10px 10px;
}

.message--user .message__content {
  max-width: min(88%, 720px);
}

.message__text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.input-bar {
  width: min(100%, 960px);
  margin: 8px auto 6px;
}

/* ------------------------------
   Logs + Personalization clarity
   ------------------------------ */
.logs-modal {
  max-width: min(1080px, calc(100vw - 30px));
}

.logs-section,
.logs-view-intro,
.logs-weekly,
.logs-summary__item,
.logs-overview-card {
  border-radius: 10px;
}

.logs-controls {
  gap: 8px;
}

.logs-modal #closeLogs.modal__close {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
}

.training-tabs {
  gap: 6px;
}

.training-tab {
  max-width: 100%;
}

.training-tab span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------
   Mobile bottom dock (quick nav)
   ------------------------------ */
.mobile-dock {
  grid-row: 4;
  position: static;
  left: auto;
  transform: none;
  bottom: auto;
  width: 100%;
  min-height: 54px;
  padding: 4px 8px 6px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid var(--border-color);
  border-radius: 0;
  background: rgba(26, 23, 20, 0.96);
  box-shadow: none;
  backdrop-filter: blur(8px);
  z-index: 1;
}

.footer {
  grid-row: 5;
  min-height: 24px;
  padding: 4px 8px;
  gap: 8px;
}

.footer__link {
  font-size: 0.64rem;
}

.footer__separator {
  font-size: 0.58rem;
}

.mobile-dock__item {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 4px 2px;
  font-family: var(--font-family);
  cursor: pointer;
}

.mobile-dock__item.is-active {
  border-color: rgba(196, 149, 106, 0.34);
  color: var(--accent);
  background: rgba(196, 149, 106, 0.12);
}

.mobile-dock__icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-dock__label {
  font-size: 0.63rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

.modal,
.modal-overlay {
  z-index: 1100;
}

/* Light-mode guide readability */
[data-theme="light"] .coach-guide__panel {
  background: #f7f0e6;
  border-color: rgba(131, 103, 74, 0.28);
}

[data-theme="light"] .coach-guide__text {
  color: #5a4a3a;
}

[data-theme="light"] .coach-guide__input {
  background: #fffdf9;
  color: #2e241a;
  border-color: rgba(131, 103, 74, 0.32);
}

[data-theme="light"] .coach-guide__input::placeholder {
  color: #7c6a58;
}

/* ------------------------------
   Mobile hardening
   ------------------------------ */
@media (max-width: 768px) {
  .main {
    min-height: 100dvh;
  }

  .header {
    padding-top: env(safe-area-inset-top, 0px);
    min-height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  }

  .sidebar {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .sidebar__header {
    padding-top: 10px;
  }

  .landing-page {
    padding-top: 16px;
    gap: 10px;
    max-width: 100%;
    grid-template-areas:
      "hero"
      "actions";
  }

  .landing-page__hero {
    padding: 15px;
    min-height: auto;
  }

  .landing-page__title {
    font-size: clamp(1.45rem, 1.25rem + 1.5vw, 1.95rem);
  }

  .landing-page__subtitle {
    font-size: 0.95rem;
  }

  .landing-page__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-action-card {
    min-height: 104px;
    padding: 12px;
  }

  .landing-action-card h3 {
    font-size: 0.9rem;
  }

  .landing-action-card p {
    font-size: 0.79rem;
    line-height: 1.35;
    margin-top: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .landing-page__side {
    display: none;
  }

  .landing-action-card--featured {
    grid-column: auto;
  }

  .welcome {
    padding-top: 18px;
  }

  .welcome__status-grid {
    grid-template-columns: 1fr;
  }

  .feature-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-card {
    min-height: 84px;
    padding: 9px;
    gap: 5px;
  }

  .feature-card__icon {
    width: 30px;
    height: 30px;
  }

  .feature-card__title {
    font-size: 0.8rem;
  }

  .feature-card__desc {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .feature-cards .feature-card:last-child {
    grid-column: 1 / -1;
  }

  .suggested-prompts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .prompt-btn {
    width: 100%;
    max-width: 100%;
    min-height: 58px;
    padding: 9px 8px 9px 26px;
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .prompt-btn::before {
    left: 9px;
    font-size: 0.66rem;
    top: 10px;
    transform: none;
  }

  .messages {
    width: 100%;
    padding: 10px 8px 114px;
  }

  .message {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 6px;
  }

  .message--user {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 0;
  }

  .message--user .message__content {
    width: auto;
    max-width: 100%;
  }

  .message__text {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .input-bar {
    width: calc(100% - 12px);
    margin-bottom: 4px;
  }

  .logs-modal {
    width: calc(100vw - 10px);
    max-width: calc(100vw - 10px);
    max-height: 92vh;
    margin: 4px auto;
  }

  .logs-modal #closeLogs.modal__close {
    top: 10px;
    right: 10px;
  }

  .logs-section,
  .logs-view-intro {
    margin-left: 10px;
    margin-right: 10px;
  }

  .training-panel {
    overflow: hidden;
  }

  #profileGymSplit {
    min-width: 0;
    width: 100%;
  }

  .mobile-dock {
    position: static;
    left: 0;
    right: 0;
    transform: none;
    bottom: auto;
    width: 100%;
    min-height: 52px;
    padding: 4px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    border-top: 1px solid var(--border-color);
    background: rgba(26, 23, 20, 0.95);
    box-shadow: 0 -8px 22px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    z-index: 1;
  }

  .mobile-dock__item {
    min-height: 44px;
    gap: 1px;
    padding: 3px 2px;
  }

  .mobile-dock__icon {
    font-size: 0.9rem;
  }

  .mobile-dock__label {
    font-size: 0.62rem;
  }

  .footer {
    grid-row: 5;
    position: static;
    left: 0;
    right: 0;
    bottom: auto;
    min-height: 22px;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
    background: rgba(20, 17, 15, 0.92);
    border-top: 1px solid var(--border-color);
    z-index: 1;
  }

  .footer__link {
    font-size: 0.6rem;
  }

  .footer__separator {
    font-size: 0.52rem;
  }

  body.mobile-dock-visible .consent-banner {
    bottom: calc(var(--mobile-footer-height) + env(safe-area-inset-bottom, 0px));
    z-index: 970;
  }

  body.mobile-dock-visible.consent-banner-visible .main {
    padding-bottom: calc(var(--consent-banner-height, 0px) + 6px);
  }
}

/* ── Engagement Stats Bar (Welcome Panel) ─────────── */

.engagement-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.engagement-bar__card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-secondary, #1e1e1e);
  border: 1px solid var(--border-color, #333);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.engagement-bar__card--level {
  cursor: pointer;
  transition: border-color 0.2s;
  border: none;
  text-align: left;
  color: inherit;
  font-family: inherit;
}

.engagement-bar__card--level:hover {
  border-color: var(--accent, #c4956a);
}

.engagement-bar__icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.engagement-bar__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.engagement-bar__value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #eee);
  line-height: 1.2;
}

.engagement-bar__label {
  font-size: 0.7rem;
  color: var(--text-secondary, #999);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.engagement-bar__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--bg-tertiary, #2a2a2a);
}

.engagement-bar__progress-fill {
  height: 100%;
  background: var(--accent, #c4956a);
  border-radius: 0 3px 3px 0;
  transition: width 0.6s ease;
  width: 0%;
}

@media (max-width: 600px) {
  .engagement-bar {
    gap: 6px;
  }
  .engagement-bar__card {
    padding: 10px;
    gap: 8px;
  }
  .engagement-bar__icon {
    font-size: 1.1rem;
  }
  .engagement-bar__value {
    font-size: 0.95rem;
  }
  .engagement-bar__label {
    font-size: 0.6rem;
  }
}

/* ── Engagement Modal ───────────────────────────────── */

.engagement-modal {
  max-width: 520px;
}

.engagement-hero {
  text-align: center;
  padding: 24px 16px;
  background: var(--bg-secondary, #1a1a1a);
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
}

.engagement-hero__level {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.engagement-hero__level-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent, #c4956a);
  color: #fff;
  font-weight: 700;
  font-size: 1.2rem;
}

.engagement-hero__level-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.engagement-hero__points {
  margin: 12px 0;
}

.engagement-hero__total {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent, #c4956a);
}

.engagement-hero__label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.engagement-hero__progress {
  margin-top: 12px;
}

.engagement-hero__bar {
  height: 8px;
  background: var(--bg-tertiary, #2a2a2a);
  border-radius: 4px;
  overflow: hidden;
}

.engagement-hero__bar span {
  display: block;
  height: 100%;
  background: var(--accent, #c4956a);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.engagement-hero__next {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.engagement-streaks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.engagement-streak-card {
  background: var(--bg-secondary, #1a1a1a);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  text-align: center;
}

.engagement-streak-card__label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.engagement-streak-card__value {
  font-size: 1.1rem;
  color: var(--accent, #c4956a);
}

.engagement-ledger__title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.engagement-day {
  margin-bottom: 12px;
}

.engagement-day__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color, #333);
}

.engagement-day__date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.engagement-day__total {
  font-size: 0.85rem;
  font-weight: 700;
}

.engagement-day__total.positive { color: #4ade80; }
.engagement-day__total.negative { color: #f87171; }

.engagement-entry {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  font-size: 0.8rem;
}

.engagement-entry__reason { color: var(--text-primary, #fff); }
.engagement-entry--positive .engagement-entry__points { color: #4ade80; }
.engagement-entry--negative .engagement-entry__points { color: #f87171; }

/* ── Analytics Summary (Welcome Panel) ────────────── */

.analytics-summary {
  margin-bottom: 20px;
}

.analytics-summary__title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #999);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 10px;
}

.analytics-summary__cards {
  display: flex;
  gap: 10px;
}

.analytics-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 8px;
  background: var(--bg-secondary, #1e1e1e);
  border: 1px solid var(--border-color, #333);
  border-radius: 12px;
  text-align: center;
}

.analytics-card__value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary, #eee);
  line-height: 1.2;
}

.analytics-card__label {
  font-size: 0.7rem;
  color: var(--text-secondary, #999);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

.analytics-card__sub {
  font-size: 0.65rem;
  color: var(--text-tertiary, #666);
  margin-top: 4px;
}

/* Consistency dots row */
.analytics-consistency {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.consistency-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.consistency-dot__circle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-tertiary, #2a2a2a);
}

.consistency-dot__circle--completed { background: #4ade80; }
.consistency-dot__circle--skipped   { background: #f87171; }
.consistency-dot__circle--pending   { background: var(--accent, #c4956a); }
.consistency-dot__circle--rest      { background: var(--bg-tertiary, #2a2a2a); border: 1px solid var(--border-color, #444); }

.consistency-dot__day {
  font-size: 0.55rem;
  color: var(--text-tertiary, #666);
  text-transform: uppercase;
}

/* Insights */
.analytics-insights {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insight-card {
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 3px solid var(--accent, #c4956a);
  background: var(--bg-secondary, #1e1e1e);
}

.insight-card--positive { border-left-color: #4ade80; }
.insight-card--warning  { border-left-color: #fbbf24; }
.insight-card--negative { border-left-color: #f87171; }

.insight-card__title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #eee);
  margin: 0 0 2px;
}

.insight-card__body {
  font-size: 0.72rem;
  color: var(--text-secondary, #999);
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .analytics-summary__cards {
    gap: 6px;
  }
  .analytics-card {
    padding: 10px 6px;
  }
  .analytics-card__value {
    font-size: 1.15rem;
  }
/* ── Group Tab (Logs Modal) ────────────────────────── */

.group-tab-empty {
  text-align: center;
  padding: 32px 16px;
}

.group-tab-empty__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary, #eee);
  margin: 0 0 6px;
}

.group-tab-empty__desc {
  font-size: 0.82rem;
  color: var(--text-secondary, #999);
  margin: 0 0 20px;
}

.group-tab-actions {
  max-width: 340px;
  margin: 0 auto;
}

.group-tab-form-row {
  display: flex;
  gap: 8px;
}

.group-tab-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #333);
  border-radius: 8px;
  background: var(--bg-secondary, #1e1e1e);
  color: var(--text-primary, #eee);
  font-size: 0.85rem;
}

.group-tab-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  color: var(--text-tertiary, #666);
  font-size: 0.75rem;
}

.group-tab-divider::before,
.group-tab-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color, #333);
}

.group-tab-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color, #333);
  margin-bottom: 16px;
}

.group-tab-header__name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary, #eee);
  margin: 0 0 4px;
}

.group-tab-header__code {
  font-size: 0.8rem;
  color: var(--text-secondary, #999);
}

.group-tab-header__code strong {
  color: var(--accent, #c4956a);
  letter-spacing: 0.1em;
}

.group-tab-leave {
  flex-shrink: 0;
}

.group-tab-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #999);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}

.group-tab-leaderboard__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.group-tab-select {
  padding: 4px 8px;
  border: 1px solid var(--border-color, #333);
  border-radius: 6px;
  background: var(--bg-secondary, #1e1e1e);
  color: var(--text-primary, #eee);
  font-size: 0.78rem;
}

.group-tab-lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color, #222);
}

.group-tab-lb-row--top {
  background: var(--bg-secondary, #1e1e1e);
  border-radius: 8px;
  border-bottom: none;
  margin-bottom: 4px;
}

.group-tab-lb-row__rank {
  width: 28px;
  text-align: center;
  font-size: 1.1rem;
}

.group-tab-lb-row__name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary, #eee);
  font-size: 0.88rem;
}

.group-tab-lb-row__level {
  font-size: 0.75rem;
  color: var(--text-secondary, #999);
}

.group-tab-lb-row__points {
  font-weight: 600;
  color: var(--accent, #c4956a);
  font-size: 0.85rem;
}

.group-tab-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color, #222);
}

.group-tab-member__name {
  font-size: 0.88rem;
  color: var(--text-primary, #eee);
}

.group-tab-member__role {
  font-size: 0.75rem;
  color: var(--text-secondary, #999);
}

.group-tab-pending {
  margin-bottom: 16px;
}

.group-tab-pending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color, #222);
  font-size: 0.85rem;
  color: var(--text-primary, #eee);
}

.group-tab-pending-item div {
  display: flex;
  gap: 6px;
}

.group-tab-members {
  margin-top: 16px;
}

.group-tab-leaderboard {
  margin-bottom: 16px;
}

/* ── Group Modal ────────────────────────────────────── */

.group-modal {
  max-width: 560px;
}

.group-empty-text {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.group-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.group-create-form,
.group-join-form {
  display: flex;
  gap: 8px;
}

.group-create-form input,
.group-join-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #333);
  border-radius: var(--border-radius-sm);
  background: var(--bg-secondary, #1a1a1a);
  color: var(--text-primary, #fff);
  font-size: 0.85rem;
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  background: var(--bg-secondary, #1a1a1a);
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
}

.group-header__name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.group-header__code {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-header__code strong {
  color: var(--accent, #c4956a);
  letter-spacing: 2px;
  font-family: var(--font-mono, monospace);
}

.btn--sm {
  padding: 4px 10px;
  font-size: 0.75rem;
}

.group-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.group-pending {
  margin-bottom: 16px;
}

.group-pending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-secondary, #1a1a1a);
  border-radius: var(--border-radius-sm);
  margin-bottom: 6px;
}

.group-pending-item__name {
  font-size: 0.85rem;
}

.group-pending-item__actions {
  display: flex;
  gap: 6px;
}

.group-leaderboard {
  margin-bottom: 16px;
}

.group-leaderboard__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.group-leaderboard__head select {
  padding: 4px 8px;
  border: 1px solid var(--border-color, #333);
  border-radius: var(--border-radius-sm);
  background: var(--bg-secondary, #1a1a1a);
  color: var(--text-primary, #fff);
  font-size: 0.8rem;
}

.group-lb-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
}

.group-lb-row--top {
  background: var(--bg-secondary, #1a1a1a);
}

.group-lb-row__rank {
  font-size: 1.1rem;
  text-align: center;
}

.group-lb-row__name {
  font-weight: 500;
}

.group-lb-row__level {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.group-lb-row__points {
  font-weight: 700;
  color: var(--accent, #c4956a);
}

.group-members {
  margin-bottom: 16px;
}

.group-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.group-member__role {
  color: var(--text-muted);
  font-size: 0.75rem;
}
