/* Strive Design System: reusable presentation primitives and layout polish. */
:root {
  --strive-yellow: #ffd800;
  --strive-black: #070707;
  --strive-surface: #111111;
  --strive-surface-raised: #171717;
  --strive-border: #303030;
  --strive-border-strong: #454545;
  --strive-text: #f7f7f4;
  --strive-muted: #aaa9a3;
  --strive-success: #59ca7f;
  --strive-attention: #e9a23b;
  --strive-danger: #e76565;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --radius-control: 5px;
  --radius-card: 8px;
  --shadow-card: 0 12px 30px rgb(0 0 0 / 22%);
  --transition-ui: 160ms ease;
}

/* Life Planner */
.life-planner-entry,
.life-planner-event-header,
.life-planner-event-metrics,
.life-planner-banking-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 16px);
}

.life-planner-entry > div { min-width: 0; }
.life-planner-entry p:last-child { margin-bottom: 0; }
.life-planner-form,
.life-planner-review,
.coach-life-planner-actions { margin-top: var(--space-5, 20px); }
.life-planner-image-preview { width: min(100%, 420px); max-height: 280px; margin-top: 16px; object-fit: contain; border: 1px solid var(--border, #343434); border-radius: var(--radius-md, 8px); background: #111; }
.life-planner-review-item { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) minmax(130px, 1fr) minmax(100px, .7fr) auto; gap: 12px; align-items: end; padding: 14px 0; border-bottom: 1px solid var(--border, #303030); }
.life-planner-review-item .field { min-width: 0; }
.confidence-badge { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border: 1px solid currentColor; border-radius: 999px; white-space: nowrap; font-size: .78rem; font-weight: 700; }
.confidence-green { color: #85d69a; }
.confidence-orange { color: #f2c94c; }
.confidence-red { color: #f28b82; }
.life-planner-questions,
.life-planner-review-note,
.life-planner-post-guidance { margin-top: 16px; padding: 14px 16px; border-left: 3px solid var(--yellow, #f3e500); background: rgba(243, 229, 0, .06); }
.life-planner-questions ul { margin-bottom: 0; }
.life-planner-question-list { display: grid; gap: 12px; margin-top: 12px; }
.life-planner-banking-preview,
.life-planner-event-metrics { margin-top: 18px; padding: 14px; background: rgba(255, 255, 255, .035); border: 1px solid var(--border, #303030); border-radius: var(--radius-md, 8px); }
.life-planner-banking-preview span,
.life-planner-event-metrics span { display: grid; gap: 3px; min-width: 0; }
.life-planner-banking-preview small,
.life-planner-event-metrics small { color: var(--muted, #a6a6a6); }
.life-planner-event-card { margin-top: 14px; padding: 18px; border: 1px solid var(--border, #303030); border-left: 3px solid var(--yellow, #f3e500); border-radius: var(--radius-md, 8px); background: var(--card, #171717); }
.life-planner-event-header { align-items: flex-start; }
.life-planner-event-header h4 { margin: 7px 0 3px; }
.life-planner-record-actions { justify-content: flex-end; margin-top: 14px; }
.life-planner-post-check { margin-top: 16px; }
.life-planner-post-check .record-actions { margin-top: 10px; flex-wrap: wrap; }
.coach-life-planner-actions { display: grid; grid-template-columns: minmax(160px, .5fr) minmax(240px, 1fr); gap: 14px; }
.coach-life-planner-actions .button-row { grid-column: 1 / -1; }

@media (max-width: 760px) {
  .life-planner-entry,
  .life-planner-event-header,
  .life-planner-event-metrics,
  .life-planner-banking-preview { align-items: stretch; flex-direction: column; }
  .life-planner-entry .btn { width: 100%; }
  .life-planner-review-item { grid-template-columns: 1fr 1fr; }
  .life-planner-review-item .field:first-child { grid-column: 1 / -1; }
  .life-planner-review-item .record-action { min-height: 44px; }
  .coach-life-planner-actions { grid-template-columns: 1fr; }
  .coach-life-planner-actions .button-row { grid-column: auto; }
  .coach-life-planner-actions .button-row .btn { width: 100%; }
}

html { background: var(--strive-black); scroll-padding-top: 20px; }
body { color: var(--strive-text); background: var(--strive-black); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--strive-yellow);
  outline-offset: 3px;
}

.card,
.dashboard-section,
.purpose-card,
.modal-panel,
.client-summary-card {
  border-radius: var(--radius-card);
  border-color: var(--strive-border);
  box-shadow: var(--shadow-card);
}

.dashboard-section,
.client-summary-card { margin-bottom: var(--space-5); }
.section-heading-row { gap: var(--space-4); }
.section-heading-row h2,
.section-heading-row h3,
.client-view-header h2,
.coach-section-header h2 { margin-bottom: var(--space-2); }
.section-note, .muted { color: var(--strive-muted); line-height: 1.5; }
.eyebrow { color: var(--strive-yellow); letter-spacing: 0; }

.btn,
button.btn {
  min-height: 46px;
  border-radius: var(--radius-control);
  transition: transform var(--transition-ui), border-color var(--transition-ui), background-color var(--transition-ui), color var(--transition-ui);
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn.primary { min-height: 50px; }
.btn:disabled { cursor: not-allowed; opacity: .52; }

.field input,
.field select,
.field textarea,
input,
select,
textarea { min-height: 46px; border-radius: var(--radius-control); }
textarea { min-height: 96px; }
.check-option,
.ai-toggle-row { min-height: 48px; }

.pill,
.status-badge { border-radius: 999px; }
.guided-empty-state,
.empty-tab-state,
.client-selection-empty {
  padding: clamp(22px, 4vw, 38px);
  border: 1px dashed var(--strive-border-strong);
  background: #0d0d0d;
  text-align: left;
}
.guided-empty-state h3,
.empty-tab-state h3,
.client-selection-empty h3 { margin: 0 0 var(--space-2); }
.form-status.success,
.support-clear-message { color: var(--strive-success); }
.form-status.error { color: #ff9a9a; }

.client-dashboard-content {
  width: min(100% - 32px, 1180px);
  margin-inline: auto;
  padding-top: var(--space-6);
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}
.client-view-header,
.dashboard-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--strive-border);
}
.client-mobile-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: rgb(8 8 8 / 96%);
  backdrop-filter: blur(16px);
  border-top: 1px solid #343434;
}
.client-mobile-nav button { min-width: 0; min-height: 52px; padding: 8px 5px; border-radius: var(--radius-control); }
.client-mobile-nav button span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-mobile-nav button.active { color: #050505; background: var(--strive-yellow); }

.strive-workspace-insight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  border-left: 3px solid var(--strive-yellow);
}
.strive-workspace-insight > div { min-width: 0; }
.strive-workspace-insight p:not(.eyebrow) { max-width: 720px; margin-bottom: 0; color: #d9d9d5; line-height: 1.55; }
.strive-workspace-grid,
.coach-workspace-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.purpose-card {
  display: flex;
  min-width: 0;
  min-height: 210px;
  padding: var(--space-5);
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  background: var(--strive-surface);
}
button.purpose-card { width: 100%; color: var(--strive-text); cursor: pointer; }
.purpose-card h3,
.purpose-card strong { margin: var(--space-2) 0; color: var(--strive-text); font-family: var(--heading-font); font-size: 1.35rem; }
.purpose-card > p:not(.eyebrow),
.purpose-card > small { margin: 0 0 var(--space-5); color: var(--strive-muted); line-height: 1.5; }
.purpose-card .btn { width: 100%; margin-top: auto; }
button.purpose-card:hover { border-color: #6a5c13; background: #17160f; transform: translateY(-1px); }

.dashboard-disclosure { border-radius: var(--radius-card); }
.dashboard-disclosure > summary { min-height: 58px; padding: var(--space-4); }
.dashboard-disclosure-content { padding: 0 var(--space-4) var(--space-4); }
.section-disclosure { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.section-disclosure > summary { margin-bottom: var(--space-4); border-top: 1px solid var(--strive-border); border-bottom: 1px solid var(--strive-border); background: #0c0c0c; }
.section-disclosure > .dashboard-disclosure-content { padding-inline: 0; }

.coach-admin-layout { background: var(--strive-black); }
.coach-admin-sidebar { width: 244px; border-right-color: var(--strive-border); background: #0b0b0b; }
.coach-admin-sidebar nav { gap: var(--space-1); }
.coach-nav-item { min-height: 46px; border-radius: var(--radius-control); }
.coach-admin-main { min-width: 0; padding: var(--space-6); }
.coach-section-header { margin-bottom: var(--space-6); }
.coaching-centre-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: center;
  gap: var(--space-5);
}
.coaching-centre-status .button-row { grid-column: 1 / -1; margin: 0; }
.holiday-mode-active-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-5); margin: var(--space-4) 0; padding: var(--space-4); border: 1px solid #5b5118; border-left: 3px solid var(--strive-yellow); background: #15140d; }
.holiday-mode-active-summary p { margin: 5px 0 0; color: var(--strive-muted); }
.holiday-mode-active-summary dl { display: flex; gap: var(--space-5); margin: 0; }
.holiday-mode-active-summary dt { color: var(--strive-muted); font-size: .72rem; text-transform: uppercase; }
.holiday-mode-active-summary dd { margin: 4px 0 0; font-weight: 800; }
.programme-list { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.programme-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  min-height: 64px;
  padding: var(--space-3) var(--space-4);
  color: var(--strive-text);
  border: 1px solid var(--strive-border);
  border-radius: var(--radius-control);
  background: var(--strive-surface-raised);
  text-align: left;
  cursor: pointer;
}
.programme-list button:hover { border-color: #6a5c13; }
.programme-list span,
.programme-list strong,
.programme-list small { display: block; min-width: 0; }
.programme-list small { margin-top: 3px; color: var(--strive-muted); }
.programme-list em { flex: 0 0 auto; color: var(--strive-yellow); font-style: normal; font-weight: 800; }
.journey-feed,
.calendar-timeline { position: relative; }
.timeline-item { position: relative; gap: var(--space-4); min-height: 70px; padding: var(--space-3) 0 var(--space-3) var(--space-5); border-left: 1px solid #494949; }
.timeline-item::before { content: ""; position: absolute; left: -5px; top: 20px; width: 9px; height: 9px; border: 2px solid var(--strive-yellow); border-radius: 50%; background: var(--strive-black); }
.timeline-item time { color: var(--strive-muted); font-size: .76rem; }
.timeline-item p { margin: 4px 0 0; color: var(--strive-muted); line-height: 1.45; }

.client-profile-settings { margin-bottom: var(--space-5); }
.client-tabs {
  gap: var(--space-1);
  padding: var(--space-1);
  overflow-x: auto;
  border: 1px solid var(--strive-border);
  border-radius: var(--radius-card);
  background: #0d0d0d;
  scrollbar-width: thin;
}
.client-tab { min-width: max-content; min-height: 44px; border-radius: var(--radius-control); }
.client-tab.active { color: #050505; background: var(--strive-yellow); }
.client-tab-content { padding-top: var(--space-5); }

.coach-loading-state [class*="skeleton"],
.coach-loading-state span { animation-duration: 1.6s; }
.food-photo-preview { border-radius: var(--radius-card); }
.food-photo-review { border-radius: var(--radius-card); }

@media (max-width: 900px) {
  .coach-admin-main { padding: var(--space-4); }
  .coaching-centre-status { grid-template-columns: 1fr; }
  .coaching-centre-status .button-row { grid-column: auto; }
  .holiday-mode-active-summary { grid-template-columns: 1fr; }
  .holiday-mode-active-summary dl { flex-wrap: wrap; }
}

@media (max-width: 680px) {
  .client-dashboard-content { width: min(100% - 22px, 1180px); padding-top: var(--space-4); }
  .strive-workspace-grid,
  .coach-workspace-actions { grid-template-columns: 1fr; }
  .strive-workspace-insight { align-items: stretch; flex-direction: column; }
  .strive-workspace-insight .btn { width: 100%; }
  .purpose-card { min-height: 0; }
  .section-heading-row { align-items: stretch; flex-direction: column; }
  .section-heading-row > .btn { width: 100%; }
  .programme-list button { align-items: flex-start; }
  .client-mobile-nav button { font-size: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Goal-adaptive nutrition: one calm weekly explanation, with deeper detail on demand. */
.adaptive-nutrition-card,
.coach-adaptive-nutrition {
  border-left: 3px solid var(--strive-yellow, #ffd400);
}

.adaptive-nutrition-card.risk-high,
.coach-adaptive-nutrition:has(.priority-high) {
  border-left-color: #ef6a67;
}

.adaptive-plan-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.coach-adaptive-nutrition .adaptive-plan-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.adaptive-plan-summary > span,
.adaptive-plan-focus {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.025);
  border-radius: var(--radius-sm, 8px);
}

.adaptive-plan-summary small,
.adaptive-plan-focus small {
  display: block;
  margin-bottom: 5px;
  color: var(--text-muted, #a8a8a8);
}

.adaptive-plan-summary strong,
.adaptive-plan-focus strong {
  display: block;
  overflow-wrap: break-word;
}

.adaptive-plan-focus p,
.adaptive-coach-note {
  margin: 8px 0 0;
}

.adaptive-nutrition-card details {
  margin-top: 14px;
}

.adaptive-nutrition-card details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--strive-yellow, #ffd400);
  cursor: pointer;
}

.adaptive-nutrition-card details ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.adaptive-day-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 14px;
}

.adaptive-day-list span {
  min-width: 0;
  padding: 9px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm, 8px);
  text-align: center;
}

.adaptive-day-list small,
.adaptive-day-list strong,
.adaptive-day-list em {
  display: block;
  overflow-wrap: break-word;
}

.adaptive-day-list em {
  margin-top: 3px;
  color: var(--text-muted, #a8a8a8);
  font-size: 0.72rem;
  font-style: normal;
}

.adaptive-override-form {
  margin-top: 18px;
}

@media (max-width: 720px) {
  .adaptive-plan-summary,
  .coach-adaptive-nutrition .adaptive-plan-summary {
    grid-template-columns: 1fr 1fr;
  }

  .adaptive-override-form .button-row .btn {
    width: 100%;
  }

  .adaptive-day-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .adaptive-plan-summary,
  .coach-adaptive-nutrition .adaptive-plan-summary {
    grid-template-columns: 1fr;
  }
}
