:root {
  --brand: oklch(0.56 0.15 151);
  --brand-strong: oklch(0.43 0.13 151);
  --brand-deep: oklch(0.31 0.08 151);
  --brand-soft: oklch(0.95 0.035 151);
  --canvas: oklch(0.985 0.006 151);
  --surface: oklch(1 0 0);
  --surface-muted: oklch(0.965 0.009 151);
  --ink: oklch(0.22 0.025 151);
  --muted: oklch(0.46 0.025 151);
  --faint: oklch(0.62 0.018 151);
  --line: oklch(0.9 0.016 151);
  --line-strong: oklch(0.82 0.026 151);
  --orange: oklch(0.73 0.16 55);
  --blue: oklch(0.66 0.13 250);
  --coral: oklch(0.67 0.18 28);
  --danger: oklch(0.52 0.2 28);
  --danger-soft: oklch(0.96 0.035 28);
  --warning: oklch(0.66 0.14 80);
  --radius-sm: 8px;
  --radius: 14px;
  --nav-height: 70px;
  --header-height: 58px;
  --z-sticky: 20;
  --z-dialog: 40;
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: oklch(0.94 0.012 151);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--canvas);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; text-decoration: none; }

button { color: inherit; }

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.liff-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: clip;
  background: var(--canvas);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  min-height: calc(var(--header-height) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  border-bottom: 1px solid color-mix(in oklch, var(--line) 78%, transparent);
  background: color-mix(in oklch, var(--canvas) 94%, transparent);
  backdrop-filter: blur(14px);
}

.app-header-title {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 760;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-header > :first-child { justify-self: start; }
.app-header > :last-child { justify-self: end; }

.app-header-actions {
  display: flex;
  min-width: 42px;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}

.header-spacer { width: 42px; height: 42px; }

.header-avatar {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible { background: var(--surface-muted); }

.icon-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.text-action:focus-visible,
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--brand) 34%, transparent);
  outline-offset: 2px;
}

.icon-button svg { width: 22px; height: 22px; }

.notification-bell { position: relative; flex: 0 0 42px; }
.notification-bell.has-unread { color: var(--ink); }
.notification-unread-dot {
  position: absolute;
  top: 8px;
  right: 7px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--canvas);
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--danger) 18%, transparent);
}

.icon-button-soft {
  width: 38px;
  height: 38px;
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.icon-button.is-disabled { color: var(--faint); opacity: .55; }

.text-action {
  display: inline-flex;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  color: var(--brand-strong);
  background: transparent;
  font-size: 14px;
  font-weight: 720;
  white-space: nowrap;
  cursor: pointer;
}

.liff-main {
  min-height: calc(100dvh - var(--header-height));
  padding: 14px 14px calc(var(--nav-height) + 26px + env(safe-area-inset-bottom));
}

.notification-toolbar {
  display: flex;
  min-height: 52px;
  margin-bottom: 10px;
  padding: 3px 2px 8px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.notification-toolbar > div { display: grid; gap: 1px; }
.notification-toolbar strong { font-size: 13px; }
.notification-toolbar span { color: var(--muted); font-size: 10px; }
.notification-read-all {
  min-height: 36px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  color: var(--brand-strong);
  background: transparent;
  font-size: 11px;
  font-weight: 780;
  cursor: pointer;
}
.notification-read-all:hover,
.notification-read-all:focus-visible { background: var(--brand-soft); }
.notification-read-all:disabled { color: var(--faint); cursor: default; }
.notification-read-all:disabled:hover { background: transparent; }

.notification-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.notification-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 18px;
  min-height: 102px;
  padding: 14px 12px;
  align-items: start;
  gap: 10px;
  border-top: 1px solid var(--line);
}
.notification-row:first-child { border-top: 0; }
.notification-row:hover,
.notification-row:focus-visible { background: var(--surface-muted); }
.notification-row.is-unread { background: color-mix(in oklch, var(--brand-soft) 54%, white); }
.notification-row.is-unread:hover,
.notification-row.is-unread:focus-visible { background: var(--brand-soft); }
.notification-row > svg { width: 17px; height: 17px; margin-top: 3px; color: var(--faint); }
.notification-category {
  display: inline-flex;
  min-height: 24px;
  padding: 0 8px;
  align-items: center;
  border-radius: 999px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  font-size: 9px;
  font-weight: 820;
  white-space: nowrap;
}
.notification-category.is-event { color: oklch(0.42 0.14 55); background: oklch(0.95 0.05 70); }
.notification-category.is-maintenance { color: oklch(0.43 0.11 250); background: oklch(0.95 0.035 250); }
.notification-category.is-notice { color: var(--muted); background: var(--surface-muted); }
.notification-row-copy { display: grid; min-width: 0; gap: 4px; }
.notification-row-title { display: flex; min-width: 0; align-items: center; gap: 7px; }
.notification-row-title strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.notification-row-title i { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.notification-row-copy > span:nth-child(2) { color: var(--muted); font-size: 10px; line-height: 1.55; }
.notification-row-copy small { color: var(--faint); font-size: 9px; }

.notification-empty {
  display: grid;
  min-height: 330px;
  padding: 36px 22px;
  place-items: center;
  align-content: center;
  text-align: center;
}
.notification-empty > span { display: grid; width: 66px; height: 66px; margin-bottom: 16px; place-items: center; border-radius: 21px; color: var(--brand-strong); background: var(--brand-soft); }
.notification-empty svg { width: 28px; height: 28px; }
.notification-empty h1 { margin: 0 0 6px; font-size: 18px; }
.notification-empty p { max-width: 270px; margin: 0; color: var(--muted); font-size: 11px; }

.notification-detail {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.notification-detail > header { padding: 22px 17px 19px; border-bottom: 1px solid var(--line); background: linear-gradient(145deg, var(--surface), var(--brand-soft)); }
.notification-detail h1 { margin: 13px 0 7px; font-size: 24px; line-height: 1.25; letter-spacing: -.025em; }
.notification-detail time { display: block; color: var(--faint); font-size: 9px; }
.notification-detail header p { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.notification-body { min-height: 190px; padding: 22px 17px 30px; color: var(--ink); font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
.notification-back-link { margin-top: 12px; }

.bottom-nav {
  position: fixed;
  z-index: var(--z-sticky);
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 480px);
  min-height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  margin: 0 auto;
  padding: 6px 10px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface) 96%, transparent);
  backdrop-filter: blur(16px);
}

.bottom-nav-item {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 650;
}

.bottom-nav-item svg { width: 22px; height: 22px; }
.bottom-nav-item.is-active { color: var(--brand-strong); }
html[data-liff-navigation="loading"] .bottom-nav { opacity: .72; }
.bottom-nav-item.is-active::before {
  position: absolute;
  top: 0;
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: var(--brand);
  content: "";
}

.nav-pro-badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 9px);
  padding: 1px 4px;
  color: white;
  border-radius: 999px;
  background: var(--brand-strong);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .04em;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 760;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(.22, 1, .36, 1), background 180ms ease, opacity 180ms ease;
}

