:root{
  --bg:#fff9f7;--card:#ffffff;--text:#312b2d;--muted:#7f7377;--pink:#d97888;--pink-dark:#ba5c6c;
  --pink-soft:#f8e3e7;--lav:#eee8f8;--mint:#e1f2e8;--peach:#f9eadc;--amber:#c8883d;--amber-soft:#fff1db;
  --red:#b84a52;--red-soft:#fde7e8;--green:#3f7c5e;--green-soft:#e3f2e8;--blue:#5b7297;--blue-soft:#e8eef7;
  --shadow:0 10px 30px rgba(94,58,67,.08);--radius:24px;--border:#efe6e5;
}
*{box-sizing:border-box}html{background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;-webkit-text-size-adjust:100%}body{margin:0;min-height:100vh;background:linear-gradient(180deg,#fffaf8 0%,#fff7f8 45%,#fbf7ff 100%)}button,input,select{font:inherit;color:inherit}button{cursor:pointer}.app-shell{width:min(100%,720px);min-height:100vh;margin:0 auto;padding:env(safe-area-inset-top) 18px calc(28px + env(safe-area-inset-bottom));}.topbar{height:68px;display:flex;align-items:center;justify-content:space-between}.brand{font-weight:800;letter-spacing:-.02em}.brand span{font-weight:500;color:var(--muted)}.icon-btn,.back-btn,.close-btn{border:0;background:transparent}.icon-btn{width:46px;height:46px;border-radius:16px;font-size:24px}.icon-btn:active,.quick-link:active,.back-btn:active{transform:scale(.97)}.ghost{background:rgba(255,255,255,.55)}.view{display:none;animation:fade .18s ease}.view.active{display:block}@keyframes fade{from{opacity:.25;transform:translateY(4px)}to{opacity:1;transform:none}}.hero{display:flex;gap:15px;align-items:center;padding:26px 4px 22px}.hero-emoji{width:64px;height:64px;display:grid;place-items:center;background:var(--peach);border-radius:22px;font-size:31px;box-shadow:var(--shadow)}h1,h2,p{margin-top:0}h1{font-size:clamp(28px,7vw,37px);line-height:1.06;letter-spacing:-.035em;margin-bottom:6px}h2{font-size:22px;letter-spacing:-.025em;margin-bottom:0}.hero p{font-size:17px;color:var(--muted);margin:0}.card{background:rgba(255,255,255,.92);border:1px solid rgba(239,230,229,.9);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow);margin-bottom:16px}.section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:16px}.section-heading.compact{align-items:center}.eyebrow{font-size:11px;letter-spacing:.14em;font-weight:900;color:var(--pink-dark)}.soft-pill{background:var(--pink-soft);padding:7px 11px;border-radius:999px;font-weight:800;font-size:13px}.period-list{display:grid;gap:10px}.period-card{display:flex;align-items:center;gap:12px;padding:14px;border-radius:19px;background:#fff;border:1px solid var(--border)}.period-icon{width:46px;height:46px;border-radius:16px;display:grid;place-items:center;font-size:22px;flex:0 0 auto}.period-card.morning .period-icon{background:var(--peach)}.period-card.afternoon .period-icon{background:var(--mint)}.period-card.evening .period-icon{background:var(--lav)}.period-main{min-width:0;flex:1}.period-name{font-size:13px;font-weight:800;color:var(--muted)}.period-value{font-size:24px;line-height:1.15;font-weight:900;letter-spacing:-.03em}.period-meta{font-size:12px;color:var(--muted);margin-top:2px}.status-dot{width:12px;height:12px;border-radius:50%;flex:0 0 auto}.status-ok{background:var(--green)}.status-attention{background:var(--amber)}.status-danger{background:var(--red)}.status-empty{background:#d8ced0}.primary-cta{width:100%;border:0;border-radius:21px;background:linear-gradient(135deg,var(--pink),#cf829c);color:#fff;font-size:18px;font-weight:900;letter-spacing:.02em;padding:20px 18px;box-shadow:0 14px 30px rgba(202,111,134,.26);margin:8px 0 16px}.primary-cta:active{transform:translateY(1px)}.primary-cta.smaller{padding:17px;margin-top:12px}.quick-links{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.quick-link{border:1px solid var(--border);background:rgba(255,255,255,.8);border-radius:18px;min-height:68px;display:flex;flex-direction:column;gap:3px;align-items:center;justify-content:center;font-size:20px}.quick-link span{font-size:12px;font-weight:800;color:var(--muted)}.medicine-card{background:linear-gradient(135deg,#fff,#fff9ef)}.text-btn{border:0;background:transparent;color:var(--pink-dark);font-weight:850}.medicine-today-list{display:grid;gap:8px}.dose-row{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid var(--border);padding:11px 12px;border-radius:16px}.dose-info{flex:1;min-width:0}.dose-title{font-weight:850}.dose-meta{font-size:12px;color:var(--muted)}.dose-action{border:0;border-radius:13px;background:var(--mint);color:#315f49;font-weight:850;padding:9px 11px}.dose-action.done{background:#f1ecec;color:var(--muted)}.page-head{display:flex;align-items:center;gap:10px;padding:18px 0 16px}.page-head h1{font-size:31px;margin:2px 0 0}.back-btn{width:46px;height:46px;font-size:42px;line-height:1;border-radius:16px;background:rgba(255,255,255,.65)}.segmented{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;background:#f7f0f1;border-radius:16px;padding:5px}.segmented button{border:0;background:transparent;border-radius:12px;padding:11px 6px;font-weight:800;color:var(--muted)}.segmented button.active{background:#fff;color:var(--text);box-shadow:0 3px 10px rgba(80,52,59,.08)}.segmented.small{grid-template-columns:repeat(4,1fr);margin-top:9px}.segmented.small button{font-size:11px;padding:9px 3px}.controls-card{padding:12px}.stats-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:16px}.stat-card{background:#fff;border:1px solid var(--border);border-radius:20px;padding:16px;box-shadow:var(--shadow)}.stat-label{font-size:11px;font-weight:900;color:var(--muted);letter-spacing:.08em}.stat-value{font-weight:950;font-size:27px;letter-spacing:-.03em;margin-top:5px}.stat-sub{font-size:11px;color:var(--muted);margin-top:4px}.chart-card canvas{width:100%;display:block;background:linear-gradient(180deg,#fff,#fffafb);border-radius:16px}.chart-legend{font-size:11px;color:var(--muted);display:flex;gap:5px;align-items:center}.dot{width:9px;height:9px;border-radius:50%;display:inline-block}.dot.sys{background:var(--pink)}.dot.dia{background:var(--blue)}.muted{color:var(--muted)}.tiny{font-size:12px;line-height:1.45}.table-wrap{overflow:auto;margin-bottom:14px}.report-table{width:100%;border-collapse:collapse;min-width:520px;font-size:13px}.report-table th,.report-table td{padding:10px 7px;border-bottom:1px solid var(--border);text-align:left}.report-table th{font-size:10px;color:var(--muted);letter-spacing:.08em}.report-table td.strong{font-weight:850}.secondary-btn,.danger-ghost{border:1px solid var(--border);background:#fff;border-radius:17px;padding:14px;font-weight:850}.secondary-btn{color:var(--pink-dark)}.danger-ghost{color:var(--red);background:#fffafa}.full{width:100%;margin-top:10px}.history-list,.medicine-list{display:grid;gap:10px}.history-item,.medicine-item{display:flex;gap:12px;align-items:center;padding:13px 0;border-bottom:1px solid var(--border)}.history-item:last-child,.medicine-item:last-child{border-bottom:0}.history-reading{font-size:22px;font-weight:900;min-width:110px}.history-info,.medicine-info{flex:1;min-width:0}.history-date,.medicine-name{font-weight:850}.history-meta,.medicine-meta{font-size:12px;color:var(--muted)}.mini-status{font-size:11px;font-weight:900;padding:6px 8px;border-radius:999px}.mini-status.ok{background:var(--green-soft);color:var(--green)}.mini-status.attention{background:var(--amber-soft);color:#8a5c25}.mini-status.danger{background:var(--red-soft);color:var(--red)}.delete-btn,.edit-btn{border:0;background:#f7f1f2;border-radius:12px;width:38px;height:38px}.settings-card h2{margin-bottom:14px}.settings-card label,.sheet label:not(.big-field){display:block;font-size:13px;font-weight:800;margin:12px 0}.settings-card input,.settings-card select,.sheet label:not(.big-field) input{width:100%;border:1px solid var(--border);background:#fff;border-radius:14px;padding:13px;margin-top:6px;outline:none}.settings-card input:focus,.settings-card select:focus,.sheet input:focus{border-color:#dda3ad;box-shadow:0 0 0 3px #fbe9ed}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}.switch-row{display:flex!important;align-items:center;justify-content:space-between;gap:16px}.switch-row input{width:22px!important;height:22px;margin:0!important}.screen-note{font-size:12px;line-height:1.55;color:var(--muted);padding:0 8px 20px}.hidden{display:none!important}.sheet-dialog{border:0;padding:0;background:transparent;max-width:none;width:100%;height:100%;margin:0}.sheet-dialog::backdrop{background:rgba(55,42,46,.36);backdrop-filter:blur(3px)}.sheet{position:fixed;left:50%;transform:translateX(-50%);bottom:0;width:min(100%,720px);background:#fff;border-radius:30px 30px 0 0;padding:10px 20px calc(24px + env(safe-area-inset-bottom));box-shadow:0 -12px 50px rgba(64,40,48,.18);max-height:94vh;overflow:auto}.sheet-handle{width:48px;height:5px;border-radius:999px;background:#e4dadd;margin:1px auto 16px}.sheet-title-row{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.sheet-title-row h2{font-size:28px;margin-top:3px}.close-btn{font-size:31px;width:42px;height:42px;background:#f7f0f1;border-radius:15px}.big-field{display:block;background:#fff9fa;border:1px solid var(--border);padding:13px 15px;border-radius:19px;margin:10px 0}.big-field>span{display:block;font-size:13px;font-weight:750;color:var(--muted)}.big-field>div{display:flex;align-items:baseline;gap:8px}.big-field input{width:100%;border:0;background:transparent;outline:none;font-weight:950;font-size:40px;letter-spacing:-.04em;padding:2px 0}.big-field em{font-size:12px;color:var(--muted);font-style:normal}.result-sheet{text-align:center}.result-icon{width:68px;height:68px;border-radius:24px;background:var(--green-soft);color:var(--green);display:grid;place-items:center;font-size:32px;font-weight:950;margin:5px auto 12px}.result-sheet h2{font-size:28px}.result-reading{font-size:44px;font-weight:950;letter-spacing:-.05em;margin:9px 0}.result-sheet p{font-size:17px;line-height:1.45}.medical-note{text-align:left;border-radius:18px;padding:13px 14px;background:#faf6f5;color:var(--muted);font-size:13px;line-height:1.45}.result-sheet.danger .result-icon{background:var(--red-soft);color:var(--red)}.result-sheet.danger .medical-note{background:var(--red-soft);color:#71383c}.result-sheet.attention .result-icon{background:var(--amber-soft);color:var(--amber)}@media(min-width:700px){.app-shell{padding-left:28px;padding-right:28px}.quick-link{min-height:78px}.hero{padding-top:34px}.sheet{bottom:18px;border-radius:30px;max-width:650px}.stats-grid{grid-template-columns:repeat(4,1fr)}}@media print{body{background:#fff}.topbar,.page-head button,.controls-card,.primary-cta,.quick-links,.secondary-btn,.screen-note,#medicineToday{display:none!important}.app-shell{width:100%;max-width:none;padding:0}.view{display:none!important}#reportsView{display:block!important}.card,.stat-card{box-shadow:none;border-color:#ddd;break-inside:avoid}.chart-card{break-inside:avoid}.page-head{padding:0 0 10px}}

.topbar-spacer{width:46px;height:46px}
.measurement-period-block{margin:4px 0 14px}
.measurement-period-label{display:block;font-size:13px;font-weight:850;color:var(--muted);margin:0 0 7px 3px}
.measurement-period-picker{grid-template-columns:repeat(3,1fr);background:#f7f0f1}
.measurement-period-picker button{font-size:12px;line-height:1.2;min-height:48px;padding:8px 4px}
.measurement-period-picker button.active{background:#fff;color:var(--text);box-shadow:0 3px 10px rgba(80,52,59,.08)}


/* v0.2.2 — czytelniejsza historia i szybka korekta pory pomiaru */
.history-section{margin-bottom:18px}
.history-list{display:grid;gap:14px}
.history-entry{background:rgba(255,255,255,.95);border:1px solid var(--border);border-radius:24px;padding:17px 17px 14px;box-shadow:0 9px 28px rgba(94,58,67,.065)}
.history-entry-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.history-date-block{display:flex;align-items:baseline;gap:8px;min-width:0}
.history-date{font-size:14px;font-weight:900;white-space:nowrap}
.history-time{font-size:14px;font-weight:750;color:var(--muted)}
.history-values{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;padding:1px 0 14px}
.history-pressure{min-width:0}
.history-reading{font-size:34px;line-height:1;font-weight:950;letter-spacing:-.045em;min-width:0}
.history-unit{font-size:11px;color:var(--muted);margin-top:5px;font-weight:700}
.history-pulse{display:grid;grid-template-columns:auto auto;align-items:baseline;column-gap:5px;row-gap:1px;justify-content:end;text-align:right;flex:0 0 auto}
.history-pulse span{grid-column:1/3;font-size:11px;color:var(--muted);font-weight:800;text-transform:uppercase;letter-spacing:.06em}
.history-pulse strong{font-size:25px;line-height:1;font-weight:950}
.history-pulse small{font-size:11px;color:var(--muted)}
.history-period-edit{border-top:1px solid var(--border);padding-top:12px}
.history-edit-label{font-size:11px;font-weight:900;color:var(--muted);letter-spacing:.025em;margin-bottom:8px}
.history-edit-label span{font-weight:650;color:#a19397;letter-spacing:0}
.history-period-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;background:#f7f0f1;border-radius:15px;padding:5px}
.history-period-btn{border:0;background:transparent;border-radius:11px;min-height:39px;padding:7px 4px;font-size:11px;font-weight:850;color:var(--muted);line-height:1.15;display:flex;align-items:center;justify-content:center;gap:4px}
.history-period-btn span{font-size:13px}
.history-period-btn.active{background:#fff;color:var(--text);box-shadow:0 3px 10px rgba(80,52,59,.09)}
.history-period-btn:active{transform:scale(.98)}
.history-entry-footer{display:flex;justify-content:space-between;align-items:center;margin-top:7px}
.history-delete-btn,.history-edit-btn{border:0;background:transparent;font-size:11px;font-weight:800;padding:6px 2px}.history-delete-btn{color:#a56b73}.history-edit-btn{color:var(--pink-dark)}
.history-empty{padding:18px 5px}
@media(max-width:390px){
  .history-entry{padding:15px 14px 12px}
  .history-reading{font-size:31px}
  .history-date-block{gap:6px}
  .history-date,.history-time{font-size:13px}
  .history-period-btn{font-size:10px;gap:3px}
}

/* v0.2.3 — potwierdzenie zmiany pory pomiaru w historii */


/* v0.2.4 — ekran główny zawsze z widocznym dolnym menu + formularz nad klawiaturą */
#homeView{padding-bottom:96px}
#homeView .quick-links{
  position:fixed;z-index:35;left:50%;transform:translateX(-50%);
  bottom:calc(8px + env(safe-area-inset-bottom));
  width:min(calc(100% - 36px),684px);gap:8px;padding:7px;
  border:1px solid rgba(239,230,229,.95);border-radius:24px;
  background:rgba(255,249,247,.94);box-shadow:0 12px 36px rgba(75,48,57,.14);
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)
}
#homeView .quick-link{min-height:58px;border-radius:17px;background:rgba(255,255,255,.92)}
#homeView .quick-link span{font-size:12px}

/* Na krótszym ekranie przeglądarki lekko ściskamy tylko stronę główną — bez zmniejszania czytelności. */
@media(max-height:820px) and (max-width:699px){
  .app-shell{padding-left:16px;padding-right:16px;padding-bottom:calc(18px + env(safe-area-inset-bottom))}
  .topbar{height:56px}
  .hero{padding:12px 4px 12px;gap:12px}
  .hero-emoji{width:54px;height:54px;border-radius:19px;font-size:27px}
  .hero h1{font-size:clamp(27px,7vw,33px);margin-bottom:4px}
  .hero p{font-size:15px}
  #homeView .today-card{padding:16px;margin-bottom:10px;border-radius:22px}
  #homeView .section-heading{margin-bottom:11px}
  #homeView .period-list{gap:8px}
  #homeView .period-card{padding:10px 12px;border-radius:17px}
  #homeView .period-icon{width:42px;height:42px;border-radius:14px;font-size:21px}
  #homeView .period-value{font-size:22px}
  #homeView .period-meta{font-size:11px}
  #homeView .primary-cta{padding:16px 16px;margin:6px 0 8px;border-radius:19px}
}

/* Arkusz pomiaru ma respektować faktycznie widoczną część ekranu po otwarciu klawiatury. */
.measurement-sheet{
  bottom:var(--keyboard-offset,0px);
  max-height:min(94dvh,calc(var(--visual-viewport-height,100dvh) - 6px));
  overscroll-behavior:contain;
  padding:8px 18px calc(16px + env(safe-area-inset-bottom));
  scroll-padding-bottom:76px;
}
.measurement-sheet .sheet-handle{margin-bottom:9px}
.measurement-sheet .sheet-title-row h2{font-size:24px;line-height:1.05;margin-top:2px}
.measurement-sheet .close-btn{width:40px;height:40px;font-size:29px;border-radius:14px}
.measurement-sheet .measurement-period-block{margin:2px 0 8px}
.measurement-sheet .measurement-period-label{font-size:12px;margin-bottom:5px}
.measurement-sheet .measurement-period-picker{padding:4px;gap:4px;border-radius:14px}
.measurement-sheet .measurement-period-picker button{min-height:40px;padding:6px 3px;font-size:11px;border-radius:10px}
.measurement-sheet .big-field{padding:9px 12px;border-radius:17px;margin:6px 0}
.measurement-sheet .big-field>span{font-size:12px}
.measurement-sheet .big-field input{font-size:35px;line-height:1;padding:1px 0}
.measurement-sheet #saveMeasurementBtn{
  position:sticky;bottom:0;z-index:4;margin:8px 0 0;padding:15px 16px;
  box-shadow:0 9px 24px rgba(202,111,134,.30),0 -8px 18px rgba(255,255,255,.92)
}
body.keyboard-open .measurement-sheet{border-radius:22px 22px 0 0;padding-top:5px}
body.keyboard-open .measurement-sheet .sheet-handle{display:none}
body.keyboard-open .measurement-sheet .sheet-title-row{align-items:center;margin-bottom:2px}
body.keyboard-open .measurement-sheet .sheet-title-row .eyebrow{display:none}
body.keyboard-open .measurement-sheet .sheet-title-row h2{font-size:19px;margin:0}
body.keyboard-open .measurement-sheet .close-btn{width:34px;height:34px;font-size:25px;border-radius:11px}
body.keyboard-open .measurement-sheet .measurement-period-block{margin:2px 0 5px}
body.keyboard-open .measurement-sheet .measurement-period-label{display:none}
body.keyboard-open .measurement-sheet .measurement-period-picker button{min-height:34px;padding:4px 2px;font-size:10px}
body.keyboard-open .measurement-sheet .big-field{padding:6px 10px;margin:4px 0;border-radius:14px}
body.keyboard-open .measurement-sheet .big-field>span{font-size:11px}
body.keyboard-open .measurement-sheet .big-field input{font-size:31px}
body.keyboard-open .measurement-sheet #saveMeasurementBtn{padding:13px 14px;margin-top:6px;font-size:17px}


/* v0.2.5 — własna klawiatura numeryczna dla pomiaru; brak klawiatury systemowej */
.measurement-sheet{
  bottom:0;
  max-height:calc(100dvh - 4px);
  padding:9px 18px calc(14px + env(safe-area-inset-bottom));
  overflow:auto;
}
.measurement-sheet .sheet-handle{margin-bottom:8px}
.measurement-sheet .sheet-title-row h2{font-size:24px}
.measurement-sheet .measurement-period-block{margin:3px 0 8px}
.measurement-sheet .measurement-period-picker button{min-height:39px;padding:5px 3px;font-size:11px}
.measurement-fields{display:grid;gap:7px}
.measurement-sheet .big-field{padding:10px 13px;border-radius:18px;margin:0;transition:border-color .15s ease,box-shadow .15s ease,background .15s ease;cursor:pointer}
.measurement-sheet .big-field>span{font-size:12px}
.measurement-sheet .big-field input{font-size:40px;line-height:1;padding:1px 0;caret-color:transparent;user-select:none;pointer-events:none}
.measurement-sheet .big-field em{font-size:12px}
.measurement-input-field.active{background:#fff;border-color:#e5a8b7;box-shadow:0 0 0 3px rgba(217,120,136,.13)}
.measurement-input-field.active>span{color:var(--pink-dark)}
.measurement-keypad{
  display:grid;grid-template-columns:repeat(3,1fr);gap:6px;
  margin:9px 0 7px;padding:7px;border-radius:19px;
  background:linear-gradient(180deg,#fff7f8,#f8f1f4);border:1px solid var(--border)
}
.measurement-keypad button{
  min-height:42px;border:0;border-radius:13px;background:#fff;
  box-shadow:0 2px 7px rgba(80,52,59,.07);font-size:21px;font-weight:850;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent
}
.measurement-keypad button:active{transform:scale(.97);background:var(--pink-soft)}
.measurement-keypad .keypad-action{color:var(--pink-dark);background:#fffafb}
.measurement-keypad .keypad-next{font-size:13px;color:#fff;background:linear-gradient(135deg,var(--pink),#cf829c)}
.measurement-keypad .keypad-next:active{background:var(--pink-dark)}
.measurement-error{margin:3px 3px 0;color:#9b4a4f;font-size:12px;font-weight:750;text-align:center}
.measurement-sheet #saveMeasurementBtn{position:static;margin:6px 0 0;padding:14px 16px;box-shadow:0 9px 22px rgba(202,111,134,.26)}
/* Stare reguły dla systemowej klawiatury nie mają zastosowania do formularza pomiaru. */
body.keyboard-open .measurement-sheet{bottom:0;border-radius:30px 30px 0 0;padding:9px 18px calc(14px + env(safe-area-inset-bottom))}
body.keyboard-open .measurement-sheet .sheet-handle{display:block;margin-bottom:8px}
body.keyboard-open .measurement-sheet .sheet-title-row .eyebrow{display:inline}
body.keyboard-open .measurement-sheet .sheet-title-row h2{font-size:24px;margin-top:2px}
body.keyboard-open .measurement-sheet .close-btn{width:40px;height:40px;font-size:29px;border-radius:14px}
body.keyboard-open .measurement-sheet .measurement-period-block{margin:3px 0 8px}
body.keyboard-open .measurement-sheet .measurement-period-label{display:block}
body.keyboard-open .measurement-sheet .measurement-period-picker button{min-height:39px;padding:5px 3px;font-size:11px}
body.keyboard-open .measurement-sheet .big-field{padding:10px 13px;margin:0;border-radius:18px}
body.keyboard-open .measurement-sheet .big-field>span{font-size:12px}
body.keyboard-open .measurement-sheet .big-field input{font-size:40px}
body.keyboard-open .measurement-sheet #saveMeasurementBtn{padding:14px 16px;margin-top:6px;font-size:18px}
@media(max-height:720px) and (max-width:699px){
  .measurement-sheet{padding-top:6px}
  .measurement-sheet .sheet-handle{display:none}
  .measurement-sheet .sheet-title-row .eyebrow{display:none}
  .measurement-sheet .sheet-title-row h2{font-size:20px;margin:0}
  .measurement-sheet .close-btn{width:35px;height:35px;font-size:25px}
  .measurement-sheet .measurement-period-label{display:none}
  .measurement-sheet .measurement-period-block{margin:2px 0 5px}
  .measurement-sheet .measurement-period-picker button{min-height:33px;font-size:10px;padding:3px 2px}
  .measurement-fields{gap:5px}
  .measurement-sheet .big-field{padding:7px 11px;border-radius:15px}
  .measurement-sheet .big-field>span{font-size:11px}
  .measurement-sheet .big-field input{font-size:34px}
  .measurement-keypad{margin:6px 0 5px;padding:5px;gap:5px;border-radius:16px}
  .measurement-keypad button{min-height:36px;font-size:19px;border-radius:11px}
  .measurement-keypad .keypad-next{font-size:12px}
  .measurement-sheet #saveMeasurementBtn{padding:12px 14px;margin-top:4px;font-size:17px}
}


/* v0.2.6 — pomiar jako pełny ekran aplikacji + własny, stabilny kursor */
.measurement-view{padding-bottom:18px}
.measurement-page-head{padding-top:16px;padding-bottom:18px}
.measurement-page-head h1{font-size:33px}
.measurement-page{display:block}
.measurement-card{padding:18px;border-radius:26px;margin-bottom:14px}
.measurement-view .measurement-period-block{margin:0 0 16px}
.measurement-view .measurement-period-label{display:block;font-size:12px;font-weight:900;color:var(--muted);margin:0 0 7px 3px}
.measurement-view .measurement-period-picker{grid-template-columns:repeat(3,1fr);padding:5px;gap:5px;border-radius:17px}
.measurement-view .measurement-period-picker button{min-height:48px;padding:8px 5px;font-size:12px;border-radius:12px}
.measurement-view .measurement-fields{display:grid;gap:11px}
.measurement-view .big-field{padding:15px 17px;border-radius:21px;margin:0;min-height:100px;display:flex;flex-direction:column;justify-content:center;transition:border-color .15s ease,box-shadow .15s ease,background .15s ease;cursor:pointer}
.measurement-view .big-field>span{font-size:13px;margin-bottom:5px}
.measurement-view .measurement-value-row{display:flex;align-items:baseline;min-height:53px;gap:5px}
.measurement-view .big-field input{flex:0 0 auto;width:1ch;min-width:.7ch;max-width:3.3ch;border:0;background:transparent;outline:none;font-size:48px;line-height:1;font-weight:950;letter-spacing:-.04em;padding:0;caret-color:transparent;pointer-events:none;user-select:none}
.measurement-view .big-field em{margin-left:auto;font-size:14px;color:var(--muted);font-style:normal}
.measurement-view .measurement-input-field.active{background:#fff;border-color:#e4a0b1;box-shadow:0 0 0 4px rgba(217,120,136,.13)}
.measurement-view .measurement-input-field.active>span{color:var(--pink-dark)}
.fake-caret{display:none;width:3px;height:38px;border-radius:3px;background:var(--pink-dark);align-self:center;margin:0 3px 0 0;animation:measurementCaretBlink 1s steps(1,end) infinite}
.measurement-input-field.active .fake-caret{display:inline-block}
@keyframes measurementCaretBlink{0%,48%{opacity:1}49%,100%{opacity:.12}}
.measurement-view .measurement-keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:17px 0 2px;padding:10px;border-radius:22px;background:linear-gradient(180deg,#fff7f8,#f7f0f3);border:1px solid var(--border)}
.measurement-view .measurement-keypad button{min-height:56px;border:0;border-radius:16px;background:#fff;box-shadow:0 3px 9px rgba(80,52,59,.07);font-size:24px;font-weight:900;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.measurement-view .measurement-keypad button:active{transform:scale(.97);background:var(--pink-soft)}
.measurement-view .measurement-keypad .keypad-action{color:var(--pink-dark);background:#fffafb;font-size:22px}
.measurement-view .measurement-keypad .keypad-next{font-size:15px;color:#fff;background:linear-gradient(135deg,var(--pink),#cf829c)}
.measurement-view .measurement-keypad .keypad-next:active{background:var(--pink-dark)}
.measurement-view .measurement-error{margin:10px 4px 0;color:#9b4a4f;font-size:13px;font-weight:800;text-align:center}
.measurement-save{margin:4px 0 10px;padding:19px 18px}
.measurement-note{text-align:center;padding-bottom:8px}

@media(max-height:760px) and (max-width:699px){
  .measurement-page-head{padding-top:10px;padding-bottom:12px}
  .measurement-page-head h1{font-size:29px}
  .measurement-card{padding:14px 15px;border-radius:23px}
  .measurement-view .measurement-period-block{margin-bottom:11px}
  .measurement-view .measurement-period-picker button{min-height:43px;font-size:11px}
  .measurement-view .measurement-fields{gap:8px}
  .measurement-view .big-field{min-height:86px;padding:11px 14px;border-radius:18px}
  .measurement-view .big-field input{font-size:43px}
  .fake-caret{height:34px}
  .measurement-view .measurement-keypad{gap:7px;margin-top:12px;padding:8px}
  .measurement-view .measurement-keypad button{min-height:49px;font-size:22px}
  .measurement-save{padding:17px 16px}
}


/* v0.2.7 — układ pomiaru 1 + 2: SYS szeroko, DIA i puls pół na pół */
body.measurement-screen .topbar{display:none}
body.measurement-screen .app-shell{padding-top:max(env(safe-area-inset-top),0px)}
.measurement-view .measurement-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.measurement-view .measurement-field-wide{grid-column:1 / -1}
.measurement-view .measurement-field-half{grid-column:auto;min-width:0}
.measurement-view .measurement-field-half>span{font-size:12px;white-space:nowrap}
.measurement-view .measurement-field-half .measurement-value-row{min-width:0}
.measurement-view .measurement-field-half input{font-size:43px;max-width:2.9ch}
.measurement-view .measurement-field-half em{font-size:12px;margin-left:auto}
.measurement-view .measurement-keypad{margin-top:14px}
.measurement-note{display:none}

@media(max-width:430px){
  .measurement-view .measurement-field-half{padding:13px 12px}
  .measurement-view .measurement-field-half>span{font-size:11.5px}
  .measurement-view .measurement-field-half input{font-size:40px}
  .measurement-view .measurement-field-half em{font-size:11px}
}

@media(max-height:760px) and (max-width:699px){
  .measurement-view .measurement-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .measurement-view .measurement-field-wide{grid-column:1 / -1}
  .measurement-view .measurement-field-half{min-height:86px}
  .measurement-view .measurement-field-half input{font-size:38px}
  .measurement-view .measurement-keypad{margin-top:10px}
}


/* v0.2.8 — ostatnie dopasowanie wysokości ekranu pomiaru na S25 Ultra */
body.measurement-screen .measurement-card{padding-bottom:10px;margin-bottom:5px}
body.measurement-screen .measurement-view .measurement-keypad{margin-bottom:0}
body.measurement-screen .measurement-save{margin:0 0 6px;padding:18px 18px}
body.measurement-screen .measurement-view{padding-bottom:4px}

/* v0.2.9 — mikro-dopasowanie: cały przycisk zapisu widoczny na S25 Ultra */
@media(max-height:760px) and (max-width:699px){
  body.measurement-screen .measurement-page-head{padding-top:6px;padding-bottom:8px}
  body.measurement-screen .measurement-card{padding-top:12px}
  body.measurement-screen .measurement-view .measurement-period-block{margin-bottom:9px}
  body.measurement-screen .measurement-view .measurement-keypad{margin-top:8px}
  body.measurement-screen .measurement-view .measurement-keypad button{min-height:47px}
  body.measurement-screen .measurement-save{margin:-2px 0 12px;padding:16px 18px}
}


/* 0.2.10 — edycja pomiaru z historii */
.measurement-edit-dialog{border:0;padding:0;background:transparent;width:100%;max-width:none;margin:auto}
.measurement-edit-dialog::backdrop{background:rgba(55,42,46,.34);backdrop-filter:blur(3px)}
.measurement-edit-modal{width:min(calc(100vw - 34px),500px);margin:auto;background:#fff;border:1px solid var(--border);border-radius:27px;padding:20px;box-shadow:0 22px 70px rgba(70,42,51,.22)}
.measurement-edit-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px}
.measurement-edit-head h2{font-size:27px;margin:3px 0 0;letter-spacing:-.035em}
.measurement-edit-values{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.measurement-edit-values label{position:relative;display:block;background:#fff9fa;border:1px solid var(--border);border-radius:17px;padding:10px 10px 9px;min-width:0}
.measurement-edit-values label:focus-within{border-color:#dda3ad;box-shadow:0 0 0 3px #fbe9ed}
.measurement-edit-values span{display:block;font-size:11px;font-weight:900;color:var(--muted);margin-bottom:3px}
.measurement-edit-values input{width:100%;border:0;background:transparent;outline:0;font-size:28px;line-height:1.1;font-weight:950;letter-spacing:-.04em;padding:2px 0 15px;-moz-appearance:textfield}
.measurement-edit-values input::-webkit-outer-spin-button,.measurement-edit-values input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.measurement-edit-values small{position:absolute;left:10px;bottom:7px;color:var(--muted);font-size:9px;font-weight:700}
.measurement-edit-period-block{margin-top:16px}
.measurement-edit-caption{display:block;font-size:12px;font-weight:900;color:var(--muted);margin:0 0 7px 3px}
.measurement-edit-period-picker{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;background:#f7f0f1;border-radius:16px;padding:5px}
.measurement-edit-period-picker button{border:0;background:transparent;border-radius:12px;min-height:46px;padding:7px 3px;font-size:11px;font-weight:850;color:var(--muted)}
.measurement-edit-period-picker button.active{background:#fff;color:var(--text);box-shadow:0 3px 10px rgba(80,52,59,.09)}
.measurement-edit-save{margin:14px 0 0}
@media(max-width:380px){.measurement-edit-modal{padding:17px}.measurement-edit-values{gap:6px}.measurement-edit-values input{font-size:25px}.measurement-edit-period-picker button{font-size:10px}}

/* 0.2.11 — ręczne dodawanie starszego pomiaru z Historii */
.history-add-btn{width:100%;margin:0 0 14px;min-height:50px;background:rgba(255,255,255,.9);font-size:13px}
.history-add-datetime{display:grid;grid-template-columns:1.25fr .9fr;gap:8px;margin-bottom:10px}
.history-add-datetime label{display:block;background:#fff9fa;border:1px solid var(--border);border-radius:17px;padding:10px 11px 9px;min-width:0}
.history-add-datetime label:focus-within{border-color:#dda3ad;box-shadow:0 0 0 3px #fbe9ed}
.history-add-datetime span{display:block;font-size:11px;font-weight:900;color:var(--muted);margin-bottom:5px}
.history-add-datetime input{width:100%;border:0;background:transparent;outline:0;font-size:16px;font-weight:850;color:var(--text);padding:3px 0;min-width:0}
.history-add-modal .measurement-edit-period-picker button.active{background:#fff;color:var(--text);box-shadow:0 3px 10px rgba(80,52,59,.09)}
@media(max-width:380px){.history-add-datetime{grid-template-columns:1.15fr .85fr}.history-add-datetime input{font-size:14px}.history-add-btn{min-height:46px}}

