/* Clarity Resident app — port of "Clarity Resident.dc.html" (Claude Design handoff). Mounted by demo/resident.js inside the ios-frame. */

.res-app { height: 100%; position: relative; font-family: Manrope, system-ui, sans-serif; color: #0D1B1E; background: #FFFFFF; line-height: normal; text-align: left; }
.res-app, .res-app * { box-sizing: border-box; }
.res-app button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; text-align: inherit; line-height: normal; letter-spacing: inherit; -webkit-appearance: none; appearance: none; cursor: pointer; }
.res-app [hidden] { display: none !important; }

.res-main { position: absolute; inset: 0; display: flex; flex-direction: column; }
.res-scroll, .res-dscroll { scrollbar-width: none; }
.res-scroll::-webkit-scrollbar, .res-dscroll::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- Header + tabs ---------- */
.res-head { flex-shrink: 0; padding: 60px 20px 0; }
.res-greet { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: #6B7B80; }
.res-title { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; margin-top: 2px; }
.res-tabs { display: flex; gap: 5px; margin-top: 14px; }
.res-app .res-tab { padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: #F2F7F8; color: #5C6B70; border: 1px solid #E7EDEE; }
.res-app .res-tab.is-on { background: #0F3B47; color: #FFFFFF; border-color: #0F3B47; }

.res-scroll { flex: 1; overflow: auto; padding: 16px 18px 34px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Today ---------- */
.res-hero { padding: 19px; border-radius: 24px; background: linear-gradient(150deg, rgba(8,26,42,0.58) 0%, rgba(8,26,42,0.32) 100%), url(../assets/beach-sunset.jpg) center 30% / cover; color: #FFFFFF; display: flex; align-items: center; gap: 16px; }
.res-ring { width: 88px; height: 88px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(#9BF5C6 0turn 0.86turn, rgba(255,255,255,0.25) 0.86turn 1turn); display: flex; align-items: center; justify-content: center; }
.res-ring-in { width: 71px; height: 71px; border-radius: 50%; background: rgba(8,20,32,0.72); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.res-ring-num { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.res-ring-of { font-size: 8.5px; font-weight: 800; letter-spacing: 0.14em; opacity: 0.7; margin-top: 3px; }
.res-hero-text { flex: 1; min-width: 0; }
.res-hero-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: 0.13em; opacity: 0.82; }
.res-hero-h { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.25; margin-top: 5px; }
.res-hero-sub { font-size: 12.5px; line-height: 1.45; opacity: 0.85; margin-top: 6px; font-weight: 500; }

.res-sechead { display: flex; align-items: baseline; justify-content: space-between; padding: 6px 2px 0; }
.res-sectitle { font-size: 17px; font-weight: 800; letter-spacing: -0.025em; }

.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

.res-tile { perspective: 900px; cursor: pointer; height: 186px; }
.res-tile-in { position: relative; width: 100%; height: 100%; }
.res-face { position: absolute; inset: 0; transition: opacity 320ms ease; padding: 14px 15px; border-radius: 20px; display: flex; flex-direction: column; gap: 8px; }
.res-front { opacity: 1; background: #FFFFFF; border: 1px solid #DCE6E8; box-shadow: 0 2px 10px rgba(13,27,30,0.06); }
.res-back { opacity: 0; background: #0F3B47; color: #FFFFFF; }
.res-tile.is-flipped .res-front { opacity: 0; }
.res-tile.is-flipped .res-back { opacity: 1; }

.res-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.res-tile-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; color: #4A5A5E; text-transform: uppercase; }
.res-tile-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.res-tile-val { display: flex; align-items: baseline; gap: 4px; }
.res-tile-num { font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: #0B1417; }
.res-tile-unit { font-size: 11.5px; font-weight: 700; color: #6B7B80; }
.res-spark { position: relative; height: 36px; margin-top: auto; }
.res-spark svg { position: absolute; inset: 0; width: 100%; height: 36px; display: inline; }
.res-spark-dot { position: absolute; right: 0; width: 8px; height: 8px; border-radius: 50%; }
.res-tile-note { font-size: 11px; font-weight: 700; }

.res-back-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; color: #8FD8E0; text-transform: uppercase; }
.res-bstats { display: flex; gap: 12px; }
.res-bstat-v { font-size: 15px; font-weight: 800; letter-spacing: -0.03em; }
.res-bstat-k { font-size: 8.5px; font-weight: 800; letter-spacing: 0.07em; color: rgba(255,255,255,0.6); text-transform: uppercase; margin-top: 2px; }
.res-back-short { font-size: 10.5px; line-height: 1.4; color: rgba(255,255,255,0.82); font-weight: 500; }

/* ---------- Range segmented control (Trends + detail) ---------- */
.res-seg { display: flex; gap: 5px; padding: 4px; border-radius: 14px; background: #F2F7F8; }
.res-app .res-seg-btn { flex: 1; text-align: center; padding: 8px 0; border-radius: 11px; font-size: 12.5px; font-weight: 700; background: transparent; color: #7C8A8E; }
.res-app .res-seg-btn.is-on { background: #FFFFFF; color: #0D1B1E; }

/* ---------- Trends ---------- */
.res-trow { padding: 14px 15px; border-radius: 18px; background: #FFFFFF; border: 1px solid #E7EDEE; display: flex; align-items: center; gap: 14px; cursor: pointer; }
.res-trow:hover { border-color: #BFDDE6; box-shadow: 0 6px 18px rgba(13,27,30,0.07); }
.res-trow-main { flex: 1; min-width: 0; }
.res-trow-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; opacity: 0.85; text-transform: uppercase; }
.res-trow-val { display: flex; align-items: baseline; gap: 5px; margin-top: 3px; }
.res-trow-avg { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.res-trow-unit { font-size: 11px; font-weight: 600; opacity: 0.75; }
.res-trow-delta { font-size: 11.5px; font-weight: 700; opacity: 0.92; margin-top: 4px; }
.res-tbars { display: flex; align-items: flex-end; gap: 2px; height: 44px; width: 124px; }
.res-bar { flex: 1; border-radius: 2px; }

/* ---------- Device ---------- */
.res-dev-card { padding: 18px; border-radius: 24px; background: #FFFFFF; border: 1px solid #E7EDEE; display: flex; align-items: center; gap: 14px; }
.res-dev-img { width: 120px; height: 120px; max-width: none; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 12px 22px rgba(0,0,0,0.45)); }
.res-dev-text { flex: 1; min-width: 0; }
.res-dev-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: 0.13em; opacity: 0.82; }
.res-dev-name { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; margin-top: 3px; }
.res-dev-sub { font-size: 12px; opacity: 0.82; font-weight: 500; margin-top: 2px; }
.res-dev-pill { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 6px 11px; border-radius: 999px; background: #EAF7F3; color: #2C6B5E; }
.res-dev-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: #9BF5C6; }
.res-dev-pill-t { font-size: 11px; font-weight: 700; }

.res-card { padding: 16px; border-radius: 20px; background: #FFFFFF; border: 1px solid #E7EDEE; }
.res-card-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: 0.09em; opacity: 0.85; }
.res-card-big { display: flex; align-items: baseline; gap: 4px; margin-top: 6px; }
.res-card-num { font-size: 33px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.res-card-unit { font-size: 13px; font-weight: 700; opacity: 0.8; }
.res-batt { height: 8px; border-radius: 99px; background: #EEF3F4; margin-top: 11px; overflow: hidden; }
.res-batt-fill { height: 100%; background: linear-gradient(90deg, #9BF5C6, #6FD3C7); border-radius: 99px; }
.res-card-foot { font-size: 12px; font-weight: 600; opacity: 0.88; margin-top: 9px; }
.res-wbars { display: flex; align-items: flex-end; gap: 2.5px; height: 34px; margin-top: 9px; }

.res-drows { padding: 6px 16px; border-radius: 20px; background: #FFFFFF; border: 1px solid #E7EDEE; }
.res-drow { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #F1F5F6; }
.res-drow-ic { width: 28px; height: 28px; border-radius: 10px; flex-shrink: 0; }
.res-drow-main { flex: 1; min-width: 0; }
.res-drow-k { font-size: 13.5px; font-weight: 700; }
.res-drow-sub { font-size: 11.5px; opacity: 0.75; font-weight: 500; margin-top: 1px; }
.res-drow-v { font-size: 12.5px; font-weight: 700; flex-shrink: 0; opacity: 0.95; }

.res-care { padding: 17px 18px; border-radius: 20px; background: linear-gradient(135deg, #0F3B47 0%, #17555F 100%); color: #FFFFFF; }
.res-care-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; color: #3E9FD1; }
.res-care-title { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; margin-top: 5px; }
.res-care-body { font-size: 13px; line-height: 1.5; color: #5C6B70; margin-top: 5px; font-weight: 500; }

/* ---------- Notes ---------- */
.res-note { padding: 16px 17px; border-radius: 20px; background: #FFFFFF; border: 1px solid #E7EDEE; }
.res-note-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.res-note-kindwrap { display: inline-flex; align-items: center; gap: 7px; }
.res-note-dot { width: 7px; height: 7px; border-radius: 50%; }
.res-note-kind { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.9; }
.res-note-when { font-size: 11px; font-weight: 600; opacity: 0.7; }
.res-note-title { font-size: 17px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.3; margin-top: 7px; }
.res-note-body { font-size: 13px; line-height: 1.55; opacity: 0.86; margin-top: 5px; font-weight: 500; }

/* ---------- Metric detail overlay ---------- */
.res-detail { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: #FFFFFF; }
.res-dhead { flex-shrink: 0; padding: 58px 20px 12px; }
.res-app .res-backbtn { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.res-backbtn-ic { width: 24px; height: 24px; border-radius: 50%; background: #F2F7F8; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #3E9FD1; }
.res-dtitle { font-size: 27px; font-weight: 800; letter-spacing: -0.035em; margin-top: 10px; }
.res-dscroll { flex: 1; overflow: auto; padding: 4px 18px 40px; display: flex; flex-direction: column; gap: 12px; }
.res-dval { display: flex; align-items: baseline; gap: 8px; }
.res-dval-num { font-size: 52px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.res-dval-unit { font-size: 15px; font-weight: 600; color: #8A989C; }
.res-dval-note { margin-left: auto; font-size: 11.5px; font-weight: 800; padding: 6px 12px; border-radius: 999px; }
.res-chart { padding: 16px 14px 12px; border-radius: 22px; background: #FFFFFF; border: 1px solid #E7EDEE; }
.res-chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.res-chart-bars .res-bar { border-radius: 3px; }
.res-chart-axis { display: flex; justify-content: space-between; margin-top: 10px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; color: #9AA7AB; }
.res-dstats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; }
.res-dstat { padding: 13px 10px; border-radius: 16px; background: #F5F9FA; text-align: center; }
.res-dstat-v { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; }
.res-dstat-k { font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; opacity: 0.72; margin-top: 3px; text-transform: uppercase; }
.res-meaning { padding: 17px; border-radius: 20px; background: #F5F9FA; color: #0D1B1E; }
.res-meaning-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: 0.11em; color: #3E9FD1; }
.res-meaning-text { font-size: 14.5px; line-height: 1.6; color: #2A3A3E; margin-top: 8px; font-weight: 500; }
.res-sensor { padding: 16px 17px; border-radius: 20px; background: linear-gradient(135deg, #0F3B47 0%, #17555F 100%); color: #FFFFFF; }
.res-sensor-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; opacity: 0.68; }
.res-sensor-text { font-size: 13.5px; line-height: 1.5; margin-top: 6px; font-weight: 500; opacity: 0.92; }