.primary-button {
  color: white;
  border: 1px solid var(--brand-strong);
  background: var(--brand-strong);
}

.primary-button:hover { background: var(--brand-deep); }
.primary-button:active,
.secondary-button:active { transform: translateY(1px); }

.primary-button:disabled,
.secondary-button:disabled { cursor: wait; opacity: .62; }

.secondary-button {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.text-link {
  display: inline-flex;
  min-height: 44px;
  padding: 0 10px;
  align-items: center;
  justify-content: center;
  color: var(--brand-strong);
  font-weight: 700;
}

.date-banner {
  display: flex;
  min-height: 58px;
  padding: 8px 10px 8px 14px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.date-banner > div { display: flex; flex-direction: column; }
.date-banner strong { font-size: 15px; }
.date-banner span { color: var(--muted); font-size: 12px; }

.calorie-hero {
  display: grid;
  padding: 22px 0 16px;
  place-items: center;
}

.calorie-ring {
  display: grid;
  width: 168px;
  height: 168px;
  padding: 11px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--brand) var(--progress), var(--line) 0);
}

.calorie-ring-inner {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 50%;
  background: var(--canvas);
}

.calorie-ring strong { font-size: 38px; font-weight: 760; line-height: 1; letter-spacing: -.035em; }
.calorie-ring span { margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.calorie-goal { margin-top: 10px; color: var(--brand-strong); font-size: 12px; font-weight: 700; }

.macro-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0 6px 18px;
}

.macro-label { display: flex; margin-bottom: 7px; align-items: baseline; justify-content: space-between; gap: 4px; }
.macro-label span { color: var(--muted); font-size: 11px; }
.macro-label strong { font-size: 12px; }

.progress-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.progress-track.is-large { height: 9px; }
.progress-fill { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--brand); }
.progress-fill.is-orange, .is-orange { background: var(--orange); }
.progress-fill.is-blue, .is-blue { background: var(--blue); }
.progress-fill.is-coral, .is-coral { background: var(--coral); }
.progress-fill.is-green, .is-green { background: var(--brand); }

.insight-panel,
.recent-meals,
.quota-card,
.report-chart-card,
.report-macros,
.weight-chart-card,
.weight-list-section,
.form-section,
.detail-section,
.nutrition-detail,
.analysis-note,
.pricing-options,
.plan-comparison,
.subscription-actions,
.billing-note {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-heading-row h2,
.form-section h2,
.analysis-note h2,
.report-macros h2,
.pricing-options h2,
.billing-note h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 760;
}

.section-heading-row p,
.field-help { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.section-heading-row > a { min-height: 36px; color: var(--brand-strong); font-size: 12px; font-weight: 720; }

.status-chip,
.membership-chip,
.pro-chip {
  display: inline-flex;
  min-height: 24px;
  padding: 0 9px;
  align-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-muted);
  font-size: 10px;
  font-weight: 760;
}

