/* Damp Diary concept PWA. Two skins on one structure: .ios and .android on <html>. */

:root {
  --ink: #14202B; --paper: #F6F3EC; --teal: #1E6B66; --green: #3E8E5A; --amber: #D9902A; --red: #C2483D;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --ok: #3E8E5A; --watch: #D9902A; --run: #C2483D;
  --ok-text: #2E7347; --watch-text: #9A5F0E; --run-text: #A93A30;
}
.framed.ios { --sat: 54px; --sab: 30px; }
.framed.android { --sat: 34px; --sab: 14px; }

/* ---------- iOS tokens ---------- */
.ios {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --bg: #F3F0E9; --surface: #FFFDF9; --surface2: #ECE7DD; --text: #14202B; --text2: #5D6871; --line: rgba(20, 32, 43, 0.1);
  --accent: #1E6B66; --on-accent: #FFFFFF; --tonal: rgba(30, 107, 102, 0.12); --on-tonal: #1E6B66;
  --bar: rgba(246, 243, 236, 0.8); --tab-off: #8B959D; --tabh: 50px;
  --radius: 20px; --paper-bg: #FFFEFA; --banner: rgba(250, 248, 243, 0.86);
}
/* ---------- Android (Material 3) tokens ---------- */
.android {
  --font: Roboto, "Google Sans", system-ui, sans-serif;
  --bg: #F8F5EE; --surface: #EFEBE2; --surface2: #E6E1D6; --text: #1A1E1F; --text2: #4F5A5C; --line: rgba(26, 30, 31, 0.12);
  --accent: #1E6B66; --on-accent: #FFFFFF; --tonal: #CDE8E3; --on-tonal: #0A2E2B;
  --bar: #ECE7DD; --tab-off: #4F5A5C; --tabh: 80px;
  --radius: 16px; --paper-bg: #FFFDF8; --banner: #F1EDE4;
}

/* ---------- dark ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]).ios {
    --bg: #0C1218; --surface: #18222B; --surface2: #232F39; --text: #F2EEE6; --text2: #9EAAB3; --line: rgba(255, 255, 255, 0.1);
    --accent: #6CC6BC; --on-accent: #062522; --tonal: rgba(108, 198, 188, 0.16); --on-tonal: #8ED9D0;
    --bar: rgba(16, 24, 31, 0.78); --tab-off: #7D8891; --paper-bg: #1D2731; --banner: rgba(38, 48, 57, 0.86);
    --ok-text: #74C792; --watch-text: #F0B65A; --run-text: #F08A7E;
  }
  :root:not([data-theme="light"]).android {
    --bg: #11181C; --surface: #1B2429; --surface2: #243037; --text: #E9EEEC; --text2: #A8B4B5; --line: rgba(255, 255, 255, 0.12);
    --accent: #84D4C9; --on-accent: #00332E; --tonal: #234C48; --on-tonal: #C4EDE6;
    --bar: #1B2429; --tab-off: #A8B4B5; --paper-bg: #1F292F; --banner: #26313A;
    --ok-text: #74C792; --watch-text: #F0B65A; --run-text: #F08A7E;
  }
}
:root[data-theme="dark"].ios {
  --bg: #0C1218; --surface: #18222B; --surface2: #232F39; --text: #F2EEE6; --text2: #9EAAB3; --line: rgba(255, 255, 255, 0.1);
  --accent: #6CC6BC; --on-accent: #062522; --tonal: rgba(108, 198, 188, 0.16); --on-tonal: #8ED9D0;
  --bar: rgba(16, 24, 31, 0.78); --tab-off: #7D8891; --paper-bg: #1D2731; --banner: rgba(38, 48, 57, 0.86);
  --ok-text: #74C792; --watch-text: #F0B65A; --run-text: #F08A7E;
}
:root[data-theme="dark"].android {
  --bg: #11181C; --surface: #1B2429; --surface2: #243037; --text: #E9EEEC; --text2: #A8B4B5; --line: rgba(255, 255, 255, 0.12);
  --accent: #84D4C9; --on-accent: #00332E; --tonal: #234C48; --on-tonal: #C4EDE6;
  --bar: #1B2429; --tab-off: #A8B4B5; --paper-bg: #1F292F; --banner: #26313A;
  --ok-text: #74C792; --watch-text: #F0B65A; --run-text: #F08A7E;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none; font-size: 16px; line-height: 1.4;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p, h1, h2, h3 { margin: 0; }
.ic { width: 22px; height: 22px; flex: none; }
.ic.sm { width: 17px; height: 17px; }
.noscript { padding: 24px; }

.app { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
.no-anim, .no-anim * { transition: none !important; }

/* ---------- screens ---------- */
.screens { position: absolute; inset: 0; transform-origin: 50% 0; transition: transform 0.42s cubic-bezier(0.2, 0.9, 0.25, 1), border-radius 0.42s; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding-top: var(--sat); padding-bottom: calc(var(--tabh) + var(--sab) + 28px);
  opacity: 0; transform: translate3d(14px, 0, 0); visibility: hidden; pointer-events: none;
  transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.36s;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }
