/* Pulse on the phone — the lite layer (2026-10-04). Built from the approved
   mock in ~/Downloads/pulse-mobile-mock/. Lives beside the Mac layout;
   body.lite-on swaps one for the other. Everything is scoped to #lite. */

body.lite-on .app, body.lite-on #authGate { display: none !important; }
body.lite-on { overflow: auto !important; height: auto; min-height: 100vh; background: var(--bg); }
body.lite-on #lite { display: block; }
#lite { display: none; font-size: 15px; line-height: 1.4; color: var(--text); min-height: 100vh; }
#lite a { color: inherit; text-decoration: none; }
#lite svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
#lite button { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left; -webkit-tap-highlight-color: transparent; cursor: pointer; }
#lite input, #lite textarea, #lite select { font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }

/* Frame: content scrolls under a fixed tab bar */
#lite .scr { overflow-x: hidden; padding: calc(6px + env(safe-area-inset-top, 0px)) 16px calc(104px + env(safe-area-inset-bottom, 0px)); max-width: 560px; margin: 0 auto; }
#lite .scr.noTabs { padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
#lite .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(58px + env(safe-area-inset-bottom, 0px)); background: #0d1218; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 6px env(safe-area-inset-bottom, 0px); }
#lite .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--muted); position: relative; }
#lite .tab svg.i { width: 23px; height: 23px; }
#lite .tab.on { color: var(--accent); }
#lite .tab .bdg { position: absolute; top: -2px; left: 50%; margin-left: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #1a0a0a; font: 700 11px/18px -apple-system, sans-serif; text-align: center; }
#lite .tab .dot { position: absolute; top: -1px; left: 50%; margin-left: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); border: 2px solid #0d1218; }

/* Shared pieces */
#lite .top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: 4px; gap: 10px; }
#lite .top h2 { font-size: 26px; font-weight: 700; letter-spacing: -.4px; }
#lite .top h2.mid { font-size: 17px; flex: 1; text-align: center; }
#lite .top .back { display: flex; align-items: center; gap: 2px; color: var(--accent); font-size: 16px; margin-left: -6px; min-width: 50px; }
#lite .top .back svg.i { width: 24px; height: 24px; }
#lite .top .spacer { width: 50px; }
#lite .ico-btn { width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); background: var(--panel); border: 1px solid var(--border); flex-shrink: 0; }
#lite .ico-btn.sm { width: 34px; height: 34px; } #lite .ico-btn.sm svg.i { width: 17px; height: 17px; }
#lite .asof { font-size: 12px; color: var(--muted); }
#lite .card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; }
#lite .lbl { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; }
#lite .sec { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 2px 8px; gap: 10px; }
#lite .sec h3 { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; }
#lite .sec button, #lite .sec a { font-size: 13px; color: var(--accent); font-weight: 500; }
#lite .pill { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .02em; white-space: nowrap; }
#lite .pill.ok { background: var(--ok-soft); color: var(--ok); } #lite .pill.warn { background: var(--warn-soft); color: var(--warn); } #lite .pill.bad { background: var(--bad-soft); color: var(--bad); } #lite .pill.mute { background: rgba(107,125,146,.18); color: var(--text-secondary); }
#lite .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 12px; font-size: 15px; font-weight: 700; border: 1px solid var(--border); background: var(--panel); color: var(--text); white-space: nowrap; }
#lite .btn.pri { background: var(--accent); border-color: var(--accent); color: #0a0e14; }
#lite .btn.sm { height: 34px; font-size: 13px; padding: 0 12px; border-radius: 9px; }
#lite .btn.wide { width: 100%; }
#lite .btn.red { background: var(--bad-soft); border-color: rgba(248,113,113,.4); color: var(--bad); }
#lite .btn[disabled] { opacity: .5; }
#lite .chev { color: var(--muted); width: 18px !important; height: 18px !important; }
#lite .seg { display: flex; background: var(--panel); border: 1px solid var(--border); border-radius: 999px; padding: 3px; margin-bottom: 10px; }
#lite .seg button { flex: 1; text-align: center; font-size: 13px; font-weight: 500; padding: 6px 0; border-radius: 999px; color: var(--text-secondary); }
#lite .seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
#lite .ok { color: var(--ok); } #lite .warn { color: var(--warn); } #lite .bad { color: var(--bad); } #lite .mut { color: var(--muted); } #lite .blue { color: var(--accent); }
#lite .empty { font-size: 14px; color: var(--muted); padding: 14px; }
#lite .loading { padding: 80px 16px; text-align: center; color: var(--muted); font-size: 15px; }
#lite .err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 10px; text-align: center; }
#lite .two { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
#lite .fbot { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; margin-top: 12px; }
#lite .fbot.one { grid-template-columns: 1fr; }