.status-chip.is-success,
.membership-chip.is-pro {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.pro-chip { color: white; background: var(--brand-strong); letter-spacing: .05em; }
.insight-copy { margin: 13px 0; color: var(--muted); font-size: 13px; }
.insight-copy strong { color: var(--ink); }

.compact-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.compact-stats div { display: flex; min-height: 62px; align-items: center; justify-content: center; flex-direction: column; border-right: 1px solid var(--line); }
.compact-stats div:last-child { border-right: 0; }
.compact-stats span { color: var(--muted); font-size: 10px; }
.compact-stats strong { font-size: 15px; }

.meal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 66px;
  padding: 10px 0;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.meal-row:first-of-type { margin-top: 10px; }
.meal-row-copy { display: flex; min-width: 0; flex-direction: column; }
.meal-row-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.meal-row-copy small { color: var(--muted); font-size: 10px; }
.meal-row > b { font-size: 14px; }
.meal-row > b small { color: var(--muted); font-size: 9px; font-weight: 600; }

.day-controller {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.day-controller strong { font-size: 15px; }

.month-calendar {
  margin: 14px 0 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.month-calendar-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  min-height: 42px;
  align-items: center;
  text-align: center;
}
.month-calendar-head strong { font-size: 13px; }
.month-calendar-weekdays,
.month-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-calendar-weekdays { margin: 4px 0; color: var(--muted); font-size: 10px; font-weight: 700; text-align: center; }
.month-calendar-grid { row-gap: 2px; }
.calendar-day {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 42px;
  place-items: center;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
}
.calendar-day:hover,
.calendar-day:focus-visible { background: var(--surface-muted); }
.calendar-day.is-active { color: white; background: var(--brand-strong); }
.calendar-day.is-today:not(.is-active) { color: var(--brand-strong); background: var(--brand-soft); }
.calendar-day.is-adjacent { color: var(--faint); }
.calendar-day.is-disabled { color: var(--faint); opacity: .38; }
.calendar-day i { position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--brand); }
.calendar-day.is-active i { background: white; }

.week-strip {
  display: flex;
  margin: 14px -14px 16px;
  padding: 0 14px 4px;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.week-strip::-webkit-scrollbar { display: none; }

.week-day {
  position: relative;
  display: flex;
  min-width: 43px;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.week-day span { font-size: 14px; font-weight: 720; }
.week-day small { color: var(--muted); font-size: 9px; }
.week-day i { position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--brand); }
.week-day.is-active { color: white; border-color: var(--brand-strong); background: var(--brand-strong); }
.week-day.is-active small { color: color-mix(in oklch, white 76%, var(--brand-strong)); }
.week-day.is-active i { background: white; }

.day-summary-line {
  display: flex;
  margin-bottom: 10px;
  padding: 0 2px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.day-summary-line strong { color: var(--ink); font-size: 14px; }
.meal-list { display: grid; gap: 12px; }

.meal-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.meal-card.is-excluded { opacity: .68; }
.meal-card-title { padding: 13px 13px 11px; border-bottom: 1px solid var(--line); }
.meal-card-title span,
.meal-detail-title span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 680; }
.meal-card-title h2 { margin: 0; font-size: 16px; line-height: 1.35; text-wrap: pretty; }
.meal-card-head { display: flex; min-height: 52px; padding: 10px 13px; align-items: center; justify-content: space-between; }
.meal-card-head > div { display: flex; align-items: baseline; gap: 7px; }
.meal-card-head strong { color: var(--brand-strong); font-size: 13px; }
.meal-card-head span { color: var(--muted); font-size: 10px; }
.meal-card-head > b { font-size: 15px; }
.meal-card-head > b small { color: var(--muted); font-size: 10px; }
.meal-card-body { padding: 0 13px 13px; }
.meal-card-summary { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.55; text-wrap: pretty; }
.meal-card-macros { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.meal-card-macros b { color: var(--ink); }
.excluded-note { margin: 10px 0 0; color: var(--warning); font-size: 10px; }

.empty-state,
.premium-gate {
  display: flex;
  min-height: calc(100dvh - var(--header-height) - var(--nav-height) - 40px);
  padding: 32px 18px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.empty-icon,
.premium-lock {
  display: grid;
  width: 78px;
  height: 78px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.empty-icon svg,
.premium-lock svg { width: 36px; height: 36px; }
.empty-state h1,
.premium-gate h1 { margin: 0 0 10px; font-size: 21px; }
.empty-state p,
.premium-gate p { max-width: 30ch; margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.empty-state .primary-button,
.empty-state .secondary-button,
.premium-gate .primary-button { max-width: 280px; margin-top: 8px; }
.empty-state .secondary-button { border: 0; background: transparent; }

.meal-detail-title { margin-bottom: 4px; padding: 4px 2px 12px; }
.meal-detail-title h1 { margin: 0; font-size: 21px; line-height: 1.35; text-wrap: pretty; }
.meal-detail-heading {
  display: flex;
  min-height: 50px;
  padding: 3px 2px 12px;
  align-items: center;
  justify-content: space-between;
}

.meal-detail-heading div { display: flex; flex-direction: column; }
.meal-detail-heading span { color: var(--brand-strong); font-size: 14px; font-weight: 760; }
.meal-detail-heading small { color: var(--muted); font-size: 10px; font-weight: 600; }
.meal-detail-heading > strong { font-size: 16px; }
.meal-summary-copy { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.6; text-wrap: pretty; }

.food-list { display: grid; }
.food-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; min-height: 42px; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.food-list > div:first-child { border-top: 0; }
.food-list strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.food-list span { color: var(--muted); font-size: 10px; }
.food-list b { font-size: 11px; }
.food-list.is-compact { margin-top: 8px; }

.nutrition-detail { display: grid; grid-template-columns: 124px minmax(0, 1fr); align-items: center; gap: 16px; }
.nutrition-ring {
  display: flex;
  width: 116px;
  height: 116px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 10px solid var(--brand-soft);
  border-top-color: var(--orange);
  border-right-color: var(--blue);
  border-bottom-color: var(--coral);
  border-radius: 50%;
}
.nutrition-ring strong { font-size: 24px; line-height: 1; }
.nutrition-ring span { color: var(--muted); font-size: 9px; }
.nutrition-legend { display: grid; gap: 9px; }
.nutrition-legend > div { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto 30px; align-items: center; gap: 6px; font-size: 10px; }
.nutrition-legend strong { font-size: 11px; }
.nutrition-legend small { color: var(--muted); text-align: right; }
.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.is-orange { background: var(--orange); }
.dot.is-blue { background: var(--blue); }
.dot.is-coral { background: var(--coral); }

.mini-nutrition-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.mini-nutrition-grid div { display: flex; min-height: 66px; align-items: center; justify-content: center; flex-direction: column; border-right: 1px solid var(--line); }
.mini-nutrition-grid div:last-child { border-right: 0; }
.mini-nutrition-grid span { color: var(--muted); font-size: 10px; }
.mini-nutrition-grid strong { font-size: 14px; }

.analysis-note { color: var(--brand-deep); background: var(--brand-soft); }
.analysis-note-title { display: flex; align-items: center; gap: 8px; }
.analysis-note-title svg { width: 19px; height: 19px; }
.analysis-note p { margin: 8px 0 0; font-size: 12px; }
.muted-copy { margin: 8px 0 0; color: var(--muted); font-size: 12px; }

.toast,
.form-error,
.subscription-notice,
.subscription-feedback {
  margin-bottom: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 12px;
}
.toast.is-success,
.subscription-notice.is-success { color: var(--brand-deep); background: var(--brand-soft); }
.form-error { color: var(--danger); background: var(--danger-soft); }

.edit-form { display: grid; gap: 0; }
.field-label { display: block; margin: 13px 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.field-label:first-child { margin-top: 0; }
input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
}
input,
select { padding-top: 0; padding-bottom: 0; }
textarea { min-height: 86px; resize: vertical; }
input::placeholder { color: var(--muted); }

.toggle-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; margin-top: 15px; align-items: center; gap: 10px; cursor: pointer; }
.toggle-row span { display: flex; flex-direction: column; }
.toggle-row strong { font-size: 12px; }
.toggle-row small { color: var(--muted); font-size: 10px; }
.toggle-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-row i { position: relative; display: block; width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); transition: background 180ms ease; }
.toggle-row i::after { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: white; content: ""; transition: transform 180ms cubic-bezier(.22, 1, .36, 1); }
.toggle-row input:checked + i { background: var(--brand); }
.toggle-row input:checked + i::after { transform: translateX(18px); }
.toggle-row input:focus-visible + i { outline: 3px solid color-mix(in oklch, var(--brand) 34%, transparent); outline-offset: 2px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 8px; gap: 12px; }
.field-grid label span { display: flex; margin-bottom: 5px; align-items: baseline; justify-content: space-between; color: var(--muted); font-size: 10px; }
.field-grid label small { font-size: 9px; }
.sticky-actions { position: sticky; bottom: calc(var(--nav-height) + env(safe-area-inset-bottom)); z-index: 5; display: grid; grid-template-columns: .8fr 1.2fr; margin: 0 -14px; padding: 10px 14px; gap: 10px; border-top: 1px solid var(--line); background: color-mix(in oklch, var(--canvas) 95%, transparent); backdrop-filter: blur(14px); }
.delete-form { margin-top: 14px; text-align: center; }
.delete-form button { min-height: 44px; padding: 0 16px; border: 0; color: var(--danger); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }

.premium-gate { padding-top: 22px; }
.premium-gate .pro-chip { margin-bottom: 10px; }
.preview-report { display: flex; width: min(270px, 100%); height: 90px; margin: 0 0 18px; padding: 12px; align-items: end; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.preview-report span { width: 20px; border-radius: 4px 4px 0 0; background: var(--brand-soft); }
.benefit-list { width: min(280px, 100%); margin: 0 0 12px; padding: 0; list-style: none; text-align: left; }
.benefit-list li { position: relative; padding: 7px 0 7px 27px; font-size: 12px; }
.benefit-list li::before { position: absolute; top: 7px; left: 0; display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: white; background: var(--brand); font-size: 10px; content: "✓"; }

.report-period { display: flex; margin: 2px 2px 14px; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 730; }
.report-overview { display: grid; grid-template-columns: minmax(0, 1fr) 112px; margin-bottom: 12px; padding: 18px; align-items: center; gap: 16px; border-radius: var(--radius); color: white; background: var(--brand-deep); }
.report-primary { display: flex; flex-direction: column; }
.report-primary > span { color: color-mix(in oklch, white 72%, var(--brand-deep)); font-size: 11px; }
.report-primary strong { margin-top: 5px; font-size: 27px; line-height: 1; letter-spacing: -.025em; }
.report-primary strong small { font-size: 11px; }
.report-primary p { margin: 8px 0 0; color: color-mix(in oklch, white 72%, var(--brand-deep)); font-size: 10px; }
.adherence-ring { display: grid; width: 92px; height: 92px; padding: 7px; place-items: center; border-radius: 50%; background: conic-gradient(white var(--progress), color-mix(in oklch, white 17%, transparent) 0); }
.adherence-ring div { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; flex-direction: column; border-radius: 50%; background: var(--brand-deep); }
.adherence-ring strong { font-size: 18px; }
.adherence-ring span { font-size: 8px; }

.bar-chart { display: grid; grid-template-columns: repeat(7, 1fr); height: 180px; margin-top: 12px; align-items: end; gap: 8px; border-bottom: 1px solid var(--line); }
.bar-column { display: flex; height: 100%; align-items: center; justify-content: end; flex-direction: column; gap: 5px; }
.bar-column i { display: block; width: 68%; min-height: 5px; border-radius: 4px 4px 0 0; background: color-mix(in oklch, var(--brand) 78%, white); }
.bar-column small { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.bar-value { color: var(--muted); font-size: 8px; }
.chart-goal-line { margin-top: 7px; color: var(--muted); font-size: 9px; text-align: right; }

.report-macro-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 11px 0; gap: 4px 10px; border-top: 1px solid var(--line); font-size: 11px; }
.report-macro-row:first-of-type { margin-top: 10px; }
.report-macro-row > strong { font-size: 11px; }
.report-macro-row > div { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 999px; background: var(--line); }
.report-macro-row i { display: block; height: 100%; max-width: 100%; border-radius: inherit; }
.coach-note { display: grid; grid-template-columns: 38px minmax(0, 1fr); margin-bottom: 12px; padding: 16px; gap: 12px; border-radius: var(--radius); color: var(--brand-deep); background: var(--brand-soft); }
.coach-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; color: white; background: var(--brand-strong); font-size: 11px; font-weight: 850; }
.coach-note h2 { margin: 0 0 4px; font-size: 14px; }
.coach-note p { margin: 0; font-size: 11px; }

.adjustment-gate { position: relative; min-height: 112px; margin-bottom: 12px; overflow: hidden; border-radius: var(--radius); }
.adjustment-gate .coach-note { min-height: 112px; margin: 0; }
.adjustment-gate.is-locked .coach-note { filter: blur(5px); opacity: .65; user-select: none; }
.feature-lock-card {
  position: absolute;
  inset: 0;
  display: flex;
  padding: 14px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  color: var(--ink);
  background: color-mix(in oklch, var(--surface) 72%, transparent);
  backdrop-filter: blur(7px);
  text-align: center;
}
.feature-lock-card strong { font-size: 12px; }
.feature-lock-card a { min-height: 36px; padding: 7px 12px; color: var(--brand-strong); font-size: 11px; font-weight: 760; }

.weight-summary { padding: 8px 4px 18px; }
.weight-summary > span { color: var(--muted); font-size: 11px; }
.weight-summary > strong { display: block; margin-top: 4px; font-size: 34px; line-height: 1.1; letter-spacing: -.03em; }
.weight-summary > strong small { font-size: 14px; }
.weight-summary p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.weight-summary b { color: var(--brand-strong); }
.weight-chart-card { position: relative; min-height: 224px; padding: 13px 12px 8px 34px; }
.weight-chart { display: block; width: 100%; height: 178px; overflow: visible; }
.weight-grid-line { stroke: var(--line); stroke-width: 1; }
.weight-line { stroke: var(--brand); stroke-width: 2.5; }
.weight-chart circle { fill: var(--surface); stroke: var(--brand); stroke-width: 2.2; }
.weight-axis { position: absolute; top: 23px; bottom: 36px; left: 8px; display: flex; justify-content: space-between; flex-direction: column; color: var(--muted); font-size: 8px; }
.weight-chart-dates { display: flex; padding: 0 8px; justify-content: space-between; color: var(--muted); font-size: 9px; }
.empty-chart { display: flex; min-height: 190px; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); text-align: center; }
.empty-chart svg { width: 38px; height: 38px; color: var(--brand); }
.empty-chart p { max-width: 24ch; margin: 10px 0 0; font-size: 12px; }
.weight-list { display: grid; margin-top: 8px; }
.weight-list > div { display: flex; min-height: 46px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.weight-list span { color: var(--muted); font-size: 11px; }
.weight-list strong { font-size: 13px; }

.paid-feature-frame { position: relative; min-height: 520px; }
.paid-feature-frame.is-locked { overflow: hidden; border-radius: var(--radius); }
.paid-feature-frame.is-locked .paid-feature-content { filter: blur(6px); opacity: .64; pointer-events: none; user-select: none; }
.report-feature-frame.is-locked .paid-feature-content { filter: blur(9px); opacity: .5; }
.paid-feature-lock {
  position: absolute;
  inset: 0;
  display: flex;
  min-height: 520px;
  padding: 28px 20px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: color-mix(in oklch, var(--canvas) 68%, transparent);
  backdrop-filter: blur(8px);
  text-align: center;
}
.paid-feature-lock .premium-lock { width: 66px; height: 66px; margin-bottom: 10px; }
.paid-feature-lock .pro-chip { margin-bottom: 8px; }
.paid-feature-lock h1 { margin: 0 0 8px; font-size: 20px; }
.paid-feature-lock p { max-width: 29ch; margin: 0 0 16px; color: var(--muted); font-size: 12px; }
.paid-feature-lock .primary-button { max-width: 260px; }

.app-dialog {
  width: min(100% - 28px, 420px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 20px color-mix(in oklch, var(--ink) 18%, transparent);
}
.app-dialog::backdrop { background: color-mix(in oklch, var(--ink) 54%, transparent); backdrop-filter: blur(3px); }
.app-dialog form { padding: 18px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { margin: 0; font-size: 17px; }
.app-dialog .primary-button { margin-top: 18px; }

.profile-hero { display: grid; grid-template-columns: 66px minmax(0, 1fr); padding: 18px 6px 22px; align-items: center; gap: 14px; }
.profile-hero img { width: 66px; height: 66px; object-fit: cover; border: 1px solid var(--line); border-radius: 50%; }
.profile-hero h1 { margin: 0 0 5px; overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.quota-card .section-heading-row > strong { font-size: 13px; }
.quota-card .progress-track { margin-top: 13px; }

.menu-list { margin-bottom: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.menu-list > a { display: grid; grid-template-columns: 38px minmax(0, 1fr) 22px; min-height: 68px; padding: 10px 12px; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.menu-list > a:first-child { border-top: 0; }
.menu-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 9px; color: var(--brand-strong); background: var(--brand-soft); }
.menu-icon svg { width: 19px; height: 19px; }
.menu-list > a > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.menu-list strong { font-size: 13px; }
.menu-list small { color: var(--muted); font-size: 10px; }
.menu-arrow { width: 18px; height: 18px; color: var(--faint); }
.menu-section-label { margin: 18px 4px 7px; color: var(--muted); font-size: 10px; font-weight: 760; letter-spacing: .08em; }
.legal-menu-list .menu-icon { color: var(--ink); background: var(--surface-muted); }
.account-note { padding: 4px 10px; color: var(--muted); font-size: 10px; text-align: center; }

.friend-id-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
  padding: 14px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.friend-id-panel > div { display: flex; min-width: 0; flex-direction: column; }
.friend-id-panel span { color: var(--muted); font-size: 10px; }
.friend-id-panel strong { font-size: 15px; letter-spacing: .08em; }
.compact-button { width: auto; min-height: 42px; padding: 0 13px; font-size: 12px; }
.friend-switcher { display: flex; margin: 0 -14px 12px; padding: 0 14px 3px; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.friend-switcher::-webkit-scrollbar { display: none; }
.friend-chip { display: flex; min-width: 98px; max-width: 150px; min-height: 54px; padding: 7px 10px; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.friend-chip > span { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 50%; color: var(--brand-strong); background: var(--brand-soft); font-size: 12px; font-weight: 800; }
.friend-chip strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.friend-chip.is-active { color: white; border-color: var(--brand-strong); background: var(--brand-strong); }
.friend-chip.is-active > span { color: var(--brand-deep); background: white; }
.friend-overview { margin-bottom: 12px; padding: 16px; border-radius: var(--radius); color: white; background: var(--brand-deep); }
.friend-overview .section-heading-row p { color: color-mix(in oklch, white 72%, var(--brand-deep)); }
.friend-overview .status-chip { color: var(--brand-deep); background: white; }
.friend-nutrition-grid { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 15px; border-top: 1px solid color-mix(in oklch, white 18%, transparent); border-bottom: 1px solid color-mix(in oklch, white 18%, transparent); }
.friend-nutrition-grid div { display: flex; min-height: 62px; padding: 9px 0; justify-content: center; flex-direction: column; }
.friend-nutrition-grid div:nth-child(odd) { border-right: 1px solid color-mix(in oklch, white 18%, transparent); }
.friend-nutrition-grid div:nth-child(-n+2) { border-bottom: 1px solid color-mix(in oklch, white 18%, transparent); }
.friend-nutrition-grid span { color: color-mix(in oklch, white 72%, var(--brand-deep)); font-size: 9px; }
.friend-nutrition-grid strong { font-size: 16px; }
.friend-nutrition-grid small { font-size: 9px; font-weight: 600; }
.friend-days { display: grid; gap: 9px; }
.friend-day { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.friend-day-head { display: flex; min-height: 48px; padding: 9px 12px; align-items: center; justify-content: space-between; gap: 8px; background: var(--surface-muted); }
.friend-day-head > div { display: flex; align-items: baseline; gap: 6px; }
.friend-day-head strong { font-size: 12px; }
.friend-day-head span { color: var(--muted); font-size: 9px; }
.friend-meal { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 58px; padding: 9px 12px; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.friend-meal > div { display: flex; min-width: 0; flex-direction: column; }
.friend-meal > div:last-child { align-items: flex-end; text-align: right; }
.friend-meal strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.friend-meal b { font-size: 11px; }
.friend-meal small { color: var(--muted); font-size: 8px; }
.friend-remove-form { margin: 10px 0; text-align: center; }
.friend-remove-form button { min-height: 44px; padding: 0 16px; border: 0; color: var(--danger); background: transparent; font-size: 11px; font-weight: 720; }
.friend-empty { min-height: 390px; }

.contact-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 12px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-muted);
}
.contact-tabs a {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}
.contact-tabs a.is-active { color: var(--brand-deep); background: var(--surface); box-shadow: 0 2px 6px color-mix(in oklch, var(--ink) 8%, transparent); }
.contact-tabs a span { display: grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border-radius: 999px; background: var(--brand-soft); font-size: 9px; }
.contact-identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
  padding: 13px 14px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.contact-identity > div { display: flex; min-width: 0; flex-direction: column; }
.contact-identity span { color: var(--muted); font-size: 10px; }
.contact-identity strong { font-size: 15px; letter-spacing: .08em; }
.contact-list,
.pending-group-list,
.group-members-section {
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.contact-list-heading { display: flex; min-height: 44px; padding: 9px 13px; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); background: var(--surface-muted); }
.contact-list-heading strong { font-size: 12px; }
.contact-list-heading span { color: var(--muted); font-size: 9px; text-align: right; }
.contact-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 18px;
  min-height: 68px;
  padding: 9px 12px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
}
.contact-list-heading + .contact-row { border-top: 0; }
.contact-row:hover,
.contact-row:focus-visible { background: var(--brand-soft); }
.contact-row > svg { width: 17px; height: 17px; color: var(--faint); }
.contact-avatar { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 50%; color: var(--brand-strong); background: var(--brand-soft); font-size: 14px; font-weight: 820; }
.contact-avatar.is-group { border-radius: 10px; color: white; background: var(--brand-strong); }
.contact-avatar.is-group svg { width: 22px; height: 22px; }
.contact-avatar.is-large { width: 54px; height: 54px; flex-basis: 54px; font-size: 18px; }
.contact-copy { display: flex; min-width: 0; flex-direction: column; }
.contact-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.contact-copy small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.contact-role { padding: 3px 6px; border-radius: 999px; color: var(--brand-strong); background: var(--brand-soft); font-size: 8px; font-weight: 760; }
.contact-detail-head { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; margin-bottom: 12px; padding: 8px 2px; align-items: center; gap: 12px; }
.contact-detail-head h1 { margin: 0; font-size: 18px; }
.contact-detail-head p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.contact-empty { min-height: 390px; }
.pending-group-row { display: flex; min-height: 62px; padding: 10px 13px; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.pending-group-row > div { display: flex; flex-direction: column; }
.pending-group-row strong { font-size: 12px; }
.pending-group-row small { color: var(--muted); font-size: 9px; }
.pending-group-row button,
.group-meta-line button,
.group-request button,
.group-member-manage button { min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px; color: var(--brand-strong); background: var(--brand-soft); font-size: 10px; font-weight: 740; }
.group-dialog { max-height: calc(100dvh - 28px); overflow-y: auto; padding: 18px; }
.group-dialog form { padding: 0; }
.dialog-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.dialog-section h3 { margin: 0 0 4px; font-size: 14px; }
.dialog-section input,
.dialog-disclosure input,
.dialog-disclosure select,
.dialog-disclosure textarea { margin-bottom: 10px; }
.dialog-disclosure { margin-top: 14px; border-top: 1px solid var(--line); }
.dialog-disclosure summary { min-height: 48px; padding: 12px 0; color: var(--brand-strong); font-size: 12px; font-weight: 760; cursor: pointer; }
.dialog-disclosure form { padding: 2px 0 0; }
.group-overview,
.member-nutrition-detail { margin-bottom: 12px; padding: 16px; border-radius: var(--radius); color: white; background: var(--brand-deep); }
.group-overview h1 { margin: 0; font-size: 18px; }
.group-overview .section-heading-row p,
.member-nutrition-detail .section-heading-row p { color: color-mix(in oklch, white 72%, var(--brand-deep)); }
.group-overview .status-chip,
.member-nutrition-detail .status-chip { color: var(--brand-deep); background: white; }
.group-meta-line { display: flex; min-height: 38px; margin-top: 10px; align-items: center; gap: 8px; color: color-mix(in oklch, white 76%, var(--brand-deep)); font-size: 10px; }
.group-meta-line button { min-height: 30px; color: var(--brand-deep); background: white; }
.group-admin { margin-bottom: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.group-admin > summary { display: flex; min-height: 48px; padding: 11px 14px; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 760; cursor: pointer; }
.group-admin > summary span { padding: 3px 7px; border-radius: 999px; color: var(--danger); background: var(--danger-soft); font-size: 9px; }
.group-admin-body { display: grid; gap: 14px; padding: 14px; border-top: 1px solid var(--line); }
.group-admin-body section { display: grid; gap: 8px; }
.group-admin-body h2 { margin: 0; font-size: 12px; }
.group-request,
.group-member-manage { display: flex; min-height: 46px; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); }
.group-request > div:first-child { display: flex; flex-direction: column; }
.group-request > div:last-child { display: flex; gap: 6px; }
.group-request small { color: var(--muted); font-size: 9px; }
.group-request button.is-danger,
.group-member-manage button.is-danger { color: var(--danger); background: var(--danger-soft); }
.group-settings { display: grid; gap: 8px; }
.group-settings label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.group-settings input,
.group-settings select,
.group-settings textarea { margin: 0; }
.danger-action { width: 100%; min-height: 44px; border: 0; border-radius: 9px; color: var(--danger); background: var(--danger-soft); font-size: 11px; font-weight: 760; }
.member-switcher { display: grid; }
.member-contact { display: grid; grid-template-columns: 42px minmax(0, 1fr) 18px; min-height: 65px; padding: 9px 12px; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.contact-list-heading + .member-switcher .member-contact:first-child { border-top: 0; }
.member-contact > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.member-contact strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.member-contact small { color: var(--muted); font-size: 9px; }
.member-contact > svg { width: 17px; height: 17px; color: var(--faint); }
.member-contact.is-active { background: var(--brand-soft); }
.member-contact.is-active .contact-avatar { color: white; background: var(--brand-strong); }

.membership-status { margin-bottom: 12px; padding: 20px; border-radius: var(--radius); color: var(--ink); background: var(--surface-muted); }
.membership-status.is-pro { color: white; background: var(--brand-deep); }
.membership-status h1 { margin: 10px 0 5px; font-size: 24px; }
.membership-status p { margin: 0; color: var(--muted); font-size: 12px; }
.membership-status.is-pro p { color: color-mix(in oklch, white 74%, var(--brand-deep)); }
.membership-status.is-pro .membership-chip { color: var(--brand-deep); background: white; }
.pricing-options { margin-bottom: 12px; }
.savings-badge { display: inline-flex; min-height: 26px; padding: 0 9px; align-items: center; border-radius: 999px; color: var(--brand-deep); background: var(--brand-soft); font-size: 10px; font-weight: 800; white-space: nowrap; }
.pricing-option-list { margin-top: 13px; border-top: 1px solid var(--line); }
.pricing-option { display: flex; width: 100%; min-height: 58px; padding: 10px 8px; align-items: center; justify-content: space-between; gap: 12px; color: inherit; border: 0; border-bottom: 1px solid var(--line); background: transparent; font: inherit; text-align: left; }
.pricing-option.is-selected { background: var(--brand-soft); }
.pricing-option:focus-visible { outline: 3px solid color-mix(in oklch, var(--brand) 34%, transparent); outline-offset: -3px; }
.pricing-option > span:first-child { display: grid; gap: 2px; }
.pricing-option strong { font-size: 12px; }
.pricing-option small { color: var(--muted); font-size: 9px; }
.pricing-option > span:last-child { color: var(--muted); font-size: 10px; white-space: nowrap; }
.pricing-option-price { display: grid; justify-items: end; gap: 2px; }
.pricing-option-price small { color: var(--faint); font-size: 9px; }
.pricing-option-price s { text-decoration-thickness: 1.5px; }
.pricing-option b { color: var(--ink); font-size: 17px; font-variant-numeric: tabular-nums; }
.pricing-option.is-recommended b { color: var(--brand-strong); }
.pricing-savings { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.pricing-savings strong { color: var(--brand-deep); }
.plan-comparison { padding: 0; overflow: hidden; }
.plan-row { display: grid; grid-template-columns: minmax(0, 1.5fr) .7fr .7fr; min-height: 46px; padding: 0 13px; align-items: center; border-top: 1px solid var(--line); font-size: 11px; }
.plan-row:first-child { border-top: 0; }
.plan-row > strong,
.plan-row > b { text-align: center; }
.plan-row > b { font-size: 11px; }
.plan-row .check { color: var(--brand-strong); font-size: 15px; }
.plan-head { color: var(--muted); background: var(--surface-muted); font-size: 10px; }
.subscription-actions p { margin: 9px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.coupon-form { margin-bottom: 0; }
.coupon-code-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 8px; }
.coupon-code-row input { text-transform: uppercase; }
.coupon-code-row .secondary-button { min-height: 46px; padding: 0 10px; font-size: 12px; }
.coupon-feedback { margin-top: 9px; padding: 10px 11px; border-radius: 9px; color: var(--muted); background: var(--surface-muted); font-size: 10px; line-height: 1.45; }
.coupon-feedback[data-state="success"] { color: var(--brand-deep); background: var(--brand-soft); }
.coupon-feedback[data-state="error"] { color: var(--danger); background: var(--danger-soft); }
.coupon-confirm-dialog { width: min(360px, calc(100% - 28px)); }
.coupon-confirm-dialog p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; text-align: left; }
.coupon-confirm-dialog .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; margin-top: 18px; gap: 8px; }
.coupon-confirm-dialog .dialog-actions button { min-height: 46px; margin: 0; }
.checkout-summary { display: grid; margin: 13px 0; padding: 11px 12px; gap: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-muted); }
.checkout-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.checkout-summary > [hidden] { display: none; }
.checkout-summary dt,
.checkout-summary dd { margin: 0; }
.checkout-summary dd { font-variant-numeric: tabular-nums; }
.checkout-summary .checkout-list-price dd { color: var(--faint); }
.checkout-summary .checkout-list-price s { text-decoration-thickness: 1.5px; }
.checkout-summary [data-discount-row] dd { color: var(--brand-strong); }
.checkout-summary .checkout-total { padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 800; }
.checkout-summary .checkout-total dd { color: var(--brand-deep); font-size: 18px; }
.subscription-choice-list { display: grid; gap: 8px; }
.danger-button { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 25%, white); background: var(--danger-soft); }
.subscription-feedback { margin-top: 10px; margin-bottom: 0; color: var(--muted); background: var(--surface-muted); }
.subscription-feedback[data-state="success"] { color: var(--brand-deep); background: var(--brand-soft); }
.subscription-feedback[data-state="error"] { color: var(--danger); background: var(--danger-soft); }
.subscription-feedback[data-state="info"] { color: var(--brand-deep); background: var(--brand-soft); }
.trial-code-panel { margin-bottom: 12px; }
.trial-code-panel .section-heading-row { margin-bottom: 12px; }
.trial-badge { padding: 4px 9px; border-radius: 999px; color: var(--brand-deep); background: var(--brand-soft); font-size: 10px; font-weight: 800; }
.trial-code-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 8px; }
.trial-code-row input { text-transform: uppercase; }
.trial-code-row .secondary-button { min-height: 46px; padding: 0 10px; font-size: 13px; }
.trial-code-panel .subscription-feedback { margin-bottom: 0; }
.billing-note p { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.membership-legal-links { display: flex; margin-top: 12px; padding-top: 10px; align-items: center; flex-wrap: wrap; gap: 4px 12px; border-top: 1px solid var(--line); }
.membership-legal-links a { display: inline-flex; min-height: 36px; align-items: center; color: var(--brand-strong); font-size: 10px; font-weight: 760; }

.legal-liff-page .liff-main { padding-top: 10px; }
.liff-legal-switcher { display: flex; margin: 0 -14px 12px; padding: 0 14px 3px; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.liff-legal-switcher::-webkit-scrollbar { display: none; }
.liff-legal-switcher a { display: inline-flex; min-height: 38px; padding: 0 12px; align-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 720; }
.liff-legal-switcher a.is-active { color: white; border-color: var(--brand-strong); background: var(--brand-strong); }
.liff-legal-hero { padding: 19px 5px 21px; }
.liff-legal-hero > span { color: var(--brand-strong); font-size: 9px; font-weight: 820; letter-spacing: .13em; text-transform: uppercase; }
.liff-legal-hero h1 { margin: 7px 0 8px; font-size: 30px; line-height: 1.12; letter-spacing: -.04em; }
.liff-legal-hero p { margin: 0; color: var(--muted); font-size: 12px; }
.liff-legal-hero small { display: block; margin-top: 10px; color: var(--faint); font-size: 9px; }
.liff-legal-status { margin-bottom: 12px; padding: 13px 14px; border: 1px solid color-mix(in oklch, var(--brand) 25%, white); border-radius: 10px; background: var(--brand-soft); }
.liff-legal-status strong { color: var(--brand-deep); font-size: 11px; }
.liff-legal-status p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.legal-liff-page .legal-prose { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.legal-liff-page .legal-section { padding: 19px 15px; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.legal-liff-page .legal-section:first-child { border-top: 0; }
.legal-liff-page .legal-section-number { display: block; margin-bottom: 4px; color: var(--brand-strong); font-size: 8px; font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
.legal-liff-page .legal-section h2 { margin: 0 0 9px; font-size: 16px; line-height: 1.3; }
.legal-liff-page .legal-section p { margin: 0 0 10px; color: #4d534e; font-size: 11px; }
.legal-liff-page .legal-section p:last-child { margin-bottom: 0; }
.legal-liff-page .legal-section ul { margin: 0; padding-left: 1.25em; color: #4d534e; font-size: 11px; }
.legal-liff-page .legal-section li + li { margin-top: 8px; }
.legal-liff-page .legal-section strong { color: var(--ink); }
.legal-liff-page .legal-plan-table { max-width: 100%; margin: 12px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
.legal-liff-page .legal-plan-table table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 10px; }
.legal-liff-page .legal-plan-table th:first-child { width: 58px; }
.legal-liff-page .legal-plan-table th:nth-child(2) { width: 70px; }
.legal-liff-page .legal-plan-table th,
.legal-liff-page .legal-plan-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-liff-page .legal-plan-table thead th { color: var(--muted); background: var(--surface-muted); font-size: 9px; }
.legal-liff-page .legal-plan-table tbody tr:last-child th,
.legal-liff-page .legal-plan-table tbody tr:last-child td { border-bottom: 0; }
.legal-liff-page .legal-plan-table tbody th { color: var(--brand-strong); }
.legal-liff-page .legal-contact-list { display: grid; margin: 13px 0 0; border-top: 1px solid var(--line); }
.legal-liff-page .legal-contact-list > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); padding: 9px 0; gap: 8px; border-bottom: 1px solid var(--line); }
.legal-liff-page .legal-contact-list dt { color: var(--muted); font-size: 9px; }
.legal-liff-page .legal-contact-list dd { margin: 0; font-size: 10px; font-weight: 700; overflow-wrap: anywhere; }
.legal-liff-page .legal-contact-list a { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 2px; }

.login-state .liff-main { display: grid; min-height: 100dvh; padding: 28px; place-items: center; }
.login-panel { width: 100%; max-width: 340px; text-align: center; }
.login-brand { width: 88px; height: 88px; object-fit: cover; border-radius: 24px; }
.login-panel h1 { margin: 18px 0 8px; font-size: 21px; }
.login-panel p { margin-bottom: 20px; color: var(--muted); font-size: 13px; }
.loading-mark { display: flex; margin-top: 18px; justify-content: center; gap: 5px; }
.loading-mark span { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: loading-dot 900ms ease-in-out infinite alternate; }
.loading-mark span:nth-child(2) { animation-delay: 180ms; }
.loading-mark span:nth-child(3) { animation-delay: 360ms; }
@keyframes loading-dot { to { opacity: .25; transform: translateY(-4px); } }

@media (min-width: 481px) {
  .liff-shell { box-shadow: 0 0 0 1px var(--line); }
}

@media (max-width: 350px) {
  .macro-strip { gap: 8px; }
  .nutrition-detail { grid-template-columns: 106px minmax(0, 1fr); gap: 9px; }
  .nutrition-ring { width: 100px; height: 100px; }
  .meal-card-macros { gap: 4px; }
}

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