:root {
  --bg: #f5f7f4;
  --ink: #10231d;
  --muted: #66736d;
  --surface: #ffffff;
  --surface-soft: #eef3ef;
  --line: #d9e1dc;
  --green: #18784b;
  --blue: #2e6f9f;
  --amber: #b97912;
  --orange: #c7672d;
  --rose: #b84b5a;
  --purple: #6c5b95;
  --shadow: 0 18px 50px rgba(22, 37, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  background: var(--bg);
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a.button,
.header-button,
.menu-button,
.mobile-menu-button,
.small-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.button,
.header-button.primary {
  background: var(--green);
  color: #fff;
}

.header-login-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid rgba(67, 209, 125, 0.34);
  border-radius: 8px;
  background: linear-gradient(180deg, #43d17d, #23a961);
  color: #07100c;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(35, 169, 97, 0.22);
}

.button.secondary,
.header-button.quiet,
.small-button {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--ink);
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.mini-icon-button {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-color: rgba(137, 156, 175, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.mini-icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.goal-row-actions .small-button:has(svg) {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.goal-row-actions .small-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--ink);
  font-size: 1.35rem;
}

.mobile-header-toggle,
.mobile-menu-button,
.android-update-chip,
.mobile-only {
  display: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 244, 0.94);
  backdrop-filter: blur(12px);
}

.brand-lockup,
.header-actions,
.google-control,
.top-menu {
  display: flex;
  align-items: center;
}

.brand-lockup {
  min-width: 0;
  gap: 12px;
}

.brand-lockup-public {
  gap: 0;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.brand-mark,
.brand-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  background: #152d25;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.brand-avatar {
  display: block;
  object-fit: cover;
  border: 1px solid rgba(16, 35, 29, 0.12);
  background: var(--surface-soft);
}

.brand-logo-mark {
  object-fit: contain;
  padding: 2px;
  border-color: transparent;
  background: transparent;
}

.brand-wordmark {
  display: block;
  width: min(240px, 44vw);
  max-width: 100%;
  height: auto;
  max-height: 42px;
  object-fit: contain;
  object-position: left center;
}

.brand-goalmetric-wordmark {
  display: grid;
  min-width: 0;
  gap: 2px;
  line-height: 1;
}

.brand-goalmetric-logo {
  display: block;
  width: min(250px, 48vw);
  max-width: 100%;
  height: auto;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.26));
}

