/* Fitalthy — mobile-first styles */
:root {
  --paper: #F4F7F5;
  --card: #FFFFFF;
  --ink: #17231D;
  --ink-soft: #4A5A52;
  --ink-faint: #7C8B83;
  --rule: #DCE4DE;
  --green: #0E6A4C;
  --green-soft: #E2F0E9;
  --warn: #9A5B0B;
  --warn-soft: #F7EAD4;
  --red: #A33325;
  --red-soft: #F6DFDA;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--green); }
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px 64px; }

/* nav */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 20px; color: var(--green); text-decoration: none; letter-spacing: -.02em; }
.nav-links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.nav-links a { text-decoration: none; color: var(--ink-soft); font-size: 14.5px; }
.nav-links a.on { color: var(--green); font-weight: 600; }
.nav-links a.btn { color: #fff; }

/* banner */
.banner {
  background: var(--green-soft); color: var(--ink);
  padding: 10px 16px; font-size: 14.5px; text-align: center;
  border-bottom: 1px solid var(--rule);
}
.banner.warn { background: var(--warn-soft); }
.banner a { font-weight: 600; }

/* cards & type */
h1 { font-size: 26px; letter-spacing: -.02em; line-height: 1.15; margin: 8px 0 12px; }
h2 { font-size: 19px; margin: 26px 0 10px; }
.card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 16px; margin: 12px 0;
}
.muted { color: var(--ink-faint); font-size: 14px; }
.small { font-size: 14px; }

/* buttons & forms */
.btn {
  display: inline-block; background: var(--green); color: #fff; border: 0;
  padding: 12px 20px; border-radius: 8px; font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
form.stack { display: grid; gap: 12px; }
label { font-size: 14px; font-weight: 600; color: var(--ink-soft); display: block; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; font-size: 16px; border: 1px solid var(--rule);
  border-radius: 8px; background: #fff; color: var(--ink);
}
.err { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: 8px; font-size: 14.5px; }

/* chips */
.chip {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; background: var(--rule); color: var(--ink-soft);
}
.chip.high { background: var(--red-soft); color: var(--red); }
.chip.low { background: var(--warn-soft); color: var(--warn); }
.chip.ok { background: var(--green-soft); color: var(--green); }

/* lists */
.list { display: grid; gap: 10px; margin: 12px 0; padding: 0; list-style: none; }
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 13px 15px; text-decoration: none; color: var(--ink);
}
.row:active { background: var(--green-soft); }
.row .sub { color: var(--ink-faint); font-size: 13.5px; }

/* tables */
table.vals { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.vals th { text-align: left; color: var(--ink-faint); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 8px 6px 0; border-bottom: 1px solid var(--rule); }
table.vals td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.vals tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; }

/* sparkline */
.spark { width: 100%; max-width: 240px; height: 48px; color: var(--green); display: block; }
.trend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.drift { font-size: 13.5px; font-weight: 700; color: var(--warn); }

/* record view */
.orig { width: 100%; border-radius: var(--radius); border: 1px solid var(--rule); }
.urgent {
  background: var(--red-soft); border: 1px solid var(--red); color: var(--red);
  border-radius: var(--radius); padding: 14px 16px; font-weight: 600; margin: 12px 0;
}
.explain { white-space: pre-wrap; }
.disclaim { font-size: 13px; color: var(--ink-faint); border-top: 1px solid var(--rule); margin-top: 14px; padding-top: 10px; }

/* plans */
.plans { display: grid; gap: 12px; margin: 16px 0 6px; }
@media (min-width: 640px) { .plans { grid-template-columns: 1fr 1fr 1fr; } }
.plan h3 { margin: 6px 0 4px; }
.plan-price { margin: 0 0 6px; }
.plan-price .price { font-size: 32px; }
.plan.featured { border: 2px solid var(--green); }

/* landing */
.hero { text-align: center; padding: 36px 0 8px; }
.hero h1 { font-size: 34px; }
.hero p.lede { font-size: 18px; color: var(--ink-soft); max-width: 34em; margin: 0 auto 20px; }
.price { font-size: 44px; font-weight: 800; color: var(--green); letter-spacing: -.03em; }
.steps3 { display: grid; gap: 12px; margin: 20px 0; }
@media (min-width: 640px) { .steps3 { grid-template-columns: 1fr 1fr 1fr; } }

/* footer */
.foot { max-width: 720px; margin: 0 auto; padding: 18px 16px 40px; color: var(--ink-faint); font-size: 12.5px; border-top: 1px solid var(--rule); }

