/* v190 habits-protocols screens, built on css/minimal.css (see docs/design-system-v190.md). Scoped to this area only. */

/* ============================================================
   Shared bits for this area
   ============================================================ */
.hp-habits, .hp-protocol, .hp-tasks { --hp-act: var(--blue-2, var(--accent)); }
:is(.hp-habits, .hp-protocol, .hp-tasks) .m-related { margin-bottom: 8px; }
:is(.hp-habits, .hp-protocol) .m-more summary .m-row-txt b { font-size: 15px; font-weight: 500; }
:is(.hp-habits, .hp-protocol) .m-more > summary { gap: 12px; }

/* caption with a count and an optional quiet action on the right */
.hp-cap-row { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.hp-cap-row em { font-style: normal; font-weight: 600; letter-spacing: .04em; color: var(--tx-3); opacity: .8; font-variant-numeric: tabular-nums; }
.hp-cap-act {
  margin: -8px -4px -8px auto; min-height: 36px; padding: 0 6px; border: 0; background: none; color: var(--hp-act);
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; cursor: pointer;
}

/* plain rows inside an open m-more: hairlines, no second box */
.hp-rows { margin: 0; border-top: 1px solid var(--line); }
.m-more > .hp-rows { padding: 0; }
.hp-rows > .m-row + .m-row { border-top: 1px solid var(--line); }
.hp-rows .m-row-txt small { white-space: normal; line-height: 1.4; }
.hp-row-add { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); color: var(--hp-act); }
.hp-row-add svg { width: 15px; height: 15px; }
.hp-row-add.on { border-color: transparent; background: var(--blue-grad, var(--accent)); color: #fff; }

/* one quiet link inside copy */
.hp-link { padding: 0; border: 0; background: none; color: var(--hp-act); font: inherit; font-weight: 600; cursor: pointer; }

/* ============================================================
   Habits
   ============================================================ */

/* activity: one flat card, numbers first, quiet legend */
.hp-habits .ember-activity.hp-activity {
  display: block; margin: 0; padding: 18px 16px 14px; border-radius: var(--m-radius); border: 1px solid var(--line);
  background: var(--m-surface); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
}
.hp-act-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hp-act-stats > div { min-width: 0; }
.hp-act-stats > div + div { padding-left: 12px; border-left: 1px solid var(--line); }
.hp-act-stats b {
  display: block; font-family: var(--font-display, inherit); font-size: 28px; font-weight: 400; line-height: 1; letter-spacing: -.02em;
  color: var(--tx); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hp-act-stats b em { margin-left: 1px; font-family: inherit; font-size: 15px; font-style: normal; color: var(--tx-3); }
.hp-act-stats small { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.3; color: var(--tx-3); }
.hp-activity .ember-matrix { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); gap: 6px; }
.hp-activity .ember-col { gap: 5px; }
.hp-activity .ember-col i { height: 10px; max-width: 30px; border-radius: 5px; background: color-mix(in srgb, var(--tx) 6%, transparent); box-shadow: none; }
.hp-activity .ember-col i.on { background: var(--accent); box-shadow: none; }
.hp-activity .ember-col i.half { background: linear-gradient(90deg, var(--accent) 50%, color-mix(in srgb, var(--tx) 12%, transparent) 50%); }
.hp-activity .ember-col i.miss { background: transparent; border: 1px solid color-mix(in srgb, var(--tx) 14%, transparent); }
.hp-activity .ember-col small { margin-top: 3px; font-size: 10.5px; color: var(--tx-3); }
.hp-activity .ember-col.today small { color: var(--accent); font-weight: 700; }
.hp-activity .ember-legend { flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; font-size: 11px; color: var(--tx-3); }
.hp-activity .ember-legend i { width: 12px; height: 6px; border-radius: 3px; background: var(--accent); }
.hp-activity .ember-legend i.half { background: linear-gradient(90deg, var(--accent) 50%, color-mix(in srgb, var(--tx) 14%, transparent) 50%); }
.hp-activity .ember-legend i.miss { background: transparent; border: 1px solid color-mix(in srgb, var(--tx) 20%, transparent); }
.hp-act-more { margin-left: auto; }

/* the habit list is Today's calm list: same rows, same goal captions */
.hp-list { margin-top: calc(var(--m-gap) - 10px); }
.hp-list .hr-group:last-child { margin-bottom: 0; }
.hp-flag { margin: 10px 0 4px; }
.hp-flag .m-row.hr-flag-banner { min-height: 60px; margin: 0; padding: 10px 14px; border: 0; border-radius: 0; background: transparent; }
.hp-flag-dot { flex: none; width: 8px; height: 8px; margin: 0 7px; border-radius: 50%; background: var(--accent); }
.hp-habits .hr-edit-hint { margin: 14px 8px 0; }

.hp-empty b { display: block; font-size: 16px; font-weight: 500; color: var(--tx); }
.hp-empty p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--tx-2); }

.hp-add-row { margin-top: var(--m-gap); }
.hp-list + .hp-add-row { margin-top: 14px; }
.hp-plus { color: var(--hp-act); }

