/* Native Murmi type roles. Keep layout in app.css; see docs/web-typography.md. */
@font-face {
  font-family: WixText;
  src: url('assets/WixMadeforText.ttf') format('truetype');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: WixDisplay;
  src: url('assets/WixMadeforDisplay.ttf') format('truetype');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-system: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font: WixText, var(--font-system);
  --font-display: WixDisplay, var(--font-system);
  --font-timer: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  --text-meta: .875rem;
  --text-secondary: .9375rem;
  --text-body: 1.0625rem;
  --text-title: 1.25rem;
  --text-section: 1.375rem;
  --text-dialog: 1.75rem;
  --text-value: 1.875rem;
  --text-page: 2.125rem;
  --text-metric: 2.5rem;
  --text-stat: 3rem;
  --text-balance: clamp(3rem, 4.2vw, 4rem);
  --leading-body: 1.5;
  --leading-reading: 1.6;
  --leading-label: 1.4;
  --leading-heading: 1.2;
}

html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font: 400 var(--text-body)/var(--leading-body) var(--font); }
button, input, textarea, select { font: inherit; letter-spacing: inherit; }
b, strong { font-weight: 600; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-heading);
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
h1 { font-size: var(--text-page); }
h2 { font-size: var(--text-section); }
h3 { font-size: var(--text-title); letter-spacing: -.015em; }

/* Ordinary reading stays at the iOS body size, including controls. */
.lead, .page-heading .lead, .auth-story-copy > p,
.ai-nudge p, .support-panel p, .empty-state p, .chat-empty p,
.connect-social p, .club-card p, .account-panel > p, .modal-body .lead,
.feature-tile p, .social-rules, .consent-list, .danger-note {
  font-size: var(--text-body);
  line-height: var(--leading-reading);
}
.lead, .account-panel > p, .connect-social p, .social-rules,
.analysis-notes, .consent-note, .danger-note { max-inline-size: 62ch; }
.message-text { font-size: var(--text-body); line-height: var(--leading-reading); }
input, textarea, select { font-size: var(--text-body); line-height: var(--leading-body); }
label, .file-label, .analysis-items, .connected-state, .chat-action-card,
.check-row, .sharing-controls label { font-size: var(--text-body); line-height: var(--leading-body); }
label { font-weight: 500; }
.check-row { font-weight: 500; }
.sharing-controls label { font-weight: 400; }
.btn, .text-button, .add-meal-line, .fasting-control, .modal-tabs button {
  font-size: var(--text-body);
  line-height: var(--leading-label);
  font-weight: 600;
}
.btn { min-height: 3.25rem; }
.modal-tabs button { font-weight: 500; }
.form-error, #toast { font-size: var(--text-body); line-height: var(--leading-body); }

/* Secondary copy is readable information, rather than decorative fine print. */
small, .muted, .form-hint, .back-link, .story-footer, .auth-welcome,
.auth-privacy, .sidebar-mascot p, .profile-link small, .sync-status,
.app-footer, .date-caption, .balance-label, .balance-note, .calorie-math,
.macro > div:first-child, .water-main p, .fasting-display p,
.food-description small, .habit-card > span:not(.icon), .message-author,
.chat-message > small, .chat-note, .chat-pending, .friend-card p,
.club-card .muted, .food-page-summary > div:not(.food-page-actions),
.progress-stats p, .chart-column, .bar-number, .chart-caption,
.analysis-notes, .consent-note, .action-saved, .sharing-controls .muted,
.friend-facts div, .friend-facts b, .chat-toolbar {
  font-size: var(--text-secondary);
  line-height: var(--leading-body);
}
small { font-weight: 400; }
.food-description small, .feature-description small { font-family: var(--font); }
.panel-top, .profile-link b, .message-author {
  font-family: var(--font);
  font-size: var(--text-secondary);
  line-height: var(--leading-label);
  font-weight: 600;
}
.feature-description small { font-weight: 400; }
.sidebar-mascot b { font-weight: 500; }
.tag, .workspace-label, .eyebrow {
  font-size: var(--text-meta);
  line-height: var(--leading-label);
}
.eyebrow, .workspace-label { font-weight: 500; letter-spacing: .04em; }

/* One hierarchy for every page, card, and sheet. */
.header-title { font-size: var(--text-body); line-height: var(--leading-label); }
.nav-item { font-size: var(--text-body); line-height: var(--leading-label); }
.nav-item.active, .avatar, .auth-sticker { font-weight: 600; }
.avatar { font-size: var(--text-body); line-height: 1; }
.auth-form-wrap h2, .welcome-panel h1 { font-size: var(--text-page); }
.auth-story h1 { font-size: clamp(2.125rem, 3vw, 3rem); line-height: 1.15; }
.auth-welcome { font-weight: 500; }
.auth-privacy { line-height: var(--leading-reading); }
.connect-social h2, .chat-empty h2 { font-size: var(--text-dialog); }
.ai-nudge h2 { font-size: var(--text-dialog); font-weight: 600; }
.account-panel h2, .modal-header h2 { font-size: var(--text-dialog); }
.feature-panel h2, .feature-tile h2 { font-size: var(--text-section); }
.privacy-settings h3 { font-size: var(--text-title); }
.sharing-controls legend { font-size: var(--text-body); font-weight: 600; line-height: var(--leading-label); }
.food-description b { font-size: var(--text-body); font-weight: 600; line-height: var(--leading-label); }
.social-day summary, .social-self summary { font-weight: 600; }
.auth-sticker { font-size: var(--text-body); }

