:root {
  --bg:#f4f4f5;--surface:#fff;--surface2:#f4f4f5;
  --blue:#2563eb;--blue-dark:#1d4ed8;--blue-pale:#eff6ff;
  --text:#111118;--text-2:#3f3f46;--text-3:#71717a;
  --border:#e4e4e7;
  --danger:#dc2626;--danger-pale:#fef2f2;
  --warn:#d97706;--warn-pale:#fffbeb;
  --ok:#16a34a;--ok-pale:#f0fdf4;
  --low:#2563eb;--low-pale:#eff6ff;
  --r:16px;--r-sm:12px;
  --btn-grad:linear-gradient(135deg,#3b82f6 0%,#2563eb 100%);
  --alert-border:#e8c060;--alert-text:#7a4a08;
}
[data-dark="1"]{
  --bg:#0f1117;--surface:#18191f;--surface2:#1e2028;
  --text:#f0f0f4;--text-2:#b8bac9;--text-3:#8e90a6;
  --border:#2a2b38;--blue-pale:#1a2540;
  --danger-pale:#2a1010;--warn-pale:#251a08;--ok-pale:#0a1f12;--low-pale:#0e1a30;
  --alert-border:#d97706;--alert-text:#fcd34d;
}
@media(prefers-color-scheme:dark){
  :root:not([data-dark="0"]){
    --bg:#0f1117;--surface:#18191f;--surface2:#1e2028;
    --text:#f0f0f4;--text-2:#b8bac9;--text-3:#8e90a6;
    --border:#2a2b38;--blue-pale:#1a2540;
    --danger-pale:#2a1010;--warn-pale:#251a08;--ok-pale:#0a1f12;--low-pale:#0e1a30;
    --alert-border:#d97706;--alert-text:#fcd34d;
  }
}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html{height:100%}
body{font-family:'Plus Jakarta Sans',sans-serif;background:var(--bg);color:var(--text);max-width:430px;margin:0 auto;min-height:100vh;-webkit-font-smoothing:antialiased;overscroll-behavior:none}
body.landing-mode{max-width:none}

/* SPLASH */
#splash{position:fixed;inset:0;background:var(--bg);display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:999;transition:opacity .3s}
@keyframes spin{to{transform:rotate(360deg)}}

/* LOGIN */
#login-screen{display:none;flex-direction:column;align-items:center;justify-content:center;min-height:100vh;padding:32px 24px;background:var(--bg)}
.login-icon{font-size:64px;margin-bottom:20px}
.login-title{font-size:28px;font-weight:700;margin-bottom:8px;text-align:center}
.login-sub{font-size:14px;color:var(--text-2);margin-bottom:40px;text-align:center;line-height:1.5}
#login-form,#login-magic{width:100%}
#login-sent{display:none;flex-direction:column;align-items:center;text-align:center;width:100%}
.login-sent-icon{font-size:48px;margin-bottom:16px}
.login-sent-title{font-size:18px;font-weight:700;margin-bottom:8px}
.login-sent-sub{font-size:13px;color:var(--text-2);line-height:1.6;margin-bottom:24px}
.login-back{font-size:13px;color:var(--text-3);background:none;border:none;cursor:pointer;font-family:inherit}
.lerr{font-size:12px;color:var(--danger);margin-top:8px;min-height:16px}

/* LAYOUT */
.page{display:none;flex-direction:column;min-height:100vh;padding-bottom:76px;animation:fadeUp .2s ease}
.page.active{display:flex}
@keyframes fadeUp{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
.scroll-area{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:16px}

/* TOPBAR */
.topbar{padding:48px 20px 14px;background:var(--surface);border-bottom:1px solid var(--border)}
.topbar-row{display:flex;align-items:center;justify-content:space-between}
.topbar h1{font-size:26px;font-weight:700}
.chip{font-size:13px;font-weight:600;color:var(--text);background:var(--blue-pale);border:1px solid var(--blue);padding:5px 12px;border-radius:20px}

/* NAV */
.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:430px;background:var(--surface);border-top:1px solid var(--border);display:flex;z-index:100;padding-bottom:env(safe-area-inset-bottom)}
.nav-btn{flex:1;display:flex;flex-direction:column;align-items:center;padding:10px 0 8px;gap:3px;border:none;background:none;cursor:pointer;color:var(--text-3);font-size:10px;font-family:inherit;font-weight:500;transition:color .2s}
.nav-btn svg{width:22px;height:22px;stroke-width:1.7;fill:none;stroke:currentColor}
.nav-btn.active{color:var(--blue)}
.nav-btn.active svg{stroke-width:2.2}

/* FAB */
.fab{position:fixed;bottom:86px;right:calc(50% - 215px + 16px);width:56px;height:56px;border-radius:50%;background:var(--btn-grad);color:white;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 20px rgba(37,99,235,.38);z-index:99;transition:transform .15s}
.fab:active{transform:scale(.93)}
.fab svg{width:24px;height:24px;fill:none;stroke:white;stroke-width:2.5}

/* HERO */
.hero{background:var(--blue);color:white;border-radius:var(--r);padding:22px 24px;margin-bottom:12px;position:relative;overflow:hidden}
.hero::before{content:'';position:absolute;top:-50px;right:-50px;width:160px;height:160px;background:rgba(255,255,255,.05);border-radius:50%}
.hero-lbl{font-size:11px;font-weight:500;opacity:.65;text-transform:uppercase;letter-spacing:1px;margin-bottom:6px}
.hero-val{font-weight:700;font-size:62px;line-height:1}
.hero-val small{font-size:16px;opacity:.55;font-weight:300}
.hero-meta{font-size:12px;opacity:.6;margin-top:2px}
.hero-badge{display:inline-block;margin-top:10px;background:rgba(255,255,255,.18);padding:3px 10px;border-radius:12px;font-size:12px;font-weight:600}

/* STATS */
.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-sm);padding:14px}
.stat-lbl{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.6px;color:var(--text-3);margin-bottom:4px}
.stat-val{font-weight:700;font-size:28px;line-height:1}
.stat-sub{font-size:11px;color:var(--text-3);margin-top:2px}
.sec-title{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.7px;color:var(--text-3);margin:14px 0 8px}

