/* =========================================================
   Home Care PWA — Warm Clinical Design
   ========================================================= */
:root {
  --bg: #FBF6EE;
  --bg-2: #F5ECDF;
  --hero: #F3E6D3;
  --card: #FFFDF9;
  --line: #EADFCF;
  --line-2: #E2D3BE;
  --ink: #2A2722;
  --ink-2: #5E574C;
  --ink-3: #8F8577;
  --green: #3F8F6B;
  --green-d: #2C6B4F;
  --green-l: #DCEFDF;
  --green-b: #7FB892;
  --mint: #A6E3D3;
  --mint-d: #2E7F6B;
  --coral: #DE6050;
  --coral-l: #FCE6E1;
  --amber: #D99A2B;
  --amber-l: #FBEFD6;
  --blue: #3D7CC9;
  --blue-l: #E3EEFB;
  --r: 22px;
  --r-s: 14px;
  --shadow: 0 1px 2px rgba(80, 60, 30, .05), 0 6px 20px -8px rgba(80, 60, 30, .14);
  --shadow-lg: 0 24px 60px -18px rgba(50, 35, 10, .35);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: 'IBM Plex Sans Thai Looped', 'Sukhumvit Set', 'Noto Sans Thai Looped', 'Leelawadee UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green-d); }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.3; margin: 0; }

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: linear-gradient(180deg, var(--hero), var(--bg)); z-index: 100; transition: opacity .35s; }
.splash img { border-radius: 24px; box-shadow: var(--shadow); }
.splash-name { font-weight: 700; font-size: 22px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line-2); border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.app { min-height: 100vh; max-width: 640px; margin: 0 auto; position: relative; padding-bottom: calc(86px + var(--safe-b)); }
.view { padding: 0 16px 24px; outline: none; }
.view.enter { animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; padding: calc(10px + var(--safe-t)) 16px 10px; background: rgba(251, 246, 238, .88); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); display: flex; align-items: center; gap: 10px; min-height: 56px; border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar.hero-mode { position: relative; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; min-height: 0; }
.topbar .back { width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; font-size: 20px; cursor: pointer; }
.topbar h1 { font-size: 21px; font-weight: 700; flex: 1; }
.topbar .act { border: 0; background: var(--green); color: #fff; border-radius: 14px; padding: 9px 14px; font-weight: 600; font-size: 15px; cursor: pointer; }

.hero { margin: 0 -16px 18px; padding: calc(62px + var(--safe-t)) 22px 24px; background: linear-gradient(180deg, #EFDDC3 0%, var(--hero) 55%, #F7EEE2 100%); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -40px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(127, 184, 146, .25), transparent 70%); }
.hero-title { display: flex; align-items: center; gap: 12px; font-size: clamp(25px, 7.4vw, 31px); font-weight: 700; letter-spacing: -.3px; }
.hero-title .em { font-size: 36px; }
.hero-tag { margin-top: 10px; font-size: 19px; color: var(--ink); }
.hero-sub { font-size: 15.5px; color: var(--ink-2); }
.hero-user { position: absolute; right: 16px; top: calc(14px + var(--safe-t)); z-index: 1; display: flex; gap: 8px; align-items: center; background: rgba(255, 253, 249, .75); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 5px; font-size: 14px; text-decoration: none; color: var(--ink); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.hero-date { font-size: 14px; color: var(--ink-3); margin-top: 8px; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.tile { background: var(--card); border: 1.5px solid var(--line-2); border-radius: var(--r); padding: 18px 10px 16px; text-align: center; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; font-size: 17px; transition: transform .12s, box-shadow .2s, background .2s; position: relative; min-height: 112px; justify-content: center; }
.tile:active { transform: scale(.97); }
.tile .ic { font-size: 32px; line-height: 1; }
.tile.on { background: var(--green-l); border-color: var(--green-b); }
.tile .badge { position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--coral); color: #fff; font-size: 13px; display: grid; place-items: center; font-weight: 700; }

.pushline { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; color: var(--ink-2); margin: 4px 2px 18px; }
.pushline.warn { background: var(--amber-l); border: 1px solid #F0D9A6; padding: 12px 14px; border-radius: var(--r-s); color: #6E4C0C; cursor: pointer; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-h h2 { font-size: 20px; font-weight: 700; flex: 1; display: flex; align-items: center; gap: 10px; }
.card-h .link { font-size: 15px; text-decoration: none; color: var(--green-d); font-weight: 600; }
.muted { color: var(--ink-3); font-size: 15px; }
.small { font-size: 14px; }
.empty { text-align: center; padding: 26px 10px; color: var(--ink-3); }
.empty .ic { font-size: 44px; display: block; margin-bottom: 6px; }

.numlist { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.numlist li { counter-increment: n; padding: 16px 0; border-bottom: 1px solid var(--line); }
.numlist li:last-child { border-bottom: 0; }
.numlist b { display: block; font-size: 18px; }
.numlist b::before { content: counter(n) '. '; }
.numlist span { color: var(--ink-2); }

/* ---------- dose timeline ---------- */
.slot { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--line-2); }
.slot:last-child { border-bottom: 0; padding-bottom: 2px; }
.slot-time { width: 64px; flex: none; text-align: center; }
.slot-time b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.slot-time span { font-size: 12.5px; color: var(--ink-3); }
.slot.now .slot-time b { color: var(--coral); }
.slot.done .slot-time b { color: var(--green); }
.slot-body { flex: 1; min-width: 0; }
.dose { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.dose .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(0, 0, 0, .04); }
.dose .nm { flex: 1; min-width: 0; }
.dose .nm b { font-weight: 600; }
.dose .nm small { display: block; color: var(--ink-3); font-size: 14px; }
.dose.taken .nm b { text-decoration: line-through; text-decoration-color: rgba(63, 143, 107, .5); color: var(--ink-2); }
.dose.skipped .nm b { color: var(--ink-3); }
.chk { width: 44px; height: 44px; flex: none; border-radius: 14px; border: 2px solid var(--line-2); background: #fff; font-size: 20px; display: grid; place-items: center; cursor: pointer; transition: all .15s; }
.chk.on { background: var(--green); border-color: var(--green); color: #fff; }
.chk.skip { background: #F1ECE4; border-color: var(--line-2); color: var(--ink-3); font-size: 15px; }
.slot-actions { display: flex; gap: 8px; margin-top: 8px; }

.btn { border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 600; font-size: 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: transform .1s, filter .15s; min-height: 52px; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; }
.btn-block { width: 100%; }
.btn-p { background: var(--green); color: #fff; box-shadow: 0 6px 16px -6px rgba(44, 107, 79, .6); }
.btn-mint { background: var(--mint); color: #134E40; border: 1.5px solid #8DD3C0; }
.btn-soft { background: #F6EBDD; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-ghost { background: transparent; color: var(--green-d); border: 1.5px solid var(--line-2); }
.btn-danger { background: var(--coral-l); color: #A33A2C; border: 1.5px solid #F3C4BA; }
.btn-s { padding: 8px 14px; min-height: 40px; font-size: 15px; border-radius: 12px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* ---------- next appointment ---------- */
.appt-next { display: flex; gap: 14px; align-items: center; }
.cal { width: 64px; flex: none; border-radius: 16px; overflow: hidden; text-align: center; border: 1px solid var(--line-2); background: #fff; }
.cal .m { background: var(--coral); color: #fff; font-size: 12.5px; font-weight: 700; padding: 3px 0; }
.cal .d { font-size: 26px; font-weight: 700; line-height: 1.25; padding: 2px 0 0; }
.cal .w { font-size: 12px; color: var(--ink-3); padding-bottom: 4px; }
.countdown { display: inline-block; background: var(--blue-l); color: var(--blue); padding: 3px 11px; border-radius: 999px; font-size: 14px; font-weight: 600; margin-top: 4px; }
.countdown.soon { background: var(--coral-l); color: #B03C2D; }

.appt { display: flex; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); margin-bottom: 12px; box-shadow: var(--shadow); cursor: pointer; }
.appt.past { opacity: .62; box-shadow: none; }
.appt h3 { font-size: 18px; }
.appt .meta { font-size: 15px; color: var(--ink-2); }

/* ---------- med list ---------- */
.med { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); margin-bottom: 10px; cursor: pointer; }
.med.off { opacity: .55; }
.pill { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 24px; flex: none; }
.med .info { flex: 1; min-width: 0; }
.med .info b { font-size: 17.5px; }
.med .info div { font-size: 14.5px; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.tag { font-size: 13px; padding: 2px 9px; border-radius: 999px; background: var(--bg-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tag.g { background: var(--green-l); color: var(--green-d); }
.tag.r { background: var(--coral-l); color: #A33A2C; }

.daynav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.daynav button { width: 42px; height: 42px; border-radius: 13px; border: 1px solid var(--line); background: var(--card); font-size: 18px; cursor: pointer; }
.daynav .lbl { flex: 1; text-align: center; font-weight: 600; }

/* ---------- adherence ---------- */
.bars { display: flex; gap: 6px; align-items: flex-end; height: 86px; margin-top: 6px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: var(--green-l); position: relative; overflow: hidden; height: 64px; }
.bars .b i::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); background: linear-gradient(180deg, #6DB38B, var(--green)); border-radius: inherit; }
.bars .b i.na { background: repeating-linear-gradient(45deg, #F2EADF, #F2EADF 4px, #F8F2E9 4px, #F8F2E9 8px); }
.bars .b span { font-size: 12px; color: var(--ink-3); }
.big-pct { font-size: 34px; font-weight: 700; color: var(--green-d); line-height: 1; }

/* ---------- vitals ---------- */
.vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vcard { border: 1.5px solid var(--line); border-radius: 18px; padding: 14px; background: var(--card); cursor: pointer; text-align: left; }
.vcard.on { border-color: var(--green-b); background: var(--green-l); }
.vcard .t { font-size: 14px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.vcard .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vcard .v small { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.vcard .d { font-size: 12.5px; color: var(--ink-3); }
.meter { height: 14px; border-radius: 8px; background: var(--blue-l); overflow: hidden; margin: 10px 0 6px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, #7DB4F0, var(--blue)); border-radius: inherit; transition: width .4s; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick button { flex: 1; min-width: 80px; }
.vrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.vrow:last-child { border-bottom: 0; }
.vrow .val { font-weight: 700; font-size: 18px; min-width: 90px; font-variant-numeric: tabular-nums; }
.vrow .when { flex: 1; font-size: 14px; color: var(--ink-3); }
.vrow .x { border: 0; background: none; font-size: 18px; color: var(--ink-3); cursor: pointer; padding: 6px; }
.spark { width: 100%; height: 90px; display: block; }
.lvl { font-size: 12.5px; padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.lvl.ok { background: var(--green-l); color: var(--green-d); }
.lvl.hi { background: var(--coral-l); color: #A33A2C; }
.lvl.lo { background: var(--amber-l); color: #8A5A07; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label, .lbl-s { display: block; font-size: 15px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; border: 1.5px solid var(--line-2); background: #fff; border-radius: 14px; padding: 13px 14px; font-size: 17px; outline: none; transition: border .15s, box-shadow .15s; min-height: 52px; appearance: none; -webkit-appearance: none; }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238F8577' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(63, 143, 107, .14); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.grid2 > * { min-width: 0; }
input[type=date].input, input[type=time].input, input[type=datetime-local].input { min-width: 0; max-width: 100%; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line-2); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 15px; cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--green-l); border-color: var(--green-b); color: var(--green-d); font-weight: 600; }
.chip input { display: none; }
.times { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.time-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--green-l); color: var(--green-d); border-radius: 12px; padding: 4px 4px 4px 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.time-pill button { border: 0; background: rgba(255, 255, 255, .7); width: 28px; height: 28px; border-radius: 9px; cursor: pointer; color: var(--ink-2); }
.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors label { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; position: relative; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .06); }
.colors input { display: none; }
.colors input:checked + span { position: absolute; inset: -4px; border-radius: 50%; border: 3px solid var(--ink); }
.switch { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch .tx { flex: 1; }
.switch .tx small { display: block; color: var(--ink-3); font-size: 14px; }
.tg { width: 52px; height: 32px; border-radius: 16px; background: #DDD3C4; position: relative; transition: background .2s; flex: none; }
.tg::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.tg.on { background: var(--green); }
.tg.on::after { transform: translateX(20px); }
.seg { display: flex; background: var(--bg-2); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 11px; padding: 10px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.err { background: var(--coral-l); color: #A33A2C; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 15px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 30px 22px calc(30px + var(--safe-b)); max-width: 460px; margin: 0 auto; }
.auth .logo { width: 84px; height: 84px; border-radius: 24px; box-shadow: var(--shadow); margin: 0 auto 14px; display: block; }
.auth h1 { text-align: center; font-size: 28px; }
.auth .sub { text-align: center; color: var(--ink-2); margin-bottom: 24px; }
.auth .switch-link { text-align: center; margin-top: 16px; color: var(--ink-2); }
.auth .switch-link a { font-weight: 600; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 640px; z-index: 30; display: flex; background: rgba(255, 253, 249, .94); backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b)); }
.tabbar a { flex: 1; text-decoration: none; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 12.5px; font-weight: 600; padding: 6px 0 4px; border-radius: 14px; position: relative; }
.tabbar .ti { font-size: 22px; line-height: 1.2; filter: grayscale(1) opacity(.65); transition: filter .2s, transform .2s; }
.tabbar a.on { color: var(--green-d); background: var(--green-l); }
.tabbar a.on .ti { filter: none; transform: translateY(-1px); }

.fab { position: fixed; right: max(18px, calc(50% - 302px)); bottom: calc(96px + var(--safe-b)); z-index: 25; width: 62px; height: 62px; border-radius: 22px; border: 0; background: var(--green); color: #fff; font-size: 32px; box-shadow: 0 14px 30px -10px rgba(44, 107, 79, .75); cursor: pointer; display: grid; place-items: center; }
.fab:active { transform: scale(.95); }

/* ---------- sheet (bottom modal) ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(40, 30, 15, .42); animation: fade .2s; }
.sheet-panel { position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 20px calc(22px + var(--safe-b)); animation: up .28s cubic-bezier(.2, .9, .3, 1.05); box-shadow: var(--shadow-lg); -webkit-overflow-scrolling: touch; }
.sheet-panel::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 12px; }
.sheet-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sheet-h h2 { flex: 1; font-size: 21px; }
.sheet-h .x { width: 40px; height: 40px; border-radius: 13px; border: 1px solid var(--line); background: var(--card); font-size: 18px; cursor: pointer; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- alarm (center popup like reference) ---------- */
.alarm { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 22px; background: rgba(60, 64, 90, .55); animation: fade .2s; }
.alarm-card { width: 100%; max-width: 400px; background: #FFFBF7; border-radius: 26px; padding: 26px 22px 20px; text-align: center; border: 3px solid #5B8EE6; box-shadow: var(--shadow-lg); animation: pop .32s cubic-bezier(.2, 1.3, .4, 1); }
.alarm-card .bell { font-size: 72px; line-height: 1; display: inline-block; animation: ring 1.4s ease-in-out infinite; transform-origin: 50% 8%; }
.alarm-card h2 { font-size: 27px; margin: 12px 0 6px; }
.alarm-card .desc { color: #7A5B55; font-size: 18px; margin-bottom: 6px; }
.alarm-card .items { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 6px 14px; margin: 14px 0 4px; max-height: 38vh; overflow: auto; }
.alarm-card .items div { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.alarm-card .items div:last-child { border-bottom: 0; }
.alarm-card .btns { display: grid; gap: 10px; margin-top: 18px; }
.alarm-card .btn { font-size: 19px; min-height: 58px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes ring { 0%, 50%, 100% { transform: rotate(0); } 5%, 15%, 25% { transform: rotate(14deg); } 10%, 20%, 30% { transform: rotate(-14deg); } }

/* ---------- install popup ---------- */
.install-hero { text-align: center; padding: 4px 0 6px; }
.install-hero img { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--shadow); }
.install-hero h2 { font-size: 23px; margin: 12px 0 4px; }
.perks { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.perks li { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font-size: 16px; }
.perks li span { font-size: 24px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.steps li::before { content: counter(s); width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; display: grid; place-items: center; flex: none; }
.ios-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #fff; border: 1px solid var(--line-2); vertical-align: middle; margin: 0 2px; }
.pointer { text-align: center; font-size: 30px; animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(8px); } }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); z-index: 90; background: #2A2722; color: #fff; padding: 12px 20px; border-radius: 14px; font-size: 15.5px; box-shadow: var(--shadow-lg); max-width: 90vw; text-align: center; animation: toastIn .25s; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.contact { display: flex; gap: 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact:last-child { border-bottom: 0; }
.contact .ci { width: 52px; height: 52px; border-radius: 16px; background: var(--coral-l); display: grid; place-items: center; font-size: 26px; flex: none; }
.contact .tx { flex: 1; min-width: 0; }
.contact .tx b { display: block; font-size: 17.5px; }
.callbtn { background: var(--green); color: #fff; text-decoration: none; padding: 11px 16px; border-radius: 14px; font-weight: 600; white-space: nowrap; }
.warnlist li { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17.5px; }
.warnlist li::before { content: '⚠️'; }
.warnlist { list-style: none; padding: 0; margin: 0; }
.banner { display: flex; gap: 12px; align-items: center; border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; }
.banner.r { background: var(--coral-l); border: 1px solid #F3C4BA; color: #842F23; }
.banner.a { background: var(--amber-l); border: 1px solid #F0D9A6; color: #6E4C0C; }
.banner.g { background: var(--green-l); border: 1px solid #BFE0C8; color: var(--green-d); }
.banner .ic { font-size: 26px; }
.banner .tx { flex: 1; font-size: 15.5px; }
code.copy { display: block; background: #fff; border: 1px dashed var(--line-2); border-radius: 12px; padding: 10px 12px; font-size: 13px; word-break: break-all; cursor: pointer; margin: 6px 0 10px; }
.hist { font-size: 14.5px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist:last-child { border-bottom: 0; }
.hist small { color: var(--ink-3); display: block; }
.sec-title { font-size: 15px; font-weight: 700; color: var(--ink-3); margin: 22px 4px 10px; letter-spacing: .2px; }

@media (min-width: 680px) {
  .app { padding-top: 10px; }
  .hero { border-radius: 0 0 28px 28px; margin: 0 0 18px; }
  .view { padding: 0 20px 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