.brand-goalmetric-name {
  display: block;
  overflow: hidden;
  max-width: min(250px, 44vw);
  font-family: ui-rounded, "SF Pro Rounded", "Aptos Rounded", "Nunito Sans", "Nunito", "Arial Rounded MT Bold", "Trebuchet MS", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.56rem;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-goalmetric-goal {
  color: #f8fbff;
  text-shadow: 0 6px 22px rgba(255, 255, 255, 0.16);
}

.brand-goalmetric-metric {
  display: inline-block;
  margin-left: 0.07em;
  background: linear-gradient(90deg, #22d6df 0%, #338eff 52%, #9a52ff 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-goalmetric-tagline {
  overflow: hidden;
  max-width: min(250px, 44vw);
  color: rgba(238, 245, 255, 0.7);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overline {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.google-control {
  min-height: 46px;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.google-control form {
  display: contents;
}

.status-dot {
  display: inline-block;
  width: 10px;
  min-width: 10px;
  max-width: 10px;
  height: 10px;
  min-height: 10px;
  max-height: 10px;
  flex: 0 0 10px;
  align-self: center;
  border-radius: 50%;
  background: var(--muted);
}

.status-connected,
.status-bridge_ready {
  background: var(--green);
}

.status-available {
  background: var(--amber);
}

.status-coming_soon {
  background: var(--rose);
}

.google-label {
  font-weight: 800;
}

.google-status {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: capitalize;
}

.last-sync {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.top-menu {
  gap: 8px;
}

.menu-layer {
  position: relative;
}

.menu-button {
  list-style: none;
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.menu-button::-webkit-details-marker {
  display: none;
}

.menu-button::marker {
  content: "";
}

.menu-button span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #e5eee8;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.menu-layer[open] > .menu-button {
  background: #152d25;
  border-color: #152d25;
  color: #fff;
}

.menu-layer[open] {
  z-index: 70;
}

.menu-layer[open] > .menu-button span {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.layer-panel {
  position: fixed;
  top: 84px;
  right: 24px;
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 108px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  z-index: 80;
}

.profile-layer {
  width: min(1040px, calc(100vw - 32px));
}

.profile-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.profile-section-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
}

.profile-section-tab span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(67, 217, 124, 0.12);
  color: var(--green);
  font-size: 0.72rem;
}

.profile-section-tab.is-active {
  border-color: rgba(67, 217, 124, 0.45);
  background: rgba(67, 217, 124, 0.14);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

.layer-head,
.feed-head,
.stat-top,
.mini-row,
.schedule-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.layer-head {
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

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

.panel-section {
  padding: 16px 0 0;
}

.panel-section + .panel-section {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.profile-subsection-head {
  display: grid;
  gap: 2px;
  margin: 16px 0 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.profile-subsection-head:first-of-type {
  margin-top: 10px;
}

.profile-subsection-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.15;
}

.goal-manager-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.goal-manager-head h3,
.goal-manager-head p {
  margin: 0;
}

.goal-manager-head p {
  margin-top: 4px;
  font-size: 0.84rem;
}

.goal-manager-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.goal-manager-action {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  color: var(--ink);
}

.goal-manager-action.is-active {
  border-color: rgba(67, 217, 124, 0.52);
  background: rgba(67, 217, 124, 0.16);
  color: var(--green);
  box-shadow: 0 0 0 1px rgba(67, 217, 124, 0.12);
}

.goal-action-panel {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid rgba(137, 156, 175, 0.26);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
}

.goal-action-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.goal-action-panel-head h4,
.goal-action-panel-head p {
  margin: 0;
}

.goal-action-panel-head p:not(.overline) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.goal-plan-wizard-panel {
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green) 12%, transparent), transparent 34%),
    var(--surface);
}

.goal-plan-wizard {
  display: grid;
  gap: 14px;
}

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

.wizard-progress span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.wizard-progress span.is-active {
  border-color: rgba(67, 217, 124, 0.58);
  background: rgba(67, 217, 124, 0.16);
  color: var(--green);
}

.goal-plan-wizard[data-enhanced="1"] .wizard-step {
  display: none;
}

.goal-plan-wizard[data-enhanced="1"] .wizard-step.is-active {
  display: grid;
}

.wizard-step {
  display: grid;
  gap: 12px;
}

.wizard-option-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 -2px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.2;
}

.wizard-option-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 18px color-mix(in srgb, var(--green) 28%, transparent);
}

.wizard-option-title.blue::before {
  background: var(--blue);
}

.wizard-option-title.amber::before {
  background: var(--amber);
}

.wizard-option-title.orange::before {
  background: var(--orange);
}

.wizard-option-title.purple::before {
  background: var(--purple);
}

.wizard-goal-list {
  display: grid;
  gap: 10px;
}

.wizard-goal-card {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
  cursor: pointer;
}

.wizard-goal-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.wizard-goal-card span:not(.wizard-goal-icon) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.wizard-goal-card strong {
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.08;
}

.wizard-goal-card em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.28;
}

.wizard-goal-card b {
  align-self: start;
  padding: 5px 8px;
  border: 1px solid rgba(137, 156, 175, 0.22);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wizard-goal-icon {
  --plan-icon-tone: var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid color-mix(in srgb, var(--plan-icon-tone) 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--plan-icon-tone) 16%, transparent);
  color: var(--plan-icon-tone);
  font-size: 0.78rem;
  font-weight: 950;
}

.wizard-goal-icon svg {
  width: 25px;
  height: 25px;
}

.wizard-goal-icon svg * {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wizard-goal-icon.plan-icon-hyrox {
  --plan-icon-tone: var(--amber);
}

.wizard-goal-icon.plan-icon-gymrace {
  --plan-icon-tone: var(--blue);
}

.wizard-goal-icon.plan-icon-strength {
  --plan-icon-tone: var(--orange);
}

.wizard-goal-icon.plan-icon-calisthenics {
  --plan-icon-tone: #c4b5fd;
}

.wizard-goal-icon.plan-icon-fitness {
  --plan-icon-tone: #5eead4;
}

.wizard-goal-icon.plan-icon-cycling {
  --plan-icon-tone: #22d3ee;
}

.wizard-goal-icon.plan-icon-race {
  --plan-icon-tone: #f472b6;
}

.wizard-goal-icon.plan-icon-recovery {
  --plan-icon-tone: #a78bfa;
}

.wizard-goal-card:has(input:checked) {
  border-color: rgba(67, 217, 124, 0.65);
  background: rgba(67, 217, 124, 0.13);
  box-shadow: inset 0 0 0 1px rgba(67, 217, 124, 0.12);
}

.wizard-goal-card:has(input:checked) .wizard-goal-icon {
  border-color: color-mix(in srgb, var(--plan-icon-tone) 76%, white 12%);
  background: var(--plan-icon-tone);
  color: #06120c;
}

.wizard-goal-card.is-disabled {
  cursor: default;
  opacity: 0.58;
}

.wizard-goal-card.is-disabled .wizard-goal-icon {
  border-color: rgba(137, 156, 175, 0.2);
  background: rgba(137, 156, 175, 0.08);
  color: var(--muted);
}

.wizard-step-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.wizard-step-head strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.12;
}

.wizard-step-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.wizard-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.wizard-card-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wizard-card-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wizard-choice {
  position: relative;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
  cursor: pointer;
}

.wizard-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.wizard-choice span {
  display: grid;
  gap: 4px;
}

.wizard-choice strong {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.1;
}

.wizard-choice em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  line-height: 1.25;
}

.wizard-choice:has(input:checked) {
  border-color: rgba(67, 217, 124, 0.62);
  background: rgba(67, 217, 124, 0.12);
  box-shadow: inset 0 0 0 1px rgba(67, 217, 124, 0.1);
}

.wizard-choice:focus-within {
  outline: 2px solid rgba(67, 217, 124, 0.38);
  outline-offset: 2px;
}

.wizard-review {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(67, 217, 124, 0.34);
  border-radius: 8px;
  background: rgba(67, 217, 124, 0.1);
}

.wizard-review strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.wizard-review span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.wizard-actions [data-wizard-hint] {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.goal-list-head {
  margin-top: 14px;
  padding-top: 0;
  border-top: 0;
}

.mcp-token-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.mcp-token-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.mcp-token-row strong,
.mcp-token-row p {
  min-width: 0;
}

.mcp-token-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.mcp-token-row.is-revoked {
  opacity: 0.62;
}

.token-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.token-created-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.token-created-card {
  width: min(720px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.token-secret-box {
  width: 100%;
  margin-top: 8px;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.token-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.token-meta-grid span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.token-created-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stack {
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

.dashboard-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.summary-band {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 20px 0 26px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.stat-tile {
  min-height: 124px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-top {
  align-items: flex-start;
}

.stat-top span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.stat-top strong {
  font-size: 1.28rem;
  line-height: 1;
  text-align: right;
}

.stat-tile p {
  min-height: 34px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeea;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.stat-blue .meter span {
  background: var(--blue);
}

.stat-amber .meter span {
  background: var(--amber);
}

.stat-orange .meter span {
  background: var(--orange);
}

.stat-rose .meter span {
  background: var(--rose);
}

.stat-purple .meter span {
  background: var(--purple);
}

.tabbed-dashboard {
  display: grid;
  grid-template-columns: repeat(5, max-content) 1fr;
  align-items: start;
  gap: 10px;
}

.tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
}

.tab-label {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

button.is-pressed,
.button.is-pressed,
.small-button.is-pressed,
.header-button.is-pressed {
  transform: translateY(1px) scale(0.99);
}

button.is-submitting,
form.is-submitting button[type="submit"] {
  opacity: 0.74;
  cursor: progress;
}

.tab-label svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#tab-goals:checked + .tab-label,
#tab-feed:checked + .tab-label,
#tab-trends:checked + .tab-label,
#tab-sleep:checked + .tab-label,
#tab-reports:checked + .tab-label,
#tab-circle:checked + .tab-label,
#tab-coach:checked + .tab-label {
  background: #152d25;
  border-color: #152d25;
  color: #fff;
}

.tab-panel {
  grid-column: 1 / -1;
  display: none;
  margin-top: 8px;
}

#tab-goals:checked ~ .overview-panel,
#tab-feed:checked ~ .feed-panel,
#tab-trends:checked ~ .trends-panel,
#tab-sleep:checked ~ .sleep-panel,
#tab-reports:checked ~ .report-panel,
#tab-circle:checked ~ .circle-panel,
#tab-coach:checked ~ .coach-thread-panel {
  display: block;
}

.feed-sections,
.feed-section,
.feed-list,
.message-list,
.mini-list,
.schedule-list {
  display: grid;
  gap: 10px;
}

.feed-sections {
  gap: 24px;
}

.feed-section {
  gap: 12px;
}

.feed-date {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 0.96rem;
}

.feed-date::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: var(--line);
}

.feed-summary-card {
  padding: 14px;
  border: 1px solid #c6d8cf;
  border-radius: 8px;
  background: #edf5ef;
}

.feed-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.feed-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.feed-summary-metric {
  min-height: 74px;
  display: grid;
  align-content: start;
  gap: 4px;
  padding-left: 10px;
  border-left: 3px solid var(--green);
}

.feed-summary-metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.feed-summary-metric strong {
  font-size: 1.2rem;
  line-height: 1.1;
}

.feed-summary-metric em {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
}

.data-quality-card {
  display: grid;
  grid-template-columns: minmax(190px, 0.55fr) minmax(120px, 0.22fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(232, 244, 238, 0.1);
  border-radius: 8px;
  background: rgba(9, 16, 23, 0.72);
}

.data-quality-card h3 {
  margin: 0;
  font-size: 1rem;
}

.data-quality-card span,
.data-quality-card em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.data-quality-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.data-quality-meter span {
  display: block;
  width: calc(var(--score, 0) * 1%);
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.data-quality-amber .data-quality-meter span { background: var(--amber); }
.data-quality-blue .data-quality-meter span { background: var(--blue); }

.data-quality-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.data-quality-list span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-weight: 800;
}

.data-quality-list span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.data-quality-list .is-ok::before {
  background: var(--green);
}

.metric-blue {
  border-color: var(--blue);
}

.metric-amber {
  border-color: var(--amber);
}

.metric-orange {
  border-color: var(--orange);
}

.metric-purple {
  border-color: var(--purple);
}

.feed-card,
.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.feed-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.feed-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e5eee8;
  color: var(--green);
  font-weight: 900;
}

.feed-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feed-workout .feed-icon {
  background: #e8edf5;
  color: var(--blue);
}

.feed-sleep .feed-icon {
  background: #edeaf5;
  color: var(--purple);
}

.feed-card.feed-body > .feed-icon {
  background: #f5e8eb;
  color: var(--rose);
}

.feed-hydration .feed-icon {
  background: #e6f0f7;
  color: var(--blue);
}

.feed-body .feed-head {
  align-items: start;
}

.feed-head h3,
.feed-head p {
  margin: 0;
}

.feed-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.feed-head strong {
  flex: 0 0 auto;
  font-size: 1rem;
  text-align: right;
}

.feed-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.feed-card-actions > form {
  display: contents;
}

.delete-icon {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.delete-icon:hover {
  border-color: #e0a7af;
  background: #fbecef;
  color: var(--rose);
}

.delete-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.macro-row,
.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.macro-row span,
.metric-row span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.metric-row strong {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.activity-hr-trace {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.activity-hr-head,
.activity-hr-axis {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.activity-hr-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.activity-hr-head span,
.activity-hr-recovery span,
.activity-hr-axis span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-hr-head em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.activity-hr-head strong,
.activity-hr-recovery strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.activity-hr-trace.is-partial {
  border-color: rgba(241, 183, 74, 0.28);
}

.activity-hr-recovery {
  justify-items: end;
  text-align: right;
}

.activity-hr-chart-wrap {
  position: relative;
  min-width: 0;
  height: clamp(118px, 16vw, 172px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(67, 209, 125, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(67, 209, 125, 0.055) 1px, transparent 1px),
    radial-gradient(circle at 12% 20%, rgba(67, 209, 125, 0.08), transparent 32%),
    rgba(4, 12, 11, 0.34);
  background-size: 28px 28px, 28px 28px, auto, auto;
}

.activity-hr-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.activity-hr-chart polyline {
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px rgba(67, 209, 125, 0.42));
}

.activity-hr-chart circle {
  fill: #07110d;
  stroke: var(--green);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.activity-hr-value-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.activity-hr-value-labels span {
  position: absolute;
  z-index: 2;
  min-width: 24px;
  padding: 2px 5px;
  border: 1px solid rgba(67, 209, 125, 0.28);
  border-radius: 999px;
  background: rgba(5, 13, 10, 0.82);
  color: #a8ffcb;
  font-size: 0.65rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  transform: translate(-50%, calc(-100% - 7px));
  box-shadow: 0 0 12px rgba(67, 209, 125, 0.16);
}

.activity-hr-bands {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.activity-hr-bands span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.activity-hr-bands i {
  display: block;
  height: 5px;
  min-width: 4px;
  border-radius: 999px;
  background: currentColor;
}

.activity-hr-bands strong {
  color: var(--ink);
  font-size: 0.72rem;
}

.activity-hr-bands em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
}

.activity-hr-band-easy { color: var(--green); }
.activity-hr-band-aerobic { color: var(--blue); }
.activity-hr-band-tempo { color: var(--amber); }
.activity-hr-band-hard { color: var(--rose); }

.body-composition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.body-composition-grid div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.body-composition-grid span,
.body-composition-grid em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  font-style: normal;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.body-composition-grid span {
  font-weight: 900;
  text-transform: uppercase;
}

.body-composition-grid strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.body-trend-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 6px;
  min-width: 0;
}

.body-trend-chart {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.body-trend-chart-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 6px;
  align-items: baseline;
  min-width: 0;
}

.body-trend-chart-head span,
.body-trend-chart-head em,
.body-trend-labels span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.56rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.body-trend-chart-head strong {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.05;
}

.body-trend-chart-head em {
  grid-column: 1 / -1;
  color: rgba(233, 240, 235, 0.72);
  font-size: 0.54rem;
}

.body-trend-chart svg {
  width: 100%;
  min-height: 38px;
  max-height: 44px;
  overflow: visible;
}

.body-trend-chart polyline {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.body-trend-chart circle {
  fill: rgba(18, 28, 38, 1);
  stroke: var(--green);
  stroke-width: 2.2;
}

.body-trend-point-label {
  fill: #f8fffb;
  font-size: 7px;
  font-weight: 900;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(5, 9, 13, 0.95);
  stroke-linejoin: round;
  stroke-width: 3.2px;
  text-anchor: middle;
}

.body-trend-rose polyline,
.body-trend-rose circle { stroke: var(--rose); }
.body-trend-green polyline,
.body-trend-green circle { stroke: var(--green); }
.body-trend-amber polyline,
.body-trend-amber circle { stroke: var(--amber); }

.body-trend-labels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  gap: 2px;
  text-align: center;
}

.food-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.food-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.food-list em {
  flex: 0 0 auto;
  color: var(--muted);
  font-style: normal;
}

.message {
  padding: 14px;
}

.message-role {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.message-meta span {
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.message-meta time {
  text-align: right;
}

.message pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.62;
}

.message.assistant pre {
  max-width: 92ch;
}

.coach-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.coach-rating button {
  width: 34px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(232, 244, 238, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
}

.coach-rating svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coach-rating button.is-active {
  border-color: rgba(67, 209, 125, 0.42);
  background: rgba(67, 209, 125, 0.14);
  color: #caffd8;
}

.coach-rating.is-saving {
  opacity: 0.7;
}

.coach-thread-panel .message-list {
  gap: 14px;
}

.coach-web-tabs {
  display: grid;
  gap: 14px;
}

.coach-web-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.coach-web-tab-head {
  display: flex;
  gap: 14px;
  align-items: end;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.coach-web-tab-head h2,
.coach-web-tab-head p {
  margin: 0;
}

.coach-web-tab-head h2 {
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.25rem;
}

.coach-web-tab-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  width: min(430px, 100%);
}

.coach-web-tab-bar label {
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-align: center;
  cursor: pointer;
}

#coach-web-tab-briefs:checked ~ .coach-web-tab-head label[for="coach-web-tab-briefs"],
#coach-web-tab-call:checked ~ .coach-web-tab-head label[for="coach-web-tab-call"],
#coach-web-tab-behaviour:checked ~ .coach-web-tab-head label[for="coach-web-tab-behaviour"] {
  border-color: rgba(67, 209, 125, 0.42);
  background: rgba(67, 209, 125, 0.16);
  color: var(--ink);
}

.coach-web-section {
  display: none;
}

#coach-web-tab-briefs:checked ~ .coach-web-tab-panels .coach-web-section-briefs,
#coach-web-tab-call:checked ~ .coach-web-tab-panels .coach-web-section-call,
#coach-web-tab-behaviour:checked ~ .coach-web-tab-panels .coach-web-section-behaviour {
  display: grid;
  gap: 14px;
}

.coach-call-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(67, 209, 125, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(67, 209, 125, 0.13), rgba(88, 182, 255, 0.07) 45%, transparent),
    linear-gradient(180deg, rgba(22, 33, 43, 0.97), rgba(13, 20, 27, 0.97));
}

.coach-call-hero h3,
.coach-call-hero p {
  margin: 0;
}

.coach-call-hero h3 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.25rem;
}

.coach-call-hero p {
  margin-top: 8px;
  color: var(--muted);
}

.coach-call-hero em {
  display: block;
  margin-top: 8px;
  color: var(--green);
  font-style: normal;
  font-weight: 850;
}

.coach-call-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.coach-web-section-behaviour {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.coach-web-section-behaviour > .behavior-coach-head {
  grid-column: 1 / -1;
}

.behavior-coach-head h3,
.behavior-coach-head p {
  margin: 0;
}

.behavior-coach-head h3 {
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.2rem;
}

.message.user {
  background: #f8faf8;
}

.message-list.compact {
  max-height: 420px;
  overflow: auto;
}

@media (max-width: 780px) {
  .coach-web-tab-head {
    align-items: stretch;
    flex-direction: column;
  }

  .coach-web-tab-bar {
    width: 100%;
  }

  .coach-call-hero,
  .coach-call-grid,
  .coach-web-section-behaviour {
    grid-template-columns: 1fr;
  }
}

.mini-list,
.schedule-list {
  margin-top: 14px;
}

.mini-row,
.schedule-row {
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.mini-row span,
.schedule-row p {
  color: var(--muted);
}

.schedule-row p {
  margin: 4px 0 0;
}

.schedule-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.schedule-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.schedule-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr 0.75fr 0.85fr 1.35fr;
  gap: 8px;
}

.schedule-edit-grid label {
  font-size: 0.72rem;
}

.schedule-edit-grid input,
.schedule-edit-grid select {
  min-height: 36px;
  padding: 0 8px;
  font-size: 0.82rem;
}

.schedule-delete-form {
  align-self: end;
}

.training-planner-section {
  grid-column: 1 / -1;
}

.training-planner-head {
  align-items: center;
  gap: 12px;
}

.training-planner-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.training-planner-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.training-action-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.training-week-nav {
  margin-top: 14px;
}

.training-week-nav span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.training-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.training-day-card {
  min-height: 154px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.training-day-card.is-today {
  border-color: rgba(67, 217, 124, 0.55);
  box-shadow: inset 0 3px 0 rgba(67, 217, 124, 0.8);
}

.training-day-head,
.planned-workout-card summary,
.workout-template-card summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.training-day-head strong {
  display: block;
}

.training-day-head span,
.planned-workout-card small,
.workout-template-card small,
.training-pattern-hint small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.planned-workout-stack {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.planned-workout-card,
.workout-template-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 55%, transparent);
  padding: 10px;
}

.planned-workout-card summary,
.workout-template-card summary {
  cursor: pointer;
  list-style: none;
}

.planned-workout-card summary::-webkit-details-marker,
.workout-template-card summary::-webkit-details-marker {
  display: none;
}

.planned-workout-card summary strong,
.workout-template-card summary strong {
  display: block;
  font-size: 0.9rem;
}

.planned-workout-card summary em,
.workout-template-card summary em {
  align-self: flex-start;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(67, 217, 124, 0.14);
  color: var(--green);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.planned-workout-card.status-skipped summary em {
  background: rgba(184, 75, 90, 0.14);
  color: var(--rose);
}

.planned-workout-card.status-done summary em {
  background: rgba(46, 111, 159, 0.14);
  color: var(--blue);
}

.planned-workout-card p,
.workout-template-card p,
.training-pattern-hint p {
  margin: 8px 0 0;
  font-size: 0.82rem;
}

.planner-activity-match {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
}

.planner-activity-match > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.planner-activity-match strong {
  font-size: 0.78rem;
}

.planner-activity-match span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.planner-activity-match p {
  margin-top: 6px;
  color: var(--muted);
}

.planner-activity-match.status-linked {
  border-color: rgba(67, 217, 124, 0.28);
  background: rgba(67, 217, 124, 0.1);
}

.planner-activity-match.status-linked span {
  color: var(--green);
}

.planner-activity-match.status-suggested {
  border-color: rgba(245, 184, 87, 0.28);
  background: rgba(245, 184, 87, 0.1);
}

.planner-activity-match.status-suggested span {
  color: var(--amber);
}

.planner-activity-match.status-waiting {
  border-color: rgba(78, 174, 242, 0.28);
  background: rgba(78, 174, 242, 0.1);
}

.planner-activity-match.status-waiting span {
  color: var(--blue);
}

.training-pattern-hint {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
}

.training-library-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 14px;
  margin-top: 16px;
}

.workout-template-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.compact-training-form {
  margin-top: 10px;
}

.compact-training-form > input[type="text"],
.compact-training-form .planner-feedback-grid,
.compact-training-form .planner-adaptation-note {
  grid-column: 1 / -1;
}

.training-edit-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.planner-feedback-grid {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-soft) 74%, transparent);
}

.planner-feedback-section,
.planner-feedback-meta label {
  min-width: 0;
}

.planner-feedback-title,
.planner-feedback-grid label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.planner-feedback-title {
  display: block;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.planner-feedback-chip-grid {
  display: grid;
  gap: 8px;
}

.planner-feedback-rating-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.planner-feedback-reason-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.planner-feedback-chip {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1.1;
  cursor: pointer;
}

.planner-feedback-chip:hover,
.planner-feedback-chip:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  outline: none;
}

.planner-feedback-chip.is-selected,
.planner-feedback-chip[aria-pressed="true"] {
  border-color: transparent;
  background: var(--accent);
  color: #03100a;
}

.planner-feedback-reason-grid .planner-feedback-chip.is-selected,
.planner-feedback-reason-grid .planner-feedback-chip[aria-pressed="true"] {
  background: var(--blue);
  color: #03101a;
}

.planner-feedback-meta {
  display: grid;
  grid-template-columns: minmax(80px, 0.55fr) minmax(140px, 1fr);
  align-items: end;
  gap: 8px;
}

.planner-feedback-grid input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.78rem;
}

.planner-feedback-check {
  min-height: 34px;
  justify-content: flex-start;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 62%, transparent);
}

.planner-feedback-check input {
  width: auto;
  min-height: 0;
  padding: 0;
}

.planner-adaptation-note {
  padding: 9px 10px;
  border: 1px solid rgba(67, 217, 124, 0.28);
  border-radius: 8px;
  background: rgba(67, 217, 124, 0.1);
  color: var(--green);
  font-weight: 800;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.planner-day-checkboxes {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.planner-day-checkboxes label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 64%, transparent);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.planner-item-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.planner-item-list h5 {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.planner-item-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  padding: 8px;
}

.planner-item-row summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.planner-item-row summary::-webkit-details-marker {
  display: none;
}

.planner-item-main strong {
  display: block;
  font-size: 0.82rem;
}

.planner-item-main small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.planner-item-status,
.planner-item-type {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(88, 182, 255, 0.12);
  color: var(--blue);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.planner-item-status.status-done {
  background: rgba(67, 217, 124, 0.14);
  color: var(--green);
}

.planner-item-status.status-partial {
  background: rgba(255, 197, 92, 0.16);
  color: var(--amber);
}

.planner-item-status.status-skipped {
  background: rgba(255, 109, 143, 0.14);
  color: var(--rose);
}

.planner-item-edit-form,
.planner-item-add-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.planner-item-add-form {
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 54%, transparent);
}

.planner-item-grid,
.planner-item-actual-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.planner-item-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.planner-item-grid label,
.planner-item-actual-grid label {
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.planner-item-grid input,
.planner-item-grid select,
.planner-item-actual-grid input,
.planner-item-edit-form > input,
.planner-item-add-form input,
.planner-item-add-form select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.78rem;
}

.empty-state {
  width: min(720px, 100%);
  margin: 64px auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.empty-state.small {
  margin: 0;
}

.empty-state h2 {
  margin-bottom: 10px;
}

.empty-state p {
  margin: 0 0 18px;
}

.landing-page {
  display: grid;
  gap: 18px;
  padding: 18px clamp(22px, 4vw, 56px) 56px;
}

.landing-hero {
  min-height: min(560px, calc(100vh - 140px));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  max-width: 1680px;
  padding: 36px 0 24px;
  margin: 0 auto;
}

.landing-copy {
  display: grid;
  gap: 18px;
  max-width: 680px;
}

.landing-copy h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.6rem, 7vw, 5.9rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.landing-copy p {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.landing-status-pill {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
}

.landing-signal-card {
  display: grid;
  gap: 16px;
  max-width: 560px;
  justify-self: end;
  padding: 22px;
  border: 1px solid rgba(67, 209, 125, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 84% 12%, rgba(101, 71, 242, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(67, 209, 125, 0.16), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
}

.landing-signal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.landing-signal-head span,
.landing-metric-chip span,
.landing-plan-preview span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.landing-signal-head strong {
  display: block;
  margin-top: 3px;
  color: var(--green);
  font-size: 1.44rem;
}

.landing-score-ring {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(12, 18, 25, 0.98) 56%, transparent 58%),
    conic-gradient(var(--green) calc(var(--ring-progress) * 1%), rgba(137, 156, 175, 0.16) 0);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 14px 26px rgba(0, 0, 0, 0.18);
}

.landing-score-ring span {
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 950;
}

.landing-coach-line {
  margin: 0;
  padding: 12px 13px;
  border: 1px solid rgba(67, 209, 125, 0.16);
  border-radius: 8px;
  background: rgba(67, 209, 125, 0.07);
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 850;
  line-height: 1.35;
}

.landing-signal-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.landing-metric-chip {
  --metric-accent: var(--green);
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.landing-metric-chip strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landing-metric-chip i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(137, 156, 175, 0.17);
}

.landing-metric-chip i::before {
  content: "";
  display: block;
  width: calc(var(--metric-progress) * 1%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--metric-accent), rgba(255, 255, 255, 0.74));
}

.landing-metric-purple { --metric-accent: var(--purple); }
.landing-metric-blue { --metric-accent: var(--blue); }
.landing-metric-amber { --metric-accent: var(--amber); }

.landing-mini-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
  align-items: stretch;
}

.landing-plan-preview {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(88, 182, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(88, 182, 255, 0.12), rgba(101, 71, 242, 0.1));
}

.landing-plan-preview strong,
.landing-plan-preview em {
  display: block;
}

.landing-plan-preview strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 0.98rem;
}

.landing-plan-preview em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.landing-trend-preview {
  display: flex;
  align-items: end;
  gap: 5px;
  min-height: 86px;
  padding: 12px 10px;
  border: 1px solid rgba(67, 209, 125, 0.14);
  border-radius: 8px;
  background: rgba(5, 9, 13, 0.34);
}

.landing-trend-preview span {
  flex: 1;
  min-width: 5px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, var(--green), rgba(88, 182, 255, 0.7));
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

.landing-feature-grid article {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.landing-feature-grid strong {
  color: var(--ink);
}

.landing-feature-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.public-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.public-legal-links a {
  color: var(--muted);
  text-decoration: none;
}

.public-legal-links a:hover {
  color: var(--ink);
}

.legal-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 4%, rgba(124, 92, 255, 0.16), transparent 32rem),
    radial-gradient(circle at 88% 12%, rgba(56, 217, 130, 0.12), transparent 28rem),
    var(--bg);
  color: var(--ink);
}

.legal-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 28px 18px 58px;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 800;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.legal-brand img:first-child {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.legal-brand img:last-child {
  width: 178px;
  height: auto;
}

.legal-card {
  display: grid;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal-card h1,
.legal-card h2,
.legal-card p,
.legal-card ul,
.legal-card ol {
  margin: 0;
}

.legal-card h1 {
  max-width: 780px;
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.legal-card h2 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
  line-height: 1.62;
}

.legal-card ul,
.legal-card ol {
  padding-left: 1.25rem;
}

.legal-card a {
  color: var(--green);
  font-weight: 850;
}

.sync-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 35, 29, 0.28);
}

.sync-overlay[hidden] {
  display: none;
}

.offline-banner {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 92;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 9px 12px;
  border: 1px solid rgba(255, 184, 77, 0.32);
  border-radius: 8px;
  background: rgba(14, 18, 23, 0.94);
  color: #f6f8f5;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
}

.offline-banner[hidden] {
  display: none;
}

.offline-banner span {
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.offline-banner strong {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-card {
  width: min(440px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sync-card h2 {
  margin-bottom: 8px;
}

.sync-card p:not(.overline) {
  margin: 0 0 18px;
  color: var(--muted);
}

.sync-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.sync-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  animation: sync-progress 1.2s ease-in-out infinite;
}

body.is-syncing {
  cursor: progress;
}

@keyframes sync-progress {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(260%);
  }
}

@media (max-width: 1080px) {
  .summary-band {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .feed-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .landing-hero {
    grid-template-columns: 1fr;
  }

  .landing-signal-card {
    justify-self: stretch;
    max-width: none;
  }

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

@media (max-width: 760px) {
  .app-header {
    position: relative;
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .header-actions,
  .google-control,
  .top-menu {
    width: 100%;
    justify-content: stretch;
  }

  .google-control,
  .top-menu {
    align-items: stretch;
  }

  .google-control > *,
  .google-control form,
  .top-menu .menu-layer,
  .top-menu .menu-button,
  .header-button {
    flex: 1 1 auto;
  }

  .google-control form {
    display: flex;
  }

  .google-control > .status-dot,
  .source-actions > .status-dot {
    flex: 0 0 10px;
    width: 10px;
    min-width: 10px;
    max-width: 10px;
    height: 10px;
    min-height: 10px;
    max-height: 10px;
    align-self: center;
  }

  .layer-panel {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 24px);
  }

  .panel-grid.two,
  .form-grid,
  .form-grid.two,
  .stat-grid,
  .feed-summary-grid {
    grid-template-columns: 1fr;
  }

  .tabbed-dashboard {
    grid-template-columns: 1fr 1fr;
  }

  .feed-card {
    grid-template-columns: 1fr;
  }

  .feed-icon {
    width: 36px;
    height: 36px;
  }

  .feed-head,
  .food-list li,
  .schedule-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .feed-head strong,
  .food-list em {
    text-align: left;
  }
}

/* Dark fitness dashboard polish */
:root {
  --bg: #070b0f;
  --ink: #eef7f2;
  --muted: #9aa8a1;
  --surface: #111820;
  --surface-soft: #18232d;
  --surface-raised: #151f29;
  --line: rgba(232, 244, 238, 0.11);
  --line-strong: rgba(232, 244, 238, 0.19);
  --green: #43d17d;
  --blue: #58b6ff;
  --amber: #f1b74a;
  --orange: #ff8c5a;
  --rose: #ff6d8f;
  --purple: #b69cff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

html {
  background: var(--bg);
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 25, 32, 0.98) 0%, rgba(7, 11, 15, 1) 42%, rgba(5, 8, 11, 1) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(67, 209, 125, 0.055), transparent 31%, rgba(88, 182, 255, 0.04) 69%, transparent),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.028) 0, rgba(255, 255, 255, 0.028) 1px, transparent 1px, transparent 54px);
  opacity: 0.8;
}

button,
a.button,
.header-button,
.menu-button,
.small-button {
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

button:hover,
a.button:hover,
.header-button:hover,
.menu-button:hover,
.small-button:hover {
  transform: translateY(-1px);
}

.button,
.header-button.primary {
  background: linear-gradient(180deg, #4be28a, #24a95d);
  color: #06100b;
  border-color: rgba(91, 238, 145, 0.52);
  box-shadow: 0 0 0 1px rgba(67, 209, 125, 0.14), 0 12px 30px rgba(28, 182, 91, 0.22);
}

.button.secondary,
.header-button.quiet,
.small-button,
.icon-button {
  background: rgba(24, 35, 45, 0.88);
  border-color: var(--line);
  color: var(--ink);
}

.button.secondary:hover,
.header-button.quiet:hover,
.small-button:hover,
.icon-button:hover {
  border-color: rgba(88, 182, 255, 0.38);
  background: rgba(32, 47, 60, 0.95);
}

.app-header {
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 15, 0.82);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.brand-mark,
.brand-avatar {
  border-radius: 8px;
}

.brand-mark {
  background: linear-gradient(145deg, #1e2d37, #0f171f);
  color: var(--green);
  border: 1px solid rgba(67, 209, 125, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 28px rgba(0, 0, 0, 0.26);
}

.brand-avatar {
  border-color: rgba(255, 255, 255, 0.16);
  background: var(--surface-soft);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.brand-logo-mark {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.overline {
  color: var(--green);
  opacity: 0.9;
}

h1,
h2,
h3 {
  color: var(--ink);
}

.muted,
.google-status,
.last-sync,
.feed-head p,
.stat-tile p,
.feed-summary-head,
.feed-summary-metric span,
.feed-summary-metric em,
.mini-row span,
.schedule-row p,
.food-list em,
label {
  color: var(--muted);
}

.google-control {
  border-color: var(--line);
  background: rgba(17, 24, 32, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.google-label {
  color: var(--ink);
}

.status-dot {
  box-shadow: 0 0 0 4px rgba(154, 168, 161, 0.09);
}

.status-connected,
.status-bridge_ready {
  box-shadow: 0 0 0 4px rgba(67, 209, 125, 0.12), 0 0 18px rgba(67, 209, 125, 0.38);
}

.status-available {
  box-shadow: 0 0 0 4px rgba(241, 183, 74, 0.12), 0 0 18px rgba(241, 183, 74, 0.28);
}

.menu-button,
.tab-label {
  background: rgba(17, 24, 32, 0.78);
  border-color: var(--line);
  color: var(--muted);
}

.menu-button span {
  background: rgba(67, 209, 125, 0.12);
  color: var(--green);
}

.menu-layer[open] > .menu-button,
#tab-goals:checked + .tab-label,
#tab-feed:checked + .tab-label,
#tab-trends:checked + .tab-label,
#tab-sleep:checked + .tab-label,
#tab-reports:checked + .tab-label,
#tab-circle:checked + .tab-label,
#tab-coach:checked + .tab-label {
  background: rgba(67, 209, 125, 0.14);
  border-color: rgba(67, 209, 125, 0.42);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(67, 209, 125, 0.08);
}

.menu-layer[open] > .menu-button span {
  background: rgba(67, 209, 125, 0.2);
  color: var(--green);
}

.layer-panel,
.sync-card,
.empty-state {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(21, 31, 41, 0.98), rgba(13, 20, 27, 0.98));
  box-shadow: var(--shadow);
}

.layer-head,
.panel-section + .panel-section,
.mini-row,
.schedule-row,
.food-list li {
  border-color: var(--line);
}

input,
select,
textarea {
  border-color: var(--line);
  background: rgba(5, 9, 13, 0.62);
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(67, 209, 125, 0.58);
  box-shadow: 0 0 0 3px rgba(67, 209, 125, 0.11);
}

input::placeholder,
textarea::placeholder {
  color: rgba(154, 168, 161, 0.72);
}

.dashboard-shell {
  width: min(1240px, calc(100% - 32px));
  padding-top: 30px;
}

.summary-band {
  position: relative;
  grid-template-columns: 210px minmax(0, 1fr);
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(67, 209, 125, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(21, 31, 41, 0.92), rgba(12, 18, 25, 0.92));
  box-shadow: var(--shadow);
}

.summary-band::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(67, 209, 125, 0.72), rgba(88, 182, 255, 0.36), transparent);
}

.stat-grid {
  gap: 12px;
}

.stat-tile {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(22, 33, 43, 0.96), rgba(13, 20, 27, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.stat-tile::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--green);
}

.stat-blue::before { background: var(--blue); }
.stat-amber::before { background: var(--amber); }
.stat-orange::before { background: var(--orange); }
.stat-rose::before { background: var(--rose); }
.stat-purple::before { background: var(--purple); }

.stat-top span,
.feed-summary-metric span,
.metric-row strong {
  letter-spacing: 0;
}

.stat-top strong {
  color: #f8fffb;
  font-size: 1.42rem;
}

.meter,
.sync-progress {
  background: rgba(255, 255, 255, 0.075);
}

.meter span {
  background: linear-gradient(90deg, rgba(67, 209, 125, 0.72), var(--green));
  box-shadow: 0 0 14px rgba(67, 209, 125, 0.24);
}

.stat-blue .meter span { background: linear-gradient(90deg, rgba(88, 182, 255, 0.68), var(--blue)); }
.stat-amber .meter span { background: linear-gradient(90deg, rgba(241, 183, 74, 0.68), var(--amber)); }
.stat-orange .meter span { background: linear-gradient(90deg, rgba(255, 140, 90, 0.68), var(--orange)); }
.stat-rose .meter span { background: linear-gradient(90deg, rgba(255, 109, 143, 0.68), var(--rose)); }
.stat-purple .meter span { background: linear-gradient(90deg, rgba(182, 156, 255, 0.68), var(--purple)); }

.tabbed-dashboard {
  margin-top: 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 11, 15, 0.42);
}

.tab-label {
  min-height: 44px;
}

.feed-sections {
  padding-top: 12px;
}

.feed-date {
  color: var(--ink);
}

.feed-date::after {
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

.feed-summary-card {
  border-color: rgba(67, 209, 125, 0.24);
  background:
    linear-gradient(135deg, rgba(67, 209, 125, 0.13), transparent 38%),
    rgba(17, 24, 32, 0.86);
}

.feed-summary-metric {
  border-left-color: var(--green);
}

.metric-blue { border-color: var(--blue); }
.metric-amber { border-color: var(--amber); }
.metric-orange { border-color: var(--orange); }
.metric-purple { border-color: var(--purple); }

.feed-card,
.message {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(21, 31, 41, 0.94), rgba(12, 18, 25, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.032);
}

.feed-card {
  position: relative;
  overflow: hidden;
}

.feed-workout {
  overflow: visible;
}

.feed-workout:has(.activity-share-menu[open]) {
  z-index: 35;
}

@media (min-width: 761px) {
  .feed-workout .feed-body {
    padding-right: 46px;
  }
}

.feed-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--green);
}

.feed-workout::before,
.feed-workout .feed-icon { color: var(--blue); }
.feed-workout::before { background: var(--blue); }
.feed-sleep::before { background: var(--purple); }
.feed-body::before { background: var(--rose); }
.feed-hydration::before { background: var(--blue); }

.feed-icon,
.feed-workout .feed-icon,
.feed-sleep .feed-icon,
.feed-card.feed-body > .feed-icon,
.feed-hydration .feed-icon {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.075);
}

.feed-icon {
  color: var(--green);
}

.feed-sleep .feed-icon {
  color: var(--purple);
}

.feed-card.feed-body > .feed-icon {
  color: var(--rose);
}

.feed-hydration .feed-icon {
  color: var(--blue);
}

.feed-head strong {
  color: #f8fffb;
}

.feed-card-actions strong {
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.delete-icon {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line);
  color: var(--muted);
}

.delete-icon:hover {
  border-color: rgba(255, 109, 143, 0.46);
  background: rgba(255, 109, 143, 0.12);
  color: var(--rose);
}

.activity-share-menu {
  position: relative;
}

.activity-card-corner {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
}

.activity-card-corner > form {
  display: block;
  margin: 0;
}

.activity-card-corner.is-busy .activity-share-icon svg {
  animation: circleSharePulse 0.8s ease-in-out infinite alternate;
}

.activity-share-icon {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  cursor: pointer;
}

.activity-share-icon:hover,
.activity-share-menu[open] > .activity-share-icon {
  border-color: rgba(67, 209, 125, 0.46);
  background: rgba(67, 209, 125, 0.12);
  color: var(--green);
}

.activity-share-icon.is-shared {
  border-color: rgba(67, 209, 125, 0.42);
  background: rgba(67, 209, 125, 0.16);
  color: var(--green);
}

.activity-share-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.macro-row span,
.metric-row span {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.055);
  color: var(--ink);
}

.food-list li {
  color: var(--ink);
}

.message.user {
  background: linear-gradient(180deg, rgba(30, 45, 57, 0.95), rgba(18, 28, 37, 0.95));
}

.message-role {
  color: var(--green);
}

.sync-overlay {
  background: rgba(3, 6, 9, 0.72);
  backdrop-filter: blur(10px);
}

.sync-progress span {
  background: linear-gradient(90deg, transparent, var(--green), var(--blue));
}

@media (max-width: 1080px) {
  .summary-band {
    grid-template-columns: 1fr;
  }
}

/* Trends tab */
.tabbed-dashboard {
  grid-template-columns: repeat(5, max-content) 1fr;
}

#tab-trends:checked + .tab-label {
  background: #152d25;
  border-color: #152d25;
  color: #fff;
}

#tab-trends:checked ~ .trends-panel {
  display: block;
}

.trends-panel {
  display: none;
}

.trend-period-tabs {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.trend-period-tabs a {
  position: relative;
  min-width: 46px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.trend-period-tabs a.is-active {
  border-color: rgba(67, 214, 125, 0.44);
  background: rgba(67, 214, 125, 0.16);
  color: var(--ink);
}

.trend-period-tabs.is-loading a {
  opacity: 0.58;
  pointer-events: none;
}

.trend-period-tabs a.is-loading {
  opacity: 1;
  border-color: rgba(67, 214, 125, 0.64);
  background: rgba(67, 214, 125, 0.2);
  color: var(--ink);
}

.trend-period-tabs a.is-loading::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 4px;
  width: 7px;
  height: 7px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: var(--green);
  border-radius: 999px;
  animation: trend-period-spin 0.7s linear infinite;
}

.trend-period-tabs.is-loading::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: -6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  animation: trend-period-sweep 0.9s ease-in-out infinite;
}

@keyframes trend-period-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes trend-period-sweep {
  0% {
    opacity: 0.25;
    transform: scaleX(0.2);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
  100% {
    opacity: 0.25;
    transform: scaleX(0.2);
  }
}

.trend-hero,
.trend-card,
.insight-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.trend-hero {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(170px, 0.6fr) minmax(240px, 1fr);
  gap: 18px;
  align-items: end;
  padding: 18px;
}

.trend-body-hero {
  grid-template-columns: minmax(170px, 0.58fr) minmax(330px, 1.08fr) minmax(310px, 1fr);
  align-items: stretch;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 109, 143, 0.16), transparent 34%),
    var(--surface);
}

.trend-body-copy,
.trend-body-weight-panel,
.trend-body-side {
  min-width: 0;
}

.trend-body-copy {
  display: grid;
  align-content: center;
  gap: 8px;
}

.trend-body-copy h2 {
  margin: 0;
}

.trend-body-score strong {
  font-size: 2.28rem;
}

.trend-body-weight-panel {
  display: grid;
  align-content: center;
  gap: 6px;
}

.trend-body-weight-panel svg {
  width: 100%;
  min-height: 150px;
  overflow: visible;
}

.trend-body-weight-panel polyline {
  fill: none;
  stroke: var(--rose);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-body-weight-panel circle {
  fill: rgba(18, 28, 38, 1);
  stroke: var(--rose);
  stroke-width: 2.6;
}

.trend-body-weight-panel .chart-point-label {
  font-size: 4.4px;
  stroke-width: 2px;
}

.trend-mini-line .trend-point-label {
  font-size: 5.2px;
  stroke-width: 2.3px;
}

.trend-body-side {
  display: grid;
  gap: 8px;
  align-content: stretch;
}

.trend-body-hero-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.trend-body-hero-charts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: stretch;
}

.trend-body-hero-charts .body-trend-chart {
  align-content: space-between;
}

.trend-body-hero-charts .body-trend-chart svg {
  min-height: 58px;
  max-height: 68px;
}

.trend-steps-hero {
  margin-top: 10px;
}

.trend-hero-score {
  display: grid;
  gap: 4px;
}

.trend-hero-score strong {
  font-size: 2rem;
  line-height: 1;
}

.trend-hero-score span,
.trend-card p,
.trend-card em,
.trend-day em,
.insight-list p {
  color: var(--muted);
}

.trend-hero-meter,
.trend-card-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.trend-hero-meter {
  grid-column: 1 / 3;
}

.trend-hero-meter span,
.trend-card-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.trend-day-bars {
  grid-row: 1 / span 2;
  grid-column: 3;
  height: 130px;
  display: grid;
  grid-template-columns: repeat(var(--trend-bar-count, 7), minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.trend-day {
  min-width: 0;
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.trend-day-track {
  position: relative;
  width: 100%;
  height: 76px;
  display: flex;
  align-items: end;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

.trend-day-track span {
  width: 100%;
  min-height: 5px;
  border-radius: inherit;
  background: var(--green);
}

.trend-day-value {
  position: absolute;
  top: 5px;
  right: 4px;
  left: 4px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 17px;
  padding: 2px 4px;
  border: 1px solid rgba(248, 255, 251, 0.16);
  border-radius: 999px;
  background: rgba(5, 9, 13, 0.78);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.32);
  color: #f8fffb;
  font-size: 0.6rem;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-day strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.trend-day em {
  max-width: 100%;
  font-size: 0.72rem;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trend-day.is-today .trend-day-track {
  outline: 1px solid var(--green);
  outline-offset: 2px;
}

.trend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.trend-card {
  min-height: 154px;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(42px, 1fr);
  align-content: stretch;
  gap: 6px;
  padding: 11px 12px;
  position: relative;
  overflow: hidden;
}

.trend-card-wide {
  grid-column: span 2;
}

.trend-card-composition {
  min-height: 246px;
  grid-template-rows: auto auto auto auto auto auto;
}

.trend-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--green);
}

.trend-card-head {
  display: grid;
  gap: 3px;
}

.trend-card-head span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.trend-card-head strong {
  font-size: 1.16rem;
  line-height: 1.05;
}

.trend-card p,
.trend-card em {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.22;
  font-style: normal;
}

.mini-bars {
  height: 48px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  margin-top: 2px;
  overflow: visible;
  padding-top: 14px;
}

.mini-bars span {
  position: relative;
  min-height: 4px;
  border-radius: 999px 999px 3px 3px;
  background: var(--green);
}

.mini-bar-value {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  max-width: 42px;
  min-height: 15px;
  padding: 2px 4px;
  border: 1px solid rgba(248, 255, 251, 0.14);
  border-radius: 999px;
  background: rgba(5, 9, 13, 0.82);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  color: #f8fffb;
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  white-space: nowrap;
}

.trend-mini-chart {
  align-self: end;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.trend-body-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.trend-body-metrics div {
  padding: 6px;
}

.trend-body-metrics span {
  font-size: 0.54rem;
}

.trend-body-metrics strong {
  font-size: 0.74rem;
}

.trend-body-composition-trends {
  align-self: end;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.trend-mini-chart .mini-bars {
  height: 56px;
  margin-top: 0;
}

.trend-mini-chart .mini-bars span {
  opacity: 0.86;
}

.trend-mini-chart .mini-bars span.is-today {
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.trend-mini-line svg {
  width: 100%;
  min-height: 58px;
  max-height: 62px;
  overflow: visible;
}

.trend-mini-line polyline {
  fill: none;
  stroke: var(--green);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-mini-line circle {
  fill: rgba(18, 28, 38, 1);
  stroke: var(--green);
  stroke-width: 2.3;
}

.trend-target-line {
  stroke: rgba(255, 255, 255, 0.32);
  stroke-dasharray: 4 4;
}

.trend-chart-labels {
  display: grid;
  grid-template-columns: repeat(var(--chart-point-count, 7), minmax(0, 1fr));
  gap: 3px;
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1;
  text-align: center;
}

.trend-blue::before,
.trend-blue .trend-card-meter span,
.trend-blue .mini-bars span { background: var(--blue); }
.trend-amber::before,
.trend-amber .trend-card-meter span,
.trend-amber .mini-bars span { background: var(--amber); }
.trend-orange::before,
.trend-orange .trend-card-meter span,
.trend-orange .mini-bars span { background: var(--orange); }
.trend-rose::before,
.trend-rose .trend-card-meter span,
.trend-rose .mini-bars span { background: var(--rose); }
.trend-purple::before,
.trend-purple .trend-card-meter span,
.trend-purple .mini-bars span { background: var(--purple); }

.trend-blue .trend-mini-line polyline,
.trend-blue .trend-mini-line circle { stroke: var(--blue); }
.trend-amber .trend-mini-line polyline,
.trend-amber .trend-mini-line circle { stroke: var(--amber); }
.trend-orange .trend-mini-line polyline,
.trend-orange .trend-mini-line circle { stroke: var(--orange); }
.trend-rose .trend-mini-line polyline,
.trend-rose .trend-mini-line circle { stroke: var(--rose); }
.trend-purple .trend-mini-line polyline,
.trend-purple .trend-mini-line circle { stroke: var(--purple); }

.insight-panel {
  margin-top: 12px;
  padding: 16px;
}

.insight-list {
  display: grid;
  gap: 8px;
}

.insight-list p {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

/* Dark trend treatment */
#tab-trends:checked + .tab-label {
  background: rgba(67, 209, 125, 0.14);
  border-color: rgba(67, 209, 125, 0.42);
  color: var(--ink);
}

.trend-hero,
.trend-card,
.insight-panel {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(21, 31, 41, 0.94), rgba(12, 18, 25, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.032);
}

.trend-hero {
  background:
    linear-gradient(135deg, rgba(67, 209, 125, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(21, 31, 41, 0.96), rgba(12, 18, 25, 0.96));
}

.trend-hero-meter,
.trend-card-meter,
.trend-day-track {
  background: rgba(255, 255, 255, 0.075);
}

.trend-hero-meter span,
.trend-card-meter span,
.trend-day-track span {
  background: linear-gradient(180deg, var(--green), #209d58);
  box-shadow: 0 0 18px rgba(67, 209, 125, 0.24);
}

.insight-list p {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
}

@media (max-width: 1080px) {
  .trend-hero,
  .trend-body-hero {
    grid-template-columns: 1fr;
  }

  .trend-hero-meter,
  .trend-day-bars {
    grid-column: auto;
    grid-row: auto;
  }

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

  .trend-body-hero-charts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .tabbed-dashboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .trend-card {
    min-height: 138px;
  }

  .trend-card-wide {
    grid-column: auto;
  }

  .trend-body-composition-trends,
  .goal-body-composition-trends,
  .trend-body-hero-charts {
    grid-template-columns: 1fr;
  }

  .trend-body-weight-panel svg {
    min-height: 118px;
  }

  .trend-day-bars {
    gap: 5px;
  }
}


/* Goal progress */
.goals-band {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin: 18px 0 24px;
  padding: 20px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(21, 31, 41, 0.9), rgba(12, 18, 25, 0.9));
  box-shadow: var(--shadow);
}

.goals-band.is-loading {
  opacity: 0.58;
  pointer-events: none;
}

.section-heading h2 {
  margin: 0;
}

.goal-week-toolbar {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.week-switcher {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(137, 156, 175, 0.22);
  border-radius: 10px;
  background: rgba(5, 9, 13, 0.38);
}

.week-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.week-button-text {
  grid-column: 1 / -1;
  min-height: 34px;
  font-size: 0.78rem;
}

.week-current {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: center;
}

.week-current strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-current span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
}

.goal-detail {
  display: grid;
  min-width: 0;
  height: 100%;
}

.goal-detail > summary {
  list-style: none;
  min-height: 100%;
  height: 100%;
  box-sizing: border-box;
}

.goal-detail > summary::-webkit-details-marker {
  display: none;
}

.goal-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 33, 43, 0.96), rgba(13, 20, 27, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.goal-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--green);
}

.goal-blue::before { background: var(--blue); }
.goal-amber::before { background: var(--amber); }
.goal-orange::before { background: var(--orange); }
.goal-rose::before { background: var(--rose); }
.goal-purple::before { background: var(--purple); }

.goal-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.goal-card-head span,
.goal-card p,
.goal-card em,
.goal-card small,
.goal-row p {
  color: var(--muted);
}

.goal-card-head span {
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.goal-card-head strong {
  color: var(--green);
  font-size: 0.78rem;
  text-align: right;
  text-transform: uppercase;
}

.goal-card h3 {
  margin: 0;
}

.goal-card p,
.goal-card em,
.goal-card small {
  margin: 0;
}

.goal-value {
  color: var(--ink) !important;
  font-size: 1.7rem;
  font-weight: 850;
  line-height: 1;
}

.goal-card em,
.goal-card small {
  font-style: normal;
  line-height: 1.35;
}

.goal-body-composition-mini {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.goal-body-composition-mini div {
  padding: 6px;
}

.goal-body-composition-mini span {
  font-size: 0.54rem;
}

.goal-body-composition-mini strong {
  font-size: 0.72rem;
}

.goal-body-spark-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.goal-body-spark-grid .body-trend-chart {
  padding: 6px;
}

.goal-body-spark-grid .body-trend-chart-head span,
.goal-body-spark-grid .body-trend-chart-head em {
  font-size: 0.5rem;
}

.goal-body-spark-grid .body-trend-chart-head strong {
  font-size: 0.68rem;
}

.goal-body-spark-grid .body-trend-chart svg {
  min-height: 30px;
  max-height: 34px;
}

.goal-body-spark-grid .body-trend-point-label {
  display: none;
}

.goal-row-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.goal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.goal-row strong,
.goal-row p {
  display: block;
  margin: 0;
}

.goal-row p {
  margin-top: 4px;
  font-size: 0.84rem;
}

.goal-row-main {
  flex: 1 1 220px;
  min-width: 0;
}

.goal-row-editable {
  align-items: start;
}

.inline-edit-panel {
  position: relative;
}

.inline-edit-panel > summary {
  list-style: none;
  cursor: pointer;
}

.inline-edit-panel > summary::-webkit-details-marker {
  display: none;
}

.goal-edit-form {
  width: min(720px, calc(100vw - 96px));
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.goal-edit-form .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.goal-manage-button {
  white-space: nowrap;
}

.goal-plan-band {
  grid-template-columns: 1fr;
  gap: 14px;
}

.goal-plan-topbar,
.goal-plan-layout,
.goal-plan-day header,
.plan-session-card > summary,
.goal-plan-detail > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.goal-plan-selector {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(137, 156, 175, 0.16);
  border-radius: 8px;
  background: rgba(5, 9, 13, 0.22);
}

.goal-plan-selector-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.goal-plan-selector-head span {
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.goal-plan-selector-head em,
.goal-plan-selected-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 750;
}

.goal-plan-topbar {
  justify-content: space-between;
  padding: 2px 2px 0;
}

.goal-plan-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.goal-plan-actions .icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
}

.goal-plan-actions .icon-button svg {
  width: 19px;
  height: 19px;
}

.goal-plan-actions .icon-button svg,
.goal-plan-actions .icon-button path,
.goal-plan-actions .icon-button rect {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-action-menu {
  position: relative;
}

.plan-action-menu > summary {
  list-style: none;
  cursor: pointer;
}

.plan-action-menu > summary::-webkit-details-marker {
  display: none;
}

.plan-menu-card {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: var(--shadow);
}

.plan-menu-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.plan-menu-card input,
.plan-menu-card select {
  min-width: 0;
}

.plan-menu-grid,
.plan-weekday-row {
  display: grid;
  gap: 8px;
}

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

.plan-weekday-row {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.plan-weekday-row label,
.checkbox-row {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 4px !important;
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink) !important;
  font-size: 0.62rem !important;
}

.checkbox-row {
  justify-content: flex-start;
}

.goal-plan-pill-row,
.plan-item-chip-list {
  display: flex;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
  overflow: visible;
  scrollbar-width: thin;
}

.goal-plan-week-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.goal-plan-pill {
  position: relative;
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 245px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  text-decoration: none;
}

.goal-plan-pill::before,
.goal-plan-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--green);
}

.goal-plan-pill.goal-blue::before,
.goal-plan-hero.goal-blue::before,
.goal-plan-coach.goal-blue {
  --plan-tone: var(--blue);
}

.goal-plan-pill.goal-amber::before,
.goal-plan-hero.goal-amber::before,
.goal-plan-coach.goal-amber {
  --plan-tone: var(--amber);
}

.goal-plan-pill.goal-orange::before,
.goal-plan-hero.goal-orange::before,
.goal-plan-coach.goal-orange {
  --plan-tone: var(--orange);
}

.goal-plan-pill.goal-purple::before,
.goal-plan-hero.goal-purple::before,
.goal-plan-coach.goal-purple {
  --plan-tone: var(--purple);
}

.goal-plan-pill.goal-rose::before,
.goal-plan-hero.goal-rose::before,
.goal-plan-coach.goal-rose {
  --plan-tone: var(--rose);
}

.goal-plan-pill.goal-blue::before { background: var(--blue); }
.goal-plan-pill.goal-amber::before { background: var(--amber); }
.goal-plan-pill.goal-orange::before { background: var(--orange); }
.goal-plan-pill.goal-purple::before { background: var(--purple); }
.goal-plan-pill.goal-rose::before { background: var(--rose); }

.goal-plan-pill.is-selected {
  border-color: rgba(74, 222, 128, 0.58);
  background: rgba(74, 222, 128, 0.11);
}

.goal-plan-pill span,
.goal-plan-pill em,
.goal-plan-hero span,
.goal-plan-hero p,
.goal-plan-coach span,
.goal-plan-coach em,
.goal-plan-week-strip span,
.goal-plan-week-strip em,
.plan-session-card span,
.plan-session-card em,
.goal-plan-detail span,
.goal-plan-detail em,
.goal-plan-empty {
  color: var(--muted);
}

.goal-plan-pill strong,
.goal-plan-pill span,
.goal-plan-pill em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-plan-pill span,
.goal-plan-pill em {
  font-size: 0.66rem;
  font-weight: 850;
}

.goal-plan-layout {
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
}

.goal-plan-hero {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(280px, 1.35fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 33, 43, 0.96), rgba(13, 20, 27, 0.96));
}

.goal-plan-hero.goal-blue::before { background: var(--blue); }
.goal-plan-hero.goal-amber::before { background: var(--amber); }
.goal-plan-hero.goal-orange::before { background: var(--orange); }
.goal-plan-hero.goal-purple::before { background: var(--purple); }
.goal-plan-hero.goal-rose::before { background: var(--rose); }

.goal-plan-hero-copy,
.goal-plan-coach,
.goal-plan-kpis {
  min-width: 0;
}

.goal-plan-hero h3,
.goal-plan-coach strong,
.plan-session-card strong,
.goal-plan-detail strong {
  margin: 0;
  color: var(--ink);
}

.goal-plan-hero h3 {
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1;
}

.goal-plan-coach {
  display: grid;
  gap: 5px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--plan-tone, var(--green)) 38%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--plan-tone, var(--green)) 13%, transparent);
}

.goal-plan-kpis {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(66px, 1fr));
  gap: 8px;
}

.goal-plan-kpis div,
.goal-plan-week-strip a {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  text-decoration: none;
}

.goal-plan-kpis strong,
.goal-plan-week-strip strong {
  color: var(--ink);
  font-size: 1.15rem;
}

.goal-plan-side {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.goal-plan-week-strip a {
  min-width: 0;
}

.goal-plan-week-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.goal-plan-day {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.goal-plan-day.is-today {
  border-color: rgba(74, 222, 128, 0.42);
  background: rgba(74, 222, 128, 0.06);
}

.goal-plan-day header {
  justify-content: space-between;
}

.goal-plan-day header div {
  display: grid;
  gap: 1px;
}

.goal-plan-day header strong {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
}

.goal-plan-day-body {
  display: grid;
  gap: 8px;
}

.plan-session-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 10, 15, 0.38);
}

.plan-session-card.is-relevant {
  border-color: rgba(74, 222, 128, 0.28);
}

.plan-session-card.status-done {
  opacity: 0.72;
}

.plan-session-card > summary {
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
}

.plan-session-card > summary::-webkit-details-marker,
.goal-plan-detail > summary::-webkit-details-marker {
  display: none;
}

.plan-session-card b {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 0.64rem;
  text-transform: uppercase;
}

.plan-session-card summary div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.plan-session-card summary strong,
.plan-session-card summary em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-item-chip {
  flex: 0 0 auto;
  min-width: 150px;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.plan-item-chip strong,
.plan-item-chip em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-session-edit {
  display: grid;
  grid-template-columns: 118px minmax(140px, 1fr) 110px 88px auto;
  gap: 8px;
  align-items: end;
}

.plan-session-edit label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
}

.goal-plan-detail {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.goal-plan-detail > summary {
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
}

.goal-plan-detail > summary em {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.behavior-entry-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.behavior-checkin-form {
  display: grid;
  gap: 12px;
}

.behavior-form-section {
  display: grid;
  gap: 7px;
}

.behavior-form-section > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.behavior-choice-row,
.feeling-score-row {
  display: grid;
  gap: 8px;
}

.behavior-slot-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.behavior-tag-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feeling-score-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.behavior-choice-chip,
.feeling-score-chip {
  position: relative;
  min-width: 0;
}

.behavior-choice-chip input,
.feeling-score-chip input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.behavior-choice-chip span,
.feeling-score-chip span {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
}

.behavior-choice-chip input:checked + span {
  border-color: rgba(177, 125, 255, 0.48);
  background: rgba(177, 125, 255, 0.2);
}

.behavior-tag-positive input:checked + span {
  border-color: rgba(67, 209, 125, 0.48);
  background: rgba(67, 209, 125, 0.18);
}

.behavior-tag-negative input:checked + span {
  border-color: rgba(255, 126, 83, 0.5);
  background: rgba(255, 126, 83, 0.18);
}

.feeling-score-chip span {
  min-height: 58px;
  gap: 2px;
  padding: 7px 6px;
}

.feeling-score-chip strong,
.feeling-score-chip em {
  display: block;
  margin: 0;
  font-style: normal;
}

.feeling-score-chip strong {
  font-size: 1.05rem;
}

.feeling-score-chip em {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
}

.feeling-score-chip input:checked + span {
  border-color: rgba(88, 182, 255, 0.5);
  background: rgba(88, 182, 255, 0.16);
}

.feeling-score-1 input:checked + span,
.feeling-score-2 input:checked + span {
  border-color: rgba(255, 126, 83, 0.5);
  background: rgba(255, 126, 83, 0.18);
}

.feeling-score-4 input:checked + span,
.feeling-score-5 input:checked + span {
  border-color: rgba(67, 209, 125, 0.48);
  background: rgba(67, 209, 125, 0.18);
}

.behavior-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.behavior-checkin-form textarea,
.behavior-checkin-form input[type="date"] {
  width: 100%;
}

.behavior-checkin-dialog {
  width: min(620px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
}

.behavior-checkin-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(5px);
}

.behavior-dialog-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(19, 30, 40, 0.98), rgba(10, 16, 23, 0.98));
  box-shadow: var(--shadow);
}

.behavior-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.behavior-entry strong,
.behavior-entry p {
  display: block;
  margin: 0;
}

.behavior-entry p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.behavior-green {
  border-left-color: var(--green);
}

.behavior-rose {
  border-left-color: var(--rose);
}

.behavior-blue {
  border-left-color: var(--blue);
}

.behavior-entry-list-coach {
  margin-top: 0;
}

@media (max-width: 620px) {
  .behavior-tag-row {
    grid-template-columns: 1fr;
  }

  .feeling-score-row {
    gap: 6px;
  }

  .feeling-score-chip span {
    min-height: 52px;
    padding-inline: 3px;
  }

  .feeling-score-chip em {
    font-size: 0.58rem;
  }
}

.goal-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(3, 6, 9, 0.72);
  backdrop-filter: blur(10px);
}

.goal-detail[open] .goal-layer {
  display: grid;
}

.goal-layer-panel {
  width: min(980px, 100%);
  max-height: min(86vh, 860px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(21, 31, 41, 0.99), rgba(10, 15, 21, 0.99));
  box-shadow: var(--shadow);
}

.goal-detail-kpis,
.goal-detail-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.goal-detail-kpis div,
.goal-station-row,
.goal-target-form,
.goal-progress-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.goal-detail-kpis div {
  display: grid;
  gap: 4px;
  padding: 11px;
}

.goal-detail-kpis span,
.goal-station-header,
.goal-target-note,
.goal-detail-summary,
.goal-station-row em {
  color: var(--muted);
}

.goal-detail-kpis span,
.goal-station-header {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.goal-detail-kpis strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.goal-detail-summary,
.goal-target-note {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
}

.goal-body-composition-detail {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.goal-body-composition-trends {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.goal-target-form {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 10px;
}

.goal-target-form label {
  flex: 1 1 220px;
}

.event-model-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.event-model-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.event-model-summary span,
.event-model-summary em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1.25;
}

.event-model-summary span {
  font-weight: 900;
  text-transform: uppercase;
}

.event-model-summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-station-table {
  display: grid;
  gap: 6px;
}

.goal-station-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) minmax(90px, 0.75fr) minmax(110px, 1fr) minmax(72px, 0.65fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.goal-station-row > span {
  min-width: 0;
}

.goal-station-row strong,
.goal-station-row em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-station-row strong {
  color: var(--ink);
}

.goal-station-row em {
  margin-top: 2px;
  font-size: 0.76rem;
  font-style: normal;
}

.goal-station-row.is-missing {
  opacity: 0.68;
}

.station-signal-strength {
  border-color: rgba(67, 209, 125, 0.32);
}

.station-signal-strength > span:last-child strong {
  color: var(--green);
}

.station-signal-focus {
  border-color: rgba(255, 140, 90, 0.34);
}

.station-signal-focus > span:last-child strong {
  color: var(--orange);
}

.station-signal-partial > span:last-child strong {
  color: var(--amber);
}

.station-signal-plan > span:last-child strong {
  color: var(--blue);
}

.goal-form .form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1180px) {
  .goal-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .goal-plan-layout {
    grid-template-columns: 1fr;
  }

  .goal-plan-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .goal-plan-week-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .goals-band {
    grid-template-columns: 1fr;
  }

  .goal-week-toolbar {
    gap: 10px;
  }

  .week-switcher {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .goal-card-grid,
  .goal-form .form-grid {
    grid-template-columns: 1fr;
  }

  .goal-plan-topbar {
    align-items: flex-start;
  }

  .goal-plan-selector-head {
    display: grid;
    gap: 3px;
  }

  .goal-plan-actions {
    flex: 0 0 auto;
  }

  .goal-plan-actions .icon-button {
    width: 38px;
    height: 38px;
  }

  .goal-plan-pill-row {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .goal-plan-pill {
    flex: 0 0 156px;
    min-width: 150px;
  }

  .goal-plan-week-strip {
    grid-template-columns: 1fr 1fr;
  }

  .goal-plan-week-list {
    grid-template-columns: 1fr;
  }

  .goal-plan-day {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .goal-plan-day header {
    align-items: flex-start;
  }

  .goal-plan-day-body {
    min-width: 0;
  }

  .plan-session-edit {
    grid-template-columns: 1fr 1fr;
  }

  .plan-session-edit .small-button {
    grid-column: 1 / -1;
  }

  .plan-menu-card {
    position: fixed;
    top: 80px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 170px);
    overflow: auto;
  }

  .goal-layer {
    align-items: end;
    padding: 10px 10px calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .goal-layer-panel {
    max-height: calc(100vh - 112px);
    padding: 14px;
  }

  .goal-detail-kpis,
  .goal-detail-progress-grid,
  .event-model-summary {
    grid-template-columns: 1fr;
  }

  .goal-target-form {
    align-items: stretch;
    flex-direction: column;
  }

  .goal-station-row {
    grid-template-columns: 1fr 0.9fr;
  }

  .goal-station-header {
    display: none;
  }

  .goal-row {
    align-items: stretch;
    flex-direction: column;
  }
}

.today-signal-card {
  --signal-accent: var(--green);
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(67, 209, 125, 0.14), rgba(88, 182, 255, 0.07) 46%, rgba(255, 184, 77, 0.06)),
    linear-gradient(180deg, rgba(18, 29, 38, 0.96), rgba(10, 16, 23, 0.96));
  box-shadow: var(--shadow);
}

.today-signal-blue {
  --signal-accent: var(--blue);
}

.today-signal-amber {
  --signal-accent: var(--amber);
}

.today-signal-orange,
.today-signal-rose {
  --signal-accent: var(--orange);
}

.today-signal-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 16px;
  align-items: center;
}

.today-signal-lead > div:first-child {
  min-width: 0;
}

.today-signal-lead .overline,
.today-signal-lead h2,
.today-signal-lead p {
  margin: 0;
}

.today-signal-lead h2 {
  margin-top: 4px;
  font-size: clamp(1.28rem, 2.4vw, 2.05rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.today-signal-lead p {
  max-width: 780px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.35;
}

.today-signal-score {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  align-content: center;
  justify-self: end;
  padding: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(12, 18, 25, 0.98) 58%, transparent 60%),
    conic-gradient(var(--signal-accent) calc(var(--score) * 1%), rgba(137, 156, 175, 0.18) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 14px 30px rgba(0, 0, 0, 0.24);
}

.today-signal-score span {
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 920;
  line-height: 1;
}

.today-signal-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.today-signal-metric {
  --metric-accent: var(--green);
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 88px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.today-signal-metric.metric-blue {
  --metric-accent: var(--blue);
}

.today-signal-metric.metric-amber {
  --metric-accent: var(--amber);
}

.today-signal-metric.metric-orange,
.today-signal-metric.metric-rose {
  --metric-accent: var(--orange);
}

.today-signal-metric > span,
.today-signal-next > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.today-signal-metric strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-signal-metric em {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-signal-meter {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(137, 156, 175, 0.15);
}

.today-signal-meter i {
  display: block;
  width: min(100%, calc(var(--metric-progress) * 1%));
  height: 100%;
  border-radius: inherit;
  background: var(--metric-accent);
}

.today-signal-next {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(67, 209, 125, 0.18);
  border-radius: 8px;
  background: rgba(67, 209, 125, 0.07);
}

.today-signal-next strong {
  min-width: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.28;
}

.today-signal-next em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.today-checkin-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(177, 125, 255, 0.32);
  border-radius: 8px;
  background: rgba(177, 125, 255, 0.12);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.today-checkin-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

@media (max-width: 920px) {
  .today-signal-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .today-signal-card {
    padding: 14px;
  }

  .today-signal-lead {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 10px;
  }

  .today-signal-score {
    width: 92px;
    height: 92px;
  }

  .today-signal-score span {
    font-size: 1.66rem;
  }

  .today-signal-lead h2 {
    font-size: 1.24rem;
  }

  .today-signal-lead p {
    font-size: 0.82rem;
  }

  .today-signal-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-signal-metric {
    min-height: 78px;
    padding: 10px;
  }

  .today-signal-next {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .today-signal-next em {
    white-space: normal;
  }

  .today-checkin-button {
    width: 100%;
  }
}

/* Compact top dashboard layout */
.top-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 24px;
}

.top-dashboard-grid .summary-band,
.top-dashboard-grid .goals-band {
  min-width: 0;
  margin: 0;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 18px;
}

.top-dashboard-grid .stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.top-dashboard-grid .stat-tile {
  min-height: 112px;
  padding: 12px;
  gap: 9px;
}

.top-dashboard-grid .stat-top strong {
  font-size: 1.2rem;
}

.top-dashboard-grid .stat-tile p {
  min-height: 26px;
  font-size: 0.8rem;
}

.top-dashboard-grid .goal-card-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.top-dashboard-grid .goal-card {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(105px, auto);
  align-content: initial;
  align-items: center;
  gap: 7px 14px;
  padding: 12px 14px;
}

.top-dashboard-grid .goal-card-head,
.top-dashboard-grid .goal-card .meter {
  grid-column: 1 / -1;
}

.top-dashboard-grid .goal-card h3,
.top-dashboard-grid .goal-card p,
.top-dashboard-grid .goal-card em,
.top-dashboard-grid .goal-card small {
  min-width: 0;
}

.top-dashboard-grid .goal-card h3 {
  font-size: 0.95rem;
}

.top-dashboard-grid .goal-value {
  font-size: 1.42rem;
}

.top-dashboard-grid .goal-card p:not(.goal-value) {
  text-align: right;
}

.top-dashboard-grid .goal-card em {
  font-size: 0.88rem;
}

.top-dashboard-grid .goal-card small {
  font-size: 0.78rem;
  text-align: right;
}

@media (max-width: 1180px) {
  .top-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .top-dashboard-grid .goals-band {
    grid-template-columns: 160px minmax(0, 1fr);
  }

  .top-dashboard-grid .goal-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .top-dashboard-grid .goal-card {
    grid-template-columns: 1fr;
    min-height: 170px;
  }

  .top-dashboard-grid .goal-card p:not(.goal-value),
  .top-dashboard-grid .goal-card small {
    text-align: left;
  }
}

@media (max-width: 820px) {
  .top-dashboard-grid .stat-grid,
  .top-dashboard-grid .goal-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-dashboard-grid .goals-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .top-dashboard-grid .stat-grid,
  .top-dashboard-grid .goal-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Stacked compact dashboard override */
.top-dashboard-grid {
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.top-dashboard-grid .summary-band,
.top-dashboard-grid .goals-band {
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 18px;
}

.top-dashboard-grid .stat-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.top-dashboard-grid .stat-tile {
  min-height: 96px;
  padding: 11px 12px;
  gap: 7px;
}

.top-dashboard-grid .stat-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.top-dashboard-grid .stat-top span {
  font-size: 0.78rem;
}

.top-dashboard-grid .stat-top strong {
  font-size: 1.04rem;
}

.top-dashboard-grid .stat-tile p {
  min-height: 20px;
  font-size: 0.78rem;
}

.top-dashboard-grid .goal-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.top-dashboard-grid .goal-card {
  min-height: 146px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 12px;
}

.top-dashboard-grid .goal-card-head,
.top-dashboard-grid .goal-card .meter {
  grid-column: 1 / -1;
}

.top-dashboard-grid .goal-card-head span,
.top-dashboard-grid .goal-card-head strong {
  font-size: 0.7rem;
}

.top-dashboard-grid .goal-card h3 {
  font-size: 0.9rem;
}

.top-dashboard-grid .goal-value {
  font-size: 1.25rem;
  text-align: right;
}

.top-dashboard-grid .goal-card p:not(.goal-value),
.top-dashboard-grid .goal-card em,
.top-dashboard-grid .goal-card small {
  font-size: 0.76rem;
  line-height: 1.25;
}

.top-dashboard-grid .goal-card p:not(.goal-value),
.top-dashboard-grid .goal-card small {
  text-align: right;
}

.top-dashboard-grid .goal-card em {
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .top-dashboard-grid .summary-band,
  .top-dashboard-grid .goals-band {
    grid-template-columns: 1fr;
  }

  .top-dashboard-grid .stat-grid,
  .top-dashboard-grid .goal-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .top-dashboard-grid .stat-grid,
  .top-dashboard-grid .goal-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-dashboard-grid .goal-card {
    grid-template-columns: 1fr;
  }

  .top-dashboard-grid .goal-value,
  .top-dashboard-grid .goal-card p:not(.goal-value),
  .top-dashboard-grid .goal-card small {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .top-dashboard-grid .stat-grid,
  .top-dashboard-grid .goal-card-grid {
    grid-template-columns: 1fr;
  }

  .top-dashboard-grid .goal-card em {
    white-space: normal;
  }
}

/* Fix goal cards after compact stacked layout */
.top-dashboard-grid .goal-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.top-dashboard-grid .goal-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 156px;
  gap: 8px;
  padding: 12px 14px;
}

.top-dashboard-grid .goal-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.top-dashboard-grid .goal-card h3,
.top-dashboard-grid .goal-card p,
.top-dashboard-grid .goal-card em,
.top-dashboard-grid .goal-card small,
.top-dashboard-grid .goal-value {
  overflow-wrap: normal;
  word-break: normal;
  text-align: left;
}

.top-dashboard-grid .goal-card h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.15;
}

.top-dashboard-grid .goal-value {
  margin-top: 2px;
  font-size: 1.45rem;
  line-height: 1;
}

.top-dashboard-grid .goal-card p:not(.goal-value),
.top-dashboard-grid .goal-card em,
.top-dashboard-grid .goal-card small {
  font-size: 0.8rem;
  line-height: 1.28;
}

.top-dashboard-grid .goal-card .meter {
  width: 100%;
  flex: 0 0 auto;
}

.top-dashboard-grid .goal-card em {
  white-space: normal;
}

.top-dashboard-grid .goal-card small {
  margin-top: auto;
}

@media (max-width: 820px) {
  .top-dashboard-grid .goal-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .top-dashboard-grid .goal-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Workout annotations */
.activity-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.activity-event-stations {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.linked-event-stations,
.event-station-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.event-station-suggestions > span {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.event-station-chip {
  position: relative;
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 34px;
  padding: 4px 4px 4px 10px;
  border: 1px solid rgba(85, 211, 135, 0.26);
  border-radius: 8px;
  background: rgba(85, 211, 135, 0.08);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.event-station-chip.is-dragging {
  position: fixed;
  top: -9999px;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.station-chip-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.96;
  transform: translate3d(-9999px, -9999px, 0);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

.event-station-chip.is-drag-target {
  outline: 2px solid rgba(85, 211, 135, 0.65);
  outline-offset: 2px;
}

.station-chip-placeholder {
  display: inline-block;
  width: 150px;
  min-height: 34px;
  border: 1px dashed rgba(85, 211, 135, 0.68);
  border-radius: 8px;
  background: rgba(85, 211, 135, 0.13);
  vertical-align: middle;
}

.event-station-chip:active {
  cursor: grabbing;
}

.event-station-chip > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.event-station-chip > span strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.event-station-chip > span em {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-station-chip form,
.event-station-suggestions form {
  margin: 0;
}

.station-chip-actions {
  position: relative;
}

.station-chip-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 35;
  display: grid;
  min-width: 118px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-raised, var(--surface));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.46);
  opacity: 1;
}

.station-chip-menu button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 8px 10px;
  text-align: left;
}

.station-chip-menu button:hover {
  background: var(--surface-soft);
}

.station-chip-edit-form {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: grid;
  gap: 8px;
  width: min(92vw, 620px);
  padding: 12px;
  border: 1px solid rgba(85, 211, 135, 0.42);
  border-radius: 8px;
  background: var(--surface-raised, var(--surface));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  opacity: 1;
}

.station-chip-edit-form.is-right-aligned {
  right: 0;
  left: auto;
}

.station-chip-edit-form[hidden],
.station-chip-menu[hidden] {
  display: none;
}

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

.station-chip-edit-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.station-chip-edit-form input,
.station-chip-edit-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  padding: 8px;
}

.station-chip-edit-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-edit {
  margin-top: 10px;
}

.activity-edit > summary {
  width: max-content;
  list-style: none;
}

.activity-edit > summary::-webkit-details-marker {
  display: none;
}

.activity-edit-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.activity-station-add-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(85, 211, 135, 0.22);
  border-radius: 8px;
  background: rgba(85, 211, 135, 0.065);
}

[data-station-panel][hidden] {
  display: none !important;
}

.activity-station-add-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.activity-station-add-head strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.activity-station-add-head span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-edit-form .form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.activity-station-add-form .form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.activity-station-add-form .form-grid .wide {
  grid-column: span 2;
}

.activity-edit-form textarea {
  min-height: 68px;
}

.activity-station-add-form textarea {
  min-height: 58px;
}

.activity-edit-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.activity-edit-status {
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 900px) {
  .activity-edit-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-station-add-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .activity-edit-form .form-grid {
    grid-template-columns: 1fr;
  }

  .activity-station-add-head {
    display: grid;
    gap: 3px;
  }

  .activity-station-add-head span {
    text-align: left;
    white-space: normal;
  }

  .activity-station-add-form .form-grid {
    grid-template-columns: 1fr;
  }

  .activity-station-add-form .form-grid .wide {
    grid-column: auto;
  }
}

/* Four-column goal cards on wide dashboards */
.top-dashboard-grid .goal-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.top-dashboard-grid .goal-card {
  min-height: 142px;
  padding: 11px 12px;
  gap: 7px;
}

.top-dashboard-grid .goal-card h3 {
  font-size: 0.92rem;
}

.top-dashboard-grid .goal-value {
  font-size: 1.3rem;
}

.top-dashboard-grid .goal-card-head span,
.top-dashboard-grid .goal-card-head strong,
.top-dashboard-grid .goal-card p:not(.goal-value),
.top-dashboard-grid .goal-card em,
.top-dashboard-grid .goal-card small {
  font-size: 0.74rem;
}

@media (max-width: 1280px) {
  .top-dashboard-grid .goal-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .top-dashboard-grid .goal-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .top-dashboard-grid .goal-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Split run goals into target outcome and training support */
.goal-split-progress {
  display: grid;
  gap: 7px;
}

.goal-progress-panel {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 7px;
  background: rgba(8, 13, 19, 0.44);
}

.goal-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.goal-progress-head span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.goal-progress-head strong {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.05;
  text-align: right;
}

.goal-progress-panel p,
.goal-progress-panel em {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.22;
}

.goal-progress-panel .meter {
  height: 5px;
}

.top-dashboard-grid .goal-split-progress {
  gap: 6px;
}

.top-dashboard-grid .goal-progress-panel {
  padding: 7px;
}

.top-dashboard-grid .goal-progress-head span,
.top-dashboard-grid .goal-progress-panel p,
.top-dashboard-grid .goal-progress-panel em {
  font-size: 0.68rem;
}

.top-dashboard-grid .goal-progress-head strong {
  font-size: 0.88rem;
}

@media (max-width: 560px) {
  .goal-split-progress {
    grid-template-columns: 1fr;
  }
}

/* Compact run-source control inside Profile */
.data-source-card,
.weather-location-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.data-source-card h3,
.weather-location-card h3 {
  margin-bottom: 6px;
}

.weather-location-card {
  flex-wrap: wrap;
}

.weather-location-card .weather-status {
  flex: 1 1 100%;
  min-height: 1.2em;
  margin: 0;
}

.compact-line {
  margin-top: 6px;
  font-size: 0.82rem;
}

.source-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.source-actions form {
  display: contents;
}

.android-download-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.android-download-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 760px) {
  .data-source-card,
  .weather-location-card {
    align-items: stretch;
    flex-direction: column;
  }

  .source-actions {
    justify-content: stretch;
  }

  .source-actions .small-button,
  .source-actions form {
    flex: 1 1 auto;
  }

  .training-planner-head,
  .training-library-grid {
    grid-template-columns: 1fr;
  }

  .training-planner-head {
    align-items: stretch;
  }

  .training-planner-actions,
  .training-planner-actions .small-button {
    width: 100%;
  }

  .training-week-grid {
    grid-template-columns: 1fr;
  }

  .training-edit-grid {
    grid-template-columns: 1fr;
  }

  .planner-day-checkboxes,
  .planner-item-grid,
  .planner-item-grid.compact,
  .planner-item-actual-grid {
    grid-template-columns: 1fr 1fr;
  }

  .planner-feedback-rating-grid,
  .planner-feedback-reason-grid,
  .planner-feedback-meta {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .training-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .training-library-grid {
    grid-template-columns: 1fr;
  }
}

/* Macro snapshot and compact goal charts */
.macro-bar-list {
  display: grid;
  gap: 5px;
}

.macro-progress {
  display: grid;
  gap: 3px;
}

.macro-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.1;
}

.macro-progress-head span {
  font-weight: 850;
}

.macro-progress-head em {
  font-style: normal;
  white-space: nowrap;
}

.macro-progress .meter {
  height: 5px;
}

.macro-green .meter span { background: linear-gradient(90deg, rgba(67, 209, 125, 0.72), var(--green)); }
.macro-blue .meter span { background: linear-gradient(90deg, rgba(88, 182, 255, 0.68), var(--blue)); }
.macro-orange .meter span { background: linear-gradient(90deg, rgba(255, 140, 90, 0.68), var(--orange)); }

.micro-summary {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.micro-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.micro-summary-head strong {
  color: var(--ink);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.micro-summary-head span {
  color: var(--muted);
  font-size: 0.62rem;
  text-align: right;
}

.micro-list {
  display: grid;
  gap: 5px;
}

.micro-row {
  display: grid;
  gap: 3px;
}

.micro-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.1;
}

.micro-row span {
  color: var(--ink);
  font-weight: 850;
}

.micro-row em {
  font-style: normal;
  white-space: nowrap;
}

.micro-unknown span,
.micro-unknown em {
  color: rgba(171, 181, 190, 0.82);
}

.micro-row .meter {
  height: 4px;
}

.micro-unknown .meter span { background: rgba(171, 181, 190, 0.35); }
.micro-low .meter span { background: linear-gradient(90deg, rgba(255, 91, 108, 0.65), var(--rose)); }
.micro-watch .meter span { background: linear-gradient(90deg, rgba(255, 198, 88, 0.68), var(--amber)); }
.micro-ok .meter span { background: linear-gradient(90deg, rgba(67, 209, 125, 0.72), var(--green)); }

.micro-watch-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.micro-watch-list span {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 198, 88, 0.12);
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
}

.vital-list {
  display: grid;
  gap: 5px;
}

.vital-list div {
  display: grid;
  grid-template-columns: minmax(34px, 0.55fr) minmax(56px, 0.9fr) minmax(42px, 0.7fr);
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.vital-list span,
.vital-list em {
  color: var(--muted);
  font-size: 0.66rem;
  font-style: normal;
  line-height: 1.1;
}

.vital-list span {
  font-weight: 850;
}

.vital-list strong {
  color: var(--ink);
  font-size: 0.76rem;
  line-height: 1.1;
  white-space: nowrap;
}

.vital-list-inline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vital-list-inline div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.vital-list-inline em {
  width: max-content;
}

.vital-list .vital-watch em,
.vital-list .vital-warn em,
.vital-list .vital-alert em {
  justify-self: start;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.vital-list .vital-watch em {
  background: rgba(88, 182, 255, 0.13);
  color: var(--blue);
}

.vital-list .vital-warn em {
  background: rgba(255, 192, 95, 0.15);
  color: var(--amber);
}

.vital-list .vital-alert em {
  background: rgba(255, 111, 97, 0.16);
  color: var(--rose);
}

.vital-warning-list {
  display: grid;
  gap: 3px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.vital-warning-list li {
  color: var(--amber);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-state-alert .vital-warning-list li {
  color: var(--rose);
}

.goal-pie-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.goal-pie {
  width: 52px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--progress) * 1%), rgba(255, 255, 255, 0.09) 0);
  position: relative;
}

.goal-pie::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: rgba(13, 20, 27, 0.96);
}

.goal-pie span {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.goal-pie-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.goal-pie-copy strong,
.goal-pie-copy em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1.2;
}

.goal-line-chart {
  display: grid;
  gap: 4px;
}

.goal-line-chart svg {
  width: 100%;
  height: 54px;
  overflow: visible;
}

.goal-line-chart polyline {
  fill: none;
  stroke: var(--rose);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.goal-line-chart circle {
  fill: var(--ink);
  stroke: var(--rose);
  stroke-width: 1.5;
}

.chart-point-label {
  fill: #f8fffb;
  font-size: 7px;
  font-weight: 900;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(5, 9, 13, 0.96);
  stroke-linejoin: round;
  stroke-width: 3.2px;
  text-anchor: middle;
}

.chart-value-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(44px, 1fr);
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  padding: 1px 0 2px;
  scrollbar-width: none;
}

.chart-value-strip::-webkit-scrollbar {
  display: none;
}

.chart-value-strip span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 4px 5px;
  border: 1px solid rgba(137, 156, 175, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.chart-value-strip em,
.chart-value-strip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-value-strip em {
  color: var(--muted);
  font-size: 0.56rem;
  font-style: normal;
  line-height: 1;
}

.chart-value-strip strong {
  color: var(--ink);
  font-size: 0.62rem;
  line-height: 1.05;
}

.goal-target-line {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.6;
}

.goal-chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.1;
}

.goal-chart-labels em {
  font-style: normal;
}

.top-dashboard-grid .macro-progress-head,
.top-dashboard-grid .goal-pie-copy strong,
.top-dashboard-grid .goal-pie-copy em,
.top-dashboard-grid .goal-chart-labels {
  font-size: 0.66rem;
}

.top-dashboard-grid .goal-pie {
  width: 48px;
}


.event-station-box {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(137, 156, 175, 0.22);
  border-radius: 8px;
  background: rgba(10, 17, 24, 0.52);
}

.goal-action-panel.event-station-box {
  margin-top: 12px;
  padding: 14px;
  background: var(--surface);
}

.event-station-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.goal-action-panel-head.event-station-head {
  margin-bottom: 0;
}

.event-station-head strong {
  color: var(--text);
}

.event-station-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.station-test-form .form-grid {
  grid-template-columns: minmax(190px, 2fr) repeat(4, minmax(90px, 1fr));
}

.event-station-results {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.event-station-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.82rem;
}

.event-station-result strong {
  color: var(--text);
}

.event-station-result em {
  font-style: normal;
  color: var(--faint);
}

.station-grid-mini {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
  align-items: center;
}

.station-dot {
  min-width: 0;
  height: 9px;
  border-radius: 999px;
  background: rgba(137, 156, 175, 0.2);
  border: 1px solid rgba(137, 156, 175, 0.22);
}

.station-dot.is-logged {
  background: var(--green);
  border-color: rgba(85, 211, 135, 0.72);
  box-shadow: 0 0 14px rgba(85, 211, 135, 0.22);
}

.station-dot.station-erg.is-logged { background: var(--blue); border-color: rgba(86, 166, 255, 0.72); }
.station-dot.station-strength.is-logged { background: var(--orange); border-color: rgba(255, 178, 89, 0.74); }
.station-dot.station-run.is-logged { background: var(--green); border-color: rgba(85, 211, 135, 0.72); }
.station-dot.station-carry.is-logged,
.station-dot.station-lunge.is-logged,
.station-dot.station-bodyweight.is-logged { background: var(--purple); border-color: rgba(187, 134, 252, 0.7); }
.station-dot.station-skill.is-logged { background: var(--blue); border-color: rgba(86, 166, 255, 0.72); }

.event-goal-foot {
  display: grid;
  gap: 3px;
  font-size: 0.78rem;
}

.event-goal-foot strong {
  color: var(--text);
}

.event-goal-foot em {
  font-style: normal;
  color: var(--muted);
}

@media (max-width: 820px) {
  .station-test-form .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .event-station-result {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}


.goal-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.goal-format-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.goal-format-form select {
  min-height: 34px;
  width: 86px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
}

@media (max-width: 760px) {
  .desktop-only {
    display: none !important;
  }

  .profile-section-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-section-tab {
    justify-content: flex-start;
  }

  .goal-manager-head {
    align-items: center;
  }

  .goal-manager-head p {
    display: none;
  }

  .goal-manager-actions {
    gap: 6px;
  }

  .goal-action-panel {
    padding: 12px;
  }

  .goal-plan-wizard-panel {
    margin-right: -2px;
    margin-left: -2px;
  }

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

  .wizard-step-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .wizard-step-head span {
    text-align: left;
  }

  .wizard-goal-card {
    grid-template-columns: 44px minmax(0, 1fr);
    min-height: 76px;
    padding: 12px;
  }

  .wizard-goal-icon {
    width: 40px;
    height: 40px;
  }

  .wizard-goal-card b {
    grid-column: 2;
    justify-self: start;
  }

  .wizard-card-grid,
  .wizard-card-grid-two,
  .wizard-card-grid-four,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .wizard-choice {
    min-height: 68px;
  }

  .wizard-actions {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .wizard-actions [data-wizard-hint] {
    width: 100%;
    margin-right: 0;
  }

  .wizard-actions .button,
  .wizard-actions .small-button {
    flex: 1 1 0;
  }

  .goal-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .goal-row-main {
    min-width: 0;
  }

  .goal-row-actions {
    width: auto;
    align-self: start;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .goal-row-actions form {
    margin: 0;
  }

  .goal-row-actions .small-button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .goal-row-actions .inline-edit-panel {
    width: auto;
  }

  .schedule-edit-row,
  .schedule-edit-form,
  .schedule-edit-grid {
    grid-template-columns: 1fr;
  }

  .schedule-delete-form,
  .schedule-edit-form .small-button,
  .schedule-delete-form .small-button {
    width: 100%;
  }

  .goal-format-form {
    width: 100%;
  }

  .goal-edit-form {
    width: 100%;
  }

  .goal-edit-form {
    width: 100%;
  }

  .goal-edit-form .form-grid {
    grid-template-columns: 1fr;
  }

  .station-test-form .form-grid {
    grid-template-columns: 1fr;
  }

  .goal-format-form select {
    flex: 1;
  }
}

/* Intelligence dashboard */
.intelligence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.intel-card {
  min-width: 0;
  min-height: 190px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(22, 33, 43, 0.96), rgba(13, 20, 27, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.intel-call {
  grid-column: span 2;
  background:
    linear-gradient(135deg, rgba(67, 209, 125, 0.13), transparent 42%),
    linear-gradient(180deg, rgba(22, 33, 43, 0.98), rgba(13, 20, 27, 0.98));
}

.intel-green {
  border-color: rgba(67, 209, 125, 0.34);
}

.intel-blue {
  border-color: rgba(88, 182, 255, 0.32);
}

.intel-amber {
  border-color: rgba(255, 195, 92, 0.32);
}

.intel-orange,
.intel-rose {
  border-color: rgba(255, 126, 83, 0.36);
}

.intel-score-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.intel-score-ring {
  width: 72px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #121a22 0 58%, transparent 60%),
    conic-gradient(var(--green) calc(var(--score, 0) * 1%), rgba(255, 255, 255, 0.1) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.intel-score-ring span,
.intel-big-value {
  color: var(--ink);
  font-weight: 950;
}

.intel-score-ring span {
  font-size: 1.35rem;
}

.intel-big-value {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1;
}

.intel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.intel-head span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.intel-head strong {
  color: var(--ink);
  font-size: 0.95rem;
  text-align: right;
}

.intel-card p,
.intel-card li,
.intel-card em,
.intel-mini-list span,
.intel-mini-list em,
.memory-list span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.intel-card p,
.intel-card ul {
  margin: 0;
}

.intel-card ul {
  display: grid;
  gap: 5px;
  padding-left: 18px;
}

.intel-card em {
  font-style: normal;
}

.intel-green {
  border-color: rgba(67, 209, 125, 0.32);
}

.intel-blue {
  border-color: rgba(88, 182, 255, 0.32);
}

.intel-orange {
  border-color: rgba(255, 178, 89, 0.34);
}

.intel-mini-list,
.memory-list {
  display: grid;
  gap: 8px;
}

.intel-mini-list div,
.memory-list div,
.quality-grid div {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.intel-mini-list strong,
.quality-grid strong {
  color: var(--ink);
  font-size: 0.86rem;
}

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

.quality-grid span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.memory-list p {
  margin: 0;
}

@media (max-width: 1180px) {
  .intelligence-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .intelligence-grid,
  .quality-grid {
    grid-template-columns: 1fr;
  }

  .intel-call {
    grid-column: auto;
  }

  .intel-card {
    min-height: 0;
  }
}

/* Full-width snapshot and goal section headers */
.top-dashboard-grid .summary-band,
.top-dashboard-grid .goals-band {
  grid-template-columns: 1fr;
  gap: 12px;
}

.top-dashboard-grid .summary-band > div:first-child,
.top-dashboard-grid .section-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}

.top-dashboard-grid .summary-band > div:first-child .overline,
.top-dashboard-grid .section-heading .overline {
  margin: 0;
}

.top-dashboard-grid .summary-band > div:first-child h2,
.top-dashboard-grid .section-heading h2 {
  margin: 0;
  font-size: clamp(1.05rem, 1.2vw, 1.35rem);
  line-height: 1.1;
}

@media (min-width: 1181px) {
  .top-dashboard-grid .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}

.top-dashboard-grid .stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: stretch;
}

.stat-has-visual {
  min-height: 184px;
  align-content: stretch;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.top-dashboard-grid .stat-has-visual {
  min-height: 184px;
}

.stat-ring-visual,
.stat-signal-visual,
.stat-stress-visual,
.stat-healthspan-visual,
.stat-burn-visual,
.stat-sleep-visual,
.stat-vitals-visual,
.stat-body-chart {
  align-self: stretch;
  min-width: 0;
}

.stat-ring-visual {
  display: grid;
  grid-template-columns: minmax(118px, 0.95fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.stat-ring,
.sleep-gauge {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(14, 21, 29, 0.98) 0 57%, transparent 59%),
    conic-gradient(var(--green) calc(var(--progress, 0) * 1%), rgba(255, 255, 255, 0.09) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 22px rgba(67, 209, 125, 0.11);
}

.stat-ring {
  width: min(136px, 100%);
  background:
    radial-gradient(circle at center, rgba(14, 21, 29, 0.98) 0 47%, transparent 49%),
    conic-gradient(var(--green) calc(var(--progress, 0) * 1%), rgba(255, 255, 255, 0.09) 0);
}

.stat-ring span {
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 900;
  line-height: 1;
}

.sleep-gauge span {
  color: var(--muted);
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.stat-chart-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.stat-chart-copy strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.2;
}

.stat-chart-copy em,
.stat-chart-copy small,
.stat-burn-visual em,
.stat-chart-labels em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1.25;
}

.stat-chart-copy small {
  display: block;
  margin-top: 2px;
  color: rgba(248, 255, 251, 0.78);
  font-weight: 800;
}

.stat-signal-visual {
  display: grid;
  gap: 8px;
  align-content: end;
}

.stat-stress-visual {
  display: grid;
  gap: 8px;
  align-content: end;
}

.stat-healthspan-visual {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
}

.healthspan-ring {
  width: 104px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(14, 21, 29, 0.98) 0 52%, transparent 54%),
    conic-gradient(var(--green) calc(var(--score, 0) * 1%), rgba(255, 255, 255, 0.09) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 22px rgba(67, 209, 125, 0.11);
}

.healthspan-ring span {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 950;
}

.healthspan-driver-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.healthspan-driver-list span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.healthspan-driver-list .driver-positive {
  border-color: rgba(67, 209, 125, 0.26);
  color: var(--green);
}

.healthspan-driver-list .driver-negative {
  border-color: rgba(255, 109, 143, 0.28);
  color: var(--rose);
}

.healthspan-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  line-height: 1.25;
}

.healthspan-intel-ring {
  background:
    radial-gradient(circle at center, #121a22 0 58%, transparent 60%),
    conic-gradient(var(--blue) calc(var(--score, 0) * 1%), rgba(255, 255, 255, 0.1) 0);
}

.signal-range {
  position: relative;
  height: 12px;
  overflow: visible;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      #f2c84d 0 49%,
      rgba(88, 182, 255, 0.72) 49% 79%,
      rgba(67, 209, 125, 0.82) 79% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.stress-range {
  position: relative;
  height: 14px;
  overflow: visible;
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      rgba(67, 209, 125, 0.82) 0 35%,
      rgba(88, 182, 255, 0.74) 35% 55%,
      rgba(241, 183, 74, 0.86) 55% 75%,
      rgba(255, 140, 90, 0.9) 75% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.stress-marker {
  position: absolute;
  left: calc(var(--stress-score, 0) * 1%);
  top: 50%;
  width: 7px;
  height: 27px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.38);
  transform: translate(-50%, -50%);
}

.signal-marker {
  position: absolute;
  left: calc(var(--score, 0) * 1%);
  top: 50%;
  width: 5px;
  height: 25px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.38);
  transform: translate(-50%, -50%);
}

.signal-labels,
.stress-labels,
.stat-mini-pair,
.sleep-stage-labels,
.stat-chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.2;
}

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

.stress-driver-list span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.stress-driver-list .driver-positive {
  border-color: rgba(67, 209, 125, 0.26);
  color: var(--green);
}

.stress-driver-list .driver-negative {
  border-color: rgba(255, 140, 90, 0.32);
  color: var(--orange);
}

.stat-burn-visual,
.stat-sleep-visual {
  display: grid;
  gap: 8px;
  align-content: end;
}

.burn-stack,
.sleep-stage-bar {
  display: flex;
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.burn-stack span,
.sleep-stage-bar span {
  display: block;
  min-width: 2px;
  height: 100%;
}

.burn-resting { background: rgba(241, 183, 74, 0.82); }
.burn-active { background: rgba(255, 140, 90, 0.88); }

.stat-mini-pair span,
.sleep-stage-labels span,
.stat-chart-labels span {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sleep-gauge {
  width: 74px;
  background:
    radial-gradient(circle at center, rgba(14, 21, 29, 0.98) 0 58%, transparent 60%),
    conic-gradient(var(--blue) calc(var(--progress, 0) * 1%), rgba(255, 255, 255, 0.09) 0);
}

.stat-sleep-visual {
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
}

.stat-sleep-visual .sleep-stage-bar,
.stat-sleep-visual .sleep-stage-labels {
  grid-column: 2;
}

.sleep-deep { background: #6c63ff; }
.sleep-rem { background: #58b6ff; }
.sleep-light { background: #43d17d; }
.sleep-awake { background: #f1b74a; }

.stat-sleep-visual {
  grid-template-columns: 1fr;
  align-content: stretch;
}

.stat-sleep-visual .sleep-stage-labels {
  grid-column: auto;
}

.sleep-timeline-preview {
  display: grid;
  gap: 5px;
  width: 100%;
  max-width: none;
  justify-self: stretch;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.sleep-mini-hypnogram,
.sleep-hypnogram-large {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, transparent 23%, rgba(255, 255, 255, 0.06) 23% 24%, transparent 24% 47%, rgba(255, 255, 255, 0.06) 47% 48%, transparent 48% 71%, rgba(255, 255, 255, 0.06) 71% 72%, transparent 72%),
    var(--surface-soft);
}

.sleep-mini-hypnogram {
  height: 58px;
  width: 100%;
  box-sizing: border-box;
}

.sleep-hypnogram-large {
  height: 176px;
}

.sleep-mini-hypnogram i,
.sleep-hypnogram-large i {
  position: absolute;
  height: 16px;
  min-width: 3px;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.18);
}

.sleep-hypnogram-large i {
  height: 24px;
}

.sleep-mini-hypnogram .sleep-deep,
.sleep-hypnogram-large .sleep-deep { background: linear-gradient(180deg, #9a7cff, #6c63ff); }
.sleep-mini-hypnogram .sleep-rem,
.sleep-hypnogram-large .sleep-rem { background: linear-gradient(180deg, #bcefff, #58b6ff); }
.sleep-mini-hypnogram .sleep-light,
.sleep-hypnogram-large .sleep-light { background: linear-gradient(180deg, #78ddff, #67a4ff); }
.sleep-mini-hypnogram .sleep-awake,
.sleep-hypnogram-large .sleep-awake { background: linear-gradient(180deg, #ff91b8, #f1b74a); }

.sleep-hypnogram-large i span {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  display: none;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(5, 9, 13, 0.82);
  color: #f8fffb;
  font-size: 0.58rem;
  font-weight: 900;
  white-space: nowrap;
}

.sleep-hypnogram-large i:hover span {
  display: block;
}

.sleep-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.sleep-axis em {
  font-style: normal;
}

.sleep-stage-chips {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 5px;
}

.sleep-stage-chips span,
.sleep-stage-breakdown span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-weight: 900;
}

.sleep-stage-chips span {
  padding: 4px 7px;
  font-size: 0.66rem;
}

.sleep-chip-deep { color: #a997ff; }
.sleep-chip-rem { color: #8fd7ff; }
.sleep-chip-light { color: #8ab8ff; }
.sleep-chip-awake { color: #f1b74a; }

.sleep-card-copy {
  display: grid;
  gap: 2px;
}

.sleep-card-copy strong {
  font-size: 0.78rem;
}

.sleep-card-copy em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  line-height: 1.25;
}

.sleep-detail-layer[hidden] {
  display: none;
}

.sleep-detail-layer {
  position: fixed;
  inset: 0;
  z-index: 260;
}

.sleep-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 9, 0.74);
  backdrop-filter: blur(7px);
}

.sleep-detail-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(940px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 34px));
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background:
    radial-gradient(circle at 15% 0%, rgba(88, 182, 255, 0.18), transparent 32%),
    linear-gradient(180deg, rgba(21, 31, 41, 0.98), rgba(10, 16, 22, 0.98));
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.52);
  transform: translate(-50%, -50%);
}

.sleep-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.sleep-detail-head h3 {
  margin: 0;
  font-size: 1.45rem;
}

.sleep-detail-head p:not(.overline),
.sleep-architecture-note {
  margin: 4px 0 0;
  color: var(--muted);
}

.sleep-detail-summary,
.sleep-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sleep-detail-summary div,
.sleep-quality-grid div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.sleep-detail-summary span,
.sleep-quality-grid span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sleep-detail-summary strong,
.sleep-quality-grid strong {
  color: var(--ink);
  font-size: 1rem;
}

.sleep-detail-summary em,
.sleep-quality-grid em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
}

.sleep-quality-ok { border-color: rgba(67, 209, 125, 0.28) !important; }
.sleep-quality-watch { border-color: rgba(241, 183, 74, 0.34) !important; }
.sleep-quality-alert { border-color: rgba(255, 120, 120, 0.36) !important; }

.sleep-detail-chart {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.sleep-detail-stage-labels {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  align-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.sleep-detail-chart .sleep-axis {
  grid-column: 2;
}

.sleep-stage-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sleep-stage-breakdown span {
  display: inline-grid;
  gap: 1px;
  padding: 7px 10px;
}

.sleep-stage-breakdown strong,
.sleep-stage-breakdown em {
  font-size: 0.7rem;
  font-style: normal;
}

body.sleep-detail-open {
  overflow: hidden;
}

.stat-visual-sleep .stat-sleep-visual {
  width: 100%;
  justify-items: stretch;
  align-items: stretch;
}

.stat-visual-sleep .sleep-timeline-preview {
  display: block;
  width: 100%;
}

.stat-visual-sleep .sleep-mini-hypnogram {
  height: 74px;
}

.stat-visual-sleep .sleep-axis {
  margin-top: 5px;
  padding: 0 2px;
}

.sleep-panel {
  display: none;
}

.sleep-timeline-preview {
  text-decoration: none;
}

.sleep-tab-hero,
.sleep-tab-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(21, 31, 41, 0.94), rgba(12, 18, 25, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.032);
}

.sleep-tab-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
  gap: 14px;
  align-items: stretch;
  padding: 16px;
  overflow: hidden;
}

.sleep-tab-copy {
  display: grid;
  gap: 6px;
  align-content: center;
}

.sleep-tab-copy h2,
.sleep-tab-card h3 {
  margin: 0;
}

.sleep-tab-copy p:not(.overline) {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
}

.sleep-tab-score {
  display: grid;
  gap: 3px;
  align-content: center;
  justify-items: end;
  padding: 14px;
  border: 1px solid rgba(88, 182, 255, 0.22);
  border-radius: 9px;
  background: rgba(88, 182, 255, 0.08);
  text-align: right;
}

.sleep-tab-score strong {
  color: var(--ink);
  font-size: clamp(1.55rem, 2.2vw, 2.35rem);
  line-height: 1;
}

.sleep-tab-score span,
.sleep-tab-score em,
.sleep-tab-card-head span,
.sleep-tab-card > em,
.sleep-night-row span,
.sleep-night-row small {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
}

.sleep-tab-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sleep-metric,
.sleep-vital {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.sleep-metric span,
.sleep-vital span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sleep-metric strong,
.sleep-vital strong {
  color: var(--ink);
  font-size: 1rem;
}

.sleep-metric em,
.sleep-vital em {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.sleep-tab-layout,
.sleep-lower-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.sleep-tab-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sleep-lower-grid {
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  align-items: start;
}

.sleep-tab-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  padding: 14px;
}

.sleep-tab-card-wide {
  grid-column: 1 / -1;
}

.sleep-tab-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.sleep-tab-card-head h3 {
  font-size: 1.05rem;
}

.sleep-tab-detail-chart .sleep-hypnogram-large {
  min-height: 188px;
}

.sleep-tab-summary,
.sleep-tab-quality {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sleep-tab-line-chart svg {
  min-height: 84px;
  overflow: visible;
}

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

.sleep-metric-green,
.sleep-vital-green { border-color: rgba(67, 209, 125, 0.25); }
.sleep-metric-blue,
.sleep-vital-blue { border-color: rgba(88, 182, 255, 0.25); }
.sleep-metric-purple,
.sleep-vital-purple { border-color: rgba(154, 124, 255, 0.25); }
.sleep-metric-amber,
.sleep-vital-amber { border-color: rgba(241, 183, 74, 0.3); }
.sleep-metric-orange,
.sleep-vital-orange { border-color: rgba(255, 140, 90, 0.3); }
.sleep-metric-rose,
.sleep-vital-rose { border-color: rgba(255, 120, 120, 0.3); }

.sleep-guidance-list,
.sleep-night-list {
  display: grid;
  gap: 8px;
}

.sleep-guidance-list p,
.sleep-night-row {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.sleep-night-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: start;
}

.sleep-night-row > div {
  min-width: 0;
}

.sleep-night-row strong,
.sleep-night-row em {
  display: block;
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
}

.sleep-night-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sleep-night-row small {
  display: block;
  text-align: right;
}

.sleep-night-chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sleep-night-chips span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.64rem;
  font-weight: 900;
}

.stat-vitals-visual {
  display: grid;
  gap: 6px;
}

.stat-vitals-visual svg {
  width: 100%;
  min-height: 66px;
  overflow: visible;
}

.vitals-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vitals-line-rhr {
  stroke: var(--amber);
}

.vitals-line-hrv {
  stroke: var(--blue);
}

.vitals-dot {
  fill: rgba(18, 28, 38, 1);
  stroke-width: 2.3;
}

.vitals-dot-rhr {
  stroke: var(--amber);
}

.vitals-dot-hrv {
  stroke: var(--blue);
}

.vitals-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.vitals-legend span {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.vitals-legend strong {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

.vitals-legend em {
  color: var(--ink);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.vitals-legend small {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 800;
}

.vitals-legend-rhr {
  border-color: rgba(242, 200, 77, 0.24);
}

.vitals-legend-hrv {
  border-color: rgba(88, 182, 255, 0.24);
}

.stat-body-chart {
  display: grid;
  gap: 5px;
}

.stat-body-composition {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.stat-body-composition div {
  padding: 6px;
}

.stat-body-composition span {
  font-size: 0.54rem;
}

.stat-body-composition strong {
  font-size: 0.74rem;
}

.stat-body-chart svg {
  width: 100%;
  min-height: 70px;
  overflow: visible;
}

.stat-body-chart polyline {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-body-chart circle {
  fill: rgba(18, 28, 38, 1);
  stroke: var(--green);
  stroke-width: 2.6;
}

.stat-body-chart .stat-point-label {
  font-size: 4.1px;
  stroke-width: 1.9px;
}

.stat-target-line {
  stroke: rgba(255, 255, 255, 0.34);
  stroke-dasharray: 4 4;
}

.stat-chart-labels {
  align-items: center;
}

@media (max-width: 560px) {
  .top-dashboard-grid .stat-grid {
    grid-template-columns: 1fr;
  }

  .top-dashboard-grid .stat-has-visual {
    min-height: 166px;
  }

  .stat-ring-visual {
    grid-template-columns: 128px minmax(0, 1fr);
  }

  .stat-ring {
    width: 128px;
  }

  .body-composition-grid,
  .goal-body-composition-mini,
  .goal-body-composition-detail,
  .stat-body-composition {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Primary dashboard tabs */
.tabbed-dashboard {
  grid-template-columns: repeat(6, max-content) 1fr;
}

#tab-overview:checked + .tab-label,
#tab-goals:checked + .tab-label,
#tab-feed:checked + .tab-label,
#tab-trends:checked + .tab-label,
#tab-sleep:checked + .tab-label,
#tab-reports:checked + .tab-label,
#tab-circle:checked + .tab-label,
#tab-coach:checked + .tab-label {
  background: #152d25;
  border-color: rgba(67, 209, 125, 0.38);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#tab-overview:checked ~ .overview-panel,
#tab-goals:checked ~ .overview-panel,
#tab-feed:checked ~ .feed-panel,
#tab-trends:checked ~ .trends-panel,
#tab-sleep:checked ~ .sleep-panel,
#tab-reports:checked ~ .report-panel,
#tab-circle:checked ~ .circle-panel,
#tab-coach:checked ~ .coach-thread-panel {
  display: block;
}

#tab-overview:checked ~ .overview-panel .goals-band,
#tab-goals:checked ~ .overview-panel .today-signal-card,
#tab-goals:checked ~ .overview-panel .summary-band,
#tab-goals:checked ~ .overview-panel .intelligence-grid {
  display: none;
}

#tab-goals:checked ~ .overview-panel .goals-band {
  display: grid;
}

.overview-panel .top-dashboard-grid {
  margin-top: 0;
}

.overview-panel .intelligence-grid {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .tabbed-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-label {
    justify-content: center;
  }

  .stat-healthspan-visual {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .healthspan-ring {
    width: 88px;
  }
}

/* Mobile app shell */
@media (max-width: 760px) {
  body {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }

  .offline-banner {
    right: 9px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    left: 9px;
    max-width: none;
    justify-content: center;
  }

  .app-header {
    width: 100%;
    max-width: 100%;
    min-height: 76px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand-lockup {
    min-width: 0;
    gap: 10px;
  }

  .brand-avatar {
    width: 42px;
    height: 42px;
  }

  .brand-copy {
    min-width: 0;
    gap: 0;
  }

  .brand-wordmark {
    width: min(156px, 48vw);
  }

  .brand-goalmetric-logo {
    width: min(180px, 48vw);
    max-height: 48px;
  }

  .brand-goalmetric-name {
    max-width: min(176px, 48vw);
    font-size: 1.34rem;
  }

  .brand-goalmetric-tagline {
    max-width: min(176px, 48vw);
    font-size: 0.5rem;
  }

  .brand-copy h1 {
    max-width: 54vw;
    overflow: hidden;
    margin: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
    line-height: 1.15;
  }

  .mobile-header-toggle {
    display: block;
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .mobile-menu-button {
    display: inline-flex;
    min-height: 42px;
    padding: 0 12px;
    background: rgba(17, 24, 32, 0.88);
    border-color: var(--line);
    color: var(--ink);
  }

  .android-update-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid rgba(241, 183, 74, 0.42);
    border-radius: 8px;
    background: rgba(241, 183, 74, 0.16);
    color: #ffd37a;
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
  }

  .android-update-chip svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.3;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-menu-button .status-dot {
    flex: 0 0 10px;
    width: 10px;
    min-width: 10px;
    height: 10px;
  }

  .mobile-header-toggle:checked + .mobile-menu-button {
    border-color: rgba(67, 209, 125, 0.42);
    background: rgba(67, 209, 125, 0.14);
  }

  .app-header.menu-open .mobile-menu-button {
    border-color: rgba(67, 209, 125, 0.42);
    background: rgba(67, 209, 125, 0.14);
  }

  .header-actions {
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    left: 12px;
    display: none;
    width: auto;
    max-height: calc(100vh - 106px);
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(21, 31, 41, 0.98), rgba(13, 20, 27, 0.98));
    box-shadow: var(--shadow);
  }

  .mobile-header-toggle:checked ~ .header-actions {
    display: grid;
    gap: 10px;
  }

  .app-header.menu-open .header-actions {
    display: grid;
    gap: 10px;
  }

  .google-control,
  .top-menu {
    width: 100%;
    align-items: stretch;
  }

  .header-actions {
    align-items: stretch;
  }

  .google-control {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 9px 10px;
    padding: 12px;
  }

  .google-control .status-dot {
    grid-row: 1 / span 2;
    align-self: center;
  }

  .google-label {
    min-width: 0;
  }

  .google-status {
    text-align: right;
  }

  .last-sync {
    grid-column: 2 / -1;
  }

  .google-control form:first-of-type {
    grid-column: 1 / -1;
  }

  .google-control > .header-button,
  .google-control > form:not(:first-of-type) {
    grid-column: auto;
  }

  .google-control form {
    display: flex;
  }

  .google-control .header-button,
  .header-actions > .header-button {
    width: 100%;
  }

  .top-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .top-menu .menu-layer,
  .top-menu .menu-button {
    width: 100%;
  }

  .layer-panel {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - 20px);
  }

  .dashboard-shell {
    width: calc(100% - 20px);
    max-width: 1240px;
    overflow-x: hidden;
    padding-top: 14px;
    padding-bottom: 22px;
  }

  .tabbed-dashboard {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin-top: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .tab-panel {
    max-width: 100%;
    overflow-x: hidden;
    margin-top: 0;
  }

  .tab-label svg {
    width: 20px;
    height: 20px;
  }
}

/* Sticky tab docks and feed filters */
.tabbed-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.dashboard-tab-dock {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #091017;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.dashboard-tab-dock .tab-label {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 46px;
  gap: 8px;
  background: #0f1720;
  border-color: transparent;
}

.dashboard-tab-dock .tab-label > svg,
.dashboard-tab-dock .tab-label > span {
  position: relative;
  z-index: 1;
}

.dashboard-tab-dock .tab-label.is-loading {
  border-color: rgba(67, 209, 125, 0.34);
  color: #f8fffb;
  box-shadow: 0 0 0 1px rgba(67, 209, 125, 0.16), 0 0 18px rgba(67, 209, 125, 0.16);
}

.dashboard-tab-dock .tab-label.is-loading::after {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    110deg,
    rgba(67, 209, 125, 0) 0%,
    rgba(67, 209, 125, 0.14) 42%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(67, 209, 125, 0.14) 58%,
    rgba(67, 209, 125, 0) 100%
  );
  transform: translateX(-120%);
  animation: tabLoadingGlow 900ms ease-in-out infinite;
}

.dashboard-tab-dock .tab-label.is-loading span {
  color: #f8fffb;
}

@keyframes tabLoadingGlow {
  0% {
    opacity: 0;
    transform: translateX(-120%);
  }
  42%,
  58% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translateX(120%);
  }
}

#tab-overview:checked ~ .dashboard-tab-dock label[for="tab-overview"],
#tab-goals:checked ~ .dashboard-tab-dock label[for="tab-goals"],
#tab-feed:checked ~ .dashboard-tab-dock label[for="tab-feed"],
#tab-trends:checked ~ .dashboard-tab-dock label[for="tab-trends"],
#tab-sleep:checked ~ .dashboard-tab-dock label[for="tab-sleep"],
#tab-reports:checked ~ .dashboard-tab-dock label[for="tab-reports"],
#tab-circle:checked ~ .dashboard-tab-dock label[for="tab-circle"],
#tab-coach:checked ~ .dashboard-tab-dock label[for="tab-coach"] {
  background: #123323;
  border-color: rgba(67, 209, 125, 0.44);
  color: #f8fffb;
}

@media (min-width: 761px) {
  .dashboard-tab-dock {
    position: sticky;
    top: 92px;
    z-index: 26;
  }
}

.feed-filter-tabs {
  display: grid;
  gap: 12px;
}

.activity-share summary {
  list-style: none;
}

.activity-share summary::-webkit-details-marker {
  display: none;
}

.activity-share-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 45;
  width: min(320px, calc(100vw - 36px));
  padding: 10px;
  border: 1px solid rgba(67, 209, 125, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 27, 36, 0.98), rgba(8, 13, 19, 0.98));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.activity-share-popover form {
  display: grid;
  gap: 8px;
  margin: 0;
}

.activity-share input:not([type="checkbox"]),
.activity-share select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 12, 18, 0.84);
  color: var(--text);
}

.circle-share-targets {
  display: grid;
  gap: 6px;
}

.circle-share-target {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  cursor: pointer;
}

.circle-share-target:hover {
  border-color: rgba(67, 209, 125, 0.34);
  background: rgba(67, 209, 125, 0.1);
}

.circle-share-target input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
  flex: 0 0 auto;
}

.circle-share-target span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 800;
}

.circle-share-target-all {
  color: var(--green);
  background: rgba(67, 209, 125, 0.1);
}

.circle-action-toast {
  position: fixed;
  right: 18px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 90;
  max-width: min(320px, calc(100vw - 36px));
  padding: 11px 14px;
  border: 1px solid rgba(67, 209, 125, 0.36);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 33, 25, 0.98), rgba(8, 16, 12, 0.98));
  color: #f8fffb;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
  font-size: 0.86rem;
  font-weight: 850;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.circle-action-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.circle-action-toast[data-tone="error"] {
  border-color: rgba(255, 109, 143, 0.44);
  background: linear-gradient(180deg, rgba(52, 20, 30, 0.98), rgba(24, 10, 16, 0.98));
}

.circle-action-toast[data-tone="muted"] {
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(20, 27, 35, 0.98), rgba(9, 14, 19, 0.98));
}

@media (max-width: 760px) {
  .circle-action-toast {
    right: 12px;
    bottom: calc(92px + env(safe-area-inset-bottom));
  }
}

@keyframes circleSharePulse {
  from {
    opacity: 0.55;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1.05);
  }
}

.activity-shared-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(67, 209, 125, 0.34);
  border-radius: 999px;
  background: rgba(67, 209, 125, 0.12);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 850;
}

.circle-panel {
  display: none;
}

.circle-hero,
.circle-copy-panel,
.circle-game-card,
.circle-side-card,
.circle-post {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 27, 36, 0.94), rgba(10, 16, 23, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.circle-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 18px;
  align-items: end;
  padding: 18px;
  margin-bottom: 14px;
}

.circle-hero h2,
.circle-side-card h3,
.circle-post h3 {
  margin: 0;
}

.circle-hero p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
}

.circle-hero-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.circle-hero-compact .overline {
  margin: 0;
}

.circle-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.circle-mini-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.circle-mini-stats span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 46px;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid rgba(232, 244, 238, 0.08);
  border-radius: 8px;
  background: rgba(7, 12, 18, 0.62);
  color: var(--muted);
}

.circle-mini-stats svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.circle-mini-stats strong {
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1;
}

.circle-mini-stats em {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.circle-invite-actions {
  position: relative;
}

.circle-switcher-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
}

.circle-switcher {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.circle-switcher::-webkit-scrollbar {
  display: none;
}

.circle-switcher a {
  flex: 0 0 auto;
  min-width: 128px;
  max-width: 210px;
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 12, 18, 0.62);
  color: var(--text);
  text-decoration: none;
}

.circle-switcher a.is-active {
  border-color: rgba(67, 209, 125, 0.36);
  background: rgba(67, 209, 125, 0.12);
}

.circle-switcher strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.circle-switcher span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.circle-create-actions {
  position: relative;
}

.circle-create-actions summary {
  list-style: none;
  cursor: pointer;
}

.circle-create-actions summary::-webkit-details-marker {
  display: none;
}

.circle-invite-actions summary {
  list-style: none;
  cursor: pointer;
}

.circle-invite-actions summary::-webkit-details-marker {
  display: none;
}

.circle-invite-trigger,
.circle-create-trigger {
  width: 42px;
  min-width: 42px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(67, 209, 125, 0.24);
  border-radius: 8px;
  border-color: rgba(67, 209, 125, 0.24);
  background: rgba(67, 209, 125, 0.1);
  color: var(--green);
}

.circle-invite-trigger svg,
.circle-create-trigger svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.circle-invite-actions .circle-invite-form,
.circle-create-actions .circle-create-form {
  position: absolute;
  z-index: 70;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, calc(100vw - 42px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 27, 36, 0.98), rgba(10, 16, 23, 0.98));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.circle-section-tabs {
  display: grid;
  gap: 14px;
}

.circle-tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.circle-section-tabbar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(232, 244, 238, 0.08);
  border-radius: 8px;
  background: rgba(7, 12, 18, 0.62);
}

.circle-section-tabbar label {
  position: relative;
  width: 56px;
  min-width: 56px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 7px;
  color: var(--circle-tab-color, var(--muted));
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.circle-section-tabbar label:hover {
  transform: translateY(-1px);
  background: rgba(var(--circle-tab-rgb, 160, 174, 168), 0.1);
}

.circle-section-tabbar svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.circle-section-tabbar span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.circle-section-feed-label {
  --circle-tab-color: var(--green);
  --circle-tab-rgb: 67, 209, 125;
}

.circle-section-leaderboard-label {
  --circle-tab-color: var(--amber);
  --circle-tab-rgb: 241, 183, 74;
}

.circle-section-achievements-label {
  --circle-tab-color: var(--purple);
  --circle-tab-rgb: 151, 117, 250;
}

.circle-section-challenges-label {
  --circle-tab-color: var(--blue);
  --circle-tab-rgb: 79, 178, 255;
}

.circle-sub-panel {
  display: none;
}

#circle-section-feed:checked ~ .circle-section-tabbar label[for="circle-section-feed"],
#circle-section-leaderboard:checked ~ .circle-section-tabbar label[for="circle-section-leaderboard"],
#circle-section-achievements:checked ~ .circle-section-tabbar label[for="circle-section-achievements"],
#circle-section-challenges:checked ~ .circle-section-tabbar label[for="circle-section-challenges"] {
  background: rgba(var(--circle-tab-rgb, 67, 209, 125), 0.16);
  color: var(--circle-tab-color, #d9ffe5);
  box-shadow: inset 0 0 0 1px rgba(var(--circle-tab-rgb, 67, 209, 125), 0.28);
}

#circle-section-feed:checked ~ .circle-feed-sub-panel {
  display: block;
}

#circle-section-leaderboard:checked ~ .circle-leaderboard-sub-panel {
  display: block;
}

#circle-section-achievements:checked ~ .circle-achievements-sub-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(240px, 0.65fr);
  gap: 14px;
}

#circle-section-challenges:checked ~ .circle-challenges-sub-panel {
  display: block;
}

.circle-game-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.circle-game-card {
  padding: 14px;
}

.circle-leaderboard-card {
  position: relative;
}

.circle-game-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.circle-game-head h3 {
  margin: 0;
}

.circle-game-head > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.circle-privacy-menu {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
}

.circle-privacy-menu summary {
  list-style: none;
  cursor: pointer;
}

.circle-privacy-menu summary::-webkit-details-marker {
  display: none;
}

.circle-privacy-trigger {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.circle-privacy-trigger:hover,
.circle-privacy-menu[open] .circle-privacy-trigger {
  color: var(--green);
  border-color: transparent;
  background: transparent;
}

.circle-privacy-trigger svg {
  width: 20px;
  height: 20px;
}

.circle-week-switcher {
  display: inline-flex;
  gap: 6px;
  padding: 3px;
  margin-bottom: 10px;
  border: 1px solid rgba(232, 244, 238, 0.08);
  border-radius: 8px;
  background: rgba(7, 12, 18, 0.68);
}

.circle-week-switcher a,
.circle-week-switcher span {
  min-width: 74px;
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.circle-week-switcher a {
  color: var(--text);
}

.circle-week-switcher a.is-active {
  background: rgba(67, 209, 125, 0.16);
  color: #d9ffe5;
}

.circle-week-switcher a.is-loading {
  opacity: 0.68;
  pointer-events: none;
}

.circle-leaderboard-list,
.achievement-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.circle-leaderboard-list article {
  display: grid;
  grid-template-columns: 42px auto minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(232, 244, 238, 0.08);
  border-radius: 8px;
  background: rgba(9, 16, 23, 0.74);
}

.circle-leaderboard-list article.is-me {
  border-color: rgba(67, 209, 125, 0.34);
  background: rgba(67, 209, 125, 0.08);
}

.circle-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: #f8fffb;
}

.circle-leaderboard-list article > div:nth-child(3) {
  min-width: 0;
}

.circle-leaderboard-list article > div:nth-child(3) strong {
  display: block;
}

.circle-leaderboard-list article > div:nth-child(3) em {
  color: var(--green);
  font-size: 0.72rem;
  font-style: normal;
  text-transform: uppercase;
}

.circle-leaderboard-list article > div:nth-child(3) span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.circle-leaderboard-list article > b {
  justify-self: end;
  min-width: 42px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(67, 209, 125, 0.16);
  color: #c8ffd9;
  text-align: center;
}

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

.achievement-card {
  --achievement-color: var(--green);
  --achievement-rgb: 67, 209, 125;
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(232, 244, 238, 0.08);
  border-radius: 8px;
  background: rgba(9, 16, 23, 0.72);
}

.achievement-card.is-locked {
  opacity: 0.68;
}

.achievement-card.is-unlocked {
  border-color: rgba(var(--achievement-rgb), 0.34);
  background:
    radial-gradient(circle at 16% 8%, rgba(var(--achievement-rgb), 0.16), transparent 36%),
    rgba(9, 16, 23, 0.78);
}

.achievement-card.is-new {
  border-color: rgba(67, 209, 125, 0.36);
  box-shadow: 0 0 0 1px rgba(67, 209, 125, 0.08);
}

.achievement-card-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.achievement-card-head > div {
  min-width: 0;
}

.achievement-badge {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--achievement-rgb), 0.5);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.42), transparent 18%),
    radial-gradient(circle at 50% 50%, rgba(var(--achievement-rgb), 0.34), rgba(var(--achievement-rgb), 0.1) 66%, rgba(9, 16, 23, 0.92) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 12px 24px rgba(var(--achievement-rgb), 0.18);
  color: var(--achievement-color);
  flex: 0 0 auto;
}

.achievement-badge::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: inherit;
}

.achievement-badge::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(9, 16, 23, 0.98);
  border-radius: 999px;
  background: var(--achievement-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.achievement-card.is-locked .achievement-badge {
  filter: grayscale(0.72);
  opacity: 0.68;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.achievement-card.is-locked .achievement-badge::after {
  display: none;
}

.achievement-badge svg {
  position: relative;
  z-index: 1;
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.achievement-card strong,
.achievement-card span,
.achievement-card p,
.achievement-card em {
  min-width: 0;
}

.achievement-card-head > div > span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.achievement-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.achievement-unlocked {
  color: #c8ffd9;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 850;
}

.achievement-progress {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.achievement-progress::before {
  content: "";
  display: block;
  width: calc(var(--progress, 0) * 1%);
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.achievement-card.tone-blue { --achievement-color: var(--blue); --achievement-rgb: 79, 178, 255; }
.achievement-card.tone-amber { --achievement-color: var(--amber); --achievement-rgb: 241, 183, 74; }
.achievement-card.tone-purple { --achievement-color: var(--purple); --achievement-rgb: 151, 117, 250; }
.achievement-card.tone-rose { --achievement-color: var(--rose); --achievement-rgb: 244, 114, 132; }
.achievement-card.tone-orange { --achievement-color: var(--orange); --achievement-rgb: 255, 132, 79; }
.achievement-card.tone-blue .achievement-progress::before { background: var(--blue); }
.achievement-card.tone-amber .achievement-progress::before { background: var(--amber); }
.achievement-card.tone-purple .achievement-progress::before { background: var(--purple); }
.achievement-card.tone-rose .achievement-progress::before { background: var(--rose); }
.achievement-card.tone-orange .achievement-progress::before { background: var(--orange); }

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

.streak-card {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 10px;
  border: 1px solid rgba(232, 244, 238, 0.08);
  border-radius: 8px;
  background: rgba(9, 16, 23, 0.72);
}

.streak-card strong {
  color: #f8fffb;
  font-size: 1.08rem;
}

.streak-card span {
  color: var(--text);
  font-weight: 900;
}

.streak-card em {
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
}

.challenge-list {
  display: grid;
  gap: 8px;
}

.challenge-list article {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(232, 244, 238, 0.08);
  border-radius: 8px;
  background: rgba(9, 16, 23, 0.72);
}

.challenge-list article.is-complete {
  border-color: rgba(67, 209, 125, 0.3);
  background: rgba(67, 209, 125, 0.08);
}

.challenge-list article > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.challenge-list strong {
  min-width: 0;
}

.challenge-list span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.challenge-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.challenge-list article.tone-blue .achievement-progress::before { background: var(--blue); }
.challenge-list article.tone-amber .achievement-progress::before { background: var(--amber); }
.challenge-list article.tone-purple .achievement-progress::before { background: var(--purple); }
.challenge-list article.tone-rose .achievement-progress::before { background: var(--rose); }
.challenge-list article.tone-orange .achievement-progress::before { background: var(--orange); }

.circle-privacy-form {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 42px));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 27, 36, 0.98), rgba(10, 16, 23, 0.98));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.circle-privacy-head {
  grid-column: 1 / -1;
  display: grid;
  gap: 2px;
  margin-bottom: 2px;
}

.circle-privacy-head strong {
  color: var(--text);
}

.circle-privacy-head span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.circle-privacy-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px;
  border: 1px solid rgba(232, 244, 238, 0.08);
  border-radius: 8px;
  background: rgba(9, 16, 23, 0.72);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
}

.circle-privacy-form input {
  accent-color: var(--green);
}

.circle-privacy-form button {
  grid-column: 1 / -1;
  justify-self: start;
}

.circle-invite-form,
.circle-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px auto;
  gap: 10px;
  align-items: end;
}

.circle-invite-form label,
.circle-create-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.circle-invite-form input,
.circle-invite-form select,
.circle-create-form input,
.circle-copy-panel input,
.circle-comment-form input {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 12, 18, 0.88);
  color: var(--text);
}

.circle-status {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(67, 209, 125, 0.32);
  border-radius: 8px;
  background: rgba(67, 209, 125, 0.1);
  color: #c8ffd9;
  font-weight: 850;
}

.circle-copy-panel {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  margin-bottom: 14px;
}

.circle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.circle-sidebar,
.circle-feed {
  display: grid;
  align-content: start;
  gap: 12px;
}

.circle-side-card {
  padding: 14px;
}

.circle-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.circle-side-head span {
  min-width: 30px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(67, 209, 125, 0.12);
  color: var(--green);
  font-weight: 900;
}

.circle-member-list,
.circle-invite-list {
  display: grid;
  gap: 8px;
}

.circle-member-list article,
.circle-invite-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(232, 244, 238, 0.08);
  border-radius: 8px;
  background: rgba(9, 16, 23, 0.74);
}

.circle-invite-list article {
  grid-template-columns: minmax(0, 1fr) auto;
}

.circle-invite-list article.is-inactive {
  opacity: 0.68;
}

.circle-member-list img,
.circle-avatar img,
.circle-member-list article > span,
.circle-avatar span {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
}

.circle-member-list article > span,
.circle-avatar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(67, 209, 125, 0.15);
  color: var(--green);
  font-weight: 900;
}

.circle-member-list strong,
.circle-invite-list strong,
.circle-post header strong {
  display: block;
  color: var(--text);
}

.circle-member-list em,
.circle-invite-list span,
.circle-invite-list em,
.circle-post header span,
.circle-comments em {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
}

.circle-post {
  position: relative;
  padding: 14px;
}

.circle-post header,
.circle-post footer,
.circle-comment-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.circle-post header {
  justify-content: space-between;
  margin-bottom: 12px;
  padding-right: 42px;
}

.circle-avatar {
  flex: 0 0 auto;
}

.circle-post header > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.circle-post-unshare-form {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  margin: 0;
}

.circle-post-unshare-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(7, 12, 18, 0.5);
  color: var(--muted);
}

.circle-post-unshare-button:hover {
  border-color: rgba(244, 114, 132, 0.38);
  background: rgba(244, 114, 132, 0.12);
  color: var(--rose);
}

.circle-post-unshare-button svg {
  width: 18px;
  height: 18px;
}

.circle-post-body p {
  margin: 6px 0 0;
  color: var(--muted);
}

.circle-tags,
.circle-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.circle-tags span {
  padding: 5px 8px;
  border: 1px solid rgba(67, 209, 125, 0.24);
  border-radius: 999px;
  background: rgba(67, 209, 125, 0.1);
  color: #c8ffd9;
  font-size: 0.74rem;
  font-weight: 850;
}

.circle-metrics span {
  min-width: 94px;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid rgba(232, 244, 238, 0.08);
  border-radius: 8px;
  background: rgba(7, 12, 18, 0.58);
}

.circle-metrics strong {
  color: var(--text);
  font-size: 1rem;
}

.circle-metrics em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.circle-post footer {
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(232, 244, 238, 0.08);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.circle-react {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1720;
  color: var(--muted);
  font-weight: 850;
}

.circle-react svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.circle-react.is-active {
  border-color: rgba(67, 209, 125, 0.38);
  background: rgba(67, 209, 125, 0.12);
  color: var(--green);
}

.circle-comments {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.circle-comments article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(7, 12, 18, 0.48);
}

.circle-comments strong,
.circle-comments span,
.circle-comments em {
  grid-column: 1;
}

.circle-comments form {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
}

.circle-comments span {
  color: var(--text);
}

.circle-comment-form {
  margin-top: 10px;
}

.circle-comment-form input {
  min-width: 0;
}

@media (max-width: 900px) {
  .circle-hero,
  .circle-game-grid,
  .circle-layout,
  #circle-section-leaderboard:checked ~ .circle-leaderboard-sub-panel,
  #circle-section-achievements:checked ~ .circle-achievements-sub-panel {
    grid-template-columns: 1fr;
  }

  .circle-hero-compact {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .circle-hero-actions {
    justify-content: flex-end;
  }

  .circle-invite-form,
  .circle-create-form {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .circle-hero,
  .circle-game-card,
  .circle-side-card,
  .circle-post {
    padding: 12px;
  }

  .circle-game-head {
    display: grid;
    gap: 4px;
  }

  .circle-hero-actions {
    width: auto;
    justify-content: flex-end;
  }

  .circle-mini-stats {
    flex: 0 0 auto;
  }

  .circle-invite-actions .circle-invite-form,
  .circle-create-actions .circle-create-form {
    right: 0;
    width: min(340px, calc(100vw - 32px));
  }

  .circle-switcher a {
    min-width: 112px;
  }

  .circle-section-tabbar {
    gap: 6px;
    padding: 8px 10px;
  }

  .circle-section-tabbar label {
    width: 48px;
    min-width: 48px;
    min-height: 44px;
  }

  .circle-section-tabbar svg {
    width: 22px;
    height: 22px;
  }

  .circle-week-switcher {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .circle-week-switcher a,
  .circle-week-switcher span {
    min-width: 0;
    padding: 7px 6px;
  }

  .circle-leaderboard-list article {
    grid-template-columns: 34px auto minmax(0, 1fr) 42px;
    gap: 8px;
    padding: 9px;
  }

  .circle-rank {
    min-height: 30px;
    font-size: 0.78rem;
  }

  .circle-leaderboard-list article > div:nth-child(3) span {
    font-size: 0.72rem;
  }

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

  .achievement-card {
    min-height: 104px;
  }

  .achievement-card-head {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 9px;
  }

  .achievement-badge {
    width: 42px;
    height: 42px;
  }

  .achievement-badge svg {
    width: 22px;
    height: 22px;
  }

  .streak-grid,
  .circle-privacy-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .challenge-list article > div {
    align-items: flex-start;
  }

  .circle-copy-panel {
    grid-template-columns: 1fr;
  }

  .circle-sidebar {
    grid-template-columns: 1fr;
  }

  .circle-post header {
    grid-template-columns: auto minmax(0, 1fr);
    display: grid;
    padding-right: 38px;
  }

  .circle-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .circle-metrics span {
    min-width: 0;
  }

  .circle-comment-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .activity-share-popover form {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
}

.report-panel {
  min-width: 0;
}

.public-report-page .dashboard-shell {
  padding-top: 22px;
}

.public-report-shell {
  max-width: 1040px;
}

.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(12, 19, 26, 0.9);
}

.report-toolbar h2 {
  margin: 0;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.report-inline-form {
  display: inline-flex;
  margin: 0;
}

.report-option-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 9, 13, 0.34);
}

.report-option-tabs a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.report-option-tabs a.is-active {
  background: #123323;
  color: var(--ink);
}

.report-share-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(12, 19, 26, 0.9);
}

.report-share-create,
.report-share-form,
.report-new-share,
.report-share-list article {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-share-create {
  justify-content: space-between;
}

.report-share-create h3 {
  margin: 0;
}

.report-share-form {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.report-share-form label {
  min-width: 120px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-share-form input,
.report-share-form select,
.report-new-share input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 9, 13, 0.5);
  color: var(--ink);
}

.report-new-share {
  padding: 10px;
  border: 1px solid rgba(67, 209, 125, 0.28);
  border-radius: 8px;
  background: rgba(67, 209, 125, 0.08);
}

.report-new-share strong {
  color: var(--green);
  white-space: nowrap;
}

.report-new-share input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 0 10px;
  font-size: 0.78rem;
}

.report-share-list {
  display: grid;
  gap: 8px;
}

.report-share-list article {
  justify-content: space-between;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.report-share-list article.is-inactive {
  opacity: 0.62;
}

.report-share-list article > div {
  display: grid;
  gap: 2px;
}

.report-share-list strong {
  color: var(--ink);
}

.report-share-list span,
.report-share-list em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}

.share-report {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(232, 244, 238, 0.14);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(17, 27, 35, 0.98), rgba(8, 13, 18, 0.98));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}

.report-cover,
.report-section,
.report-metric,
.report-goal-card,
.report-list article,
.report-source-list div,
.report-micro-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.report-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.32fr);
  gap: 16px;
  padding: 18px;
}

.report-cover h2,
.report-section h3 {
  margin: 0;
}

.report-cover p {
  max-width: 72ch;
  margin: 7px 0 0;
  color: var(--muted);
}

.report-cover-meta {
  display: grid;
  align-content: start;
  gap: 4px;
  color: var(--muted);
  text-align: right;
}

.report-cover-meta span {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.report-cover-meta strong {
  color: var(--green);
  font-size: 0.86rem;
}

.report-cover-meta em,
.report-cover-meta small {
  color: var(--muted);
  font-style: normal;
  font-size: 0.76rem;
  font-weight: 800;
}

.report-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.report-badge strong {
  color: var(--ink);
}

.report-ai-summary {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(95, 184, 255, 0.22);
  border-radius: 10px;
  background: rgba(88, 182, 255, 0.07);
}

.report-ai-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.report-ai-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.report-ai-summary pre {
  margin: 0;
  white-space: pre-wrap;
  color: var(--ink);
  font: inherit;
  line-height: 1.48;
}

.report-summary-grid,
.report-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.report-metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border-left: 4px solid var(--green);
}

.report-metric span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-metric strong {
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.08;
}

.report-metric em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.72rem;
  line-height: 1.25;
}

.report-tone-green { border-left-color: var(--green); }
.report-tone-blue { border-left-color: var(--blue); }
.report-tone-amber { border-left-color: var(--amber); }
.report-tone-orange { border-left-color: #ff8c5a; }
.report-tone-rose { border-left-color: var(--rose); }
.report-tone-purple { border-left-color: #9f8cff; }
.report-tone-muted { border-left-color: rgba(255, 255, 255, 0.22); }

.report-section {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.report-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-section-head > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(67, 209, 125, 0.12);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
}

.report-list,
.report-source-list {
  display: grid;
  gap: 8px;
}

.report-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.report-chart {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.report-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.report-chart-head strong {
  color: var(--ink);
}

.report-chart-head span,
.report-chart-labels span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.report-chart svg {
  width: 100%;
  min-height: 84px;
  overflow: visible;
}

.report-chart polyline {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-chart circle {
  fill: rgba(18, 28, 38, 1);
  stroke: var(--green);
  stroke-width: 2.2;
}

.report-mini-bars {
  height: 84px;
  display: flex;
  align-items: end;
  gap: 4px;
  padding-top: 12px;
}

.report-mini-bars span {
  position: relative;
  flex: 1 1 0;
  min-width: 5px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--green), rgba(67, 209, 125, 0.38));
}

.report-mini-bars em {
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  color: rgba(248, 255, 251, 0.82);
  font-size: 0.52rem;
  font-style: normal;
  font-weight: 850;
  transform: translateX(-50%);
  white-space: nowrap;
}

.report-chart-labels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
}

.report-chart-labels span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-list article {
  display: grid;
  gap: 5px;
  padding: 10px;
}

.report-list article > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.report-list strong,
.report-source-list strong {
  color: var(--ink);
}

.report-list span,
.report-list em,
.report-list p,
.report-source-list span,
.report-source-list em,
.report-disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.35;
}

.report-micro-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.report-micro-panel > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-micro-panel span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.report-micro-panel .micro-low,
.report-micro-panel .micro-high {
  color: var(--amber);
}

.report-goal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.report-goal-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border-left: 4px solid var(--green);
}

.report-goal-card div:first-child {
  display: grid;
  gap: 2px;
}

.report-goal-card span,
.report-goal-card small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.report-goal-card strong {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.2;
}

.report-goal-card em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
}

.report-source-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-source-list div {
  display: grid;
  gap: 3px;
  padding: 10px;
}

.report-disclaimer {
  padding-top: 2px;
}

@media (max-width: 920px) {
  .report-summary-grid,
  .report-metric-grid,
  .report-goal-grid,
  .report-chart-grid,
  .report-source-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .report-toolbar,
  .report-actions,
  .report-share-create,
  .report-share-form,
  .report-new-share,
  .report-share-list article,
  .report-cover,
  .report-list article > div {
    display: grid;
  }

  .report-cover {
    grid-template-columns: 1fr;
  }

  .report-cover-meta {
    text-align: left;
  }

  .report-summary-grid,
  .report-metric-grid,
  .report-goal-grid,
  .report-chart-grid,
  .report-source-list {
    grid-template-columns: 1fr;
  }

  .report-new-share input,
  .report-share-form label {
    width: 100%;
  }
}

@media print {
  body {
    background: #fff !important;
    color: #111 !important;
  }

  .app-header,
  .dashboard-tab-dock,
  .no-print,
  .sync-overlay,
  .offline-banner,
  .tab-panel:not(.report-panel) {
    display: none !important;
  }

  .dashboard-shell,
  .tabbed-dashboard,
  .report-panel {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #111 !important;
  }

  .share-report,
  .report-cover,
  .report-section,
  .report-metric,
  .report-goal-card,
  .report-chart,
  .report-ai-summary,
  .report-list article,
  .report-source-list div,
  .report-micro-panel {
    break-inside: avoid;
    box-shadow: none !important;
    background: #fff !important;
    color: #111 !important;
    border-color: #d5d8dc !important;
  }

  .report-metric strong,
  .report-goal-card strong,
  .report-cover h2,
  .report-section h3,
  .report-list strong,
  .report-source-list strong {
    color: #111 !important;
  }

  .report-cover p,
  .report-cover-meta,
  .report-cover-meta em,
  .report-cover-meta small,
  .report-badge,
  .report-ai-summary span,
  .report-metric span,
  .report-metric em,
  .report-chart-head span,
  .report-chart-labels span,
  .report-goal-card span,
  .report-goal-card small,
  .report-goal-card em,
  .report-list span,
  .report-list em,
  .report-list p,
  .report-source-list span,
  .report-source-list em,
  .report-disclaimer {
    color: #4a5562 !important;
  }
}

.feed-filter-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
}

.feed-filter-dock {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(9, 16, 23, 0.96);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
}

.feed-filter-label {
  --filter-color: var(--green);
  --filter-rgb: 67, 209, 125;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.feed-filter-icon-label {
  width: 38px;
  min-width: 38px;
  padding: 0;
  color: var(--filter-color);
}

.feed-filter-icon-label svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feed-filter-icon-label span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.feed-filter-food-label {
  --filter-color: var(--green);
  --filter-rgb: 67, 209, 125;
}

.feed-filter-exercise-label {
  --filter-color: var(--blue);
  --filter-rgb: 88, 182, 255;
}

.feed-filter-sleep-label {
  --filter-color: var(--purple);
  --filter-rgb: 108, 99, 255;
}

.feed-filter-body-label {
  --filter-color: var(--rose);
  --filter-rgb: 255, 109, 143;
}

.feed-filter-hydration-label {
  --filter-color: var(--blue);
  --filter-rgb: 88, 182, 255;
}

.food-logger,
.exercise-logger {
  display: none;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(21, 31, 41, 0.88), rgba(13, 20, 27, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.food-logger-head,
.exercise-logger-head,
.food-review-head,
.exercise-log-submit-row,
.food-log-submit-row,
.food-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.food-logger-head h2,
.food-review-head h3 {
  margin: 0;
}

.log-add-label {
  display: flex;
  align-items: center;
  min-width: 0;
}

.log-add-label .overline {
  margin: 0;
}

.log-add-toggle {
  min-width: 92px;
  font-weight: 850;
}

.log-add-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.log-add-toggle.is-open svg {
  display: none;
}

.food-log-toggle {
  min-width: 104px;
}

.food-log-stack {
  display: grid;
  gap: 12px;
}

.food-log-panel {
  min-width: 0;
}

.food-search-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.food-search-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.food-search-head h3,
.food-search-head p {
  margin: 0;
}

.food-search-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.food-search-head > span,
.food-search-results-head {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.food-search-box {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.food-search-box > span {
  position: relative;
  display: block;
}

.food-search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.food-search-box input {
  min-height: 44px;
  width: 100%;
  padding-left: 40px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 16px;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: text;
  -webkit-user-select: text;
}

.food-search-results {
  display: grid;
  gap: 8px;
  max-height: 386px;
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.food-search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
  touch-action: pan-y;
}

.food-search-main {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  touch-action: pan-y;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.food-search-main:focus-visible {
  outline: 2px solid rgba(67, 209, 125, 0.72);
  outline-offset: -2px;
}

.food-search-plus {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(67, 209, 125, 0.16);
  color: var(--green);
}

.food-search-plus svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.food-search-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.food-search-copy strong,
.food-search-copy em,
.food-search-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-search-copy strong {
  font-size: 0.86rem;
}

.food-search-copy em,
.food-search-copy small {
  color: var(--muted);
  font-style: normal;
}

.food-search-copy em {
  font-size: 0.72rem;
  font-weight: 750;
}

.food-search-copy small {
  font-size: 0.72rem;
  font-weight: 850;
}

.food-search-favorite {
  width: 42px;
  min-height: 58px;
  border-left: 1px solid var(--line);
  touch-action: pan-y;
}

.food-review-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 9, 13, 0.42);
}

.food-review-head {
  align-items: flex-start;
}

.food-review-head .food-scan-status {
  margin-top: 4px;
}

.food-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.food-photo-input {
  display: none;
}

.icon-text-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(67, 209, 125, 0.28);
  border-radius: 8px;
  background: rgba(24, 35, 45, 0.78);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.08;
  cursor: pointer;
}

.icon-text-button.primary {
  border-color: rgba(91, 238, 145, 0.52);
  background: linear-gradient(180deg, #4be28a, #24a95d);
  color: #06100b;
  box-shadow: 0 10px 28px rgba(36, 169, 93, 0.22);
}

.label-photo-button {
  border-color: rgba(95, 184, 255, 0.32);
}

.icon-text-button svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-text-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.icon-text-button span {
  min-width: 0;
}

.food-photo-note {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 0.74rem;
  font-weight: 800;
}

.food-photo-note input {
  min-width: 0;
  min-height: 38px;
  width: 100%;
  border-radius: 8px;
}

.food-scan-status,
.food-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.food-barcode-form,
.food-meal-fields,
.food-edit-grid,
.exercise-log-form,
.exercise-log-grid {
  display: grid;
  gap: 10px;
}

.food-barcode-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.food-barcode-form label,
.food-meal-fields label,
.food-edit-grid label,
.exercise-log-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 0.74rem;
  font-weight: 800;
}

.food-barcode-form input,
.food-meal-fields input,
.food-meal-fields select,
.food-edit-grid input,
.exercise-log-form input,
.exercise-log-form select,
.exercise-log-form textarea {
  min-width: 0;
  min-height: 38px;
  width: 100%;
  border-radius: 8px;
}

.exercise-log-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.exercise-log-grid {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
}

.exercise-log-grid label:nth-child(2),
.exercise-log-grid label:nth-child(3) {
  grid-column: span 2;
}

.exercise-notes-label {
  display: grid;
}

.saved-foods {
  display: grid;
  gap: 12px;
}

.saved-food-group {
  display: grid;
  gap: 8px;
}

.saved-food-group > span,
.food-review-head span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.saved-food-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 156px;
  overflow-y: auto;
  padding-right: 2px;
}

.favorite-food-list {
  max-height: 184px;
}

.saved-food-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: stretch;
  max-width: 240px;
  min-width: 176px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 35, 45, 0.72);
  overflow: hidden;
}

.saved-food-chip {
  display: grid;
  gap: 2px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 9px;
  border: 0;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.saved-food-chip strong,
.saved-food-chip em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-food-chip strong {
  font-size: 0.78rem;
}

.saved-food-chip em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
}

.food-favorite-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 44px;
  border: 0;
  background: rgba(7, 12, 17, 0.28);
  color: rgba(148, 163, 184, 0.82);
  cursor: pointer;
}

.food-favorite-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.food-favorite-toggle.is-favorite {
  color: #ffd166;
}

.food-favorite-toggle.is-favorite svg {
  fill: currentColor;
}

.food-favorite-toggle:disabled {
  cursor: wait;
  opacity: 0.6;
}

.food-search-result {
  min-height: 68px;
  align-items: stretch;
}

.food-search-result > .food-search-main {
  min-height: 68px;
  height: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
}

.food-search-result > .food-search-favorite {
  width: 42px;
  min-height: 68px;
  height: 100%;
  align-self: stretch;
  border-left: 1px solid var(--line);
}

.food-search-result .food-search-plus {
  align-self: center;
}

.food-search-result .food-search-copy {
  align-content: center;
  gap: 3px;
  line-height: 1.18;
}

.food-search-result .food-search-copy strong,
.food-search-result .food-search-copy em,
.food-search-result .food-search-copy small {
  line-height: 1.18;
}

.food-meal-fields {
  grid-template-columns: minmax(120px, 0.7fr) minmax(180px, 1fr);
}

.food-queue {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.food-queue-item {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 24, 32, 0.72);
  touch-action: pan-y;
}

.food-queue-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  justify-content: normal;
  gap: 8px;
}