/* ENTRY */
.entry{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-sm);padding:13px 14px;margin-bottom:8px;display:flex;gap:12px;align-items:flex-start}
.entry-dot{width:10px;height:10px;border-radius:50%;margin-top:4px;flex-shrink:0}
.entry-body{flex:1;min-width:0}
.entry-main{font-weight:700;font-size:24px;line-height:1}
.entry-tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:5px}
.tag{background:var(--bg);border:1px solid var(--border);padding:2px 8px;border-radius:10px;font-size:11px;color:var(--text-2)}
.entry-sub{font-size:12px;color:var(--text-2);margin-top:4px}
.entry-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.entry-time{font-size:11px;color:var(--text-3);white-space:nowrap}
.edit-btn{background:none;border:none;cursor:pointer;padding:4px;color:var(--text-3);border-radius:8px;display:flex;align-items:center}

/* ALERT */
.alert{display:flex;align-items:center;gap:10px;background:var(--warn-pale);border:1.5px solid var(--alert-border);border-radius:var(--r-sm);padding:12px 14px;margin-bottom:12px}
.alert-icon{font-size:22px}
.alert-text{font-size:13px;font-weight:600;color:var(--alert-text)}

/* OVERLAY / SHEET */
.overlay{position:fixed;inset:0;background:rgba(20,20,20,.5);z-index:200;display:none;align-items:flex-end;backdrop-filter:blur(2px)}
.overlay.open{display:flex}
.sheet{background:var(--surface);border-radius:var(--r) var(--r) 0 0;width:100%;max-width:430px;margin:0 auto;padding-bottom:max(24px,env(safe-area-inset-bottom));animation:slideUp .25s cubic-bezier(.34,1.1,.64,1)}
@keyframes slideUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
.sheet-handle{width:36px;height:4px;background:var(--border);border-radius:2px;margin:10px auto 14px}
.sheet-title{font-weight:700;font-size:20px;padding:0 20px 14px;border-bottom:1px solid var(--border);margin-bottom:16px;display:flex;align-items:center;gap:10px}
.sheet-body{padding:0 18px}

