/* 공통 컴포넌트 */
.screen { padding: 0 12px; }
.hd { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px; gap: 8px; }
.hd h1 { font-size: var(--fs-title); font-weight: 800; letter-spacing: -0.02em; }
.sub { font-size: var(--fs-label); color: var(--ink3); font-weight: 600; padding: 0 8px 8px; }

.icon-btn {
  width: var(--touch); height: var(--touch); border: 0; background: transparent; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink2);
}
.icon-btn svg { width: 26px; height: 26px; }

.card { background: var(--card); border-radius: var(--radius); padding: var(--pad); margin-bottom: var(--gap); display: block; color: inherit; text-decoration: none; }
a.card:active, button.card:active { background: #F8FAFB; }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: var(--fs-card); font-weight: 800; }
.card-time { display: flex; align-items: center; font-size: var(--fs-small); color: var(--ink3); font-weight: 600; white-space: nowrap; }
.card-time svg { width: 20px; height: 20px; }
.dot { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.dot svg { width: 21px; height: 21px; }
.dot.bp { background: var(--bp-soft); color: var(--bp); }
.dot.glu { background: var(--glu-soft); color: var(--glu); }
.dot.med { background: var(--med-soft); color: var(--med); }
.section-title { font-size: var(--fs-card); font-weight: 800; margin-bottom: 8px; }

.big { font-size: var(--fs-num); font-weight: 800; line-height: 1; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.big .sl { color: var(--muted-num); font-weight: 600; }
.unit { font-size: var(--fs-label); color: var(--ink3); font-weight: 700; margin-left: 5px; letter-spacing: 0; white-space: nowrap; display: inline-block; }
.big { white-space: nowrap; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-label); font-weight: 800;
  padding: 7px 14px 7px 10px; border-radius: 99px; line-height: 1.3;
}
.chip svg { width: 19px; height: 19px; flex: none; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.high { background: var(--high-bg); color: var(--high); }
.target-line { font-size: var(--fs-small); color: var(--ink2); font-weight: 700; margin-top: 8px; }

.banner { border-radius: 18px; padding: 12px 14px; font-size: var(--fs-label); font-weight: 800; display: flex; align-items: center; gap: 8px; }
.banner svg { width: 22px; height: 22px; flex: none; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.high { background: var(--high-bg); color: var(--high); }
.note { font-size: var(--fs-small); color: var(--ink3); line-height: 1.6; }
.tip { background: var(--primary-soft); border-radius: 18px; padding: 14px 16px; font-size: var(--fs-label); line-height: 1.6; color: #164E63; }

.btn {
  display: flex; width: 100%; min-height: var(--btn-h); align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 20px; font-size: calc(21px * var(--scale)); font-weight: 800; padding: 10px 16px; text-decoration: none;
  background: var(--primary); color: #fff;
}
.btn svg { width: 24px; height: 24px; }
.btn.bp { background: var(--bp); } .btn.glu { background: var(--glu); } .btn.med { background: var(--med); }
.btn.call { background: #15803D; }
.btn.ghost { background: var(--card); color: var(--ink2); }
.btn.soft { background: var(--bg); color: var(--ink2); }
.btn.danger { background: var(--card); color: var(--high); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .5; cursor: default; }
.btn + .btn { margin-top: 10px; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { margin-top: 0; }
.link { background: none; border: 0; color: var(--primary); font-weight: 800; font-size: var(--fs-label); min-height: var(--touch); padding: 0 4px; text-decoration: none; display: inline-flex; align-items: center; }

/* 상세 화면 색 헤더 */
.color-hd { color: #fff; margin: calc(-1 * var(--gap)) -12px 12px; }
.color-hd.bp { background: var(--bp); } .color-hd.glu { background: var(--glu); } .color-hd.med { background: var(--med); }
.color-hd .bar { display: flex; align-items: center; padding: 10px 12px 0; gap: 4px; }
.color-hd .bar h1 { flex: 1; font-size: calc(22px * var(--scale)); font-weight: 800; }
.color-hd .icon-btn { color: #fff; }
.color-hd .bar .link { color: #fff; }
.tabs { display: flex; font-size: var(--fs-body); font-weight: 800; }
.tabs a { flex: 1; text-align: center; padding: 14px 0; color: rgba(255,255,255,.82); border-bottom: 4px solid transparent; text-decoration: none; min-height: var(--touch); }
.tabs a[aria-current="page"] { color: #fff; border-color: #fff; }

.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { min-height: var(--touch); padding: 8px 18px; border-radius: 99px; border: 2px solid var(--line); background: var(--card); font-weight: 800; font-size: var(--fs-label); color: var(--ink2); }
.pill[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }

/* 표 */
.range-table { width: 100%; border-collapse: collapse; }
.range-table td { padding: 11px 4px; border-bottom: 1px solid #EEF0F3; font-size: var(--fs-small); }
.range-table td:last-child { text-align: right; white-space: nowrap; }
.range-table tr.now { background: var(--warn-bg); font-weight: 800; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: 8px; vertical-align: -1px; }

/* 목록 */
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid #EEF0F3; min-height: var(--touch); }
.list-item:last-child { border-bottom: 0; }

/* 폼 */
.field { margin-bottom: 16px; }
.field label, .field .label { display: block; font-size: var(--fs-label); font-weight: 800; color: var(--ink2); margin-bottom: 8px; }
.field input[type="text"], .field input[type="tel"], .field input[type="number"], .field input[type="time"], .field input[type="datetime-local"], .field select {
  width: 100%; min-height: 56px; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--card); font-weight: 700;
}
.field input:focus { border-color: var(--primary); outline: none; }
.field .help { font-size: var(--fs-small); color: var(--ink3); margin-top: 6px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--card); font-weight: 700; font-size: var(--fs-body); margin-bottom: 8px; }
.check input { width: 26px; height: 26px; accent-color: var(--primary); }
.error { color: var(--high); font-weight: 800; font-size: var(--fs-label); margin: 0 0 10px; min-height: 1em; }

/* 모달 */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(17,24,39,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--card); border-radius: 28px; padding: 22px; width: min(420px, 100%); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 20px); transform: translateX(-50%); z-index: 70; background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 16px; font-weight: 800; font-size: var(--fs-label); max-width: calc(100% - 32px); }

.empty { text-align: center; padding: 18px 8px; color: var(--ink3); font-size: var(--fs-body); }