/* print (export page) */
@media print {
  .nav, .foot, .banner, .noprint { display: none !important; }
  body { background: #fff; }
  .card { border: 1px solid #999; break-inside: avoid; }
}

/* ---- environment band -----------------------------------------------------
   Shown on every page of a non-production environment. High contrast on
   purpose: it is a warning, not decoration, and it must survive a glance. */
.env-band {
  padding: .5rem 1rem;
  text-align: center;
  font-size: .85rem;
  letter-spacing: .02em;
  color: #1c1400;
  background: #ffd24a;
  border-bottom: 2px solid #b98a00;
}
.env-band strong { letter-spacing: .08em; }
.env-band.env-dev { background: #cfe4ff; border-bottom-color: #2b6cb0; color: #10243c; }
.env-band.env-test { background: #ffd24a; border-bottom-color: #b98a00; }

/* ---- tap targets ----------------------------------------------------------
   Every interactive control clears 44x44 CSS px. This is not cosmetic: most of
   this product is used one-handed on a phone, often by someone older, often
   while worried. A 32px link is a link that gets missed. */
a.btn, button, .btn, input[type="submit"], [role="button"] {
  min-height: 44px;
  min-width: 44px;
}
.nav-links a, .foot a, a.small, .small a {
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
}
/* Inline links inside a paragraph keep the text flow — enlarging those would
   break sentences. They get a padded hit area instead. */
p a, li a { padding: 2px 0; }

/* ---- destructive actions --------------------------------------------------
   Deleting a household is irreversible; it must not look like every other
   button on the page. */
.btn.danger {
  background: #a4232b;
  border-color: #a4232b;
  color: #fff;
}
.btn.danger:hover { background: #8b1d24; }

/* The pricing section's heading. It exists so the document outline goes
   h1 → h2 → h3 rather than h1 → h3: a screen-reader user navigating by heading
   should not find three plan names dangling under nothing. Visible, because a
   heading hidden from sight but present for assistive tech is a mismatch
   between what two users are told. */
.section-heading {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: #5b6b66;
  margin: 28px 0 4px;
}

/* An honest notice, not an error and not a success. Used where the app is
   doing something real but not what the label implies — demo billing above all. */
.notice {
  background: #fff8e1;
  border: 1px solid #e6c65c;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: .92rem;
  line-height: 1.55;
}

/* ==========================================================================
   App redesign, 10 Oct 2026 — same identity as the public site (bottle green,
   marigold), a phone-first shell with a bottom tab bar, a back control on
   every screen, and large tap targets. Appended so every earlier rule still
   applies and these win where they overlap.
   ========================================================================== */
:root {
  --paper: #FCF8F0; --card: #FFFFFF; --ink: #1A1A18; --ink-soft: #4E4B45; --ink-faint: #847F74;
  --rule: rgba(26,26,24,.13); --green: #0B4F3A; --green-2: #0E6449; --green-deep: #062E22;
  --green-soft: #E6F1EC; --marigold: #F5A623; --radius: 16px;
}
body { font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16.5px; }
h1, h2, h3 { font-family: "Bricolage Grotesque", "Noto Sans", system-ui, sans-serif; font-weight: 800; letter-spacing: -.015em; }
h1 { font-size: clamp(26px, 5vw, 34px); }
.wrap { max-width: 760px; padding-bottom: 110px; }

/* top bar */
.nav { background: var(--green-deep); border-bottom: 0; padding: 11px 16px; gap: 14px; }
.brand { color: #F1ECDE; display: flex; align-items: center; gap: 9px; font-family: "Bricolage Grotesque", sans-serif; }
.brand::before { content: ""; width: 26px; height: 26px; border-radius: 7px; background: url("/public/icons/logo.svg") center/cover; }
.nav-links { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 16px; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: #D9D2C0; white-space: nowrap; }
.nav-links a.on, .nav-links a:hover { color: #fff; }
.nav-links a.btn { background: var(--marigold); color: #241A05; }

/* back control */
.back { display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 6px; padding: 8px 14px 8px 10px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.back:hover { background: var(--green-soft); }

/* cards, buttons, forms */
.card { border-radius: var(--radius); padding: 18px; box-shadow: 0 2px 0 rgba(11,79,58,.05), 0 14px 30px -26px rgba(11,79,58,.45); }
.btn { border-radius: 999px; min-height: 46px; padding: 11px 22px; font-weight: 700; background: var(--green); }
.btn:hover { background: var(--green-2); }
.btn.small { min-height: 38px; padding: 7px 16px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--rule); }
.btn.ghost:hover { background: var(--green-soft); }
input, select, textarea { border-radius: 12px; min-height: 46px; font-size: 16px; }
.chip { border-radius: 999px; }
details > summary { cursor: pointer; padding: 6px 0; }

/* home: the two things people come to do */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 6px; }
@media (max-width: 520px) { .actions { grid-template-columns: 1fr; } }
.action { display: flex; flex-direction: column; gap: 6px; padding: 20px 18px; border-radius: 20px; text-decoration: none; color: #F3EEE1; min-height: 132px;
  box-shadow: 0 16px 30px -22px rgba(11,79,58,.7); }
.action strong { font-family: "Bricolage Grotesque", sans-serif; font-size: 21px; line-height: 1.15; color: #fff; }
.action span { font-size: 14.5px; opacity: .92; }
.action .go { margin-top: auto; font-weight: 700; }
.action.a { background: linear-gradient(160deg, #0E6449, #0B4F3A); }
.action.b { background: linear-gradient(160deg, #1B5FA8, #164B85); color: #EFF3F9; }

/* doctor cards and one-tap time buttons */
.doc-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.doc-price { text-align: end; white-space: nowrap; }
.slots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn.slot { background: var(--green-soft); color: var(--green); border: 1.5px solid transparent; min-height: 44px; padding: 9px 16px; font-size: 15px; }
.btn.slot:hover { background: var(--green); color: #fff; }

/* bottom tab bar (phones) */
.tabbar { display: none; }
@media (max-width: 720px) {
  .nav-links.app-links { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    background: #fff; border-top: 1px solid var(--rule); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--ink-faint);
    font-size: 11.5px; font-weight: 600; padding: 4px 2px; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.on { color: var(--green); }
  .tabbar a.main { color: #241A05; }
  .tabbar a.main svg { background: var(--marigold); border-radius: 50%; padding: 9px; width: 46px; height: 46px; margin-top: -20px;
    box-shadow: 0 8px 18px -8px rgba(201,127,28,.9); }
  #install-bar { bottom: 78px !important; }
}
.foot { padding-bottom: 96px; }
input[type=radio], input[type=checkbox] { min-height: 0; width: 20px; height: 20px; border-radius: 50%; accent-color: var(--green); vertical-align: middle; margin-inline-end: 8px; }
input[type=checkbox] { border-radius: 5px; }
input[type=file] { min-height: 0; }

/* ---- Document reading progress (record page) ---- */
.reading { border: 0; border-top: 4px solid var(--green, #0B4F3A); overflow: hidden; }
.reading-head { display: flex; align-items: center; gap: 14px; }
.reading-title { flex: 1; min-width: 0; }
.reading-title h2 { margin: 0 0 2px; }
.reading-title p { margin: 0; color: var(--green, #0B4F3A); font-weight: 600; min-height: 1.5em; }
.reading-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; color: var(--green, #0B4F3A);
  background: var(--green-soft, #E6F1EC); border-radius: 999px; padding: 6px 12px; }
.reading-doc { position: relative; flex: 0 0 auto; width: 46px; height: 58px; border-radius: 8px; background: #fff;
  border: 2px solid var(--green, #0B4F3A); padding: 9px 7px; display: grid; gap: 5px; align-content: start; overflow: hidden; box-sizing: border-box; }
.reading-doc i { display: block; height: 4px; border-radius: 2px; background: #CFE3DA; }
.reading-doc i:nth-child(2) { width: 70%; }
.reading-doc i:nth-child(4) { width: 55%; }
.reading-doc b { position: absolute; left: 0; right: 0; top: 0; height: 12px;
  background: linear-gradient(180deg, rgba(245,166,35,0), rgba(245,166,35,.75)); border-bottom: 2px solid var(--marigold, #F5A623);
  animation: reading-scan 1.9s ease-in-out infinite; }
@keyframes reading-scan { 0% { transform: translateY(-14px); } 100% { transform: translateY(58px); } }
.reading-bar { height: 6px; border-radius: 999px; background: var(--green-soft, #E6F1EC); margin: 16px 0 6px; overflow: hidden; }
.reading-bar span { display: block; height: 100%; border-radius: 999px; background: var(--green, #0B4F3A);
  transition: width .6s ease; position: relative; overflow: hidden; }
.reading-bar span::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: reading-shine 1.4s linear infinite; }
@keyframes reading-shine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.reading-steps { list-style: none; margin: 14px 0 6px; padding: 0; }
.reading-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; position: relative; }
.reading-steps li + li::before { content: ""; position: absolute; left: 11px; top: -8px; height: 16px; width: 2px; background: #DAD6CB; }
.reading-steps li.done + li::before { background: var(--green, #0B4F3A); }
.reading-steps .mark { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #CFCBC0; background: #fff;
  box-sizing: border-box; position: relative; z-index: 1; }
.reading-steps .what { display: grid; }
.reading-steps .note { font-size: 13.5px; color: #77736A; }
.reading-steps li.todo strong { color: #9A968C; font-weight: 600; }
.reading-steps li.todo .note, .reading-steps li.done .note { display: none; }
.reading-steps li.done .mark { background: var(--green, #0B4F3A); border-color: var(--green, #0B4F3A); }
.reading-steps li.done .mark::after { content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.reading-steps li.active .mark { border-color: var(--marigold, #F5A623); border-top-color: transparent; animation: reading-spin .9s linear infinite; }
@keyframes reading-spin { to { transform: rotate(360deg); } }
.reading-foot { font-size: 14px; color: #5E5A52; margin: 10px 0 4px; }
.reading-slow summary { font-size: 14px; color: #77736A; }
.reading-slow form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.reading.finished .reading-doc b, .reading.finished .reading-bar span::after { animation: none; opacity: 0; }
@media (max-width: 480px) {
  .reading-head { gap: 10px; }
  .reading-doc { width: 38px; height: 50px; }
  .reading-time { font-size: 13px; padding: 5px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .reading-doc b, .reading-bar span::after, .reading-steps li.active .mark { animation: none; }
  .reading-steps li.active .mark { border-top-color: var(--marigold, #F5A623); background: var(--marigold, #F5A623); }
}


/* ---- Signed-in home, 17 Oct 2026: reports first, family as people, nothing twice ---- */
.home2026 .hello { margin: 4px 0 0; color: var(--green-2, #0E6449); font-weight: 700; font-size: 15px; }
.home2026 h1 { margin-top: 2px; }
.home2026 .sec { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 10px; }
.home2026 .sec h2 { margin: 0; font-size: 19px; }
.home2026 .welcome { display: grid; gap: 4px; background: #fff; border: 1px dashed var(--green-2, #0E6449); border-radius: 16px; padding: 16px 18px; margin-top: 16px; }
.home2026 .welcome span { color: #5E5A52; font-size: 14.5px; }
.home2026 .reports { display: grid; gap: 10px; }
.home2026 .report { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; background: #fff;
  border: 1px solid rgba(26,26,24,.10); border-radius: 16px; padding: 12px 14px; text-decoration: none; color: inherit;
  transition: transform .12s ease, box-shadow .12s ease; }
.home2026 .report:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -20px rgba(6,46,34,.55); }
.home2026 .doc-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--green-soft, #E6F1EC); color: var(--green, #0B4F3A); }
.home2026 .doc-ic svg { width: 22px; height: 22px; }
.home2026 .what { display: grid; min-width: 0; }
.home2026 .what strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home2026 .what span, .home2026 .who span { font-size: 13.5px; color: #77736A; }
.home2026 .chip { font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.home2026 .chip.done { background: var(--green-soft, #E6F1EC); color: var(--green, #0B4F3A); }
.home2026 .chip.reading { background: #FFF3DC; color: #8A5A0B; }
.home2026 .chip.failed { background: #F6DFDA; color: #A33325; }
.home2026 .chip.urgent { background: #F6DFDA; color: #A33325; }
.home2026 .people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.home2026 .person { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid rgba(26,26,24,.10);
  border-radius: 16px; padding: 12px 14px; text-decoration: none; color: inherit; }
.home2026 a.person:hover { border-color: var(--green, #0B4F3A); }
.home2026 .av { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: #EDE7DA; color: #3E3A33; font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.home2026 .av.me { background: var(--green, #0B4F3A); color: #fff; }
.home2026 .av.plus { background: transparent; border: 2px dashed #B9B3A6; color: #77736A; font-size: 22px; }
.home2026 .who { display: grid; min-width: 0; }
.home2026 details.person { display: block; padding: 0; }
.home2026 details.person > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.home2026 details.person > summary::-webkit-details-marker { display: none; }
.home2026 details.person[open] { grid-column: 1 / -1; border-color: var(--green, #0B4F3A); }
.home2026 .add-form { display: grid; grid-template-columns: 2fr 1.4fr 1fr auto; gap: 8px; align-items: end; padding: 0 14px 14px; }
.home2026 .add-form label { display: grid; gap: 4px; font-size: 13px; color: #5E5A52; }
@media (max-width: 640px) {
  .home2026 .add-form { grid-template-columns: 1fr 1fr; }
  .home2026 .add-form label:first-of-type { grid-column: 1 / -1; }
  .home2026 .report { grid-template-columns: 40px 1fr; }
  .home2026 .report .chip { grid-column: 2; justify-self: start; }
}