/* TYPE SELECTOR */
.type-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:0 18px 8px}
.type-btn{background:var(--bg);border:1.5px solid var(--border);border-radius:var(--r);padding:20px 16px;cursor:pointer;font-family:inherit;text-align:left;transition:all .15s}
.type-btn:active{border-color:var(--blue);background:var(--blue-pale)}
.type-btn-icon{font-size:28px;margin-bottom:8px}
.type-btn-label{font-size:14px;font-weight:700;color:var(--text);display:block}

.ob-choice{display:flex;align-items:center;gap:12px;border:1.5px solid var(--border);border-radius:var(--r-sm);padding:16px;margin-bottom:12px;cursor:pointer;transition:border-color .15s}
.ob-choice:active{border-color:var(--blue);background:var(--blue-pale)}
.type-btn-sub{font-size:11px;color:var(--text-3);margin-top:2px;display:block}

/* FORM */
.flbl{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;color:var(--text-3);display:block;margin-bottom:5px}
.finput{width:100%;background:var(--bg);border:1.5px solid var(--border);border-radius:var(--r-sm);padding:12px 14px;font-size:16px;font-family:inherit;color:var(--text);outline:none;transition:border-color .2s;-webkit-appearance:none;margin-bottom:14px}
.finput:focus{border-color:var(--blue);background:var(--surface)}
.finput::placeholder{color:var(--text-3)}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}
.finput-wrap{display:flex;flex-direction:column}
.finput-sub{font-size:11px;color:var(--text-3);margin-bottom:4px}
.btn-primary{width:100%;background:var(--btn-grad);color:white;border:none;border-radius:var(--r-sm);padding:15px;font-size:15px;font-weight:700;font-family:inherit;cursor:pointer;transition:opacity .15s,transform .1s;margin-top:4px;box-shadow:0 2px 12px rgba(37,99,235,.3)}
.btn-primary:active{transform:scale(.99)}
.btn-primary:disabled{opacity:.6;cursor:not-allowed}

/* TOGGLE */
.toggle-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:14px}
.toggle-btn{padding:11px;border:1.5px solid var(--border);border-radius:var(--r-sm);background:var(--bg);cursor:pointer;font-family:inherit;font-size:14px;font-weight:600;color:var(--text-3);transition:all .15s;text-align:center}
.toggle-btn.sel{border-color:var(--blue);background:var(--blue-pale);color:var(--blue-dark,#1d4ed8)}

/* HISTORY */
.day-group{margin-bottom:20px}
.day-hdr{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.6px;color:var(--text-3);margin-bottom:8px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}

/* REPORT */
.report-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.rstat{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-sm);padding:16px;text-align:center}
.rstat-val{font-weight:700;font-size:34px;line-height:1}
.rstat-lbl{font-size:11px;color:var(--text-3);margin-top:3px}
.chart-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);padding:16px;margin-bottom:12px}
.chart-title{font-size:12px;font-weight:600;color:var(--text-2);margin-bottom:14px;text-transform:uppercase;letter-spacing:.5px}
.chart-wrap{position:relative;height:200px}
.period-toggle{display:flex;gap:6px}
.ptbtn{font-size:12px;font-weight:600;padding:4px 12px;border-radius:20px;border:1.5px solid var(--border);background:none;cursor:pointer;font-family:inherit;color:var(--text-2);transition:all .15s}
.ptbtn.sel{background:var(--blue);color:white;border-color:var(--blue)}
.cat-tabs{display:flex;gap:6px;overflow-x:auto;padding-bottom:4px;margin-bottom:14px;-ms-overflow-style:none;scrollbar-width:none}
.cat-tabs::-webkit-scrollbar{display:none}
.cat-tab{font-size:12px;font-weight:600;padding:6px 14px;border-radius:20px;border:1.5px solid var(--border);background:none;cursor:pointer;font-family:inherit;color:var(--text-2);white-space:nowrap;transition:all .15s}
.cat-tab.sel{background:var(--blue);color:white;border-color:var(--blue)}

