/* Public HTTPS static-assets fix: 2026-08-25 */
:root {
  --ink: #1f2521;
  --muted: #70756f;
  --paper: #f7f4ed;
  --card: #fffdf9;
  --line: #e7e1d8;
  --coral: #df644f;
  --coral-dark: #c94f3c;
  --sage: #647667;
  --blue: #5f7d8c;
  --shadow: 0 24px 60px rgba(58, 50, 39, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.auth-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(24,31,26,.76); backdrop-filter: blur(8px); }
.auth-overlay[hidden] { display: none; }
.auth-card { position: relative; width: min(100%, 430px); padding: 31px; border: 1px solid rgba(255,255,255,.42); background: var(--card); border-radius: 20px; box-shadow: 0 30px 90px rgba(10,15,11,.28); }
.auth-cancel { position: absolute; top: 19px; right: 20px; padding: 6px 8px; border: 0; color: var(--muted); background: transparent; font-size: 9px; font-weight: 750; cursor: pointer; }
.auth-cancel[hidden] { display: none; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand > span { display: grid; place-items: center; width: 42px; height: 42px; color: #fff; background: var(--coral); border-radius: 12px; font-size: 19px; }
.auth-brand small, .auth-brand strong { display: block; }
.auth-brand small { color: var(--coral); font-size: 7px; font-weight: 850; letter-spacing: .16em; }
.auth-brand strong { margin-top: 3px; font: 700 20px Georgia, "Noto Serif KR", serif; }
.auth-intro { margin: 20px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; background: #eeeae3; border-radius: 9px; }
.auth-tabs[hidden] { display: none; }
.auth-tabs button { padding: 9px; border: 0; color: #85827b; background: transparent; border-radius: 7px; font-size: 10px; font-weight: 800; cursor: pointer; }
.auth-tabs button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 8px rgba(45,40,34,.08); }
.auth-form { display: grid; gap: 13px; margin-top: 19px; }
.auth-form[hidden] { display: none; }
.auth-form [hidden] { display: none; }
.auth-form label { display: grid; gap: 7px; color: #555a55; font-size: 10px; font-weight: 750; }
.auth-form input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); color: var(--ink); background: #faf8f3; border-radius: 8px; outline: 0; font-size: 12px; }
.auth-form input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(223,100,79,.08); }
.auth-submit { display: flex; justify-content: space-between; align-items: center; min-height: 44px; margin-top: 2px; padding: 0 15px; border: 0; color: #fff; background: var(--coral); border-radius: 9px; font-size: 11px; font-weight: 800; cursor: pointer; }
.auth-submit:hover { background: var(--coral-dark); }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-error { min-height: 15px; margin: -3px 0; color: var(--coral-dark); font-size: 9px; }
.setup-note { margin: -2px 0 0; padding: 9px 10px; color: #536455; background: #edf2ec; border-radius: 7px; font-size: 9px; line-height: 1.5; }
.invite-panel { display: grid; gap: 13px; margin-top: 20px; }
.invite-panel[hidden], .invite-result[hidden] { display: none; }
.invite-panel h2 { margin: 0; font: 700 18px Georgia, "Noto Serif KR", serif; }
.invite-panel > p { margin: -6px 0 2px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.invite-result { display: grid; gap: 9px; padding: 14px; border: 1px solid #dce5dc; background: #f0f5ef; border-radius: 10px; text-align: center; }
.invite-result small { color: #657066; font-size: 9px; }
.invite-result code { padding: 9px 6px; color: var(--ink); font: 800 18px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .06em; }
.invite-result button { min-height: 36px; border: 1px solid #ccd8cc; color: #526254; background: #fff; border-radius: 8px; font-size: 10px; font-weight: 800; cursor: pointer; }
.invite-result p { margin: 0; color: #7c857d; font-size: 8px; }
.auth-security { margin: 17px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: #99968e; font-size: 8px; line-height: 1.55; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; display: flex; flex-direction: column; padding: 34px 24px 28px; color: #f8f4ec; background: #202722; z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 33px; font-family: Georgia, "Noto Serif KR", serif; font-size: 21px; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: #fff; background: var(--coral); border-radius: 11px; font-family: system-ui; font-size: 17px; }
.main-nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 13px 15px; border-radius: 10px; color: #abb4ad; font-size: 14px; font-weight: 650; transition: .2s ease; }
.nav-item span { width: 20px; text-align: center; font-size: 18px; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.085); }
.nav-item.active { box-shadow: inset 3px 0 var(--coral); }
.sidebar-note { display: flex; gap: 11px; align-items: flex-start; margin-top: auto; padding: 17px 14px; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.045); border-radius: 12px; }
.status-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #7fbc8b; box-shadow: 0 0 0 4px rgba(127,188,139,.12); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; margin-bottom: 4px; }
.sidebar-note small { color: #99a49c; font-size: 10px; }
.sidebar-note.has-warning .status-dot { background: #d5a457; box-shadow: 0 0 0 4px rgba(213,164,87,.12); }

.main-content { grid-column: 2; min-width: 0; padding: 0 5.5vw 70px; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.today-label { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.today-label span { width: 6px; height: 6px; background: var(--coral); border-radius: 50%; }
.profile-chip { display: flex; align-items: center; gap: 9px; }
.profile-chip > span { display: grid; place-items: center; width: 33px; height: 33px; background: #e9e2d7; border-radius: 50%; font-size: 12px; font-weight: 800; }
.profile-chip strong, .profile-chip small { display: block; }
.profile-chip strong { font-size: 11px; }
.profile-chip small { margin-top: 2px; color: #99978f; font-size: 9px; }
.profile-chip button { margin-left: 4px; padding: 6px 8px; border: 1px solid var(--line); color: #777b76; background: transparent; border-radius: 7px; font-size: 8px; font-weight: 700; cursor: pointer; }
.profile-chip button:hover { color: var(--coral-dark); border-color: #e9c3bb; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }

.hero { max-width: 1060px; margin: 0 auto; padding: 62px 0 31px; }
.eyebrow { color: var(--coral); font-size: 10px; font-weight: 800; letter-spacing: .19em; }
.hero h1 { margin: 12px 0 13px; font: 700 clamp(35px, 4.3vw, 55px)/1.16 Georgia, "Noto Serif KR", serif; letter-spacing: -.05em; }
.hero h1 em { color: var(--coral); font-style: normal; }
.hero p { margin: 0; color: var(--muted); font-size: 13px; }

.record-card { max-width: 1060px; margin: 0 auto; padding: 32px 38px 34px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.card-heading > div { display: flex; align-items: center; gap: 12px; }
.step-badge { display: grid; place-items: center; width: 34px; height: 34px; color: #fff; background: var(--ink); border-radius: 50%; font: italic 700 11px Georgia, serif; }
.card-heading h2 { margin: 0; font: 700 19px Georgia, "Noto Serif KR", serif; }
.required-note { color: #9d9a91; font-size: 10px; }
.date-field { max-width: 390px; margin-bottom: 22px; }
.date-field > label { display: block; margin-bottom: 8px; color: #525752; font-size: 11px; font-weight: 700; }
.input-wrap { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid var(--line); background: #faf8f3; border-radius: 8px; }
.input-wrap span { color: var(--coral); }
.input-wrap input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }

.session-row { display: flex; align-items: end; gap: 22px; margin-bottom: 22px; }
.session-date { flex: 0 0 270px; margin-bottom: 0; }
.session-guide { padding-bottom: 4px; }
.session-guide strong, .session-guide small { display: block; }
.session-guide strong { font-size: 11px; }
.session-guide small { margin-top: 5px; color: #98958d; font-size: 9px; }
.measurement-table { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.measurement-labels, .measurement-entry { display: grid; grid-template-columns: 140px repeat(3, minmax(100px, 1fr)) 76px; gap: 12px; align-items: center; }
.measurement-labels { padding: 10px 15px; color: #918e86; background: #f3f0ea; font-size: 8px; font-weight: 750; letter-spacing: .02em; }
.measurement-labels span:not(:first-child) { text-align: center; }
.measurement-labels small { font-size: 7px; font-weight: 500; }
.measurement-entry { position: relative; min-height: 76px; padding: 13px 15px; background: var(--card); border-top: 1px solid var(--line); }
.measurement-entry:first-child { border-top: 0; }
.measurement-entry:focus-within { z-index: 1; background: #fffaf7; box-shadow: inset 3px 0 var(--coral); }
.entry-meta { display: flex; align-items: center; gap: 9px; }
.entry-number { flex: 0 0 auto; display: grid; place-items: center; width: 31px; height: 31px; color: #fff; background: var(--ink); border-radius: 50%; font: italic 700 9px Georgia, serif; }
.reading-time { min-width: 0; width: 83px; padding: 8px 7px; border: 1px solid var(--line); color: var(--ink); background: #faf8f3; border-radius: 7px; font-size: 10px; outline: 0; }
.reading-time:focus { border-color: var(--coral); }
.compact-value { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: end; padding: 7px 10px 5px; border: 1px solid var(--line); background: #fff; border-radius: 8px; }
.compact-value > span { grid-column: 1 / 3; display: none; margin-bottom: 3px; color: #98958f; font-size: 8px; }
.compact-value input { min-width: 0; width: 100%; padding: 0; border: 0; color: var(--ink); background: transparent; font: 500 22px Georgia, serif; text-align: center; outline: 0; }
.compact-value input::placeholder { color: #cac6bd; }
.compact-value input::-webkit-inner-spin-button { appearance: none; }
.compact-value small { padding-bottom: 3px; color: #aaa69d; font-size: 7px; }
.compact-value:focus-within { border-color: var(--coral); box-shadow: 0 0 0 2px rgba(223,100,79,.07); }
.diastolic-value:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(95,125,140,.07); }
.remove-measurement { display: grid; place-items: center; width: 25px; height: 25px; padding: 0; border: 0; color: #aaa69f; background: transparent; border-radius: 50%; font-size: 18px; cursor: pointer; }
.remove-measurement:hover { color: var(--coral); background: #faeae6; }
.remove-measurement[hidden] { visibility: hidden; display: block; }
.entry-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.move-controls { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.move-entry { display: grid; place-items: center; width: 23px; height: 25px; padding: 0; border: 0; color: #6f756f; background: #faf8f3; font-size: 11px; cursor: pointer; }
.move-entry + .move-entry { border-left: 1px solid var(--line); }
.move-entry:hover:not(:disabled) { color: var(--coral-dark); background: #fff3f0; }
.move-entry:disabled { color: #cac7c0; cursor: not-allowed; }
.add-measurement { display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 8px 3px; border: 0; color: var(--sage); background: transparent; font-size: 9px; font-weight: 750; cursor: pointer; }
.add-measurement span { font-size: 15px; }
.add-measurement:disabled { opacity: .4; cursor: not-allowed; }

.measure-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.measure-field { min-width: 0; display: grid; grid-template-columns: 33px 1fr; gap: 0 10px; padding: 17px 16px 14px; border: 1px solid var(--line); border-radius: 11px; cursor: text; transition: .2s ease; }
.measure-field:focus-within { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(223,100,79,.08); }
.measure-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 33px; height: 33px; color: var(--coral); background: #f9e9e4; border-radius: 9px; font-size: 16px; font-weight: 800; }
.diastolic .measure-icon { color: var(--blue); background: #eaf0f2; }
.pulse .measure-icon { color: #8b6a62; background: #f0e7e2; font-size: 13px; }
.measure-copy strong, .measure-copy small { display: block; }
.measure-copy strong { font-size: 12px; }
.measure-copy small { margin-top: 2px; color: #a19e96; font-size: 9px; }
.number-input { grid-column: 1 / 3; display: flex; align-items: end; justify-content: space-between; margin-top: 18px; border-bottom: 1px solid #eae5dc; }
.number-input input { min-width: 0; width: 100%; padding: 0 0 4px; border: 0; outline: 0; background: transparent; font: 500 28px Georgia, serif; }
.number-input input::placeholder { color: #c8c4bc; }
.number-input b { padding-bottom: 7px; color: #aaa69d; font-size: 9px; font-weight: 600; }
.number-input input::-webkit-inner-spin-button { appearance: none; }
.divider { display: flex; align-items: center; gap: 12px; margin: 23px 0; color: #aaa69f; font-size: 9px; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.upload-zone { display: flex; align-items: center; gap: 14px; min-height: 67px; padding: 12px 14px; border: 1px dashed #cfc6bb; background: #faf8f4; border-radius: 11px; cursor: pointer; transition: .2s ease; }
.upload-zone:hover { border-color: var(--coral); background: #fffaf7; }
.camera-icon { display: grid; place-items: center; width: 40px; height: 40px; color: var(--coral); background: #f9e9e4; border-radius: 9px; font-size: 18px; }
.upload-copy { min-width: 0; flex: 1; }
.upload-copy strong, .upload-copy small { display: block; }
.upload-copy strong { font-size: 12px; }
.upload-copy small { margin-top: 4px; color: #9a978f; font-size: 9px; }
.upload-button { padding: 8px 13px; border: 1px solid var(--line); background: #fff; border-radius: 7px; font-size: 10px; font-weight: 700; }
.photo-name { min-height: 0; margin: 8px 0 0; color: var(--sage); font-size: 10px; }
.analysis-result { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px 14px; border: 1px solid #d9dfd9; background: #f3f7f2; border-radius: 10px; }
.analysis-result[hidden] { display: none; }
.analysis-result strong, .analysis-result small { display: block; }
.analysis-result strong { font-size: 11px; }
.analysis-result small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.analysis-spinner { flex: 0 0 auto; width: 18px; height: 18px; border: 2px solid #d5ddd5; border-top-color: var(--sage); border-radius: 50%; }
.is-loading .analysis-spinner { animation: spin .8s linear infinite; }
.is-success .analysis-spinner { display: grid; place-items: center; border: 0; color: #fff; background: var(--sage); }
.is-success .analysis-spinner::after { content: "✓"; font-size: 10px; }
.analysis-result.is-error { border-color: #edcec7; background: #fff3f0; }
.is-error .analysis-spinner { border: 0; color: var(--coral); }
.is-error .analysis-spinner::after { content: "!"; font-weight: 900; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-footer p { margin: 0; color: #9c9991; font-size: 9px; }
.form-footer p span { color: var(--sage); }
.save-button { display: flex; align-items: center; gap: 25px; padding: 13px 19px; border: 0; color: #fff; background: var(--coral); border-radius: 9px; box-shadow: 0 8px 18px rgba(223,100,79,.2); font-size: 11px; font-weight: 800; cursor: pointer; transition: .2s ease; }
.save-button:hover { background: var(--coral-dark); transform: translateY(-1px); }
.save-button:disabled { opacity: .65; cursor: wait; transform: none; }

.stats-section { max-width: 1060px; display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); gap: 12px; margin: 25px auto 0; }
.stat-card { min-width: 0; padding: 19px 19px 18px; border: 1px solid var(--line); background: rgba(255,253,249,.65); border-radius: 12px; }
.stat-card > span, .stat-card > small { display: block; }
.stat-card > span { color: var(--muted); font-size: 9px; font-weight: 750; }
.stat-card > strong { display: block; margin: 9px 0 5px; font: 700 22px Georgia, serif; white-space: nowrap; }
.stat-card > strong b { font: inherit; }
.stat-card > strong i { color: #a5a198; font: normal 600 9px system-ui; }
.stat-card > small { color: #a5a198; font-size: 8px; }
.primary-stat { color: #fff; background: var(--ink); border-color: var(--ink); }
.primary-stat > span, .primary-stat > small { color: #aeb6b0; }

.analysis-section { max-width: 1060px; margin: 54px auto 0; scroll-margin-top: 24px; }
.analysis-heading { align-items: center; }
.period-switch { display: flex; padding: 3px; border: 1px solid var(--line); background: #eeeae3; border-radius: 8px; }
.period-switch button { min-width: 47px; padding: 7px 10px; border: 0; color: #8e8b84; background: transparent; border-radius: 6px; font-size: 9px; font-weight: 750; cursor: pointer; }
.period-switch button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 7px rgba(50,45,38,.08); }
.urgent-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 13px 16px; border: 1px solid #e6afa5; color: #812f23; background: #fff0ed; border-radius: 11px; }
.urgent-banner[hidden] { display: none; }
.urgent-banner > span { flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; color: #fff; background: var(--coral-dark); border-radius: 50%; font-weight: 900; }
.urgent-banner strong, .urgent-banner small { display: block; }
.urgent-banner strong { font-size: 11px; }
.urgent-banner small { margin-top: 3px; font-size: 9px; }
.analysis-grid { display: grid; grid-template-columns: 1.1fr 1fr .9fr; gap: 11px; }
.vital-analysis { min-width: 0; padding: 20px; border: 1px solid var(--line); background: var(--card); border-radius: 13px; }
.vital-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #85827b; font-size: 9px; font-weight: 750; }
.range-badge { padding: 5px 7px; color: #777c77; background: #ecefe9; border-radius: 6px; font-size: 8px; white-space: nowrap; }
.range-badge.good { color: #4e6d55; background: #e8f0e8; }
.range-badge.watch { color: #936625; background: #f6ecd9; }
.range-badge.high, .range-badge.danger { color: #a34233; background: #f9e4df; }
.range-badge.cool { color: #496c7e; background: #e5eef2; }
.vital-number { display: block; margin: 16px 0 7px; font: 700 30px Georgia, serif; }
.vital-number > b { font: inherit; }
.vital-number i { color: #aaa69e; font: normal 700 9px system-ui; }
.vital-analysis > small { display: block; min-height: 26px; color: #95928b; font-size: 8px; line-height: 1.55; }
.mini-trend { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line); color: #737870; font-size: 8px; }
.frequency-list { display: grid; gap: 12px; margin-top: 17px; }
.frequency-list span { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; color: #87847d; font-size: 9px; }
.frequency-list i { width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }
.frequency-list .low-dot { background: var(--blue); }
.frequency-list .pulse-dot { background: #8b6a62; }
.frequency-list strong { color: var(--ink); font-size: 10px; }
.ai-insight-card { margin-top: 12px; padding: 22px 24px 20px; color: #f6f2eb; background: #202722; border-radius: 14px; box-shadow: 0 16px 35px rgba(31,37,33,.1); }
.ai-insight-top { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 12px; }
.ai-mark { display: grid; place-items: center; width: 35px; height: 35px; color: #fff; background: var(--coral); border-radius: 10px; font-size: 15px; }
.ai-insight-top span { color: #91a096; font-size: 7px; font-weight: 800; letter-spacing: .15em; }
.ai-insight-top h3 { margin: 3px 0 0; font: 700 15px Georgia, "Noto Serif KR", serif; }
.ai-insight-top button { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.13); color: #fff; background: rgba(255,255,255,.07); border-radius: 8px; font-size: 9px; font-weight: 750; cursor: pointer; }
.ai-insight-top button:hover { background: rgba(255,255,255,.12); }
.ai-insight-top button:disabled { opacity: .55; cursor: wait; }
.ai-insight-card > p { margin: 17px 0 0 47px; color: #c0c8c2; font-size: 10px; line-height: 1.7; }
#aiObservations { display: grid; gap: 7px; margin: 14px 0 0 47px; padding: 0; list-style: none; }
#aiObservations[hidden] { display: none; }
#aiObservations li { position: relative; padding-left: 13px; color: #d6dcd7; font-size: 9px; line-height: 1.55; }
#aiObservations li::before { content: ""; position: absolute; left: 0; top: 6px; width: 4px; height: 4px; background: var(--coral); border-radius: 50%; }
.ai-safety-note { margin: 16px 0 0 47px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.09); color: #909b93; font-size: 8px; }
.analysis-sources { margin: 9px 3px 0; color: #a09d95; font-size: 7px; text-align: right; }
.analysis-sources a { text-decoration: underline; text-underline-offset: 2px; }

.trend-section { max-width: 1060px; margin: 52px auto 0; scroll-margin-top: 24px; }
.chart-legend { display: flex; gap: 17px; color: var(--muted); font-size: 9px; }
.chart-legend span::before { content: ""; display: inline-block; width: 15px; height: 2px; margin: 0 6px 3px 0; background: var(--coral); }
.chart-legend .dia-legend::before { background: var(--blue); }
.chart-card { position: relative; min-height: 282px; padding: 17px 18px 10px; border: 1px solid var(--line); background: var(--card); border-radius: 14px; }
#trendChart { display: block; width: 100%; height: 250px; }
#trendChart[hidden] { display: none; }
.chart-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; }
.chart-empty[hidden] { display: none; }
.chart-empty > span { color: var(--coral); font-size: 25px; }
.chart-empty strong { margin: 9px 0 5px; font: 700 14px Georgia, "Noto Serif KR", serif; }
.chart-empty small { color: var(--muted); font-size: 9px; }

.summary-section { max-width: 1060px; margin: 52px auto 0; }
.section-title { display: flex; justify-content: space-between; align-items: end; margin-bottom: 15px; }
.section-title h2 { margin: 6px 0 0; font: 700 22px Georgia, "Noto Serif KR", serif; }
.section-title button { border: 0; color: var(--muted); background: transparent; font-size: 10px; cursor: pointer; }
.empty-record { display: grid; justify-items: center; padding: 38px; border: 1px solid var(--line); background: rgba(255,253,249,.55); border-radius: 14px; text-align: center; }
.empty-record span { font-size: 24px; color: var(--coral); }
.empty-record strong { margin-top: 8px; font: 700 14px Georgia, "Noto Serif KR", serif; }
.empty-record p { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.record-list { display: grid; gap: 8px; }
.record-row { display: grid; grid-template-columns: 115px repeat(3, minmax(95px, 1fr)) 80px; align-items: center; gap: 18px; padding: 16px 19px; border: 1px solid var(--line); background: rgba(255,253,249,.75); border-radius: 12px; }
.record-row time { padding-right: 18px; border-right: 1px solid var(--line); }
.record-row time strong, .record-row time small, .record-measure span { display: block; }
.record-row time strong { font: 700 13px Georgia, "Noto Serif KR", serif; }
.record-row time small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.record-measure span { margin-bottom: 4px; color: #9d9a92; font-size: 8px; }
.record-measure strong { font: 700 18px Georgia, serif; }
.record-measure small { margin-left: 4px; color: #aaa69d; font-size: 7px; }
.pulse-value strong { color: #775f58; }
.source-badge { justify-self: end; padding: 6px 8px; color: #777c77; background: #eeece6; border-radius: 6px; font-size: 8px; font-weight: 700; white-space: nowrap; }
.source-badge.photo { color: #a84c3d; background: #f8e8e3; }
.app-footer { max-width: 1060px; display: flex; justify-content: space-between; gap: 20px; margin: 46px auto 0; padding-top: 20px; border-top: 1px solid var(--line); color: #9b9992; font-size: 8px; }
.app-footer p { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 30; max-width: calc(100vw - 30px); padding: 12px 18px; color: #fff; background: var(--ink); border-radius: 9px; box-shadow: 0 14px 30px rgba(31,37,33,.2); font-size: 11px; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--coral-dark); }

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  .main-content { padding: 0 24px 55px; }
  .mobile-menu { display: block; }
  .measure-grid { grid-template-columns: 1fr; }
  .measurement-labels, .measurement-entry { grid-template-columns: 130px repeat(3, minmax(85px, 1fr)) 76px; gap: 8px; }
  .stats-section { grid-template-columns: repeat(2, 1fr); }
  .analysis-grid { grid-template-columns: 1fr 1fr; }
  .frequency-analysis { grid-column: 1 / -1; }
  .frequency-list { grid-template-columns: repeat(3, 1fr); }
  .measure-field { grid-template-columns: 35px 1fr 1.1fr; align-items: center; }
  .measure-icon { grid-row: auto; }
  .number-input { grid-column: 3; margin-top: 0; }
  .record-row { grid-template-columns: 90px repeat(3, 1fr); gap: 12px; }
  .source-badge { grid-column: 2 / -1; justify-self: start; }
}

@media (max-width: 560px) {
  .main-content { padding: 0 15px 45px; }
  .topbar { height: 68px; }
  .today-label { display: none; }
  .hero { padding: 42px 7px 25px; }
  .hero h1 { font-size: 36px; }
  .record-card { padding: 24px 18px; border-radius: 14px; }
  .session-row { align-items: stretch; flex-direction: column; gap: 11px; }
  .session-date { flex-basis: auto; max-width: none; }
  .measurement-labels { display: none; }
  .measurement-entry { grid-template-columns: repeat(3, 1fr); gap: 9px 7px; padding: 13px 12px 14px; }
  .entry-meta { grid-column: 1 / -1; padding-right: 88px; }
  .reading-time { width: 100px; }
  .compact-value { padding-inline: 7px; }
  .compact-value > span { display: block; }
  .compact-value input { font-size: 20px; }
  .entry-actions { position: absolute; right: 10px; top: 15px; }
  .required-note { display: none; }
  .measure-field { grid-template-columns: 34px 1fr; }
  .number-input { grid-column: 1 / 3; margin-top: 14px; }
  .upload-copy small { display: none; }
  .upload-button { display: none; }
  .form-footer { align-items: stretch; flex-direction: column; gap: 15px; }
  .save-button { justify-content: space-between; width: 100%; padding: 15px 18px; }
  .stats-section { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 16px 14px; }
  .stat-card > strong { font-size: 19px; }
  .analysis-grid { grid-template-columns: 1fr; }
  .frequency-analysis { grid-column: auto; }
  .frequency-list { grid-template-columns: 1fr; }
  .ai-insight-card { padding: 19px 17px; }
  .ai-insight-top { grid-template-columns: 34px 1fr; }
  .ai-insight-top button { grid-column: 1 / -1; justify-content: space-between; margin-top: 3px; padding: 11px 13px; }
  .ai-insight-card > p, #aiObservations, .ai-safety-note { margin-left: 0; }
  .analysis-sources { line-height: 1.6; text-align: left; }
  .chart-card { min-height: 250px; padding-inline: 6px; }
  #trendChart { height: 225px; }
  .record-row { grid-template-columns: 1fr 1fr 1fr; gap: 13px 8px; padding: 15px; }
  .record-row time { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; padding: 0 0 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .record-row time small { margin: 0; }
  .record-measure strong { font-size: 17px; }
  .source-badge { grid-column: 1 / -1; }
  .app-footer { align-items: flex-start; flex-direction: column; }
  .auth-overlay { padding: 12px; }
  .auth-card { padding: 24px 20px; border-radius: 16px; }
  .profile-chip > div { display: none; }
}