/* add a habit: one input row, two quiet pickers, then the library and templates */
.hp-add { scroll-margin-top: 76px; }
.hp-add-card { padding: 14px; }
.hp-add-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.hp-select { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hp-select > span { padding-left: 4px; font-size: 11.5px; color: var(--tx-3); }
#app .hp-select select {
  width: 100%; min-width: 0; min-height: 42px; padding: 0 32px 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background-color: var(--m-surface); color: var(--tx); font: inherit; font-size: 14px; color-scheme: dark;
  -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--tx-3) 50%), linear-gradient(135deg, var(--tx-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
[data-theme="light"] #app .hp-select select { color-scheme: light; }
.hp-limit { margin: 12px 4px 0; font-size: 12px; line-height: 1.45; color: var(--tx-3); }
.hp-add .m-card + .m-more { margin-top: 10px; }

/* library inside its m-more */
.hp-lib-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hp-search { position: relative; }
.hp-search svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--tx-3); pointer-events: none; }
#app .hp-search .m-input { width: 100%; padding-left: 40px; }
.hp-cats { flex-wrap: nowrap; margin: 0 -14px; padding: 0 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hp-cats::-webkit-scrollbar { display: none; }
.hp-cats .m-chip { flex: none; min-height: 34px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.hp-lib .lib-groups { gap: 4px; margin: 0 -14px -14px; }
.hp-lib .lib-group { border: 0; border-radius: 0; overflow: visible; }
.hp-lib .lib-group > header { padding: 14px 14px 6px; border: 0; background: none; }
.hp-lib .lib-group > header h3 { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-3); }
.hp-lib .lib-group > header small { font-size: 11.5px; color: var(--tx-3); }
.hp-lib .lrow { grid-template-columns: 22px minmax(0, 1fr) 30px; gap: 12px; min-height: 54px; padding: 8px 14px; border-top: 1px solid var(--line); }
.hp-lib .lib-group > header + .lrow { border-top: 1px solid var(--line); }
.hp-lib .lrow-icon { width: 22px; height: 22px; border-radius: 0; background: none; color: var(--tx-2); }
.hp-lib .lrow-icon svg { width: 20px; height: 20px; }
.hp-lib .lrow-copy b { font-size: 14.5px; font-weight: 500; }
.hp-lib .lrow-copy small { font-size: 12px; color: var(--tx-3); }
.hp-lib .lrow-add { width: 30px; height: 30px; border: 1px solid var(--line-2); background: transparent; color: var(--hp-act); }
.hp-lib .lrow-add svg { width: 15px; height: 15px; }
.hp-lib .lrow.added .lrow-add { border-color: transparent; background: var(--blue-grad, var(--accent)); color: #fff; }
.hp-lib .lrow.added .lrow-copy b { color: var(--tx); }
.hp-lib .lib-more { min-height: 46px; border-top: 1px solid var(--line); color: var(--hp-act); font-size: 13px; font-weight: 600; }
.hp-lib .empty-note { padding: 4px 4px 0; }

/* ============================================================
   Protocols
   ============================================================ */
.hp-proto-today .m-hero strong em { font-size: 18px; }
.hp-proto-bar { height: 4px; margin-top: 16px; border-radius: 2px; background: color-mix(in srgb, var(--tx) 8%, transparent); overflow: hidden; }
.hp-proto-bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width .5s cubic-bezier(.22, 1, .36, 1); }

.hp-pulse { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.hp-pulse-head { display: flex; align-items: baseline; justify-content: space-between; }
.hp-pulse-head span { font-size: 12.5px; color: var(--tx-3); }
.hp-pulse-head b { font-size: 13.5px; font-weight: 600; color: var(--tx-2); font-variant-numeric: tabular-nums; }
.hp-pulse-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.hp-pulse-day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hp-pulse-track { position: relative; width: 100%; max-width: 26px; height: 36px; border-radius: 6px; background: color-mix(in srgb, var(--tx) 5%, transparent); overflow: hidden; }
.hp-pulse-track i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 6px; background: color-mix(in srgb, var(--accent) 70%, transparent); }
.hp-pulse-day.today .hp-pulse-track i { background: var(--accent); }
.hp-pulse-day small { font-size: 10.5px; color: var(--tx-3); }
.hp-pulse-day.today small { color: var(--accent); font-weight: 700; }
.hp-pulse-signal { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--tx-3); }

.hp-protocol .hp-urgent { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0 0; border-radius: var(--m-radius-sm); animation: none; }
.hp-urgent svg, .sheet .hp-urgent svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }

/* today's stack: check, name, amount, time; a quiet chevron opens the details */
.hp-proto-item + .hp-proto-item { border-top: 1px solid var(--line); }
.hp-proto-row { display: flex; align-items: stretch; }
.hp-proto-row .m-row.hp-proto-check { flex: 1; min-width: 0; padding-right: 4px; }
.hp-tick { flex: none; width: 26px; height: 26px; color: var(--tx-3); }
.hp-tick svg { display: block; width: 26px; height: 26px; overflow: visible; }
.hp-tick circle { fill: none; stroke: currentColor; stroke-width: 1.6; transition: fill .2s, stroke .2s; }
.hp-tick path { fill: none; stroke: var(--on-accent, #1d0e05); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .2s ease-out .05s; }
.hp-proto-check.done .hp-tick circle { fill: var(--accent); stroke: var(--accent); }
.hp-proto-check.done .hp-tick path { stroke-dashoffset: 0; }
.hp-proto-check.done .m-row-txt b { color: var(--tx-2); }
.hp-proto-check .m-row-val { font-size: 14px; color: var(--tx-2); }
.hp-proto-more { flex: none; width: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--tx-3); cursor: pointer; }
.hp-proto-more svg { width: 16px; height: 16px; transition: transform .2s; }
.hp-proto-more[aria-expanded="true"] svg { transform: rotate(90deg); }
.hp-proto-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin: 0; padding: 2px 14px 16px 52px; }
.hp-proto-detail dt { font-size: 11px; color: var(--tx-3); }
.hp-proto-detail dd { margin: 2px 0 0; font-size: 13.5px; color: var(--tx); overflow-wrap: anywhere; }
.hp-proto-detail p { grid-column: 1 / -1; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--tx-2); }

.hp-proto-empty p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.45; color: var(--tx-2); }
.hp-proto-boundary { margin: 0; padding-top: 12px !important; font-size: 12px; line-height: 1.5; color: var(--tx-3); border-top: 1px solid var(--line); }
.hp-proto-tpl > .hp-rows + .hp-proto-boundary { border-top: 1px solid var(--line); }

.hp-proto-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.hp-proto-actions .m-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 0 12px; font-weight: 500; white-space: nowrap; }
.hp-proto-actions .m-btn svg { flex: none; width: 16px; height: 16px; color: var(--hp-act); }
.hp-proto-actions .m-btn[aria-expanded="true"] { border-color: var(--blue-line, var(--line-2)); }

