/* ==========================================================================
   Members area (dashboard, meal planner, library).
   Builds on styles.css: same tokens, buttons, type and wordmark.
   ========================================================================== */

.app-body { background: var(--paper); }
[hidden] { display: none !important; }
/* Members pages stay hidden until the account check finishes, so nothing shows to signed-out
   visitors. Meanwhile the screen already has the layout's shape (dark sidebar or top bar), and
   the "Checking…" text only fades in if the check is slow, so normal page changes don't flash. */
.auth-pending .app { visibility: hidden; }
.auth-pending { background: linear-gradient(90deg, var(--night-900) 264px, var(--paper) 264px) fixed; }
.auth-pending::after {
  content: "Checking your account…"; position: fixed; inset: 0 0 0 264px; display: grid; place-items: center;
  color: var(--ink-3); font-size: .9375rem; animation: fade-in .25s ease .8s both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Smooth cross-fade between members pages in browsers that support it (Chrome, Edge, Safari) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

/* ---------- Sign-in pages ---------- */
.auth-body { background: var(--paper); }
.auth { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); min-height: 100svh; }
.auth-side { padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth-side h1 { font-size: clamp(2.6rem, 5vw, 4.5rem); line-height: .95; font-weight: 500; letter-spacing: -.045em; max-width: 12ch; }
.auth-side p { color: var(--on-dark-2); max-width: 40ch; }
.auth-side .back { display: inline-flex; align-items: center; gap: 8px; color: var(--on-dark-2); text-decoration: none; font-size: .9375rem; font-weight: 500; min-height: 44px; }
.auth-side .back:hover { color: var(--on-dark); }
.auth-side .back .ai { width: 18px; height: 18px; }
.auth-main { display: grid; place-items: center; padding: clamp(24px, 5vw, 64px) var(--gutter); }
.auth-card { width: min(440px, 100%); display: grid; gap: 22px; }
.auth-card h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); line-height: 1; font-weight: 500; letter-spacing: -.04em; }
.auth-card .sub { color: var(--ink-2); }
.auth-form { display: grid; gap: 14px; }
.auth-form .field input { background: var(--white); border-color: var(--line-light); }
.auth-form .field input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(52, 70, 63, .14); }
.auth-form .field-error { color: var(--bad); min-height: 0; }
.auth-form .btn { width: 100%; min-height: 52px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 76px !important; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--brand); font-weight: 600; font-size: .875rem; cursor: pointer; }
.pw-toggle:hover { background: var(--mist-100); }
.hint { font-size: .8125rem; color: var(--ink-3); }
.hint.ok { color: var(--ok); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); font-size: .9375rem; }
.alert .ai { width: 18px; height: 18px; margin-top: 2px; }
.alert.error { background: var(--bad-bg); color: var(--bad-ink); border: 1px solid var(--bad-line); }
.alert.success { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid var(--ok-line); }
.alert.info { background: var(--mist-200); color: var(--ink-2); border: 1px solid var(--mist-300); }
.alert[hidden] { display: none; }
.auth-alt { font-size: .9375rem; color: var(--ink-2); }
.auth-alt a { color: var(--brand); font-weight: 600; }
.auth-row { display: flex; justify-content: flex-end; }
.auth-row a { font-size: .875rem; color: var(--brand); font-weight: 600; }
/* Google / Apple (shown only when switched on) and the "or continue with email" divider. */
.auth-social { display: grid; gap: 18px; }
.auth-social[hidden] { display: none; }
.auth-social-list { display: grid; gap: 10px; }
.btn-social { --bg: var(--white); --fg: var(--ink); border-color: var(--line-light); width: 100%; min-height: 52px; justify-content: center; gap: 10px; }
.btn-social:hover { --bg: var(--mist-100); }
.btn-social svg { width: 20px; height: 20px; flex: none; }
.btn-social[aria-busy="true"] svg { opacity: .4; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: .8125rem; font-weight: 600; letter-spacing: .02em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-light); }
/* Next steps inside an alert ("Log in", "Reset my password"). */
.alert-actions { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.alert-actions a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; display: inline-flex; align-items: center; }
.done-alt { margin-top: 10px; }
/* start.html: one quiet line while the session is checked. */
.start-body { min-height: 100vh; display: grid; place-items: center; background: var(--paper); }
.start { display: grid; justify-items: center; gap: 14px; padding: 24px var(--gutter); color: var(--ink-2); text-align: center; max-width: 460px; }
.start .empty-state { justify-items: center; text-align: center; }
.legal-note { font-size: .8125rem; color: var(--ink-3); }
.captcha:empty { display: none; }
.danger-zone { border-color: var(--bad-line); }
.btn-danger { --bg: #A3341C; --fg: #FFFFFF; }
.btn-danger:hover { --bg: #8A2A14; }
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { gap: 18px; padding-bottom: 28px; }
  .auth-side h1 { font-size: 2.25rem; }
  .auth-side .side-copy p { display: none; }
}
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100svh; }
.ai { width: 20px; height: 20px; flex: none; }

/* ---------- Sidebar (desktop) ---------- */
.app-side {
  position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 32px;
  padding: 24px 16px; background: var(--night-900); color: var(--on-dark);
}
.app-side .wordmark { padding: 4px 10px; }
.app-side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0 0 10px; }
.app-side-top .brand { --logo-h: 29px; }
.app-top .brand { --logo-h: 25px; }
.app-top-right { display: flex; align-items: center; gap: 8px; }
.app-top-right .theme-toggle { width: 44px; height: 44px; }
.app-nav { display: grid; gap: 4px; }
.app-nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: var(--r-sm);
  color: var(--on-dark-2); text-decoration: none; font-weight: 500; font-size: .9688rem;
  transition: background-color var(--t-fast), color var(--t-fast);
}
.app-nav-link:hover { background: rgba(255, 255, 255, .06); color: var(--on-dark); }
.app-nav-link[aria-current="page"] { background: rgba(226, 149, 83, .14); color: var(--accent); }
.app-nav-link.subtle { font-size: .875rem; min-height: 42px; }
.app-side-foot { margin-top: auto; display: grid; gap: 8px; }
.app-account { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); background: rgba(255, 255, 255, .04); border: 1px solid var(--line-dark); }
.app-account b { display: block; font-size: .9375rem; color: var(--on-dark); }
.app-account span:not(.app-avatar), .app-account a { font-size: .8125rem; color: var(--on-dark-2); }
.app-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--night-700); color: var(--on-dark-2); flex: none; }

/* ---------- Top bar + bottom tabs (tablet / mobile) ---------- */
.app-top, .app-tabs { display: none; }
.app-top { position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between; padding: 12px var(--gutter); background: var(--night-900); color: var(--on-dark); }
.app-top-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line-dark); text-decoration: none; font-size: .875rem; font-weight: 500; color: var(--on-dark-2); }
.app-top-link .ai { width: 16px; height: 16px; }
.app-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(27, 37, 33, .96); border-top: 1px solid var(--line-dark);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.app-tabs .tab { display: grid; justify-items: center; gap: 3px; min-height: 54px; padding: 6px 2px; border-radius: var(--r-sm); text-decoration: none; color: var(--on-dark-2); font-size: .6875rem; font-weight: 600; }
.app-tabs .tab[aria-current="page"] { color: var(--accent); background: rgba(226, 149, 83, .1); }
.app-tabs .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Main column ---------- */
.app-main { padding: 28px clamp(16px, 3.5vw, 48px) 64px; min-width: 0; outline: none; }
.app-wrap { max-width: 1180px; margin: 0 auto; display: grid; gap: clamp(24px, 3vw, 36px); }

.preview-banner {
  max-width: 1180px; margin: 0 auto 24px; display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; border-radius: var(--r-md); background: var(--mist-200); border: 1px solid var(--mist-300); color: var(--ink-2); font-size: .9375rem;
}
.preview-banner .ai { color: var(--brand); margin-top: 2px; }
.preview-banner b { color: var(--ink); }

.app-head { display: grid; gap: 12px; }
.app-head h1 { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1; font-weight: 500; letter-spacing: -.04em; }
.app-head .lede { max-width: 60ch; }
.crumb { display: inline-flex; align-items: center; gap: 8px; justify-self: start; min-height: 40px; padding: 0 12px 0 6px; border-radius: var(--pill); text-decoration: none; font-size: .9375rem; font-weight: 600; color: var(--ink-2); }
.crumb:hover { background: var(--mist-200); color: var(--ink); }
.crumb .ai { width: 18px; height: 18px; }

.panel { background: var(--white); border: 1px solid var(--line-light); border-radius: var(--r-lg); padding: clamp(18px, 2.4vw, 28px); }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-title h2 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -.02em; }
.muted-note { font-size: .875rem; color: var(--ink-3); }

.btn[aria-disabled="true"], .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.sm { min-height: 40px; padding: 0 16px; font-size: .875rem; }
.btn-light { --bg: var(--mist-100); --fg: var(--ink); border-color: var(--line-light); }
.btn-light:hover { --bg: var(--mist-200); }

/* Placeholder language: dashed outline, light stripes and a "Placeholder" tag */
.ph-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: var(--pill); background: var(--mist-200); color: var(--brand); font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ph-box {
  display: grid; place-items: center; text-align: center; gap: 8px; padding: 24px; border-radius: var(--r-md);
  border: 1.5px dashed var(--mist-300); color: var(--ink-3); font-size: .9375rem;
  background: repeating-linear-gradient(135deg, var(--mist-100) 0 12px, var(--white) 12px 24px);
}
.ph-box .ai { width: 26px; height: 26px; color: var(--brand); opacity: .7; }
.ph-line { height: 12px; border-radius: 6px; background: var(--mist-200); }

/* ---------- Dashboard ---------- */
.dash-hero {
  position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-xl); padding: clamp(24px, 4vw, 44px);
  background: var(--night-900); color: var(--on-dark); display: grid; gap: 14px;
}
.dash-hero h1 { font-size: clamp(2.2rem, 5vw, 3.75rem); line-height: .98; font-weight: 500; letter-spacing: -.045em; }
.dash-hero p { color: var(--on-dark-2); max-width: 56ch; }

.dash-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.feature-card {
  display: grid; grid-template-rows: auto 1fr; border-radius: var(--r-lg); overflow: hidden; background: var(--white);
  border: 1px solid var(--line-light); text-decoration: none; color: inherit;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 24px 50px -30px rgba(52, 70, 63, .4); }
.feature-media { aspect-ratio: 16 / 7; display: grid; place-items: center; background: var(--mist-200); position: relative; overflow: hidden; }
.feature-media.night { background: var(--night-800); }
.feature-media .big-icon { width: 64px; height: 64px; color: var(--brand); }
.feature-media.night .big-icon { color: var(--accent); }
.feature-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature-body { padding: 22px 24px 24px; display: grid; gap: 10px; align-content: start; }
.feature-body h2 { font-size: 1.5rem; font-weight: 500; letter-spacing: -.03em; }
.feature-body p { color: var(--ink-2); font-size: .9688rem; }
.feature-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.meta-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px; border-radius: var(--pill); background: var(--mist-100); font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.meta-pill .ai { width: 14px; height: 14px; }
.feature-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 600; color: var(--brand); }
.feature-go .ai { width: 18px; height: 18px; transition: transform var(--t-med) var(--ease); }
.feature-card:hover .feature-go .ai { transform: translateX(4px); }

