:root {
  color-scheme: light;
  --bg: #f2f6f6;
  --surface: #fff;
  --ink: #172e2d;
  --muted: #5d7370;
  --teal: #075b51;
  --line: #dfe9e7;
  --pale: #e6f2ed;
  --sys: #087b69;
  --dia: #6e56a5;
  --radius: 21px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
[hidden] { display: none !important; }
button, input, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button, a, summary, input, textarea { outline-offset: 4px; }
:focus-visible { outline: 3px solid #368e81; }
a { color: inherit; }
p, h1, h2 { margin: 0; }
svg { display: inline-block; width: 1.25rem; height: 1.25rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; vertical-align: middle; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-header { border-bottom: 1px solid var(--line); background: #f9fbfb; }
.header-inner { display: flex; justify-content: space-between; align-items: center; width: min(100% - 40px, 912px); min-height: 70px; margin: auto; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; letter-spacing: .045em; font-size: 1.125rem; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #07594e; color: #defff1; }
.brand-mark svg { width: 22px; height: 22px; stroke-width: 2; }
.header-date { color: var(--muted); font-size: .875rem; }
.shell { width: min(100% - 40px, 912px); margin: 0 auto; padding: 32px 0 112px; padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
.page-intro { margin-bottom: 20px; }
.page-intro h1 { font-size: clamp(1.75rem, 1.5rem + 1.15vw, 2.35rem); line-height: 1.24; font-weight: 760; letter-spacing: -.035em; }
.page-intro p { color: var(--muted); font-size: .9375rem; margin-top: 5px; }
.page-with-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); align-items: stretch; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 21px; min-width: 0; }
.panel h2, dialog h2 { font-size: 1.125rem; line-height: 1.32; font-weight: 730; }
.muted { color: var(--muted); }
.panel .muted, .dialog-head .muted { font-size: .875rem; margin-top: 4px; }
.hero { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; position: relative; overflow: hidden; isolation: isolate; background: linear-gradient(120deg,#073a35 0%,#0b5148 75%,#116457 100%); border-radius: var(--radius); padding: 22px 25px; color: white; }
.hero::before { content: ""; width: 310px; height: 310px; border-radius: 50%; position: absolute; z-index: -1; right: -156px; top: -91px; box-shadow: 0 0 0 18px #f3fffa0a, 0 0 0 39px #f3fffa08, 0 0 0 64px #f3fffa08, 0 0 0 92px #f3fffa06; border: 1px solid #f3fffa15; background: #d6ffee0a; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: #e0f7ee; font-size: .9375rem; font-weight: 600; }
.hero-kicker svg { color: #a6efd6; }
.hero-date { color: #d0eae0; font-size: .8125rem; text-align: right; }
.reading-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; column-gap: clamp(11px, 4.4vw, 30px); margin-top: 14px; }
.reading-number { display: block; font-family: ui-sans-serif, system-ui, sans-serif; line-height: 1; font-weight: 680; letter-spacing: -.075em; font-variant-numeric: tabular-nums; font-size: clamp(2.85rem, 10vw, 4.5rem); }
.reading-slash { font-size: clamp(1.65rem, 6vw, 2.6rem); color: #a8dace; font-weight: 350; margin-top: 4px; }
.pressure-label { display: block; color: #d0eae0; font-size: .875rem; margin-top: 5px; white-space: nowrap; }
.reading-meta { display: flex; align-items: center; gap: 12px; margin: 13px 0 16px; font-size: .875rem; color: #d0eae0; min-height: 1.35rem; }
.hero-pulse { display: inline-flex; gap: 5px; align-items: center; }
.hero-pulse svg { width: 1rem; height: 1rem; }
.hero-action, .primary-button, .secondary-button, .text-button, .small-button, .danger-button, .icon-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 11px; min-height: 42px; min-width: 42px; padding: 7px 12px; font-weight: 680; line-height: 1.25; text-decoration: none; text-align: center; }
.hero-action { background: #aef1d8; color: #093c32; min-height: 44px; padding-inline: 16px; margin-top: auto; }
.hero-action:hover { background: #c2f9e3; }
.primary-button { background: var(--teal); color: white; padding-inline: 15px; flex-shrink: 0; }
.primary-button:hover { background: #08493f; }
.secondary-button { background: #f7fbf9; color: var(--teal); border-color: #d1e4df; font-size: .875rem; }
.secondary-button:hover, .text-button:hover, .icon-button:hover { background: var(--pale); }
.text-button { background: transparent; color: var(--teal); font-size: .875rem; padding-inline: 7px; flex-shrink: 0; }
.small-button { color: white; background: var(--teal); font-size: .875rem; }
.icon-button { color: var(--muted); background: transparent; padding: 0; flex: 0 0 auto; }
.icon-button svg { width: 18px; height: 18px; }
.danger-button { color: #9b3542; background: transparent; }
.danger-button:hover { background: #fbe9eb; }
.danger-button.solid { background: #a43342; color: white; }
.danger-button.solid:hover { background: #842a35; }
.accent-icon { display: inline-grid; place-items: center; border-radius: 13px; width: 42px; height: 42px; background: var(--pale); color: var(--teal); flex: 0 0 auto; }
.next-card { display: grid; grid-template-columns: 1fr; justify-items: start; align-content: start; row-gap: 12px; }
.next-card .secondary-button { margin-top: auto; }
.next-time { margin-top: 8px; font-size: clamp(1.35rem, 3.3vw, 1.95rem); font-weight: 720; line-height: 1.2; font-variant-numeric: tabular-nums; }
.next-card .muted { min-height: 1.3em; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.section-head > div { min-width: 0; }
.chart { margin-top: 13px; min-width: 0; }
.chart-svg { display: block; width: 100%; height: 153px; stroke: none; overflow: visible; }
.chart-svg text { font-family: inherit; font-size: 11px; font-variant-numeric: tabular-nums; fill: #586f6b; }
.chart-svg .grid-line { stroke: #e5eeec; stroke-width: 1; }
.chart-svg .series { fill: none; stroke-width: 2.4; }
.chart-svg .dot { stroke: white; stroke-width: 1.25; }
.chart-svg .chart-empty { fill: #5e7370; font-size: 14px; font-weight: 650; }
.chart-svg .chart-empty-sub { font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; color: var(--muted); font-size: .8125rem; margin-top: 9px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 14px; height: 3px; border-radius: 3px; background: var(--sys); }
.legend span:nth-child(2) i { background: var(--dia); }
.legend .legend-unit { margin-left: auto; }
.empty-state { color: var(--muted); font-size: .875rem; padding: 12px 0 10px; }
.today-records .empty-state { margin-top: 17px; }
.record-list { overflow-wrap: anywhere; }
.record-row { width: 100%; text-align: left; color: var(--ink); border: 0; border-bottom: 1px solid #e9efee; background: transparent; padding: 10px 1px; display: grid; align-items: center; gap: 5px 10px; grid-template-columns: 46px minmax(0,1fr) minmax(0,auto) 18px; }
.record-row:hover { background: #f1f7f5; }
.record-row:last-child { border-bottom: 0; }
.record-time, .record-pulse { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.record-pressure { font-weight: 750; font-size: 1.125rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.record-pressure small { margin-left: 4px; font-size: .6875rem; font-weight: 500; color: var(--muted); }
.record-row svg { color: var(--muted); width: 16px; height: 16px; }
.record-note { grid-column: 2 / -1; font-size: .8125rem; color: var(--muted); white-space: pre-wrap; }
.date-group + .date-group { margin-top: 17px; }
.date-group h3 { margin: 0; padding: 8px 0; font-size: .875rem; color: var(--muted); background: #f5f9f8; border-radius: 8px; text-indent: 8px; font-weight: 650; }
.trend-heading { align-items: center; }
.trends-panel .chart-svg { height: clamp(185px, 37vw, 245px); }
.segmented { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: #eef4f3; }
.segmented button { color: var(--muted); background: transparent; font-weight: 650; border: 0; border-radius: 8px; min-height: 36px; padding-inline: 9px; font-size: .875rem; white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--teal); color: white; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.stat { padding: 16px; }
.stat h2 { font-size: .9375rem; }
.stat p { margin-block: 4px; font-size: .8125rem; color: var(--muted); }
.stat strong { font-size: 1.8rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat small, .context-note { font-size: .8125rem; color: var(--muted); }
.context-note { margin: 13px 2px 0; }
.data-panel, .install-card { margin-top: 14px; }
.data-actions, .settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.switch-head { align-items: center; }
.toggle { flex: 0 0 50px; width: 50px; height: 38px; display: grid; place-items: center; position: relative; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle span { display: block; width: 46px; height: 27px; border-radius: 40px; background: #b8c8c5; pointer-events: none; }
.toggle span::after { display: block; content: ""; border-radius: 50%; width: 21px; height: 21px; margin: 3px; background: white; box-shadow: 0 1px 2px #22332b33; }
.toggle input:checked + span { background: var(--teal); }
.toggle input:checked + span::after { transform: translateX(19px); }
.toggle input:focus-visible + span { outline: 3px solid #368e81; outline-offset: 3px; }
.time-list { display: grid; gap: 8px; margin-top: 16px; }
.time-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 5px 0 11px; background: #f6faf9; border: 1px solid #e4eeeb; border-radius: 11px; }
.time-item > svg { color: var(--teal); }
.time-item input { min-width: 0; flex: 1; background: transparent; border: 0; color: var(--ink); min-height: 46px; text-align: left; padding-left: 5px; font-weight: 650; }
.time-item input::-webkit-date-and-time-value { text-align: left; }
.settings-actions { justify-content: space-between; }
.time-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.time-chips span { background: var(--pale); color: var(--teal); font-weight: 700; padding: 4px 10px; border-radius: 7px; font-variant-numeric: tabular-nums; }
.instruction-list { padding-left: 21px; margin: 12px 0; color: var(--ink); font-size: .875rem; }
.instruction-list li + li { margin-top: 5px; }
details summary { cursor: pointer; color: var(--teal); font-weight: 690; min-height: 32px; padding-block: 4px; }
details summary svg { margin-inline: 2px 4px; }
.calendar-option { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; font-size: .875rem; }
.calendar-option button { margin-top: 9px; }
.install-card p { color: var(--muted); font-size: .875rem; margin: 6px 0 0; }
.app-nav { position: fixed; z-index: 2; bottom: 0; left: 0; right: 0; padding-bottom: env(safe-area-inset-bottom); background: #fbfdfc; border-top: 1px solid var(--line); }
.nav-inner { margin: auto; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); width: min(100% - 24px, 510px); gap: 6px; }
.app-nav a { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; min-height: 62px; padding: 4px; text-decoration: none; font-size: .8125rem; line-height: 1.25; color: #5b706c; }
.app-nav a svg { width: 21px; height: 21px; }
.app-nav a[aria-current="page"] { color: var(--teal); font-weight: 750; }
.app-nav a[aria-current="page"] svg { border-radius: 50%; box-shadow: 0 0 0 4px #e1f2eb; background: #e1f2eb; }
.alert-box { display: flex; align-items: center; gap: 9px; background: #e6f5ed; border: 1px solid #c2ded2; border-radius: 14px; padding: 9px; margin-bottom: 15px; }
.alert-box div { flex: 1; }
.alert-box p { font-size: .8125rem; color: var(--muted); }
.warning { padding: 11px 14px; margin-bottom: 12px; color: #713d1a; background: #fff2dd; border-radius: 10px; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); width: min(100% - 28px, 470px); max-height: min(86vh, 770px); max-height: min(86dvh, 770px); padding: 21px; background: white; color: var(--ink); overflow: auto; overscroll-behavior: contain; box-shadow: 0 14px 65px #092b263e; }
dialog::backdrop { background: #102b2870; }
.dialog-head { margin-bottom: 14px; }
.dialog-head h2 { font-size: 1.4rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.form-grid label { font-size: .875rem; font-weight: 650; display: block; min-width: 0; }
.form-grid label .muted { font-size: .75rem; font-weight: 500; }
.form-grid input, .form-grid textarea { color: var(--ink); background: #f6faf9; border: 1px solid #d9e7e3; border-radius: 9px; width: 100%; min-width: 0; min-height: 44px; padding: 8px; font-size: 1rem; margin-top: 4px; }
.form-grid textarea { display: block; resize: vertical; }
.form-grid input::placeholder, .form-grid textarea::placeholder { color: #728985; }
.field-unit { display: block; position: relative; }
.field-unit input { padding-right: 47px; }
.field-unit small { position: absolute; right: 7px; bottom: 14px; color: var(--muted); font-size: .69rem; font-weight: 550; pointer-events: none; }
.wide { grid-column: 1 / -1; }
.form-error { margin-top: 9px; color: #9b3542; font-size: .875rem; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.dialog-actions .primary-button { min-width: 115px; }
#confirm-dialog h2 { margin-bottom: 5px; }
.toast { position: fixed; z-index: 3; bottom: calc(74px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 26px); padding: 9px 14px; border-radius: 12px; background: #143e37; color: white; font-size: .875rem; box-shadow: 0 6px 20px #13373230; }
@media (max-width: 650px) {
  .header-inner, .shell { width: calc(100% - 28px); }
  .header-inner { min-height: 60px; }
  .shell { padding-top: 19px; }
  .page-intro { margin-bottom: 14px; }
  .dashboard, .settings-grid { grid-template-columns: minmax(0,1fr); gap: 11px; }
  .panel { padding: 15px; }
  .hero { padding: 18px; }
  .hero-action { width: 100%; }
  .next-card { grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 9px; }
  .next-card .secondary-button { margin-top: 0; padding-inline: 8px; }
  .next-card .accent-icon { width: 36px; height: 36px; }
  .next-card h2 { font-size: .9375rem; }
  .next-time { font-size: 1.25rem; margin-top: 2px; }
  .next-card .muted { min-height: 0; margin-top: 1px; font-size: .75rem; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 360px) {
  .header-inner, .shell { width: calc(100% - 20px); }
  .hero, .panel { padding: 13px; }
  .next-card { gap: 6px; }
  .next-card .secondary-button { font-size: .8125rem; }
  .segmented button { padding-inline: 6px; }
  .record-row { gap: 4px; }
}