.screen.active { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity 0.32s ease, transform 0.36s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s; }
.demo .screen { padding-top: calc(var(--sat) + 26px); }
:root { --topband: var(--sat); }
.demo { --topband: calc(var(--sat) + 26px); }
.topband { position: absolute; left: 0; right: 0; top: 0; height: var(--topband); z-index: 4; background: var(--bg); pointer-events: none; }
.ios .topband { background: var(--bar); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); }
.scene-home .topband { display: none; }
.pad { padding: 4px 16px 0; }

/* header */
.hdr { padding: 6px 20px 10px; }
.hdr-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hdr-titles { min-width: 0; }
.hdr-title { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: 0.2px; }
.hdr-sub { color: var(--text2); font-size: 15px; margin-top: 2px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); color: var(--text); flex: none; margin-bottom: 4px; }
.android .hdr { position: sticky; top: 0; padding: 8px 8px 12px 16px; background: var(--bg); z-index: 2; }
.android .hdr-row { align-items: center; min-height: 56px; }
.android .hdr-title { font-size: 24px; font-weight: 400; letter-spacing: 0; }
.android .hdr-sub { font-size: 14px; letter-spacing: 0.1px; }
.android .icon-btn { width: 48px; height: 48px; background: none; margin: 0; }

/* cards */
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; }
.ios .card { box-shadow: 0 1px 0 rgba(20, 32, 43, 0.03); }
.card-title { font-weight: 600; font-size: 15px; }
.android .card-title { font-weight: 500; font-size: 16px; }
.section-title { font-size: 20px; font-weight: 700; margin: 22px 4px 10px; }
.android .section-title { font-size: 16px; font-weight: 500; color: var(--accent); margin: 20px 4px 8px; letter-spacing: 0.1px; }
.fine { font-size: 12.5px; color: var(--text2); margin: 10px 4px 0; line-height: 1.45; }
.body-text { font-size: 15px; line-height: 1.5; color: var(--text); }
.body-text.small { font-size: 13.5px; color: var(--text2); margin: 6px 0 12px; }
.eyebrow { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text2); }
.android .eyebrow { text-transform: none; letter-spacing: 0.1px; font-weight: 500; font-size: 14px; }
.eyebrow-run { color: var(--run-text); }
.big { font-size: 38px; font-weight: 700; line-height: 1.1; margin: 6px 0 8px; letter-spacing: -0.3px; }
.android .big { font-weight: 400; font-size: 36px; letter-spacing: 0; }
.example-tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--watch-text); background: rgba(217, 144, 42, 0.13); padding: 4px 10px; border-radius: 999px; margin: 0 0 10px 2px; }