.dash-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dash-row .panel { display: grid; gap: 12px; align-content: start; }
.dash-row h2 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.015em; display: flex; align-items: center; gap: 10px; }
.dash-row h2 .ai { color: var(--brand); }
.quick-links { display: grid; gap: 6px; }
.quick-links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: var(--r-sm); background: var(--mist-100); text-decoration: none; font-weight: 500; font-size: .9375rem; }
.quick-links a:hover { background: var(--mist-200); }
.quick-links .ai { width: 16px; height: 16px; color: var(--brand); }

/* ---------- Toolbar: search + filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.search { position: relative; flex: 1 1 260px; }
.search .ai { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search input, .select select {
  width: 100%; min-height: 48px; border-radius: var(--r-sm); border: 1.5px solid var(--line-light); background: var(--white);
  font: inherit; font-size: 1rem; color: var(--ink); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search input { padding: 0 14px 0 42px; }
.search input:focus, .select select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(52, 70, 63, .14); }
.select { display: grid; gap: 4px; flex: 0 1 190px; }
.select label { font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.select select { padding: 0 38px 0 14px; appearance: none; cursor: pointer;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%233B4258' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
.toolbar .btn { min-height: 48px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tabs [role="tab"], .chips button {
  display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 0 16px; border-radius: var(--pill);
  border: 1px solid var(--line-light); background: var(--white); color: var(--ink-2); font-weight: 600; font-size: .9375rem; cursor: pointer;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.tabs [role="tab"]:hover, .chips button:hover { border-color: var(--brand); color: var(--ink); }
.tabs [role="tab"][aria-selected="true"], .chips button[aria-pressed="true"] { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.tabs .count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--pill); display: inline-grid; place-items: center; font-size: .75rem; background: var(--mist-200); color: var(--ink-2); }
.tabs [aria-selected="true"] .count { background: var(--on-solid-soft); color: var(--on-solid); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 40px; font-size: .875rem; padding: 0 14px; }
.result-line { font-size: .9375rem; color: var(--ink-3); }

/* ---------- Meal planner ---------- */
.meals-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.recipe-card { display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-light); overflow: hidden; }
.recipe-card .media { position: relative; aspect-ratio: 4 / 3; background: var(--mist-200); }
.recipe-card .media img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card .media .ph-box { position: absolute; inset: 10px; }
.recipe-card .media .tag { position: absolute; top: 12px; left: 12px; }
.recipe-card .body { display: grid; gap: 8px; padding: 16px 16px 6px; align-content: start; flex: 1; }
.recipe-card h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.recipe-card h3 a { text-decoration: none; }
.recipe-card h3 a::after { content: ""; position: absolute; inset: 0; }
.recipe-card { position: relative; }
.recipe-card .summary { font-size: .875rem; color: var(--ink-2); }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.recipe-card .actions { display: flex; gap: 8px; padding: 10px 16px 16px; position: relative; z-index: 1; }
.recipe-card.is-ph h3 { color: var(--ink-3); }
.recipe-card.is-ph .body { gap: 10px; }
.empty-state { display: grid; justify-items: start; gap: 6px; padding: 18px 20px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-light); }
.empty-state b { font-size: 1rem; }
.empty-state p { font-size: .9375rem; color: var(--ink-2); }

.myday { position: sticky; top: 24px; display: grid; gap: 14px; }
.myday-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.myday-head h2 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.myday-slots { display: grid; gap: 10px; }
.slot { display: grid; gap: 6px; padding: 14px; border-radius: var(--r-md); border: 1.5px dashed var(--mist-300); background: var(--paper); }
.slot.filled { border-style: solid; border-color: var(--line-light); background: var(--white); }
.slot-k { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.slot-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.slot-row span { font-size: .9375rem; color: var(--ink-2); }
.slot-row b { font-weight: 600; font-size: .9375rem; }
.icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-light); background: var(--white); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { border-color: var(--brand); color: var(--ink); }
.icon-btn .ai { width: 18px; height: 18px; }

/* Recipe detail */
.recipe-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; align-items: stretch; }
.recipe-photo { border-radius: var(--r-lg); overflow: hidden; min-height: 280px; background: var(--mist-200); display: grid; }
.recipe-photo img { width: 100%; height: 100%; object-fit: cover; }
.recipe-photo .ph-box { margin: 12px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.fact { padding: 16px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-light); display: grid; gap: 4px; }
.fact span { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.fact b { font-size: 1.25rem; font-weight: 500; letter-spacing: -.02em; }
.fact.ph b { color: var(--ink-3); font-size: 1rem; font-weight: 500; }
.recipe-cols { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.ingredients li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-light); }
.ingredients li:last-child { border-bottom: 0; }
.ingredients .amt { min-width: 72px; font-weight: 600; }
.steps { counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; }
.steps li::before { content: counter(step); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--night-900); color: var(--accent); font-weight: 600; font-size: .875rem; }
.nutrition { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.nutrition div { padding: 14px; border-radius: var(--r-md); background: var(--mist-100); display: grid; gap: 2px; }
.nutrition span { font-size: .75rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.nutrition b { font-size: 1.125rem; font-weight: 600; }

/* ---------- Library ---------- */
.lib-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.week-nav { position: sticky; top: 24px; display: grid; gap: 4px; padding: 10px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-light); }
.week-nav [role="tab"] {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 0 14px; border-radius: var(--r-sm);
  border: 0; background: transparent; color: var(--ink-2); font-weight: 600; font-size: .9375rem; text-align: left; cursor: pointer;
}
.week-nav [role="tab"]:hover { background: var(--mist-100); color: var(--ink); }
.week-nav [role="tab"][aria-selected="true"] { background: var(--solid); color: var(--on-solid); }
.week-nav .count { font-size: .75rem; min-width: 22px; height: 22px; border-radius: var(--pill); display: inline-grid; place-items: center; background: var(--mist-200); color: var(--ink-2); }
.week-nav [aria-selected="true"] .count { background: var(--on-solid-soft); color: var(--on-solid); }
.week-note { padding: 10px 14px 4px; font-size: .8125rem; color: var(--ink-3); }

.lib-main { display: grid; gap: 18px; }
.week-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px; }
.week-head h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 500; letter-spacing: -.035em; }
.doc-list { display: grid; gap: 10px; }
.doc-row {
  position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 14px 16px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-light);
}
.doc-row.is-ph { border-style: dashed; border-color: var(--mist-300); background: var(--paper); }
.doc-icon { width: 52px; height: 60px; border-radius: 10px; display: grid; place-items: center; background: var(--mist-200); color: var(--brand); }
.doc-icon .ai { width: 24px; height: 24px; }
.doc-text { display: grid; gap: 6px; min-width: 0; }
.doc-text h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.015em; }
.doc-text h3 a { text-decoration: none; }
.doc-text h3 a::after { content: ""; position: absolute; inset: 0; }
.doc-text p { font-size: .875rem; color: var(--ink-2); }
.doc-actions { display: flex; gap: 8px; position: relative; z-index: 1; }
.doc-row.is-ph .doc-text h3 { color: var(--ink-3); }