/* rows */
#lite .rows { overflow: hidden; }
#lite .row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); width: 100%; }
#lite .row:last-child { border-bottom: 0; }
#lite .row .ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
#lite .row .g { flex: 1; min-width: 0; }
#lite .row .g b { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
#lite .row .g small { display: block; font-size: 12.5px; color: var(--text-secondary); margin-top: 1px; }
#lite .row .r { text-align: right; flex-shrink: 0; }
#lite .row .r b { display: block; font-size: 15px; font-weight: 700; }
#lite .row .r small { display: block; font-size: 12px; color: var(--muted); }
#lite .kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14.5px; }
#lite .kv:last-child { border-bottom: 0; }
#lite .kv span:first-child { color: var(--text-secondary); flex-shrink: 0; }
#lite .kv span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }
#lite .kv b { font-weight: 600; }
#lite .kv.stack { flex-direction: column; align-items: flex-start; gap: 3px; }
#lite .kv.stack span:last-child { text-align: left; }
#lite .kv small { display: block; font-size: 11.5px; color: var(--muted); }
#lite .yr { font-size: 12px; font-weight: 700; color: var(--muted); margin: 14px 4px 6px; letter-spacing: .06em; }

/* Today */
#lite .status { padding: 11px 13px; margin-top: 8px; }
#lite .status p { font-size: 14px; line-height: 1.42; color: var(--text-secondary); }
#lite .status p b { color: var(--text); }
#lite .status p button { color: var(--bad); font-weight: 700; white-space: nowrap; }
#lite .chips { display: flex; gap: 6px; margin: 9px -16px 0; padding: 0 16px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#lite .chips::-webkit-scrollbar { display: none; }
#lite .chips span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); color: var(--text-secondary); flex-shrink: 0; }
#lite .chips i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
#lite .tiles { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; margin-top: 12px; }
#lite .tile { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 9px 11px 8px; min-height: 92px; display: flex; flex-direction: column; width: 100%; min-width: 0; overflow: hidden; }
#lite .tile.flag { border-color: rgba(248,113,113,.45); }
#lite .tile .t { display: flex; justify-content: space-between; align-items: center; gap: 6px; white-space: nowrap; min-width: 0; }
#lite .tile .t .lbl { overflow: hidden; text-overflow: ellipsis; }
#lite .tile .t .lbl { font-size: 10px; letter-spacing: .06em; }
#lite .tile .v { font-size: 23px; font-weight: 700; line-height: 1; margin-top: 6px; letter-spacing: -.3px; }
#lite .tile .v small { font-size: 11.5px; color: var(--muted); font-weight: 500; margin-left: 3px; letter-spacing: 0; }
#lite .tile svg.sp { width: 100%; height: 20px; margin-top: 5px; display: block; }
#lite .tile .m { font-size: 11px; color: var(--text-secondary); margin-top: auto; padding-top: 5px; display: flex; justify-content: space-between; gap: 6px; white-space: nowrap; min-width: 0; }
#lite .tile .m span { overflow: hidden; text-overflow: ellipsis; }
#lite .bar { height: 6px; border-radius: 3px; background: #1f2a38; margin-top: 10px; position: relative; overflow: hidden; }
#lite .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
#lite .tonic { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin-top: 10px; width: 100%; }
#lite .ring { display: flex; align-items: center; gap: 8px; flex: 1; }
#lite .ring svg { width: 36px; height: 36px; flex-shrink: 0; }
#lite .ring b { display: block; font-size: 16px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
#lite .ring b small { font-size: 11px; color: var(--muted); font-weight: 500; }
#lite .ring span { display: block; font-size: 11px; color: var(--text-secondary); }
#lite .offer { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 12px; border-color: rgba(88,166,255,.45); }
#lite .offer svg { color: var(--accent); }
#lite .offer div { flex: 1; } #lite .offer b { display: block; font-size: 15px; } #lite .offer small { font-size: 12.5px; color: var(--text-secondary); }

