:root {
  --ink: #10231c;
  --muted-ink: #52645d;
  --brand-950: #0c2a20;
  --brand-900: #12372a;
  --brand-800: #1c4b3a;
  --brand-700: #236047;
  --brand-100: #dfeee7;
  --brand-50: #f0f7f3;
  --lime: #d5f36a;
  --lime-strong: #b8dc3b;
  --cream: #f7f5ec;
  --paper: #fffdf7;
  --white: #ffffff;
  --line: #d8e0dc;
  --warning: #9a4b12;
  --warning-bg: #fff1dc;
  --danger: #a62b2b;
  --danger-bg: #fff0ee;
  --success: #17633e;
  --success-bg: #e7f5ec;
  --blue: #245e8a;
  --blue-bg: #e9f3fb;
  --shadow-sm: 0 1px 2px rgb(16 35 28 / 8%);
  --shadow-md: 0 12px 32px rgb(12 42 32 / 10%);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --focus: 0 0 0 3px rgb(184 220 59 / 48%);
  --motion-fast: 160ms;
  --motion-base: 220ms;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--cream);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a, label, select { touch-action: manipulation; }
button { cursor: pointer; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: -72px;
  padding: 12px 16px;
  background: var(--white);
  color: var(--brand-900);
  border-radius: var(--radius-sm);
  border: 2px solid var(--brand-900);
}
.skip-link:focus { top: 16px; }