/* Document view */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.pdf-frame { border-radius: var(--r-lg); overflow: hidden; background: var(--white); border: 1px solid var(--line-light); }
.pdf-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-light); font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.pdf-frame iframe { display: block; width: 100%; height: min(78vh, 1000px); border: 0; }
.pdf-frame .ph-box { margin: 16px; min-height: min(62vh, 760px); }
.doc-side { display: grid; gap: 14px; position: sticky; top: 24px; }
.doc-side dl { display: grid; gap: 12px; margin: 0; }
.doc-side dt { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.doc-side dd { margin: 2px 0 0; font-weight: 500; }
.doc-side .btn { width: 100%; }
.lock-note { display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; color: var(--ink-2); }
.lock-note .ai { width: 18px; height: 18px; color: var(--brand); margin-top: 2px; }

/* ---------- Onboarding quiz ---------- */
.ob { max-width: 780px; gap: 18px; position: relative; }
.ob > * { position: relative; z-index: 1; }
.ob-loading { display: grid; justify-items: center; gap: 12px; padding: 80px 0; color: var(--ink-3); }
.spin-lg { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--mist-300); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.hide-sm { display: inline; }

/* Slow-moving colour behind the quiz */
.ob > .ob-bg { display: none; } /* The blurred background shapes were removed with the move to the new design. */

/* Progress header */
.ob-top { position: sticky; top: 0; z-index: 6; margin: -28px calc(-1 * clamp(16px, 3.5vw, 48px)) 0; padding: 14px clamp(16px, 3.5vw, 48px) 12px; background: var(--glass); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--line-light); }
.ob-progress { max-width: 780px; margin: 0 auto; display: grid; gap: 10px; }
.ob-progress-row { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.ob-count-step { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.ob-step-name { font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.ob-pct { font-weight: 700; font-size: 1.125rem; color: var(--brand); font-variant-numeric: tabular-nums; }
.ob-bar { position: relative; height: 8px; border-radius: var(--pill); background: var(--mist-200); overflow: hidden; }
.ob-bar i { position: relative; display: block; height: 100%; width: 20%; border-radius: inherit; background: var(--accent); transition: width .7s var(--ease); overflow: hidden; }
.ob-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; counter-reset: st; }
.ob-st { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .8125rem; font-weight: 600; color: var(--ink-3); position: relative; }
.ob-st:not(:last-child)::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: var(--mist-300); min-width: 8px; }
.ob-st.is-done:not(:last-child)::after { background: var(--chart); }
.ob-dot { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; border: 1.5px solid var(--mist-300); background: var(--white); transition: background-color var(--t-med), border-color var(--t-med), color var(--t-med); }
.ob-dot .ai { width: 14px; height: 14px; }
.ob-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-label .short { display: none; }
.ob-st.is-current { color: var(--ink); }
.ob-st.is-current .ob-dot { background: var(--solid); border-color: var(--solid); color: var(--on-solid); box-shadow: 0 0 0 4px rgba(52, 70, 63, .18); }
.ob-st.is-done { color: var(--ink-2); }
.ob-st.is-done .ob-dot { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.ob-st.just-done .ob-dot { animation: pop .5s var(--ease); }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* The question card */
.ob-card { display: grid; gap: 18px; padding: clamp(22px, 4vw, 40px); border-radius: var(--r-xl); background: rgba(255, 255, 255, .92); border: 1px solid rgba(255, 255, 255, .8); box-shadow: 0 1px 2px rgba(52, 70, 63, .04), 0 18px 50px -24px rgba(52, 70, 63, .28); }
.ob-card.enter-fwd { animation: slideFwd .42s var(--ease) both; }
.ob-card.enter-back { animation: slideBack .42s var(--ease) both; }
@keyframes slideFwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes slideBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.ob-kicker { justify-self: start; font-size: .8125rem; font-weight: 600; color: var(--brand); background: var(--mist-100); border-radius: var(--pill); padding: 6px 12px; }
.ob-title { font-size: clamp(1.9rem, 4.6vw, 2.75rem); line-height: 1.02; font-weight: 500; letter-spacing: -.045em; outline: none; }
.ob-sub { color: var(--ink-2); font-size: 1.0625rem; margin-top: -8px; max-width: 52ch; }
.ob-qs { display: grid; gap: 22px; margin-top: 4px; }
.ob-q { display: grid; gap: 10px; animation: fadeUp .35s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ob-q-label { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.ob-q .opt { font-size: .75rem; font-weight: 600; color: var(--ink-3); background: var(--mist-100); border-radius: var(--pill); padding: 2px 8px; margin-left: 6px; vertical-align: middle; }
.ob-help { font-size: .875rem; color: var(--ink-3); }
.ob-q .field-error { color: var(--bad); font-size: .875rem; font-weight: 600; min-height: 0; }
.ob-q .field-error:empty { display: none; }
.ob-q.has-error .ob-input { border-color: var(--bad-line); }

/* Illustrated choice cards */
.qc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.qc { position: relative; display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; border-radius: var(--r-md); border: 2px solid var(--line-light); background: var(--white); font: inherit; text-align: left; cursor: pointer; isolation: isolate;
  transition: transform var(--t-med) var(--ease), border-color var(--t-fast), box-shadow var(--t-med); animation: cardIn .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.qc:hover { transform: translateY(-3px); border-color: var(--mist-300); box-shadow: 0 14px 30px -18px rgba(52, 70, 63, .45); }
.qc:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.qc .qa { display: block; width: 100%; aspect-ratio: 16 / 10; height: auto; }
.qa-fig { transform-box: fill-box; transform-origin: center; transition: transform .45s var(--ease); }
.qc:hover .qa-fig { transform: scale(1.04); }
.qc-text { display: grid; gap: 2px; padding: 12px 14px 14px; }
.qc-text b { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
.qc-text small { font-size: .8125rem; color: var(--ink-3); line-height: 1.35; }
.qc-tick { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--night-900); transform: scale(0); transition: transform .35s var(--ease); box-shadow: 0 4px 12px rgba(27, 37, 33, .3); }
.qc-tick .ai { width: 16px; height: 16px; }
.qc[aria-checked="true"] { border-color: var(--solid); box-shadow: 0 0 0 4px rgba(226, 149, 83, .7), 0 16px 34px -20px rgba(52, 70, 63, .6); }
.qc[aria-checked="true"] .qc-tick { transform: scale(1); }
.qc[aria-checked="true"] .qa-fig { transform: scale(1.08); }
.ob-q.has-error .qc { border-color: var(--bad-line); }
/* Photo cards (the diet question): two across, every photo the same 16:10 crop. On phones each card
   is a row, photo on the left, so the four fit without a long scroll. */
.qc-cards.qc-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qc-photo { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--mist-200); }
.qc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s var(--ease); }
.qc:hover .qc-photo img { transform: scale(1.03); }
.qc[aria-checked="true"] .qc-photo img { transform: scale(1.05); }
@media (max-width: 520px) {
  .qc-cards.qc-photos { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .qc-photos .qc { grid-template-rows: none; grid-template-columns: 42% minmax(0, 1fr); align-items: center; }
  .qc-photos .qc-photo { height: 100%; aspect-ratio: auto; min-height: 96px; }
  .qc-photos .qc-text { padding: 12px 40px 12px 14px; }
  .qc-photos .qc-tick { top: 50%; right: 10px; margin-top: -15px; }
}

.ob-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-pills button, .ob-chips button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--pill); border: 1.5px solid var(--line-light); background: var(--white); font: inherit; font-weight: 500; font-size: .9375rem; cursor: pointer; transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.ob-pills button:hover, .ob-chips button:hover { border-color: var(--brand); }
.ob-pills button:active, .ob-chips button:active { transform: scale(.97); }
.ob-pills button[aria-checked="true"], .ob-chips button[aria-pressed="true"] { border-color: var(--solid); background: var(--solid); color: var(--on-solid); }
.ob-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-chips button .tick { width: 0; height: 16px; opacity: 0; transition: width var(--t-fast), opacity var(--t-fast); }
.ob-chips button[aria-pressed="true"] .tick { width: 16px; opacity: 1; }

.ob-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--pill); background: var(--mist-100); justify-self: start; }
.ob-seg button { min-height: 40px; padding: 0 16px; border-radius: var(--pill); border: 0; background: none; font: inherit; font-weight: 600; font-size: .9375rem; color: var(--ink-2); cursor: pointer; transition: background-color var(--t-med), color var(--t-med); }
.ob-seg button[aria-checked="true"] { background: var(--solid); color: var(--on-solid); }
.ob-units { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.ob-units .ob-q { gap: 6px; }
.ob-units .ob-q-label { font-size: .8125rem; color: var(--ink-3); }

.ob-switch { display: inline-flex; align-items: center; gap: 12px; justify-self: start; min-height: 44px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink-2); cursor: pointer; padding: 0; }
.ob-switch .track { width: 52px; height: 30px; border-radius: var(--pill); background: var(--mist-300); position: relative; transition: background-color var(--t-med); }
.ob-switch .thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--t-med) var(--ease); }
.ob-switch[aria-checked="true"] .track { background: var(--solid); }
.ob-switch[aria-checked="true"] .thumb { transform: translateX(22px); }
.ob-skip { justify-self: start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; border: 0; background: none; font: inherit; font-size: .9375rem; font-weight: 600; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ob-skip .ai { width: 16px; height: 16px; }

.ob-input { width: 100%; min-height: 52px; padding: 0 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line-light); background: var(--white); font: inherit; font-size: 1.0625rem; color: var(--ink); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.ob-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(52, 70, 63, .14); }
.ob-year { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.ob-big { width: 200px; min-height: 76px; font-size: 2.5rem; font-weight: 500; letter-spacing: -.03em; text-align: center; border-radius: var(--r-md); font-variant-numeric: tabular-nums; }
.ob-age { font-size: 1rem; color: var(--ink-2); font-weight: 500; }
.ob-measure { display: flex; flex-wrap: wrap; gap: 10px; }
.ob-measure label { display: flex; align-items: center; gap: 8px; }
.ob-measure .ob-input { width: 130px; min-height: 60px; font-size: 1.5rem; font-weight: 500; letter-spacing: -.02em; }
.ob-measure span { font-weight: 600; color: var(--ink-2); }
.ob-q-height, .ob-q-weight { display: inline-grid; }
/* Height and weight: label and its own unit choice on one row, the number below. The field keeps its
   height when the unit changes (one box for cm/kg/lb, two narrower boxes for ft + in). */
.ob-q-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.ob-unit-pick .ob-seg { padding: 3px; }
.ob-unit-pick .ob-seg button { min-height: 40px; min-width: 48px; padding: 0 14px; font-size: .875rem; }
.ob-q-height .ob-measure, .ob-q-weight .ob-measure { min-height: 60px; flex-wrap: nowrap; }
.ob-measure[data-unit="ftin"] .ob-input { width: 92px; }
.ob-qs:has(.ob-q-height) { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.ob-qs:has(.ob-q-height) > .ob-units, .ob-qs:has(.ob-q-height) > .ob-bmi-live { grid-column: 1 / -1; }

/* BMI gauge (South Asian scale) */
.bmi-gauge { display: grid; gap: 10px; padding: 18px; border-radius: var(--r-md); background: var(--mist-100); }
.gauge-num { display: flex; align-items: baseline; gap: 10px; }
.gauge-num span { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.gauge-num b { font-size: 2.25rem; font-weight: 500; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-track { position: relative; display: flex; gap: 2px; height: 12px; margin-top: 4px; }
.gauge-track i { height: 100%; }
.gauge-track i:first-child { border-radius: 6px 0 0 6px; }
.gauge-track i:nth-last-child(2) { border-radius: 0 6px 6px 0; }
.g-below { background: #D2D9D5; }
.g-healthy { background: #8FD3AE; }
.g-raised { background: #F2C67B; }
.g-high { background: #E89A7A; }
.gauge-pin { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--solid); border: 3px solid var(--white); box-shadow: 0 2px 8px rgba(27, 37, 33, .35); transition: left .6s var(--ease); animation: pinIn .7s var(--ease) both; }
@keyframes pinIn { from { left: 0; opacity: 0; } }
.gauge-ticks { position: relative; height: 14px; font-size: .6875rem; color: var(--ink-3); font-weight: 600; }
.gauge-ticks span { position: absolute; transform: translateX(-50%); }
.gauge-read { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .875rem; color: var(--ink-2); }

/* Target weight slider */
.ob-target { display: grid; gap: 10px; padding: 20px; border-radius: var(--r-md); background: var(--mist-100); }
.ob-target-val { display: grid; gap: 2px; }
.ob-target-val b { font-size: clamp(2rem, 5vw, 2.6rem); font-weight: 500; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ob-target-val span { font-size: .9375rem; color: var(--ink-2); font-weight: 500; }
.ob-target input[type="range"], .ob-slider input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; cursor: pointer; }
.ob-target input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: var(--accent); }
.ob-target input[type="range"]::-moz-range-track { height: 8px; border-radius: 8px; background: var(--accent); }
.ob-target input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: var(--white); border: 3px solid var(--solid); box-shadow: 0 3px 10px rgba(27, 37, 33, .3); transition: transform var(--t-fast); }
.ob-target input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--white); border: 3px solid var(--solid); box-shadow: 0 3px 10px rgba(27, 37, 33, .3); }
.ob-target input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
.ob-target input[type="range"]:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; border-radius: 8px; }
.ob-slider-ends { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-3); font-weight: 600; }

/* Bottom bar */
.ob-nav { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 16px; background: linear-gradient(transparent, var(--paper) 35%); }
.ob-nav .btn-accent { min-height: 54px; padding: 0 24px; font-size: 1rem; }
.ob-nav { transition: opacity var(--t-med), transform var(--t-med) var(--ease); }
.ob-nav.is-quiet { opacity: 0; transform: translateY(12px); pointer-events: none; }
.ob-nav .btn .spin { display: none; }
.ob-nav .btn[aria-busy="true"] .spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.ob-nav .btn[aria-busy="true"] .arrow { display: none; }
.ob-save { flex: 1; text-align: center; font-size: .875rem; color: var(--ink-3); display: inline-flex; justify-content: center; align-items: center; gap: 6px; }
.ob-save .ai { width: 16px; height: 16px; color: var(--ok); }
.ob-save .spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.ob-save .err { color: var(--bad); font-weight: 600; }
.link-btn { border: 0; background: none; padding: 0 4px; font: inherit; font-weight: 700; color: var(--brand); text-decoration: underline; cursor: pointer; min-height: 32px; }

/* Finished plan */
.done-hero { position: relative; overflow: hidden; display: grid; justify-items: center; text-align: center; gap: 10px; padding: clamp(28px, 5vw, 44px) 20px; margin: calc(-1 * clamp(22px, 4vw, 40px)) calc(-1 * clamp(22px, 4vw, 40px)) 4px; border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--night-900); color: var(--on-dark); }
.done-hero h2 { font-size: clamp(1.9rem, 4.6vw, 2.75rem); line-height: 1.05; font-weight: 500; letter-spacing: -.045em; max-width: 18ch; outline: none; }
.done-hero p { color: var(--on-dark-2); max-width: 46ch; }
.done-hero .eyebrow { color: var(--accent); }
.done-badge { width: 96px; height: 96px; }
.done-cta { display: grid; justify-items: center; gap: 10px; margin-top: 8px; }
.done-cta .btn { min-height: 56px; padding: 0 28px; font-size: 1.0625rem; }
.done-login { color: var(--on-dark); font-weight: 600; font-size: .9375rem; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }
.done-ticks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: .8125rem; color: var(--on-dark-2); }
.done-ticks li { display: inline-flex; align-items: center; gap: 6px; }
.done-ticks .ai { width: 14px; height: 14px; color: var(--accent); }
.done-hero.celebrate .done-badge .ring { transform-origin: 60px 60px; animation: ringIn .6s var(--ease) both; }
.done-hero.celebrate .done-badge .tick { stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .5s .35s var(--ease) forwards; }
.done-hero.celebrate .done-badge .rays { transform-origin: 60px 60px; animation: rays .9s .2s var(--ease) both; }
@keyframes ringIn { from { transform: scale(.3); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rays { from { transform: scale(.5) rotate(-30deg); opacity: 0; } }
.confetti { position: absolute; left: 50%; top: 70px; pointer-events: none; }
.confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; background: var(--accent); opacity: 0;
  --a: calc(var(--i) * 20deg); animation: burst 1.3s calc(.25s + var(--i) * 12ms) cubic-bezier(.2, .7, .3, 1) both; }
.confetti i:nth-child(3n) { background: #8FD3AE; } .confetti i:nth-child(3n + 1) { background: #F2C67B; width: 6px; height: 6px; border-radius: 50%; }
@keyframes burst { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(.6); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-150px) rotate(240deg) scale(1); } }

