/* =========================================================
   PetGold AI — design tokens
   ========================================================= */
:root {
  --bg: #FBF8F4;
  --surface: #FFFFFF;
  --surface-2: #F6F1EA;
  --ink: #1F1B16;
  --ink-2: #4A443D;
  --muted: #857E75;
  --line: #ECE5DC;
  --line-strong: #DCD3C8;

  --primary: #E2601B;
  --primary-hover: #CC5212;
  --primary-ink: #A9440C;
  --primary-soft: #FCEDE3;

  --dark: #24201C;
  --dark-2: #3A342E;

  --blue: #2D6BD6;   --blue-soft: #E9F0FC;
  --green: #1C8556;  --green-soft: #E5F3EB;
  --amber: #A86A12;  --amber-soft: #FBF0DC;
  --red: #C23A2E;    --red-soft: #FBE9E7;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(31, 27, 22, .05);
  --shadow: 0 1px 2px rgba(31, 27, 22, .04), 0 6px 20px rgba(31, 27, 22, .06);
  --ring: 0 0 0 3px rgba(226, 96, 27, .22);

  --tabbar-h: 64px;
  --sab: env(safe-area-inset-bottom, 0px); /* iPhone home-indicator space */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); min-height: 100vh; font-size: 16px; line-height: 1.5; }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.02em; line-height: 1.2; font-weight: 700; }
h1 { font-size: 1.75rem; margin: 0 0 6px; }
h2 { font-size: 1.2rem; margin: 0 0 10px; }
h3 { font-size: 1rem; margin: 0; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.ink { color: var(--ink); }
.grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }
.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }

.ico { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.ico-fill { fill: currentColor; }

/* =========================================================
   Top bar & bottom tab bar
   ========================================================= */
.topbar { background: rgba(251, 248, 244, .88); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; font-size: 1.12rem; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; color: var(--primary); }
.brand-light { color: #fff; }
.brand-light .brand-mark { color: #fff; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-weight: 550; font-size: .93rem; padding: 8px 12px; border-radius: 999px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--ink); color: #fff; }
.nav a .ico { width: 18px; height: 18px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.logout-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; font: inherit; font-size: .9rem; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 999px; }
.logout-btn:hover { color: var(--ink); background: var(--surface-2); }
.logout-btn .ico { width: 18px; height: 18px; }

.lang-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang-toggle button { border: 0; background: none; font: inherit; font-size: .75rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.lang-toggle button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.container { max-width: 1040px; margin: 0 auto; padding: 32px 24px 64px; }

/* =========================================================
   Buttons, inputs
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .95rem; border-radius: 12px; padding: 11px 18px; min-height: 44px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, transform .08s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: .7; cursor: default; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #F3EEE8; }
.btn-lg { min-height: 52px; font-size: 1rem; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; border-radius: 10px; }
.btn-block { width: 100%; }
.text-btn { background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; align-self: flex-start; }
.text-btn:hover { color: var(--red); }

.round-btn { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; flex: none; padding: 0; }
.round-btn:hover { border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.round-btn.sm { width: 34px; height: 34px; }
.round-btn.sm .ico { width: 17px; height: 17px; }
.round-btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.round-btn.ghost:hover { color: var(--red); background: var(--red-soft); }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
label { font-weight: 600; font-size: .88rem; color: var(--ink); }
.label-hint { font-weight: 400; color: var(--muted); margin-left: 4px; }
input, select, textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface); width: 100%;
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 11px 14px; min-height: 48px;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23857E75' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 38px; }
input::placeholder, textarea::placeholder { color: #B3ACA3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input[type="date"] { min-height: 48px; }

.error { color: var(--red); background: var(--red-soft); border-radius: 10px; padding: 10px 14px; font-size: .9rem; margin: 4px 0 12px; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: .9rem; line-height: 1.45; color: var(--ink-2); }
.notice .ico { color: var(--muted); margin-top: 1px; width: 18px; height: 18px; }
.banner { display: flex; gap: 10px; align-items: center; background: var(--green-soft); color: #145E3D; border-radius: var(--r); padding: 12px 16px; margin-bottom: 18px; font-weight: 550; font-size: .95rem; }
.banner .ico { color: var(--green); }

/* segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: none; font: inherit; font-size: .9rem; font-weight: 550; color: var(--ink-2); padding: 10px 6px; border-radius: 9px; cursor: pointer; line-height: 1.2; min-height: 40px; transition: background .12s, color .12s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(31, 27, 22, .12); font-weight: 650; }
.seg-desc { font-size: .85rem; color: var(--muted); margin: 0; min-height: 1.3em; }

.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .85rem; font-weight: 550; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--ink-2); color: var(--ink); }

.input-unit, .select-unit { position: relative; }
.input-unit input { padding-right: 52px; }
.input-unit span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.select-unit select { padding-right: 84px; background-position: right 10px center; }
.select-unit span { position: absolute; right: 36px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .9rem; pointer-events: none; }
.age-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.breed-row { display: flex; gap: 8px; align-items: center; }
.breed-row input { flex: 1; }

/* =========================================================
   Cards, lists, pills
   ========================================================= */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 22px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { display: inline-flex; align-items: center; gap: 8px; font-size: 1rem; }
.card-head h3 .ico { color: var(--muted); width: 19px; height: 19px; }
.card-head a { font-size: .875rem; font-weight: 600; }
.page-head { margin-bottom: 22px; }
.page-head p { margin: 0; color: var(--muted); }
.section-title { font-size: 1.05rem; margin: 30px 0 12px; }
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.two-col .card + .card { margin-top: 0; }
.empty { color: var(--muted); font-size: .92rem; margin-bottom: 14px; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-ink); white-space: nowrap; }
.pill .ico { width: 14px; height: 14px; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.gray { background: var(--surface-2); color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 2px; }
.list-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.list-ico .ico { width: 19px; height: 19px; }
.list-ico.lg { width: 52px; height: 52px; border-radius: 14px; }
.list-ico.lg .ico { width: 26px; height: 26px; }
.tone-orange { background: var(--primary-soft); color: var(--primary); }
.tone-blue { background: var(--blue-soft); color: var(--blue); }
.tone-green { background: var(--green-soft); color: var(--green); }
.tone-amber { background: var(--amber-soft); color: var(--amber); }
.tone-gray { background: var(--surface-2); color: var(--muted); }

.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; flex: 1; }
.progress > div { height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }
.progress-row { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.progress-row span { font-size: .82rem; color: var(--muted); white-space: nowrap; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Auth
   ========================================================= */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: calc(100vh - 64px); border-radius: 28px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-brand { background: var(--dark); color: #EDE6DD; padding: 44px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%; background: var(--primary); opacity: .9; }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .brand { margin-bottom: 36px; font-size: 1.25rem; }
.auth-brand h1 { color: #fff; font-size: 2.3rem; letter-spacing: -.03em; margin-bottom: 14px; max-width: 14ch; }
.auth-brand p { color: #CFC6BB; max-width: 40ch; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 14px; max-width: 42ch; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; color: #EDE6DD; }
.auth-points .ico { color: var(--primary); width: 20px; height: 20px; margin-top: 2px; }
.auth-panel { padding: 44px; display: flex; flex-direction: column; }
.auth-lang { position: absolute; top: 22px; right: 22px; z-index: 2; }
.auth-brand .lang-toggle { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); }
.auth-brand .lang-toggle button { color: #B7AEA3; }
.auth-brand .lang-toggle button.on { background: #fff; color: var(--ink); }
.auth-form-wrap { margin: auto 0; width: 100%; max-width: 380px; align-self: center; }
.auth-form-wrap h2 { font-size: 1.6rem; margin-bottom: 18px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 22px; border: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: none; font: inherit; font-weight: 600; font-size: .92rem; padding: 9px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(31, 27, 22, .12); }

/* =========================================================
   Quiz (first-time setup)
   ========================================================= */
body[data-route="onboarding"] .container { padding-top: 20px; }
.quiz { max-width: 560px; margin: 0 auto; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.quiz-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 18px 0 26px; }
.quiz-progress span { height: 4px; border-radius: 99px; background: var(--line); }
.quiz-progress span.on { background: var(--primary); }
.quiz-head h1 { font-size: 1.85rem; letter-spacing: -.03em; }
.quiz-head p.muted { margin-bottom: 26px; }
.quiz-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.quiz-body .field:last-of-type { margin-bottom: 8px; }
.quiz-footer { margin-top: 18px; }
.quiz-footer .btn .ico { width: 18px; height: 18px; }

.about-row { display: flex; gap: 16px; align-items: flex-start; }
.about-row .field { margin-bottom: 18px; }
.photo-btn {
  width: 92px; height: 92px; border-radius: 50%; flex: none; cursor: pointer; overflow: hidden; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--surface-2); border: 1.5px dashed var(--line-strong); color: var(--muted); font-size: .7rem; font-weight: 600; text-align: center; line-height: 1.15;
  transition: border-color .15s, color .15s;
}
.photo-btn:hover { border-color: var(--primary); color: var(--primary-ink); }
.photo-btn .ico { width: 24px; height: 24px; }
.photo-btn.has { border: 0; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line); }
.photo-btn img { width: 100%; height: 100%; object-fit: cover; }
.photo-edit { position: absolute; right: 4px; bottom: 4px; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; }
.photo-edit .ico { width: 15px; height: 15px; }

.goal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goal {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px 14px; min-height: 112px;
  font: inherit; color: var(--ink); cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s;
}
.goal:hover { border-color: var(--line-strong); }
.goal.on { border-color: var(--primary); background: #FFF8F3; box-shadow: var(--ring); }
.goal-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; }
.goal.on .goal-ico { background: var(--primary); color: #fff; }
.goal-label { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.goal-check { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; }
.goal-check .ico { width: 14px; height: 14px; }
.goal.on .goal-check { background: var(--primary); border-color: var(--primary); color: #fff; }

/* edit profile */
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: .9rem; margin-bottom: 10px; }
.back-link .ico { width: 18px; height: 18px; }
.form-card { max-width: 640px; }
.form-section { font-size: 1rem; margin: 26px 0 16px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* =========================================================
   Home
   ========================================================= */
.home-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.home-head h1 { font-size: 1.9rem; margin: 0; letter-spacing: -.03em; }
.home-head .muted { margin: 2px 0 0; }
.avatar { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-empty .ico { width: 55%; height: 55%; }
.avatar-lg { width: 68px; height: 68px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line); }
.avatar-link { border-radius: 50%; flex: none; }
.avatar-link:hover { text-decoration: none; }

.lesson-card { background: var(--dark); color: #E9E2D9; border-radius: 24px; padding: 24px; position: relative; overflow: hidden; }
.lesson-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(226, 96, 27, .55), rgba(226, 96, 27, 0) 70%); pointer-events: none; }
.lesson-card > * { position: relative; z-index: 1; }
.lesson-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .8rem; color: #B7AEA3; margin-bottom: 18px; }
.lesson-tag { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); color: #F3ECE3; padding: 5px 10px; border-radius: 999px; font-weight: 600; }
.lesson-tag .ico { width: 15px; height: 15px; color: var(--primary); }
.lesson-label { font-size: .75rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--primary); margin: 0 0 6px; }
.lesson-card h2 { color: #fff; font-size: 1.45rem; letter-spacing: -.025em; margin-bottom: 8px; }
.lesson-goal { color: #CFC6BB; margin-bottom: 18px; max-width: 52ch; }
.lesson-bar { height: 6px; background: rgba(255, 255, 255, .12); border-radius: 99px; overflow: hidden; margin-bottom: 20px; }
.lesson-bar > div { height: 100%; background: var(--primary); border-radius: 99px; }
.lesson-card .btn-light .ico { width: 17px; height: 17px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; color: var(--ink); position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.tile-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; }
.tile-ico .ico { width: 21px; height: 21px; }
.tile-text strong { display: block; font-size: .95rem; letter-spacing: -.01em; }
.tile-text span { color: var(--muted); font-size: .82rem; }
.tile-go { position: absolute; top: 16px; right: 14px; color: var(--line-strong); }
.tile-go .ico { width: 18px; height: 18px; }

.stat-big { font-size: 2.1rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; }
.stat-big span { font-size: .9rem; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: 0; }

.footer-note { margin-top: 32px; font-size: .78rem; color: var(--muted); text-align: center; }

/* =========================================================
   Training
   ========================================================= */
.program-head { display: flex; gap: 16px; align-items: center; }
.program-head h2 { margin: 0 0 2px; font-size: 1.2rem; }
.program-head p { margin: 0; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 16px; }
.day-btn { aspect-ratio: 1 / 1; max-height: 52px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; font: inherit; font-weight: 650; font-size: .92rem; cursor: pointer; color: var(--ink-2); display: grid; place-items: center; transition: border-color .12s; }
.day-btn:hover { border-color: var(--line-strong); }
.day-btn .ico { width: 17px; height: 17px; }
.day-btn.done { background: var(--green-soft); border-color: transparent; color: var(--green); }
.day-btn.current { border-color: var(--primary); color: var(--primary-ink); }
.day-btn.selected { background: var(--ink); border-color: var(--ink); color: #fff; }
.lesson-detail h2 { font-size: 1.35rem; margin: 4px 0 6px; }
.checklist { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 8px; }
.checklist li { position: relative; }
.checklist input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; font-weight: 450; font-size: .95rem; line-height: 1.45; cursor: pointer; transition: background .12s, border-color .12s; }
.checklist label:hover { border-color: var(--line-strong); }
.check-box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; color: transparent; margin-top: 1px; transition: all .12s; }
.check-box .ico { width: 14px; height: 14px; }
.checklist input:checked + label { background: var(--surface-2); border-color: transparent; color: var(--muted); }
.checklist input:checked + label .check-box { background: var(--green); border-color: var(--green); color: #fff; }
.checklist input:focus-visible + label { box-shadow: var(--ring); }
.tip { display: flex; gap: 12px; align-items: flex-start; background: var(--amber-soft); border-radius: 14px; padding: 14px 16px; }
.tip .ico { color: var(--amber); margin-top: 2px; }
.tip p { margin: 0; font-size: .92rem; line-height: 1.5; color: #5E4417; }
.actions { margin-top: 18px; }
.library { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.library .card + .card { margin-top: 0; }
.program-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; }
.program-card h3 { margin-top: 4px; }
.program-card p { margin: 0; }
.program-card .meta { color: var(--muted); font-weight: 600; }
.program-card .btn { margin-top: auto; align-self: flex-start; }
.program-card.is-active { border-color: var(--primary); box-shadow: var(--ring); }

/* =========================================================
   Chat
   ========================================================= */
.chat { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 480px; padding: 0; overflow: hidden; }
.chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.bot-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--dark); color: var(--primary); display: grid; place-items: center; flex: none; }
.bot-avatar .ico { width: 22px; height: 22px; }
.chat-log { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { max-width: 82%; padding: 11px 15px; border-radius: 18px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; font-size: .95rem; }
.msg.user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.msg.typing span:nth-child(2) { animation-delay: .2s; }
.msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-form { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); align-items: flex-end; }
.chat-form textarea { resize: none; min-height: 46px; max-height: 140px; border-radius: 23px; padding: 11px 16px; }
.send-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.send-btn:hover { background: var(--primary-hover); }
.send-btn:disabled { opacity: .5; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.suggestions button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .85rem; color: var(--ink-2); cursor: pointer; text-align: left; }
.suggestions button:hover { border-color: var(--ink-2); color: var(--ink); }

/* =========================================================
   Health & food
   ========================================================= */
.sparkline { width: 100%; height: 80px; margin: 4px 0 8px; }
.inline-form { display: grid; gap: 12px; grid-template-columns: 1.4fr 1fr 1fr auto; align-items: end; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.inline-form .field { margin: 0; }
.weight-form { grid-template-columns: 1fr 1fr auto; }
.result-card .result-big { font-size: 2.5rem; font-weight: 750; letter-spacing: -.035em; line-height: 1.05; color: var(--ink); margin: 4px 0 6px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 14px; }
.stat strong { display: block; font-size: 1.3rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .8rem; line-height: 1.3; display: block; margin-top: 2px; }
.formula { margin: 14px 0 0; }

/* =========================================================
   Mobile
   ========================================================= */
@media (max-width: 860px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .library { grid-template-columns: 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; border-radius: 0; border: 0; box-shadow: none; min-height: 100vh; }
  .auth-brand { padding: 28px 24px 30px; }
  .auth-brand::after { width: 220px; height: 220px; right: -90px; bottom: -110px; }
  .auth-brand .brand { margin-bottom: 18px; }
  .auth-brand h1 { font-size: 1.75rem; }
  .auth-points { display: none; }
  .auth-panel { padding: 26px 24px 40px; }
  .auth-lang { top: 18px; right: 16px; }
  .auth-form-wrap { margin: 0 auto; }
  body[data-route="login"] .container { padding: 0; }
}

@media (max-width: 640px) {
  /* bottom tab bar, like a native app.
     The top bar must not use backdrop-filter here: it would become the containing block
     of the fixed tab bar and pin it to the top. */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .topbar-inner { height: 54px; padding: 0 16px; gap: 12px; }
  .topbar-right { margin-left: auto; }
  .logout-btn span { display: none; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; gap: 0;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + var(--sab)); padding: 6px 4px var(--sab);
    background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--line);
  }
  .nav a { flex-direction: column; gap: 3px; padding: 4px 2px; border-radius: 10px; font-size: .68rem; font-weight: 600; color: var(--muted); justify-content: center; }
  .nav a .ico { width: 24px; height: 24px; }
  .nav a:hover { background: none; }
  .nav a.active { background: none; color: var(--primary); }
  body.has-tabs .container { padding-bottom: calc(var(--tabbar-h) + var(--sab) + 28px); }

  .container { padding: 20px 16px 40px; }
  h1 { font-size: 1.5rem; }
  .card { padding: 18px; border-radius: 18px; }
  input, select, textarea, .lang-toggle button { font-size: 16px; } /* stops iOS zoom-on-focus */
  .lang-toggle button { font-size: .75rem; }

  .quiz-head h1 { font-size: 1.6rem; }
  .quiz-body { padding: 18px; }
  .quiz-progress { margin: 14px 0 20px; }
  .photo-btn { width: 80px; height: 80px; }
  .seg button { font-size: .85rem; padding: 9px 4px; }
  .seg-4 { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }

  .home-head h1 { font-size: 1.6rem; }
  .avatar-lg { width: 60px; height: 60px; }
  .lesson-card { padding: 20px; border-radius: 22px; }
  .lesson-card h2 { font-size: 1.3rem; }
  .lesson-card .btn-light { width: 100%; }
  .tiles { gap: 10px; }
  .tile { padding: 14px; gap: 12px; }
  .library { grid-template-columns: 1fr; }
  .days { gap: 6px; }
  .day-btn { border-radius: 10px; font-size: .85rem; }
  .chat { height: calc(100vh - 54px - var(--tabbar-h) - var(--sab) - 40px); min-height: 380px; border-radius: 18px; }
  .chat-head .pill { display: none; }
  .msg { max-width: 88%; }
  .inline-form, .weight-form { grid-template-columns: 1fr 1fr; }
  .inline-form .span-2, .weight-form .btn { grid-column: span 2; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 12px 10px; }
  .stat strong { font-size: 1.1rem; }
  .result-card .result-big { font-size: 2.1rem; }
  .form-actions .btn { flex: 1; }
  html { scrollbar-width: none; }
  ::-webkit-scrollbar { display: none; }
}

/* inside the iPhone preview (iphone.html) there is no real safe area, so fake the home-indicator space */
html.sim { --sab: 34px; }

/* =========================================================
   Icons (Phosphor) — app-style badges
   ========================================================= */
.ico { fill: currentColor; }

/* brand: app-icon style badge */
.brand-badge {
  width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; flex: none;
  background: linear-gradient(150deg, #F2843F 0%, #E2601B 55%, #C94C0F 100%); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 6px rgba(226, 96, 27, .35);
}
.brand-badge .ico { width: 19px; height: 19px; }
.auth-brand .brand-badge { width: 36px; height: 36px; border-radius: 11px; }
.auth-brand .brand-badge .ico { width: 22px; height: 22px; }

/* tab bar / nav: outline when idle, filled when active (like iOS) */
.nav-ico { display: inline-grid; }
.nav-ico .ico { grid-area: 1 / 1; }
.nav-ico .on { display: none; }
.nav a.active .nav-ico .on { display: block; }
.nav a.active .nav-ico .off { display: none; }

/* colored badges with white glyphs */
.tile-ico { width: 46px; height: 46px; border-radius: 14px; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 3px 8px rgba(31, 27, 22, .12); }
.tile-ico .ico { width: 25px; height: 25px; }
.bg-orange { background: linear-gradient(150deg, #F59152 0%, #E2601B 60%, #CC5212 100%); }
.bg-blue   { background: linear-gradient(150deg, #6AA2FF 0%, #3B78E7 60%, #2A60C9 100%); }
.bg-green  { background: linear-gradient(150deg, #4CCB91 0%, #22A06B 60%, #178456 100%); }
.bg-amber  { background: linear-gradient(150deg, #FBC75A 0%, #F0A422 60%, #D98A0C 100%); }

.list-ico .ico { width: 21px; height: 21px; }
.list-ico.lg .ico { width: 28px; height: 28px; }
.card-head h3 .ico { color: var(--primary); width: 20px; height: 20px; }
.lesson-tag .ico { width: 16px; height: 16px; }
.tip .ico { color: #E0A21B; width: 22px; height: 22px; }
.notice .ico { color: var(--muted); }

/* quiz goals: duotone idle, filled + white when picked */
.goal-ico { display: grid; width: 44px; height: 44px; }
.goal-ico .ico { grid-area: 1 / 1; width: 24px; height: 24px; place-self: center; }
.goal-ico .on { display: none; }
.goal.on .goal-ico { background: linear-gradient(150deg, #F59152 0%, #E2601B 60%, #CC5212 100%); }
.goal.on .goal-ico .on { display: block; }
.goal.on .goal-ico .off { display: none; }
.goal:not(.on) .goal-ico { color: var(--ink-2); }

/* auth benefit list */
.point-ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(226, 96, 27, .16); color: #F2843F; display: grid; place-items: center; flex: none; }
.auth-points li { align-items: center; }
.auth-points .point-ico .ico { color: #F2843F; width: 19px; height: 19px; margin: 0; }

.avatar-empty .ico { width: 58%; height: 58%; }

/* =========================================================
   Sign in with Apple / Google
   ========================================================= */
.oauth { display: grid; gap: 10px; }
.btn-oauth {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 50px;
  border-radius: 12px; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; padding: 0 18px;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn-oauth:disabled { opacity: .65; cursor: default; }
.btn-oauth.apple { background: #000; color: #fff; border: 1px solid #000; }
.btn-oauth.apple:hover:not(:disabled) { background: #1d1d1f; }
.btn-oauth.google { background: #fff; color: #1F1F1F; border: 1px solid #DADCE0; }
.btn-oauth.google:hover:not(:disabled) { background: #F8F9FA; border-color: #C6C9CE; }
.oauth-logo { width: 19px; height: 19px; flex: none; }
.btn-oauth.apple .oauth-logo { width: 17px; height: 20px; margin-top: -2px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: .82rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-legal { margin: 18px 0 0; font-size: .78rem; color: var(--muted); text-align: center; line-height: 1.45; }
#auth-info { margin-top: 12px; }
.demo-tag { display: block; width: fit-content; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--amber); background: var(--amber-soft); border-radius: 999px; padding: 2px 8px; margin-bottom: 6px; }
#auth-info .ico { color: var(--green); width: 18px; height: 18px; }

/* =========================================================
   Custom PNG icons (ChatGPT set in /img/icons)
   ========================================================= */
img.brand-badge { width: 34px; height: 34px; border-radius: 0; background: none; box-shadow: none; filter: drop-shadow(0 2px 3px rgba(31, 27, 22, .18)); object-fit: contain; }
.auth-brand img.brand-badge { width: 38px; height: 38px; }
.tile-img { width: 48px; height: 48px; display: block; filter: drop-shadow(0 3px 6px rgba(31, 27, 22, .14)); user-select: none; }
.goal-img { width: 46px; height: 46px; display: block; user-select: none; transition: transform .15s; }
.goal:not(.on) .goal-img { filter: saturate(.55) opacity(.85); }
.goal.on .goal-img { transform: scale(1.04); filter: drop-shadow(0 3px 6px rgba(226, 96, 27, .35)); }
.prog-img { width: 40px; height: 40px; display: block; flex: none; user-select: none; }
.prog-img.lg { width: 54px; height: 54px; }
.program-card:not(.is-active) .prog-img { filter: saturate(.5) opacity(.85); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--sab) + 16px); z-index: 60;
  transform: translate(-50%, 12px); opacity: 0; transition: opacity .2s, transform .2s;
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 32px);
  background: var(--ink); color: #fff; border-radius: 999px; padding: 11px 18px; font-size: .92rem; font-weight: 600;
  box-shadow: 0 8px 24px rgba(31, 27, 22, .25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ico { color: #4CCB91; width: 18px; height: 18px; }
.toast span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 641px) { .toast { bottom: 28px; } }

/* breed picker */
.breed-box { position: relative; }
.breed-box input { padding-left: 44px; padding-right: 44px; }
.breed-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.breed-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; padding: 0; }
.breed-clear .ico { width: 14px; height: 14px; }
.breed-clear:hover { background: var(--line); }
.breed-options {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(31, 27, 22, .14);
  max-height: 290px; overflow-y: auto;
}
.breed-options li { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; cursor: pointer; font-size: .95rem; color: var(--ink); }
.breed-options li .ico { width: 17px; height: 17px; color: var(--muted); flex: none; }
.breed-options li:hover, .breed-options li.on { background: var(--primary-soft); }
.breed-options li:hover .ico, .breed-options li.on .ico { color: var(--primary); }
.breed-options li.custom { color: var(--ink-2); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; padding-top: 12px; }
.breed-options mark { background: none; color: var(--primary-ink); font-weight: 700; }
.breed-chips { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.breed-chips .chip { padding: 7px 13px; font-size: .84rem; background: var(--surface); }
.breed-chips .chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }
@media (max-width: 640px) {
  .breed-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -18px; padding-right: 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .breed-chips::-webkit-scrollbar { display: none; }
  .breed-chips .chip { flex: none; }
}

/* =========================================================
   Settings
   ========================================================= */
.settings-btn .ico { width: 20px; height: 20px; }
.settings-btn.active { color: var(--primary); border-color: var(--primary); }
.set-label { font-size: .75rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 22px 4px 8px; }
.page-head + .set-label { margin-top: 6px; }
.set-profile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink); }
.set-profile:hover { text-decoration: none; border-color: var(--line-strong); }
.set-profile .grow { display: flex; flex-direction: column; gap: 1px; }
.set-profile strong { font-size: 1.05rem; }
.set-edit { display: inline-flex; align-items: center; gap: 2px; color: var(--primary-ink); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.set-edit .ico { width: 16px; height: 16px; }
.set-card { padding: 6px; }
.set-card .seg { background: none; border: 0; padding: 0; }
.set-card .seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.set-card .seg button .ico { width: 18px; height: 18px; }
.set-card .seg button.on { background: var(--primary-soft); color: var(--primary-ink); box-shadow: none; }
.set-list { padding: 0; overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; background: none; border: 0; font: inherit; color: var(--ink); text-align: left; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row > .ico { width: 22px; height: 22px; color: var(--muted); }
.set-row .grow { display: flex; flex-direction: column; }
.set-email { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.set-logout { cursor: pointer; color: var(--red); font-weight: 600; }
.set-logout > .ico { color: var(--red); }
.set-logout:hover { background: var(--red-soft); }
.set-about { font-size: .82rem; color: var(--muted); line-height: 1.5; margin: 0 4px; }

/* =========================================================
   Dark theme
   ========================================================= */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141210;
  --surface: #1E1B18;
  --surface-2: #27231F;
  --ink: #F3EEE8;
  --ink-2: #CFC7BD;
  --muted: #9A9188;
  --line: #2F2A25;
  --line-strong: #403931;
  --primary: #E8692A;
  --primary-hover: #F07A3A;
  --primary-ink: #FF9A5C;
  --primary-soft: #3A2417;
  --dark: #2A2420;
  --dark-2: #3A332D;
  --blue: #6AA2FF;  --blue-soft: #1B2840;
  --green: #4CCB91; --green-soft: #15301F;
  --amber: #F0B44A; --amber-soft: #33280F;
  --red: #F0776B;   --red-soft: #3A1D1A;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .35);
  --ring: 0 0 0 3px rgba(232, 105, 42, .3);
}
html[data-theme="dark"] .topbar { background: rgba(20, 18, 16, .88); }
html[data-theme="dark"] .nav a.active,
html[data-theme="dark"] .day-btn.selected,
html[data-theme="dark"] .msg.user,
html[data-theme="dark"] .photo-edit,
html[data-theme="dark"] .toast { color: var(--bg); }
html[data-theme="dark"] .btn-light { background: #F3EEE8; color: #1F1B16; }
html[data-theme="dark"] .btn-light:hover { background: #fff; }
html[data-theme="dark"] .goal.on { background: var(--primary-soft); }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #6E665D; }
html[data-theme="dark"] .banner { color: #8FE0B5; }
html[data-theme="dark"] .tip p { color: #E8CF9A; }
html[data-theme="dark"] .seg button.on { box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .set-card .seg button.on { box-shadow: none; }
@media (max-width: 640px) {
  html[data-theme="dark"] .topbar { background: var(--bg); }
  html[data-theme="dark"] .nav { background: rgba(24, 21, 19, .94); }
  html[data-theme="dark"] .nav a { color: #FFFFFF; }
  html[data-theme="dark"] .nav a.active { background: none; color: var(--primary); }
}

/* food screen: compact */
.stats-2 { grid-template-columns: 1fr 1fr !important; }
.food-profile { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.food-profile-label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.food-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.food-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; font-weight: 550; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; padding: 5px 11px; }
.food-chip-edit { color: var(--primary-ink); background: var(--primary-soft); }
.food-chip-edit:hover { text-decoration: none; }
.food-chip-edit .ico { width: 14px; height: 14px; }
.how { margin-top: 14px; }
.how summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--muted); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: "+"; font-weight: 700; }
.how[open] summary::after { content: "–"; }
.how p { margin: 8px 0 0; line-height: 1.5; }

.auth-legal a, .set-about a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }

/* =========================================================
   Quiz: clearer questions
   ========================================================= */
.q-label { display: block; font-size: 1rem; font-weight: 650; color: var(--ink); margin-bottom: 2px; }
.q-hint { margin: -2px 0 4px; font-size: .84rem; color: var(--muted); }
.field > .q-label + .seg, .field > .q-label + .opt-list, .field > .q-label + .age-row, .field > .q-label + .input-unit, .field > .q-label + .breed-box { margin-top: 6px; }

/* answer buttons that look tappable, not disabled */
.seg.choice { background: none; border: 0; padding: 0; gap: 10px; }
.seg.choice button { background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 12px; min-height: 50px; font-size: .95rem; color: var(--ink); }
.seg.choice button:hover { border-color: var(--ink-2); }
.seg.choice button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); box-shadow: none; font-weight: 700; }

/* age steppers */
.age-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stepper { display: grid; grid-template-columns: 44px 1fr 44px; grid-template-rows: auto auto; align-items: center; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 6px; }
.stepper button { width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 1.4rem; font-weight: 600; line-height: 1; cursor: pointer; }
.stepper button:active { background: var(--primary-soft); color: var(--primary-ink); }
.stepper output { text-align: center; font-size: 1.5rem; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.stepper span { grid-column: 1 / -1; text-align: center; font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* weight with kg / lb */
.weight-unit { display: flex; align-items: center; gap: 8px; }
.weight-unit input { flex: 1; font-size: 1.15rem; font-weight: 650; }
.unit-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; flex: none; }
.unit-toggle button { border: 0; background: none; font: inherit; font-size: .9rem; font-weight: 700; color: var(--muted); padding: 9px 14px; border-radius: 8px; cursor: pointer; }
.unit-toggle button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* radio cards with description */
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 12px 14px; font: inherit; color: var(--ink); cursor: pointer; }
.opt:hover { border-color: var(--ink-2); }
.opt-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; margin-top: 1px; position: relative; }
.opt-text { display: flex; flex-direction: column; gap: 1px; }
.opt-text strong { font-size: .95rem; }
.opt-text span { font-size: .84rem; color: var(--muted); line-height: 1.35; }
.opt.on { border-color: var(--primary); background: var(--primary-soft); }
.opt.on .opt-dot { border-color: var(--primary); }
.opt.on .opt-dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary); }
.opt.on .opt-text span { color: var(--ink-2); }

/* breed shortcuts: wrap into rows instead of running off the card */
.breed-chips { flex-wrap: wrap !important; overflow: visible !important; margin-right: 0 !important; padding-right: 0 !important; }

/* unanswered questions */
[data-req].missing .q-label { color: var(--red); }
[data-req].missing .seg.choice button, [data-req].missing .stepper, [data-req].missing input, [data-req].missing .goal { border-color: var(--red); }
[data-req].missing { animation: q-shake .3s; }
@keyframes q-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* sign-in hero illustration (replaces the plain orange circle) */
.auth-brand::after { display: none; }
.auth-brand > .auth-art { position: absolute; right: 0; bottom: 0; width: 340px; z-index: 0; pointer-events: none; line-height: 0; }
.auth-art img { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .35)); }
@media (max-width: 640px) {
  .auth-brand { padding-bottom: 40px; min-height: 300px; }
  .auth-brand > p { max-width: 27ch; }
  .auth-brand > .auth-art { width: 180px; }
}

/* sign-in banner polish: glow, brand word, gentle float */
.auth-brand h1 .hl { color: #F2843F; }
.auth-brand > .auth-art::before {
  content: ""; position: absolute; z-index: -1; left: -8%; top: 10%; width: 120%; height: 100%;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(242, 132, 63, .7), rgba(226, 96, 27, .28) 50%, rgba(226, 96, 27, 0));
  animation: hero-glow 6s ease-in-out infinite;
}
.auth-art img { animation: hero-float 6s ease-in-out infinite; }
@keyframes hero-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes hero-glow { 0%, 100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .auth-art img, .auth-brand > .auth-art::before { animation: none; } }
@media (max-width: 640px) {
  .auth-brand > p { max-width: 22ch; }
  .auth-brand > .auth-art { width: 196px; }
}

/* =========================================================
   Finish pass: sheet over the banner, buttons, splash
   ========================================================= */
/* primary button with the logo's glossy feel */
.btn-primary {
  background: linear-gradient(180deg, #F07A3A 0%, #E2601B 55%, #D2551A 100%);
  box-shadow: 0 6px 16px rgba(226, 96, 27, .32), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn-primary:hover { background: linear-gradient(180deg, #F48545 0%, #E5661F 55%, #CC5212 100%); }
.btn-primary:active { box-shadow: 0 3px 8px rgba(226, 96, 27, .3), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn-primary:disabled { box-shadow: none; }

/* Google first: the quickest way in */
.btn-oauth.google { min-height: 54px; border: 1.5px solid #D2D5DA; font-weight: 650; box-shadow: 0 1px 2px rgba(31, 27, 22, .06); }
.btn-oauth.google:hover:not(:disabled) { border-color: #B9BDC3; }

@media (max-width: 640px) {
  /* the form is a sheet that slides over the dark banner */
  .auth { background: var(--dark); }
  .auth-brand { min-height: 330px; padding-bottom: 48px; }
  .auth-panel {
    position: relative; z-index: 2; margin-top: -24px;
    background: var(--surface); border-radius: 26px 26px 0 0;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .18);
    padding-top: 28px;
  }
  .auth-panel::before { content: ""; position: absolute; top: 9px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--line-strong); }
  /* keep the paws clear of the language switch */
  .auth-brand > .auth-art { width: 178px; }
  .auth-lang { top: 16px; right: 14px; }
}

/* opening screen while the app loads */
#splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #1A1714;
  transition: opacity .35s ease, visibility .35s ease;
}
#splash.hide { opacity: 0; visibility: hidden; }
#splash .splash-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
#splash img { width: 96px; height: 96px; animation: splash-pop .9s cubic-bezier(.2, .8, .2, 1) both; filter: drop-shadow(0 8px 24px rgba(226, 96, 27, .45)); }
#splash span { color: #F3EEE8; font-weight: 750; font-size: 1.35rem; letter-spacing: -.02em; animation: splash-up .7s .15s ease both; }
@keyframes splash-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes splash-up { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #splash img, #splash span { animation: none; } }

/* ---------- multi-select goals ---------- */
.goal-check { font-size: .75rem; font-weight: 750; }
.goal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.link-btn { background: none; border: 0; padding: 4px 0; font: inherit; font-size: .88rem; font-weight: 650; color: var(--primary); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.program-card { position: relative; }
.plan-badge { position: absolute; top: 14px; right: 14px; font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-ink); }

/* ---------- vaccination card on home ---------- */
.vax-home { margin-top: 18px; }
.vax-stats { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 10px; }
.vax-stats > span:first-child { display: inline-flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: .9rem; }
.vax-stats strong { font-size: 1.5rem; color: var(--ink); line-height: 1; }
.vax-home .list li:first-child { border-top: 1px solid var(--line); padding-top: 12px; }
.vax-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.vax-empty p { margin: 0; color: var(--ink-2); line-height: 1.45; }
.vax-last { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.vax-last .ico { width: 16px; height: 16px; }

/* ---------- add to calendar menu ---------- */
.cal-menu { position: relative; flex: none; }
.cal-menu > summary { list-style: none; cursor: pointer; }
.cal-menu > summary::-webkit-details-marker { display: none; }
.cal-menu > summary.round-btn.ghost { color: var(--primary); }
.cal-menu > summary.round-btn.ghost:hover { color: var(--primary); background: var(--primary-soft); }
.cal-menu[open] > summary.round-btn { background: var(--primary-soft); }
.cal-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(31, 27, 22, .16); padding: 6px; display: grid; gap: 2px; animation: cal-in .14s ease-out; }
.cal-pop a, .cal-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; background: none; border-radius: 10px; font: inherit; font-size: .92rem; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; }
.cal-pop a:hover, .cal-pop button:hover { background: var(--surface-2); text-decoration: none; }
.cal-pop .ico { width: 18px; height: 18px; color: var(--primary); }
@keyframes cal-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cal-hint { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; }
.cal-hint .ico { width: 16px; height: 16px; color: var(--primary); flex: none; }

/* ---------- vet visits & exams ---------- */
.visit-list li { align-items: flex-start; }
.visit-notes { margin: 6px 0 0; font-size: .88rem; line-height: 1.45; color: var(--ink-2); white-space: pre-line; }
.visit-next { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.visit-next .cal-menu .btn { min-height: 32px; padding: 4px 12px; }
.visit-add { margin-top: 14px; }
.visit-add > summary { list-style: none; cursor: pointer; display: inline-flex; }
.visit-add > summary::-webkit-details-marker { display: none; }
.visit-add[open] > summary { display: none; }
.visit-form textarea { resize: vertical; min-height: 84px; }
.cal-menu.left .cal-pop { left: 0; right: auto; }
.card:has(.cal-menu[open]) { position: relative; z-index: 20; }

/* =========================================================
   Paw AI — assistant-style chat (open thread, pill composer)
   ========================================================= */
.gpt { display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 460px; max-width: 760px; margin: 0 auto; }
.gpt-head { display: flex; align-items: center; gap: 10px; padding: 2px 0 10px; }
.gpt-title { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.gpt-title strong { font-size: 1.05rem; }
.gpt-new { color: var(--ink-2); }
.gpt-new:hover { color: var(--ink); background: var(--surface-2); }
.gpt-new .ico { width: 20px; height: 20px; }
.gpt-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 2px 18px; scroll-behavior: smooth; }
.gpt.is-empty .gpt-log { display: flex; }

.gpt-hero { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px 8px; }
.gpt-hero img { width: 58px; height: 58px; filter: drop-shadow(0 6px 16px rgba(226, 96, 27, .35)); }
.gpt-hero h1 { font-size: 1.55rem; line-height: 1.25; letter-spacing: -.01em; margin: 0; max-width: 18ch; }
.gpt-hero .notice { text-align: left; max-width: 440px; }
.gpt-demo { margin: 0; font-size: .82rem; color: var(--muted); max-width: 34ch; }

.gpt-thread { display: flex; flex-direction: column; gap: 22px; }
.gpt-msg.user { display: flex; justify-content: flex-end; }
.gpt-bubble { max-width: 82%; background: var(--surface-2); color: var(--ink); padding: 10px 16px; border-radius: 22px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; font-size: .97rem; }
.gpt-msg.bot { display: flex; gap: 12px; align-items: flex-start; }
.gpt-mark { width: 28px; height: 28px; flex: none; margin-top: 1px; }
.gpt-body { flex: 1; min-width: 0; }
.gpt-md { font-size: .98rem; line-height: 1.62; color: var(--ink); word-wrap: break-word; }
.gpt-md p { margin: 0 0 .75em; }
.gpt-md p:last-child, .gpt-md ul:last-child, .gpt-md ol:last-child { margin-bottom: 0; }
.gpt-md ul, .gpt-md ol { margin: 0 0 .75em; padding-left: 1.3em; }
.gpt-md li { margin: .3em 0; }
.gpt-md li::marker { color: var(--muted); }
.gpt-md h4 { font-size: 1rem; margin: 1em 0 .4em; }
.gpt-md strong { font-weight: 700; }
.gpt-md code { font-size: .88em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.gpt-body .demo-tag { display: inline-block; margin-bottom: 6px; }
.gpt-actions { display: flex; gap: 2px; margin-top: 6px; margin-left: -6px; }
.gpt-act { width: 30px; height: 30px; border: 0; background: none; border-radius: 8px; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.gpt-act:hover { background: var(--surface-2); color: var(--ink); }
.gpt-act .ico { width: 17px; height: 17px; }
.gpt-dot { display: inline-block; width: 12px; height: 12px; margin-top: 8px; border-radius: 50%; background: var(--ink); animation: gpt-pulse 1s ease-in-out infinite; }
@keyframes gpt-pulse { 0%, 100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }
.gpt-error { margin-top: 12px; }

.gpt-bottom { flex: none; padding-top: 6px; }
.gpt-suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.gpt-suggest button { text-align: left; font: inherit; font-size: .86rem; line-height: 1.35; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 11px 14px; cursor: pointer; transition: background .15s, border-color .15s; }
.gpt-suggest button:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink); }
.gpt-composer { display: flex; align-items: flex-end; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 28px; padding: 7px 7px 7px 18px; box-shadow: 0 4px 18px rgba(31, 27, 22, .08); transition: border-color .15s, box-shadow .15s; }
.gpt-composer:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.gpt-composer textarea { flex: 1; border: 0; background: none; box-shadow: none !important; resize: none; padding: 9px 0; min-height: 40px; max-height: 160px; line-height: 1.45; font-size: 1rem; }
.gpt-composer textarea:focus { outline: none; }
.gpt-send { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; cursor: pointer; transition: opacity .15s, transform .1s; }
.gpt-send .ico { width: 19px; height: 19px; }
.gpt-send:disabled { background: var(--line-strong); color: var(--muted); cursor: default; }
.gpt-send:not(:disabled):active { transform: scale(.92); }
.gpt-disclaimer { margin: 8px 0 0; text-align: center; font-size: .74rem; color: var(--muted); }
html[data-theme="dark"] .gpt-composer { box-shadow: 0 4px 18px rgba(0, 0, 0, .35); }

@media (max-width: 760px) {
  .gpt { height: calc(100vh - 54px - var(--tabbar-h) - var(--sab) - 28px); min-height: 380px; }
  .gpt-hero h1 { font-size: 1.35rem; }
  .gpt-bubble { max-width: 86%; }
  .gpt-suggest { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 10px; padding: 0 16px; scroll-snap-type: x proximity; }
  .gpt-suggest::-webkit-scrollbar { display: none; }
  .gpt-suggest button { flex: 0 0 72%; scroll-snap-align: start; }
}

/* ---------- paywall & set-password screens ---------- */
.gate { max-width: 420px; margin: 0 auto; min-height: calc(100vh - 40px); display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 14px; padding: 32px 4px; text-align: center; }
.gate-logo { width: 72px; height: 72px; align-self: center; filter: drop-shadow(0 8px 20px rgba(226, 96, 27, .35)); }
.gate h1 { font-size: 1.6rem; line-height: 1.2; margin: 4px 0 0; }
.gate > p { margin: 0; color: var(--ink-2); line-height: 1.5; }
.gate-email { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .88rem; color: var(--muted) !important; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.gate-email .ico { width: 18px; height: 18px; flex: none; }
.gate .link-btn { align-self: center; }
.gate-help { font-size: .82rem; color: var(--muted) !important; }
.gate-form { display: grid; gap: 14px; text-align: left; margin-top: 6px; }
.auth-forgot { justify-self: end; margin: -6px 0 4px; font-size: .85rem; }
.auth-subscribe { display: block; text-align: center; margin: 16px 0 0; font-size: .9rem; color: var(--ink-2); text-decoration: none; }
.auth-subscribe strong { color: var(--primary); }
.auth-subscribe:hover strong { text-decoration: underline; }

/* ---------- sign-in: e-mail first ---------- */
.auth-title { font-size: 1.3rem; margin: 0 0 16px; letter-spacing: -.01em; }
#auth-form { display: grid; gap: 14px; }
.auth-form-alt { display: grid; gap: 14px; }
.auth-step-lead { margin: 0; color: var(--ink-2); line-height: 1.5; font-size: .95rem; }
.auth-email-chip { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: .92rem; cursor: pointer; text-align: left; }
.auth-email-chip .ico { width: 18px; height: 18px; color: var(--muted); flex: none; }
.auth-email-chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.auth-email-chip em { font-style: normal; font-size: .82rem; font-weight: 650; color: var(--primary); }
.auth-forgot { justify-self: end; margin: -8px 0 -4px; font-size: .85rem; }
.auth-resend { justify-self: center; font-size: .88rem; }
.auth-resend:disabled { opacity: .5; cursor: default; text-decoration: none; }
.code-input { letter-spacing: .4em; font-size: 1.35rem; text-align: center; font-weight: 700; }
.remember { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; color: var(--ink-2); user-select: none; }
.remember input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.remember-box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; background: var(--surface); transition: background .15s, border-color .15s; flex: none; }
.remember-box .ico { width: 14px; height: 14px; }
.remember input:checked + .remember-box { background: var(--primary); border-color: var(--primary); color: #fff; }
.remember input:focus-visible + .remember-box { box-shadow: var(--ring); }
#auth-error:not([hidden]), #auth-info:not([hidden]) { margin-top: 12px; }

/* =========================================================
   Visual refresh: colorful cards, progress ring, streak, trail, badges, clicker
   --pc = the program or feature color, set inline
   ========================================================= */
.ring { --size: 92px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--pc) calc(var(--p) * 1%), color-mix(in srgb, var(--pc) 18%, transparent) 0); }
.ring-inner { width: calc(var(--size) - 16px); height: calc(var(--size) - 16px); border-radius: 50%; background: var(--ring-bg, var(--surface)); display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ring-inner strong { font-size: 1.2rem; letter-spacing: -.02em; }
.ring-inner span { font-size: .68rem; color: var(--muted); max-width: 70px; }

/* streak chip in the home header */
.streak-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .95rem; flex: none; }
.streak-chip .ico { width: 20px; height: 20px; }
.streak-chip.on { background: color-mix(in srgb, #F2843F 18%, var(--surface)); color: #F2843F; }
.streak-chip strong { color: var(--ink); }

/* lesson of the day card */
.today-card { --ring-bg: color-mix(in srgb, var(--pc) 10%, #1B1714); position: relative; overflow: hidden; border-radius: 26px; padding: 20px 20px 18px; color: #F3EEE8;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--pc) 55%, #1B1714) 0%, #1B1714 62%); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 16px; }
.today-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.today-card .lesson-tag { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .12); }
.today-card .lesson-tag .ico { color: #fff; }
.today-day { font-size: .8rem; color: #D7CEC3; white-space: nowrap; }
.today-body { display: flex; align-items: center; gap: 16px; position: relative; }
.today-card .ring-inner strong { color: #fff; }
.today-card .ring-inner span { color: #CFC6BB; }
.today-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.today-text h2 { color: #fff; font-size: 1.4rem; letter-spacing: -.025em; margin: 2px 0 6px; text-wrap: balance; }
.today-card .lesson-label { color: color-mix(in srgb, var(--pc) 60%, #fff); }
.today-card .lesson-goal { color: #D7CEC3; margin: 0; font-size: .92rem; }
.today-art { position: absolute; right: -14px; top: -58px; width: 96px; height: 96px; opacity: .22; transform: rotate(-12deg); pointer-events: none; }
.week-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wk { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.wk i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 1.5px dashed rgba(255, 255, 255, .18); }
.wk i .ico { width: 15px; height: 15px; }
.wk.done i { background: var(--pc); border: 0; color: #fff; }
.wk.today i { border: 2px solid #fff; }
.wk.done.today i { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.wk.future i { opacity: .45; }
.wk small { font-size: .68rem; color: #B7AEA3; font-weight: 600; }
.wk.today small { color: #fff; }
.btn-block { width: 100%; justify-content: center; }

/* colorful feature tiles */
.tiles.tiles-2 { grid-template-columns: 1fr 1fr; margin: 16px 0; }
.tile.tile-color { background: color-mix(in srgb, var(--pc) 12%, var(--surface)); border-color: color-mix(in srgb, var(--pc) 22%, var(--line)); }
.tile.tile-color:hover { border-color: var(--pc); }
.tile.tile-color .tile-text span { color: color-mix(in srgb, var(--pc) 55%, var(--ink-2)); font-weight: 600; }
.tile.tile-color .tile-go { color: var(--pc); }
.vax-home { margin-top: 0; }

/* training: program hero */
.prog-hero { --ring-bg: color-mix(in srgb, var(--pc) 9%, var(--surface)); position: relative; overflow: hidden; border-radius: 26px; padding: 22px 20px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--pc) 22%, var(--surface)) 0%, var(--surface) 75%); border: 1px solid color-mix(in srgb, var(--pc) 28%, var(--line)); }
.prog-hero-top { display: flex; gap: 14px; align-items: center; position: relative; z-index: 1; }
.prog-hero .eyebrow { color: var(--pc); }
.prog-hero h2 { font-size: 1.45rem; letter-spacing: -.025em; margin: 2px 0 4px; text-wrap: balance; }
.prog-hero-sub { margin: 0; color: var(--ink-2); font-size: .9rem; }
.prog-hero-art { position: absolute; right: -18px; bottom: -22px; width: 120px; height: 120px; opacity: .14; transform: rotate(-10deg); pointer-events: none; }
.prog-hero .ring { --size: 86px; }
.trail { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; position: relative; z-index: 1; }
.trail::before { content: ""; position: absolute; left: 18px; right: 18px; top: 50%; height: 3px; transform: translateY(-50%); background: color-mix(in srgb, var(--pc) 25%, var(--line)); border-radius: 3px; }
.trail-dot { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--pc) 35%, var(--line)); background: var(--surface); color: var(--ink-2);
  font: inherit; font-weight: 700; font-size: .9rem; display: grid; place-items: center; cursor: pointer; padding: 0; transition: transform .15s; }
.trail-dot .ico { width: 17px; height: 17px; }
.trail-dot.done { background: var(--pc); border-color: var(--pc); color: #fff; }
.trail-dot.current { border-color: var(--pc); color: var(--pc); box-shadow: 0 0 0 5px color-mix(in srgb, var(--pc) 18%, transparent); }
.trail-dot.selected { transform: scale(1.15); background: var(--ink); border-color: var(--ink); color: var(--bg); }
.trail-dot.done.selected { background: var(--pc); border-color: var(--ink); color: #fff; }

/* lesson: numbered steps */
.lesson-detail { margin-top: 16px; }
.lesson-detail .eyebrow { color: var(--pc); }
.steps-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.steps-list li { position: relative; }
.steps-list input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.steps-list label { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--surface-2); cursor: pointer; line-height: 1.45; transition: background .15s; }
.step-num { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--pc) 16%, var(--surface)); color: var(--pc); font-weight: 800; }
.step-num .ico { display: none; width: 17px; height: 17px; }
.steps-list input:checked + label { background: color-mix(in srgb, var(--pc) 10%, var(--surface-2)); }
.steps-list input:checked + label .step-num { background: var(--pc); color: #fff; }
.steps-list input:checked + label .step-num b { display: none; }
.steps-list input:checked + label .step-num .ico { display: block; }
.steps-list input:checked + label > span:last-child { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.steps-list input:focus-visible + label { box-shadow: var(--ring); }
.lesson-video { width: 100%; border-radius: 16px; margin-top: 14px; background: #000; aspect-ratio: 16 / 9; }

/* clicker */
.clicker-box { display: flex; align-items: center; gap: 14px; margin: 14px 0 4px; padding: 14px; border-radius: 18px; border: 1px dashed color-mix(in srgb, var(--pc) 40%, var(--line)); }
.clicker-box p { margin: 2px 0 0; }
.clicker-btn { width: 60px; height: 60px; border-radius: 50%; border: 0; flex: none; background: var(--pc); color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--pc) 60%, #000), 0 8px 18px color-mix(in srgb, var(--pc) 35%, transparent); transition: transform .06s, box-shadow .06s; }
.clicker-btn .ico { width: 28px; height: 28px; }
.clicker-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--pc) 60%, #000); }
.clicker-btn.pulse { animation: click-pulse .35s ease-out; }
@keyframes click-pulse { 0% { box-shadow: 0 6px 0 color-mix(in srgb, var(--pc) 60%, #000), 0 0 0 0 color-mix(in srgb, var(--pc) 55%, transparent); } 100% { box-shadow: 0 6px 0 color-mix(in srgb, var(--pc) 60%, #000), 0 0 0 18px transparent; } }

/* badges */
.badges { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.badge-medal { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); border: 2px dashed var(--line-strong); }
.badge-medal .ico { width: 20px; height: 20px; }
.badge-medal img { width: 34px; height: 34px; }
.badge.got .badge-medal { background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--pc) 45%, #fff), var(--pc)); border: 3px solid #F2B33D; box-shadow: 0 4px 12px color-mix(in srgb, var(--pc) 35%, transparent); }
.badge small { font-size: .68rem; line-height: 1.2; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge.got small { color: var(--ink); font-weight: 600; }

/* colorful program library */
.program-card.prog-color { background: color-mix(in srgb, var(--pc) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pc) 22%, var(--line)); border-radius: 20px; }
.program-card.prog-color.is-active { border-color: var(--pc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 25%, transparent); }
.program-card.prog-color .prog-img { width: 46px; height: 46px; filter: none; }
.mini-bar { height: 5px; border-radius: 5px; background: color-mix(in srgb, var(--pc) 18%, var(--surface-2)); overflow: hidden; }
.mini-bar > div { height: 100%; background: var(--pc); border-radius: 5px; }
.program-card.prog-color .btn { border-color: color-mix(in srgb, var(--pc) 40%, var(--line)); color: var(--pc); }
html[data-theme="dark"] .tip p { color: #E8CF9A; }

@media (max-width: 640px) {
  .badges { grid-template-columns: repeat(3, 1fr); row-gap: 14px; }
  .library { grid-template-columns: 1fr 1fr; }
  .program-card.prog-color { padding: 14px; }
  .program-card.prog-color .muted.small { display: none; }
}
@media (prefers-reduced-motion: reduce) { .clicker-btn.pulse { animation: none; } .trail-dot { transition: none; } }

/* the program icons are tiles, not cut-out art: hide the decorative copies until real illustrations arrive */
/* (art shown again below) */

/* ---------- mascot illustrations ---------- */
.today-art, .prog-hero-art { display: block; }
.today-art img, .prog-hero-art img, .prog-art img, .badge-art img, .celebrate-art img { width: 100%; height: auto; display: block; user-select: none; }
.today-top { padding-right: 96px; }
.today-art { position: absolute; right: 6px; top: 4px; width: 112px; transform: none; opacity: 1; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); pointer-events: none; z-index: 2; }
.today-body { padding-right: 52px; }
.prog-hero-art { position: static; width: 118px; flex: none; opacity: 1; transform: none; filter: drop-shadow(0 8px 14px color-mix(in srgb, var(--pc) 30%, transparent)); margin: -10px -6px -10px 0; }
.prog-hero-pill { display: inline-flex; margin: 14px 0 0; padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, var(--surface)); position: relative; z-index: 1; }
.prog-art { width: 76px; display: block; margin: -4px 0 -2px -4px; }
.program-card.prog-color:not(.is-active) .prog-art { filter: saturate(.85); }
.badge-art { width: 50px; display: block; }
.badge.got .badge-medal { overflow: hidden; }

/* celebration overlay */
.celebrate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(12, 10, 9, .62); backdrop-filter: blur(4px); animation: cel-in .2s ease-out; }
.celebrate.out { animation: cel-out .2s ease-in forwards; }
.celebrate-card { position: relative; z-index: 1; width: min(340px, 100%); background: var(--surface); color: var(--ink); border-radius: 28px; padding: 18px 22px 22px; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); animation: cel-pop .35s cubic-bezier(.2, 1.4, .4, 1); }
.celebrate-art { width: 190px; margin: -70px auto 4px; display: block; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .3)); }
.celebrate-card h2 { font-size: 1.5rem; margin: 0 0 6px; letter-spacing: -.02em; }
.celebrate-card p { margin: 0 0 18px; color: var(--ink-2); line-height: 1.45; }
.celebrate-rain { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.celebrate-rain i { position: absolute; top: -40px; color: #F2843F; opacity: .9; animation: paw-fall 1.8s ease-in forwards; transform: rotate(var(--r)); }
.celebrate-rain i:nth-child(3n) { color: #F2B33D; }
.celebrate-rain i .ico { width: 26px; height: 26px; }
@keyframes paw-fall { to { transform: translateY(110vh) rotate(calc(var(--r) + 120deg)); opacity: 0; } }
@keyframes cel-in { from { opacity: 0; } }
@keyframes cel-out { to { opacity: 0; } }
@keyframes cel-pop { from { transform: scale(.85); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .celebrate, .celebrate-card { animation: none; } }

.today-top { padding-right: 0; }
.today-body { padding-right: 0; }
.today-art { right: 12px; top: 2px; width: 96px; }
.today-text .lesson-label { padding-right: 70px; }

/* =========================================================
   Quiz: one question per screen
   ========================================================= */
.quiz-one { max-width: 520px; margin: 0 auto; min-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.quiz-one .quiz-top { display: flex; align-items: center; gap: 12px; padding-top: 6px; }
.quiz-one .quiz-top .brand { flex: none; font-size: .95rem; }
.quiz-bar { flex: 1; height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.quiz-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #F07A3A, #E2601B); transition: width .35s ease; }
.quiz-one .quiz-body { flex: 1; display: flex; flex-direction: column; gap: 18px; padding-top: 18px; }
.quiz-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; animation: q-in .3s ease-out; }
.quiz-art { width: 150px; display: block; filter: drop-shadow(0 12px 16px rgba(31, 27, 22, .16)); }
.quiz-art img { width: 100%; height: auto; display: block; }
.quiz-q { font-size: 1.7rem; line-height: 1.2; letter-spacing: -.025em; margin: 4px 0 0; text-wrap: balance; }
.quiz-hint { margin: 0; color: var(--muted); font-size: .95rem; }
.quiz-fields { display: flex; flex-direction: column; gap: 14px; animation: q-in .3s ease-out .05s both; }
.quiz-one .quiz-footer { margin-top: auto; padding-bottom: 8px; }
.q-big-input { font-size: 1.25rem; padding: 14px 16px; border-radius: 16px; text-align: center; }
.weight-unit .q-big-input { text-align: left; }
.quiz-one .about-row { align-items: center; }
.seg.choice.big { display: grid; grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr; gap: 10px; background: none; border: 0; padding: 0; }
.seg.choice.big button { min-height: 62px; border-radius: 18px; font-size: 1.1rem; font-weight: 700; border: 2px solid var(--line); background: var(--surface); justify-content: center; }
.seg.choice.big button.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary-ink); box-shadow: none; }
.quiz-one .opt-list .opt { border-radius: 18px; padding: 16px; }
.quiz-one .age-row { justify-content: center; }
.quiz-one .breed-chips { justify-content: center; }
@keyframes q-in { from { opacity: 0; transform: translateY(8px); } }

/* building your plan */
.quiz-building { justify-content: center; }
.building { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px 8px; }
.building-art { width: 170px; display: block; animation: bob 1.4s ease-in-out infinite; }
.building-art img { width: 100%; height: auto; display: block; }
.building h1 { font-size: 1.6rem; letter-spacing: -.02em; margin: 0; }
.build-bar { width: 100%; max-width: 360px; height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.build-bar i { display: block; height: 100%; width: 0; border-radius: 10px; background: linear-gradient(90deg, #F2B33D, #E2601B); transition: width .55s ease; }
.build-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 10px; text-align: left; width: 100%; max-width: 360px; }
.build-list li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 600; transition: color .2s; }
.build-list li .ico { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: var(--surface-2); color: transparent; transition: background .2s, color .2s; box-sizing: border-box; }
.build-list li.done { color: var(--ink); }
.build-list li.done .ico { background: #1FA971; color: #fff; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* plan summary */
.quiz-summary { gap: 16px; padding-bottom: 16px; }
.summary-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 8px; }
.summary-art { width: 140px; display: block; }
.summary-art img { width: 100%; height: auto; display: block; }
.summary-head h1 { font-size: 1.8rem; letter-spacing: -.03em; margin: 2px 0 0; }
.summary-head .eyebrow { color: #1FA971; }
.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.summary-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.summary-stats strong { font-size: 1.5rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.summary-stats span { font-size: .75rem; color: var(--muted); line-height: 1.25; }
.summary-programs { display: grid; gap: 10px; }
.summary-prog { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; background: color-mix(in srgb, var(--pc) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pc) 25%, var(--line)); }
.summary-prog-art { width: 54px; flex: none; display: block; }
.summary-prog-art img { width: 100%; height: auto; display: block; }
.summary-prog strong { display: block; }
.summary-prog span { font-size: .82rem; color: var(--pc); font-weight: 700; }
.summary-first { border-radius: 20px; padding: 16px 18px; background: var(--surface); border: 1px dashed color-mix(in srgb, var(--pc) 45%, var(--line)); }
.summary-first .eyebrow { color: var(--pc); }
.summary-first h2 { font-size: 1.2rem; margin: 2px 0 4px; }
.summary-first p { margin: 0; }
.summary-home { align-self: center; }
@media (prefers-reduced-motion: reduce) { .quiz-card, .quiz-fields, .building-art { animation: none; } .quiz-bar i, .build-bar i { transition: none; } }

/* =========================================================
   Brand theme: orange header band with paw pattern, white floating cards,
   pill buttons and a floating tab bar (inspired by modern pet apps, in PetGold orange)
   ========================================================= */
:root {
  --band: linear-gradient(165deg, #F48A45 0%, #E2601B 55%, #D2551A 100%);
  --band-ink: #FFFFFF;
  --band-ink-2: rgba(255, 255, 255, .82);
  --band-h: 250px;
  --paws: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='%23ffffff' fill-opacity='.13'%3E%3Cg transform='translate(22 26) rotate(-18)'%3E%3Cellipse cx='12' cy='18' rx='8' ry='7'/%3E%3Ccircle cx='3' cy='8' r='3.4'/%3E%3Ccircle cx='9' cy='3' r='3.4'/%3E%3Ccircle cx='16' cy='3' r='3.4'/%3E%3Ccircle cx='22' cy='8' r='3.4'/%3E%3C/g%3E%3Cg transform='translate(90 82) rotate(22)'%3E%3Cellipse cx='12' cy='18' rx='8' ry='7'/%3E%3Ccircle cx='3' cy='8' r='3.4'/%3E%3Ccircle cx='9' cy='3' r='3.4'/%3E%3Ccircle cx='16' cy='3' r='3.4'/%3E%3Ccircle cx='22' cy='8' r='3.4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --card-shadow: 0 2px 4px rgba(150, 70, 20, .04), 0 10px 28px rgba(150, 70, 20, .09);
}
html[data-theme="dark"] {
  --band: linear-gradient(165deg, #6A3316 0%, #3A2010 55%, #1E1712 100%);
  --band-ink-2: rgba(255, 236, 222, .78);
  --card-shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 10px 28px rgba(0, 0, 0, .3);
}

/* the band sits behind the top of every app screen (not on login, quiz or the chat) */
body.has-tabs:not([data-route="ai"]) .container { position: relative; }
body.has-tabs:not([data-route="ai"]) .container::before {
  content: ""; position: absolute; z-index: -1; top: 0; left: 50%; width: 100vw; transform: translateX(-50%);
  height: var(--band-h); background: var(--paws), var(--band); background-size: 140px 140px, cover;
  border-radius: 0 0 34px 34px;
}
body.has-tabs:not([data-route="ai"]) #app { isolation: isolate; }
body.has-tabs:not([data-route="ai"]) .topbar { background: #E2601B; border-bottom: 0; }
html[data-theme="dark"] body.has-tabs:not([data-route="ai"]) .topbar { background: #6A3316; }
body.has-tabs:not([data-route="ai"]) .topbar .brand,
body.has-tabs:not([data-route="ai"]) .topbar .brand span { color: var(--band-ink); }
body.has-tabs:not([data-route="ai"]) .topbar .round-btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .22); color: #fff; }

/* text that lands on the band */
body.has-tabs .page-head h1, body.has-tabs .home-head h1 { color: var(--band-ink); }
body.has-tabs .page-head > p, body.has-tabs .home-head .muted, body.has-tabs .home-head .eyebrow { color: var(--band-ink-2); }
body[data-route="ai"] .page-head h1 { color: var(--ink); }
body.has-tabs .home-head .avatar { border: 3px solid rgba(255, 255, 255, .7); box-shadow: 0 6px 16px rgba(0, 0, 0, .15); }
body.has-tabs .streak-chip { background: rgba(255, 255, 255, .18); color: #fff; }
body.has-tabs .streak-chip.on { background: #fff; color: #E2601B; }
body.has-tabs .streak-chip strong { color: inherit; }
body.has-tabs .page-head .back-link { color: var(--band-ink); }

/* white floating cards */
.card, .tile.tile-color, .prog-hero, .program-card.prog-color, .summary-stats div, .summary-first {
  border-color: transparent; box-shadow: var(--card-shadow);
}
.card { border-radius: 24px; }
html:not([data-theme="dark"]) body { background: #FFF7F0; }

/* pill buttons */
.btn { border-radius: 999px; }
.btn-lg { min-height: 54px; }

/* floating tab bar on phones */
@media (max-width: 640px) {
  :root { --band-h: 230px; }
  .nav {
    left: 12px; right: 12px; bottom: calc(10px + var(--sab)); height: var(--tabbar-h); padding: 6px;
    border-radius: 26px; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(120, 60, 20, .18);
  }
  html[data-theme="dark"] .nav { background: rgba(30, 27, 24, .94); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
  .nav a { border-radius: 18px; }
  .nav a.active { background: var(--primary-soft); color: var(--primary); }
  html[data-theme="dark"] .nav a.active { background: #3A2417; color: #FF9A5C; }
  body.has-tabs .container { padding-bottom: calc(var(--tabbar-h) + var(--sab) + 40px); }
  .toast { bottom: calc(var(--tabbar-h) + var(--sab) + 26px); }
}
body.has-tabs:not([data-route="ai"]) .topbar img.brand-badge { background: #fff; border-radius: 50%; padding: 2px; box-sizing: border-box; }
@media (min-width: 641px) {
  body.has-tabs:not([data-route="ai"]) .topbar .nav a { color: rgba(255, 255, 255, .86); }
  body.has-tabs:not([data-route="ai"]) .topbar .nav a:hover { background: rgba(255, 255, 255, .14); }
  body.has-tabs:not([data-route="ai"]) .topbar .nav a.active { background: rgba(255, 255, 255, .22); color: #fff; }
}

/* =========================================================
   Health: summary tiles as tabs, one clean panel, forms in a sheet
   ========================================================= */
.h-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.h-sum { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 12px; border-radius: 20px; border: 2px solid transparent; background: var(--surface); box-shadow: var(--card-shadow); color: var(--ink); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.h-sum .ico { width: 22px; height: 22px; color: var(--pc); margin-bottom: 4px; }
.h-sum strong { font-size: 1.45rem; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.h-sum span { font-size: .8rem; color: var(--muted); }
.h-sum em { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--pc); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.h-sum em.bad { color: var(--red); }
.h-sum.on { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 8%, var(--surface)); }
.h-panel { padding: 18px; }
.h-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.h-panel-head h2 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; margin: 0; }
.h-panel-head h2 .ico { width: 22px; height: 22px; color: var(--primary); }
.h-list { list-style: none; margin: 0; padding: 0; }
.h-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.h-list li:first-child { border-top: 0; }
.h-list .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.h-list strong { font-size: .98rem; line-height: 1.3; }
.h-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.h-icons { display: flex; align-items: center; gap: 2px; }
.h-list.compact li { padding: 9px 0; }
.h-visit { align-items: flex-start !important; }
.h-weight-top { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 6px; }
.h-weight-top > div { display: flex; flex-direction: column; }
.h-weight-top strong { font-size: 2rem; letter-spacing: -.03em; line-height: 1.1; }
.h-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 8px 6px 6px; }
.h-empty-art { width: 128px; display: block; }
.h-empty-art img { width: 100%; height: auto; display: block; }
.h-empty p { margin: 0; color: var(--ink-2); line-height: 1.5; max-width: 34ch; }
.h-footnote { font-size: .78rem; color: var(--muted); text-align: center; margin: 14px 8px 0; line-height: 1.45; }

/* bottom sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 150; background: rgba(20, 16, 12, .45); display: flex; align-items: flex-end; justify-content: center; animation: cel-in .18s ease-out; }
.sheet-wrap.out { animation: cel-out .18s ease-in forwards; }
.sheet { width: min(560px, 100%); max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 28px 28px 0 0; padding: 10px 20px calc(22px + var(--sab)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); animation: sheet-up .26s cubic-bezier(.2, .9, .3, 1); }
.sheet-wrap.out .sheet { animation: sheet-down .18s ease-in forwards; }
.sheet-grab { width: 44px; height: 5px; border-radius: 5px; background: var(--line-strong); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head h2 { font-size: 1.25rem; margin: 0; }
.sheet-form { display: grid; gap: 14px; }
.sheet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sheet-more summary { cursor: pointer; font-weight: 650; color: var(--primary); font-size: .92rem; padding: 4px 0; }
.sheet-more[open] summary { margin-bottom: 10px; }
.sheet-more .field + .field { margin-top: 12px; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@media (min-width: 641px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 28px; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-wrap { animation: none; } }

/* ---------- Training, tidier: compact header, scrolling day trail, compact actions ---------- */
.prog-hero { padding: 20px 18px 16px; }
.prog-hero-art { width: 104px; }
.prog-hero-sub { font-size: .88rem; }
.prog-progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; position: relative; z-index: 1; }
.prog-progress .mini-bar { flex: 1; height: 7px; }
.prog-progress span { font-size: .8rem; font-weight: 700; color: var(--pc); white-space: nowrap; }
.prog-hero-pill { display: none; }
.trail-scroll { margin: 14px -18px 0; padding: 6px 18px 4px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; position: relative; z-index: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); }
.trail-scroll::-webkit-scrollbar { display: none; }
.trail { margin-top: 0; width: max-content; min-width: 100%; justify-content: flex-start; gap: 12px; }
.trail.fit { width: 100%; justify-content: space-between; gap: 0; }
.trail-dot { flex: none; }

.lesson-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.day-badge { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--pc); color: #fff; font-size: .8rem; font-weight: 800; letter-spacing: .02em; }
.lesson-detail h2 { margin: 0 0 4px; }
.lesson-goal-text { margin: 0; }
.steps-label { margin: 18px 0 0; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.steps-label span { color: var(--pc); font-variant-numeric: tabular-nums; }
.steps-list { margin: 10px 0 14px; }
.steps-list label { padding: 12px 14px; font-size: .95rem; }
.step-num { width: 28px; height: 28px; font-size: .85rem; }
.lesson-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.lesson-actions .grow { flex: 1; justify-content: center; }
.lesson-actions .clicker-btn { width: 56px; height: 56px; flex-direction: column; gap: 0; }
.lesson-actions .clicker-btn .ico { width: 24px; height: 24px; }
.lesson-actions .clicker-btn small { font-size: .55rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1; margin-top: 2px; }
.ask-link { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-weight: 650; font-size: .92rem; color: var(--primary); }
.ask-link .ico { width: 18px; height: 18px; }
.clicker-box { display: none; }

/* =========================================================
   App look (less "generated", more consumer app):
   rounded friendly type, no uppercase labels, flat colors instead of glows and gradients
   ========================================================= */
:root { --font-app: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
html, body, button, input, select, textarea { font-family: var(--font-app); }
h1, h2, h3, .brand, .quiz-q, .today-text h2, .prog-hero h2 { font-weight: 800; letter-spacing: -.01em; }
body { font-weight: 500; }

/* labels: normal case, friendly */
.eyebrow, .lesson-label, .steps-label, .today-card .lesson-label, .summary-head .eyebrow, .summary-first .eyebrow {
  text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 700;
}

/* flat buttons, no gradient glow */
.btn-primary, .btn-primary:hover { background: #E9692A; box-shadow: 0 4px 0 #C4521A; border: 0; }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #C4521A; }
.btn-primary:hover { background: #F07433; }
html[data-theme="dark"] .btn-primary, html[data-theme="dark"] .btn-primary:hover { box-shadow: 0 4px 0 #8E3A10; }

/* header band: flat brand orange with paws (no gradient) */
:root { --band: #EC6A27; }
html[data-theme="dark"] { --band: #4A2512; }
body.has-tabs:not([data-route="ai"]) .topbar { background: #EC6A27; }

/* lesson of the day: a solid card in the program color */
.today-card { background: var(--pc); box-shadow: 0 8px 20px color-mix(in srgb, var(--pc) 30%, transparent); --ring-bg: var(--pc); }
.today-card .lesson-tag { background: rgba(255, 255, 255, .2); border-color: transparent; }
.today-card .lesson-label { color: rgba(255, 255, 255, .85); }
.today-card .lesson-goal { color: rgba(255, 255, 255, .9); }
.today-card .ring { background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .28) 0); }
.today-card .ring-inner span { color: rgba(255, 255, 255, .85); }
.wk i { background: rgba(255, 255, 255, .2); border: 0; }
.wk.done i { background: #fff; color: var(--pc); }
.wk.today i { box-shadow: 0 0 0 2px #fff; }
.wk small, .wk.today small { color: rgba(255, 255, 255, .9); }
.today-card .btn-light { background: #fff; color: var(--pc); font-weight: 800; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.today-art { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18)); }

/* program card: flat soft tint */
.prog-hero { background: color-mix(in srgb, var(--pc) 12%, var(--surface)); border: 0; }
html[data-theme="dark"] .prog-hero { background: color-mix(in srgb, var(--pc) 18%, var(--surface)); }

/* no dashed outlines, softer shadows */
.summary-first { border: 0; }
.badge-medal { border-style: solid; border-width: 2px; border-color: var(--line); }
:root { --card-shadow: 0 1px 2px rgba(80, 40, 10, .05), 0 4px 14px rgba(80, 40, 10, .06); }
html[data-theme="dark"] { --card-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25); }

/* tiles: solid color icons, short text */
.tile.tile-color { background: var(--surface); }
.tile.tile-color .tile-text span { font-weight: 700; }

/* quiz buttons in the same flat style */
.quiz-bar i, .build-bar i { background: #EC6A27; }
.seg.choice.big button.on { background: color-mix(in srgb, #EC6A27 12%, var(--surface)); }

/* =========================================================
   Training "my plan": winding path of days, lesson on its own screen
   ========================================================= */
.plan-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 24px; background: color-mix(in srgb, var(--pc) 12%, var(--surface)); }
html[data-theme="dark"] .plan-head { background: color-mix(in srgb, var(--pc) 18%, var(--surface)); }
.plan-head .grow { min-width: 0; }
.plan-head h2 { margin: 2px 0 0; font-size: 1.25rem; }
.plan-head .eyebrow { color: var(--pc); margin: 0; }
.plan-head .prog-progress { margin-top: 10px; }
.plan-head-art { width: 76px; flex: none; }
.plan-head-art img { width: 100%; height: auto; display: block; }

.path-wrap { display: flex; justify-content: center; margin: 20px 0 6px; overflow: hidden; }
.path { position: relative; flex: none; }
.path-line { position: absolute; inset: 0; overflow: visible; }
.path-line path { fill: none; stroke-linecap: round; }
.path-rest { stroke: var(--line-strong); stroke-width: 7; stroke-dasharray: 2 14; }
.path-done { stroke: var(--pc); stroke-width: 9; }

.path-node { position: absolute; transform: translate(-50%, -50%); width: 62px; height: 62px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; font: inherit; font-weight: 800; font-size: 1.25rem; padding: 0; z-index: 2; transition: transform .12s; -webkit-tap-highlight-color: transparent; }
.path-node:active { transform: translate(-50%, -50%) scale(.94); }
.path-node .ico { width: 28px; height: 28px; }
.path-node.done { background: var(--pc); color: #fff; box-shadow: 0 5px 0 color-mix(in srgb, var(--pc) 70%, #000); }
.path-node.open { background: var(--surface); color: var(--pc); border: 3px solid var(--pc); box-shadow: 0 5px 0 color-mix(in srgb, var(--pc) 35%, transparent); }
.path-node.locked { background: var(--surface-2, #EFE9E2); color: var(--muted); box-shadow: 0 5px 0 var(--line-strong); }
html[data-theme="dark"] .path-node.locked { background: #2a2420; }
.path-node.locked .ico { width: 24px; height: 24px; opacity: .8; }
.path-node.current { width: 80px; height: 80px; font-size: 1.6rem; background: var(--pc); color: #fff; box-shadow: 0 6px 0 color-mix(in srgb, var(--pc) 70%, #000), 0 0 0 8px color-mix(in srgb, var(--pc) 22%, transparent); animation: path-pulse 2.2s ease-in-out infinite; }
@keyframes path-pulse { 50% { box-shadow: 0 6px 0 color-mix(in srgb, var(--pc) 70%, #000), 0 0 0 14px color-mix(in srgb, var(--pc) 10%, transparent); } }
.path-day { position: absolute; transform: translateX(-50%); font-size: .74rem; font-weight: 800; color: var(--muted); white-space: nowrap; z-index: 1; }
.path-day.done, .path-day.current { color: var(--pc); }
.path-bubble { position: absolute; transform: translateX(-50%); z-index: 3; background: var(--surface); color: var(--pc); font-weight: 800; font-size: .9rem; padding: 7px 14px; border-radius: 14px; border: 2px solid var(--line); white-space: nowrap; box-shadow: var(--card-shadow); animation: bubble-bob 1.8s ease-in-out infinite; pointer-events: none; }
.path-bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; background: var(--surface); border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translateX(-50%) rotate(45deg); }
@keyframes bubble-bob { 50% { transform: translate(-50%, -4px); } }
.path-mascot { position: absolute; width: 92px; z-index: 1; pointer-events: none; }
.path-mascot img { width: 100%; height: auto; display: block; }
.path-week { position: absolute; left: 0; right: 0; text-align: center; z-index: 1; }
.path-week { display: flex; align-items: center; gap: 10px; font-size: .78rem; font-weight: 800; color: var(--muted); }
.path-week::before, .path-week::after { content: ""; flex: 1; height: 2px; background: var(--line); border-radius: 2px; }
.path-goal { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 2; }
.path-goal-medal { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; background: var(--surface); border: 3px dashed var(--line-strong); color: var(--muted); }
.path-goal-medal .ico { width: 34px; height: 34px; }
.path-goal.got .path-goal-medal { border: 0; background: color-mix(in srgb, var(--pc) 14%, var(--surface)); }
.path-goal-medal img { width: 64px; height: auto; display: block; }
.path-goal small { font-weight: 800; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.path-goal.got small { color: var(--pc); }

/* lesson screen */
.lesson-back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 6px 2px; margin: 0 0 8px; font: inherit; font-weight: 800; color: var(--pc); cursor: pointer; }
.lesson-back .ico { width: 20px; height: 20px; }
.lesson-hero { display: flex; align-items: flex-end; gap: 10px; padding: 18px 18px 0; border-radius: 24px; background: var(--pc); color: #fff; overflow: hidden; margin-bottom: 14px; }
.lesson-hero .grow { min-width: 0; padding-bottom: 18px; }
.lesson-hero .day-badge { background: rgba(255, 255, 255, .22); }
.lesson-hero h1 { margin: 10px 0 6px; font-size: 1.5rem; line-height: 1.2; color: #fff; }
.lesson-hero p { margin: 0; color: rgba(255, 255, 255, .92); line-height: 1.45; font-size: .95rem; }
.lesson-hero-art { width: 104px; flex: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .18)); }
.lesson-hero-art img { width: 100%; height: auto; display: block; }
.lesson-screen .lesson-detail .steps-label { margin-top: 0; }
.lesson-done-pill { margin: 0 0 12px; }
@media (prefers-reduced-motion: reduce) { .path-node.current, .path-bubble { animation: none; } }
.lesson-back { color: #fff; }
.path-day { background: var(--bg); padding: 1px 8px; border-radius: 999px; }
.path-bubble.to-r { transform: none; animation-name: bubble-bob-r; }
.path-bubble.to-l { transform: translateX(-100%); animation-name: bubble-bob-l; }
.path-bubble.to-r::after { left: -8px; top: 50%; bottom: auto; transform: translateY(-50%) rotate(135deg); }
.path-bubble.to-l::after { left: auto; right: -8px; top: 50%; bottom: auto; transform: translateY(-50%) rotate(-45deg); }
@keyframes bubble-bob-r { 50% { transform: translateX(4px); } }
@keyframes bubble-bob-l { 50% { transform: translateX(calc(-100% - 4px)); } }

/* floating tab bar: solid bar + a fade below it, so page text never shows around or under it */
@media (max-width: 640px) {
  .nav { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
  html[data-theme="dark"] .nav { background: #1E1B18; }
  body.has-tabs::after {
    content: ""; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; pointer-events: none;
    height: calc(var(--tabbar-h) + var(--sab) + 34px);
    background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 42%);
  }
  body.has-tabs[data-route="ai"]::after { display: none; }
}

/* =========================================================
   Food: daily amount + meal-by-meal schedule, kcal stepper, meal buttons
   ========================================================= */
.food-top { display: flex; align-items: flex-start; gap: 12px; }
.food-top .grow { min-width: 0; }
.food-top .eyebrow { margin: 0; }
.food-kcal { margin: 0; color: var(--muted); font-weight: 600; }
.food-bowl { flex: none; width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, #E9692A 14%, var(--surface)); color: #E9692A; }
.food-bowl .ico { width: 34px; height: 34px; }
.meal-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.meal-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); font-weight: 700; }
.meal-list .grow { min-width: 0; }
.meal-list strong { font-size: 1rem; white-space: nowrap; color: var(--ink); }
.meal-dot { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #E9692A; color: #fff; font-size: .85rem; font-weight: 800; }
.treat-line { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.treat-line .ico { width: 18px; height: 18px; color: #E5A100; flex: none; }
.result-card .stats { display: none; }

.kcal-stepper { display: flex; align-items: stretch; gap: 8px; }
.kcal-stepper input { flex: 1; min-width: 0; text-align: center; font-size: 1.2rem; font-weight: 800; -moz-appearance: textfield; }
.kcal-stepper input::-webkit-outer-spin-button, .kcal-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-btn { flex: none; width: 52px; min-height: 50px; border-radius: 16px; border: 0; background: color-mix(in srgb, #E9692A 12%, var(--surface)); color: #E9692A; font: inherit; font-size: 1.5rem; font-weight: 800; cursor: pointer; line-height: 1; }
.step-btn:active { transform: scale(.95); }
.meals-seg button { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 4px; line-height: 1.1; }
.meals-seg button b { font-size: 1.15rem; }
.meals-seg button small { font-size: .7rem; font-weight: 700; color: var(--muted); }
.meals-seg button.on { background: #E9692A; color: #fff; }
.meals-seg button.on small { color: rgba(255, 255, 255, .85); }

/* food v2: who it's for, per-meal cups drawn, presets for kcal */
.food-basis { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.food-basis > span:first-child { font-size: .85rem; font-weight: 800; color: var(--ink); margin-right: 2px; }
.food-basis .food-chip { font-size: .78rem; padding: 4px 10px; }
.meal-hero { display: flex; align-items: center; gap: 14px; margin: 6px 0 12px; flex-wrap: wrap; }
.meal-hero .result-big { margin: 0; }
.cups-vis { display: flex; align-items: flex-end; gap: 4px; }
.cup-ico { width: 34px; height: 40px; display: block; }
.cup-fill { fill: #E9692A; }
.cup-line { fill: none; stroke: #C4521A; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
html[data-theme="dark"] .cup-line { stroke: #FF9A5C; }
.cup-more { font-weight: 800; color: #E9692A; align-self: center; }
.meal-times { display: flex; flex-wrap: wrap; gap: 8px; }
.meal-times span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--surface-2); font-weight: 700; font-size: .88rem; }
.meal-times .ico { width: 18px; height: 18px; color: #E5A100; }
.food-total { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, #E9692A 10%, var(--surface)); }
.food-total span { font-weight: 700; color: var(--ink-2); font-size: .9rem; }
.food-total strong { font-size: .95rem; text-align: right; }
.result-card .food-kcal + .meal-list, .result-card .meal-list { display: none; }

.kcal-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.kcal-presets button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font: inherit; cursor: pointer; color: var(--ink); }
.kcal-presets b { font-size: .8rem; font-weight: 800; white-space: nowrap; }
.kcal-presets small { font-size: .72rem; color: var(--muted); font-weight: 700; }
.kcal-presets button.on { border-color: #E9692A; background: color-mix(in srgb, #E9692A 10%, var(--surface)); color: #C4521A; }
html[data-theme="dark"] .kcal-presets button.on { color: #FF9A5C; }

/* no zoom: no double-tap zoom, no pinch (iOS ignores user-scalable, handled in app.js too) */
html, body { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, input, select, textarea, label { touch-action: manipulation; }
input, select, textarea { font-size: max(16px, 1em); }

/* week row: every day is a paw stamp; trained days are solid white with a colored paw */
.wk i { width: 32px; height: 32px; background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .5); }
.wk i .ico { width: 17px; height: 17px; }
.wk.done i { background: #fff; color: var(--pc); box-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.wk.done i .ico { width: 19px; height: 19px; }
.wk.today:not(.done) i { background: rgba(255, 255, 255, .24); color: #fff; box-shadow: 0 0 0 2px #fff; animation: wk-pulse 2s ease-in-out infinite; }
.wk.done.today i { box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(255, 255, 255, .3); }
.wk.future i { opacity: 1; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .3); }
.wk.today small { font-weight: 800; }
@keyframes wk-pulse { 50% { box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(255, 255, 255, .22); } }
@media (prefers-reduced-motion: reduce) { .wk.today i { animation: none; } }
.today-card .wk small { color: rgba(255, 255, 255, .92) !important; }

/* ---------- app-style date picker ---------- */
.date-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 11px 14px; font: inherit; font-size: max(16px, 1rem); font-weight: 700; color: var(--ink); text-align: left; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.date-btn .ico { color: var(--primary); width: 20px; height: 20px; }
.date-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.date-btn.empty { font-weight: 600; color: #B3ACA3; }
.date-btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.cal-wrap { position: fixed; inset: 0; z-index: 200; background: rgba(20, 16, 12, .45); display: grid; place-items: center; padding: 20px; animation: cel-in .18s ease-out; }
.cal-wrap.out { animation: cel-out .18s ease-in forwards; }
.cal { width: min(340px, 100%); background: var(--surface); border-radius: 24px; padding: 16px 14px 14px; box-shadow: 0 20px 50px rgba(31, 27, 22, .25); animation: cal-pop .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes cal-pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head strong { font-size: 18px; font-weight: 800; color: var(--ink); }
.cal-nav { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; cursor: pointer; }
.cal-nav .ico { width: 18px; height: 18px; }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-week span { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; padding: 4px 0 6px; }
.cal-day { aspect-ratio: 1; border: 0; border-radius: 50%; background: none; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink); cursor: pointer; display: grid; place-items: center; transition: background .12s, transform .12s; }
.cal-day:hover:not(:disabled) { background: var(--surface-2); }
.cal-day:active:not(:disabled) { transform: scale(.9); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--primary); color: var(--primary); }
.cal-day.sel { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(226, 96, 27, .35); }
.cal-day:disabled { color: #CFC8BF; cursor: default; }
.cal-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cal-foot button { flex: 1; min-height: 44px; border-radius: 999px; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }
.cal-clear { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); }
.cal-today { border: 0; background: var(--primary); color: #fff; }
.sheet-row > .field { min-width: 0; }
.date-btn { min-width: 0; gap: 8px; padding: 11px 12px; }
.date-btn span { min-width: 0; }

/* ---------- Paw AI: locked in place, only the conversation scrolls ---------- */
html:has(body[data-route="ai"]), body[data-route="ai"] { overflow: hidden; overscroll-behavior: none; height: 100%; }
@media (max-width: 640px) {
  body[data-route="ai"] .container { padding: 0; }
  body[data-route="ai"] .gpt {
    position: fixed; left: 0; right: 0; z-index: 10;
    top: calc(54px + env(safe-area-inset-top, 0px));
    bottom: calc(var(--tabbar-h) + var(--sab) + 18px);
    height: auto; min-height: 0; padding: 8px 16px 0; background: var(--bg);
  }
  body[data-route="ai"] .gpt-log { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  body[data-route="ai"] .gpt-suggest { margin-left: -16px; margin-right: -16px; }
}

/* ---------- Paw AI: photos ---------- */
.gpt-attach { width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; cursor: pointer; margin-left: -11px; transition: transform .1s; }
.gpt-attach .ico { width: 20px; height: 20px; }
.gpt-attach:active { transform: scale(.92); }
.gpt-attach:disabled { opacity: .45; cursor: default; }
.gpt-preview { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.gpt-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; flex: none; }
.gpt-preview span { flex: 1; font-size: .86rem; color: var(--ink-2); font-weight: 600; }
.gpt-preview button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; flex: none; }
.gpt-preview button .ico { width: 16px; height: 16px; }
.gpt-msg.user { flex-direction: column; align-items: flex-end; gap: 6px; }
.gpt-photo { display: block; max-width: 62%; max-height: 260px; border-radius: 18px; object-fit: cover; box-shadow: var(--shadow-sm); }

/* renewal reminder at the top of the app (paid period ending soon) */
.renew-banner { display: flex; gap: 10px; align-items: center; background: #FFF1E6; color: #8A3A0E; border: 1px solid #F6C9A6; border-radius: var(--r); padding: 12px 14px; margin-bottom: 16px; font-size: .92rem; font-weight: 600; line-height: 1.4; text-decoration: none; }
.renew-banner .ico { color: #E2601B; flex: none; width: 20px; height: 20px; }
.renew-banner span { flex: 1; }
.renew-banner strong { flex: none; background: #E2601B; color: #fff; border-radius: 999px; padding: 7px 14px; font-size: .88rem; }
.renew-banner.ended { background: #FDECEC; color: #8E1F1F; border-color: #F3B9B9; }
.renew-banner.ended .ico { color: #C93636; }
.renew-banner.ended strong { background: #C93636; }
html[data-theme="dark"] .renew-banner { background: #3A2416; color: #FFD3B3; border-color: #6B3A1C; }
html[data-theme="dark"] .renew-banner.ended { background: #3A1A1A; color: #FFC4C4; border-color: #6B2525; }