.food-queue-head > div {
  min-width: 0;
}

.food-queue-head .mini-icon-button {
  justify-self: end;
}

.food-queue-head strong,
.food-queue-head span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-queue-head strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.food-queue-head span {
  color: var(--muted);
  font-size: 0.74rem;
}

.food-edit-grid {
  grid-template-columns: minmax(170px, 1.4fr) minmax(120px, 1fr) repeat(4, minmax(76px, 0.7fr));
}

.food-edit-grid label:nth-child(4) {
  grid-column: span 2;
}

.food-log-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.food-log-totals span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(67, 209, 125, 0.12);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
}

.food-entry-row {
  display: block;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.food-list .food-entry-row {
  display: block;
  justify-content: normal;
  gap: 0;
}

.food-entry-details {
  min-width: 0;
}

.food-entry-details summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  list-style: none;
  cursor: pointer;
}

.food-entry-details summary::-webkit-details-marker {
  display: none;
}

.food-entry-details summary span,
.food-entry-details summary em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-entry-details summary em {
  color: var(--muted);
  font-style: normal;
}

.food-entry-edit-label {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid rgba(67, 209, 125, 0.24);
  border-radius: 8px;
  background: rgba(67, 209, 125, 0.1);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
}

.food-entry-edit-label svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.food-entry-details[open] summary {
  margin-bottom: 10px;
}