.app-shell { min-height: 100dvh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgb(247 245 236 / 94%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  border-radius: 50% 50% 50% 14px;
  background: var(--brand-900); color: var(--lime);
  font-weight: 900; letter-spacing: -1px; font-size: 13px;
}
.brand-copy strong { display: block; font-size: 17px; line-height: 1.2; letter-spacing: .04em; }
.brand-copy span { display: block; margin-top: 3px; color: var(--muted-ink); font-size: 12px; white-space: nowrap; }

.role-switcher {
  display: flex; gap: 4px; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
}
.role-switcher button {
  min-height: 40px; padding: 8px 14px; border: 0; border-radius: 999px;
  color: var(--muted-ink); background: transparent; font-weight: 700;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.role-switcher button[aria-pressed="true"] { background: var(--brand-900); color: var(--white); }

.layout { width: min(1440px, 100%); margin: 0 auto; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 73px; height: calc(100dvh - 73px);
  padding: 28px 20px; border-right: 1px solid var(--line); background: var(--cream);
}
.sidebar-context { padding: 0 12px 20px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.sidebar-context small { color: var(--muted-ink); }
.sidebar-context strong { display: block; margin-top: 4px; }
.nav-list { display: grid; gap: 6px; }
.nav-item {
  width: 100%; min-height: 48px; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 0; border-radius: 12px; background: transparent;
  color: var(--muted-ink); font-weight: 700; text-align: left;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.nav-item:hover { background: var(--brand-50); color: var(--brand-900); }
.nav-item.active { background: var(--brand-100); color: var(--brand-950); }
.nav-item svg { width: 20px; height: 20px; stroke-width: 1.8; flex: 0 0 auto; }

.main { min-width: 0; padding: clamp(24px, 4vw, 48px); padding-bottom: 96px; }
.main-inner { width: min(1120px, 100%); margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--brand-700); font-size: 13px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; max-width: 22ch; font-size: clamp(28px, 3vw, 42px); line-height: 1.15; letter-spacing: -.04em; text-wrap: balance; }
h2 { margin: 0; font-size: clamp(22px, 2vw, 30px); line-height: 1.25; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.lead { max-width: 68ch; margin: 10px 0 0; color: var(--muted-ink); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 32px 0 16px; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: clamp(18px, 3vw, 28px); }
.hero-card { overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); background: var(--brand-900); color: var(--white); border: 0; border-radius: var(--radius-lg); }
.hero-copy { padding: clamp(28px, 5vw, 56px); }
.hero-copy .eyebrow { color: var(--lime); }
.hero-copy h1 { color: var(--white); }
.hero-copy p { max-width: 58ch; color: #dceae4; }
.hero-side {
  min-height: 260px; display: grid; place-items: center; padding: 32px;
  background-color: var(--lime);
  background-image: radial-gradient(circle at 1px 1px, rgb(12 42 32 / 16%) 1px, transparent 0);
  background-size: 18px 18px;
  color: var(--brand-950);
}
.hero-number { text-align: center; }
.hero-number strong { display: block; font-size: clamp(54px, 8vw, 88px); line-height: .9; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.hero-number span { display: block; max-width: 16ch; margin: 14px auto 0; font-weight: 800; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 20px; }
.metric span { color: var(--muted-ink); font-size: 13px; }
.metric strong { display: block; margin-top: 5px; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric small { display: block; margin-top: 8px; color: var(--muted-ink); }

.btn {
  min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 18px; border: 1px solid transparent; border-radius: 12px;
  font-weight: 800; text-decoration: none; transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast), opacity var(--motion-fast);
}
.btn svg { width: 19px; height: 19px; stroke-width: 2; }
.btn-primary { background: var(--brand-900); color: var(--white); }
.btn-primary:hover { background: var(--brand-800); }
.btn-lime { background: var(--lime); color: var(--brand-950); }
.btn-lime:hover { background: var(--lime-strong); }
.btn-secondary { border-color: var(--line); background: var(--paper); color: var(--brand-900); }
.btn-secondary:hover { border-color: var(--brand-700); background: var(--brand-50); }
.btn-ghost { background: transparent; color: var(--brand-800); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #f0cbc6; }
.btn:disabled { cursor: not-allowed; opacity: .45; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }

.status, .chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1.3;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-success { color: var(--success); background: var(--success-bg); }
.status-warning { color: var(--warning); background: var(--warning-bg); }
.status-danger { color: var(--danger); background: var(--danger-bg); }
.status-info { color: var(--blue); background: var(--blue-bg); }
.chip { color: var(--brand-800); background: var(--brand-50); border: 1px solid var(--brand-100); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.progress-wrap { margin: 20px 0 28px; }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: var(--muted-ink); font-size: 13px; font-weight: 700; }
.progress { height: 8px; overflow: hidden; border-radius: 999px; background: var(--brand-100); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--brand-700); transition: width var(--motion-base); }

.form-card { width: min(720px, 100%); margin: 0 auto; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label, .field-label { display: block; margin-bottom: 7px; font-weight: 800; }
.required { color: var(--danger); }
.hint { display: block; margin-top: 6px; color: var(--muted-ink); font-size: 13px; }
.error-text { min-height: 20px; margin: 5px 0 0; color: var(--danger); font-size: 13px; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #b9c6c0;
  border-radius: 10px; background: var(--white); color: var(--ink);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
input:hover, select:hover, textarea:hover { border-color: var(--brand-700); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-bg); }
textarea { min-height: 108px; resize: vertical; }
.checkbox-row, .radio-row { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-row input, .radio-row input { width: 20px; height: 20px; min-height: 20px; margin: 2px 0 0; flex: 0 0 auto; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented label { margin: 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { min-height: 44px; display: inline-flex; align-items: center; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--muted-ink); font-weight: 700; cursor: pointer; }
.segmented input:checked + span { color: var(--brand-950); background: var(--brand-100); border-color: var(--brand-700); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }

.invite-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 20px; border-radius: 12px; color: var(--brand-950); background: var(--brand-100); }
.invite-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-900); color: var(--white); font-weight: 900; }
.invite-banner strong, .invite-banner span { display: block; }
.invite-banner span { margin-top: 2px; font-size: 13px; color: var(--muted-ink); }

.survey-list { display: grid; gap: 14px; }
.survey-item { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.survey-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.survey-item h3 { font-size: 16px; }
.survey-controls { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(120px, .65fr); gap: 12px; margin-top: 14px; }
.survey-controls label { font-size: 13px; color: var(--muted-ink); font-weight: 700; }
.survey-controls select, .survey-controls input { margin-top: 5px; }

.task-list { display: grid; gap: 10px; }
.task-row { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.task-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: var(--brand-100); color: var(--brand-900); }
.task-icon svg { width: 21px; height: 21px; }
.task-copy { min-width: 0; flex: 1; }
.task-copy strong, .task-copy span { display: block; }
.task-copy span { margin-top: 2px; color: var(--muted-ink); font-size: 13px; }
.task-row .btn { min-height: 42px; padding-block: 8px; }

.macro-panel { padding: 24px; }
.macro-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.macro-bars { display: grid; gap: 18px; }
.macro-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 92px; align-items: center; gap: 14px; }
.macro-label strong, .macro-label span { display: block; }
.macro-label span { color: var(--muted-ink); font-size: 12px; }
.bar-track { height: 12px; border-radius: 999px; overflow: hidden; background: #e6ebe8; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--brand-700); }
.bar-fill.warning { background: #d16a22; }
.bar-fill.danger { background: var(--danger); }
.macro-value { text-align: right; font-variant-numeric: tabular-nums; }
.macro-value strong, .macro-value span { display: block; }
.macro-value span { color: var(--muted-ink); font-size: 12px; }
.advice { display: flex; gap: 12px; margin-top: 20px; padding: 15px; border-left: 4px solid var(--warning); background: var(--warning-bg); color: #71380e; }
.advice svg { width: 21px; height: 21px; flex: 0 0 auto; }

.upload-zone {
  min-height: 220px; display: grid; place-items: center; padding: 28px; text-align: center;
  border: 2px dashed #9eb0a7; border-radius: var(--radius-md); background: var(--brand-50);
}
.upload-zone.has-image { padding: 10px; border-style: solid; background: var(--ink); }
.upload-zone img { width: 100%; max-height: 380px; object-fit: contain; border-radius: 11px; }
.upload-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 16px; background: var(--brand-100); color: var(--brand-900); }
.upload-icon svg { width: 28px; height: 28px; }
.upload-zone input { position: absolute; opacity: 0; pointer-events: none; }
.upload-zone label { display: inline-flex; margin-top: 12px; }
.demo-plate { width: 100%; max-width: 330px; aspect-ratio: 4 / 3; display: grid; place-items: center; border-radius: 14px; background: #eee5d0; }
.plate-svg { width: 82%; height: 82%; }

.result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.result-cell { padding: 14px; border-radius: 12px; background: var(--brand-50); }
.result-cell span { display: block; color: var(--muted-ink); font-size: 12px; }
.result-cell strong { display: block; margin-top: 4px; font-size: 20px; font-variant-numeric: tabular-nums; }

.plan-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, .75fr); overflow: hidden; }
.plan-hero-main { padding: clamp(22px, 4vw, 36px); }
.plan-hero-side { padding: 28px; background: var(--brand-900); color: var(--white); }
.plan-hero-side small { color: #c7d8d0; }
.plan-hero-side strong { display: block; margin-top: 8px; color: var(--lime); font-size: 40px; line-height: 1; }
.meal-table { width: 100%; border-collapse: collapse; }
.meal-table th, .meal-table td { padding: 15px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.meal-table th { color: var(--muted-ink); font-size: 13px; }
.meal-table td:first-child { width: 92px; font-weight: 900; color: var(--brand-800); }
.meal-table tr:last-child td { border-bottom: 0; }
.week-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.week-tab { min-width: 48px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--muted-ink); font-weight: 800; }
.week-tab.active { background: var(--brand-900); color: var(--white); }
.signature-box { padding: 22px; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 14px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.search-box { position: relative; width: min(360px, 100%); }
.search-box svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted-ink); }
.search-box input { padding-left: 42px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
.data-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted-ink); background: var(--brand-50); font-size: 13px; font-weight: 800; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background var(--motion-fast); }
.data-table tbody tr:hover { background: #fafbf7; }
.person { display: flex; align-items: center; gap: 11px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: var(--brand-100); color: var(--brand-900); font-weight: 900; }
.person strong, .person span { display: block; }
.person span { color: var(--muted-ink); font-size: 12px; }
.link-button { padding: 6px 0; border: 0; background: transparent; color: var(--brand-700); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.client-detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 16px; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ""; position: absolute; left: 18px; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
.timeline-row { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; padding: 10px 0; }
.timeline-dot { z-index: 1; width: 12px; height: 12px; margin: 7px auto 0; border-radius: 50%; background: var(--brand-700); box-shadow: 0 0 0 5px var(--paper); }
.timeline-row p { margin: 3px 0 0; color: var(--muted-ink); font-size: 13px; }

.coach-strip { padding: 24px; background: var(--brand-900); color: var(--white); border-radius: var(--radius-lg); }
.coach-strip p { color: #cee0d8; }
.coach-strip .metric { background: rgb(255 255 255 / 7%); border-color: rgb(255 255 255 / 14%); }
.coach-strip .metric span, .coach-strip .metric small { color: #cee0d8; }
.coach-strip .metric strong { color: var(--lime); }

.empty-state { padding: 48px 24px; text-align: center; }
.empty-state svg { width: 44px; height: 44px; color: var(--brand-700); }
.empty-state p { max-width: 44ch; margin: 10px auto 0; color: var(--muted-ink); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgb(4 19 13 / 62%); }
.modal { width: min(680px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 26px; border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-md); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); }
.icon-button svg { width: 20px; height: 20px; }

.toast { position: fixed; z-index: 200; right: 20px; bottom: 20px; max-width: min(380px, calc(100vw - 40px)); padding: 14px 16px; border-radius: 12px; background: var(--brand-950); color: var(--white); box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity var(--motion-base), transform var(--motion-base); }
.toast.show { opacity: 1; transform: translateY(0); }

.mobile-nav { display: none; }
.muted { color: var(--muted-ink); }
.small { font-size: 13px; }
.numeric { font-variant-numeric: tabular-nums; }
.divider { height: 1px; margin: 24px 0; background: var(--line); }
.spacer-16 { height: 16px; }
.spacer-24 { height: 24px; }
.text-right { text-align: right; }
.hidden { display: none !important; }

.print-sheet { display: none; }

/* 客户只使用手机端：桌面预览时也保持手机信息密度和底部导航。 */
.role-client .layout { grid-template-columns: 1fr; }
.role-client .sidebar { display: none; }
.role-client .main {
  width: 100%;
  padding: 24px 16px 104px;
}
.role-client .main-inner { width: min(520px, 100%); }
.role-client .page-head { display: block; margin-bottom: 20px; }
.role-client .page-head > .btn,
.role-client .page-head > div + div { width: 100%; margin-top: 14px; }
.role-client .hero-card,
.role-client .plan-hero,
.role-client .grid-2,
.role-client .grid-3,
.role-client .field-grid { grid-template-columns: 1fr; }
.role-client .field-full { grid-column: auto; }
.role-client .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.role-client .macro-row { grid-template-columns: 82px minmax(0, 1fr); gap: 10px; }
.role-client .macro-value {
  grid-column: 2;
  display: flex;
  align-items: baseline;
  gap: 6px;
  text-align: left;
}
.role-client .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.role-client .survey-controls { grid-template-columns: 1fr; }
.role-client .task-row { align-items: flex-start; flex-wrap: wrap; }
.role-client .task-row .btn { width: 100%; }
.role-client .meal-table th:nth-child(3),
.role-client .meal-table td:nth-child(3) { display: none; }
.role-client .mobile-nav {
  left: 50%;
  right: auto;
  width: min(520px, 100%);
  display: grid;
  transform: translateX(-50%);
  border-inline: 1px solid var(--line);
}
.public-client .topbar { justify-content: flex-start; }

@media (min-width: 768px) {
  .role-client .main {
    min-height: calc(100dvh - 72px);
    border-inline: 1px solid var(--line);
    background: var(--cream);
  }
  .role-client .topbar {
    padding-inline: max(24px, calc((100vw - 960px) / 2));
  }
}

@media (max-width: 1023px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding-inline: clamp(16px, 4vw, 32px); }
  .mobile-nav {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(4, 1fr); min-height: 68px;
    padding: 7px max(8px, env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    border-top: 1px solid var(--line); background: rgb(255 253 247 / 96%); backdrop-filter: blur(14px);
  }
  .mobile-nav button { min-height: 52px; display: grid; place-items: center; align-content: center; gap: 2px; border: 0; border-radius: 10px; background: transparent; color: var(--muted-ink); font-size: 11px; font-weight: 800; }
  .mobile-nav button.active { color: var(--brand-900); background: var(--brand-100); }
  .mobile-nav svg { width: 20px; height: 20px; }
  .client-detail { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .topbar { min-height: 64px; padding: 10px 16px; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .brand-copy span { display: none; }
  .role-switcher { gap: 2px; }
  .role-switcher button { min-height: 38px; padding: 7px 10px; font-size: 12px; }
  .main { padding-top: 24px; }
  .page-head { display: block; margin-bottom: 20px; }
  .page-head > .btn, .page-head > div + div { margin-top: 14px; }
  .hero-card, .plan-hero { grid-template-columns: 1fr; }
  .hero-side { min-height: 190px; }
  .grid-2, .grid-3, .field-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 16px; }
  .metric strong { font-size: 24px; }
  .macro-row { grid-template-columns: 82px minmax(0, 1fr); gap: 10px; }
  .macro-value { grid-column: 2; text-align: left; display: flex; gap: 6px; align-items: baseline; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-row { align-items: flex-start; flex-wrap: wrap; }
  .task-row .btn { width: 100%; }
  .survey-controls { grid-template-columns: 1fr; }
  .meal-table th:nth-child(3), .meal-table td:nth-child(3) { display: none; }
  .meal-table th, .meal-table td { padding-inline: 8px; }
  .btn-row .btn { flex: 1 1 150px; }
  .modal { padding: 20px; }
}

@media (max-width: 420px) {
  .role-switcher button span { display: none; }
  .role-switcher button::after { content: attr(data-short); }
  h1 { font-size: 30px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
}

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

@media print {
  body { background: white; color: black; }
  .topbar, .sidebar, .mobile-nav, .toast, .no-print, .main > *:not(.print-sheet) { display: none !important; }
  .layout, .main, .main-inner { display: block; width: 100%; max-width: none; padding: 0; margin: 0; }
  .print-sheet { display: block !important; padding: 12mm; font-size: 11pt; }
  .print-sheet h1 { max-width: none; font-size: 22pt; }
  .print-sheet h2 { margin-top: 18pt; font-size: 15pt; }
  .print-sheet table { width: 100%; border-collapse: collapse; }
  .print-sheet th, .print-sheet td { padding: 8pt; border: 1px solid #bbb; text-align: left; vertical-align: top; }
  .print-sheet .signature-line { margin-top: 28pt; padding-top: 12pt; border-top: 1px solid #333; }
}