/* SETTINGS */
.settings-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);margin-bottom:12px;overflow:hidden}
.srow{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--border)}
.srow:last-child{border-bottom:none}
.srow-lbl{font-size:14px;font-weight:500}
.srow-sub{font-size:11px;color:var(--text-3);margin-top:2px}
.sinput{background:var(--bg);border:1.5px solid var(--border);border-radius:8px;padding:8px 10px;font-size:14px;font-family:inherit;color:var(--text);outline:none;width:100px;text-align:center;-webkit-appearance:none}
.sinput:focus{border-color:var(--blue)}
.sw-wrap{position:relative;display:inline-block;width:46px;height:26px;cursor:pointer}
.sw-wrap input{opacity:0;width:0;height:0}
.sw{position:absolute;inset:0;background:var(--border);border-radius:26px;transition:.2s}
.sw::before{content:'';position:absolute;width:20px;height:20px;left:3px;top:3px;background:white;border-radius:50%;transition:.2s}
.sw-wrap input:checked+.sw{background:var(--blue)}
.sw-wrap input:checked+.sw::before{transform:translateX(20px)}

/* MED LIST */
.med-item{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-bottom:1px solid var(--border)}
.med-item:last-child{border-bottom:none}
.med-name{font-size:14px;font-weight:600}
.med-dose{font-size:12px;color:var(--text-3)}
.med-del{background:none;border:none;color:var(--danger);cursor:pointer;font-size:18px;padding:4px}