.food-entry-edit-form {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(5, 9, 13, 0.42);
}

.food-entry-edit-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) minmax(120px, 1fr) repeat(4, minmax(76px, 0.7fr));
  gap: 10px;
}

.food-entry-edit-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.food-entry-edit-grid label.wide {
  grid-column: span 2;
}

.food-entry-edit-grid input,
.food-entry-edit-grid select {
  min-width: 0;
  min-height: 36px;
  width: 100%;
  border-radius: 8px;
}

.food-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.small-button.danger {
  border-color: rgba(255, 109, 143, 0.34);
  background: rgba(255, 109, 143, 0.1);
  color: #ff9bb6;
}

.provider-danger-zone {
  flex: 1 1 100%;
  width: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.provider-danger-zone summary {
  cursor: pointer;
  color: #ff9bb6;
  font-size: 0.78rem;
  font-weight: 850;
}

.provider-delete-data-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.provider-danger-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.provider-danger-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 109, 143, 0.22);
  border-radius: 8px;
  background: rgba(255, 109, 143, 0.07);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.provider-danger-option input {
  margin: 0;
  accent-color: #ff6d8f;
}

.provider-danger-option small {
  color: var(--muted);
  font-size: 0.72rem;
}

.provider-danger-zone.compact {
  margin-top: 2px;
  padding-top: 6px;
}

