/* Dawa — app layer on top of liquid-glass.css. Colours only from lg tokens (+ each course's own hue, --h). */
html, body { margin: 0; height: 100%; }
html { background: var(--lg-bg, #fff); }
@media (prefers-color-scheme: dark) { html { background: #000; } }
html.standalone, html.standalone body { height: 100vh; height: 100lvh; }
html.standalone #app { height: var(--app-h, 100lvh); }
body.lg { background: var(--lg-bg); overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body.lg[data-mode="light"] { --lg-bg: #FDF3F6; --lg-scroll-fade: rgba(253,243,246,.72); }
#app { position: relative; height: 100%; height: 100dvh; max-width: 520px; margin: 0 auto; overflow: hidden; isolation: isolate; }
@media (min-width: 560px) { #app { box-shadow: 0 0 0 .5px var(--lg-separator), 0 30px 80px -40px rgba(0,0,0,.5); } }
.tabroot { position: absolute; inset: 0; }
.lg { --lg-nav-top: calc(env(safe-area-inset-top, 0px) + 8px); --lg-top: calc(env(safe-area-inset-top, 0px) + 62px); --lg-bottom: calc(env(safe-area-inset-bottom, 0px) + 112px); --lg-edge-h: calc(env(safe-area-inset-top, 0px) + 64px); }
.lg-page { --lg-page-bg: linear-gradient(rgba(0,0,0,var(--lg-dim,0)), rgba(0,0,0,var(--lg-dim,0))), var(--lg-wall, none) center / cover no-repeat, var(--lg-bg); }
.lg-large-title { margin: 4px 4px 0; }
.lg-section-title { margin-top: 8px; }

.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }
.danger { color: var(--lg-red); }
.foot { margin: -4px 8px 0; padding: 0; }
.nav-pill { height: 44px; padding: 0 16px; border-radius: 22px; border: 0; font: 650 14.5px/1 var(--lg-font); color: var(--lg-label); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.nav-pill svg { width: 17px; height: 17px; }
.link-btn { border: 0; background: none; padding: 10px 4px; min-height: 44px; font: 600 15px/1 var(--lg-font); color: var(--lg-accent-ink); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; align-self: flex-start; }
.link-btn svg { width: 17px; height: 17px; }
.lg-btn svg { width: 19px; height: 19px; }
.lg-btn:not(.lg-btn--primary) { background: var(--lg-fill); color: var(--lg-label); border: 0; }
.lg-btn.ghost { background: transparent; color: var(--lg-accent-ink); }
.hello { margin: -10px 6px -2px; font: 500 15px/1.3 var(--lg-font); color: var(--lg-label-2); }

/* medicine art: white glyph on the course colour */
.med { width: var(--s); height: var(--s); flex: none; display: grid; place-items: center; border-radius: calc(var(--s) * .3);
  background: linear-gradient(145deg, color-mix(in srgb, var(--h) 82%, #fff), var(--h)); box-shadow: inset 0 1px 1px rgba(255,255,255,.55), 0 6px 14px -8px var(--h); }
.med svg { width: 74%; height: 74%; filter: drop-shadow(0 1px 1px rgba(0,0,0,.12)); }

/* day strip */
.days { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; margin: 0 calc(-1 * var(--lg-gutter)); padding: 4px var(--lg-gutter) 6px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day { flex: none; width: 46px; height: 74px; border-radius: 23px; border: 0; display: grid; justify-items: center; align-content: center; gap: 4px; cursor: pointer; scroll-snap-align: center;
  background: var(--lg-glass); -webkit-backdrop-filter: var(--lg-blur-content); backdrop-filter: var(--lg-blur-content); box-shadow: inset 0 0 0 .5px var(--lg-edge); color: var(--lg-label);
  transition: transform var(--lg-dur-bouncy) var(--lg-ease-bouncy), background-color .25s; }
.day:active { transform: scale(.92); }
.day__w { font: 600 11px/1 var(--lg-font); color: var(--lg-label-2); text-transform: uppercase; }
.day__n { font: 700 19px/1 var(--lg-font-rounded); }
.day__dot { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(var(--lg-green) calc(var(--p) * 1%), var(--lg-track) 0); -webkit-mask: radial-gradient(circle, transparent 5px, #000 5.5px); mask: radial-gradient(circle, transparent 5px, #000 5.5px); }
.day__dot[data-n="0"] { background: none; }
.day.is-miss .day__dot { background: conic-gradient(var(--lg-green) calc(var(--p) * 1%), color-mix(in srgb, var(--lg-red) 55%, transparent) 0); }
.day.is-today .day__w { color: var(--lg-accent-ink); }
.day[aria-pressed="true"] { background: var(--lg-accent); color: var(--lg-on-accent); }
.day[aria-pressed="true"] .day__w { color: inherit; opacity: .85; }
.day[aria-pressed="true"] .day__dot { background: conic-gradient(var(--lg-on-accent) calc(var(--p) * 1%), rgba(255,255,255,.35) 0); }
.day[aria-pressed="true"] .day__dot[data-n="0"] { background: none; }

/* hero */
.hero { display: flex; align-items: center; gap: 16px; padding: 18px; }
.ring-big { position: relative; width: 108px; height: 108px; flex: none; }
.ring-big svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-big circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.ring-track { stroke: var(--lg-track); }
.ring-fill { stroke: var(--lg-accent); transition: stroke-dasharray var(--lg-dur-gentle) var(--lg-ease-smooth); }
.ring-big[style*="--p:100"] .ring-fill { stroke: var(--lg-green); }
.ring-big__in { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 2px; }
.ring-big__n { font: 750 30px/1 var(--lg-font-rounded); display: flex; align-items: baseline; letter-spacing: -.02em; }
.ring-big__n small { font-size: 16px; color: var(--lg-label-2); margin-left: 1px; }
.ring-big__l { font: 600 11px/1 var(--lg-font); color: var(--lg-label-2); text-transform: uppercase; letter-spacing: .06em; }
.hero__text { min-width: 0; display: grid; gap: 5px; }
.hero__title { font: 700 21px/1.18 var(--lg-font-display); letter-spacing: -.02em; margin: 0; overflow-wrap: anywhere; }

/* setup / welcome cards */
.setup, .welcome { gap: 12px; }
.setup b, .welcome b { font: 650 16px/1.25 var(--lg-font); }
.setup .lg-footnote { margin-top: 3px; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; font: 400 15px/1.4 var(--lg-font); }
.kbd { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--lg-fill); vertical-align: -6px; color: var(--lg-blue); }
.kbd svg { width: 16px; height: 16px; }
.small-x { width: 34px; height: 34px; min-width: 34px; }
.small-x svg { width: 15px; height: 15px; }

/* section headers with a time on the right */
.sect { display: flex; align-items: center; gap: 6px; }
.sect svg { width: 16px; height: 16px; }
.sect span { margin-left: auto; letter-spacing: 0; text-transform: none; font-weight: 500; }

/* dose rows */
.doses { --lg-sep-inset: 70px; }
.dose { padding: 6px 10px 6px 0; gap: 0; }
.dose__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 8px 6px 8px 14px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; border-radius: 18px; }
.dose__main:active { background: var(--lg-fill); }
.dose .lg-row__title small, .course .lg-row__title small { font-weight: 500; color: var(--lg-label-2); font-size: 13.5px; }
.st { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font: 600 12.5px/1 var(--lg-font); color: var(--lg-label-2); }
.st svg { width: 13px; height: 13px; }
.st--ok { color: color-mix(in oklab, var(--lg-green) 78%, var(--lg-label)); }
.st--due { color: color-mix(in oklab, var(--lg-orange) 80%, var(--lg-label)); }
.st--miss { color: var(--lg-red); }
.st--skip { color: var(--lg-label-3); }
.tick { position: relative; width: 46px; height: 46px; flex: none; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--h) 70%, transparent); background: color-mix(in srgb, var(--h) 9%, transparent);
  display: grid; place-items: center; cursor: pointer; color: transparent; transition: transform var(--lg-dur-bouncy) var(--lg-ease-bouncy), background-color .25s, border-color .25s, color .2s; }
.tick svg { width: 22px; height: 22px; transform: scale(.4); transition: transform var(--lg-dur-bouncy) var(--lg-ease-bouncy); }
.tick:active { transform: scale(.86); }
.tick[aria-pressed="true"] { background: var(--lg-green); border-color: var(--lg-green); color: #fff; box-shadow: 0 6px 16px -8px var(--lg-green); }
.tick[aria-pressed="true"] svg { transform: scale(1); }
.tick:disabled { opacity: .35; cursor: default; }
.dose.is-done .lg-row__title { color: var(--lg-label-2); }
.dose.is-done .med, .dose.is-skip .med { filter: saturate(.55); opacity: .8; }

/* courses */
.courses { --lg-sep-inset: 72px; }
.course { gap: 14px; padding: 13px 16px; }
.course .lg-row__text { display: grid; gap: 3px; }
.bar { display: block; height: 6px; border-radius: 3px; background: var(--lg-track); overflow: hidden; margin-top: 5px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--h); transition: width .8s var(--lg-ease-smooth); }
.bar--lg { height: 8px; border-radius: 4px; width: 100%; }
.bar-cap { font: 500 12px/1.2 var(--lg-font); color: var(--lg-label-2); }
.left-n { font: 750 22px/1 var(--lg-font-rounded); display: grid; justify-items: end; gap: 2px; flex: none; }
.left-n small { font: 600 10.5px/1 var(--lg-font); color: var(--lg-label-2); text-transform: uppercase; letter-spacing: .05em; }
.pill-tag { flex: none; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--lg-fill); font: 600 12px/26px var(--lg-font); color: var(--lg-label-2); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pill-tag svg { width: 13px; height: 13px; }
.pill-tag--ok { color: color-mix(in oklab, var(--lg-green) 78%, var(--lg-label)); background: color-mix(in srgb, var(--lg-green) 14%, transparent); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile { padding: 14px 12px; gap: 4px; align-content: start; }
.tile__n { font: 750 26px/1 var(--lg-font-rounded); letter-spacing: -.02em; display: block; min-height: 26px; }
.tile__n.ok { color: color-mix(in oklab, var(--lg-green) 78%, var(--lg-label)); }
.tile__n.miss { color: var(--lg-red); }
.tile__l { font: 500 12px/1.2 var(--lg-font); color: var(--lg-label-2); }

.course-hero { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 22px 18px 18px; margin-top: 6px; }
.course-hero__name { font: 750 28px/1.1 var(--lg-font-display); letter-spacing: -.025em; margin: 6px 0 0; }
.course-hero .lg-subhead { margin-top: -4px; }
.chips-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip-s { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 15px; background: color-mix(in srgb, var(--h) 13%, transparent); font: 550 13px/1.25 var(--lg-font); text-align: left; }
.chip-s svg { width: 15px; height: 15px; flex: none; color: color-mix(in oklab, var(--h) 75%, var(--lg-label)); }
.next-line { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; display: flex; }
.note .lg-body { margin: 6px 0 0; }

/* calendar */
.cal { gap: 10px; }
.cal b { font: 650 16px/1 var(--lg-font); }
.cal__nav { width: 40px; height: 40px; background: var(--lg-fill); border: 0; color: var(--lg-label); }
.cal__nav svg { width: 18px; height: 18px; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; justify-items: center; }
.cal__h { font: 600 11px/1 var(--lg-font); color: var(--lg-label-3); padding: 4px 0; }
.cal__d { width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; font: 600 14px/1 var(--lg-font-rounded); color: var(--lg-label-3); cursor: default; padding: 0; }
.cal__d.ok { background: var(--lg-green); color: #fff; cursor: pointer; }
.cal__d.miss { background: color-mix(in srgb, var(--lg-red) 16%, transparent); color: var(--lg-red); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--lg-red) 60%, transparent); cursor: pointer; }
.cal__d.skip { background: var(--lg-fill); color: var(--lg-label-2); text-decoration: line-through; cursor: pointer; }
.cal__d.plan, .cal__d.now { color: var(--lg-label); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--h) 70%, transparent); }
.cal__d.now { cursor: pointer; background: color-mix(in srgb, var(--h) 16%, transparent); }
.cal__d.is-today:not(.ok) { font-weight: 800; color: var(--lg-accent-ink); }
.cal__key { display: flex; gap: 14px; justify-content: center; font: 500 12px/1 var(--lg-font); color: var(--lg-label-2); }
.cal__key span { display: inline-flex; align-items: center; gap: 5px; }
.cal__key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.cal__key i.ok { background: var(--lg-green); } .cal__key i.miss { background: color-mix(in srgb, var(--lg-red) 40%, transparent); box-shadow: inset 0 0 0 1.5px var(--lg-red); } .cal__key i.plan { box-shadow: inset 0 0 0 2px var(--h); }

/* segmented controls (redrawn on change, so the selected look is CSS only) */
.seg { flex: none; }
.seg button[aria-pressed="true"] { background: var(--lg-glass-strong); box-shadow: inset 0 0 0 .5px var(--lg-edge), 0 3px 10px -4px rgba(0,0,0,.25); }
.lg-sheet .seg, .look .seg { background: var(--lg-fill); }

/* form */
.form { display: grid; gap: 18px; padding-bottom: 24px; }
.form-head { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 22px; background: color-mix(in srgb, var(--h) 12%, transparent); }
.summary { margin: 0; font: 400 14px/1.4 var(--lg-font); color: var(--lg-label-2); }
.summary b { color: var(--lg-label); font-weight: 650; }
.fl { display: grid; gap: 8px; }
.fl > .lg-eyebrow { margin-left: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kind { border: 0; border-radius: 18px; padding: 10px 4px 8px; background: var(--lg-fill); display: grid; justify-items: center; gap: 6px; cursor: pointer; color: var(--lg-label-2); font: 600 12px/1 var(--lg-font);
  transition: transform var(--lg-dur-bouncy) var(--lg-ease-bouncy), box-shadow .2s, background-color .2s; }
.kind:active, .when:active, .color:active { transform: scale(.92); }
.kind[aria-pressed="true"] { background: color-mix(in srgb, var(--h) 14%, transparent); color: var(--lg-label); box-shadow: inset 0 0 0 2px var(--h); }
.kind:not([aria-pressed="true"]) .med { filter: grayscale(.85); opacity: .65; }
.whens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.when { border: 0; border-radius: 18px; padding: 12px 6px 10px; background: var(--lg-fill); display: grid; justify-items: center; gap: 4px; cursor: pointer; color: var(--lg-label-2);
  transition: transform var(--lg-dur-bouncy) var(--lg-ease-bouncy), background-color .2s, color .2s; }
.when svg { width: 22px; height: 22px; }
.when span { font: 650 13.5px/1 var(--lg-font); }
.when small { font: 500 11.5px/1 var(--lg-font); opacity: .8; }
.when[aria-pressed="true"] { background: var(--lg-accent); color: var(--lg-on-accent); }
.frow { display: flex; align-items: center; gap: 10px; min-height: 44px; flex-wrap: wrap; }
.frow > span:first-child:not(.grow) { font: 500 15px/1 var(--lg-font); color: var(--lg-label-2); min-width: 34px; display: inline-flex; }
.frow > span svg { width: 20px; height: 20px; }
.frow .seg { flex: 1; min-width: 160px; }
.frow.tog { cursor: pointer; }
.lg-field.time { width: auto; flex: 1; max-width: 170px; }
.phase { display: grid; gap: 10px; padding: 14px; border-radius: 22px; background: var(--lg-fill); }
.phase + .phase { margin-top: 2px; }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--lg-glass-strong); border-radius: 22px; padding: 2px; }
.stepper .lg-icon-btn { width: 40px; height: 40px; border: 0; background: none; color: var(--lg-label); }
.stepper .lg-icon-btn:disabled { opacity: .3; }
.stepper svg { width: 17px; height: 17px; }
.stepper b { min-width: 30px; text-align: center; font: 700 18px/1 var(--lg-font-rounded); }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.color { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--h); cursor: pointer; box-shadow: inset 0 1px 1px rgba(255,255,255,.5); transition: transform var(--lg-dur-bouncy) var(--lg-ease-bouncy), box-shadow .2s; }
.color[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--lg-bg), 0 0 0 5.5px var(--h); }

/* dose sheet */
.dose-sheet { display: grid; gap: 14px; padding-bottom: 12px; }
.ds-head { display: flex; gap: 14px; align-items: center; }
.ds-head h3 { margin: 0; }
.ds-state { display: inline-flex; align-items: center; gap: 6px; margin: 0; font: 650 15px/1 var(--lg-font); color: color-mix(in oklab, var(--lg-green) 78%, var(--lg-label)); }
.ds-state svg { width: 18px; height: 18px; }
.at-row { padding: 6px 6px 6px 14px; border-radius: 20px; background: var(--lg-fill); flex-wrap: nowrap; }
.at-row .lg-field { background: var(--lg-glass-strong); height: 40px; max-width: 130px; }

/* settings */
.inline-field { border: 0; background: none; font: 500 16px var(--lg-font); color: var(--lg-label-2); text-align: right; min-width: 0; width: 140px; padding: 8px 0; outline: none; }
.inline-field.time { width: auto; color: var(--lg-accent-ink); font-weight: 600; }
.inline-field:focus { color: var(--lg-label); }
label.lg-row { cursor: pointer; }
.lg-row--grid .seg { width: 100%; }
.look { gap: 12px; }
.walls { display: flex; gap: 10px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 6px; scrollbar-width: none; }
.walls::-webkit-scrollbar { display: none; }
.wall { flex: none; border: 0; background: none; padding: 0; display: grid; gap: 6px; justify-items: center; cursor: pointer; font: 500 11.5px/1 var(--lg-font); color: var(--lg-label-2); }
.wall img { width: 54px; height: 96px; border-radius: 14px; object-fit: cover; box-shadow: 0 0 0 .5px var(--lg-separator); transition: transform var(--lg-dur-bouncy) var(--lg-ease-bouncy), box-shadow .2s; }
.wall[aria-pressed="true"] img { box-shadow: 0 0 0 2.5px var(--lg-bg), 0 0 0 5px var(--lg-accent); }
.wall[aria-pressed="true"] span { color: var(--lg-label); font-weight: 650; }

@media (max-width: 360px) { .kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ring-big { width: 92px; height: 92px; } .hero__title { font-size: 19px; } }

/* White & black (owner's choice, 2026-11-07): plain white page in light mode, true black in dark; glass stays,
   made a little more solid with a soft shadow so cards still read as floating panes on a flat background. */
body.lg[data-mode="light"] { --lg-bg: #FFFFFF; --lg-scroll-fade: rgba(255,255,255,.78); }
body.lg[data-mode="dark"] { --lg-bg: #000000; --lg-scroll-fade: rgba(0,0,0,.72); }
body.lg[data-wall="plain"][data-mode="light"] { --lg-glass: rgba(248,248,252,.72); --lg-glass-clear: rgba(248,248,252,.6); --lg-fill: rgba(20,20,40,.055); --lg-edge: rgba(0,0,0,.06);
  --lg-shadow: 0 12px 30px -14px rgba(20,20,50,.22), 0 1px 3px rgba(20,20,50,.06); }
body.lg[data-wall="plain"][data-mode="dark"] { --lg-glass: rgba(28,28,32,.78); --lg-glass-clear: rgba(28,28,32,.66); --lg-glass-sheet: rgba(22,22,26,.86); --lg-edge: rgba(255,255,255,.1); }
body.lg[data-wall="plain"] .day:not([aria-pressed="true"]) { box-shadow: inset 0 0 0 .5px var(--lg-edge), 0 6px 16px -10px rgba(0,0,0,.3); }