/* Display is intentional for values, not inherited accidentally from body Text. */
.balance-number, .water-main strong, .fasting-display strong,
.food-page-summary strong, .feature-number, .progress-stats strong,
.food-calories b, .habit-card b {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.025em;
}
.balance-number { font-size: var(--text-balance); letter-spacing: -.035em; }
.water-main strong, .feature-number, .food-page-summary strong { font-size: var(--text-metric); }
.progress-stats strong { font-size: var(--text-stat); }
.fasting-display strong { font-size: var(--text-value); }
.habit-card b { font-size: var(--text-section); }
.food-calories b { font-size: var(--text-title); }
.balance-number small, .water-main strong small, .feature-number small,
.food-page-summary strong small, .progress-stats strong small {
  font-family: var(--font);
  font-size: var(--text-body);
  font-weight: 500;
  line-height: var(--leading-label);
  letter-spacing: normal;
}
/* The shipped Wix files have no tnum feature. Only a running timer uses mono. */
.fasting-display .timer-digits, .code-input {
  font-family: var(--font-timer);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
}
.code-input { font-size: var(--text-dialog); letter-spacing: .2em; }
.invite-code { font-size: var(--text-dialog); font-weight: 600; letter-spacing: .08em; line-height: var(--leading-heading); }

.wordmark { font-family: var(--font-display); font-size: 2.5rem; font-weight: 800; line-height: 1.1; letter-spacing: -.065em; }
.wordmark span { font: 700 1.4375rem/1 var(--font); letter-spacing: normal; }
.plate-spark { font-size: 2.5rem; line-height: 1; }

/* Allow larger user text and longer labels to grow instead of squeezing them. */
.app-header { height: auto; min-height: 5.5rem; padding-block: .75rem; }
.header-actions, .page-heading, .panel-top, .section-heading { min-width: 0; }
.panel-top { flex-wrap: wrap; }
.day-picker { flex-wrap: wrap; max-inline-size: 100%; }
.date-field { min-width: 0; }
.date-field input { width: 8.5em; max-width: 100%; font-size: var(--text-body); }
.macro > div:first-child { flex-wrap: wrap; }
.macro > div:first-child > span { white-space: normal; }
.water-main, .fasting-display { flex-wrap: wrap; }
.water-main strong { white-space: normal; }
.fasting-display > div { min-width: 0; }
.fasting-display strong { white-space: normal; overflow-wrap: anywhere; }
.feature-number { overflow-wrap: anywhere; }
.btn, .text-button { white-space: normal; overflow-wrap: anywhere; }
.food-description, .food-calories, .chart-caption, .feature-description { min-width: 0; }
.food-calories { max-inline-size: 40%; overflow-wrap: anywhere; }
.action-saved { white-space: normal; }
.chat-toolbar { flex-wrap: wrap; }
.bar-number { overflow-wrap: anywhere; }
.chat-message, .chat-prompts .btn, .chat-action-card { overflow-wrap: anywhere; }

@media (max-width: 1024px) and (min-width: 768px) {
  .sidebar > .wordmark { font-size: 0; }
  .sidebar > .wordmark::before { font-size: 2.5rem; letter-spacing: -.065em; }
}
@media (max-width: 767px) {
  .header-title { font-family: var(--font-display); font-size: var(--text-section); font-weight: 700; letter-spacing: -.025em; }
  .app-header { min-height: 4.5625rem; }
  .app-footer { padding-bottom: calc(var(--mobile-nav-space, 7rem) + 1.5rem + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(var(--mobile-nav-space, 7rem) + 1rem); }
  .date-field input { width: 8em; }
  .mobile-nav { font-size: var(--text-meta); grid-template-columns: repeat(auto-fit, minmax(min(100%, 4em), 1fr)); }
  .mobile-nav .nav-item { font-size: var(--text-meta); line-height: 1.25; letter-spacing: normal; }
  .mobile-nav .nav-item > span:not(.icon) { overflow-wrap: normal; }
  .auth-story h1 { font-size: var(--text-page); }
  .modal-header h2, .account-panel h2 { font-size: var(--text-section); }
  .feature-number, .water-main strong, .food-page-summary strong { font-size: var(--text-page); }
  .progress-stats strong { font-size: var(--text-metric); }
  .nutrition-center .balance-number { font-size: var(--text-balance); line-height: 1.15; letter-spacing: -.035em; }
  .nutrition-center .balance-number small { font-size: var(--text-body); line-height: var(--leading-label); letter-spacing: normal; }
  .nutrition-panel .macro > div:first-child { flex-wrap: wrap; font-size: var(--text-secondary); }
  .nutrition-panel .macro > div:first-child > span { white-space: normal; }
  .nutrition-panel .macro > div:first-child > span:last-child { font-size: inherit; }
  .nutrition-center .plate-spark { font-size: 1.9375rem; }
  .nutrition-footer .btn { flex-basis: 100%; }
  .progress-stats .panel { grid-template-columns: minmax(0, 1fr); }
  .progress-stats strong { grid-column: 1; grid-row: auto; }
  .progress-stats p, .progress-stats .text-button { grid-column: 1; }
  .sun-grid .support-panel .btn { white-space: normal; }
}
@media (max-width: 350px) {
  .mobile-nav .nav-item { font-size: .8125rem; }
  .date-field input { width: 7.25em; }
  .day-picker { gap: .375rem; }
  .mobile-nav .nav-item:last-child > span:not(.icon) { white-space: normal; overflow-wrap: normal; }
}