.food-entry-status {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

@media (max-width: 760px) {
  body.food-logger-open,
  body.exercise-logger-open,
  body.profile-layer-open,
  body.coach-layer-open {
    overflow: hidden;
    overscroll-behavior-y: none;
  }

  .menu-layer[open] > .layer-panel {
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .food-logger,
  .exercise-logger {
    padding: 10px;
  }

  .food-logger.is-food-panel-open,
  .exercise-logger.is-exercise-panel-open {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: 8px;
    right: 8px;
    z-index: 68;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(var(--goalmetric-vvh, 100dvh) - 16px - env(safe-area-inset-top, 0px));
    max-height: none;
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    border-color: rgba(137, 156, 175, 0.28);
    background: var(--bg);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
    -webkit-overflow-scrolling: touch;
  }

  .food-logger.is-food-panel-open .food-logger-head,
  .exercise-logger.is-exercise-panel-open .exercise-logger-head {
    position: sticky;
    top: 0;
    z-index: 6;
    margin: -10px -10px 0;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }

  .food-logger.is-food-panel-open .food-log-panel,
  .exercise-logger.is-exercise-panel-open .exercise-log-panel {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  .food-logger.is-food-panel-open .food-log-stack {
    gap: 8px;
  }

  .food-search-card,
  .food-review-card {
    padding: 10px;
  }

  .food-logger.is-food-panel-open .food-search-card {
    gap: 8px;
  }

  .food-search-head {
    align-items: center;
  }

  .food-logger.is-food-panel-open .food-search-head {
    min-height: 0;
    justify-content: flex-end;
    margin-bottom: -4px;
  }

  .food-logger.is-food-panel-open .food-search-head > div {
    display: none;
  }

  .food-search-head > span {
    white-space: nowrap;
  }

  .food-logger.is-food-panel-open .food-search-box {
    position: sticky;
    top: 53px;
    z-index: 5;
    gap: 0;
    margin: 0 -2px;
    padding: 2px 2px 8px;
    background: var(--surface);
    color: transparent;
    font-size: 0;
  }

  .food-logger.is-food-panel-open .food-search-box input {
    min-height: 46px;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.2;
  }

  .food-search-results {
    max-height: 318px;
  }

  .food-logger.is-food-panel-open .food-search-results {
    max-height: clamp(180px, calc(var(--goalmetric-vvh, 100dvh) - 392px), 310px);
    overscroll-behavior: contain;
  }

  .food-logger.is-food-search-active .food-review-card {
    display: none;
  }

  .food-logger.is-food-search-active .food-search-card {
    min-height: calc(var(--goalmetric-vvh, 100dvh) - 86px - env(safe-area-inset-top, 0px));
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .food-logger.is-food-search-active .food-search-results {
    max-height: none;
    min-height: 0;
  }

  .food-search-result {
    grid-template-columns: minmax(0, 1fr) 38px;
    min-height: 64px;
  }

  .food-search-main {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 56px;
    padding: 8px;
  }

  .food-search-favorite {
    width: 38px;
    min-height: 56px;
  }

  .food-search-result > .food-search-main {
    min-height: 64px;
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 8px;
  }

  .food-search-result > .food-search-favorite {
    width: 38px;
    min-height: 64px;
  }

  .food-logger-head,
  .exercise-logger-head {
    align-items: center;
  }

  .food-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .icon-text-button {
    width: 100%;
    min-height: 52px;
    gap: 10px;
    padding: 0 8px;
    font-size: 0.82rem;
  }

  .icon-text-button svg {
    width: 30px;
    height: 30px;
  }

  .food-barcode-form,
  .food-meal-fields {
    grid-template-columns: 1fr;
  }

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

  .exercise-log-grid label:nth-child(2),
  .exercise-log-grid label:nth-child(3),
  .exercise-notes-label {
    grid-column: 1 / -1;
  }

  .saved-food-list {
    flex-wrap: nowrap;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .saved-food-tile {
    flex: 0 0 210px;
    max-width: 210px;
  }

  .food-queue {
    max-height: none;
    overflow: visible;
  }

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

  .food-edit-grid label:first-child,
  .food-edit-grid label:nth-child(4) {
    grid-column: 1 / -1;
  }

  .food-entry-details summary {
    grid-template-columns: minmax(0, 1fr) minmax(82px, auto) 34px;
    gap: 8px;
  }

  .food-entry-details summary em {
    max-width: 42vw;
  }

  .food-entry-edit-label {
    grid-column: auto;
    width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 8px;
  }

  .food-entry-edit-label svg {
    width: 17px;
    height: 17px;
  }

  .food-entry-edit-text {
    display: none;
  }

  .food-entry-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .food-entry-edit-grid label.wide {
    grid-column: 1 / -1;
  }
}

.feed-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.feed-pager[hidden],
.feed-pager [hidden] {
  display: none;
}

.feed-pager span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.feed-pager .is-loading {
  cursor: progress;
  opacity: 0.75;
}

.dashboard-skeleton {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 16, 23, 0.76);
}

.dashboard-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: skeletonSweep 1.25s ease-in-out infinite;
  pointer-events: none;
}

.report-lazy-shell {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.skeleton-grid span {
  min-height: 76px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

@keyframes skeletonSweep {
  to {
    transform: translateX(100%);
  }
}

#feed-filter-all:checked ~ .feed-filter-dock label[for="feed-filter-all"],
#feed-filter-food:checked ~ .feed-filter-dock label[for="feed-filter-food"],
#feed-filter-exercise:checked ~ .feed-filter-dock label[for="feed-filter-exercise"],
#feed-filter-sleep:checked ~ .feed-filter-dock label[for="feed-filter-sleep"],
#feed-filter-body:checked ~ .feed-filter-dock label[for="feed-filter-body"],
#feed-filter-hydration:checked ~ .feed-filter-dock label[for="feed-filter-hydration"] {
  background: rgba(var(--filter-rgb), 0.16);
  border-color: rgba(var(--filter-rgb), 0.38);
  color: var(--filter-color);
}

#feed-filter-all:checked ~ .feed-filter-dock label[for="feed-filter-all"] {
  color: var(--ink);
}

#feed-filter-food:checked ~ .food-logger,
#feed-filter-exercise:checked ~ .exercise-logger {
  display: grid;
}

#feed-filter-food:checked ~ .feed-sections .feed-card:not(.feed-meal),
#feed-filter-exercise:checked ~ .feed-sections .feed-card:not(.feed-workout),
#feed-filter-sleep:checked ~ .feed-sections .feed-card:not(.feed-sleep),
#feed-filter-body:checked ~ .feed-sections .feed-card:not(.feed-body),
#feed-filter-hydration:checked ~ .feed-sections .feed-card:not(.feed-hydration),
#feed-filter-food:checked ~ .feed-sections .feed-summary-card,
#feed-filter-exercise:checked ~ .feed-sections .feed-summary-card,
#feed-filter-sleep:checked ~ .feed-sections .feed-summary-card,
#feed-filter-body:checked ~ .feed-sections .feed-summary-card,
#feed-filter-hydration:checked ~ .feed-sections .feed-summary-card {
  display: none;
}

#feed-filter-food:checked ~ .feed-sections .feed-section:not(:has(.feed-card.feed-meal)),
#feed-filter-exercise:checked ~ .feed-sections .feed-section:not(:has(.feed-card.feed-workout)),
#feed-filter-sleep:checked ~ .feed-sections .feed-section:not(:has(.feed-card.feed-sleep)),
#feed-filter-body:checked ~ .feed-sections .feed-section:not(:has(.feed-card.feed-body)),
#feed-filter-hydration:checked ~ .feed-sections .feed-section:not(:has(.feed-card.feed-hydration)) {
  display: none;
}