/* MISC */
.empty{text-align:center;padding:48px 24px;color:var(--text-3)}
.empty-icon{font-size:40px;margin-bottom:12px}
.empty p{font-size:14px;line-height:1.5}
.toast{position:fixed;bottom:92px;left:50%;transform:translateX(-50%) translateY(12px);background:#1c1a17;color:white;padding:10px 20px;border-radius:30px;font-size:13px;font-weight:500;opacity:0;transition:all .25s;z-index:400;white-space:nowrap;pointer-events:none}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.bg-badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:10px;font-size:11px;font-weight:600}

/* LANDING */
.landing-wrap{max-width:1080px;margin:0 auto;padding:20px 24px 40px}
.landing-nav{display:flex;align-items:center;justify-content:space-between;padding:8px 0 28px}
.landing-nav-brand{font-size:16px;font-weight:700}

.landing-hero{display:flex;flex-direction:column;gap:28px;padding:12px 0 40px}
.landing-hero-text h1{font-size:30px;line-height:1.25;font-weight:800;margin-bottom:14px}
.landing-hero-text p{font-size:15px;line-height:1.6;color:var(--text-2);margin-bottom:24px;max-width:480px}
.landing-cta-row{display:flex;gap:12px;flex-wrap:wrap}
.landing-btn-outline{background:none;border:1.5px solid var(--border);border-radius:var(--r-sm);padding:14px 26px;font-size:15px;font-weight:700;color:var(--text-2);cursor:pointer;font-family:inherit}
.landing-btn-outline:active{border-color:var(--blue);color:var(--blue)}

.landing-shots{display:flex;gap:14px;overflow-x:auto;padding:4px 0 8px;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.landing-shots::-webkit-scrollbar{display:none}
.landing-shots img{height:340px;width:auto;border-radius:20px;border:1px solid var(--border);box-shadow:0 12px 32px rgba(0,0,0,.12);flex-shrink:0}

.landing-features{display:grid;grid-template-columns:1fr;gap:20px;padding:24px 0;border-top:1px solid var(--border)}
.landing-feature-row{display:flex;gap:14px;align-items:flex-start}
.landing-feature-icon{font-size:24px;flex-shrink:0}
.landing-feature-title{font-size:15px;font-weight:700;margin-bottom:4px}
.landing-feature-text{font-size:13px;color:var(--text-2);line-height:1.5}

.landing-showcase{display:flex;flex-direction:column;align-items:center;gap:24px;padding:32px 0;border-top:1px solid var(--border);text-align:center}
.landing-showcase-text h2{font-size:22px;font-weight:800;margin-bottom:10px}
.landing-showcase-text p{font-size:14px;line-height:1.6;color:var(--text-2)}
.landing-showcase-imgs{display:flex;gap:14px;justify-content:center;flex-wrap:wrap}
.landing-showcase-imgs img{height:320px;width:auto;border-radius:20px;border:1px solid var(--border);box-shadow:0 12px 32px rgba(0,0,0,.12)}

.landing-footer{padding:24px 0 8px;border-top:1px solid var(--border);text-align:center}
.landing-footer p{font-size:12px;color:var(--text-3);line-height:1.6;margin-bottom:8px}
.landing-footer a{color:var(--text-2)}

@media(min-width:860px){
  .landing-hero{flex-direction:row;align-items:center;gap:48px;padding:32px 0 56px}
  .landing-hero-text{flex:1}
  .landing-shots{flex:1;overflow-x:visible;flex-wrap:wrap;justify-content:flex-end}
  .landing-hero-text h1{font-size:44px}
  .landing-shots img{height:480px}
  .landing-features{grid-template-columns:1fr 1fr}
  .landing-showcase{flex-direction:row;text-align:left;gap:56px;padding:48px 0}
  .landing-showcase.reverse{flex-direction:row-reverse}
  .landing-showcase-text{flex:1}
  .landing-showcase-text p{max-width:420px}
  .landing-showcase-imgs{flex:1}
  .landing-showcase-imgs img{height:440px}
}

/* HERO (üç alanlı: boş | son ölçüm | tahmini HbA1c) */
.hero3{display:flex;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-sm);padding:20px 14px;margin-bottom:12px}
.hero-side{flex:1;display:flex;flex-direction:column;align-items:center;min-width:0}
.hero-center{display:flex;flex-direction:column;align-items:center}
.hero3 .hero-lbl{font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.6px;color:var(--text-3);opacity:1;margin-bottom:12px;text-align:center}
.hero3 .hero-lbl.small{font-size:9px;letter-spacing:.4px;margin-bottom:8px}
.hcircle{border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff}
.hcircle.big{width:128px;height:128px}
.hcircle.small{width:84px;height:84px}
.hc-num{font-weight:700;font-size:38px;line-height:42px}
.hcircle.small .hc-num{font-size:24px;line-height:28px}
.hc-unit{font-size:11px;opacity:.85;font-weight:500;margin-top:1px}
.hcircle.small .hc-unit{font-size:10px}
.hero3 .hero-meta{font-size:11px;color:var(--text-3);opacity:1;margin-top:12px;text-align:center}
.hero3 .hero-meta.small{font-size:10px;margin-top:8px}
.hcircle-wrap{position:relative}
.info-badge{position:absolute;top:-8px;right:-8px;width:22px;height:22px;border-radius:50%;background:#f08a24;color:#fff;border:none;font-weight:800;font-size:13px;font-family:inherit;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 4px rgba(0,0,0,.25)}

/* KAYIT KARTLARI (ikon paneli + değer rozeti + görünür düzenle/sil) */
.entry.e-row,.entry.e-card{padding:0;gap:0;align-items:stretch;overflow:hidden;cursor:pointer;transition:opacity .35s,transform .35s,max-height .3s .3s,margin .3s .3s}
.entry.removing{opacity:0;transform:translateX(100%);pointer-events:none}
.e-panel{width:58px;flex-shrink:0;display:flex;align-items:center;justify-content:center}
.e-content{flex:1;min-width:0;display:flex;gap:12px;align-items:center}
.e-row .e-content{padding:10px 8px 10px 12px}
.e-card .e-content{padding:13px 8px 13px 13px;align-items:flex-start}
.e-body{flex:1;min-width:0}
.e-valrow{display:flex;align-items:baseline;gap:4px}
.e-val{font-weight:700;font-size:20px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.e-unit{font-size:12px;color:var(--text-3)}
.e-meta{font-size:12px;color:var(--text-2);margin-top:1px}
.e-time{font-size:12px;font-weight:500;color:var(--text-3);white-space:nowrap}
.e-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.e-time2{font-size:12px;font-weight:600;color:var(--text-2)}
.e-pill{border:1px solid var(--border);background:var(--bg);padding:1px 7px;border-radius:8px;font-size:10px;font-weight:600;color:var(--text-2)}
.e-title{font-weight:700;font-size:16px;margin-top:2px}
.e-block{min-width:72px;padding:6px 10px;border-radius:var(--r-sm);color:#fff;display:flex;flex-direction:column;align-items:center}
.e-block b{font-weight:800;font-size:22px;line-height:1.2}
.e-block span{font-size:10px;font-weight:600;opacity:.9}
.e-actions{display:flex;flex-direction:column;gap:2px;flex-shrink:0}
.e-row .e-actions{flex-direction:row}
.e-act{width:34px;height:34px;border:none;border-radius:8px;background:none;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--text-3);transition:background .15s,color .15s}
.e-act.edit:hover{background:var(--blue-pale);color:var(--blue)}
.e-act.del:hover{background:var(--danger-pale);color:var(--danger)}

/* KAYITLAR: arama + filtreler */
.h-searchrow{display:flex;gap:8px;align-items:center}
.h-search{flex:1;min-width:0;background:var(--surface);border:1px solid var(--border);border-radius:var(--r-sm);padding:10px 12px;font-size:14px;font-family:inherit;color:var(--text);outline:none;-webkit-appearance:none}
.h-search:focus{border-color:var(--blue)}
.h-filterbtn{position:relative;width:42px;height:42px;flex-shrink:0;border:1.5px solid var(--border);border-radius:var(--r-sm);background:var(--surface);color:var(--text-2);cursor:pointer;display:flex;align-items:center;justify-content:center}
.h-filterbtn.active{border-color:var(--blue);background:var(--blue-pale);color:var(--blue)}
.h-dot{position:absolute;top:7px;right:7px;width:8px;height:8px;border-radius:50%;background:var(--blue)}
.h-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-sm);padding:12px;margin-top:8px}
.hp-lbl{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.6px;color:var(--text-3);margin:4px 0 6px}
.hp-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}
.h-chips{display:flex;gap:8px;overflow-x:auto;padding:12px 0 6px;scrollbar-width:none}
.h-chips::-webkit-scrollbar{display:none}
.hchip{font-size:12px;font-weight:600;padding:6px 14px;border-radius:20px;border:1.5px solid var(--border);background:none;cursor:pointer;font-family:inherit;color:var(--text-2);white-space:nowrap}
.hchip.sel{background:var(--blue);color:#fff;border-color:var(--blue)}
.h-range{font-size:12px;font-weight:500;color:var(--text-3);padding:6px 0 12px}
.hlink{background:none;border:none;color:var(--blue);font-weight:600;font-size:13px;font-family:inherit;cursor:pointer;margin-top:4px}
.more-btn{width:100%;padding:14px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--blue);font-weight:600;font-size:14px;font-family:inherit;cursor:pointer;margin-bottom:80px}