/* ---------- today: hero ring ---------- */
.hero { text-align: center; padding: 22px 18px 18px; }
.ring-wrap { position: relative; width: 212px; height: 212px; margin: 2px auto 12px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: var(--surface2); stroke-width: 14; }
.ring-stroke { fill: none; stroke-width: 14; stroke-linecap: round; stroke: var(--lv, var(--ok)); transition: stroke 0.8s ease; }
.ring-glow { fill: none; stroke-width: 34; opacity: 0.22; filter: blur(9px); stroke: var(--lv, var(--ok)); transition: stroke 0.8s ease; }
[data-level="ok"] { --lv: var(--ok); } [data-level="watch"] { --lv: var(--watch); } [data-level="run"] { --lv: var(--run); }
[data-level="watch"] .ring-glow, [data-level="run"] .ring-glow { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.16; } 50% { opacity: 0.42; } }
.ring-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-rh { font-size: 58px; font-weight: 700; letter-spacing: -1.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-rh small { font-size: 26px; font-weight: 600; letter-spacing: 0; margin-left: 2px; }
.android .ring-rh { font-weight: 400; }
.ring-t { color: var(--text2); font-size: 16px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.state-name { font-size: 22px; font-weight: 700; transition: color 0.5s; }
.android .state-name { font-weight: 500; }
[data-level="ok"] .state-name { color: var(--ok-text); }
[data-level="watch"] .state-name { color: var(--watch-text); }
[data-level="run"] .state-name { color: var(--run-text); }
.state-msg { color: var(--text); font-size: 15px; line-height: 1.45; margin: 6px auto 10px; max-width: 300px; }
.meta { font-size: 12.5px; color: var(--text2); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid2 .card { margin: 0; }
.tile { padding: 14px 14px 13px; }
.tile-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text2); }
.tile-value { font-size: 24px; font-weight: 650; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.android .tile-value { font-weight: 500; }
.tile-sub { font-size: 12px; color: var(--text2); line-height: 1.3; }

.device { display: flex; gap: 14px; align-items: center; padding: 12px; }
.device-img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; flex: none; }
.device-name { font-weight: 600; font-size: 15px; }
.device-sub { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text2); margin-top: 3px; }
.device-note { font-size: 11px; color: var(--text2); margin-top: 4px; opacity: 0.8; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 500; transition: background 0.25s, color 0.25s; }
.android .chip { border-radius: 8px; border: 1px solid var(--line); background: transparent; height: 34px; padding: 0 14px; }
.chip .chip-tick { width: 0; margin-right: -6px; opacity: 0; transition: width 0.25s, margin 0.25s, opacity 0.25s; }
.chip.done { background: var(--tonal); color: var(--on-tonal); }
.android .chip.done { border-color: transparent; }
.chip.done .chip-tick { width: 17px; margin-right: 0; opacity: 1; }

/* ---------- tomorrow ---------- */
.forecast-card .body-text { color: var(--text2); }
.strip-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.legend { font-size: 12px; color: var(--text2); display: flex; align-items: center; gap: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.dot-ok { background: var(--ok); } .dot-watch { background: var(--watch); } .dot-run { background: var(--run); }
.strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; height: 112px; align-items: end; }
.bar { height: 100%; display: flex; align-items: flex-end; border-radius: 4px; position: relative; }
.bar span { display: block; width: 100%; height: var(--h); border-radius: 5px 5px 3px 3px; transform-origin: 50% 100%; }
.bar-ok span { background: var(--ok); opacity: 0.85; }
.bar-watch span { background: var(--watch); }
.bar-run span { background: var(--run); }
.bar.sel::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--text); }
.strip.play .bar span { animation: grow 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; animation-delay: calc(var(--i) * 28ms); }
@keyframes grow { from { transform: scaleY(0.02); } to { transform: scaleY(1); } }
.ticks { display: grid; grid-template-columns: repeat(24, 1fr); margin-top: 12px; font-size: 11px; color: var(--text2); }
.ticks span { grid-column: calc(var(--i) + 1) / span 3; }
.hour-detail { font-size: 13.5px; color: var(--text2); margin-top: 10px; line-height: 1.45; min-height: 40px; }
.hour-detail b { color: var(--text); }
.lvl-ok { color: var(--ok-text); } .lvl-watch { color: var(--watch-text); } .lvl-run { color: var(--run-text); font-weight: 600; }