@media (min-width: 761px) {
  .feed-filter-dock {
    position: sticky;
    top: 154px;
    z-index: 24;
  }
}

@media (max-width: 760px) {
  .tabbed-dashboard::before {
    display: none;
  }

  .dashboard-tab-dock {
    position: fixed;
    right: auto;
    bottom: 0;
    left: 50%;
    z-index: 46;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    width: min(520px, calc(100% - 18px));
    max-width: calc(100% - 18px);
    min-height: 72px;
    padding: 7px 6px;
    border-bottom: 1px solid rgba(232, 244, 238, 0.14);
    border-radius: 12px;
    background: #091017;
    box-shadow: 0 -16px 34px rgba(0, 0, 0, 0.54);
    transform: translate3d(-50%, 0, 0);
    backface-visibility: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }

  .dashboard-tab-dock .tab-label {
    width: auto;
    min-height: 58px;
    flex-direction: column;
    gap: 4px;
    padding: 0 4px;
    border-radius: 8px;
    font-size: 0.6rem;
    line-height: 1;
    transform: none !important;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }

  .dashboard-tab-dock > label[for="tab-trends"],
  .dashboard-tab-dock > label[for="tab-sleep"],
  .dashboard-tab-dock > label[for="tab-reports"],
  .dashboard-tab-dock > label[for="tab-circle"] {
    display: none;
  }

  .tab-more-menu {
    position: relative;
    display: block;
    justify-self: stretch;
    align-self: stretch;
    width: 100%;
    height: 100%;
    min-width: 0;
  }

  .tab-more-menu summary {
    list-style: none;
  }

  .tab-more-menu summary::-webkit-details-marker {
    display: none;
  }

  .dashboard-tab-dock .tab-more-summary {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 58px;
  }

  #tab-trends:checked ~ .dashboard-tab-dock .tab-more-summary,
  #tab-sleep:checked ~ .dashboard-tab-dock .tab-more-summary,
  #tab-reports:checked ~ .dashboard-tab-dock .tab-more-summary,
  #tab-circle:checked ~ .dashboard-tab-dock .tab-more-summary,
  .tab-more-menu[open] > .tab-more-summary {
    background: #123323;
    border-color: rgba(67, 209, 125, 0.44);
    color: #f8fffb;
  }

  .tab-more-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    z-index: 50;
    display: grid;
    gap: 7px;
    width: min(210px, calc(100vw - 28px));
    padding: 8px;
    border: 1px solid rgba(67, 209, 125, 0.28);
    border-radius: 10px;
    background: #091017;
    box-shadow: 0 -16px 34px rgba(0, 0, 0, 0.54);
  }

  .tab-more-option {
    width: 100%;
    min-height: 46px;
    flex-direction: row !important;
    justify-content: flex-start;
    gap: 10px !important;
    padding: 0 11px !important;
    font-size: 0.82rem !important;
  }

  .dashboard-tab-dock .tab-label:active,
  .dashboard-tab-dock .tab-label:hover {
    transform: none !important;
  }

  .feed-filter-dock {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding: 6px;
  }

  .feed-filter-label {
    flex: 0 0 auto;
  }

  .feed-pager {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .data-quality-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .data-quality-list {
    justify-content: flex-start;
  }

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

  .feed-sections {
    gap: 16px;
    padding-top: 6px;
  }

  .feed-section {
    gap: 10px;
  }

  .feed-date {
    margin: 4px 0 0;
    font-size: 1.02rem;
  }

  .feed-summary-card {
    padding: 10px;
  }

  .feed-summary-head {
    margin-bottom: 8px;
    font-size: 0.68rem;
  }

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

  .feed-summary-metric {
    --metric-color: var(--green);
    position: relative;
    min-height: 76px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-content: center;
    gap: 1px 9px;
    padding: 8px;
    border-left: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
  }

  .feed-summary-metric::before {
    content: "";
    grid-row: 1 / 4;
    width: 38px;
    height: 38px;
    align-self: center;
    border-radius: 50%;
    background:
      radial-gradient(circle at center, #111820 0 54%, transparent 56%),
      conic-gradient(var(--metric-color) calc(var(--progress, 0) * 1%), rgba(255, 255, 255, 0.12) 0);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  .feed-summary-metric span,
  .feed-summary-metric strong,
  .feed-summary-metric em {
    min-width: 0;
  }

  .feed-summary-metric span {
    font-size: 0.68rem;
    line-height: 1.1;
  }

  .feed-summary-metric strong {
    font-size: 1rem;
    line-height: 1.05;
  }

  .feed-summary-metric em {
    overflow: hidden;
    font-size: 0.68rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .feed-summary-metric.metric-green { --metric-color: var(--green); }
  .feed-summary-metric.metric-blue { --metric-color: var(--blue); }
  .feed-summary-metric.metric-amber { --metric-color: var(--amber); }
  .feed-summary-metric.metric-orange { --metric-color: var(--orange); }
  .feed-summary-metric.metric-purple { --metric-color: var(--purple); }
  .feed-summary-metric.metric-rose { --metric-color: var(--rose); }

  .feed-card {
    gap: 10px;
    padding: 12px;
  }

  .feed-icon {
    width: 32px;
    height: 32px;
  }

  .feed-head h3 {
    font-size: 0.98rem;
  }

  .feed-head p,
  .metric-row span,
  .macro-row span,
  .food-list li,
  .activity-note {
    font-size: 0.78rem;
  }

  .activity-hr-trace {
    padding: 9px;
  }

  .activity-hr-head {
    align-items: flex-start;
  }

  .activity-hr-chart-wrap {
    height: 118px;
  }

  .activity-hr-chart polyline {
    stroke-width: 1.7;
  }

  .activity-hr-value-labels span {
    min-width: 21px;
    padding: 2px 4px;
    font-size: 0.58rem;
  }

  .activity-hr-bands {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .mcp-token-row,
  .token-meta-grid {
    grid-template-columns: 1fr;
  }

  .mcp-token-row form,
  .mcp-token-row .small-button {
    width: 100%;
  }
}

/* Compact account header and slide-out settings drawer */
.header-actions {
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.header-sync-form {
  display: contents;
}

.header-icon-button {
  position: relative;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 32, 0.84);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 28px rgba(0, 0, 0, 0.18);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.header-icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(67, 209, 125, 0.42);
  background: rgba(25, 37, 47, 0.95);
}

.header-icon-button svg,
.drawer-section-title svg,
.drawer-nav-button svg,
.drawer-logout svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sync-header-button .status-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  min-width: 8px;
  max-width: 8px;
  height: 8px;
  min-height: 8px;
  max-height: 8px;
  border: 1px solid rgba(7, 11, 15, 0.95);
}

.header-icon-button.is-syncing svg {
  animation: drawer-sync-spin 0.9s linear infinite;
}

.header-icon-button.android-update-chip {
  display: inline-flex;
  color: #ffd37a;
  border-color: rgba(241, 183, 74, 0.42);
  background: rgba(241, 183, 74, 0.14);
}

.top-menu.panel-host {
  position: static;
  width: 0;
  height: 0;
  overflow: visible;
}

.top-menu.panel-host > .menu-layer {
  position: static;
  width: 0;
  height: 0;
  overflow: visible;
}

.top-menu.panel-host .menu-button {
  display: none;
}

.app-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 84;
  background: rgba(1, 6, 10, 0.58);
  opacity: 0;
  backdrop-filter: blur(3px);
  transition: opacity 0.2s ease;
}

.app-drawer-backdrop.is-open {
  opacity: 1;
}

.app-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 85;
  width: min(430px, calc(100vw - 20px));
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-left: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(18, 27, 36, 0.99), rgba(9, 15, 21, 0.99));
  box-shadow: -28px 0 55px rgba(0, 0, 0, 0.42);
  transform: translateX(104%);
  transition: transform 0.22s ease;
  overscroll-behavior: contain;
}

.app-drawer.is-open {
  transform: translateX(0);
}

body.app-drawer-open {
  overflow: hidden;
}

.safety-disclaimer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(1, 6, 10, 0.72);
  backdrop-filter: blur(8px);
}

.safety-disclaimer-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 121;
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100dvh - 36px);
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 0%, rgba(67, 209, 125, 0.14), transparent 38%),
    linear-gradient(180deg, var(--surface-raised, var(--surface)), var(--surface));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.48);
  transform: translate(-50%, -50%);
  overflow: auto;
}

.safety-disclaimer-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(67, 209, 125, 0.34);
  border-radius: 18px;
  background: rgba(67, 209, 125, 0.12);
  color: var(--green);
}

.safety-disclaimer-mark svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.safety-disclaimer-copy {
  display: grid;
  gap: 10px;
}

.safety-disclaimer-copy h2,
.safety-disclaimer-copy p {
  margin: 0;
}

.safety-disclaimer-copy ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
}

.safety-disclaimer-copy li + li {
  margin-top: 8px;
}

.safety-disclaimer-form {
  display: grid;
}

.safety-disclaimer-form .button {
  width: 100%;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2,
.drawer-section h3 {
  margin: 0;
}

.drawer-body {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  padding: 14px 14px 22px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.drawer-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.drawer-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-section-title > svg {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 8px;
  color: var(--green);
  background: rgba(67, 209, 125, 0.11);
}

.drawer-source-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(8, 13, 18, 0.46);
}

.drawer-source-card strong {
  display: block;
  color: var(--ink);
}

.drawer-source-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.35;
}

.drawer-source-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.drawer-source-actions form {
  display: contents;
}

.drawer-invite-form {
  display: grid;
  gap: 10px;
}

.drawer-invite-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.drawer-invite-form label span,
.drawer-form-status,
.drawer-invite-result span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.drawer-invite-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(8, 13, 18, 0.54);
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

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

.drawer-invite-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(67, 209, 125, 0.28);
  border-radius: 8px;
  background: rgba(67, 209, 125, 0.09);
}

.drawer-invite-result[hidden] {
  display: none;
}

.drawer-invite-result span {
  grid-column: 1 / -1;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.drawer-invite-result code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
}

.drawer-form-status {
  min-height: 1.1em;
  margin: -2px 0 0;
}

.drawer-form-status[data-tone="error"] {
  color: var(--rose);
}

.drawer-invite-submit {
  justify-content: center;
}

.drawer-nav-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.drawer-nav-button,
.drawer-logout {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 24, 32, 0.82);
  color: var(--ink);
  font-weight: 800;
  text-align: left;
  text-decoration: none;
}

.drawer-nav-button:hover,
.drawer-logout:hover {
  transform: none;
  border-color: rgba(67, 209, 125, 0.36);
  background: rgba(25, 37, 47, 0.92);
}

.drawer-nav-button svg,
.drawer-logout svg {
  width: 18px;
  height: 18px;
  color: var(--green);
}

.drawer-logout {
  border-color: rgba(184, 75, 90, 0.32);
}

.drawer-logout svg {
  color: var(--rose);
}

.first-setup-panel .profile-subsection-head {
  align-items: flex-start;
}

.first-setup-wizard {
  gap: 14px;
}

.first-setup-wizard .wizard-step {
  display: none;
}

.first-setup-wizard .wizard-step.is-active {
  display: grid;
}

.sticky-wizard-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 15, 21, 0.94);
  backdrop-filter: blur(12px);
}