/* İLAÇLAR SEKMESİ */
.med-empty{padding:12px 16px 14px;font-size:13px;color:var(--text-3)}
.med-card .srow{gap:10px}
.med-chips{display:flex;gap:8px;flex-wrap:wrap;padding:14px 16px 14px}
.med-dates{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.med-add-row{display:flex;gap:8px;align-items:center;padding:14px 16px 14px}
.med-plus{width:40px;height:40px;border:none;border-radius:var(--r-sm);background:var(--blue);color:#fff;font-weight:700;font-size:20px;cursor:pointer;font-family:inherit;flex-shrink:0}
.med-small-btn{border:1.5px solid var(--blue);border-radius:8px;background:none;color:var(--blue);font-weight:600;font-size:13px;padding:7px 12px;cursor:pointer;font-family:inherit}
.med-rem-row{display:flex;align-items:center;gap:8px;padding:12px 16px;border-top:1px solid var(--border)}
.med-check{display:flex;align-items:center;gap:10px;padding:12px 16px;border-top:1px solid var(--border);cursor:pointer}
.med-cb{width:22px;height:22px;border-radius:50%;border:2px solid var(--border);display:flex;align-items:center;justify-content:center;color:#fff;font-size:13px;font-weight:700;flex-shrink:0}
.med-cb.done{background:var(--ok);border-color:var(--ok)}
.sw-wrap.sm{width:38px;height:22px;flex-shrink:0}
.sw-wrap.sm .sw{border-radius:22px}
.sw-wrap.sm .sw::before{width:16px;height:16px;left:3px;top:3px}
.sw-wrap.sm input:checked+.sw::before{transform:translateX(16px)}
.med-period{padding:14px 16px;border-bottom:1px solid var(--border)}
.med-period .srow-sub{line-height:1.45}
.med-date{display:flex;flex-direction:column;gap:3px;flex:1;min-width:130px}
.med-date span{font-size:12px;font-weight:600;color:var(--text-2)}
.med-date .sinput{width:100%;text-align:left}

/* MASAÜSTÜ: uygulama telefon çerçevesi içinde gösterilir.
   transform, fixed öğelerin (alt menü, FAB, pencereler, toast) çerçeveye göre konumlanmasını sağlar. */
@media(min-width:600px){
  html:has(body.app-mode){background:#d9dbe1}
  body.app-mode{height:min(880px,calc(100vh - 40px));min-height:0;margin:20px auto;border:10px solid #16171c;border-radius:44px;box-shadow:0 24px 60px rgba(0,0,0,.28),0 0 0 2px #3a3c46;overflow:hidden;transform:translateZ(0);position:relative}
  body.app-mode #app-wrap{height:100%}
  body.app-mode .page{height:100%;min-height:0;padding-bottom:0}
  body.app-mode .scroll-area{padding-bottom:96px}
  body.app-mode .topbar{padding-top:34px}
  body.app-mode .bottom-nav{width:100%;max-width:none;left:0;transform:none}
  body.app-mode .fab{right:16px}
  body.app-mode .overlay{border-radius:34px}
}
@media(min-width:600px){
  html[data-dark="1"]:has(body.app-mode){background:#07080b}
}
@media(min-width:600px) and (prefers-color-scheme:dark){html:not([data-dark="0"]):has(body.app-mode){background:#07080b}}
@media(min-width:600px){body.app-mode .scroll-area{scrollbar-width:none}body.app-mode .scroll-area::-webkit-scrollbar{display:none}}
@media(min-width:600px){
  /* iç köşeler: kenarlık 10px, dış yarıçap 44px => içerik yarıçapı 34px */
  body.app-mode #app-wrap{border-radius:34px;overflow:hidden;clip-path:inset(0 round 34px)}
  body.app-mode .bottom-nav{border-radius:0 0 34px 34px}
  body.app-mode .overlay{clip-path:inset(0 round 34px)}
}
@media(min-width:600px){
  /* iPhone "dynamic island" çentiği */
  body.app-mode::before{content:'';position:absolute;top:9px;left:50%;transform:translateX(-50%);width:104px;height:28px;border-radius:20px;background:#16171c;z-index:1000;pointer-events:none}
  body.app-mode .topbar{padding-top:44px}
}

/* RAPOR GRAFİKLERİ */
.donut-row{display:flex;align-items:center;gap:16px}
.donut-wrap{position:relative;width:150px;height:150px;flex-shrink:0}
.donut-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.donut-center b{font-size:30px;font-weight:800}
.donut-center span{font-size:11px;color:var(--text-3)}
.lg-col{flex:1;display:flex;flex-direction:column;gap:10px;min-width:0}
.lg-row{display:flex;align-items:center;gap:10px}
.lg-dot{width:12px;height:12px;border-radius:50%;flex-shrink:0}
.lg-t{font-size:13px;font-weight:600}
.lg-s{font-size:11px;color:var(--text-3)}
.lg-inline{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px;font-size:11px;color:var(--text-3)}
.sw-box{width:12px;height:12px;border-radius:3px;display:inline-block}
.sw-line{width:16px;height:3px;border-radius:2px;display:inline-block;margin-left:8px}
.bars-row{display:flex;gap:10px}
.bar-col{flex:1;display:flex;flex-direction:column;align-items:center}
.bar-val{font-size:14px;font-weight:700}
.bar-track{width:100%;display:flex;flex-direction:column;justify-content:flex-end;background:var(--bg);border-radius:6px;margin-top:4px;overflow:hidden}
.bar-part{font-size:12px;font-weight:600;color:var(--text-2);margin-top:6px}
.bar-n{font-size:10px;color:var(--text-3)}
.adh-block{margin-bottom:18px}
.adh-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.adh-name{font-size:14px;font-weight:700}
.adh-sub{font-size:11px;color:var(--text-3)}
.adh-pct{font-size:22px;font-weight:800}
.adh-cells{display:flex;flex-wrap:wrap}
.adh-cells span{display:inline-block}
.cmp-row{display:flex;align-items:center;gap:10px;padding:12px 0;border-bottom:1px solid var(--border)}
.cmp-row:last-child{border-bottom:none}
.cmp-l{flex:1;font-size:14px}
.cmp-r{text-align:right}
.cmp-v{font-size:18px;font-weight:700}
.cmp-d{font-size:11px}
.gdot-info{min-height:20px;font-size:13px;font-weight:600;color:var(--text-3);margin-bottom:4px}
.gdot-info.on{color:var(--text)}