.list { padding: 0; overflow: hidden; }
.list.flat { margin-bottom: 8px; }
.todo { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 16px; position: relative; cursor: pointer; }
.todo + .todo::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; height: 1px; background: var(--line); }
.todo input { position: absolute; opacity: 0; pointer-events: none; }
.todo .box { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s; }
.android .todo .box { width: 20px; height: 20px; border-radius: 3px; border-color: var(--text2); margin: 2px; }
.todo .box .ic { transform: scale(0.4); transition: transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1); }
.todo.done .box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.todo.done .box .ic { transform: scale(1); }
.todo-text { font-size: 15px; line-height: 1.35; flex: 1; }
.todo.done .todo-text { color: var(--text2); }
.todo-cta { font-size: 14px; font-weight: 600; color: var(--accent); }
.android .todo-cta { font-weight: 500; }
.todo.action.done .todo-cta { opacity: 0; }

/* ---------- diary ---------- */
.verdict .verdict-word { color: var(--accent); }
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 14px; }
.num { background: var(--surface2); border-radius: 14px; padding: 10px 10px 11px; }
.num-v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.android .num-v { font-weight: 500; }
.num-l { font-size: 11.5px; color: var(--text2); line-height: 1.3; margin-top: 2px; }
.verdict .body-text { font-size: 14px; color: var(--text2); }
.days { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; height: 150px; align-items: end; margin-top: 14px; }
.day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; }
.day-val { font-size: 11px; color: var(--text2); font-variant-numeric: tabular-nums; }
.day-bar { width: 100%; max-width: 26px; height: var(--h); background: linear-gradient(180deg, var(--watch), #C27A20); border-radius: 6px 6px 3px 3px; transform-origin: 50% 100%; }
.day-lab { font-size: 11px; color: var(--text2); }
.days.play .day-bar { animation: grow 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; animation-delay: calc(var(--i) * 70ms); }
.log-head { display: flex; justify-content: space-between; align-items: center; }
.verified { display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ok-text); }
.log { border-top: 1px solid var(--line); margin-bottom: 14px; }
.log-row { display: grid; grid-template-columns: 1.6fr 0.9fr 0.8fr 1.1fr 1fr; gap: 6px; font-size: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.log-time { color: var(--text2); }
.log-out { color: var(--text2); }
.log-sig { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--text2); font-size: 11px; }
.events-card { display: none; }
.events-card.has { display: block; }
.ev { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 8px; color: var(--text); }
.ev .ic { color: var(--ok-text); }

/* ---------- letter ---------- */
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface2); border-radius: 10px; padding: 2px; margin-bottom: 12px; }
.seg-btn { position: relative; z-index: 1; font-size: 13px; font-weight: 600; padding: 8px 6px; border-radius: 8px; color: var(--text2); transition: color 0.25s; line-height: 1.2; }
.seg-btn.on { color: var(--text); }
.seg-thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); border-radius: 8px; background: var(--surface); box-shadow: 0 2px 6px rgba(20, 32, 43, 0.14); transition: transform 0.34s cubic-bezier(0.2, 0.9, 0.25, 1); }
.seg[data-kind="social"] .seg-thumb { transform: translateX(100%); }
.android .seg { background: transparent; border: 1px solid var(--text2); border-radius: 20px; padding: 0; overflow: hidden; }
.android .seg-btn { border-radius: 0; font-weight: 500; padding: 10px 6px; }
.android .seg-btn + .seg-btn { border-left: 1px solid var(--text2); }
.android .seg-thumb { top: 0; bottom: 0; left: 0; width: 50%; border-radius: 0; background: var(--tonal); box-shadow: none; }
.android .seg-btn.on { color: var(--on-tonal); }
.paper { background: var(--paper-bg); padding: 20px 18px; box-shadow: 0 1px 2px rgba(20, 32, 43, 0.06), 0 8px 24px rgba(20, 32, 43, 0.05); }
.letter-text { margin: 0; white-space: pre-wrap; word-wrap: break-word; font-family: Georgia, "Iowan Old Style", "Times New Roman", serif; font-size: 14px; line-height: 1.6; color: var(--text); }
.btn-row { display: flex; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 14px; font-size: 16px; font-weight: 600; flex: 1; transition: transform 0.15s, opacity 0.2s; }
.btn:active { transform: scale(0.97); }
.android .btn { height: 42px; border-radius: 21px; font-size: 14px; font-weight: 500; letter-spacing: 0.1px; }
.btn.filled { background: var(--accent); color: var(--on-accent); }
.btn.tonal { background: var(--tonal); color: var(--on-tonal); }
.btn.danger { background: rgba(194, 72, 61, 0.12); color: var(--run-text); }
.btn.wide { width: 100%; margin-top: 10px; flex: none; }