@keyframes drawer-sync-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .app-header {
    position: sticky;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 66px;
    padding: 9px 10px;
  }

  .header-actions {
    position: static;
    inset: auto;
    width: auto;
    max-height: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .mobile-header-toggle,
  .mobile-menu-button {
    display: none;
  }

  .brand-avatar {
    width: 40px;
    height: 40px;
  }

  .brand-wordmark {
    width: min(142px, 44vw);
  }

  .brand-goalmetric-logo {
    width: min(164px, 44vw);
    max-height: 44px;
  }

  .brand-goalmetric-name {
    max-width: min(160px, 44vw);
    font-size: 1.2rem;
  }

  .brand-goalmetric-tagline {
    max-width: min(160px, 44vw);
    font-size: 0.46rem;
  }

  .brand-copy h1 {
    max-width: 48vw;
    font-size: 0.96rem;
  }

  .header-icon-button {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  .header-login-button {
    min-width: 84px;
    min-height: 42px;
    padding: 0 12px;
  }

  .landing-page {
    padding: 4px 14px 34px;
  }

  .landing-hero {
    min-height: auto;
    gap: 16px;
    padding: 20px 0 10px;
  }

  .landing-copy h1 {
    font-size: clamp(2.2rem, 14vw, 3.7rem);
  }

  .landing-copy p {
    font-size: 0.98rem;
  }

  .landing-signal-card {
    padding: 16px;
  }

  .landing-signal-metrics,
  .landing-mini-panels {
    grid-template-columns: 1fr;
  }

  .landing-trend-preview {
    min-height: 72px;
  }

  .landing-feature-grid {
    grid-template-columns: 1fr;
  }

  .app-drawer {
    width: min(390px, calc(100vw - 12px));
  }

  .drawer-head {
    padding: 16px 14px 12px;
  }

  .drawer-body {
    padding: 12px 10px calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .top-menu.panel-host,
  .top-menu.panel-host > .menu-layer {
    width: 0;
    height: 0;
  }
}

/* Theme controls and light mode */
html[data-theme="dark"] {
  color-scheme: dark;
}

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

.theme-choice {
  min-width: 0;
  min-height: 58px;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-color: var(--line);
  background: rgba(17, 24, 32, 0.82);
  color: var(--muted);
  font-size: 0.78rem;
}

.theme-choice svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-choice strong {
  overflow: hidden;
  max-width: 100%;
  color: inherit;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-choice.is-active {
  border-color: rgba(67, 209, 125, 0.44);
  background: rgba(67, 209, 125, 0.15);
  color: var(--ink);
}

html[data-theme="light"] {
  --bg: #f5f8f4;
  --ink: #10231d;
  --muted: #61726a;
  --surface: #ffffff;
  --surface-soft: #edf4ef;
  --surface-raised: #fbfdf9;
  --line: rgba(29, 55, 45, 0.13);
  --line-strong: rgba(29, 55, 45, 0.22);
  --green: #18784b;
  --blue: #2e6f9f;
  --amber: #b97912;
  --orange: #c7672d;
  --rose: #b84b5a;
  --purple: #6c5b95;
  --shadow: 0 18px 50px rgba(22, 37, 31, 0.12);
  color-scheme: light;
}

html[data-theme="light"],
html[data-theme="light"] body {
  background: var(--bg);
}

html[data-theme="light"] body {
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(24, 120, 75, 0.12), transparent 34rem),
    linear-gradient(180deg, #fbfdf9 0%, #eef5f0 100%);
}

html[data-theme="light"] body::before {
  background:
    linear-gradient(90deg, rgba(24, 120, 75, 0.08), transparent 34%, rgba(46, 111, 159, 0.06) 70%, transparent),
    repeating-linear-gradient(0deg, rgba(16, 35, 29, 0.035) 0, rgba(16, 35, 29, 0.035) 1px, transparent 1px, transparent 54px);
  opacity: 0.68;
}

html[data-theme="light"] .app-header {
  background: rgba(251, 253, 249, 0.92);
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(16, 35, 29, 0.1);
}

html[data-theme="light"] .brand-avatar,
html[data-theme="light"] .brand-logo-mark {
  border-color: rgba(24, 120, 75, 0.2);
  box-shadow: 0 10px 24px rgba(16, 35, 29, 0.12);
}

html[data-theme="light"] .brand-goalmetric-goal {
  color: #10231d;
  text-shadow: none;
}

html[data-theme="light"] .brand-goalmetric-tagline {
  color: rgba(16, 35, 29, 0.66);
}

html[data-theme="light"] .brand-goalmetric-logo {
  filter: drop-shadow(0 1px 2px rgba(16, 35, 29, 0.34)) drop-shadow(0 8px 20px rgba(16, 35, 29, 0.1));
}

html[data-theme="light"] .header-icon-button,
html[data-theme="light"] .button.secondary,
html[data-theme="light"] .header-button.quiet,
html[data-theme="light"] .small-button,
html[data-theme="light"] .icon-button,
html[data-theme="light"] .drawer-nav-button,
html[data-theme="light"] .drawer-logout,
html[data-theme="light"] .theme-choice {
  background: rgba(255, 255, 255, 0.86);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 10px 22px rgba(16, 35, 29, 0.08);
}

html[data-theme="light"] .header-icon-button:hover,
html[data-theme="light"] .small-button:hover,
html[data-theme="light"] .drawer-nav-button:hover,
html[data-theme="light"] .drawer-logout:hover,
html[data-theme="light"] .theme-choice:hover {
  background: #ffffff;
  border-color: rgba(24, 120, 75, 0.32);
}

html[data-theme="light"] .button,
html[data-theme="light"] .header-button.primary {
  background: linear-gradient(180deg, #2bbd6f, #18784b);
  color: #ffffff;
  border-color: rgba(24, 120, 75, 0.38);
  box-shadow: 0 12px 28px rgba(24, 120, 75, 0.18);
}

html[data-theme="light"] .sync-header-button .status-dot {
  border-color: #fbfdf9;
}

html[data-theme="light"] .header-icon-button.android-update-chip {
  color: #8a560a;
  border-color: rgba(185, 121, 18, 0.32);
  background: rgba(255, 244, 218, 0.88);
}

html[data-theme="light"] .app-drawer-backdrop {
  background: rgba(16, 35, 29, 0.32);
}

html[data-theme="light"] .app-drawer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(241, 247, 243, 0.99));
  border-left-color: var(--line-strong);
  box-shadow: -26px 0 50px rgba(16, 35, 29, 0.16);
}

html[data-theme="light"] .drawer-head {
  border-bottom-color: var(--line);
}

html[data-theme="light"] .drawer-section,
html[data-theme="light"] .drawer-source-card,
html[data-theme="light"] .sticky-wizard-actions,
html[data-theme="light"] .layer-panel,
html[data-theme="light"] .empty-state,
html[data-theme="light"] .sync-card,
html[data-theme="light"] .report-panel,
html[data-theme="light"] .medical-report-panel,
html[data-theme="light"] .coach-thread-panel,
html[data-theme="light"] .profile-layer,
html[data-theme="light"] .goal-layer-panel {
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .drawer-invite-form input {
  background: rgba(251, 253, 249, 0.92);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="light"] .drawer-invite-result {
  background: rgba(24, 120, 75, 0.09);
  border-color: rgba(24, 120, 75, 0.24);
}

html[data-theme="light"] .drawer-section-title > svg,
html[data-theme="light"] .theme-choice.is-active {
  background: rgba(24, 120, 75, 0.11);
  border-color: rgba(24, 120, 75, 0.32);
  color: var(--ink);
}

html[data-theme="light"] .dashboard-tab-dock,
html[data-theme="light"] .feed-filter-dock,
html[data-theme="light"] .profile-section-tabs,
html[data-theme="light"] .trend-period-tabs,
html[data-theme="light"] .week-switcher {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(16, 35, 29, 0.1);
}

html[data-theme="light"] .dashboard-tab-dock .tab-label,
html[data-theme="light"] .feed-filter-label,
html[data-theme="light"] .profile-section-tab,
html[data-theme="light"] .trend-period-tabs a,
html[data-theme="light"] .week-switcher a {
  background: rgba(237, 244, 239, 0.78);
  border-color: transparent;
  color: var(--muted);
}

html[data-theme="light"] #tab-overview:checked ~ .dashboard-tab-dock label[for="tab-overview"],
html[data-theme="light"] #tab-goals:checked ~ .dashboard-tab-dock label[for="tab-goals"],
html[data-theme="light"] #tab-feed:checked ~ .dashboard-tab-dock label[for="tab-feed"],
html[data-theme="light"] #tab-trends:checked ~ .dashboard-tab-dock label[for="tab-trends"],
html[data-theme="light"] #tab-sleep:checked ~ .dashboard-tab-dock label[for="tab-sleep"],
html[data-theme="light"] #tab-reports:checked ~ .dashboard-tab-dock label[for="tab-reports"],
html[data-theme="light"] #tab-circle:checked ~ .dashboard-tab-dock label[for="tab-circle"],
html[data-theme="light"] #tab-coach:checked ~ .dashboard-tab-dock label[for="tab-coach"],
html[data-theme="light"] #tab-trends:checked ~ .dashboard-tab-dock .tab-more-summary,
html[data-theme="light"] #tab-sleep:checked ~ .dashboard-tab-dock .tab-more-summary,
html[data-theme="light"] #tab-reports:checked ~ .dashboard-tab-dock .tab-more-summary,
html[data-theme="light"] #tab-circle:checked ~ .dashboard-tab-dock .tab-more-summary,
html[data-theme="light"] .tab-more-menu[open] > .tab-more-summary,
html[data-theme="light"] .profile-section-tab.is-active,
html[data-theme="light"] .trend-period-tabs a.is-active,
html[data-theme="light"] .week-switcher a.is-active {
  background: rgba(24, 120, 75, 0.13);
  border-color: rgba(24, 120, 75, 0.32);
  color: var(--ink);
}

html[data-theme="light"] .dashboard-tab-dock .tab-label.is-loading,
html[data-theme="light"] .dashboard-tab-dock .tab-label.is-loading span {
  color: var(--ink);
}

html[data-theme="light"] .dashboard-tab-dock .tab-label.is-loading::after {
  background: linear-gradient(
    110deg,
    rgba(24, 120, 75, 0) 0%,
    rgba(24, 120, 75, 0.14) 42%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(24, 120, 75, 0.14) 58%,
    rgba(24, 120, 75, 0) 100%
  );
}

html[data-theme="light"] .tab-more-panel {
  background: #ffffff;
  border-color: rgba(24, 120, 75, 0.28);
  box-shadow: 0 -16px 34px rgba(16, 35, 29, 0.16);
}

html[data-theme="light"] .today-signal-card {
  background:
    linear-gradient(135deg, rgba(24, 120, 75, 0.12), rgba(46, 111, 159, 0.06) 48%, rgba(185, 121, 18, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 246, 0.96));
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(16, 35, 29, 0.1);
}

html[data-theme="light"] .today-signal-score {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.98) 58%, transparent 60%),
    conic-gradient(var(--signal-accent) calc(var(--score) * 1%), rgba(16, 35, 29, 0.11) 0);
  box-shadow: inset 0 0 0 1px rgba(16, 35, 29, 0.06), 0 10px 24px rgba(16, 35, 29, 0.12);
}

html[data-theme="light"] .today-signal-metric {
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .summary-band,
html[data-theme="light"] .stat-tile,
html[data-theme="light"] .feed-summary-card,
html[data-theme="light"] .feed-card,
html[data-theme="light"] .message,
html[data-theme="light"] .trend-card,
html[data-theme="light"] .goal-card,
html[data-theme="light"] .goal-detail-panel,
html[data-theme="light"] .report-goal-card,
html[data-theme="light"] .report-chart,
html[data-theme="light"] .data-quality-card,
html[data-theme="light"] .circle-leaderboard-list article,
html[data-theme="light"] .achievement-card,
html[data-theme="light"] .body-trend-chart {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(16, 35, 29, 0.09);
}

html[data-theme="light"] .summary-band::before,
html[data-theme="light"] .stat-tile::before,
html[data-theme="light"] .feed-card::before,
html[data-theme="light"] .trend-card::before,
html[data-theme="light"] .goal-card::before {
  opacity: 0.5;
}

html[data-theme="light"] .stat-tile,
html[data-theme="light"] .trend-card,
html[data-theme="light"] .goal-card,
html[data-theme="light"] .feed-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 247, 0.96));
}

html[data-theme="light"] .achievement-card.is-unlocked {
  background:
    radial-gradient(circle at 16% 8%, rgba(var(--achievement-rgb), 0.14), transparent 38%),
    rgba(255, 255, 255, 0.94);
}

html[data-theme="light"] .achievement-badge {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.86), transparent 20%),
    radial-gradient(circle at 50% 50%, rgba(var(--achievement-rgb), 0.22), rgba(var(--achievement-rgb), 0.08) 68%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 10px 20px rgba(var(--achievement-rgb), 0.14);
}

html[data-theme="light"] .achievement-badge::before {
  border-color: rgba(var(--achievement-rgb), 0.18);
}

html[data-theme="light"] .achievement-badge::after {
  border-color: rgba(255, 255, 255, 0.98);
}

html[data-theme="light"] .stat-top strong,
html[data-theme="light"] .feed-head strong,
html[data-theme="light"] .feed-head h3,
html[data-theme="light"] .trend-card-head strong,
html[data-theme="light"] .goal-card-head strong,
html[data-theme="light"] .goal-card h3,
html[data-theme="light"] .message-role,
html[data-theme="light"] .message-meta span,
html[data-theme="light"] .report-chart-head strong,
html[data-theme="light"] .report-goal-card strong,
html[data-theme="light"] .circle-leaderboard-list article > div:nth-child(3) strong,
html[data-theme="light"] .achievement-card strong {
  color: var(--ink);
}

html[data-theme="light"] .muted,
html[data-theme="light"] .stat-tile p,
html[data-theme="light"] .trend-card p,
html[data-theme="light"] .trend-card em,
html[data-theme="light"] .goal-card p,
html[data-theme="light"] .goal-card em,
html[data-theme="light"] .goal-card small,
html[data-theme="light"] .food-list li,
html[data-theme="light"] .activity-note,
html[data-theme="light"] .message-meta time,
html[data-theme="light"] .message pre,
html[data-theme="light"] .report-chart-head span,
html[data-theme="light"] .report-chart-labels span,
html[data-theme="light"] .report-goal-card span,
html[data-theme="light"] .report-goal-card small,
html[data-theme="light"] .report-goal-card em {
  color: var(--muted);
}

html[data-theme="light"] .message.assistant pre,
html[data-theme="light"] .message pre {
  background: rgba(237, 244, 239, 0.62);
  border-color: var(--line);
}

html[data-theme="light"] .message.user {
  background: rgba(24, 120, 75, 0.08);
}

html[data-theme="light"] .feed-icon,
html[data-theme="light"] .activity-share-icon,
html[data-theme="light"] .delete-icon,
html[data-theme="light"] .activity-hr-trace,
html[data-theme="light"] .activity-hr-bands span,
html[data-theme="light"] .metric-row span,
html[data-theme="light"] .macro-row span,
html[data-theme="light"] .food-list li,
html[data-theme="light"] .coach-rating button,
html[data-theme="light"] .chart-value-strip span,
html[data-theme="light"] .feed-summary-metric,
html[data-theme="light"] .vitals-legend span {
  background: rgba(237, 244, 239, 0.72);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="light"] .meter,
html[data-theme="light"] .trend-card-meter,
html[data-theme="light"] .achievement-progress {
  background: rgba(16, 35, 29, 0.1);
}

html[data-theme="light"] .trend-mini-chart,
html[data-theme="light"] .goal-line-chart,
html[data-theme="light"] .activity-hr-chart-wrap,
html[data-theme="light"] .stat-vitals-visual,
html[data-theme="light"] .stat-body-chart,
html[data-theme="light"] .report-chart svg,
html[data-theme="light"] .body-trend-chart svg {
  background: rgba(237, 244, 239, 0.46);
  border-color: var(--line);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #ffffff;
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: rgba(97, 114, 106, 0.72);
}

html[data-theme="light"] .sync-overlay {
  background: rgba(245, 248, 244, 0.74);
}

html[data-theme="light"] .offline-banner,
html[data-theme="light"] .circle-action-toast {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(16, 35, 29, 0.14);
}

html[data-theme="light"] .feed-summary-metric::before {
  background:
    radial-gradient(circle at center, #ffffff 0 54%, transparent 56%),
    conic-gradient(var(--metric-color) calc(var(--progress, 0) * 1%), rgba(16, 35, 29, 0.12) 0);
  box-shadow: inset 0 0 0 1px rgba(16, 35, 29, 0.08);
}

html[data-theme="light"] .overline,
html[data-theme="light"] .drawer-nav-button svg,
html[data-theme="light"] .drawer-section-title > svg,
html[data-theme="light"] .drawer-logout svg {
  color: var(--green);
}

@media (max-width: 760px) {
  html[data-theme="light"] .dashboard-tab-dock {
    background: rgba(255, 255, 255, 0.96);
    border-color: var(--line);
    box-shadow: 0 -16px 34px rgba(16, 35, 29, 0.16);
  }
}

/* Light-mode cleanup for chart-heavy panels */
html[data-theme="light"] .stat-ring,
html[data-theme="light"] .sleep-gauge,
html[data-theme="light"] .healthspan-ring,
html[data-theme="light"] .healthspan-intel-ring,
html[data-theme="light"] .intel-score-ring,
html[data-theme="light"] .goal-pie {
  background:
    radial-gradient(circle at center, #f9fcf8 0 47%, transparent 49%),
    conic-gradient(var(--green) calc(var(--progress, var(--score, 0)) * 1%), rgba(16, 35, 29, 0.11) 0);
  box-shadow: inset 0 0 0 1px rgba(16, 35, 29, 0.08), 0 12px 24px rgba(24, 120, 75, 0.08);
}

html[data-theme="light"] .sleep-gauge,
html[data-theme="light"] .intel-score-ring {
  background:
    radial-gradient(circle at center, #f9fcf8 0 58%, transparent 60%),
    conic-gradient(var(--green) calc(var(--progress, var(--score, 0)) * 1%), rgba(16, 35, 29, 0.11) 0);
}

html[data-theme="light"] .healthspan-ring,
html[data-theme="light"] .healthspan-intel-ring {
  background:
    radial-gradient(circle at center, #f9fcf8 0 52%, transparent 54%),
    conic-gradient(var(--green) calc(var(--progress, var(--score, 0)) * 1%), rgba(16, 35, 29, 0.11) 0);
}

html[data-theme="light"] .healthspan-intel-ring {
  background:
    radial-gradient(circle at center, #f9fcf8 0 58%, transparent 60%),
    conic-gradient(var(--blue) calc(var(--score, 0) * 1%), rgba(16, 35, 29, 0.11) 0);
}

html[data-theme="light"] .stat-ring span,
html[data-theme="light"] .sleep-gauge span,
html[data-theme="light"] .healthspan-ring span,
html[data-theme="light"] .intel-score-ring span {
  color: var(--ink);
}

html[data-theme="light"] .goal-pie::after {
  background: #f9fcf8;
}

html[data-theme="light"] .stat-chart-copy small,
html[data-theme="light"] .body-trend-chart-head em {
  color: var(--muted);
}

html[data-theme="light"] .goals-band {
  background:
    radial-gradient(circle at top left, rgba(24, 120, 75, 0.1), transparent 30rem),
    rgba(255, 255, 255, 0.9);
  border-color: var(--line);
  box-shadow: 0 16px 38px rgba(16, 35, 29, 0.1);
}

html[data-theme="light"] .week-switcher,
html[data-theme="light"] .week-button,
html[data-theme="light"] .goal-row,
html[data-theme="light"] .goal-plan-pill,
html[data-theme="light"] .goal-plan-hero,
html[data-theme="light"] .goal-plan-kpis div,
html[data-theme="light"] .goal-plan-week-strip a,
html[data-theme="light"] .goal-plan-day,
html[data-theme="light"] .plan-session-card,
html[data-theme="light"] .plan-item-chip,
html[data-theme="light"] .goal-plan-detail,
html[data-theme="light"] .plan-menu-card,
html[data-theme="light"] .behavior-entry,
html[data-theme="light"] .goal-detail-kpis div,
html[data-theme="light"] .goal-station-row,
html[data-theme="light"] .goal-target-form,
html[data-theme="light"] .goal-progress-panel,
html[data-theme="light"] .event-model-summary div {
  background: rgba(247, 251, 248, 0.82);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="light"] .goal-manage-button {
  background: rgba(24, 120, 75, 0.1);
  border-color: rgba(24, 120, 75, 0.24);
  color: var(--ink);
}

html[data-theme="light"] .goal-layer {
  background: rgba(245, 248, 244, 0.7);
}

html[data-theme="light"] .goal-layer-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 245, 0.98));
}

html[data-theme="light"] .trend-hero,
html[data-theme="light"] .trend-body-hero,
html[data-theme="light"] .insight-panel {
  background:
    radial-gradient(circle at top left, rgba(24, 120, 75, 0.1), transparent 32rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 247, 0.96));
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(16, 35, 29, 0.09);
}

html[data-theme="light"] .trend-body-hero {
  background:
    radial-gradient(circle at 0% 0%, rgba(184, 75, 90, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 247, 0.96));
}

html[data-theme="light"] .trend-hero-meter,
html[data-theme="light"] .trend-card-meter,
html[data-theme="light"] .trend-day-track {
  background: rgba(16, 35, 29, 0.1);
}

html[data-theme="light"] .trend-body-weight-panel circle,
html[data-theme="light"] .trend-mini-line circle,
html[data-theme="light"] .body-trend-chart circle,
html[data-theme="light"] .goal-line-chart circle,
html[data-theme="light"] .report-chart circle,
html[data-theme="light"] .stat-body-chart circle {
  fill: #ffffff;
}

html[data-theme="light"] .trend-target-line {
  stroke: rgba(16, 35, 29, 0.26);
}

html[data-theme="light"] .chart-point-label,
html[data-theme="light"] .body-trend-point-label,
html[data-theme="light"] .mini-bar-value,
html[data-theme="light"] .trend-day-value {
  color: var(--ink);
  fill: var(--ink);
  stroke: rgba(255, 255, 255, 0.94);
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(16, 35, 29, 0.12);
  box-shadow: 0 4px 10px rgba(16, 35, 29, 0.12);
}

html[data-theme="light"] .circle-hero,
html[data-theme="light"] .circle-copy-panel,
html[data-theme="light"] .circle-game-card,
html[data-theme="light"] .circle-side-card,
html[data-theme="light"] .circle-post,
html[data-theme="light"] .circle-invite-actions .circle-invite-form,
html[data-theme="light"] .circle-create-actions .circle-create-form,
html[data-theme="light"] .circle-privacy-form,
html[data-theme="light"] .streak-card,
html[data-theme="light"] .challenge-list article {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(246, 250, 247, 0.95));
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(16, 35, 29, 0.09);
}

html[data-theme="light"] .circle-week-switcher,
html[data-theme="light"] .circle-switcher a,
html[data-theme="light"] .circle-section-tabbar,
html[data-theme="light"] .circle-mini-stats span,
html[data-theme="light"] .circle-leaderboard-list article,
html[data-theme="light"] .circle-member-list article,
html[data-theme="light"] .circle-invite-list article,
html[data-theme="light"] .circle-privacy-form label,
html[data-theme="light"] .circle-metrics span,
html[data-theme="light"] .circle-comments article,
html[data-theme="light"] .circle-react,
html[data-theme="light"] .circle-invite-form input,
html[data-theme="light"] .circle-invite-form select,
html[data-theme="light"] .circle-create-form input,
html[data-theme="light"] .circle-copy-panel input,
html[data-theme="light"] .circle-comment-form input {
  background: rgba(237, 244, 239, 0.72);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="light"] .circle-rank {
  background: rgba(16, 35, 29, 0.07);
  color: var(--ink);
}

html[data-theme="light"] .circle-week-switcher a.is-active,
html[data-theme="light"] .circle-switcher a.is-active,
html[data-theme="light"] #circle-section-feed:checked ~ .circle-section-tabbar label[for="circle-section-feed"],
html[data-theme="light"] #circle-section-leaderboard:checked ~ .circle-section-tabbar label[for="circle-section-leaderboard"],
html[data-theme="light"] #circle-section-achievements:checked ~ .circle-section-tabbar label[for="circle-section-achievements"],
html[data-theme="light"] #circle-section-challenges:checked ~ .circle-section-tabbar label[for="circle-section-challenges"],
html[data-theme="light"] .circle-leaderboard-list article > b,
html[data-theme="light"] .achievement-unlocked,
html[data-theme="light"] .circle-status,
html[data-theme="light"] .circle-tags span {
  color: #0f5f3a;
}

html[data-theme="light"] #circle-section-feed:checked ~ .circle-section-tabbar label[for="circle-section-feed"],
html[data-theme="light"] #circle-section-leaderboard:checked ~ .circle-section-tabbar label[for="circle-section-leaderboard"],
html[data-theme="light"] #circle-section-achievements:checked ~ .circle-section-tabbar label[for="circle-section-achievements"],
html[data-theme="light"] #circle-section-challenges:checked ~ .circle-section-tabbar label[for="circle-section-challenges"] {
  background: rgba(var(--circle-tab-rgb, 67, 209, 125), 0.14);
  color: var(--circle-tab-color, #0f5f3a);
  box-shadow: inset 0 0 0 1px rgba(var(--circle-tab-rgb, 67, 209, 125), 0.24);
}

html[data-theme="light"] .circle-invite-trigger,
html[data-theme="light"] .circle-create-trigger {
  background: rgba(24, 120, 75, 0.1);
  border-color: rgba(24, 120, 75, 0.24);
  color: var(--green);
}

html[data-theme="light"] .circle-post-unshare-button {
  background: rgba(16, 35, 29, 0.06);
  border-color: rgba(16, 35, 29, 0.12);
  color: var(--muted);
}

html[data-theme="light"] .circle-post-unshare-button:hover {
  background: rgba(184, 75, 90, 0.1);
  border-color: rgba(184, 75, 90, 0.24);
  color: var(--rose);
}

html[data-theme="light"] .circle-privacy-trigger {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

html[data-theme="light"] .circle-privacy-trigger:hover,
html[data-theme="light"] .circle-privacy-menu[open] .circle-privacy-trigger {
  background: transparent;
  border-color: transparent;
  color: var(--green);
}

html[data-theme="light"] .circle-member-list strong,
html[data-theme="light"] .circle-invite-list strong,
html[data-theme="light"] .circle-post header strong,
html[data-theme="light"] .circle-metrics strong,
html[data-theme="light"] .streak-card strong,
html[data-theme="light"] .streak-card span,
html[data-theme="light"] .circle-comments span,
html[data-theme="light"] .challenge-list strong {
  color: var(--ink);
}

html[data-theme="light"] .circle-post footer,
html[data-theme="light"] .circle-leaderboard-list article,
html[data-theme="light"] .circle-member-list article,
html[data-theme="light"] .circle-invite-list article {
  border-color: var(--line);
}

/* Light-mode cleanup for intelligence and reports */
html[data-theme="light"] .intel-card,
html[data-theme="light"] .intel-mini-list div,
html[data-theme="light"] .memory-list div,
html[data-theme="light"] .quality-grid div {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 247, 0.96));
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(16, 35, 29, 0.09);
}

html[data-theme="light"] .intel-card p,
html[data-theme="light"] .intel-card li,
html[data-theme="light"] .intel-card em,
html[data-theme="light"] .intel-mini-list span,
html[data-theme="light"] .intel-mini-list em,
html[data-theme="light"] .memory-list span,
html[data-theme="light"] .quality-grid span {
  color: var(--muted);
}

html[data-theme="light"] .intel-card strong,
html[data-theme="light"] .intel-head strong,
html[data-theme="light"] .intel-mini-list strong,
html[data-theme="light"] .quality-grid strong {
  color: var(--ink);
}

html[data-theme="light"] .report-toolbar,
html[data-theme="light"] .report-share-panel,
html[data-theme="light"] .share-report,
html[data-theme="light"] .report-cover,
html[data-theme="light"] .report-section,
html[data-theme="light"] .report-metric,
html[data-theme="light"] .report-goal-card,
html[data-theme="light"] .report-list article,
html[data-theme="light"] .report-source-list div,
html[data-theme="light"] .report-micro-panel,
html[data-theme="light"] .report-ai-summary,
html[data-theme="light"] .report-share-list article {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 247, 0.96));
  border-color: var(--line);
  box-shadow: 0 14px 34px rgba(16, 35, 29, 0.09);
}

html[data-theme="light"] .report-toolbar {
  background:
    radial-gradient(circle at top left, rgba(24, 120, 75, 0.1), transparent 24rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 247, 0.96));
}

html[data-theme="light"] .report-share-panel {
  background:
    radial-gradient(circle at top left, rgba(46, 111, 159, 0.08), transparent 24rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 247, 0.96));
}

html[data-theme="light"] .report-option-tabs,
html[data-theme="light"] .report-share-form input,
html[data-theme="light"] .report-share-form select,
html[data-theme="light"] .report-new-share input,
html[data-theme="light"] .report-badge,
html[data-theme="light"] .report-micro-panel span {
  background: rgba(237, 244, 239, 0.72);
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="light"] .report-option-tabs a.is-active {
  background: rgba(24, 120, 75, 0.14);
  color: var(--ink);
}

html[data-theme="light"] .report-new-share {
  background: rgba(24, 120, 75, 0.08);
  border-color: rgba(24, 120, 75, 0.28);
}

html[data-theme="light"] .report-cover h2,
html[data-theme="light"] .report-section h3,
html[data-theme="light"] .report-cover-meta span,
html[data-theme="light"] .report-badge strong,
html[data-theme="light"] .report-ai-summary pre,
html[data-theme="light"] .report-metric strong,
html[data-theme="light"] .report-goal-card strong,
html[data-theme="light"] .report-list strong,
html[data-theme="light"] .report-source-list strong,
html[data-theme="light"] .report-share-list strong {
  color: var(--ink);
}

html[data-theme="light"] .report-cover p,
html[data-theme="light"] .report-cover-meta,
html[data-theme="light"] .report-cover-meta em,
html[data-theme="light"] .report-cover-meta small,
html[data-theme="light"] .report-ai-summary span,
html[data-theme="light"] .report-metric span,
html[data-theme="light"] .report-metric em,
html[data-theme="light"] .report-list span,
html[data-theme="light"] .report-list em,
html[data-theme="light"] .report-list p,
html[data-theme="light"] .report-source-list span,
html[data-theme="light"] .report-source-list em,
html[data-theme="light"] .report-share-list span,
html[data-theme="light"] .report-share-list em,
html[data-theme="light"] .report-disclaimer {
  color: var(--muted);
}

html[data-theme="light"] .report-mini-bars em {
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .report-tone-muted {
  border-left-color: rgba(16, 35, 29, 0.22);
}

/* Light theme polish pass */
html[data-theme="light"] {
  --bg: #f7faf6;
  --ink: #0d211b;
  --muted: #5d6f67;
  --surface: #ffffff;
  --surface-soft: #f1f7f3;
  --surface-raised: #fbfdfb;
  --line: rgba(35, 62, 51, 0.11);
  --line-strong: rgba(35, 62, 51, 0.18);
  --shadow: 0 16px 34px rgba(27, 49, 40, 0.08);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 12% 0%, rgba(24, 120, 75, 0.09), transparent 30rem),
    radial-gradient(circle at 88% 8%, rgba(46, 111, 159, 0.07), transparent 28rem),
    linear-gradient(180deg, #fbfdfb 0%, #f3f8f4 46%, #eef5f0 100%);
}

html[data-theme="light"] body::before {
  background:
    linear-gradient(90deg, rgba(24, 120, 75, 0.035), transparent 36%, rgba(46, 111, 159, 0.028) 74%, transparent),
    repeating-linear-gradient(0deg, rgba(27, 49, 40, 0.018) 0, rgba(27, 49, 40, 0.018) 1px, transparent 1px, transparent 64px);
  opacity: 0.42;
}

html[data-theme="light"] .app-header {
  background:
    linear-gradient(90deg, rgba(13, 33, 27, 0.98), rgba(18, 48, 38, 0.96) 52%, rgba(12, 26, 35, 0.97));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 28px rgba(13, 33, 27, 0.22);
}

html[data-theme="light"] .brand-goalmetric-logo {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.34)) drop-shadow(0 8px 18px rgba(0, 0, 0, 0.18));
}

html[data-theme="light"] .brand-avatar {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

html[data-theme="light"] .header-icon-button,
html[data-theme="light"] .icon-button {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f5fbf7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 24px rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .header-icon-button:hover,
html[data-theme="light"] .icon-button:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(67, 209, 125, 0.34);
}

html[data-theme="light"] .sync-header-button .status-dot {
  border-color: rgba(13, 33, 27, 0.96);
}

html[data-theme="light"] .dashboard-shell {
  padding-top: 26px;
}

html[data-theme="light"] .tabbed-dashboard {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

html[data-theme="light"] .dashboard-tab-dock {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(35, 62, 51, 0.1);
  box-shadow: 0 10px 24px rgba(27, 49, 40, 0.08);
  backdrop-filter: blur(14px);
}

html[data-theme="light"] .dashboard-tab-dock .tab-label,
html[data-theme="light"] .feed-filter-label,
html[data-theme="light"] .profile-section-tab,
html[data-theme="light"] .trend-period-tabs a,
html[data-theme="light"] .week-switcher a {
  background: rgba(243, 248, 244, 0.74);
  border-color: rgba(35, 62, 51, 0.06);
  color: #51665d;
}

html[data-theme="light"] #tab-overview:checked ~ .dashboard-tab-dock label[for="tab-overview"],
html[data-theme="light"] #tab-goals:checked ~ .dashboard-tab-dock label[for="tab-goals"],
html[data-theme="light"] #tab-feed:checked ~ .dashboard-tab-dock label[for="tab-feed"],
html[data-theme="light"] #tab-trends:checked ~ .dashboard-tab-dock label[for="tab-trends"],
html[data-theme="light"] #tab-sleep:checked ~ .dashboard-tab-dock label[for="tab-sleep"],
html[data-theme="light"] #tab-reports:checked ~ .dashboard-tab-dock label[for="tab-reports"],
html[data-theme="light"] #tab-circle:checked ~ .dashboard-tab-dock label[for="tab-circle"],
html[data-theme="light"] #tab-coach:checked ~ .dashboard-tab-dock label[for="tab-coach"],
html[data-theme="light"] #tab-trends:checked ~ .dashboard-tab-dock .tab-more-summary,
html[data-theme="light"] #tab-sleep:checked ~ .dashboard-tab-dock .tab-more-summary,
html[data-theme="light"] #tab-reports:checked ~ .dashboard-tab-dock .tab-more-summary,
html[data-theme="light"] #tab-circle:checked ~ .dashboard-tab-dock .tab-more-summary,
html[data-theme="light"] .tab-more-menu[open] > .tab-more-summary,
html[data-theme="light"] .profile-section-tab.is-active,
html[data-theme="light"] .trend-period-tabs a.is-active,
html[data-theme="light"] .week-switcher a.is-active {
  background: linear-gradient(180deg, rgba(24, 120, 75, 0.13), rgba(24, 120, 75, 0.08));
  border-color: rgba(24, 120, 75, 0.28);
  color: #0d211b;
  box-shadow: inset 0 0 0 1px rgba(24, 120, 75, 0.06);
}

html[data-theme="light"] .today-signal-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(46, 111, 159, 0.08), transparent 30rem),
    radial-gradient(circle at 0% 0%, rgba(24, 120, 75, 0.13), transparent 28rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(246, 251, 248, 0.97));
  border-color: rgba(35, 62, 51, 0.11);
  box-shadow: 0 16px 32px rgba(27, 49, 40, 0.08);
}