.plan { display: grid; gap: 16px; }
.pl-cards { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; }
.pl-card { border-radius: var(--r-md); background: var(--mist-100); padding: 16px; display: grid; gap: 4px; align-content: start; animation: fadeUp .5s var(--ease) both; }
.pl-card span { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.pl-card b { font-size: 1.375rem; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.pl-card p { font-size: .9375rem; color: var(--ink-2); }
.plan-goal { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; }
.plan-goal > div { display: grid; gap: 4px; }
.plan-goal .qa { width: 96px; height: 96px; border-radius: var(--r-sm); }
.plan-level { background: var(--accent); animation-delay: .08s; }
.plan-daily { grid-column: 1 / -1; animation-delay: .16s; }
.plan-level span { color: var(--ink-2); }
.plan-gets ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.plan-gets li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 16px; border-radius: var(--r-md); background: var(--night-900); color: var(--on-dark); font-size: .9375rem; line-height: 1.45; animation: fadeUp .5s var(--ease) both; animation-delay: calc(.15s + var(--i) * 80ms); }
.plan-gets .ai { width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.ob-fine { font-size: .8125rem; color: var(--ink-3); }

.ob-answers { border-top: 1px solid var(--line-light); padding-top: 12px; }
.ob-answers > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 600; color: var(--brand); }
.ob-answers > summary::-webkit-details-marker { display: none; }
.ob-answers > summary .ai { width: 16px; height: 16px; }
.ob-answers[open] > summary { margin-bottom: 8px; }
.ob-review { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line-light); }
.ob-review-head { display: flex; align-items: center; gap: 10px; }
.ob-review-head h3 { font-size: 1rem; font-weight: 600; flex: 1; }
.ob-review-head .btn .ai { width: 14px; height: 14px; }
.ob-flag { font-size: .75rem; font-weight: 700; color: var(--bad-ink); background: var(--bad-bg); padding: 3px 10px; border-radius: var(--pill); }
.ob-review dl { display: grid; gap: 4px; margin: 0; }
.ob-review dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 6px 0; }
.ob-review dt { color: var(--ink-3); font-size: .9375rem; }
.ob-review dd { margin: 0; font-weight: 500; }
.ob-review .err, .err { color: var(--bad); font-size: .8125rem; font-weight: 600; }
.alert.success .ai, .alert.error .ai { width: 18px; height: 18px; flex: none; }

/* ---------- Landing-page quiz (visitors) ---------- */
.quiz-guest { background: var(--paper); }
.guest-top { position: relative; z-index: 7; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px var(--gutter); background: var(--night-900); color: var(--on-dark); }
.guest-top-links { display: flex; align-items: center; gap: 10px; }
.guest-login { color: var(--on-dark); font-weight: 600; font-size: .9375rem; text-decoration: none; padding: 10px 12px; border-radius: var(--pill); }
.guest-login:hover { background: rgba(255, 255, 255, .08); }
.guest-top .quiz-close { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-dark); color: var(--on-dark); }
.quiz-guest .app-main { max-width: 900px; margin: 0 auto; }
.quiz-guest .ob-top { top: 0; }
.quiz-guest .ob-nav { bottom: 0; }
.guide-compact { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: clamp(20px, 3vw, 32px); }


/* ---------- Progress page ---------- */
.pg-head h1 { max-width: 20ch; }
.pg-tabs { position: sticky; top: 0; z-index: 4; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; background: var(--paper); scrollbar-width: none; }
.pg-tabs::-webkit-scrollbar { display: none; }
.pg-tabs a { flex: none; min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--pill); text-decoration: none; font-weight: 600; font-size: .875rem; color: var(--ink-2); border: 1px solid var(--line-light); background: var(--white); transition: border-color var(--t-fast), background-color var(--t-fast); }
.pg-tabs a:hover { border-color: var(--brand); }
.pg-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; scroll-margin-top: 70px; }
/* Wide content (tables, step lists) scrolls inside its own box instead of widening the page */
.app-wrap { grid-template-columns: minmax(0, 1fr); }
.panel, .goal-card, .ob-card { min-width: 0; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; }
.sec-head h2, .pg-section > h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); font-weight: 500; letter-spacing: -.03em; display: flex; align-items: center; gap: 10px; }
.sec-head h2 .ai, .pg-section > h2 .ai { color: var(--brand); }
.sec-head .ob-seg { background: var(--white); border: 1px solid var(--line-light); }
.sec-head .ob-seg button { min-height: 36px; font-size: .875rem; padding: 0 14px; }

/* Hero: the journey at a glance */
.pg-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: center; padding: clamp(22px, 4vw, 40px); border-radius: var(--r-xl); color: var(--on-dark);
  background: var(--night-900); scroll-margin-top: 70px; animation: fadeUp .5s var(--ease) both; }