/* ---------- tab bar ---------- */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; height: calc(var(--tabh) + var(--sab)); padding-bottom: var(--sab); background: var(--bar); }
.ios .tabbar { -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%); border-top: 0.5px solid var(--line); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--tab-off); }
.ios .tab .ic { width: 25px; height: 25px; }
.ios .tab-label { font-size: 10.5px; font-weight: 500; letter-spacing: 0.1px; }
.ios .tab.on { color: var(--accent); }
.ios .tab.on .ic path, .ios .tab.on .ic rect { stroke-width: 2.2; }
.android .tab { gap: 4px; padding-top: 4px; }
.android .tab-ic { position: relative; width: 64px; height: 32px; display: grid; place-items: center; }
.android .tab-ic::before { content: ""; position: absolute; inset: 0; border-radius: 16px; background: var(--tonal); transform: scaleX(0.3); opacity: 0; transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.25, 1), opacity 0.2s; }
.android .tab-ic .ic { position: relative; width: 24px; height: 24px; }
.android .tab-label { font-size: 12px; font-weight: 500; letter-spacing: 0.4px; }
.android .tab.on { color: var(--text); }
.android .tab.on .tab-ic { color: var(--on-tonal); }
.android .tab.on .tab-ic::before { transform: scaleX(1); opacity: 1; }
.android .tab.on .tab-label { font-weight: 700; }

/* ---------- sheets ---------- */
.scrim { position: absolute; inset: 0; z-index: 8; background: rgba(8, 12, 16, 0.38); opacity: 0; pointer-events: none; transition: opacity 0.35s; }
.sheet-open .scrim { opacity: 1; pointer-events: auto; }
.ios.sheet-open .screens { transform: translateY(calc(var(--sat) * 0.25)) scale(0.94); border-radius: 14px; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; max-height: calc(100% - var(--sat) - 12px); overflow-y: auto;
  background: var(--surface); border-radius: 14px 14px 0 0; padding-bottom: calc(var(--sab) + 18px);
  transform: translate3d(0, 105%, 0); transition: transform 0.46s cubic-bezier(0.2, 0.9, 0.25, 1); box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
}
.ios .sheet { background: var(--bg); }
.android .sheet { border-radius: 28px 28px 0 0; background: var(--bg); }
.sheet.open { transform: none; }
.sheet-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 4px; }
.android .sheet-grab { width: 32px; height: 4px; margin: 16px auto 8px; background: var(--text2); opacity: 0.4; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 16px 10px 20px; }
.sheet-title { font-size: 17px; font-weight: 600; }
.android .sheet-title { font-size: 22px; font-weight: 400; }
.sheet-body { padding: 0 16px; }
.sheet .card { background: var(--surface); }
.alert-top { display: flex; align-items: center; gap: 14px; background: rgba(194, 72, 61, 0.1); border-radius: var(--radius); padding: 16px; margin-bottom: 6px; }
.alert-dot { position: relative; width: 14px; height: 14px; border-radius: 50%; background: var(--run); flex: none; }
.alert-dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--run); animation: ping 1.8s ease-out infinite; }
@keyframes ping { from { transform: scale(0.5); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }
.alert-title { font-size: 20px; font-weight: 700; color: var(--run-text); }
.android .alert-title { font-weight: 500; }
.alert-time { font-size: 13px; color: var(--text2); }
.mini-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text2); margin: 18px 4px 8px; }
.android .mini-title { text-transform: none; font-size: 14px; font-weight: 500; letter-spacing: 0.1px; color: var(--accent); }
.why { background: var(--surface); border-radius: var(--radius); padding: 4px 16px; }
.why-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 14.5px; }
.why-row + .why-row { border-top: 1px solid var(--line); }
.why-row span { color: var(--text2); }
.why-row b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.android .why-row b { font-weight: 500; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 46px; right: 0; height: 1px; background: var(--line); }
.row-ic { color: var(--accent); }
.row-text { flex: 1; min-width: 0; }
.row-label { font-size: 15px; }
.row-value { font-size: 13px; color: var(--text2); }
.row-chev { color: var(--text2); opacity: 0.6; }
.about { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text2); margin-top: 14px; line-height: 1.45; }
.about .ic { margin-top: 1px; }