html[data-theme="light"] .today-signal-lead p,
html[data-theme="light"] .today-signal-metric em,
html[data-theme="light"] .today-signal-next em {
  color: #61736b;
}

html[data-theme="light"] .today-signal-score {
  background:
    radial-gradient(circle at center, #fbfdfb 58%, transparent 60%),
    conic-gradient(var(--signal-accent) calc(var(--score) * 1%), rgba(35, 62, 51, 0.12) 0);
  box-shadow: inset 0 0 0 1px rgba(35, 62, 51, 0.07), 0 10px 20px rgba(27, 49, 40, 0.11);
}

html[data-theme="light"] .today-signal-metric {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(35, 62, 51, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .today-signal-next {
  background: linear-gradient(90deg, rgba(24, 120, 75, 0.1), rgba(46, 111, 159, 0.055));
  border-color: rgba(24, 120, 75, 0.2);
}

html[data-theme="light"] .summary-band,
html[data-theme="light"] .goals-band,
html[data-theme="light"] .stat-tile,
html[data-theme="light"] .feed-summary-card,
html[data-theme="light"] .feed-card,
html[data-theme="light"] .message,
html[data-theme="light"] .trend-card,
html[data-theme="light"] .goal-card,
html[data-theme="light"] .goal-detail-panel,
html[data-theme="light"] .report-goal-card,
html[data-theme="light"] .report-chart,
html[data-theme="light"] .data-quality-card,
html[data-theme="light"] .body-trend-chart {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(247, 251, 248, 0.97));
  border-color: rgba(35, 62, 51, 0.1);
  box-shadow: 0 12px 24px rgba(27, 49, 40, 0.075);
}

html[data-theme="light"] .summary-band::before,
html[data-theme="light"] .stat-tile::before,
html[data-theme="light"] .feed-card::before,
html[data-theme="light"] .trend-card::before,
html[data-theme="light"] .goal-card::before {
  opacity: 0.34;
}

html[data-theme="light"] .summary-band > div:first-child h2,
html[data-theme="light"] .section-heading h2,
html[data-theme="light"] .today-signal-lead h2,
html[data-theme="light"] .stat-top strong,
html[data-theme="light"] .goal-value,
html[data-theme="light"] .trend-card-head strong,
html[data-theme="light"] .feed-head strong {
  color: #0a1b16;
}

html[data-theme="light"] .muted,
html[data-theme="light"] .stat-tile p,
html[data-theme="light"] .trend-card p,
html[data-theme="light"] .trend-card em,
html[data-theme="light"] .goal-card p,
html[data-theme="light"] .goal-card em,
html[data-theme="light"] .goal-card small,
html[data-theme="light"] .food-list li,
html[data-theme="light"] .activity-note {
  color: #61736b;
}

html[data-theme="light"] .meter,
html[data-theme="light"] .trend-card-meter,
html[data-theme="light"] .achievement-progress,
html[data-theme="light"] .today-signal-meter {
  background: rgba(35, 62, 51, 0.09);
}

html[data-theme="light"] .trend-mini-chart,
html[data-theme="light"] .goal-line-chart,
html[data-theme="light"] .stat-vitals-visual,
html[data-theme="light"] .stat-body-chart,
html[data-theme="light"] .report-chart svg,
html[data-theme="light"] .body-trend-chart svg {
  background: rgba(245, 250, 246, 0.82);
  border-color: rgba(35, 62, 51, 0.08);
}

html[data-theme="light"] .activity-hr-chart-wrap {
  background:
    linear-gradient(90deg, rgba(24, 120, 75, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(24, 120, 75, 0.08) 1px, transparent 1px),
    rgba(245, 250, 246, 0.82);
  background-size: 28px 28px, 28px 28px, auto;
}

html[data-theme="light"] .activity-hr-chart circle {
  fill: #ffffff;
}

html[data-theme="light"] .activity-hr-value-labels span {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(24, 120, 75, 0.24);
  color: #17663e;
  box-shadow: 0 8px 16px rgba(24, 120, 75, 0.1);
}

html[data-theme="light"] .stat-ring,
html[data-theme="light"] .sleep-gauge,
html[data-theme="light"] .healthspan-ring,
html[data-theme="light"] .healthspan-intel-ring,
html[data-theme="light"] .intel-score-ring,
html[data-theme="light"] .goal-pie {
  background:
    radial-gradient(circle at center, #fbfdfb 0 47%, transparent 49%),
    conic-gradient(var(--green) calc(var(--progress, var(--score, 0)) * 1%), rgba(35, 62, 51, 0.1) 0);
  box-shadow: inset 0 0 0 1px rgba(35, 62, 51, 0.06), 0 10px 20px rgba(24, 120, 75, 0.08);
}

html[data-theme="light"] .healthspan-ring,
html[data-theme="light"] .healthspan-intel-ring,
html[data-theme="light"] .sleep-gauge,
html[data-theme="light"] .intel-score-ring {
  background:
    radial-gradient(circle at center, #fbfdfb 0 58%, transparent 60%),
    conic-gradient(var(--green) calc(var(--progress, var(--score, 0)) * 1%), rgba(35, 62, 51, 0.1) 0);
}

html[data-theme="light"] .goal-pie::after {
  background: #fbfdfb;
}

html[data-theme="light"] .chart-value-strip span,
html[data-theme="light"] .feed-summary-metric,
html[data-theme="light"] .metric-row span,
html[data-theme="light"] .macro-row span,
html[data-theme="light"] .food-list li,
html[data-theme="light"] .vitals-legend span {
  background: rgba(245, 250, 246, 0.86);
  border-color: rgba(35, 62, 51, 0.09);
  color: #0d211b;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(35, 62, 51, 0.13);
}

html[data-theme="light"] .sleep-mini-hypnogram,
html[data-theme="light"] .sleep-hypnogram-large {
  background:
    linear-gradient(180deg, transparent 23%, rgba(15, 23, 42, 0.08) 23% 24%, transparent 24% 47%, rgba(15, 23, 42, 0.08) 47% 48%, transparent 48% 71%, rgba(15, 23, 42, 0.08) 71% 72%, transparent 72%),
    #f8fafc;
}

html[data-theme="light"] .sleep-detail-backdrop {
  background: rgba(15, 23, 42, 0.38);
}

html[data-theme="light"] .sleep-detail-panel {
  background:
    radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.12), transparent 32%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

html[data-theme="light"] .sleep-stage-chips span,
html[data-theme="light"] .sleep-stage-breakdown span,
html[data-theme="light"] .sleep-detail-summary div,
html[data-theme="light"] .sleep-quality-grid div,
html[data-theme="light"] .sleep-metric,
html[data-theme="light"] .sleep-vital,
html[data-theme="light"] .sleep-guidance-list p,
html[data-theme="light"] .sleep-night-row,
html[data-theme="light"] .sleep-night-chips span {
  background: #ffffff;
}

html[data-theme="light"] .sleep-tab-hero,
html[data-theme="light"] .sleep-tab-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 247, 0.95));
  border-color: rgba(35, 62, 51, 0.11);
  box-shadow: 0 14px 34px rgba(16, 35, 29, 0.08);
}

html[data-theme="light"] .sleep-tab-score {
  background: rgba(24, 120, 75, 0.08);
  border-color: rgba(24, 120, 75, 0.18);
}

html[data-theme="light"] .behavior-dialog-card,
html[data-theme="light"] .coach-web-tab-head,
html[data-theme="light"] .coach-call-hero {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(246, 250, 247, 0.95));
  border-color: rgba(35, 62, 51, 0.11);
  box-shadow: 0 14px 34px rgba(16, 35, 29, 0.08);
}

html[data-theme="light"] .behavior-choice-chip span,
html[data-theme="light"] .feeling-score-chip span,
html[data-theme="light"] .coach-web-tab-bar label {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(35, 62, 51, 0.12);
}

html[data-theme="light"] .today-checkin-button {
  color: #4f287f;
  background: rgba(239, 230, 255, 0.94);
  border-color: rgba(125, 82, 191, 0.24);
}

@media (max-width: 760px) {
  .sleep-tab-hero,
  .sleep-tab-layout,
  .sleep-lower-grid {
    grid-template-columns: 1fr;
  }

  .sleep-tab-hero,
  .sleep-tab-card {
    padding: 12px;
  }

  .sleep-tab-score {
    justify-items: start;
    text-align: left;
  }

  .sleep-tab-metrics,
  .sleep-tab-summary,
  .sleep-tab-quality,
  .sleep-vital-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sleep-detail-chart {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 7px;
  }

  .sleep-detail-stage-labels {
    font-size: 0.64rem;
  }

  .sleep-tab-detail-chart .sleep-hypnogram-large {
    min-height: 150px;
  }

  .sleep-night-row {
    grid-template-columns: 1fr;
  }

  .sleep-night-row small {
    text-align: left;
  }

  html[data-theme="light"] .dashboard-shell {
    padding-top: 10px;
  }

  html[data-theme="light"] .dashboard-tab-dock {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(35, 62, 51, 0.11);
    box-shadow: 0 -10px 28px rgba(27, 49, 40, 0.13);
  }
}

/* GoalMetric signal cockpit refinements */
.today-signal-rings {
  display: grid;
  grid-template-columns: repeat(2, 58px);
  gap: 8px;
  justify-content: end;
}

.today-signal-ring {
  --ring-accent: var(--green);
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(10, 16, 23, 0.98) 57%, transparent 59%),
    conic-gradient(var(--ring-accent) calc(var(--ring-progress) * 1%), rgba(137, 156, 175, 0.16) 0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.today-signal-ring.ring-blue { --ring-accent: var(--blue); }
.today-signal-ring.ring-amber { --ring-accent: var(--amber); }
.today-signal-ring.ring-orange,
.today-signal-ring.ring-rose { --ring-accent: var(--orange); }
.today-signal-ring.ring-purple { --ring-accent: var(--purple); }

.today-signal-ring span {
  max-width: 42px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-signal-ring em {
  color: var(--muted);
  font-size: 0.5rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.today-signal-why {
  margin: -2px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(67, 209, 125, 0.16);
  border-radius: 8px;
  background: rgba(67, 209, 125, 0.07);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.28;
}

.today-workout-focus {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(210px, 0.65fr) minmax(280px, 0.9fr);
  gap: 12px;
  align-items: stretch;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(88, 182, 255, 0.12), rgba(67, 209, 125, 0.08)),
    rgba(12, 18, 25, 0.9);
  box-shadow: var(--shadow);
}

.today-workout-copy {
  min-width: 0;
}

.today-workout-copy h3,
.today-workout-copy p {
  margin: 0;
}

.today-workout-copy h3 {
  margin-top: 4px;
  font-size: 1.1rem;
}

.today-workout-copy p {
  margin-top: 7px;
  color: var(--ink);
  font-weight: 850;
}

.today-workout-copy em {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
}

.today-workout-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.today-workout-stats span {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.today-workout-stats strong,
.today-workout-stats em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-workout-stats strong {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 950;
}

.today-workout-stats em {
  color: var(--muted);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.today-workout-hr {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.today-workout-hr svg {
  width: 100%;
  min-height: 92px;
  padding: 6px;
  overflow: visible;
  border: 1px solid rgba(67, 209, 125, 0.12);
  border-radius: 8px;
  background: rgba(3, 8, 12, 0.5);
}

.today-workout-hr polyline {
  fill: none;
  stroke: var(--green);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.today-workout-hr circle {
  fill: rgba(10, 16, 23, 0.92);
  stroke: var(--green);
  stroke-width: 1.5;
}

.today-workout-hr div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.today-workout-hr span {
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(67, 209, 125, 0.1);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.sleep-stage-mix-card,
.sleep-rhythm-card {
  min-height: 280px;
}

.sleep-stage-mix-ring {
  --deep: 0;
  --light: 0;
  --rem: 0;
  --awake: 0;
  width: 144px;
  height: 144px;
  justify-self: center;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(10, 16, 23, 0.98) 55%, transparent 57%),
    conic-gradient(
      #6c63ff 0 calc(var(--deep) * 1%),
      #67a4ff calc(var(--deep) * 1%) calc((var(--deep) + var(--light)) * 1%),
      #58b6ff calc((var(--deep) + var(--light)) * 1%) calc((var(--deep) + var(--light) + var(--rem)) * 1%),
      #f1b74a calc((var(--deep) + var(--light) + var(--rem)) * 1%) 100%
    );
}

.sleep-stage-mix-ring span,
.sleep-stage-mix-ring em {
  display: block;
  color: var(--ink);
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.sleep-stage-mix-ring span {
  font-size: 1.5rem;
}

.sleep-stage-mix-ring em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.62rem;
  font-style: normal;
  text-transform: uppercase;
}

.sleep-stage-mix-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.sleep-stage-mix-list div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.sleep-stage-mix-list strong,
.sleep-stage-mix-list span,
.sleep-stage-mix-list em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sleep-stage-mix-list strong {
  font-size: 0.74rem;
  font-weight: 950;
}

.sleep-stage-mix-list span {
  color: var(--ink);
  font-weight: 900;
}

.sleep-stage-mix-list em {
  color: var(--muted);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 850;
}

.sleep-rhythm-axis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 900;
}

.sleep-rhythm-axis span:nth-child(n+2) {
  text-align: center;
}

.sleep-rhythm-rows {
  display: grid;
  gap: 6px;
}

.sleep-rhythm-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.sleep-rhythm-row strong {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.sleep-rhythm-row span {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(137, 156, 175, 0.13);
}

.sleep-rhythm-row i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), var(--blue));
}

.sleep-stage-history {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
  gap: 8px;
  align-items: end;
}

.sleep-stage-history-day {
  display: grid;
  gap: 5px;
  min-width: 0;
  text-align: center;
}

.sleep-stage-history-stack {
  height: 116px;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border: 1px solid rgba(137, 156, 175, 0.14);
  border-radius: 999px;
  background: rgba(137, 156, 175, 0.1);
}

.sleep-stage-history-stack span {
  min-height: 4px;
}

.sleep-stage-history-day strong,
.sleep-stage-history-day em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sleep-stage-history-day strong {
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 950;
}

.sleep-stage-history-day em {
  color: var(--muted);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 850;
}

.trend-intel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 10px;
  margin-top: 10px;
}

.trend-heatmap-card,
.trend-radar-card {
  min-height: 250px;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.trend-heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(10px, 1fr);
  gap: 4px;
  align-items: end;
  min-height: 118px;
  padding: 8px;
  border: 1px solid rgba(137, 156, 175, 0.14);
  border-radius: 8px;
  background: rgba(3, 8, 12, 0.22);
}

.trend-heatmap-week {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: 4px;
}

.trend-heatmap span,
.trend-heatmap-legend i {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: rgba(137, 156, 175, 0.16);
}

.trend-heatmap span.is-today {
  outline: 2px solid rgba(255, 255, 255, 0.42);
  outline-offset: 1px;
}

.heat-level-0 { background: rgba(137, 156, 175, 0.13) !important; }
.heat-level-1 { background: rgba(67, 209, 125, 0.22) !important; }
.heat-level-2 { background: rgba(67, 209, 125, 0.42) !important; }
.heat-level-3 { background: rgba(67, 209, 125, 0.66) !important; }
.heat-level-4 { background: rgba(67, 209, 125, 0.96) !important; }

.trend-heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
}

.trend-heatmap-legend span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.trend-heatmap-legend i {
  width: 10px;
  height: 10px;
}

.trend-radar-layout {
  display: grid;
  grid-template-columns: minmax(150px, 0.82fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.trend-radar-chart {
  width: 100%;
  min-height: 184px;
  overflow: visible;
}

.radar-grid,
.radar-grid-mid {
  fill: rgba(137, 156, 175, 0.04);
  stroke: rgba(137, 156, 175, 0.22);
  stroke-width: 0.8;
}

.radar-axis {
  stroke: rgba(137, 156, 175, 0.18);
  stroke-width: 0.7;
}

.trend-radar-chart text {
  fill: var(--muted);
  font-size: 4px;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
}

.radar-baseline {
  fill: rgba(88, 182, 255, 0.14);
  stroke: rgba(88, 182, 255, 0.7);
  stroke-width: 1;
}

.radar-current {
  fill: rgba(67, 209, 125, 0.22);
  stroke: rgba(67, 209, 125, 0.95);
  stroke-width: 1.4;
}

.trend-radar-list {
  display: grid;
  gap: 7px;
}

.trend-radar-list span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.trend-radar-list strong,
.trend-radar-list em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-radar-list strong {
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 950;
}

.trend-radar-list em {
  color: var(--muted);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 850;
}

html[data-theme="light"] .today-signal-ring,
html[data-theme="light"] .sleep-stage-mix-ring {
  background:
    radial-gradient(circle at center, #ffffff 57%, transparent 59%),
    conic-gradient(var(--ring-accent, var(--green)) calc(var(--ring-progress, 0) * 1%), rgba(15, 23, 42, 0.12) 0);
}

html[data-theme="light"] .sleep-stage-mix-ring {
  background:
    radial-gradient(circle at center, #ffffff 55%, transparent 57%),
    conic-gradient(
      #6c63ff 0 calc(var(--deep) * 1%),
      #67a4ff calc(var(--deep) * 1%) calc((var(--deep) + var(--light)) * 1%),
      #58b6ff calc((var(--deep) + var(--light)) * 1%) calc((var(--deep) + var(--light) + var(--rem)) * 1%),
      #f1b74a calc((var(--deep) + var(--light) + var(--rem)) * 1%) 100%
    );
}

html[data-theme="light"] .today-workout-focus,
html[data-theme="light"] .trend-heatmap,
html[data-theme="light"] .today-workout-hr svg {
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .today-signal-why,
html[data-theme="light"] .today-workout-stats span,
html[data-theme="light"] .sleep-stage-mix-list div,
html[data-theme="light"] .trend-radar-list span {
  background: rgba(255, 255, 255, 0.86);
}

@media (max-width: 900px) {
  .today-workout-focus,
  .trend-intel-grid,
  .trend-radar-layout {
    grid-template-columns: 1fr;
  }

  .today-workout-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .today-signal-lead {
    grid-template-columns: minmax(0, 1fr);
  }

  .today-signal-rings {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
  }

  .today-signal-ring {
    width: auto;
    max-width: 64px;
    height: 56px;
    justify-self: stretch;
  }

  .today-workout-stats,
  .sleep-stage-mix-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trend-heatmap {
    gap: 3px;
    padding: 6px;
  }

  .sleep-stage-history {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .sleep-stage-history-stack {
    height: 88px;
  }
}

/* Single layered Today signal dial */
.today-signal-lead {
  grid-template-columns: minmax(0, 1fr) minmax(286px, 320px);
  align-items: start;
}

.today-signal-copy {
  display: grid;
  gap: 12px;
  align-self: start;
  justify-items: start;
  max-width: 800px;
  min-width: 0;
  padding-top: 18px;
}

.today-layered-signal {
  display: grid;
  grid-template-columns: auto minmax(108px, 1fr);
  gap: 16px;
  align-items: center;
  justify-items: start;
  align-self: start;
  justify-self: end;
  min-width: 286px;
}

.today-layered-dial {
  position: relative;
  width: 164px;
  height: 164px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(10, 16, 23, 0.98) 0 31%, transparent 32%),
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.12), transparent 35%),
    rgba(7, 13, 20, 0.44);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045), 0 18px 38px rgba(0, 0, 0, 0.28);
}

.today-layer {
  --ring-accent: var(--green);
  --ring-track: rgba(137, 156, 175, 0.075);
  --ring-width: 12px;
  position: absolute;
  border-radius: 50%;
  background: conic-gradient(from -90deg, var(--ring-accent) calc(var(--ring-progress) * 1%), var(--ring-track) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring-width) - 1px), #000 calc(100% - var(--ring-width)));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring-width) - 1px), #000 calc(100% - var(--ring-width)));
}

.today-layer-1 {
  --ring-width: 17px;
  --ring-track: rgba(67, 209, 125, 0.12);
  inset: 0;
}

.today-layer-2 {
  --ring-width: 10px;
  --ring-track: rgba(182, 156, 255, 0.12);
  inset: 27px;
}

.today-layer-3 {
  --ring-width: 15px;
  --ring-track: rgba(255, 109, 143, 0.115);
  inset: 39px;
}

.today-layer-4 {
  --ring-width: 8px;
  inset: 66px;
}

.today-layer.ring-green { --ring-accent: var(--green); }
.today-layer.ring-blue { --ring-accent: var(--blue); }
.today-layer.ring-amber { --ring-accent: var(--amber); }
.today-layer.ring-orange,
.today-layer.ring-rose { --ring-accent: var(--orange); }
.today-layer.ring-purple { --ring-accent: var(--purple); }
.today-layer.ring-rose { --ring-accent: var(--rose); }

.today-layered-center {
  position: absolute;
  inset: 54px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 16, 23, 0.98), rgba(10, 16, 23, 0.92));
  box-shadow: 0 0 22px rgba(5, 9, 13, 0.46);
  text-align: center;
}

.today-layered-center strong {
  color: var(--ink);
  font-size: 2.05rem;
  font-weight: 950;
  line-height: 0.95;
}

.today-layered-legend {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding-left: 2px;
}

.today-layered-legend span {
  --ring-accent: var(--green);
  display: inline-flex;
  min-width: 0;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid rgba(137, 156, 175, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.today-layered-legend span.ring-blue { --ring-accent: var(--blue); }
.today-layered-legend span.ring-amber { --ring-accent: var(--amber); }
.today-layered-legend span.ring-orange,
.today-layered-legend span.ring-rose { --ring-accent: var(--orange); }
.today-layered-legend span.ring-purple { --ring-accent: var(--purple); }
.today-layered-legend span.ring-green { --ring-accent: var(--green); }
.today-layered-legend span.ring-rose { --ring-accent: var(--rose); }

.today-layered-legend i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ring-accent);
}

.today-layered-legend strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.58rem;
  text-overflow: ellipsis;
}

.today-signal-metrics-compact {
  display: none;
}

.today-signal-coach,
.today-signal-lead .today-signal-coach {
  margin: 0;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid rgba(67, 209, 125, 0.18);
  border-radius: 8px;
  background: rgba(67, 209, 125, 0.07);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.32;
  text-align: left;
}

.today-signal-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.today-signal-footer em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

html[data-theme="light"] .today-layered-dial {
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 34%, transparent 35%),
    radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.08), transparent 35%),
    rgba(255, 255, 255, 0.7);
}

html[data-theme="light"] .today-layered-center {
  background: #ffffff;
}

html[data-theme="light"] .today-layered-legend span {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(35, 62, 51, 0.12);
}

html[data-theme="light"] .today-signal-coach {
  background: rgba(255, 255, 255, 0.88);
}

@media (max-width: 620px) {
  .today-signal-lead {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: center;
  }

  .today-signal-copy {
    padding-top: 0;
  }

  .today-layered-signal {
    justify-self: center;
    gap: 12px;
    width: min(100%, 304px);
    min-width: 0;
  }

  .today-layered-dial {
    width: 172px;
    height: 172px;
  }

  .today-layered-center {
    inset: 52px;
  }

  .today-layered-center strong {
    font-size: 1.95rem;
  }

  .today-layered-legend {
    max-width: 116px;
  }

  .today-signal-coach {
    font-size: 0.88rem;
  }

  .today-signal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .today-signal-footer em {
    text-align: center;
    white-space: normal;
  }
}

@media (max-width: 390px) {
  .today-signal-lead {
    grid-template-columns: 1fr;
  }

  .today-layered-signal {
    justify-self: center;
    grid-template-columns: auto minmax(92px, 1fr);
    gap: 10px;
    width: min(100%, 292px);
  }

  .today-layered-dial {
    width: 160px;
    height: 160px;
  }

  .today-layered-center {
    inset: 50px;
  }

  .today-layered-legend {
    max-width: 108px;
  }

  .today-layered-legend span {
    padding: 5px 6px;
    font-size: 0.52rem;
  }

  .today-layered-legend strong {
    font-size: 0.54rem;
  }
}

/* Coach Mode v1 */
.coach-mode-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(67, 209, 125, 0.16), transparent 34rem),
    radial-gradient(circle at top right, rgba(115, 98, 179, 0.18), transparent 32rem),
    var(--bg);
}

.coach-mode-shell {
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 42px;
}

.coach-mode-header,
.coach-command-hero,
.coach-panel,
.coach-client-hero {
  border: 1px solid rgba(137, 156, 175, 0.18);
  background: rgba(13, 20, 28, 0.84);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.coach-mode-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 14px;
}

.coach-mode-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.coach-mode-brand img:first-child {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.coach-mode-brand img:last-child {
  width: 156px;
  height: auto;
}

.coach-mode-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.coach-command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 24px;
  align-items: center;
  margin-top: 18px;
  padding: 24px;
  border-radius: 18px;
}

.coach-command-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 4rem);
  letter-spacing: 0;
}

.coach-command-hero p {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
}

.coach-command-grid,
.coach-client-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.coach-command-grid article,
.coach-client-stats article {
  min-height: 96px;
  padding: 14px;
  border: 1px solid rgba(137, 156, 175, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.coach-command-grid span,
.coach-client-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.coach-command-grid strong,
.coach-client-stats strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
}

.coach-status-pill {
  display: inline-flex;
  margin: 14px 0 0;
  padding: 8px 12px;
  border: 1px solid rgba(67, 209, 125, 0.34);
  border-radius: 999px;
  background: rgba(67, 209, 125, 0.12);
  color: var(--green);
  font-weight: 900;
}

.coach-mode-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.coach-mode-sidebar,
.coach-mode-main {
  display: grid;
  gap: 18px;
  align-content: start;
}

.coach-panel,
.coach-client-hero {
  border-radius: 16px;
  padding: 18px;
}

.coach-panel-head,
.coach-week-head,
.coach-client-hero,
.coach-client-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.coach-panel-head h2,
.coach-client-title h2 {
  margin: 2px 0 0;
  font-size: 1.28rem;
}

.coach-invite-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.coach-invite-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.coach-invite-form input[type="text"],
.coach-invite-form select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  padding: 0 12px;
}

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

.coach-permission-grid label {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(137, 156, 175, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
}

.coach-invite-result {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(67, 209, 125, 0.28);
  border-radius: 12px;
  background: rgba(67, 209, 125, 0.1);
}

.coach-invite-result span,
.coach-invite-result code {
  font-weight: 900;
}

.coach-invite-result code {
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}

.coach-invite-list,
.coach-client-list,
.coach-attention-list,
.coach-activity-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.coach-invite-list article,
.coach-attention-list article,
.coach-activity-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid rgba(137, 156, 175, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.coach-invite-list p,
.coach-attention-list p,
.coach-activity-list p,
.coach-client-row p,
.coach-empty-note p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.coach-token-pill {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(80, 160, 220, 0.12);
  color: var(--blue);
  font-size: 0.68rem;
  font-weight: 900;
}

.coach-token-green {
  background: rgba(67, 209, 125, 0.12);
  color: var(--green);
}

.coach-token-orange {
  background: rgba(255, 149, 96, 0.12);
  color: var(--orange);
}

.coach-empty-note {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(108, 91, 149, 0.32);
  border-radius: 12px;
  background: rgba(108, 91, 149, 0.12);
}

.coach-client-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid rgba(137, 156, 175, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  text-decoration: none;
}

.coach-client-row.is-active {
  border-color: rgba(67, 209, 125, 0.42);
  background: rgba(67, 209, 125, 0.1);
}

.coach-client-row img,
.coach-client-row > span,
.coach-client-title img,
.coach-client-title > span {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(67, 209, 125, 0.14);
  color: var(--green);
  font-weight: 900;
}

.coach-client-row em {
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 149, 96, 0.15);
  color: var(--orange);
  font-style: normal;
  font-size: 0.76rem;
  font-weight: 900;
}

.coach-client-hero {
  align-items: stretch;
}

.coach-client-title {
  justify-content: flex-start;
  min-width: 0;
}

.coach-client-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.coach-client-stats {
  width: min(430px, 42%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.coach-client-stats article {
  min-height: 82px;
}

.coach-client-stats strong {
  font-size: 1.55rem;
}

.coach-week-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.coach-week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(138px, 1fr));
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.coach-day-card {
  min-height: 190px;
  padding: 12px;
  border: 1px solid rgba(137, 156, 175, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.032);
}

.coach-day-card.is-today {
  border-color: rgba(67, 209, 125, 0.44);
}

.coach-day-card > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.coach-day-card > header span {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.coach-day-card > header strong {
  font-size: 1.35rem;
}

.coach-day-plan-list {
  display: grid;
  gap: 8px;
}

.coach-plan-card {
  border: 1px solid rgba(137, 156, 175, 0.14);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.coach-plan-card summary {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
}

.coach-plan-card summary strong,
.coach-plan-card summary em {
  display: block;
}

.coach-plan-card summary em,
.coach-plan-card summary small,
.coach-match-line {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
}

.coach-plan-card ol {
  margin: 0;
  padding: 0 10px 10px 28px;
}

.coach-plan-card li {
  margin: 7px 0;
}

.coach-plan-card li span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.coach-match-line {
  margin: 0;
  padding: 0 10px 10px;
}

.coach-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.coach-empty-large {
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
}

html[data-theme="light"] .coach-mode-body {
  background:
    radial-gradient(circle at top left, rgba(24, 120, 75, 0.12), transparent 34rem),
    radial-gradient(circle at top right, rgba(108, 91, 149, 0.12), transparent 32rem),
    var(--bg);
}

html[data-theme="light"] .coach-mode-header,
html[data-theme="light"] .coach-command-hero,
html[data-theme="light"] .coach-panel,
html[data-theme="light"] .coach-client-hero {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 22px 54px rgba(22, 37, 31, 0.1);
}

html[data-theme="light"] .coach-plan-card {
  background: rgba(16, 35, 29, 0.035);
}

@media (max-width: 980px) {
  .coach-mode-shell {
    width: min(100% - 22px, 760px);
  }

  .coach-command-hero,
  .coach-mode-grid,
  .coach-client-hero,
  .coach-detail-grid {
    grid-template-columns: 1fr;
  }

  .coach-client-hero {
    display: grid;
  }

  .coach-client-stats {
    width: 100%;
  }

  .coach-week-board {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }
}

@media (max-width: 620px) {
  .coach-mode-shell {
    width: calc(100% - 16px);
    padding-top: 10px;
  }

  .coach-mode-header {
    border-radius: 12px;
  }

  .coach-mode-brand img:last-child {
    width: 132px;
  }

  .coach-mode-actions .small-button.secondary {
    display: none;
  }

  .coach-command-hero,
  .coach-panel,
  .coach-client-hero {
    padding: 14px;
  }

  .coach-command-grid,
  .coach-client-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coach-panel-head,
  .coach-week-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