/* the manual add form, flattened into one card */
.hp-proto-form { margin-top: 10px; }
.hp-proto-form .protocol-add { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.hp-proto-form .field { margin-bottom: 14px; }
.hp-proto-form .field label { margin: 0 0 6px 4px; font-size: 11.5px; font-weight: 600; color: var(--tx-3); }
#app .hp-proto-form .field input { min-height: 44px; padding: 0 14px; border-radius: 999px !important; font-size: 15px; }
.hp-proto-form .chip-grid { gap: 8px; }
.hp-proto-form .chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--tx-2); font-size: 13.5px; font-weight: 500; }
.hp-proto-form .chip.on { color: #fff; border-color: transparent; background: var(--blue-grad, var(--accent)); }
.hp-proto-form .seg { display: flex; }
.hp-proto-form .seg button { flex: 1; min-height: 36px; font-size: 13px; }
.hp-proto-form .protocol-add > .btn { width: 100%; min-height: 46px; margin-top: 4px; border-radius: 999px; background: var(--blue-grad, var(--accent)); color: #fff; }

/* the tracker sheet reached from "Symptom log and history" */
.proto-row .remove-btn svg { display: block; width: 14px; height: 14px; }

/* Section caption row with a quiet action (v190) */
.hp-cap-row { display: flex; align-items: center; justify-content: space-between; }
.hp-cap-act { border: 0; background: none; padding: 0; color: var(--blue-2, var(--accent)); font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; cursor: pointer; }
.hp-btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
/* Group habits by area or goal */
.hr-groupby { margin: 4px 0 14px; }
.hr-groupby .m-chip { min-height: 34px; font-size: 13px; }

/* ============================================================
   Protocols (v201): the living dashboard, insight, stacks, protein, add sheet
   ============================================================ */
.pd { margin: 0 -16px; }
/* the body: a glass figure with a light network running out from the heart, standing on a holographic base.
   --pk-glow lights the glass and network, --pk-hi its brightest lines, --pk-core and --pk-warm the heart and progress. */
.pk-stage {
  --pk-glow: var(--blue-2, #8fb0ff); --pk-hi: var(--blue-3, #c9d6ff); --pk-core: var(--accent-3, #ffd2b0); --pk-warm: var(--accent, #ff8a4c);
  --pk-card: color-mix(in srgb, var(--bg) 76%, transparent); --pk-shade: color-mix(in srgb, var(--bg) 80%, #000);
  position: relative; width: 100%; max-width: 440px; aspect-ratio: 360 / 450; margin: 0 auto; container-type: inline-size;
}
.pk-stage > svg { position: absolute; left: 0; width: 100%; overflow: visible; pointer-events: none; }
.pk-svg, .pk-fx { top: 0; height: 100%; }
.pk-floor { top: 83.556%; height: 16.444%; }
.pk-fx, .pk-floor { will-change: transform; }
.pk-shade { fill: none; stroke: var(--pk-shade); stroke-width: 15; stroke-opacity: .85; }
.pk-rim { fill: none; stroke: var(--pk-hi); stroke-width: 3; stroke-opacity: .32; }
.pk-groove path { fill: none; stroke: var(--pk-shade); stroke-width: 3.6; stroke-opacity: .62; stroke-linecap: round; }
.pk-edge { fill: none; stroke: var(--pk-hi); stroke-width: .9; stroke-opacity: .55; }
/* v273 (his ask: more real): the anatomy reads as sculpted light and shade; the contour lines are only a faint sheen */
.pk-muscle path { fill: none; stroke: var(--pk-hi); stroke-width: .6; stroke-opacity: .12; stroke-linecap: round; }
.pk-net-glow path, .pk-net path, .pk-pulse path, .pk-net-spine, .pk-net-spine-glow { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pk-net-glow { stroke-width: 3.2; opacity: .2; }
.pk-net { stroke-width: .75; opacity: .7; }
.pk-net.pk-net-fine { stroke-width: .45; opacity: .26; }
.pk-net.pk-net-org { stroke-width: .6; opacity: .75; }
.pk-net-spine { stroke: var(--pk-core); stroke-width: 1; }
.pk-net-spine-glow { stroke: var(--pk-warm); stroke-width: 3.4; stroke-opacity: .2; }
.pk-joints circle { fill: var(--pk-hi); }
.pk-joints .pk-joint-halo { fill: var(--pk-glow); opacity: .18; }
/* energy leaves the heart on every second beat and runs out to the hands, feet and head, fading as it arrives */
.pk-pulse path { stroke: var(--pk-core); stroke-width: 1.1; stroke-dasharray: 7 120; stroke-dashoffset: 7; opacity: 0; animation: pkPulse 2.2s cubic-bezier(.3, .2, .5, 1) infinite; }
.pk-pulse .pk-pulse-glow { stroke: var(--pk-warm); stroke-width: 4.5; stroke-opacity: .35; }
.pk-heart :is(circle, path) { transform-box: fill-box; transform-origin: center; }
.pk-heart-core { fill: color-mix(in srgb, var(--pk-core) 35%, #fff); }
.pk-heart-ray { fill: var(--pk-core); opacity: .85; }
.pk-heart-halo, .pk-heart-core, .pk-heart-ray { animation: pkBeat 1.1s ease-in-out infinite; }
.pk-heart-flare { opacity: 0; }
.pk-heart.flare .pk-heart-flare { animation: pkFlare 1.2s cubic-bezier(.2, .7, .3, 1); }
.pk-floor path { fill: none; stroke: var(--pk-hi); stroke-width: .8; }
.pk-floor .b0 { stroke-opacity: .14; stroke-dasharray: 60 6 2 6; animation: pkSpin 70s linear infinite reverse; }
.pk-floor .b1 { stroke-opacity: .3; stroke-dasharray: 36 10 4 10; animation: pkSpin 48s linear infinite; }
.pk-floor .b2 { stroke-opacity: .18; }
.pk-floor .b2s { stroke: var(--pk-core); stroke-opacity: .6; stroke-width: 1.2; stroke-dasharray: 46 314; animation: pkSpin 9s linear infinite; }
.pk-floor .b3 { stroke-opacity: .38; stroke-dasharray: 2 4; animation: pkSpin 30s linear infinite reverse; }
/* lines from the cards to the body */
.pk-wire { fill: none; stroke: var(--pk-hi); stroke-opacity: .42; stroke-width: .8; stroke-dasharray: 3 3; animation: pkWire 1.4s linear infinite; }
.pk-wire.hot { stroke: var(--pk-core); stroke-opacity: .85; }
.pk-wire-end { fill: var(--pk-hi); opacity: .75; }
.pk-spot { fill: var(--pk-core); }
.pk-spot-halo { fill: var(--pk-warm); opacity: .28; }
.pk-spot-halo.hot { transform-box: fill-box; transform-origin: center; animation: pkSpot 2.2s ease-in-out infinite; }
/* the four readings as glass cards; the one that needs you most glows */
.pk-card {
  position: absolute; width: 27.5%; display: grid; justify-items: start; gap: .9cqw; padding: 2.4cqw 2.6cqw 2.7cqw;
  border: 1px solid color-mix(in srgb, var(--pk-hi) 16%, transparent); border-radius: 3.8cqw; isolation: isolate;
  background: linear-gradient(155deg, color-mix(in srgb, var(--pk-glow) 13%, transparent), transparent 58%), var(--pk-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 12px 28px -14px rgba(0, 0, 0, .7);
  color: var(--tx); font: inherit; text-align: left; cursor: pointer;
}
.pk-card-head { display: flex; align-items: center; gap: 1.3cqw; min-width: 0; }
.pk-card { --tone: var(--pk-hi); }
.pk-card[data-id="am"] { --tone: #ffd27a; }
.pk-card[data-id="pm"] { --tone: #bdb6ff; }
.pk-card[data-id="protein"] { --tone: #ff9a55; }
.pk-card[data-id="water"] { --tone: #7fd6ff; }
:root[data-palette="greyblack"] .pk-card { --tone: var(--tx-2); }
.pk-card-head i { display: grid; color: var(--tone); }
.pk-card-head i svg { width: clamp(13px, 4cqw, 16px); height: clamp(13px, 4cqw, 16px); }
.pk-card small { font-size: clamp(10px, 3.1cqw, 12.5px); font-weight: 500; color: var(--tx-2); white-space: nowrap; }
.pk-card b { font-size: clamp(17px, 5.6cqw, 23px); font-weight: 500; line-height: 1.05; letter-spacing: -.02em; color: var(--tx); font-variant-numeric: tabular-nums; }
.pk-card em { margin-top: -.3cqw; font-size: clamp(9.5px, 2.8cqw, 11.5px); font-style: normal; color: var(--tx-3); white-space: nowrap; }
.pk-bars { display: flex; align-items: flex-end; gap: .75cqw; height: 3.9cqw; margin-top: .5cqw; }
.pk-bars i { width: .95cqw; min-width: 2.5px; height: calc(30% + var(--i) * 10%); border-radius: 2px; background: color-mix(in srgb, var(--pk-hi) 17%, transparent); }
.pk-bars i.on { background: linear-gradient(180deg, var(--pk-core), var(--pk-warm)); }
.pk-card.hot { border-color: color-mix(in srgb, var(--pk-core) 42%, transparent); }
.pk-card.hot::before {
  content: ''; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 22px -3px color-mix(in srgb, var(--pk-warm) 55%, transparent), inset 0 0 16px -7px var(--pk-warm); animation: pkHot 2.6s ease-in-out infinite;
}
:root .pd .pk-stage .pk-card.hot small { color: var(--pk-core); }
.pk-card.full .pk-card-head i { filter: drop-shadow(0 0 4px var(--tone)); }
.pk-card:focus-visible { outline: 2px solid var(--pk-hi); outline-offset: 3px; }
.pk-sum { margin: 2px 16px 0; text-align: center; font-size: 13.5px; line-height: 1.45; color: var(--tx-2); }
[data-theme="light"] .pk-sum { margin-top: 14px; }
.pk-sum b { font-family: var(--font-display, inherit); font-size: 17px; font-weight: 400; color: var(--tx); }
[data-theme="light"] .pd { margin: 0; }
/* light theme: the body keeps its night sky, like the Levels dial below it */
[data-theme="light"] .pk-stage {
  --tx: #eef2ff; --tx-2: rgba(225, 232, 255, .8); --tx-3: rgba(200, 212, 245, .6);
  --pk-glow: #7d9dff; --pk-hi: #c3d1ff; --pk-core: #ffb27a; --pk-warm: #ff7a2f; --pk-card: rgba(9, 17, 44, .74); --pk-shade: #040a1e;
  overflow: hidden; border-radius: var(--m-radius); background: radial-gradient(60% 50% at 50% 36%, rgba(52, 96, 240, .25), transparent 72%), #0a1330;
}
:root[data-palette="greyblack"] .pk-stage { --pk-glow: #a6a6a6; }
@keyframes pkPulse { 0% { stroke-dashoffset: 7; opacity: 0; } 8%, 60% { opacity: 1; } 70%, 100% { stroke-dashoffset: -100; opacity: 0; } }
@keyframes pkBeat { 0%, 56%, 100% { transform: scale(1); opacity: .82; } 12% { transform: scale(1.24); opacity: 1; } 24% { transform: scale(.98); opacity: .88; } 36% { transform: scale(1.12); opacity: 1; } }
@keyframes pkFlare { 0% { opacity: 0; transform: scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(2.6); } }
@keyframes pkSpin { to { stroke-dashoffset: -360; } }
@keyframes pkWire { to { stroke-dashoffset: 12; } }
@keyframes pkHot { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes pkSpot { 0%, 100% { transform: scale(1); opacity: .28; } 50% { transform: scale(1.6); opacity: .5; } }
@media (prefers-reduced-motion: reduce) {
  .pk-stage *, .pk-stage *::before { animation: none !important; }
  .pk-pulse, .pk-heart-flare { display: none; }
}
[data-motion="reduced"] .pk-stage *, [data-motion="reduced"] .pk-stage *::before { animation: none !important; }
[data-motion="reduced"] :is(.pk-pulse, .pk-heart-flare) { display: none; }

/* what the data says */
.pk-insight { display: flex; gap: 14px; align-items: flex-start; margin-top: 12px; padding: 16px; border-radius: var(--m-radius); border: 1px solid var(--line); background: var(--m-surface); }
.pk-insight-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(127, 214, 255, .35); color: #9fd8ff; box-shadow: inset 0 0 16px rgba(127, 214, 255, .18); }
.pk-insight-ico svg { width: 19px; height: 19px; }
.pk-insight-txt { min-width: 0; }
.pk-insight-txt small { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3); }
.pk-insight-txt b { display: block; margin-top: 2px; font-size: 15px; font-weight: 600; color: var(--tx); }
.pk-insight-txt p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--tx-2); }

/* morning, night, as needed */
.pk-cap { gap: 10px; min-height: 16px; }
.pk-cap .sl-pill { margin: -6px 0 -6px auto; min-height: 28px; font-size: 12px; }
.pk-list > .pk-item + .pk-item { border-top: 1px solid var(--line); }
.pk-row { display: flex; align-items: center; }
.pk-check { flex: none; display: grid; place-items: center; width: 52px; min-height: 58px; padding: 0; border: 0; background: none; color: var(--tx-3); cursor: pointer; }
.pk-check > svg { width: 25px; height: 25px; }
.pk-check svg circle { fill: none; stroke: currentColor; stroke-width: 1.5; transition: fill .2s, stroke .2s; }
.pk-tick path { fill: none; stroke: transparent; stroke-width: 2.1; transition: stroke .2s; }
.pk-item.taken .pk-check { color: var(--accent); }
.pk-item.taken .pk-tick circle { fill: var(--accent); }
.pk-item.taken .pk-tick path { stroke: #1d0e05; }
.pk-plus { color: var(--blue-2, var(--accent)); }
.pk-plus circle { stroke-dasharray: 3 3; }
.pk-plus path { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.pk-check:disabled { cursor: default; opacity: .35; }
.pk-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 14px 8px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pk-type { --tc: #a7b3d0; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: color-mix(in srgb, var(--tc) 17%, transparent); color: color-mix(in srgb, var(--tc) 80%, #fff); }
.pk-type svg { width: 18px; height: 18px; }
.pk-type.t-vitamin { --tc: #f5c26b; }
.pk-type.t-supplement { --tc: #6fdc9c; }
.pk-type.t-medication { --tc: #7da2ff; }
.pk-type.t-peptide { --tc: #b48cff; }
.pk-type.t-electrolyte { --tc: #6ee1ff; }
.pk-type.t-nutrition { --tc: #ff9f7a; }
.pk-type.t-fitness { --tc: #9fb6ff; }
[data-theme="light"] .pk-type { color: color-mix(in srgb, var(--tc) 70%, #1a1f2b); }
.pk-item.taken .m-row-txt b { color: var(--tx-2); }
.pk-item.rest { opacity: .55; }
.pk-detail { display: grid; gap: 10px; padding: 0 14px 14px 52px; }
.pk-detail p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--tx-3); }
.pk-add { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; }
.pk-add svg { width: 18px; height: 18px; }

/* protein: your target, a tap per meal */
.pk-protein { padding: 18px; }
.pk-protein-top { display: flex; align-items: center; gap: 14px; }
.pk-protein-big { font-family: var(--font-display, inherit); font-size: 46px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.pk-protein-big em { margin-left: 2px; font-size: 22px; font-style: normal; }
.pk-protein-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pk-protein-txt b { font-size: 15px; font-weight: 600; color: var(--tx); }
.pk-protein-txt small { font-size: 12.5px; color: var(--tx-3); }
.pk-protein-bar { height: 6px; margin-top: 14px; overflow: hidden; border-radius: 99px; background: var(--line-2); }
.pk-protein-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .7s cubic-bezier(.22, 1, .36, 1); }
.pk-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.pk-quick .m-chip { min-height: 34px; }
.pk-undo { margin-left: auto; padding: 6px 2px; border: 0; background: none; color: var(--blue-2, var(--accent)); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
/* bottom of the tab: one quiet row of tools, then a single fine line */
.pk-tools { display: flex; justify-content: center; gap: 8px; margin: 22px 0 0; }
.pk-tool { flex: 0 1 92px; display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 64px; padding: 8px 4px; border: 0; border-radius: var(--m-radius-sm, 14px); background: none; color: var(--tx-3); font: inherit; font-size: 11px; letter-spacing: .02em; cursor: pointer; transition: color .2s, background-color .2s, transform .15s; }
.pk-tool svg { width: 22px; height: 22px; stroke-width: 1.6; color: var(--tx-2); transition: color .2s; }
.pk-tool:active { transform: scale(.94); background: color-mix(in srgb, var(--tx) 5%, transparent); }
.pk-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pk-tool[aria-expanded="true"] { color: var(--tx-2); }
.pk-tool[aria-expanded="true"] svg { color: var(--accent); }
@media (hover: hover) { .pk-tool:hover { color: var(--tx-2); } .pk-tool:hover svg { color: var(--tx); } }
.pk-tpl { margin-top: 10px; overflow: hidden; }
.pk-fine { margin: 26px 0 0; text-align: center; font-size: 11px; line-height: 1.4; letter-spacing: .01em; color: var(--tx-3); opacity: .8; }
/* entrance: protein card, then the tool row 40 ms behind it */
@keyframes pkRise { from { opacity: 0; transform: translateY(10px); } }
.pk-rise { animation: pkRise .42s cubic-bezier(.2, .8, .2, 1) both; }
.pk-tools.pk-rise { animation-delay: .04s; }
@media (prefers-reduced-motion: reduce) { .pk-rise { animation: none !important; } }
[data-motion="reduced"] .pk-rise { animation: none !important; }
.pk-foods { display: grid; grid-auto-flow: column; grid-auto-columns: 116px; gap: 8px; margin: 14px -18px 0; padding: 2px 18px 4px; overflow-x: auto; scrollbar-width: none; }
.pk-foods::-webkit-scrollbar { display: none; }
.pk-food { display: grid; justify-items: start; gap: 3px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--m-surface); color: var(--tx); font: inherit; text-align: left; cursor: pointer; transition: transform .15s; }
.pk-food:active { transform: scale(.96); }
.pk-food-ico { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 14px; background: radial-gradient(circle at 35% 30%, rgba(255, 190, 130, .34), rgba(255, 122, 47, .1)); color: #ffc79a; }
.pk-food-ico svg { width: 24px; height: 24px; }
[data-theme="light"] .pk-food-ico { color: #c4561a; }
.pk-food b { font-size: 13px; font-weight: 600; line-height: 1.25; }
.pk-food small { font-size: 12px; color: var(--accent); }
.pk-ask { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line-2); background: transparent; color: var(--tx-2); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.pk-ask svg { flex: none; width: 18px; height: 18px; }
.pk-protein-setup .m-chips { margin: 10px 0 12px; }
.pk-protein-q { margin: 0; font-size: 15px; color: var(--tx); }

/* add or edit an item: a step-by-step wizard (v208). One question per screen, glass tiles, one tap to answer. */
.pq-wiz { display: flex; flex-direction: column; min-height: 340px; max-height: min(640px, calc(88dvh - 92px - env(safe-area-inset-bottom, 0px))); overflow: hidden; }
.pq-top { flex: none; display: flex; align-items: center; gap: 4px; margin: -2px 0 8px -10px; padding-right: 4px; }
.pq-back { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--tx-2); cursor: pointer; transition: background .15s, opacity .2s; }
.pq-back:active { background: var(--m-surface-2); }
.pq-back:disabled { visibility: hidden; }
.pq-back svg { width: 22px; height: 22px; }
.pq-bar { flex: 1; display: flex; gap: 4px; }
.pq-bar i { position: relative; flex: 1; height: 4px; overflow: hidden; border-radius: 4px; background: color-mix(in srgb, var(--tx) 10%, transparent); }
.pq-bar i::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.pq-bar i.on::after { transform: scaleX(1); }

.pq-step { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.pq .pq-q { flex: none; margin: 6px 0 16px; font-family: var(--font-display, inherit); font-size: 27px; font-weight: 400; line-height: 1.15; letter-spacing: -.01em; }
.pq-cap { margin: 4px 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tx-3); }
.pq-grid + .pq-cap { margin-top: 18px; }
.pq-scroll {
  flex: 1 1 auto; min-height: 0; margin: 0 -8px; padding: 10px 8px 22px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 20px), transparent); mask-image: linear-gradient(#000 calc(100% - 20px), transparent);
}
.pq-scroll::-webkit-scrollbar { display: none; }
.pq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pq-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* a tile is one answer: glass at rest, the main gradient once picked */
.pq-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; min-width: 0; min-height: 96px; padding: 14px;
  border-radius: 20px; border: 1px solid var(--line-2); background: var(--m-surface); color: var(--tx); font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.pq-tile:active { transform: scale(.97); background: var(--m-surface-2); }
.pq-tile.on, .pq-tile.on:active { border-color: transparent; background: var(--blue-grad, var(--accent)); color: var(--p-on-action, #fff); }
.pq-tile[hidden] { display: none; }
.pq-ti { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: auto; border-radius: 12px; background: color-mix(in srgb, var(--tx) 7%, transparent); color: var(--blue-2, var(--accent)); transition: background .2s, color .2s; }
.pq-ti svg { width: 20px; height: 20px; }
.pq-tile.on .pq-ti { background: color-mix(in srgb, currentColor 20%, transparent); color: inherit; }
.pq-tl { font-size: 15px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.pq-tl em { margin-left: 2px; font-size: 12px; font-style: normal; font-weight: 500; opacity: .75; }
.pq-ts { font-size: 12.5px; line-height: 1.2; color: var(--tx-3); }
.pq-tile.on .pq-ts { color: inherit; opacity: .8; }
.pq-tc { position: absolute; top: 14px; right: 14px; font-size: 12px; font-weight: 600; color: var(--tx-3); font-variant-numeric: tabular-nums; }
.pq-tile.on .pq-tc { color: inherit; opacity: .8; }
.pq-big { margin-bottom: auto; font-family: var(--font-display, inherit); font-size: 40px; font-weight: 400; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
/* big: when and how often */
.pq-tile.lg { min-height: 132px; }
.pq-tile.lg .pq-ti { width: 44px; height: 44px; border-radius: 15px; }
.pq-tile.lg .pq-ti svg { width: 24px; height: 24px; }
.pq-tile.lg .pq-tl { font-size: 17px; }
/* compact: items and notes */
.pq-tile.sm { flex-direction: row; align-items: center; justify-content: flex-start; min-height: 58px; padding: 10px 14px; }
.pq-tile.sm .pq-tl { font-size: 14.5px; font-weight: 500; }
.pq-tile.sm.on .pq-tl { font-weight: 600; }
.pq-tile.sm.ic .pq-ti { width: 32px; height: 32px; margin: 0 4px 0 -4px; }
.pq-tile.sm.ic .pq-ti svg { width: 18px; height: 18px; }
.pq-wide { width: 100%; margin-top: 12px; justify-content: space-between; border-style: dashed; background: transparent; color: var(--tx-2); }
.pq-chev { flex: none; display: grid; place-items: center; color: var(--tx-3); }
.pq-chev svg { width: 16px; height: 16px; }
/* times: the time is the tile */
.pq-tile.tm { align-items: flex-start; justify-content: center; gap: 3px; min-height: 84px; }
.pq-tile.tm .pq-tl { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.pq-tile.tm.other { border-style: dashed; background: transparent; }
.pq-tile.tm.other.on { border-style: solid; background: var(--blue-grad, var(--accent)); }
.pq-tile.tm.other .pq-ti { margin: 0 0 2px; width: 28px; height: 28px; border-radius: 10px; }
.pq-tile.tm.other .pq-ti svg { width: 16px; height: 16px; }
.pq-tile.tm.other:not(.on) .pq-tl { font-size: 14.5px; font-weight: 500; color: var(--tx-2); }
.pq-grid.c3 .pq-tile.tm { min-height: 76px; padding: 12px; }
.pq-grid.c3 .pq-tile.tm .pq-tl { font-size: 17px; }
.pq-grid.c3 .pq-tile.tm.other:not(.on) .pq-tl { font-size: 14px; }
.pq-grid.c3 .pq-ts { font-size: 11.5px; }
.pq-sug { position: absolute; top: -8px; right: 10px; padding: 2px 8px; border-radius: 999px; background: var(--blue-grad, var(--accent)); color: var(--p-on-action, #fff); font-size: 10px; font-weight: 700; letter-spacing: .06em; line-height: 1.4; text-transform: uppercase; }
.pq-tile.on .pq-sug { background: var(--p-on-action, #fff); color: var(--blue, #2f5df2); }
.pq-empty { margin: 12px 4px 0; font-size: 14px; color: var(--tx-3); }
.pq-empty[hidden] { display: none; }
.pq-search { flex: none; }
.pq-search .m-input { width: 100%; }

/* one small input, only after a custom choice */
#app .pq .m-input { font-size: 16px; }
.pq-field-in { width: 100%; min-height: 56px; margin-top: 4px; }
#app .pq .pq-field-in { font-size: 18px; }
.pq-other { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.pq-other .m-input { flex: 1; min-width: 0; }
.pq-other .m-btn:disabled, .pq-foot .m-btn:disabled { opacity: .4; cursor: default; }

.pq-foot { flex: none; display: grid; gap: 10px; padding-top: 6px; }
.pq .sl-wide { margin-top: 0; }
.pq-main { min-height: 52px; font-size: 15px; }
.pq-skip { min-height: 40px; padding: 0 12px; border: 0; background: none; color: var(--tx-3); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.pq-skip[hidden] { display: none; }
.pq-del { min-height: 44px; }
.pq-del.arm { border-color: var(--red, #f25c75); color: var(--red, #f25c75); }
.pq-boundary { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--tx-3); }
.pq-boundary svg { flex: none; width: 16px; height: 16px; }

/* review: one line per answer */
.pq-sum { border-radius: 20px; border: 1px solid var(--line); background: var(--m-surface); overflow: hidden; }
.pq-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 14px; border: 0; background: none; color: var(--tx); font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.pq-row + .pq-row { border-top: 1px solid var(--line); }
.pq-row:active { background: var(--m-surface-2); }
.pq-ri { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: color-mix(in srgb, var(--tx) 7%, transparent); color: var(--blue-2, var(--accent)); }
.pq-ri svg { width: 19px; height: 19px; }
.pq-rt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.pq-rt small { font-size: 12px; color: var(--tx-3); }
.pq-rt b { overflow: hidden; font-size: 15.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

/* saved: a calm check, then what it joined */
.pq-done { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow-y: auto; }
.pq-check { width: 84px; height: 84px; margin-bottom: 10px; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pq-check circle { stroke-width: 2.4; }
.pq-check-fill { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: none; }
.pq-check-ring { stroke: var(--accent); }
.pq-check path { stroke: var(--accent); stroke-width: 4; }
.pq-done .pq-q { margin: 6px 0 4px; }
.pq-done-name { margin: 0 0 18px; font-size: 16px; font-weight: 600; color: var(--tx-2); overflow-wrap: anywhere; }
.pq-ints { display: grid; gap: 10px; width: 100%; margin: 0; padding: 0; list-style: none; text-align: left; }
.pq-ints li { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--m-surface); font-size: 14.5px; font-weight: 500; }
.pq-ints li span { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.pq-ints li svg { width: 13px; height: 13px; stroke-width: 3; }

/* the slow, soft step change: the old step fades and drifts away, the new one fades in and rises, tiles one after another */
.pq-leaving { pointer-events: none; animation: pqOut 280ms ease-in-out both; }
.pq-leaving.pq-back { animation-name: pqOutBack; }
.pq-in :is(.pq-stag, .pq-tile, .pq-row) { animation: pqIn 420ms cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
.pq-in.pq-back :is(.pq-stag, .pq-tile, .pq-row) { animation-name: pqInBack; }
.pq-in .pq-bar i.cur::after { animation: pqFill 600ms cubic-bezier(.2, .8, .2, 1) backwards; }
.pq-in .pq-check-fill { animation: pqFade 900ms ease-out 200ms backwards; }
.pq-in .pq-check-ring { stroke-dasharray: 183; animation: pqDraw 900ms cubic-bezier(.2, .8, .2, 1) 120ms backwards; }
.pq-in .pq-check path { stroke-dasharray: 44; animation: pqDrawCheck 700ms cubic-bezier(.2, .8, .2, 1) 640ms backwards; }
@keyframes pqOut { to { opacity: 0; transform: translateY(-12px); } }
@keyframes pqOutBack { to { opacity: 0; transform: translateY(12px); } }
@keyframes pqIn { from { opacity: 0; transform: translateY(16px); } }
@keyframes pqInBack { from { opacity: 0; transform: translateY(-16px); } }
@keyframes pqFill { from { transform: scaleX(0); } }
@keyframes pqFade { from { opacity: 0; } }
@keyframes pqDraw { from { stroke-dashoffset: 183; } }
@keyframes pqDrawCheck { from { stroke-dashoffset: 44; } }
@media (prefers-reduced-motion: reduce) {
  .pq-leaving, .pq-in *, .pq-in *::after { animation: none !important; }
}
[data-motion="reduced"] :is(.pq-leaving, .pq-in *, .pq-in *::after) { animation: none !important; }
[data-motion="reduced"] .pq-tile, [data-motion="reduced"] .pq-bar i::after { transition: none; }
@media (max-width: 374px) {
  .pq .pq-q { font-size: 24px; }
  .pq-tile { padding: 12px; }
  .pq-grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pq-grid.c3 .pq-tile.tm .pq-tl { font-size: 18px; }
}
@media (max-height: 700px) {
  .pq .pq-q { margin-bottom: 10px; }
  .pq-row { min-height: 52px; }
  .pq-tile.lg { min-height: 108px; }
}

/* Levels: a fan of glass segments around a glowing orb, and one reading in a glass card */
.pl { position: relative; --tone: #8fb0ff; isolation: isolate; }
.pl::before {
  content: ''; position: absolute; z-index: -1; left: 50%; top: 30%; width: 92%; height: 64%; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--tone) 24%, transparent), transparent); pointer-events: none;
}
.pl::after {
  content: ''; position: absolute; z-index: -1; left: 50%; bottom: 8%; width: 70%; height: 34%; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--tone) 16%, transparent), transparent); pointer-events: none;
}
.pl-dial { position: relative; width: 100%; max-width: 420px; aspect-ratio: 360 / 228; margin: 0 auto; }
.pl-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pl-wedge { cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* solid colors faded as one layer, so the soft-corner stroke does not double up over the fill */
.pl-wedge-in { opacity: .82; }
.pl-wedge.on .pl-wedge-in { opacity: .94; }
.pl-w { fill: url(#plGlass); stroke: url(#plGlass); stroke-width: 10; stroke-linejoin: round; transition: opacity .15s; }
.pl-wedge.on .pl-w { fill: url(#plGlassOn); stroke: url(#plGlassOn); }
.pl-wedge:active .pl-w { opacity: .82; }
.pl-edge { fill: none; stroke: rgba(255, 255, 255, .2); stroke-width: 1; stroke-linecap: round; }
.pl-wedge.on .pl-edge { stroke: rgba(230, 238, 255, .75); }
.pl-prog { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; opacity: .9; }
.pl-orb-glow { fill: url(#plOrbGlow); pointer-events: none; }
.pl-orb { fill: url(#plOrb); }
.pl-orb-g { pointer-events: none; transform-box: fill-box; transform-origin: center; animation: plBreathe 4.6s ease-in-out infinite; }
.pl-orb-ring { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 2; }
.pl-orb-fill { fill: none; stroke: var(--tone); stroke-width: 2.6; stroke-linecap: round; }
.pl-orb-ico { position: absolute; left: 50%; top: 28.07%; transform: translate(-50%, -50%); display: grid; place-items: center; color: #1b1838; pointer-events: none; }
.pl-orb-ico svg { width: 26px; height: 26px; stroke-width: 2.2; }
.pl-seg {
  position: absolute; translate: -50% -50%; display: grid; justify-items: center; gap: 4px; width: 68px; padding: 8px 0;
  border: 0; border-radius: 14px; background: none; color: rgba(214, 226, 255, .66); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.pl-seg i { display: grid; place-items: center; }
.pl-seg i svg { width: 18px; height: 18px; }
.pl-seg span { font-size: 9.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.pl-seg.on { color: #fff; }
.pl-seg.on i { color: var(--seg); filter: drop-shadow(0 0 6px var(--seg)); }
.pl-seg:focus-visible { outline: 2px solid var(--tone); outline-offset: 2px; }
.pl-card {
  position: relative; margin: 6px 0 0; padding: 16px 18px 8px; border-radius: 26px; color: #eef2ff;
  background: linear-gradient(155deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .035) 55%, rgba(255, 255, 255, .07));
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 24px 48px -20px rgba(0, 0, 0, .65);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
}
.pl-head { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.pl-head small { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(214, 226, 255, .78); }
.pl-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: rgba(214, 226, 255, .55); }
.pl-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 8px var(--tone); }
.pl-act {
  margin-left: auto; min-height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07); color: #eef2ff; font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.pl-act:active { background: rgba(255, 255, 255, .14); }
.pl-big { display: flex; align-items: baseline; gap: 7px; margin-top: 8px; }
.pl-big b { font-family: var(--font-display, inherit); font-size: 48px; font-weight: 400; line-height: 1; letter-spacing: -.02em; color: #f6f8ff; font-variant-numeric: tabular-nums; }
.pl-big b.pl-none { font-size: 30px; color: rgba(240, 244, 255, .8); }
.pl-big em { font-style: normal; font-size: 14px; color: rgba(214, 226, 255, .6); }
.pl-delta { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; font-size: 12.5px; color: rgba(214, 226, 255, .72); }
.pl-delta i { font-style: normal; font-size: 9px; color: rgba(214, 226, 255, .5); }
.pl-delta.up i { color: var(--accent); }
.pl-chart { display: block; width: 100%; height: auto; margin-top: 2px; overflow: visible; }
.pl-base { stroke: rgba(255, 255, 255, .08); stroke-width: 1; }
.pl-target { stroke: rgba(255, 255, 255, .26); stroke-width: 1; stroke-dasharray: 3 4; }
.pl-tlabel, .pl-tick { fill: rgba(214, 226, 255, .5); font-size: 10px; font-family: inherit; }
.pl-empty { fill: rgba(214, 226, 255, .45); font-size: 11.5px; font-family: inherit; }
.pl-area { fill: url(#plFill); }
.pl-glowline { fill: none; stroke: var(--tone); stroke-width: 7; stroke-linecap: round; opacity: .16; }
.pl-line { fill: none; stroke: var(--tone); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pl-drop { stroke: var(--tone); stroke-width: 1; stroke-dasharray: 2 3; opacity: .4; }
.pl-dot { fill: #fff; stroke: var(--tone); stroke-width: 2.4; }
.pl-halo-dot { fill: var(--tone); opacity: .25; transform-box: fill-box; transform-origin: center; animation: plDot 2.4s ease-in-out infinite; }
/* picking a segment: it lifts out, the reading rises, the curve draws itself */
.pl.pl-anim .pl-wedge.on .pl-wedge-in { animation: plLift .5s cubic-bezier(.2, .9, .3, 1.25) both; }
.pl.pl-anim .pl-seg.on { animation: plSeg .5s cubic-bezier(.2, .9, .3, 1.25) both; }
.pl.pl-anim .pl-big, .pl.pl-anim .pl-delta { animation: plRise .45s cubic-bezier(.2, .8, .2, 1) both; }
.pl.pl-anim .pl-delta { animation-delay: .06s; }
.pl.pl-anim .pl-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: plDraw 1s cubic-bezier(.3, .7, .2, 1) .08s forwards; }
.pl.pl-anim :is(.pl-area, .pl-glowline, .pl-dot, .pl-drop) { animation: plFade .8s ease-out .3s both; }
.pl.pl-anim .pl-orb-ico { animation: plIco .5s cubic-bezier(.2, .9, .3, 1.3) both; }
@keyframes plLift { from { transform: translate(0, 0); } }
@keyframes plSeg { from { opacity: .4; } }
@keyframes plRise { from { opacity: 0; transform: translateY(8px); } }
@keyframes plDraw { to { stroke-dashoffset: 0; } }
@keyframes plFade { from { opacity: 0; } }
@keyframes plIco { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } }
@keyframes plBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes plDot { 0%, 100% { transform: scale(.8); opacity: .3; } 50% { transform: scale(1.3); opacity: .1; } }
/* light theme: the dial keeps its night sky, like the body above it */
[data-theme="light"] .pl { padding: 12px 12px 14px; border-radius: var(--m-radius); background: radial-gradient(70% 50% at 50% 30%, rgba(52, 96, 240, .22), transparent 72%), #0a1330; overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .pl-orb-g, .pl-halo-dot { animation: none !important; }
  .pl.pl-anim * { animation: none !important; }
}
[data-motion="reduced"] :is(.pl-orb-g, .pl-halo-dot), [data-motion="reduced"] .pl.pl-anim * { animation: none !important; }

/* Device matrix 2026-10-19, touch targets: "Took all" draws 28px tall (the negative margins keep the row tight); the halo makes the hit area 44px. */
.pk-cap .sl-pill { position: relative; }
.pk-cap .sl-pill::after { content: ''; position: absolute; inset: -8px -4px; border-radius: 999px; }