.pg-hero > * { position: relative; z-index: 1; }
.hero-ring { display: grid; justify-items: center; gap: 10px; text-align: center; }
.hero-ring p { font-size: .875rem; color: var(--on-dark-2); max-width: 22ch; }
.ring { position: relative; width: 180px; aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .ring-bg { stroke: rgba(255, 255, 255, .1); }
.ring .ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; animation: ringFill 1.2s .15s var(--ease) both; }
@keyframes ringFill { from { stroke-dashoffset: 100; } }
.ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-in b { font-size: 2.6rem; font-weight: 500; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-in span { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-2); margin-top: 4px; }
.hero-main { display: grid; gap: 14px; align-content: start; }
.hero-goal { display: flex; align-items: center; gap: 14px; }
.hero-goal .qa { width: 64px; height: 64px; border-radius: var(--r-sm); flex: none; box-shadow: 0 0 0 1px var(--line-dark); }
.hero-goal span { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.hero-goal h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 500; letter-spacing: -.04em; line-height: 1.05; }
.hero-nums { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.hero-nums > div { display: grid; gap: 2px; }
.hero-nums span { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--on-dark-2); }
.hero-nums b { font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hero-nums i { color: var(--on-dark-2); display: grid; }
.hero-nums i .ai { width: 18px; height: 18px; }
.hero-change { padding: 6px 12px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .06); }
.hero-change.down b { color: var(--accent); }
.hero-msg { font-size: 1.0625rem; color: var(--on-dark); max-width: 52ch; }
.hero-ms { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-sm); background: rgba(226, 149, 83, .1); border: 1px solid rgba(226, 149, 83, .2); font-size: .9375rem; color: var(--on-dark); justify-self: start; }
.hero-ms .ai { width: 18px; height: 18px; color: var(--accent); flex: none; }
.hero-ms.done .ai { color: var(--accent); }
.pg-hero .btn-ghost { --fg: var(--on-dark); border-color: var(--line-dark); }
.pg-hero .btn .ai { width: 18px; height: 18px; }
.hero-empty { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.hero-empty h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 500; letter-spacing: -.04em; line-height: 1.05; }
.hero-preview { position: relative; padding: 18px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .04); border: 1px dashed var(--line-dark); }
.hero-preview svg { width: 100%; height: auto; display: block; }
.example-tag { position: absolute; top: 10px; left: 12px; font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--night-900); background: var(--accent); border-radius: var(--pill); padding: 3px 10px; }
.pv-band { fill: rgba(226, 149, 83, .22); }
.pv-line { fill: none; stroke: var(--on-dark); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 400; animation: drawLine 1.6s .2s var(--ease) both; }
.pv-dot { fill: var(--night-900); stroke: var(--on-dark); stroke-width: 2; }
@keyframes drawLine { from { stroke-dashoffset: 400; } }
.hero-list { display: grid; gap: 10px; }
.hero-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--on-dark-2); }
.hero-list b { color: var(--on-dark); }
.hero-list .ai { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 3px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.stat { padding: 16px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-light); display: grid; gap: 4px; align-content: start; }
.stat span { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.stat b { font-size: 1.5rem; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat b .of { font-size: 1rem; color: var(--ink-3); }
.stat small { font-size: .8125rem; color: var(--ink-3); }
.stat small a { color: var(--brand); font-weight: 600; }
.stat small.up { color: var(--bad-ink); }
.stat small.down { color: var(--ok-ink); }
.stat.empty b { font-size: 1rem; color: var(--ink-3); font-weight: 500; }
.stat-strip .stat { animation: fadeUp .45s var(--ease) both; }
.stat-strip .stat:nth-child(2) { animation-delay: .05s; } .stat-strip .stat:nth-child(3) { animation-delay: .1s; } .stat-strip .stat:nth-child(4) { animation-delay: .15s; }

/* Weekly check-in */
.ci-panel { padding: 0; overflow: hidden; }
/* Today's meals: a short menu for the day, one row per meal, not a set of cards. */
.td { display: grid; gap: 6px; }
.td-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 4px; }
.td-head h2 { font-size: clamp(1.5rem, 2.8vw, 1.875rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.1; }
.td-list { list-style: none; margin: 0; padding: 0; }
.td-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 8px 18px; padding: 16px 0; border-top: 1px solid var(--line-light); }
.td-meal { font-size: .9375rem; font-weight: 600; color: var(--accent-ink); }
.td-main { display: grid; gap: 3px; min-width: 0; }
.td-main h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.td-main a { color: var(--ink); text-decoration: none; }
.td-main a:hover { text-decoration: underline; }
.td-why { font-size: .9375rem; color: var(--ink-2); }
.td-done { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.td-done a { color: var(--ink-2); }
.td-done .ai { width: 18px; height: 18px; flex: none; color: var(--ok); }
.td-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.td-row.is-new .td-main { animation: tdIn .45s var(--ease) both; }
@keyframes tdIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.td-more { position: relative; }
.td-more summary { width: 40px; height: 40px; display: grid; place-items: center; list-style: none; border-radius: 50%; border: 1px solid var(--line-light); background: var(--white); color: var(--ink-2); cursor: pointer; }
.td-more summary::-webkit-details-marker { display: none; }
.td-more summary:hover { border-color: var(--brand); color: var(--ink); }
.td-more summary .ai { width: 18px; height: 18px; }
.td-more-menu { position: absolute; z-index: 5; right: 0; top: calc(100% + 6px); display: grid; min-width: 170px; padding: 6px; border-radius: var(--r-sm); background: var(--white); border: 1px solid var(--line-light); box-shadow: 0 8px 24px var(--shadow); }
.td-more-menu button { min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: .9375rem; text-align: left; color: var(--ink); cursor: pointer; }
.td-more-menu button:hover { background: var(--mist-100); }
.td-waiting, .td-note, .td-empty { font-size: .9375rem; color: var(--ink-2); padding-top: 12px; border-top: 1px solid var(--line-light); }
.td-waiting a { color: var(--brand); font-weight: 600; }
.td-empty { border-top: 0; padding-top: 0; margin-bottom: 8px; }
.td > .btn { justify-self: start; }
.td-note { font-weight: 500; color: var(--ink); }
.td-small { font-size: .8125rem; color: var(--ink-3); padding-top: 8px; }
@media (max-width: 720px) {
  .td-row { grid-template-columns: minmax(0, 1fr); }
  .td-acts { justify-content: flex-start; }
}
.dash-due { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin-bottom: 14px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--accent-soft); font-weight: 500; }
.dash-due a { color: var(--brand); font-weight: 600; }
/* The weekly check: one statement, one speed ruler, at most one decision. */
.wk-check { display: grid; gap: 14px; padding: clamp(20px, 2.6vw, 30px); }
.wk-check h3 { font-size: clamp(1.625rem, 3vw, 2.125rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.1; }
.wk-body { font-size: 1.0625rem; color: var(--ink-2); max-width: 60ch; margin-top: -6px; }
.wk-dots { display: flex; align-items: center; gap: 8px; }
.wk-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--mist-300); }
.wk-dots i.on { background: var(--accent); border-color: var(--accent); }
.wk-dots span { margin-left: 6px; font-size: .9375rem; font-weight: 600; color: var(--ink-2); }
.wk-ruler { display: grid; gap: 6px; padding-top: 6px; max-width: 640px; }
.wk-you-label, .wk-zone-label { position: relative; left: clamp(44px, var(--x), calc(100% - 64px)); justify-self: start; transform: translateX(-50%); white-space: nowrap; font-size: .875rem; }
.wk-you-label { font-weight: 700; color: var(--accent-ink); }
.wk-zone-label { color: var(--ink-2); font-weight: 500; }
.wk-track { position: relative; height: 14px; border-radius: var(--pill); background: var(--mist-200); }
.wk-zone { position: absolute; top: 0; bottom: 0; border-radius: var(--pill); background: var(--night-900); opacity: .32; }
.wk-zero { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink-3); }
.wk-you { position: absolute; top: 50%; left: var(--x); width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--white); box-shadow: 0 2px 8px var(--shadow); }
.wk-check.is-fresh .wk-you { animation: wkSettle .9s var(--ease) both; }
@keyframes wkSettle { from { left: var(--from); } to { left: var(--x); } }
.wk-ends { position: relative; display: flex; justify-content: space-between; font-size: .8125rem; color: var(--ink-3); }
.wk-steady { position: absolute; top: 0; transform: translateX(-50%); }
@media (max-width: 340px) { .wk-steady { display: none; } }
.wk-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 16px 18px; border-radius: var(--r-md); background: var(--accent-soft); }
.wk-offer > div:first-child { flex: 1 1 280px; display: grid; gap: 2px; }
.wk-offer b { font-size: 1.125rem; font-weight: 600; letter-spacing: -.015em; }
.wk-offer p { font-size: .9375rem; color: var(--ink-2); }
.wk-offer-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.wk-advice { font-size: .9375rem; color: var(--ink-2); max-width: 66ch; padding-left: 14px; border-left: 3px solid var(--accent); }
.wk-advice a { color: var(--brand); font-weight: 600; }
.wk-why summary { cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.wk-why p { margin-top: 8px; font-size: .9375rem; color: var(--ink-2); max-width: 66ch; }
.wk-weigh { display: grid; gap: 8px; padding: 16px clamp(20px, 2.6vw, 30px) 18px; border-top: 1px solid var(--line-light); background: var(--mist-100); }
.wk-weigh.is-done { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.wk-weigh.is-done p { display: flex; align-items: center; gap: 8px; }
.wk-weigh.is-done .ai { width: 18px; height: 18px; color: var(--ok); flex: none; }
.wk-weigh-field { display: grid; gap: 8px; }
.wk-weigh-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wk-weigh-row .ob-input { width: 120px; min-height: 48px; font-size: 1.125rem; background: var(--white); }
.wk-weigh .btn .spin { display: none; }
.wk-weigh .btn[aria-busy="true"] .spin { display: inline-block; }
.ci-closed { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; }
.ci-closed b { font-size: 1.0625rem; }
.ci-form { display: grid; gap: 18px; padding: 20px; animation: fadeUp .35s var(--ease) both; }
.ci-field { display: grid; gap: 8px; }
.ci-label { font-size: .9375rem; font-weight: 600; }
.ci-label .opt { font-size: .75rem; font-weight: 600; color: var(--ink-3); background: var(--mist-100); border-radius: var(--pill); padding: 2px 8px; margin-left: 4px; }
.ci-form .ob-measure .ob-input { width: 120px; min-height: 52px; font-size: 1.25rem; }
.ci-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.ci-steps button { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line-light); background: var(--white); font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.ci-steps button:hover { border-color: var(--brand); }
.ci-steps button:active { transform: scale(.94); }
.ci-steps button[aria-checked="true"] { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.ci-habits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink-2); }
.ci-habits .ai { width: 16px; height: 16px; color: var(--ok); }
.ci-habits a { color: var(--brand); font-weight: 600; }
.ci-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ci-actions .btn .spin { display: none; }
.ci-actions .btn[aria-busy="true"] .spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.ci-summary { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: var(--r-md); background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-ink); animation: fadeUp .4s var(--ease) both; }
.ci-summary > .ai { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.ci-summary .ms-hit { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 600; }
.ci-summary .ms-hit .ai { width: 18px; height: 18px; }
.ci-summary.celebrate { animation: fadeUp .4s var(--ease) both, glow 1.6s .3s ease-out; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(46, 125, 79, .45); } 100% { box-shadow: 0 0 0 18px rgba(46, 125, 79, 0); } }
.ci-history h3 { font-size: .8125rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.ci-history ol { display: grid; gap: 6px; }
.ci-history details ol { margin-top: 6px; }
.ci-history li { display: grid; grid-template-columns: 140px 110px 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: var(--r-sm); background: var(--white); border: 1px solid var(--line-light); font-size: .9375rem; }
.ci-history time { font-size: .8125rem; font-weight: 600; color: var(--ink-3); }
.ci-history .ci-note { color: var(--ink-2); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-history .btn .ai { width: 14px; height: 14px; }

/* Projection */
.pj-panel { display: grid; gap: 14px; }
.pj-key { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.pj-key span { display: inline-flex; align-items: center; gap: 8px; }
.pj-key span::before { content: ""; display: inline-block; }
.k-actual::before { width: 22px; height: 3px; border-radius: 2px; background: var(--chart); box-shadow: inset 0 0 0 0 transparent; }
.k-proj::before { width: 22px; height: 12px; border-radius: 3px; background: rgba(150, 174, 245, .38); border: 1.5px dashed var(--accent-600); }
.k-target::before { width: 22px; border-top: 2.5px dashed var(--ok); }
.pj-fig { position: relative; margin: 0; }
.pj-chart .pj-band { fill: rgba(150, 174, 245, .32); stroke: var(--accent-600); stroke-width: 1.5; stroke-dasharray: 5 4; animation: fadeIn .8s var(--ease) both; }
.pj-chart .pj-mid { fill: none; stroke: var(--accent-600); stroke-width: 1.5; stroke-dasharray: 2 5; stroke-linecap: round; }
.pj-chart .pj-target { stroke: var(--ok); stroke-width: 2; stroke-dasharray: 7 5; }
.pj-chart .pj-actual { fill: none; stroke: var(--chart); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; animation: drawPath 1.2s .2s var(--ease) both; }
@keyframes drawPath { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fadeIn { from { opacity: 0; } }
.pj-chart .pj-dot { fill: var(--chart); stroke: var(--white); stroke-width: 2.5; }
.pj-chart .lbl { font-weight: 700; font-size: 12px; fill: var(--ink-2); }
.pj-chart .axis-unit { font-weight: 700; }
.pj-chart .pj-cursor { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; transition: opacity var(--t-fast); }
.pj-chart .pj-cursor.on { opacity: 1; }
.pj-chart .pj-hit { fill: transparent; cursor: crosshair; outline: none; }
.pj-chart .pj-hit:focus-visible { fill: rgba(52, 70, 63, .08); }
.pj-tip { position: absolute; top: 8px; transform: translateX(12px); display: grid; gap: 2px; min-width: 180px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--night-900); color: var(--on-dark); font-size: .8125rem; box-shadow: 0 10px 30px rgba(27, 37, 33, .3); pointer-events: none; z-index: 2; }
.pj-tip.flip { transform: translateX(calc(-100% - 12px)); }
.pj-tip b { font-size: .875rem; margin-bottom: 2px; }
.pj-tip span { color: var(--on-dark-2); }
.pj-lede { color: var(--ink-2); }
.pj-table th[scope="row"] { font-weight: 600; }
.pj-table th[scope="row"] small { display: block; font-size: .75rem; font-weight: 500; color: var(--ink-3); }
.pj-table tr.is-start { background: var(--mist-100); }
.pj-how > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-weight: 600; color: var(--brand); }
.pj-how > summary::-webkit-details-marker { display: none; }
.pj-how > summary .ai { width: 16px; height: 16px; }
.pj-how ul { display: grid; gap: 6px; padding-left: 18px; list-style: disc; color: var(--ink-2); font-size: .9375rem; }
.pj-missing { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pj-missing > .ai { color: var(--brand); }
.pj-missing p { flex: 1 1 260px; color: var(--ink-2); }

/* Goals */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.goal-card { display: grid; gap: 12px; padding: 18px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-light); align-content: start; animation: fadeUp .45s var(--ease) both; }
.goal-card.is-paused { opacity: .75; }
.goal-top { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: center; }
.goal-top .ring { width: 76px; }
.goal-top .ring circle { stroke-width: 12; }
.goal-top .ring .ring-bg { stroke: var(--mist-200); }
.goal-top .ring .ring-fg { stroke: var(--chart); }
.goal-top .ring-in b { font-size: 1.125rem; color: var(--ink); letter-spacing: -.02em; }
.goal-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--mist-100); color: var(--brand); }
.goal-card.is-completed .goal-icon { background: var(--ok-bg); color: var(--ok-ink); }
.goal-icon .ai { width: 28px; height: 28px; }
.goal-head { display: grid; gap: 6px; min-width: 0; }
.goal-head h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.015em; }
.goal-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.goal-badges:empty { display: none; }
.goal-next { display: flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 600; color: var(--brand); }
.goal-next .ai { width: 14px; height: 14px; }
.goal-edit { display: grid; gap: 12px; }
.goal-edit .field { display: grid; gap: 4px; }
.goal-edit label { font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.goal-edit-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.goal-edit .ob-input { min-height: 46px; }
.badge { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: var(--pill); background: var(--mist-200); color: var(--ink-2); }
.badge.suggested { background: var(--mist-100); color: var(--brand); }
.badge.completed { background: var(--ok-bg); color: var(--ok-ink); }
.badge.paused { background: var(--warn-bg); color: var(--warn-ink); }
.goal-bar { height: 8px; border-radius: var(--pill); background: var(--mist-200); overflow: hidden; }
.goal-bar i { display: block; height: 100%; background: var(--chart); border-radius: inherit; }
.goal-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .875rem; color: var(--ink-2); }
.goal-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; border-top: 1px solid var(--line-light); }
.goal-actions .btn { min-height: 38px; padding: 0 12px; font-size: .8125rem; }
.goal-actions .btn .ai, .goal-card .btn .ai { width: 14px; height: 14px; }
.idea-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.idea-row > span { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.chip-add { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--pill); border: 1.5px dashed var(--mist-300); background: var(--white); font: inherit; font-size: .875rem; font-weight: 500; color: var(--ink); cursor: pointer; transition: border-color var(--t-fast), background-color var(--t-fast), transform var(--t-fast); }
.chip-add:hover { border-color: var(--brand); border-style: solid; }
.chip-add:active { transform: scale(.97); }
.chip-add .ai { width: 14px; height: 14px; color: var(--brand); }
.empty-soft p { color: var(--ink-2); }
.add-panel > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 28px; font-weight: 600; color: var(--ink); }
.add-panel > summary::-webkit-details-marker { display: none; }
.add-panel > summary .ai { width: 16px; height: 16px; color: var(--brand); }
.add-panel[open] > summary { margin-bottom: 14px; }

