/* Guitar — design system copied from the Exercise Library (shared/app.css, 2026-09-25 tokens).
   Standalone app: same ground, cards, type and components; accent is the guitar green. */
@font-face { font-family: "Archivo"; src: url("fonts/archivo-latin.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
/* Health system main pages (Today, Library, Fuel). Program pages keep ../shared/styles.css.
   Tokens and components from the ratified Option 1 design (2026-09-25). Fonts are declared
   by shared/shell.js from shared/fonts/, so they work offline. */
:root {
  color-scheme: light;
  --bg: #F3F1EC;
  --card: #FFFFFF;
  --line: #E4E0D6;
  --ink: #16171B;
  --muted: #5C5F66;
  --track: #EAE6DC;
  --olive: #2F6B4F;
  --olive-soft: #E6F0EA;
  --P: #24507A;
  --F: #C27C0E;
  --C: #93B03A;
  --P-ink: #24507A;
  --F-ink: #8A5A08;
  --C-ink: #5E7A12;
  --amber-ink: #7A4E05;
  --amber-soft: #F6EAD0;
  --danger: #B3261E;
  --disp: "Archivo", "Figtree", -apple-system, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Figtree", -apple-system, system-ui, sans-serif; font-size: 15px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; padding-top: env(safe-area-inset-top);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.disp { font-family: var(--disp); font-stretch: 80%; font-weight: 800; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.eyebrow .lower { font-weight: 500; letter-spacing: 0; text-transform: none; }
.olive { color: var(--olive); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 4px 4px 0; }
.page-head h1 { margin: 2px 0 0; font-family: var(--disp); font-stretch: 80%; font-weight: 800; font-size: 38px; line-height: 1.02; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 4px 0; min-height: 36px; }
.link { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; font-size: 13px; font-weight: 700; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.pad { padding: 16px 18px; }
.list > * + * { border-top: 1px solid var(--line); }
.hint { font-size: 12px; line-height: 1.45; color: var(--muted); }
.empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #FFFFFF; border-color: transparent; }
.btn-olive { background: var(--olive); color: #FFFFFF; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; min-height: 52px; font-size: 16px; border-radius: 14px; }
.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}

.mono {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 11px; color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-stretch: 75%; font-weight: 800; font-size: 13px; letter-spacing: 0.02em;
}
.mono.ghost { background: transparent !important; border: 2px dashed currentColor; }
.mono.sm { width: 36px; height: 36px; border-radius: 10px; font-size: 12px; }

.utabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.utabs::-webkit-scrollbar { display: none; }
.utabs > * {
  min-height: 44px; padding: 0 10px; border: 0; border-bottom: 2.5px solid transparent; margin-bottom: -1px; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center;
}
.utabs > .on { border-bottom-color: var(--ink); color: var(--ink); font-weight: 700; }
.utabs.olive > .on { border-bottom-color: var(--olive); }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--track); }
.seg button { flex: 1 1 0; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--ink); color: #FFFFFF; font-weight: 700; }
.seg.olive button.on { background: var(--olive); }

.bar { height: 7px; border-radius: 4px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; }

/* bottom sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(22, 23, 27, 0.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  background: var(--bg); border-radius: 26px 26px 0 0; padding: 10px 16px calc(26px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
}
.sheet > * { flex-shrink: 0; }   /* a tall sheet scrolls; it must never squash its search box or tabs */
.grabber { width: 38px; height: 5px; border-radius: 3px; background: #CFC9BC; align-self: center; flex-shrink: 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 2px; }
.sheet-head h2 { margin: 0; font-family: var(--disp); font-stretch: 80%; font-weight: 800; font-size: 27px; line-height: 1.05; }
.x-btn { width: 44px; height: 44px; flex-shrink: 0; border-radius: 22px; border: 1px solid var(--line); background: var(--card); font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }

/* form fields (16px text keeps iOS from zooming) */
.field { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 0 12px; font-size: 16px; }
select.field { padding-right: 8px; }
.lab { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 5px 2px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }

/* SetLog sync panel (its markup uses these) */
.ex-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ex-actions .btn { flex: 1 1 auto; }
code { font-family: ui-monospace, Menlo, monospace; }
.sync-card h3 { margin: 0 0 6px; font-size: 15px; }
.sync-card p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ---- Guitar additions (same vocabulary as the library's main pages; kickers, rules and type, no pills) ---- */
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: flex; justify-content: center;
  background: rgba(255, 255, 255, 0.94); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line); padding: 0 6px env(safe-area-inset-bottom); }
.tabbar-in { display: flex; width: 100%; max-width: 560px; }
.tab { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 56px; padding-top: 7px; box-sizing: border-box;
  color: var(--muted); background: transparent; border: 0; font-size: 11px; font-weight: 600; cursor: pointer; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 800; }
.tab .ico { height: 28px; display: flex; align-items: center; justify-content: center; }

.trigger { font-size: 13px; color: var(--muted); margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.card.current { border-color: var(--olive); }
.title-md { font-family: var(--disp); font-stretch: 80%; font-weight: 800; font-size: 21px; line-height: 1.08; }
.title-lg { font-family: var(--disp); font-stretch: 80%; font-weight: 800; font-size: 27px; line-height: 1.04; }
.title-xl { font-family: var(--disp); font-stretch: 80%; font-weight: 800; font-size: 44px; line-height: 1; }
.title-xl span { font-family: "Figtree", -apple-system, system-ui, sans-serif; font-size: 15px; font-weight: 600; color: var(--muted); }
.meta { font-size: 13px; line-height: 1.5; color: var(--muted); margin-top: 2px; }
.meta b { color: var(--ink); font-weight: 700; }
.body, .item .body p { margin: 0; font-size: 15px; line-height: 1.5; }
.step-name { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--olive); }
.aside { margin: -2px 6px 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.textlink { border: 0; background: transparent; padding: 4px 0; font-size: 13px; font-weight: 700; color: var(--olive); cursor: pointer; }
.btn[disabled] { opacity: 0.4; cursor: default; }

/* five-step bar */
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.steps i { height: 6px; border-radius: 3px; background: var(--track); }
.steps i.on { background: var(--olive); }
.steps i.now { background: var(--olive-soft); box-shadow: inset 0 0 0 1.5px var(--olive); }
.item .t .steps { margin-top: 8px; max-width: 200px; }

/* video: thumbnail until tapped, then the YouTube player in place */
.vid { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--ink); cursor: pointer; }
.vid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid .play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.vid .play i { width: 58px; height: 58px; border-radius: 29px; background: rgba(22, 23, 27, 0.74); display: flex; align-items: center; justify-content: center; padding-left: 3px; }
.vid.on { cursor: default; }
.vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vid-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.vid-cap a { font-weight: 700; white-space: nowrap; }

/* expandable rows (basics, songs) */
.item > summary { list-style: none; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; cursor: pointer; }
.item > summary::-webkit-details-marker { display: none; }
.item .t { flex: 1; min-width: 0; }
.item .t b { display: block; font-size: 15px; font-weight: 600; }
.item .t small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
.item .chev { color: var(--muted); font-size: 20px; transition: transform .15s; }
.item[open] > summary .chev { transform: rotate(90deg); }
.item .body { padding: 2px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.chk { width: 30px; height: 30px; border-radius: 15px; border: 1.5px solid var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #FFFFFF; }
.item.done .chk { background: var(--olive); border-color: var(--olive); }
.item.done .t b { color: var(--muted); }
.song .num { width: 26px; flex-shrink: 0; font-family: var(--disp); font-stretch: 80%; font-weight: 800; font-size: 22px; color: var(--muted); }
.song.current .num { color: var(--olive); }
.steplist { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; }

/* one-minute drill */
.drill { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--olive-soft); }
.drill .t { flex: 1; min-width: 0; }
.drill .t b { display: block; font-size: 14px; font-weight: 700; }
.drill .t small { display: block; font-size: 12px; line-height: 1.45; color: var(--muted); }
.drill .t .textlink { padding: 0; font-size: 12px; }
.drill .btn { min-width: 92px; }

.rec { border-color: var(--F); }
.rec .eyebrow { color: var(--F-ink); }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-size: 14px; font-weight: 600; }
.row .t small { display: block; font-size: 12px; color: var(--muted); }
.stack > .list { margin: 0 -18px; border-top: 1px solid var(--line); }
.stack > .list .row { padding: 8px 18px; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #FFFFFF; font-size: 13px; font-weight: 600; padding: 10px 16px; border-radius: 12px; z-index: 120; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; }
