:root {
  color-scheme: light;
  --primary: #087e8b;
  --primary-strong: #075e68;
  --primary-soft: #e5f4f3;
  --success: #168a68;
  --success-soft: #e7f5ef;
  --warning: #a96816;
  --warning-soft: #fff5df;
  --danger: #b5473c;
  --danger-soft: #fcece9;
  --ink: #172b35;
  --ink-2: #51656e;
  --ink-3: #73858c;
  --canvas: #f3f7f8;
  --surface: #fff;
  --line: #dce7e9;
  --shadow: 0 12px 28px rgba(34, 69, 76, 0.09);
  --radius: 20px;
  --ease: 220ms cubic-bezier(.2, .75, .25, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; background: #dfe9ea; color: var(--ink); }

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(8, 126, 139, .28); outline-offset: 2px; }

.prototype-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 28px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.82), transparent 30%),
    radial-gradient(circle at 88% 82%, rgba(8,126,139,.13), transparent 28%),
    #dfe9ea;
}

.scenario-panel {
  width: 304px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 28px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 24px 60px rgba(34, 69, 76, .14);
  backdrop-filter: blur(18px);
}

.scenario-panel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.scenario-panel h1 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.02em; }
.scenario-panel > p { margin: 12px 0 20px; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.eyebrow { color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.scenario-close { display: none !important; }
.scenario-list { display: grid; gap: 10px; }
.scenario-option {
  width: 100%; min-height: 68px; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); text-align: left; cursor: pointer; transition: var(--ease);
}
.scenario-option:hover { border-color: #9ccbd0; transform: translateY(-1px); }
.scenario-option:active { transform: scale(.985); }
.scenario-option.is-active { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.scenario-option__index { color: var(--primary); font-size: 12px; font-weight: 800; }
.scenario-option strong, .scenario-option small { display: block; }
.scenario-option strong { font-size: 15px; }
.scenario-option small { margin-top: 4px; color: var(--ink-2); font-size: 12px; }
.scenario-note { display: flex; gap: 9px; margin: 18px 0; padding: 12px; color: var(--ink-2); background: #edf3f4; border-radius: 14px; font-size: 12px; line-height: 1.5; }
.scenario-note svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }

.phone-frame {
  width: 403px; height: min(874px, calc(100vh - 40px)); padding: 6px;
  border-radius: 42px; background: #162b32; box-shadow: 0 28px 80px rgba(30, 58, 64, .28);
}
.phone-screen { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 36px; background: var(--canvas); }
.status-bar { height: 26px; flex: 0 0 26px; display: flex; align-items: center; justify-content: space-between; padding: 6px 22px 0; font-size: 12px; font-weight: 700; background: var(--surface); }
.status-icons { display: flex; align-items: center; gap: 6px; }
.status-icons svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.battery { display: grid; place-items: center; width: 25px; height: 13px; border: 1.5px solid var(--ink); border-radius: 4px; font-size: 8px; }
.app-header { height: 62px; flex: 0 0 62px; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding: 0 12px; border-bottom: 1px solid #edf2f3; background: var(--surface); z-index: 5; }
.app-title-wrap { text-align: center; }
.app-title-wrap h2 { margin: 1px 0 0; font-size: 17px; }
.prototype-tag { display: inline-flex; color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 14px; background: transparent; cursor: pointer; transition: var(--ease); }
.icon-button:hover { background: var(--primary-soft); }
.icon-button:active { background: #d6ecea; }
.icon-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-back.is-hidden { visibility: hidden; pointer-events: none; }
.scenario-trigger { display: none; }

.app-content { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; scroll-behavior: smooth; }
.app-content.is-modal-open { overflow: hidden; }
.page { min-height: 100%; padding: 20px 18px 32px; animation: page-in var(--ease); }
.page--with-nav { padding-bottom: 32px; }
@keyframes page-in { from { opacity: .2; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.bottom-nav { height: 72px; flex: 0 0 72px; display: grid; grid-template-columns: repeat(4,1fr); padding: 5px 8px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); z-index: 5; }
.bottom-nav.is-hidden { display: none; }
.bottom-nav button { min-width: 64px; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-3); font-size: 11px; cursor: pointer; transition: var(--ease); }
.bottom-nav button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav button.is-active { color: var(--primary); font-weight: 700; background: var(--primary-soft); }

.toast { position: absolute; left: 50%; bottom: 88px; z-index: 20; max-width: calc(100% - 40px); padding: 11px 16px; border-radius: 12px; color: #fff; background: rgba(23,43,53,.92); font-size: 13px; opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: var(--ease); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.section-kicker { margin: 0 0 5px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.page-heading { margin: 0; font-size: 27px; line-height: 1.22; letter-spacing: -.04em; }
.page-subtitle { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.section-title { margin: 24px 2px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-title h3 { margin: 0; font-size: 17px; }
.section-title span, .section-title button { color: var(--ink-2); font-size: 12px; }

.card { border: 1px solid rgba(210,225,227,.9); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card-button { width: 100%; border: 1px solid rgba(210,225,227,.9); text-align: left; cursor: pointer; transition: var(--ease); }
.card-button:hover { border-color: #a9d1d5; }
.card-button:active { transform: scale(.99); }
.card-pad { padding: 17px; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 4px 9px; border-radius: 999px; color: var(--primary-strong); background: var(--primary-soft); font-size: 11px; font-weight: 750; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--success { color: #09674b; background: var(--success-soft); }
.badge--warning { color: #8c5512; background: var(--warning-soft); }
.badge--danger { color: #943c33; background: var(--danger-soft); }
.badge--neutral { color: var(--ink-2); background: #edf2f3; }
.meta { color: var(--ink-2); font-size: 12px; line-height: 1.55; }
.divider { height: 1px; margin: 15px 0; background: var(--line); }

.primary-button, .secondary-button, .text-button {
  min-height: 48px; border-radius: 14px; font-weight: 750; cursor: pointer; transition: var(--ease);
}
.primary-button { border: 1px solid var(--primary); color: #fff; background: var(--primary); box-shadow: 0 8px 18px rgba(8,126,139,.2); }
.primary-button:hover { background: var(--primary-strong); }
.primary-button:active { transform: scale(.985); }
.primary-button:disabled { border-color: #9eb1b5; background: #9eb1b5; box-shadow: none; cursor: not-allowed; }
.secondary-button { border: 1px solid #b9cfd2; color: var(--primary-strong); background: #fff; }
.secondary-button:hover { background: var(--primary-soft); }
.secondary-button:active { transform: scale(.985); }
.text-button { border: 0; color: var(--primary-strong); background: transparent; }
.full-width { width: 100%; }
.button-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 18px; }

.home-hero { padding: 3px 2px 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.home-hero h2 { margin: 0; font-size: 26px; letter-spacing: -.04em; }
.home-hero p { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }
.avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(145deg,var(--primary),#55aeb5); font-weight: 800; }
.course-selector { margin: 0 0 14px; }
.course-selector__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 8px; }
.course-selector__head strong { font-size: 13px; }
.course-selector__head span { color: var(--ink-3); font-size: 10px; }
.course-selector__rail { display: grid; grid-template-columns: 34px minmax(0,1fr) 34px; align-items: center; gap: 5px; }
.course-selector__grid { min-width: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.course-arrow { width: 34px; min-height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid #cfdee0; border-radius: 12px; color: var(--primary-strong); background: #fff; cursor: pointer; }
.course-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.course-arrow--previous svg { transform: rotate(180deg); }
.course-arrow:disabled { color: #aab9bc; background: #edf2f3; cursor: default; opacity: .7; }
.course-choice { position: relative; min-width: 0; min-height: 94px; padding: 12px 10px; overflow: hidden; border: 1px solid #cedde0; border-radius: 16px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; transition: var(--ease); }
.course-choice:hover { border-color: #8fc3c8; }
.course-choice.is-active { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.course-choice > span, .course-choice > strong, .course-choice > small { display: block; }
.course-choice > span { font-size: 12px; font-weight: 800; }
.course-choice > strong { margin-top: 5px; font-size: 17px; }
.course-choice > small { margin-top: 4px; overflow: hidden; color: var(--ink-3); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.course-choice > i { position: absolute; top: 10px; right: 8px; color: var(--primary-strong); font-size: 8px; font-style: normal; font-weight: 750; }

.course-overview { padding: 20px; color: #fff; border-color: transparent; background: linear-gradient(145deg,#075e68,#118592); overflow: hidden; position: relative; }
.course-overview::after { content: ''; position: absolute; right: -44px; bottom: -66px; width: 170px; height: 170px; border: 28px solid rgba(255,255,255,.07); border-radius: 50%; }
.course-overview__top { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.course-overview__label { color: rgba(255,255,255,.76); font-size: 12px; font-weight: 650; }
.course-count { display: flex; align-items: baseline; gap: 7px; margin-top: 4px; }
.course-count strong { font-size: 46px; line-height: 1; letter-spacing: -.06em; }
.course-count span { color: rgba(255,255,255,.8); font-size: 15px; font-weight: 700; }
.course-status { padding: 6px 10px; border: 1px solid rgba(255,255,255,.28); border-radius: 999px; background: rgba(255,255,255,.12); font-size: 11px; font-weight: 750; }
.course-progress-track { position: relative; z-index: 1; height: 8px; margin-top: 18px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.18); }
.course-progress-track div { height: 100%; border-radius: inherit; background: #fff; }
.course-progress-meta { position: relative; z-index: 1; display: flex; justify-content: space-between; margin-top: 8px; color: rgba(255,255,255,.72); font-size: 11px; }
.course-overview__link { position: relative; z-index: 1; display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 12px; color: rgba(255,255,255,.9); font-size: 11px; font-weight: 700; }
.course-overview__link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

.section-title--compact { margin-top: 19px; margin-bottom: 10px; }
.next-treatment-card { padding: 17px; display: grid; grid-template-columns: 48px 1fr; gap: 4px 12px; align-items: center; }
.next-treatment-icon { width: 48px; height: 48px; display: grid; place-items: center; grid-row: 1; border-radius: 16px; color: var(--primary); background: var(--primary-soft); }
.next-treatment-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.next-treatment-copy { min-width: 0; }
.next-treatment-copy span { display: block; color: var(--ink-2); font-size: 11px; }
.next-treatment-copy strong { display: block; margin-top: 4px; font-size: 18px; line-height: 1.35; }
.next-treatment-card .primary-button { grid-column: 1 / -1; margin-top: 12px; }

.lease-meta-strip { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 5px; border: 0; color: var(--ink-3); background: transparent; text-align: left; cursor: pointer; }
.lease-meta-strip svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.lease-meta-strip > span:not(.lease-meta-link) { flex: 1; font-size: 11px; }
.lease-meta-link { color: var(--primary-strong); font-size: 11px; font-weight: 700; }

.lease-card { padding: 17px; overflow: hidden; position: relative; }
.lease-card::after { content: ''; position: absolute; right: -28px; top: -35px; width: 108px; height: 108px; border-radius: 50%; background: rgba(255,255,255,.22); }
.lease-card--active { color: #fff; border-color: transparent; background: linear-gradient(135deg,#087e8b,#126c76); }
.lease-card--warning { background: linear-gradient(135deg,#fff9e9,#fff); border-color: #f0d294; }
.lease-card--expired { background: linear-gradient(135deg,#f7eeee,#fff); border-color: #e9c8c4; }
.lease-card__top, .device-row, .record-card__head, .timeline-item__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lease-card h3 { margin: 8px 0 2px; font-size: 21px; }
.lease-card--active .meta { color: rgba(255,255,255,.78); }
.lease-days { position: relative; z-index: 1; font-size: 30px; font-weight: 800; letter-spacing: -.04em; }
.lease-days small { display: block; margin-top: -2px; font-size: 10px; font-weight: 600; opacity: .74; text-align: right; }

.device-card { padding: 15px 16px; display: flex; align-items: center; gap: 12px; }
.device-icon { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 15px; color: var(--primary); background: var(--primary-soft); }
.device-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.device-copy { flex: 1; min-width: 0; }
.device-copy strong { display: block; font-size: 15px; }
.device-copy span { display: block; margin-top: 4px; color: var(--ink-2); font-size: 12px; }
.device-copy small { display: block; margin-top: 7px; color: var(--ink-3); font-size: 10px; line-height: 1.4; }
.chevron { width: 20px; height: 20px; fill: none; stroke: var(--ink-3); stroke-width: 1.8; }

.connection-page .section-title { margin-top: 24px; }
.bound-device-card { width: 100%; min-height: 94px; padding: 16px; display: flex; align-items: center; gap: 12px; text-align: left; }
.bound-device-card.is-connected { border-color: rgba(27,139,117,.35); background: linear-gradient(135deg,#fff,#effaf7); }
.bound-device-card:disabled { cursor: wait; opacity: .86; }
.bound-device-card .badge { flex: 0 0 auto; }
.connection-loading { margin: 12px 5px 0; }
.connected-device-status { margin-top: 14px; padding: 17px; }
.connected-device-status__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.connected-device-status__head span { color: var(--ink-3); font-size: 10px; }
.device-status-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 14px 0; }
.device-status-grid div { min-width: 0; padding: 11px; border-radius: 12px; background: #f1f6f6; }
.device-status-grid dt { color: var(--ink-3); font-size: 9px; }
.device-status-grid dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--primary-strong); font-size: 13px; font-weight: 800; }
.connected-device-status .info-strip { margin: 0; }
.empty-bound-device { min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.empty-bound-device strong { margin-top: 12px; }
.empty-bound-device p { margin: 7px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.add-device-button { margin-top: 18px; }
.connection-footnote { margin: 10px 8px 0; color: var(--ink-3); font-size: 10px; line-height: 1.5; text-align: center; }
.bluetooth-search-visual { position: relative; width: 154px; height: 154px; display: grid; place-items: center; margin: 24px auto; }
.bluetooth-search-visual > span { position: absolute; inset: 0; border: 1px solid rgba(8,126,139,.18); border-radius: 50%; }
.bluetooth-search-visual > span:nth-child(2) { inset: 22px; }
.bluetooth-search-visual > div { position: relative; z-index: 1; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 27px; color: #fff; background: linear-gradient(145deg,var(--primary),var(--primary-strong)); box-shadow: 0 16px 30px rgba(8,126,139,.2); }
.bluetooth-search-visual svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bluetooth-search-visual.is-scanning > span { animation: search-pulse 1.5s ease-out infinite; }
.bluetooth-search-visual.is-scanning > span:nth-child(2) { animation-delay: .45s; }
@keyframes search-pulse { 0% { transform: scale(.72); opacity: .9; } 100% { transform: scale(1.08); opacity: 0; } }
.search-status, .search-result { padding: 17px; }
.search-status p { margin: 7px 0 12px; color: var(--ink-2); font-size: 12px; }
.search-result .primary-button, .search-result .secondary-button { margin-top: 16px; }
.search-button { margin-top: 4px; }

.task-card { padding: 19px; color: #fff; border: 0; background: linear-gradient(145deg,#173f49,#087e8b); overflow: hidden; position: relative; }
.task-card::before { content: ''; position: absolute; width: 160px; height: 160px; right: -62px; bottom: -94px; border: 24px solid rgba(255,255,255,.07); border-radius: 50%; }
.task-card__label { color: rgba(255,255,255,.72); font-size: 12px; }
.task-card h3 { position: relative; margin: 9px 0 5px; font-size: 25px; }
.task-card p { position: relative; margin: 0; color: rgba(255,255,255,.78); font-size: 13px; }
.task-card .primary-button { position: relative; margin-top: 18px; width: 100%; border-color: #fff; color: var(--primary-strong); background: #fff; box-shadow: none; }

.progress-card { padding: 17px; }
.progress-row { display: flex; justify-content: space-between; align-items: flex-end; }
.progress-row strong { font-size: 22px; }
.progress-track { height: 8px; margin: 12px 0 7px; border-radius: 999px; overflow: hidden; background: #e7eff0; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--primary),#43aab2); }
.progress-labels { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 11px; }

.record-card { padding: 16px; }
.record-card h3 { margin: 0; font-size: 17px; }
.record-slots { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin: 15px 0; }
.record-slot { height: 7px; border-radius: 999px; background: #dfe9ea; }
.record-slot.is-filled { background: var(--success); }
.record-preview { display: grid; grid-template-columns: 1.2fr .8fr .7fr; gap: 8px; padding: 12px; border-radius: 14px; background: #f4f8f8; font-size: 12px; }
.record-preview span { color: var(--ink-2); }
.record-preview strong { display: block; margin-top: 3px; color: var(--ink); font-size: 13px; }
.info-strip { display: flex; gap: 10px; margin-top: 13px; padding: 12px; border-radius: 14px; color: var(--primary-strong); background: var(--primary-soft); font-size: 12px; line-height: 1.55; }
.info-strip svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }

.onboarding-page { display: flex; flex-direction: column; min-height: 100%; }
.step-dots { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-bottom: 26px; }
.step-dot { height: 4px; border-radius: 999px; background: #dbe5e7; }
.step-dot.is-active { background: var(--primary); }
.onboarding-visual { height: 200px; margin: 18px 0 24px; display: grid; place-items: center; position: relative; }
.onboarding-orbit { width: 168px; height: 168px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); box-shadow: inset 0 0 0 24px rgba(255,255,255,.62); }
.onboarding-orbit svg { width: 84px; height: 84px; fill: none; stroke: var(--primary); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.orbit-pulse { position: absolute; width: 198px; height: 198px; border: 1px solid rgba(8,126,139,.2); border-radius: 50%; animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { transform: scale(.82); opacity: 0; } 35% { opacity: 1; } 100% { transform: scale(1.08); opacity: 0; } }
.onboarding-actions { margin-top: auto; padding-top: 24px; }
.lease-summary { margin-top: 18px; padding: 16px; }
.lease-summary dl { margin: 0; display: grid; gap: 12px; }
.lease-summary div { display: flex; justify-content: space-between; gap: 16px; }
.lease-summary dt { color: var(--ink-2); font-size: 13px; }
.lease-summary dd { margin: 0; font-size: 13px; font-weight: 700; }
.device-found { margin: 20px 0; padding: 16px; border: 1.5px solid var(--primary); border-radius: 18px; background: var(--surface); }
.loading-line { height: 4px; margin-top: 13px; overflow: hidden; border-radius: 999px; background: #dce8e9; }
.loading-line::after { content: ''; display: block; width: 42%; height: 100%; border-radius: inherit; background: var(--primary); animation: loading 1s infinite ease-in-out; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(340%); } }
.success-mark { width: 78px; height: 78px; display: grid; place-items: center; margin: 24px auto; border-radius: 50%; color: #fff; background: var(--success); box-shadow: 0 14px 30px rgba(22,138,104,.22); }
.success-mark svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.check-list { display: grid; gap: 10px; margin-top: 20px; }
.check-item { min-height: 58px; display: flex; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; }
.check-item input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--primary); }
.check-item span { font-size: 13px; line-height: 1.55; }
.safety-note { margin-top: 15px; padding: 13px; border-left: 3px solid var(--warning); border-radius: 0 12px 12px 0; color: #71460f; background: var(--warning-soft); font-size: 12px; line-height: 1.6; }

.guide-tabs { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin: 18px 0; }
.guide-tab { min-height: 44px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 700; cursor: pointer; }
.guide-tab.is-active { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }
.body-guide { padding: 18px; text-align: center; }
.body-illustration { height: 248px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 18px; background: linear-gradient(180deg,#eef7f7,#f9fbfb); overflow: hidden; }
.body-illustration svg { width: 210px; height: 240px; }
.body-guide h3 { margin: 0; font-size: 20px; }
.body-guide p { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.65; }

.record-list { display: grid; gap: 10px; margin-top: 18px; }
.record-row { padding: 15px; }
.record-row__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.record-row__top strong { font-size: 15px; }
.record-fields { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 14px; }
.record-field { padding: 10px; border-radius: 12px; background: #f4f8f8; }
.record-field span { display: block; color: var(--ink-3); font-size: 10px; }
.record-field strong { display: block; margin-top: 4px; font-size: 13px; }
.empty-record { min-height: 80px; display: grid; place-items: center; border: 1px dashed #c9d9dc; border-radius: 16px; color: var(--ink-3); background: rgba(255,255,255,.58); font-size: 12px; }

.timeline { position: relative; display: grid; gap: 12px; margin-top: 18px; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 12px; bottom: 14px; width: 2px; background: #d5e2e4; }
.timeline-item { position: relative; margin-left: 34px; padding: 15px; }
.timeline-item::before { content: ''; position: absolute; left: -28px; top: 18px; width: 12px; height: 12px; border: 3px solid var(--canvas); border-radius: 50%; background: #bccbce; box-shadow: 0 0 0 1px #bccbce; }
.timeline-item.is-complete::before { background: var(--success); box-shadow: 0 0 0 1px var(--success); }
.timeline-item.is-current::before { background: var(--primary); box-shadow: 0 0 0 4px rgba(8,126,139,.14); }
.timeline-item h3 { margin: 0; font-size: 15px; }
.timeline-item p { margin: 6px 0 0; color: var(--ink-2); font-size: 12px; }
.week-divider { margin: 5px 0 -2px 35px; color: var(--ink-3); font-size: 11px; font-weight: 750; letter-spacing: .08em; }

.calendar-card { padding: 16px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calendar-head h3 { margin: 3px 0 0; font-size: 18px; }
.calendar-head .text-button { min-height: 44px; padding: 0 4px; }
.readonly-label { color: var(--ink-3); font-size: 10px; font-weight: 700; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; }
.calendar-weekdays { margin: 14px 0 7px; color: var(--ink-3); font-size: 10px; text-align: center; }
.calendar-day { min-width: 0; height: 40px; display: grid; place-items: center; position: relative; border: 0; border-radius: 11px; color: var(--ink-2); background: transparent; font-size: 12px; }
button.calendar-day { min-height: 40px; cursor: pointer; }
.calendar-day.has-plan { color: var(--ink); background: #f0f5f5; font-weight: 800; }
.calendar-day.has-plan:hover { box-shadow: inset 0 0 0 1px var(--primary); }
.calendar-day i { position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; transform: translateX(-50%); background: #aab9bc; }
.calendar-day.is-complete { color: #09674b; background: var(--success-soft); }
.calendar-day.is-complete i { background: var(--success); }
.calendar-day.is-current { color: #fff; background: var(--primary); }
.calendar-day.is-current i { background: #fff; }
.calendar-day.is-next { color: #7b4c0e; background: var(--warning-soft); box-shadow: inset 0 0 0 1px #efd298; }
.calendar-day.is-next i { background: var(--warning); }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 14px; color: var(--ink-3); font-size: 9px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.calendar-legend i { width: 7px; height: 7px; border-radius: 50%; background: #aab9bc; }
.calendar-legend i.is-complete { background: var(--success); }
.calendar-legend i.is-current { background: var(--primary); }
.calendar-legend i.is-next { background: var(--warning); }

.plan-list { position: relative; overflow: hidden; padding: 4px 14px; box-shadow: none; }
.plan-list::before { content: ''; position: absolute; left: 31px; top: 30px; bottom: 30px; width: 2px; background: #d7e3e5; }
.plan-item { position: relative; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; padding: 11px 0; border-bottom: 1px solid #e8eff0; }
.plan-item:last-child { border-bottom: 0; }
.plan-item__rail { position: relative; z-index: 1; padding-top: 3px; }
.plan-item__rail span { width: 32px; height: 32px; display: grid; place-items: center; border: 4px solid #fff; border-radius: 50%; color: var(--ink-2); background: #e5edef; font-size: 11px; font-weight: 800; }
.plan-item.is-complete .plan-item__rail span { color: #fff; background: var(--success); }
.plan-item.is-current .plan-item__rail span { color: #fff; background: var(--primary); box-shadow: 0 0 0 4px rgba(8,126,139,.12); }
.plan-item.is-next .plan-item__rail span { color: #7b4c0e; background: var(--warning-soft); box-shadow: inset 0 0 0 1px #e8c579; }
.plan-item__body { min-width: 0; }
.plan-item__head { min-height: 26px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-item__head > div { min-width: 0; display: flex; align-items: baseline; gap: 7px; }
.plan-item__head strong { font-size: 14px; }
.plan-item__head small { color: var(--ink-3); font-size: 10px; }
.plan-status { flex: 0 0 auto; color: var(--ink-3); font-size: 10px; font-weight: 750; }
.plan-item.is-complete .plan-status { color: var(--success); }
.plan-item.is-current .plan-status { color: var(--primary); }
.plan-item.is-next .plan-status { color: var(--warning); }
.plan-item__schedule { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-item__schedule > span { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.plan-item__schedule .text-button { min-width: 50px; min-height: 44px; padding: 0 2px; }
.plan-item__meta { min-height: 22px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-3); font-size: 10px; }
.plan-item__meta .text-button { min-height: 44px; padding: 0 2px; font-size: 10px; }
.home-plan-section { margin-top: 24px; padding-top: 2px; scroll-margin-top: 18px; }
.home-plan-section__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 0 2px 12px; }
.home-plan-section__head h2 { margin: 3px 0 0; font-size: 21px; }
.home-plan-section__head .text-button { min-height: 44px; padding: 0 4px; }
.home-plan-section > .meta { margin: 0 2px 14px; }
.modal-root { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.modal-root:empty { display: none; }
.schedule-modal-layer { position: absolute; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.schedule-modal-layer { pointer-events: auto; }
.schedule-modal-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(18,38,44,.5); cursor: pointer; }
.schedule-modal { position: relative; z-index: 1; width: 100%; padding: 20px 18px max(22px,env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: #fff; box-shadow: 0 -20px 48px rgba(23,43,53,.18); animation: modal-in var(--ease); }
@keyframes modal-in { from { transform: translateY(22px); opacity: .4; } to { transform: none; opacity: 1; } }
.schedule-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.schedule-modal__head h2 { margin: 3px 0 0; font-size: 21px; }
.schedule-modal__head .section-kicker { margin: 0; }
.schedule-modal > .meta { margin: 9px 0 17px; }
.schedule-modal__fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.schedule-modal__fields label span { display: block; margin-bottom: 7px; color: var(--ink-2); font-size: 11px; }
.schedule-modal__fields input { width: 100%; min-height: 46px; padding: 0 9px; border: 1px solid #bfd0d3; border-radius: 12px; color: var(--ink); background: #fff; font-size: 12px; }
.schedule-modal__actions { display: grid; grid-template-columns: .8fr 1.5fr; gap: 9px; margin-top: 18px; }
.schedule-modal__actions button { min-height: 46px; }
.health-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin: 18px 0; padding: 4px; border-radius: 15px; background: #e8eff0; }
.health-tabs button { min-width: 0; min-height: 44px; padding: 0 5px; border: 0; border-radius: 11px; color: var(--ink-2); background: transparent; font-size: 12px; font-weight: 700; cursor: pointer; }
.health-tabs button.is-active { color: var(--primary-strong); background: #fff; box-shadow: 0 4px 12px rgba(34,69,76,.08); }
.health-summary { padding: 17px; }
.health-summary__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.health-summary__top h2 { margin: 5px 0 0; font-size: 21px; }
.health-summary__top .secondary-button { min-height: 44px; padding: 0 12px; }
.health-summary > .meta { margin: 10px 0 0; line-height: 1.5; }
.health-metrics { display: grid; grid-template-columns: repeat(2,1fr); grid-auto-rows: 82px; gap: 10px; margin-top: 12px; }
.health-metrics .card { min-height: 82px; display: flex; flex-direction: column; justify-content: center; padding: 14px; box-shadow: none; }
.health-metrics span { display: block; color: var(--ink-3); font-size: 10px; }
.health-metrics strong { display: block; margin-top: 6px; font-size: 17px; }
.assessment-dimensions { margin-top: 12px; }
.assessment-dimensions strong { font-size: 14px; }
.report-chart { height: 188px; display: grid; grid-template-columns: repeat(8,1fr); align-items: end; gap: 8px; padding: 22px 16px 15px; }
.report-bar { height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; }
.report-bar > span { width: 100%; max-width: 24px; border-radius: 7px 7px 3px 3px; background: #d9e4e6; }
.report-bar > span.is-complete { background: var(--success); }
.report-bar > span.is-current { background: var(--primary); }
.report-bar small { color: var(--ink-3); font-size: 9px; }
.assessment-overview { padding: 18px; text-align: center; }
.assessment-score { width: 126px; height: 126px; display: grid; place-items: center; align-content: center; margin: 14px auto; border: 8px solid var(--primary-soft); border-radius: 50%; }
.assessment-score strong { font-size: 28px; }
.assessment-score span { margin-top: 3px; color: var(--ink-3); font-size: 10px; }
.assessment-overview p { margin: 0 0 16px; color: var(--ink-2); font-size: 12px; line-height: 1.6; }
.empty-trend { min-height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px; text-align: center; box-shadow: none; }
.empty-trend svg { width: 34px; height: 34px; margin-bottom: 11px; fill: none; stroke: #8da4a9; stroke-width: 1.5; }
.empty-trend strong { font-size: 14px; }
.empty-trend span { max-width: 240px; margin-top: 7px; color: var(--ink-3); font-size: 11px; line-height: 1.55; }
.assessment-intro { padding: 2px 2px 12px; }
.assessment-intro h2 { margin: 6px 0 0; font-size: 21px; }
.assessment-intro p { margin: 7px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.55; }
.scale-list { display: grid; gap: 10px; }
.scale-item { min-height: 82px; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 11px; padding: 13px; }
.scale-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; color: var(--primary-strong); background: var(--primary-soft); font-weight: 800; }
.scale-item > span:nth-child(2) strong, .scale-item > span:nth-child(2) small { display: block; }
.scale-item > span:nth-child(2) strong { font-size: 14px; }
.scale-item > span:nth-child(2) small { margin-top: 5px; color: var(--ink-3); font-size: 10px; line-height: 1.4; }
.scale-action { display: inline-flex; align-items: center; gap: 2px; color: var(--primary-strong); font-size: 10px; font-weight: 700; }
.scale-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

.store-hero { padding: 4px 2px 8px; }
.profile-device-entry { padding: 17px; }
.profile-device-entry__link { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 12px; color: var(--primary-strong); font-size: 11px; font-weight: 750; }
.profile-device-entry__link svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.device-guide-visual { margin-top: 18px; overflow: hidden; padding: 8px 14px 15px; text-align: center; }
.device-guide-visual > svg { width: 100%; max-width: 300px; height: 190px; }
.device-guide-visual > div strong, .device-guide-visual > div span { display: block; }
.device-guide-visual > div strong { font-size: 15px; }
.device-guide-visual > div span { margin-top: 5px; color: var(--ink-3); font-size: 10px; }
.device-resource-grid { display: grid; gap: 10px; }
.device-resource-grid > button { min-height: 76px; display: grid; grid-template-columns: 46px minmax(0,1fr) 20px; grid-template-rows: auto auto; align-items: center; gap: 3px 11px; padding: 12px 14px; }
.device-resource-grid .device-resource-icon { grid-row: 1 / 3; }
.device-resource-grid strong { align-self: end; font-size: 14px; }
.device-resource-grid small { align-self: start; color: var(--ink-3); font-size: 10px; }
.device-resource-grid .chevron { grid-column: 3; grid-row: 1 / 3; }
.device-resource-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; color: var(--primary); background: var(--primary-soft); }
.device-resource-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.device-resource-icon--warning { color: #8c5512; background: var(--warning-soft); }
.resource-placeholder { margin-top: 20px; padding: 28px 20px; text-align: center; }
.resource-placeholder .device-resource-icon { margin: 0 auto 14px; }
.resource-placeholder h2 { margin: 0; font-size: 19px; }
.resource-placeholder p { margin: 10px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.7; }
.video-placeholder { min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; background: linear-gradient(145deg,#173f49,#087e8b); color: #fff; }
.video-placeholder > span { width: 62px; height: 62px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; background: rgba(255,255,255,.12); }
.video-placeholder svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.video-placeholder small { color: rgba(255,255,255,.72); }
.faq-list { display: grid; gap: 10px; margin-top: 20px; }
.faq-list details { padding: 0 15px; box-shadow: none; }
.faq-list summary { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 750; cursor: pointer; }
.faq-list summary::after { content: '+'; color: var(--primary); font-size: 20px; font-weight: 400; }
.faq-list details[open] summary::after { content: '–'; }
.faq-list details p { margin: -2px 0 15px; color: var(--ink-2); font-size: 12px; line-height: 1.65; }
.store-categories { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 18px; }
.store-categories button { min-width: 0; min-height: 118px; display: flex; flex-direction: column; align-items: flex-start; padding: 13px 11px; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.store-categories button:hover { border-color: #a9d1d5; background: var(--primary-soft); }
.store-categories svg { width: 26px; height: 26px; margin-bottom: 12px; fill: none; stroke: var(--primary); stroke-width: 1.7; }
.store-categories strong { font-size: 13px; }
.store-categories span { margin-top: 5px; color: var(--ink-3); font-size: 9px; line-height: 1.45; }
.store-list { display: grid; gap: 10px; }
.store-item { min-height: 72px; display: grid; grid-template-columns: 44px 1fr 20px; align-items: center; gap: 12px; padding: 12px; }
.store-item__icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--primary); background: var(--primary-soft); }
.store-item__icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.store-item > span:nth-child(2) strong, .store-item > span:nth-child(2) small { display: block; }
.store-item > span:nth-child(2) strong { font-size: 14px; }
.store-item > span:nth-child(2) small { margin-top: 5px; color: var(--ink-3); font-size: 10px; }
.store-item > .chevron { width: 18px; height: 18px; }

.profile-card { padding: 18px; }
.profile-identity { display: flex; align-items: center; gap: 13px; }
.profile-identity h3 { margin: 0; font-size: 18px; }
.profile-identity p { margin: 4px 0 0; color: var(--ink-2); font-size: 12px; }
.menu-list { margin-top: 14px; overflow: hidden; }
.menu-item { width: 100%; min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 15px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; }
.menu-item:last-child { border-bottom: 0; }
.menu-item svg { width: 22px; height: 22px; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu-item span { flex: 1; font-size: 14px; font-weight: 650; }

.lease-detail-hero { padding: 20px; text-align: center; }
.lease-symbol { width: 74px; height: 74px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 24px; color: var(--warning); background: var(--warning-soft); }
.lease-symbol--expired { color: var(--danger); background: var(--danger-soft); }
.lease-symbol svg { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lease-detail-hero h2 { margin: 0; font-size: 24px; }
.lease-detail-hero p { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.65; }
.action-list { display: grid; gap: 10px; margin-top: 18px; }
.action-item { display: flex; gap: 12px; padding: 15px; }
.action-number { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: var(--primary-strong); background: var(--primary-soft); font-size: 12px; font-weight: 800; }
.action-item strong { display: block; font-size: 14px; }
.action-item p { margin: 5px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.55; }

.scenario-scrim { display: none; }

@media (max-width: 760px) {
  html, body { height: 100%; background: var(--canvas); }
  .prototype-stage { min-height: 100%; height: 100%; display: block; padding: 0; background: var(--canvas); }
  .phone-frame { width: 100%; height: 100%; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .phone-screen { border-radius: 0; }
  .scenario-trigger { display: grid; }
  .scenario-panel { position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 50; width: auto; max-height: calc(100vh - 28px); overflow: auto; transform: translateY(calc(100% + 24px)); transition: var(--ease); }
  .scenario-panel.is-open { transform: none; }
  .scenario-close { display: grid !important; }
  .scenario-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(18,38,44,.46); opacity: 0; pointer-events: none; transition: var(--ease); display: block; }
  .scenario-scrim.is-open { opacity: 1; pointer-events: auto; }
}

@media (max-width: 360px) {
  .page { padding-left: 14px; padding-right: 14px; }
  .page-heading { font-size: 24px; }
  .record-preview { grid-template-columns: 1fr 1fr; }
  .record-preview > div:last-child { grid-column: 1 / -1; }
  .course-selector__rail { grid-template-columns: 30px minmax(0,1fr) 30px; gap: 3px; }
  .course-arrow { width: 30px; }
  .course-choice { padding-left: 8px; padding-right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