/* Habits */
.habit-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.habit-list { display: grid; gap: 8px; }
.habit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-light); }
.habit-row h3 { font-size: .9688rem; font-weight: 600; }
.habit-row p { font-size: .8125rem; color: var(--ink-3); }
.streak { display: inline-flex; align-items: center; gap: 3px; color: var(--warn-ink); font-weight: 600; }
.streak .ai { width: 13px; height: 13px; }
.week { display: grid; grid-template-columns: repeat(7, 38px); gap: 4px; }
.week button { height: 42px; border-radius: var(--r-sm); border: 1.5px solid var(--line-light); background: var(--white); font: inherit; font-size: .6875rem; font-weight: 600; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; line-height: 1.1; padding: 0; transition: background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.week button:hover { border-color: var(--brand); }
.week button[aria-pressed="true"] { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.week button .ai { width: 14px; height: 14px; }
.week button[disabled] { opacity: .5; cursor: progress; }
.week button.just-ticked { animation: pop .45s var(--ease); }
.heat { display: grid; gap: 6px; padding: 14px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line-light); }
.heat-title { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.heat-days, .heat-grid { display: grid; grid-template-columns: repeat(7, 22px); gap: 4px; }
.heat-days span { font-size: .6875rem; font-weight: 600; color: var(--ink-3); text-align: center; }
.heat .h { width: 22px; height: 22px; border-radius: 6px; display: block; }
.h.l0 { background: var(--mist-100); } .h.l1 { background: #DCE3DF; } .h.l2 { background: #A9B8B1; } .h.l3 { background: #6E8279; } .h.l4 { background: var(--chart); }
.h.future { background: transparent; border: 1px dashed var(--mist-300); }
.heat-key { display: flex; align-items: center; gap: 4px; font-size: .6875rem; color: var(--ink-3); margin-top: 4px; }
.heat-key .h { width: 12px; height: 12px; border-radius: 3px; }
.add-habit { margin-top: 2px; }
.icon-btn .ai { width: 16px; height: 16px; }

/* Shared form + chart pieces */
.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.form-inline .field { display: grid; gap: 4px; }
.form-inline label { font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.form-inline .ob-input { min-height: 44px; width: auto; min-width: 120px; font-size: 1rem; }
.form-inline .ob-measure .ob-input { width: 110px; min-height: 44px; font-size: 1rem; }
.form-inline .select select { min-height: 44px; }
.form-msg { font-size: .875rem; font-weight: 600; min-height: 1.2em; }
.form-msg:empty { min-height: 0; }
.form-msg.ok { color: var(--ok-ink); }
.form-msg.bad { color: var(--bad); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font: 500 12px var(--font-sans); fill: var(--ink-3); }
.chart .grid { stroke: var(--line-light); }
.chart .line { fill: none; stroke: var(--chart); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; animation: drawPath 1.1s var(--ease) both; }
.chart .dot { fill: var(--white); stroke: var(--chart); stroke-width: 2; }
.chart-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.data-table th, .data-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line-light); white-space: nowrap; }
.data-table thead th { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
details.mini > summary { cursor: pointer; font-weight: 600; font-size: .875rem; color: var(--brand); list-style: none; min-height: 36px; display: inline-flex; align-items: center; gap: 4px; }
details.mini > summary::-webkit-details-marker { display: none; }
details.mini > summary .ai { width: 14px; height: 14px; }
.timeline { display: grid; gap: 0; border-left: 2px solid var(--mist-300); margin-left: 8px; }
.timeline li { position: relative; padding: 0 0 16px 20px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid var(--brand); }
.timeline time { display: block; font-size: .75rem; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; }
.timeline p { font-size: .9375rem; }
.ob-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; padding: 20px; border-radius: var(--r-lg); background: var(--night-900); color: var(--on-dark); }
.ob-cta b { display: block; font-size: 1.125rem; }
.ob-cta p { color: var(--on-dark-2); font-size: .9375rem; }
.ob-cta .mini-bar { height: 6px; border-radius: var(--pill); background: rgba(255, 255, 255, .15); margin-top: 8px; width: min(260px, 60vw); overflow: hidden; }
.ob-cta .mini-bar i { display: block; height: 100%; background: var(--accent); }


/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .meals-layout { grid-template-columns: minmax(0, 1fr); }
  .myday { position: static; }
  .myday-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 1023px) {
  .auth-pending { background: linear-gradient(180deg, var(--night-900) 68px, var(--paper) 68px) fixed; }
  .auth-pending::after { inset: 68px 0 0; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .app-side { display: none; }
  .app-top { display: flex; }
  .app-tabs { display: grid; }
  .app-main { padding-bottom: 110px; }
  .dash-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lib-layout { grid-template-columns: minmax(0, 1fr); }
  .week-nav { position: static; display: flex; overflow-x: auto; padding: 6px; }
  .week-nav [role="tab"] { flex: none; }
  .week-note { display: none; }
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-side { position: static; }
}
@media (max-width: 760px) {
  .dash-sections, .dash-row, .recipe-top, .recipe-cols { grid-template-columns: minmax(0, 1fr); }
  .myday-slots { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .nutrition { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .select { flex: 1 1 calc(50% - 5px); }
  .doc-row { grid-template-columns: 44px minmax(0, 1fr); }
  .doc-icon { width: 44px; height: 52px; }
  .doc-actions { grid-column: 1 / -1; }
  .doc-actions .btn { flex: 1; }
}
/* ==========================================================================
   Nutrition: shared pieces
   ========================================================================== */
.mline { display: inline-flex; align-items: center; gap: 3px; font-size: .8125rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mline .mk { font-style: normal; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; font-size: .625rem; font-weight: 800; color: var(--snow); margin-left: 5px; }
.mline .mk:first-child { margin-left: 0; }
.mk.pro, .mx.pro .mx-bar i { background: var(--pro); }
.mk.carb, .mx.carb .mx-bar i { background: var(--carb); }
.mk.fat, .mx.fat .mx-bar i { background: var(--fat); }
.src { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: var(--pill); font-size: .6875rem; font-weight: 700; letter-spacing: .02em; background: var(--mist-100); color: var(--ink-2); border: 1px solid var(--line-light); white-space: nowrap; }
.src-label { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.src-user, .src-recipe_estimate { background: var(--mist-200); color: var(--brand); }
.src-plan { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }

/* Macro bars */
.mx { display: grid; gap: 6px; }
.mx-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mx-top span { font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.mx-top b { font-size: 1.125rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mx-top small { font-size: .8125rem; font-weight: 500; color: var(--ink-3); }
.mx-bar { height: 10px; border-radius: var(--pill); background: var(--mist-200); overflow: hidden; }
.mx-bar i { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; transform-origin: left; animation: barIn .9s var(--ease) both; }
.mx-bar[data-empty] i { display: none; }
@keyframes barIn { from { transform: scaleX(0); } }
.mx-miss { font-size: .75rem; color: var(--warn-ink); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translate(-50%, 160%); max-width: min(520px, calc(100% - 32px)); padding: 12px 18px; border-radius: var(--pill);
  background: var(--night-900); color: var(--on-dark); font-size: .9375rem; font-weight: 500; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .5); border: 1px solid var(--line-dark);
  transition: transform .45s var(--ease), opacity .3s, visibility 0s linear .45s; pointer-events: none; opacity: 0; visibility: hidden; }
.toast.on { transform: translate(-50%, 0); pointer-events: auto; opacity: 1; visibility: visible; transition-delay: 0s; }
.toast .link-btn { color: var(--accent); }
@media (max-width: 1023px) { .toast { bottom: calc(80px + env(safe-area-inset-bottom)); } }

/* Stepper */
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper .icon-btn { font-size: 1.25rem; font-weight: 600; line-height: 1; }
.stepper input { width: 110px; text-align: center; font-size: 1.375rem; font-weight: 600; min-height: 52px; font-variant-numeric: tabular-nums; }
.stepper.sm b { min-width: 2ch; text-align: center; font-size: 1.25rem; font-weight: 600; }
.stepper .icon-btn[disabled] { opacity: .4; cursor: default; }

/* ---------- Sheet (dialog) ---------- */
html.sheet-open { overflow: hidden; }
.sheet { width: min(620px, 100%); max-width: 100%; max-height: min(88vh, 860px); margin: auto; padding: 0; border: 0; border-radius: var(--r-xl); background: var(--white); color: var(--ink);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .55); overflow: hidden; }
.sheet::backdrop { background: rgba(27, 37, 33, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet[open] { animation: sheetIn .4s var(--ease) both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.sheet-in { display: flex; flex-direction: column; max-height: min(88vh, 860px); }
.sheet-in.swap > * { animation: fadeUp .3s var(--ease) both; }
.sheet-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 18px 12px 22px; border-bottom: 1px solid var(--line-light); }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet-head h2 { font-size: 1.3125rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; overflow-wrap: anywhere; }
.sheet-head p { font-size: .875rem; color: var(--ink-3); margin-top: 2px; }
.icon-btn.fav[aria-pressed="true"] { color: var(--carb); border-color: var(--carb); }
.icon-btn.fav[aria-pressed="true"] .ai { fill: currentColor; }
.sheet-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-light); background: var(--white); }
.sheet-foot .btn-accent { min-height: 50px; padding: 0 24px; }
.sheet-foot .btn .spin, .tg-form .btn .spin { display: none; }
.sheet-foot .btn[aria-busy="true"] .spin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@media (max-width: 640px) {
  .sheet { width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .sheet-in { max-height: 92vh; }
  .sheet[open] { animation: sheetUp .38s var(--ease) both; }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } }
}

/* Food search */
.fs-bar { display: flex; gap: 8px; padding: 14px 18px 4px; }
.fs-search { flex: 1; }
.fs-search input { min-height: 52px; font-size: 1.0625rem; }
.fs-scan { width: 52px; height: 52px; border-radius: var(--r-sm); }
.fs-body { flex: 1; overflow-y: auto; padding: 8px 18px 18px; overscroll-behavior: contain; }
.fs-group { margin-top: 14px; }
.fs-group h3 { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.fs-group ul { display: grid; gap: 4px; }
.fs-src { font-size: .75rem; color: var(--ink-3); margin: -2px 0 6px; }
.fs-more { margin-top: 6px; width: 100%; }
.fs-hint { padding: 10px 2px; }
.fs-warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn-ink); font-size: .875rem; margin-top: 10px; }
.fs-warn .ai { width: 16px; height: 16px; margin-top: 2px; }
.fs-loading { display: grid; justify-items: center; gap: 10px; padding: 36px 0; color: var(--ink-3); font-size: .875rem; }
.fs-loading.sm { display: flex; justify-content: center; align-items: center; padding: 18px 0; }
.fs-loading.sm .spin-lg { width: 18px; height: 18px; border-width: 2px; }
.fs-empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 28px 12px; color: var(--ink-2); }
.fs-empty .ai { width: 26px; height: 26px; color: var(--brand); }
.fs-empty p { font-size: .9375rem; max-width: 40ch; }
.fs-empty.sm { padding: 16px 8px; }
.fi { position: relative; width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--r-md);
  background: none; font: inherit; text-align: left; color: inherit; cursor: pointer; transition: background-color var(--t-fast), border-color var(--t-fast); }
.fi:hover { background: var(--mist-100); }
.fi:focus-visible { outline: 2px solid var(--brand); outline-offset: 0; }
.fi-img { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: var(--mist-100); }
.fi-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.fi-ph .ai { width: 20px; height: 20px; color: var(--brand); }
.fi-text { display: grid; gap: 1px; min-width: 0; }
.fi-text b { font-weight: 600; font-size: .9688rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fi-text small { font-size: .8125rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-num { display: grid; justify-items: end; line-height: 1.05; }
.fi-num b { font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.fi-num small { font-size: .6875rem; color: var(--ink-3); text-align: right; }
.fi .src { min-height: 17px; padding: 0 6px; font-size: .625rem; margin-right: 2px; vertical-align: 1px; }

/* Portion view */
.pv { flex: 1; overflow-y: auto; display: grid; gap: 14px; align-content: start; padding: 16px 22px 20px; }
.pv-food { display: grid; gap: 8px; }
.pv-img { width: 84px; height: 84px; object-fit: contain; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line-light); }
.pv-src { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .8125rem; color: var(--ink-3); }
.pv-full { font-size: .8125rem; color: var(--ink-3); }
.pv-notes { display: grid; gap: 4px; }
.pv-notes li, .pv-missing { display: flex; gap: 8px; align-items: flex-start; font-size: .875rem; color: var(--ink-2); }
.pv-notes .ai, .pv-missing .ai { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--warn-ink); }
.pv-missing { padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-bg); border: 1px solid var(--warn-line); }
.pv-portion { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pv-portion .select { flex: 1 1 180px; }
.pv-why { margin-top: -6px; }
.pv-out { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 20px; align-items: center; padding: 16px; border-radius: var(--r-md); background: var(--mist-100); }
.pv-kcal { display: grid; justify-items: center; min-width: 96px; }
.pv-kcal b { font-size: 2.6rem; font-weight: 500; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.pv-kcal span { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.pv-macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pv-m { display: grid; gap: 2px; padding: 10px 10px 10px 12px; border-radius: var(--r-sm); background: var(--white); border-left: 4px solid var(--c); }
.pv-m.pro { --c: var(--pro); } .pv-m.carb { --c: var(--carb); } .pv-m.fat { --c: var(--fat); }
.pv-m span { font-size: .75rem; font-weight: 600; color: var(--ink-3); }
.pv-m b { font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.pv-extra { grid-column: 1 / -1; font-size: .8125rem; color: var(--ink-3); }
.pv-move { display: grid; gap: 6px; }
.pv-move label, .rl-grid label, .bc-form label { font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.rl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.rl-grid .field, .cf .field { display: grid; gap: 6px; }
@media (max-width: 480px) { .pv-out { grid-template-columns: minmax(0, 1fr); } .pv-kcal { justify-items: start; } }

/* Custom food form */
.cf { flex: 1; overflow-y: auto; display: grid; gap: 12px; padding: 16px 22px 20px; }
.cf label { font-size: .875rem; font-weight: 600; }
.cf .opt { font-size: .75rem; font-weight: 600; color: var(--ink-3); margin-left: 4px; }
.cf .ob-input { min-height: 48px; }
.cf .field-error:empty { display: none; }
.cf-serving { border: 1px solid var(--line-light); border-radius: var(--r-md); padding: 12px 14px 4px; display: grid; gap: 10px; margin: 0; }
.cf-serving legend { font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 0 6px; }
.cf-row, .cf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cf-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.cf input[aria-invalid="true"] { border-color: var(--bad); }

/* Barcode */
.bc { flex: 1; overflow-y: auto; display: grid; gap: 16px; padding: 16px 22px 22px; }
.bc-cam { position: relative; display: grid; place-items: center; min-height: 120px; border-radius: var(--r-md); background: var(--mist-100); overflow: hidden; }
.bc-cam video { display: none; width: 100%; max-height: 300px; object-fit: cover; }
.bc-cam.on video { display: block; }
.bc-frame { display: none; position: absolute; inset: 30% 12%; border: 3px solid var(--accent); border-radius: var(--r-sm); box-shadow: 0 0 0 999px rgba(27, 37, 33, .35); }
.bc-cam.on .bc-frame { display: block; }
.bc-form { display: grid; gap: 6px; }
.bc-row { display: flex; gap: 8px; }
.bc-row input { flex: 1; font-variant-numeric: tabular-nums; letter-spacing: .04em; }

/* ---------- Food diary page ---------- */
.dy { display: grid; gap: 18px; }
.dy[aria-busy="true"] { opacity: .6; transition: opacity .2s; }
.dy-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dy-date { position: relative; display: grid; min-width: 0; padding: 4px 14px; border-radius: var(--r-md); cursor: pointer; }
.dy-date:hover { background: var(--mist-100); }
.dy-date b { font-size: 1.375rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.dy-date span { font-size: .875rem; color: var(--ink-3); }
.dy-date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dy-date:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }

.dy-sum { position: relative; overflow: hidden; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(18px, 4vw, 40px); align-items: center; padding: clamp(20px, 3.5vw, 34px);
  border-radius: var(--r-xl); color: var(--on-dark); background: var(--night-900); animation: fadeUp .45s var(--ease) both; }
.dy-sum > * { position: relative; z-index: 1; }
.dy-ring { display: grid; justify-items: center; gap: 8px; text-align: center; }
.ring.big { width: 200px; }
.ring.big circle { stroke-width: 9; }
.ring .ring-fg.over { stroke: #FFB27A; }
.dy-left { font-size: .9375rem; color: var(--on-dark-2); }
.dy-left b { color: var(--on-dark); font-size: 1.0625rem; }
.dy-macros { display: grid; gap: 14px; }
.dy-sum .mx-top span, .dy-sum .mx-top small { color: var(--on-dark-2); }
.dy-sum .mx-bar { background: rgba(255, 255, 255, .1); }
.dy-sum .mx.pro .mx-bar i { background: #5CCB9F; } .dy-sum .mx.carb .mx-bar i { background: #F0B04F; } .dy-sum .mx.fat .mx-bar i { background: #C99BF2; }
.dy-sum .mx-miss { color: #F4C77E; }
.dy-notes { display: grid; gap: 6px; }
.dy-notes p { display: flex; gap: 8px; align-items: flex-start; font-size: .875rem; color: var(--on-dark-2); }
.dy-notes .ai { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--accent); }
.dy-notes a { color: var(--accent); font-weight: 600; }

.dy-meals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dy-meal { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-light); animation: fadeUp .45s var(--ease) both; }
.dy-meal:nth-child(2) { animation-delay: .04s; } .dy-meal:nth-child(3) { animation-delay: .08s; } .dy-meal:nth-child(4) { animation-delay: .12s; }
.dy-meal > header { display: flex; align-items: center; gap: 10px; }
.dy-meal h2 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -.02em; }
.dy-meal-k { flex: 1; font-size: .875rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dy-add { min-height: 40px; }
.dy-empty { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; border-radius: var(--r-md); border: 1.5px dashed var(--mist-300); background: transparent; font: inherit; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: border-color var(--t-fast), color var(--t-fast), background-color var(--t-fast); }
.dy-empty:hover { border-color: var(--brand); color: var(--brand); background: var(--mist-100); }
.dy-empty .ai { width: 18px; height: 18px; }
.fe-list { display: grid; gap: 6px; }
.fe { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 8px 6px 8px 10px; border-radius: var(--r-md); background: var(--paper); animation: fadeUp .3s var(--ease) both; }
.fe-main { grid-column: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 2px 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.fe-main:hover b { text-decoration: underline; text-underline-offset: 3px; }
.fe-text { display: grid; min-width: 0; }
.fe-text b { font-weight: 600; font-size: .9688rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-text small { font-size: .8125rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-num { display: grid; justify-items: end; line-height: 1.05; flex: none; }
.fe-num b { font-size: 1.0625rem; font-variant-numeric: tabular-nums; }
.fe-num small { font-size: .6875rem; color: var(--ink-3); }
.fe-sub { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fe-acts { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 2px; align-items: center; }
.fe-acts .icon-btn { width: 36px; height: 36px; border-color: transparent; background: transparent; }
.fe-acts .icon-btn:hover { background: var(--white); border-color: var(--line-light); }
.fe.planned { border: 1.5px dashed var(--mist-300); background: transparent; }
.fe.planned .fe-main { grid-column: 1 / -1; cursor: default; }
.fe.planned .btn .ai { width: 14px; height: 14px; }

.dy-targets { padding: 0; }
.dy-targets > summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 16px 20px; cursor: pointer; list-style: none; }
.dy-targets > summary::-webkit-details-marker { display: none; }
.dy-targets > summary > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.dy-targets > summary .ai { color: var(--brand); }
.tg-form { display: grid; gap: 16px; padding: 4px 20px 20px; }
.tg-form .field { display: grid; gap: 6px; }
.tg-form label { font-size: .875rem; font-weight: 600; }
.tg-form .field-error:empty { display: none; }
.tg-est { display: grid; gap: 10px; padding: 16px; border-radius: var(--r-md); background: var(--mist-100); font-size: .9375rem; color: var(--ink-2); }
.tg-est b { color: var(--ink); }
.tg-est-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tg-est-row > span { font-size: .875rem; font-weight: 600; }
.tg-card { display: grid; gap: 8px; padding: 14px; border-radius: var(--r-sm); background: var(--white); border: 1px solid var(--line-light); }
.dy-credit { font-size: .75rem; color: var(--ink-3); max-width: 90ch; }
.dy-credit a { color: inherit; }

/* Dashboard: today's food */
.dash-food-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.dash-kcal { display: grid; }
.dash-kcal b { font-size: 2.75rem; font-weight: 500; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.dash-kcal span { font-size: .875rem; color: var(--ink-3); }
.dash-macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dash-food-empty { display: grid; gap: 10px; }
.dash-food-empty p { color: var(--ink-2); }

/* ---------- Recipes ---------- */
.recipe-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.rc { position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line-light); overflow: hidden;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease); animation: cardIn .45s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.rc:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -28px var(--shadow); }
.rc-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.rc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.rc:hover .rc-media img, .rc:hover .rc-art svg { transform: scale(1.05); }
.rc-art { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; color: var(--ink); isolation: isolate; }
.rc-art svg { width: 58%; max-width: 230px; height: auto; margin-left: 18%; transition: transform .8s var(--ease); }
.rc-no { position: absolute; left: 16px; bottom: 6px; font-family: var(--font-serif); font-size: 4.5rem; line-height: 1; letter-spacing: -.03em; opacity: .9; }
.cat-breakfast { background: #F6EBDD; }
.cat-lunch { background: #E4ECE5; }
.cat-dinner { background: #E8EBE9; }
.cat-snack { background: #F3E7E1; }
.rc-art .plate { fill: rgba(255, 255, 255, .7); stroke: rgba(52, 70, 63, .35); }
.rc-art .food { fill: rgba(226, 149, 83, .35); }
.rc-art .dot { fill: currentColor; stroke: none; }
.rc-tag { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: var(--pill); background: rgba(255, 255, 255, .92); color: var(--ink-fixed); font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.rc-tag.draft { background: rgba(27, 37, 33, .8); color: var(--snow); }
.rc-body { display: grid; gap: 8px; padding: 16px 16px 6px; align-content: start; flex: 1; }
.rc-body h3 { font-size: 1.0938rem; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.rc-body h3 a { text-decoration: none; }
.rc-body h3 a::after { content: ""; position: absolute; inset: 0; }
.rc-body .summary { font-size: .875rem; color: var(--ink-2); }
.rc-nutri { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .875rem; color: var(--ink-2); }
.rc-nutri > b { font-size: 1.125rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.rc-actions { position: relative; z-index: 1; display: flex; gap: 8px; padding: 10px 16px 16px; }
.rc-actions .btn { flex: 1; }
.rc-actions .btn .ai { width: 16px; height: 16px; }
.plan-date { min-height: 40px; width: auto; font-size: .875rem; padding: 0 10px; }
.myday .slot-row { flex-wrap: wrap; }
.myday .slot-row a { flex: 1 1 140px; text-decoration: none; }
.logged { display: inline-flex; align-items: center; gap: 4px; font-size: .8125rem; font-weight: 700; color: var(--ok-ink); }
.logged .ai { width: 14px; height: 14px; }

/* Recipe page */
.rp-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(18px, 3.5vw, 40px); align-items: center; animation: fadeUp .45s var(--ease) both; }
.rp-cover { position: relative; aspect-ratio: 5 / 4; border-radius: var(--r-xl); overflow: hidden; background: var(--mist-200); }
.rp-cover img { width: 100%; height: 100%; object-fit: cover; }
.rp-cover .rc-no { font-size: 7rem; left: 22px; bottom: 10px; }
.rp-head { display: grid; gap: 14px; align-content: center; }
.rp-head h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1; font-weight: 500; letter-spacing: -.04em; text-wrap: balance; }
.rp-head .muted-note { display: flex; gap: 6px; align-items: flex-start; }
.rp-head .muted-note .ai { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.rp-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-badges .rc-tag { position: static; }
.rp-head .facts { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.rp-head .fact .stepper { margin-top: 2px; }
.rp-head .fact .icon-btn { width: 34px; height: 34px; }
.allergens { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn-ink); font-size: .875rem; }
.allergens .ai { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.tips { margin-top: 18px; padding: 14px 16px; border-radius: var(--r-md); background: var(--mist-100); display: grid; gap: 6px; }
.tips ul { list-style: disc; padding-left: 18px; display: grid; gap: 4px; color: var(--ink-2); font-size: .9375rem; }
.nutri-panel .nutrition div { border-top: 4px solid var(--c, var(--mist-300)); }
.nutri-panel .nutrition .n-kcal { --c: var(--kcal); } .nutri-panel .nutrition .pro { --c: var(--pro); } .nutri-panel .nutrition .carb { --c: var(--carb); } .nutri-panel .nutrition .fat { --c: var(--fat); }
.nutri-panel .pj-how { margin-top: 10px; }
.nutri-panel .pj-how ul { margin-top: 6px; }
.nutri-panel .pj-how small { color: var(--ink-3); }
.nutri-panel > p { margin-top: 10px; }

/* Theme toggle placement on the website pages */
.site-header .theme-toggle { color: var(--snow); }
.guest-top .theme-toggle { color: var(--on-dark); }
.auth-main { position: relative; }
.auth-theme { position: absolute; top: 16px; right: 16px; }
.auth-side .brand { --logo-h: 32px; }
.guest-top .brand { --logo-h: 26px; }

@media (max-width: 900px) {
  .dy-sum { grid-template-columns: minmax(0, 1fr); }
  .dy-ring { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; align-items: center; gap: 18px; }
  .ring.big { width: 136px; }
  .ring.big .ring-in b { font-size: 2rem; }
  .dy-meals { grid-template-columns: minmax(0, 1fr); }
  .rp-hero { grid-template-columns: minmax(0, 1fr); }
  .rp-cover { aspect-ratio: 16 / 9; }
}
@media (max-width: 600px) {
  .dash-food-row { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dash-macros { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dy-date b { font-size: 1.1875rem; }
  .rc-actions .btn { padding: 0 10px; }
}

@media (max-width: 420px) {
  .myday-slots { grid-template-columns: minmax(0, 1fr); }
  /* Small phones: only the current stage keeps its name; the rest are numbered dots. */
  .ob-st:not(.is-current) .ob-label { display: none; }
  .ob-st:not(.is-current) { flex: 0 1 auto; }
  .ob-steps { grid-auto-columns: auto; grid-template-columns: none; justify-content: space-between; }
}
@media (max-width: 1023px) {
  .ob-top { top: 68px; margin-top: -28px; }
  .ob-nav { bottom: calc(66px + env(safe-area-inset-bottom)); }
  .quiz-guest .ob-top { top: 0; }
  .quiz-guest .ob-nav { bottom: env(safe-area-inset-bottom); }
  .quiz-guest .app-main { padding-bottom: 32px; }
  .pg-tabs { top: 68px; }
}
@media (max-width: 760px) {
  /* Phones: short stage names, illustrated cards as compact rows, single-column plan. */
  .ob-label .long { display: none; }
  .ob-label .short { display: inline; }
  .ob-st { gap: 6px; font-size: .75rem; }
  .ob-step-name { font-size: 1rem; }
  .ob-card { border-radius: var(--r-lg); }
  .done-hero { border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .qc-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .qc { grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: none; align-items: center; }
  .qc .qa { aspect-ratio: auto; height: 100%; min-height: 80px; }
  .qc-tick { top: 50%; margin-top: -15px; right: 12px; }
  .qc-text { padding-right: 48px; }
  .ob-measure .ob-input { width: 108px; }
  .pl-cards, .plan-gets ul, .guide-compact { grid-template-columns: minmax(0, 1fr); }
  .plan-gets ul { gap: 8px; }
  .ob-review dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ob-nav .btn { padding: 0 16px; }
  .ob-nav .btn-accent { flex: 1 1 auto; justify-content: center; }
  .ob-nav .ob-save:not([data-state="error"]) { display: none; }
  .ob-nav:has(.ob-save[data-state="error"]) { flex-wrap: wrap; }
  .ob-nav .ob-save[data-state="error"] { order: -1; flex-basis: 100%; }
  .hide-sm { display: none; }
  /* Progress page */
  .pg-hero, .hero-empty { grid-template-columns: minmax(0, 1fr); border-radius: var(--r-lg); }
  .hero-ring { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; align-items: center; gap: 16px; }
  .ring { width: 116px; }
  .ring-in b { font-size: 1.8rem; }
  .ring-in span { font-size: .625rem; }
  .pg-hero .btn-row .btn { flex: 1 1 auto; justify-content: center; }
  .sec-head .ob-seg { width: 100%; justify-content: space-between; }
  .sec-head .ob-seg button { flex: 1; padding: 0 8px; }
  .goal-grid { grid-template-columns: minmax(0, 1fr); }
  .goal-top { grid-template-columns: 64px minmax(0, 1fr); }
  .goal-top .ring, .goal-icon { width: 64px; height: 64px; }
  .goal-edit-row { grid-template-columns: minmax(0, 1fr); }
  .ci-history li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .ci-history li > :nth-child(2), .ci-history li > :nth-child(3), .ci-history li > .ci-note { grid-column: 1; }
  .ci-history li > .btn { grid-column: 2; grid-row: 1 / span 4; }
  .ci-history .ci-note:empty { display: none; }
  .ci-steps button { width: 42px; height: 42px; }
  .habit-wrap { grid-template-columns: minmax(0, 1fr); }
  .habit-row { grid-template-columns: minmax(0, 1fr) auto; }
  .habit-row .week { grid-column: 1 / -1; grid-row: 2; }
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .heat-days, .heat-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .heat { max-width: 300px; }
  .heat .h { width: 100%; height: auto; aspect-ratio: 1; }
  .heat-key .h { width: 12px; height: 12px; aspect-ratio: auto; }
  .pj-tip { min-width: 150px; }
  /* Measurement history as compact rows on phones (the projection table keeps its columns) */
  .data-table:not(.pj-table) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data-table:not(.pj-table), .data-table:not(.pj-table) tbody { display: block; }
  .data-table:not(.pj-table) tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-light); }
  .data-table:not(.pj-table) td { border: 0; padding: 2px 0; white-space: normal; }
  .data-table:not(.pj-table) td:nth-child(1) { grid-column: 1; font-size: .8125rem; color: var(--ink-3); }
  .data-table:not(.pj-table) td:nth-child(2) { grid-column: 1; font-weight: 600; }
  .data-table:not(.pj-table) td:nth-child(3) { grid-column: 1; }
  .data-table:not(.pj-table) td:nth-child(4) { grid-column: 1; font-size: .8125rem; color: var(--ink-2); }
  .data-table:not(.pj-table) td:nth-child(5) { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
  .pj-table th, .pj-table td { white-space: normal; padding: 10px 6px; font-size: .875rem; }
}

/* ---------- Quiz details in the new design (the visitor and members' quiz) ---------- */
.ob-top { backdrop-filter: none; -webkit-backdrop-filter: none; }
.ob-st.is-current .ob-dot { box-shadow: 0 0 0 4px rgba(226, 149, 83, .25); }
.ob-pct { color: var(--accent-ink); }
.ob-card { border-radius: var(--r-lg); background: var(--white); border: 1px solid rgba(52, 70, 63, .07);
  box-shadow: 0 1px 2px rgba(52, 70, 63, .04), 0 18px 44px -22px rgba(52, 70, 63, .22); }
.ob-title { font-weight: 600; letter-spacing: -.04em; }
.ob-kicker { color: var(--accent-ink); background: var(--accent-soft); }
.qc { border: 1.5px solid rgba(52, 70, 63, .14); }
.qc:hover { border-color: rgba(52, 70, 63, .32); box-shadow: 0 12px 26px -18px rgba(52, 70, 63, .4); }
.qc[aria-checked="true"] { border-color: var(--solid); box-shadow: 0 0 0 3px rgba(226, 149, 83, .55), 0 14px 30px -20px rgba(52, 70, 63, .5); }
.qc-tick { color: var(--ink-fixed); box-shadow: 0 4px 12px rgba(52, 70, 63, .25); }
.qc:focus-visible, .ob-chips button:focus-visible, .ob-pills button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ob-input:focus { border-color: var(--solid); box-shadow: 0 0 0 4px rgba(226, 149, 83, .22); }
.done-hero .eyebrow { color: var(--accent); }