/* ---------- notification banner ---------- */
.banner {
  position: absolute; z-index: 20; left: 8px; right: 8px; top: calc(var(--sat) + 6px);
  display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; cursor: pointer;
  background: var(--banner); border-radius: 22px; box-shadow: 0 14px 40px rgba(8, 12, 16, 0.22);
  transform: translate3d(0, calc(-100% - var(--sat) - 24px), 0); transition: transform 0.6s cubic-bezier(0.2, 1.25, 0.35, 1);
}
.ios .banner { -webkit-backdrop-filter: blur(26px) saturate(190%); backdrop-filter: blur(26px) saturate(190%); }
.banner.show { transform: none; }
.banner-icon { width: 38px; height: 38px; border-radius: 9px; flex: none; }
.banner-text { flex: 1; min-width: 0; }
.banner-app { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); }
.ios .banner-app span:first-child { display: none; }
.ios .banner-app { position: absolute; right: 14px; top: 12px; }
.banner-title { font-weight: 600; font-size: 15px; padding-right: 36px; display: flex; align-items: center; gap: 6px; }
.banner-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--watch); flex: none; }
.banner[data-level="run"] .banner-title::before { background: var(--run); }
.banner-body { font-size: 15px; line-height: 1.32; margin-top: 1px; }
.banner-actions { display: none; }
.android .banner { left: 8px; right: 8px; border-radius: 24px; padding: 14px 16px 10px; gap: 12px; }
.android .banner-icon { width: 24px; height: 24px; border-radius: 50%; margin-top: 0; }
.android .banner-app { justify-content: flex-start; gap: 4px; font-size: 12px; }
.android .banner-title { font-weight: 500; font-size: 15px; margin-top: 4px; padding-right: 0; }
.android .banner-body { font-size: 14px; color: var(--text2); }
.android .banner-actions { display: flex; gap: 22px; margin-top: 10px; font-size: 14px; font-weight: 500; color: var(--accent); }