/* Sheets */
#lite .dim { position: fixed; inset: 0; background: rgba(5,8,12,.62); z-index: 50; }
#lite .sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--panel-hi); border-top: 1px solid var(--border-light); border-radius: 22px 22px 0 0; padding: 10px 18px calc(28px + env(safe-area-inset-bottom, 0px)); }
#lite .sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border-light); margin: 0 auto 14px; }
#lite .sheet h3 { font-size: 20px; font-weight: 700; }
#lite .sheet h3 small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 8px; }
#lite .sheet .big { font-size: 44px; font-weight: 700; letter-spacing: -1px; line-height: 1; margin-top: 8px; }
#lite .sheet .big small { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
#lite .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
#lite .stat { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; min-width: 0; }
#lite .stat b { display: block; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lite .stat span { font-size: 11px; color: var(--muted); }
#lite .sheet p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.45; margin-top: 8px; }
#lite .sheet p b { color: var(--text); }
#lite .sheet .card { background: var(--panel); }
#lite .menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 4px; border-top: 1px solid var(--border); font-size: 16px; }
#lite .menu-item:first-of-type { border-top: 0; }
#lite .menu-item svg { color: var(--text-secondary); }
#lite .menu-item small { display: block; font-size: 12px; color: var(--muted); }
#lite .menu-item div { flex: 1; }
#lite .tog { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-top: 10px; font-size: 14px; width: 100%; }
#lite .tog div { flex: 1; text-align: left; }
#lite .tog b { font-size: 15px; }
#lite .sw { width: 46px; height: 28px; border-radius: 14px; background: #2d3d52; position: relative; flex-shrink: 0; transition: background .15s; }
#lite .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px; background: #e6edf3; transition: left .15s; }
#lite .sw.on { background: var(--accent); } #lite .sw.on::after { left: 21px; }

/* Log */
#lite .logbtns { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; margin-top: 10px; }
#lite .logbtn { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 14px 12px; min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; position: relative; width: 100%; }
#lite .logbtn.flag { border-color: rgba(248,113,113,.45); }
#lite .logbtn .ic { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
#lite .logbtn b { font-size: 15px; font-weight: 600; margin-top: 10px; display: block; }
#lite .logbtn small { font-size: 12px; color: var(--muted); display: block; }
#lite .logbtn .ndot { position: absolute; top: 12px; right: 12px; }
#lite .field { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; margin-top: 10px; }
#lite .field.on { border-color: var(--accent); }
#lite .field .lbl { display: block; }
#lite .field input, #lite .field textarea, #lite .field select { width: 100%; border: 0; background: transparent; padding: 0; margin-top: 4px; border-radius: 0; }
#lite .field input:focus, #lite .field textarea:focus, #lite .field select:focus { outline: none; }
#lite .field input.big { font-size: 40px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; }
#lite .field input.mid { font-size: 24px; font-weight: 700; }
#lite .field textarea { min-height: 64px; resize: vertical; line-height: 1.4; }
#lite .field .unit { font-size: 13px; color: var(--muted); }
#lite .field .when { font-size: 17px; font-weight: 600; margin-top: 6px; display: flex; justify-content: space-between; align-items: center; }
#lite .field .when span { color: var(--muted); font-weight: 400; }
#lite .field input[type=datetime-local], #lite .field input[type=date], #lite .field input[type=time] { font-size: 16px; margin-top: 6px; }
#lite .chipset { display: flex; gap: 8px; flex-wrap: wrap; }
#lite .chip { font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--text-secondary); }
#lite .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
#lite .scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
#lite .scale button { height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
#lite .scale button.on { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
#lite .week { padding: 10px 14px; margin-top: 6px; }
#lite .week .l { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-secondary); }

/* Visit */
#lite .cardh { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px 6px; }
#lite .cardh small { font-size: 12px; color: var(--muted); }
#lite .chk { display: flex; gap: 11px; padding: 10px 14px; border-bottom: 1px solid var(--border); align-items: flex-start; width: 100%; }
#lite .chk:last-child { border-bottom: 0; }
#lite .chk .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--muted); flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #0a0e14; }
#lite .chk .box.p1 { border-color: var(--bad); } #lite .chk .box.p2 { border-color: var(--warn); } #lite .chk .box.p0 { border-color: var(--ok); }
#lite .chk .box.done { background: var(--ok); border-color: var(--ok); }
#lite .chk .g { flex: 1; min-width: 0; }
#lite .chk .g b { display: block; font-size: 14.5px; font-weight: 600; }
#lite .chk .g small { display: block; font-size: 12px; color: var(--text-secondary); line-height: 1.35; margin-top: 1px; }
#lite .chk.done .g b { color: var(--muted); text-decoration: line-through; }
#lite .chk .when { font-size: 11px; color: var(--muted); white-space: nowrap; margin-top: 3px; }
#lite .hcard { padding: 12px 14px; display: block; width: 100%; }
#lite .hcard .big { font-size: 30px; font-weight: 700; letter-spacing: -.5px; line-height: 1; margin-top: 6px; }
#lite .hcard .big small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; letter-spacing: 0; }
#lite .hcard .sub { font-size: 12px; color: var(--text-secondary); margin-top: 6px; line-height: 1.4; }
#lite .labs .kv { padding: 9px 14px; }

/* Record */
#lite .search { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); color: var(--muted); font-size: 15px; margin: 6px 0 12px; }
#lite .search svg.i { width: 18px; height: 18px; }
#lite .search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); outline: none; padding: 0; }
#lite .search input::placeholder { color: var(--muted); }
#lite .marker { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
#lite .marker:last-child { border-bottom: 0; }
#lite .marker small { display: block; font-size: 11.5px; color: var(--muted); }
#lite .marker b { font-weight: 700; white-space: nowrap; }
#lite .note { white-space: pre-wrap; font-size: 14px; color: var(--text-secondary); line-height: 1.45; padding: 11px 14px; }

/* Lock */
#lite .lock { padding: 100px 26px 0; text-align: center; max-width: 420px; margin: 0 auto; }
#lite .lock .appico { width: 86px; height: 86px; border-radius: 22px; background: none; object-fit: cover; margin: 0 auto 22px; display: flex; align-items: center; justify-content: center; }
#lite .lock h3 { font-size: 30px; font-weight: 700; }
#lite .lock p { color: var(--text-secondary); margin: 8px 0 32px; font-size: 15px; }
#lite .lock input { width: 100%; height: 52px; padding: 0 14px; border-radius: 12px; margin-bottom: 10px; }
#lite .lock .btn { width: 100%; height: 52px; font-size: 16px; }
#lite .lock .alt { display: block; width: 100%; text-align: center; color: var(--accent); font-size: 15px; font-weight: 600; padding: 14px 0; }
#lite .lock .fine { font-size: 12px; color: var(--muted); margin-top: 18px; }

/* A Mac panel (Trends, Insights, Settings…) shown inside the phone, with a way back */
body.lite-panel .app { display: flex !important; }
body.lite-panel .sidebar { display: none !important; }
body.lite-panel .main { margin-left: 0 !important; padding: 0 14px 40px !important; height: auto !important; overflow: visible !important; }
body.lite-panel .main > .header { padding-top: 10px; position: static; }
body.lite-panel #lite { display: none !important; }
body.lite-panel { overflow: auto !important; height: auto; }
.lite-panelbar { display: none; }
body.lite-panel .lite-panelbar { display: flex; align-items: center; gap: 6px; height: calc(44px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 10px 0; background: var(--bg); border-bottom: 1px solid var(--border); font-size: 16px; color: var(--accent); position: sticky; top: 0; z-index: 30; }
.lite-panelbar button { font: inherit; color: inherit; background: none; border: 0; display: flex; align-items: center; gap: 2px; padding: 8px 4px; }
.lite-panelbar b { color: var(--text); font-size: 15px; margin-left: 6px; }
@media (min-width: 769px) { .nav button[data-id="phone"] { display: none; } }