/* ---------- toast / snackbar ---------- */
.toast {
  position: absolute; z-index: 12; left: 50%; bottom: calc(var(--tabh) + var(--sab) + 14px); max-width: calc(100% - 32px);
  transform: translate3d(-50%, 16px, 0); opacity: 0; pointer-events: none;
  background: rgba(20, 32, 43, 0.92); color: #F6F3EC; padding: 11px 16px; border-radius: 14px; font-size: 14px; line-height: 1.35;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.25, 1), opacity 0.25s; width: max-content;
}
.android .toast { border-radius: 4px; background: #2F3638; color: #EEF1EF; left: 16px; right: 16px; width: auto; max-width: none; transform: translate3d(0, 16px, 0); }
.toast.show { opacity: 1; transform: translate3d(-50%, 0, 0); }
.android .toast.show { transform: none; }
.sheet-open .toast { z-index: 30; bottom: calc(var(--sab) + 18px); }

/* ---------- demo layer ---------- */
.demo-ui { position: absolute; inset: 0; z-index: 25; pointer-events: none; }
.demo-progress { position: absolute; left: 0; right: 0; top: var(--sat); height: 3px; background: rgba(30, 107, 102, 0.12); }
.demo-progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.demo-badge, .demo-paused {
  position: absolute; top: calc(var(--sat) + 7px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 11px; font-weight: 600; letter-spacing: 0.2px; color: var(--watch-text); background: rgba(217, 144, 42, 0.14); padding: 3px 10px; border-radius: 999px;
}
.demo-paused { color: #F6F3EC; background: rgba(20, 32, 43, 0.86); opacity: 0; transition: opacity 0.2s; }
.paused .demo-paused { opacity: 1; }
.demo-caption {
  position: absolute; left: 50%; bottom: calc(var(--tabh) + var(--sab) + 14px); transform: translate3d(-50%, 10px, 0); opacity: 0;
  max-width: calc(100% - 40px); width: max-content; text-align: center;
  background: rgba(20, 32, 43, 0.9); color: #F6F3EC; font-size: 13px; font-weight: 600; padding: 9px 15px; border-radius: 999px;
}
.demo-caption.show { animation: capIn 0.45s cubic-bezier(0.2, 0.9, 0.25, 1) forwards; }
@keyframes capIn { from { opacity: 0; transform: translate3d(-50%, 10px, 0); } to { opacity: 1; transform: translate3d(-50%, 0, 0); } }
.sheet-open .demo-caption { bottom: calc(var(--sab) + 18px); }
.interstitial { position: absolute; inset: 0; display: grid; place-items: center; background: #14202B; opacity: 0; transition: opacity 0.5s ease; }
.interstitial p { color: #F6F3EC; font-family: Georgia, serif; font-size: 32px; transform: translate3d(0, 10px, 0); transition: transform 0.7s cubic-bezier(0.2, 0.9, 0.25, 1); }
.interstitial.show { opacity: 1; }
.interstitial.show p { transform: none; }
.tapdot { position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.45); border: 2px solid rgba(255, 255, 255, 0.95); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25); opacity: 0; }
.tapdot.go { animation: tap 0.95s ease-out forwards; }
@keyframes tap { 0% { opacity: 0; scale: 1.4; } 25% { opacity: 1; scale: 0.8; } 45% { opacity: 1; scale: 0.7; } 100% { opacity: 0; scale: 1.5; } }

/* ---------- home-screen scene (for the notification shot) ---------- */
.scene-home .app { background: #14202B; }
.home-scene { position: absolute; inset: 0; background:
  radial-gradient(120% 70% at 15% 10%, rgba(30, 107, 102, 0.85), transparent 60%),
  radial-gradient(90% 60% at 90% 85%, rgba(217, 144, 42, 0.55), transparent 65%),
  linear-gradient(160deg, #1B2C38, #0E161D); padding: calc(var(--sat) + 70px) 26px 0; }
.ios .home-scene { padding-top: calc(var(--sat) + 132px); }
.android .home-scene { padding-top: calc(var(--sat) + 128px); }
.hs-clock { color: #F6F3EC; text-align: center; margin-bottom: 34px; }
.hs-time { font-size: 64px; font-weight: 300; letter-spacing: -1px; line-height: 1; }
.hs-date { font-size: 15px; opacity: 0.8; margin-top: 6px; }
.hs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px 18px; justify-items: center; }
.hs-app { width: 60px; height: 60px; border-radius: 15px; background: rgba(246, 243, 236, calc(0.1 + (var(--k, 3) * 0.012))); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); position: relative; }
.android .hs-app { border-radius: 50%; width: 56px; height: 56px; }
.hs-dd { background: none; box-shadow: none; }
.hs-dd img { width: 100%; height: 100%; border-radius: inherit; }
.hs-dd em { position: absolute; top: 66px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 12px; color: #F6F3EC; white-space: nowrap; }
.hs-dock { position: absolute; left: 14px; right: 14px; bottom: calc(var(--sab) + 12px); display: flex; justify-content: space-around; padding: 14px; border-radius: 30px; background: rgba(246, 243, 236, 0.14); }
.android .hs-dock { background: none; }

/* ---------- motion preferences and still captures ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
.still *, .still *::before, .still *::after { transition: none !important; animation: none !important; }
.still .banner { transition: none !important; }

/* small phones */
@media (max-width: 360px) {
  .hdr-title { font-size: 30px; }
  .android .hdr-title { font-size: 22px; }
  .ring-wrap { width: 184px; height: 184px; }
  .ring-rh { font-size: 50px; }
  .num-v { font-size: 17px; }
  .big { font-size: 32px; }
  .seg-btn { font-size: 12px; }
  .grid2 { gap: 10px; }
}

/* larger screens: keep the phone width */
@media (min-width: 640px) {
  body { background: #E9E4DA; }
  .app { left: 50%; right: auto; width: 430px; transform: translateX(-50%); box-shadow: 0 0 0 1px rgba(20, 32, 43, 0.08), 0 30px 80px rgba(20, 32, 43, 0.18); }
  .framed .app { left: 0; width: 100%; transform: none; box-shadow: none; }
}
