:root {
  --bg: #F3F4F8;
  --card: #FFFFFF;
  --ink: #0E1525;
  --ink-2: #1E2738;
  --text-2: #3B4357;
  --muted: #5E6678;
  --muted-on-dark: #A9B1C3;
  --line: #E4E7EF;
  --line-2: #C9CEDA;
  --lime: #C6F36B;
  --blue: #2F5BEA;
  --blue-ink: #1F44C2;
  --blue-soft: #E6EBFF;
  --green: #12A37A;
  --green-ink: #0B7A5A;
  --green-soft: #E3F6EF;
  --coral: #FF6B4A;
  --coral-ink: #A8341A;
  --coral-deep: #7A2410;
  --coral-soft: #FFEDE7;
  --coral-line: #FFC2B0;
  --water: #2F80ED;
  --water-soft: #E4F0FD;
  --amber-soft: #FFF4D6;
  --amber-ink: #6B4600;
  --purple: #6B3FD1;
  --purple-soft: #F0E9FF;
  --shadow: 0 1px 2px rgba(14,21,37,.05), 0 8px 24px rgba(14,21,37,.06);
  --radius: 24px;
  --surface: #0E1525;
  --field: #FFFFFF;
  --on-lime: #0E1525;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px; line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: var(--blue); text-decoration: none; }
svg { flex-shrink: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

#app { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: 120px; position: relative; }

/* ---------- başlık ---------- */
.top { padding: 22px 20px 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.top .sub { font-size: 14px; font-weight: 500; color: var(--muted); }
.top-center { font-size: 17px; font-weight: 700; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink); position: relative; flex-shrink: 0;
}
.icon-btn .dot { position: absolute; top: 11px; right: 12px; width: 9px; height: 9px; border-radius: 5px; background: var(--coral); border: 2px solid #fff; }

/* ---------- hasta seçici ---------- */
.chips { padding: 12px 20px 14px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.pchip {
  height: 48px; padding: 0 16px 0 6px; border-radius: 24px; background: var(--card); color: var(--ink);
  font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(14,21,37,.05);
}
.pchip[aria-pressed="true"] { background: var(--surface); color: #fff; font-weight: 700; }
.avatar {
  width: 36px; height: 36px; border-radius: 18px; background: var(--lime); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.add-round {
  width: 48px; height: 48px; border-radius: 24px; border: 1.5px dashed #A3AABA; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ---------- kartlar ---------- */
.section { margin: 0 20px; }
.h2row { margin: 22px 20px 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.h2row h2, h2.h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
h2.h2 { margin: 22px 20px 10px; }
.link { font-size: 14px; font-weight: 700; color: var(--blue); }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; }
.card.shadow { box-shadow: var(--shadow); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.xbold { font-weight: 800; }
.label { font-size: 14px; font-weight: 700; color: var(--muted); }
.empty { padding: 22px; text-align: center; color: var(--muted); font-size: 15px; background: var(--card); border-radius: 20px; }

.hero { background: var(--surface); color: #fff; border-radius: 28px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.hero .pill { padding: 6px 12px; border-radius: 14px; background: var(--ink-2); font-size: 13px; font-weight: 700; color: var(--lime); letter-spacing: .04em; }
.hero .muted, .on-dark-muted { color: var(--muted-on-dark); }
.hero-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--ink-2); display: flex; align-items: center; justify-content: center; color: var(--lime); flex-shrink: 0; overflow: hidden; }
.hero-icon img { width: 100%; height: 100%; object-fit: cover; }
.hero-time { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.hero-name { font-size: 18px; font-weight: 700; }

.btn {
  height: 52px; padding: 0 18px; border-radius: 16px; font-size: 16px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.btn.big { height: 60px; border-radius: 20px; font-size: 19px; font-weight: 800; }
.btn.lime { background: var(--lime); color: var(--on-lime); font-weight: 800; }
.btn.dark { background: var(--surface); color: #fff; }
.btn.dark.lime-text { color: var(--lime); }
.btn.ghost-dark { background: var(--ink-2); color: #fff; font-weight: 600; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.soft { background: var(--bg); color: var(--ink); font-weight: 600; }
.btn.white { background: var(--card); color: var(--ink); }
.btn.danger { background: var(--coral-soft); color: var(--coral-deep); }
.btn.sm { height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn.full { width: 100%; }
.btn[disabled] { opacity: .5; }
.btns { display: flex; gap: 10px; }
.btns > .btn { flex: 1; }

/* istatistik */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 14px 12px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; }
.stat .v { font-size: 18px; font-weight: 800; }
.stat .l { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat.warn { background: var(--coral-soft); box-shadow: none; }
.stat.warn .v { color: var(--coral-deep); }
.stat.warn .l { color: var(--coral-ink); font-weight: 600; }
.stat-ico { width: 44px; height: 44px; border-radius: 22px; background: #fff; color: #D2461F; display: flex; align-items: center; justify-content: center; }

/* liste satırları */
.item { padding: 12px 14px; border-radius: 18px; background: var(--card); display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; }
.item.alert { box-shadow: inset 0 0 0 1.5px var(--coral-line); }
.item .t1 { font-size: 16px; font-weight: 700; }
.item .t2 { font-size: 13px; color: var(--muted); }
.item .t2.warn { color: var(--coral-ink); font-weight: 600; }
.status { width: 32px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.status.taken { background: var(--green); }
.status.missed { background: var(--coral); }
.status.skipped { background: var(--line-2); color: var(--ink); }
.status.pending { border: 2px solid var(--line-2); }
.status.snoozed { border: 2px solid var(--blue); color: var(--blue); }
.dotk { width: 10px; height: 10px; border-radius: 5px; background: var(--green); flex-shrink: 0; }
.dotk.high, .dotk.low { background: var(--coral); }
.val { font-size: 20px; font-weight: 800; }
.val.high, .val.low { color: var(--coral-ink); }

/* ilaç kartı */
.med { padding: 14px; border-radius: 20px; background: var(--card); display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; }
.med.low { box-shadow: inset 0 0 0 1.5px var(--coral-line); }
.med.off { opacity: .6; }
.med-ico { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; background: var(--blue-soft); color: var(--blue-ink); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.med.low .med-ico { background: var(--coral-soft); color: #D2461F; }
.med-ico img { width: 100%; height: 100%; object-fit: cover; }
.med { align-items: flex-start; }
.med-ico, .med-stock { margin-top: 2px; }
.med-body { display: flex; flex-direction: column; gap: 6px; text-align: left; min-width: 0; }
.med-name { font-size: 16px; font-weight: 700; line-height: 1.25; }
.med-times { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mt { display: inline-flex; align-items: center; gap: 5px; }
.mt > i { width: 8px; height: 8px; border-radius: 4px; background: var(--line-2); }
.mt.d-taken > i { background: var(--green); }
.mt.d-missed > i { background: var(--coral); }
.mt.d-skipped > i { background: var(--amber-ink); }
.mt.d-pending > i { background: transparent; box-shadow: inset 0 0 0 2px var(--line-2); }
.mt-prn { color: var(--amber-ink); }
.mt-plan { color: var(--muted); font-weight: 500; }
.med-line { font-size: 13.5px; color: var(--muted); line-height: 1.3; }
.med-line.end b { color: var(--ink); font-weight: 700; }
.med.low .med-line.end, .med.low .med-line.end b { color: var(--coral-ink); }
.med-rx { align-self: flex-start; padding: 3px 9px; border-radius: 8px; background: var(--coral-soft); color: var(--coral-ink); font-size: 12.5px; font-weight: 700; }
[data-hold] { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.bar { height: 6px; border-radius: 3px; background: #E7EAF1; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--green); }
.med.low .bar { background: #FFE0D6; }
.med.low .bar > i { background: var(--coral); }

/* profil */
.profile { background: var(--surface); color: #fff; border-radius: 28px; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.profile .big-avatar { width: 68px; height: 68px; border-radius: 24px; background: var(--lime); color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; flex-shrink: 0; }
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini { padding: 10px 12px; border-radius: 16px; background: var(--ink-2); display: flex; flex-direction: column; gap: 2px; }
.mini .l { font-size: 12px; color: var(--muted-on-dark); }
.mini .v { font-size: 18px; font-weight: 800; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 7px 12px; border-radius: 14px; background: var(--ink-2); font-size: 14px; font-weight: 600; }
.tag.allergy { background: var(--coral); color: var(--ink); font-weight: 800; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { padding: 14px 12px; border-radius: 20px; background: var(--card); display: flex; flex-direction: column; gap: 6px; text-align: left; }
.tile .k { font-size: 13px; font-weight: 700; }
.tile .v { font-size: 17px; font-weight: 800; }
.tile .d { font-size: 12px; color: var(--muted); }

/* sekmeler / seçim */
.seg { padding: 5px; border-radius: 18px; background: #E4E7EF; display: flex; gap: 4px; }
.seg > button { flex: 1; height: 46px; border-radius: 14px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.seg > button[aria-pressed="true"] { background: var(--surface); color: #fff; font-weight: 700; }
.seg.light { background: var(--bg); padding: 4px; border-radius: 16px; }
.seg.light > button { height: 42px; border-radius: 12px; }
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
.opt { flex: 1; min-width: 0; height: 46px; padding: 0 12px; border-radius: 14px; background: var(--bg); color: var(--ink); font-size: 15px; font-weight: 600; white-space: nowrap; }
.opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); color: var(--blue-ink); font-weight: 800; }
.opt.dark[aria-pressed="true"] { box-shadow: none; background: var(--surface); color: var(--lime); }
.opt.warn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #D2461F; background: var(--coral-soft); color: var(--coral-deep); }
.chipbtn { height: 42px; padding: 0 14px; border-radius: 14px; background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 600; }
.chipbtn[aria-pressed="true"] { background: var(--surface); color: #fff; font-weight: 700; }
.chipbtn.dashed { background: transparent; border: 1.5px dashed #A3AABA; color: var(--text-2); font-weight: 700; }

/* form */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .flabel { font-size: 13px; font-weight: 700; color: var(--text-2); }
.input {
  height: 52px; width: 100%; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line-2);
  background: var(--field); font-size: 17px; font-weight: 600; color: var(--ink);
}
.input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
textarea.input { height: auto; padding: 12px 14px; font-size: 15px; font-weight: 500; resize: vertical; min-height: 84px; }
.input::placeholder { color: #8A91A3; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bignum { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.bignum input { width: 160px; border: none; outline: none; background: transparent; text-align: right; font-size: 56px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); padding: 0; }
.bignum input::placeholder { color: #C3C8D4; }
.bignum .unit { font-size: 18px; font-weight: 700; color: var(--muted); }
.bp-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bp-inputs input { height: 72px; text-align: center; font-size: 30px; font-weight: 800; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 48px; height: 48px; border-radius: 16px; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.stepper .n { min-width: 48px; text-align: center; font-size: 28px; font-weight: 800; }
.timechip { height: 48px; padding: 0 6px 0 16px; border-radius: 16px; background: var(--surface); color: #fff; display: inline-flex; align-items: center; gap: 2px; font-size: 18px; font-weight: 800; }
.timechip button { width: 36px; height: 36px; border-radius: 12px; color: var(--muted-on-dark); display: flex; align-items: center; justify-content: center; }
.switch { width: 52px; height: 32px; border-radius: 16px; background: #D3D7E1; padding: 3px; display: flex; flex-shrink: 0; transition: background .15s; }
.switch > i { width: 26px; height: 26px; border-radius: 13px; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
[aria-pressed="true"] > .switch, .switch.on { background: var(--blue); }
[aria-pressed="true"] > .switch > i, .switch.on > i { transform: translateX(20px); }
.toggle-row { min-height: 68px; padding: 10px 16px; display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; border-bottom: 1px solid #EDEFF4; }
.toggle-row:last-child { border-bottom: none; }
.toggle-row button, .toggle-row .btn { flex-shrink: 0; white-space: nowrap; }
.ticon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 13px; display: flex; align-items: center; justify-content: center; }
.list-card { background: var(--card); border-radius: 24px; overflow: hidden; }
.subpanel { padding: 12px 16px 14px; background: #F7F8FB; border-bottom: 1px solid #EDEFF4; display: flex; flex-direction: column; gap: 10px; }
.medchip { height: 40px; padding: 0 12px 0 8px; border-radius: 13px; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.medchip .box { width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 2px #A3AABA; display: flex; align-items: center; justify-content: center; }
.medchip[aria-pressed="true"] { background: var(--surface); color: #fff; box-shadow: none; font-weight: 700; }
.medchip[aria-pressed="true"] .box { background: var(--lime); color: var(--ink); box-shadow: none; }
.medchip.gray:not([aria-pressed="true"]) { color: var(--muted); }

/* sabit alt çubuk */
.dock {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; width: calc(min(520px, 100vw) - 40px);
  padding: 12px 12px 12px 18px; border-radius: 26px; background: var(--surface); color: #fff;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 12px 30px rgba(14,21,37,.25); z-index: 20;
}
.dock .btn { height: 56px; border-radius: 18px; }

/* alt menü */
nav.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom));
  width: calc(min(520px, 100vw) - 40px); height: 68px; padding: 8px; border-radius: 26px; background: var(--surface);
  display: flex; gap: 4px; box-shadow: 0 12px 30px rgba(14,21,37,.25); z-index: 10;
}
nav.tabbar a { flex: 1; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted-on-dark); font-size: 15px; font-weight: 800; }
nav.tabbar a span { display: none; }
nav.tabbar a.on { flex: 1.6; background: var(--lime); color: var(--on-lime); }
nav.tabbar a.on span { display: inline; }

/* sayfa (sheet) */
.sheet-back { position: fixed; inset: 0; background: rgba(14,21,37,.55); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet {
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--card); border-radius: 32px 32px 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; animation: up .2s ease-out;
}
.sheet .grip { align-self: center; width: 44px; height: 5px; border-radius: 3px; background: #D3D7E1; }
.sheet h3 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.page-full { position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow-y: auto; }
.page-full .inner { max-width: 520px; margin: 0 auto; padding-bottom: 130px; }
.infobox { padding: 14px 16px; border-radius: 18px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 15px; }
.infobox.warn { background: var(--coral-soft); color: var(--coral-deep); }
.infobox.ok { background: var(--green-soft); color: #0A5C44; }
.infobox.info { background: var(--blue-soft); color: var(--blue-ink); }

/* grafik kartı */
.chart { background: var(--card); color: var(--ink); border-radius: 28px; padding: 16px 14px 14px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.ch-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 2px; }
.ch-head h2 { margin: 0; font-size: 19px; font-weight: 800; }
.ch-head span { font-size: 13px; font-weight: 600; color: var(--muted); text-align: right; }
.ch-period { padding: 4px; border-radius: 14px; background: var(--bg); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.ch-period button { height: 38px; border-radius: 10px; border: none; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.ch-period button[aria-pressed="true"] { background: var(--ink); color: var(--card); font-weight: 700; }
.ch-chips { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 6px; }
.ch-chip { padding: 8px 10px; border-radius: 14px; background: var(--bg); min-width: 0; display: flex; flex-direction: column; }
.ch-chip span { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-chip b { font-size: 19px; font-weight: 800; white-space: nowrap; }
.ch-chip.warn { background: var(--coral-soft); }
.ch-chip.warn span { color: var(--coral-ink); }
.ch-chip.warn b { color: var(--coral-deep); }
.ch-wrap { position: relative; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-lab { fill: var(--muted); font-size: 11px; font-weight: 600; font-family: inherit; }
.ch-lab.sm { font-size: 10.5px; }
.ch-band { fill: var(--green-soft); }
.ch-band-t { stroke: var(--green-soft); fill: var(--green-ink); font-size: 11px; font-weight: 700; }
.ch-ref { stroke: #D2461F; stroke-width: 1.5; stroke-dasharray: 5 4; }
.ch-ref.r-warn { stroke: #D97A00; }
.ch-ref-t, .ch-band-t { paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.ch-ref-t { fill: #C23A16; font-size: 11px; font-weight: 700; }
.ch-ref-t.r-warn { fill: #A85C00; }
.ch-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.ch-pt { stroke: var(--card); stroke-width: 2; }
.s-sys { stroke: #1F44C2; } .ch-pt.s-sys { fill: #1F44C2; }
.s-dia { stroke: #6F8EF0; } .ch-pt.s-dia { fill: #6F8EF0; }
.s-fast { stroke: #2C9A4B; } .ch-pt.s-fast { fill: #2C9A4B; }
.ch-pt.s-post { fill: #D97A00; } .ch-pt.s-rnd { fill: #8A93A6; }
.s-temp { stroke: #C2410C; } .ch-pt.s-temp { fill: #C2410C; }
.s-spo2 { stroke: #0E7490; } .ch-pt.s-spo2 { fill: #0E7490; }
.s-kilo { stroke: #6D28D9; } .ch-pt.s-kilo { fill: #6D28D9; }
.ch-line.s-post, .ch-line.s-rnd { display: none; }
.ch-pt.bad { fill: #D2461F; }
.ch-hit { fill: transparent; cursor: pointer; }
.ch-hit.sel { fill: rgba(14,21,37,.12); }
.ch-tip { position: absolute; width: 56%; padding: 9px 12px; border-radius: 12px; background: #0E1525; color: #fff; display: flex; flex-direction: column; gap: 2px; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.ch-tip .tip-d { font-size: 11.5px; font-weight: 600; color: #A9B1C3; }
.ch-tip b { font-size: 17px; font-weight: 800; }
.ch-tip b small { font-size: 12px; font-weight: 600; color: #C9CFDC; }
.ch-tip .tip-s { font-size: 11.5px; font-weight: 700; color: #9FE3B0; }
.ch-tip .tip-s.bad { color: #FF9E86; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0 2px; }
.ch-legend span { display: flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 16px; height: 4px; border-radius: 2px; }
.lg.l-sys { background: #1F44C2; } .lg.l-dia { background: #6F8EF0; } .lg.l-fast { background: #2C9A4B; }
.lg.l-temp { background: #C2410C; } .lg.l-spo2 { background: #0E7490; } .lg.l-kilo { background: #6D28D9; }
.lg.l-ref { height: 0; border-top: 2px dashed #D2461F; border-radius: 0; }
.lg.l-bad { width: 10px; height: 10px; border-radius: 5px; background: #D2461F; }
.lg.l-rnd { width: 10px; height: 10px; border-radius: 5px; background: #8A93A6; }
.lg.l-post { width: 9px; height: 9px; border-radius: 1px; background: #D97A00; transform: rotate(45deg); }
:root[data-theme="dark"] .s-sys { stroke: #6F8EF0; } :root[data-theme="dark"] .ch-pt.s-sys { fill: #6F8EF0; }
:root[data-theme="dark"] .s-dia { stroke: #B4C5FF; } :root[data-theme="dark"] .ch-pt.s-dia { fill: #B4C5FF; }
:root[data-theme="dark"] .lg.l-sys { background: #6F8EF0; } :root[data-theme="dark"] .lg.l-dia { background: #B4C5FF; }
:root[data-theme="dark"] .ch-tip { background: #EEF1F6; color: #0E1525; }
:root[data-theme="dark"] .ch-tip .tip-d, :root[data-theme="dark"] .ch-tip b small { color: #3B4357; }
:root[data-theme="dark"] .ch-tip .tip-s { color: #0B7A5A; } :root[data-theme="dark"] .ch-tip .tip-s.bad { color: #A8341A; }
:root[data-theme="dark"] .ch-pt.bad { fill: #FF6B4A; }
:root[data-theme="dark"] .ch-hit.sel { fill: rgba(255,255,255,.14); }

/* hafta şeridi */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.week > div { height: 64px; border-radius: 16px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.week .wd { font-size: 11px; color: var(--muted); }
.week .dn { font-size: 17px; font-weight: 700; }
.week .today { background: var(--surface); color: #fff; }
.week .today .wd { color: var(--muted-on-dark); }
.week .has { box-shadow: inset 0 0 0 2px var(--blue); }
.week .has .dn { color: var(--blue-ink); }
.week .today.has .dn { color: #fff; }
.week i { width: 6px; height: 6px; border-radius: 3px; background: var(--blue); }
.datebox { width: 48px; height: 52px; border-radius: 14px; background: var(--blue-soft); color: var(--blue-ink); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.datebox b { font-size: 18px; font-weight: 800; line-height: 1.1; }
.datebox span { font-size: 11px; font-weight: 700; }

/* bildirim */
#toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(20px); background: var(--surface); color: #fff;
  padding: 12px 18px; border-radius: 16px; font-size: 15px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: all .2s; z-index: 60; max-width: calc(100vw - 40px); text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--coral-deep); }
.offline-bar { background: var(--amber-soft); color: var(--amber-ink); font-size: 13px; font-weight: 700; text-align: center; padding: 6px 12px; }
.loading { padding: 60px 20px; text-align: center; color: var(--muted); }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt22 { margin-top: 22px; }
.center { text-align: center; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 1.0.2 — tarih/saat alanları taşmasın, su bardak seçici */
.grid2.dt .input { padding: 0 10px; font-size: 16px; min-width: 0; width: 100%; }
input[type="date"].input, input[type="time"].input, input[type="datetime-local"].input { min-width: 0; width: 100%; -webkit-appearance: none; appearance: none; }
.glass-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.opt.glass { height: 64px; flex-direction: column; display: flex; align-items: center; justify-content: center; gap: 0; padding: 0; }
.opt.glass b { font-size: 20px; font-weight: 800; line-height: 1.1; }
.opt.glass span { font-size: 12px; color: var(--text-2); font-weight: 600; }

/* ================= 1.1.0 ================= */
body { zoom: var(--fs, 1); }

/* karanlık tema */
:root[data-theme="dark"] {
  --bg: #080C16; --card: #151B2A; --field: #1B2233; --ink: #EEF1F6; --ink-2: #2A3344; --surface: #1E2738;
  --text-2: #C3C9D6; --muted: #98A1B3; --muted-on-dark: #A9B1C3; --line: #262E40; --line-2: #3A4356;
  --blue: #5B7FFF; --blue-ink: #A9BCFF; --blue-soft: #1C2750; --green-ink: #6FD3A5; --green-soft: #12352C;
  --coral-ink: #FF9E86; --coral-deep: #FFB4A2; --coral-soft: #3A1E17; --coral-line: #6B2E20;
  --water-soft: #14284A; --amber-soft: #3A2E10; --amber-ink: #F2C665; --purple: #A98BFF; --purple-soft: #2A2147;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}
:root[data-theme="dark"] .avatar, :root[data-theme="dark"] .big-avatar { color: #0E1525; }
:root[data-theme="dark"] .stat-ico { background: var(--card); }
:root[data-theme="dark"] .medchip { background: var(--field); }
:root[data-theme="dark"] .sheet-back { background: rgba(0,0,0,.6); }
:root[data-theme="dark"] .opt[aria-pressed="true"] { color: var(--blue-ink); }

/* rozetler */
.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.badge { padding: 10px; border-radius: 18px; background: var(--card); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.badge .bi { width: 28px; height: 28px; border-radius: 14px; background: var(--bg); color: var(--muted); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.badge b { font-size: 20px; font-weight: 800; line-height: 1.1; }
.badge > span:last-child { font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.badge.on { background: var(--surface); color: #fff; }
.badge.on .bi { background: var(--lime); color: #0E1525; }
.badge.on > span:last-child { color: var(--muted-on-dark); }

/* günün akışı */
.tl { position: relative; display: flex; flex-direction: column; gap: 6px; }
.tl::before { content: ""; position: absolute; left: 58px; top: 16px; bottom: 16px; width: 2px; background: var(--line); }
.tl-row { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; }
.tl-row[disabled] { cursor: default; opacity: 1; }
.tl-t { width: 40px; flex-shrink: 0; text-align: right; font-size: 13px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tl-dot { width: 22px; height: 22px; border-radius: 11px; flex-shrink: 0; border: 2px solid var(--line-2); background: var(--card); display: flex; align-items: center; justify-content: center; color: #fff; position: relative; z-index: 1; }
.tl-card { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 16px; background: var(--card); display: flex; align-items: center; gap: 10px; font-size: 14px; }
.tl-ic { width: 30px; height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--text-2); flex-shrink: 0; }
.tl-row.k-meas .tl-ic { background: var(--purple-soft); color: var(--purple); }
.tl-row.k-water .tl-ic { background: var(--water-soft); color: #2F80ED; }
.tl-row.k-prn .tl-ic { background: var(--amber-soft); color: var(--amber-ink); }
.tl-row.k-appt .tl-ic { background: var(--blue-soft); color: var(--blue-ink); }
.tl-row.done .tl-dot { background: var(--green); border-color: var(--green); }
.tl-row.done .tl-card { opacity: .62; }
.tl-row.bad .tl-dot { background: var(--coral); border-color: var(--coral); }
.tl-row.bad .tl-card { background: var(--coral-soft); }
.tl-now { display: flex; align-items: center; gap: 10px; }
.tl-now span { width: 40px; text-align: right; font-size: 13px; font-weight: 800; color: var(--blue-ink); }
.tl-now i { width: 22px; height: 22px; border-radius: 11px; border: 3px solid var(--blue); background: var(--card); flex-shrink: 0; position: relative; z-index: 1; box-sizing: border-box; }
.tl-now::after { content: ""; flex: 1; height: 2px; background: var(--blue); border-radius: 1px; order: 3; }
.tl-now b { order: 4; font-size: 11px; font-weight: 800; color: var(--blue-ink); letter-spacing: .04em; }

/* takvim: kaydırılabilir hafta */
.weekscroll { display: flex; gap: 6px; overflow-x: auto; padding: 8px 20px 4px; scroll-snap-type: x proximity; scrollbar-width: none; }
.weekscroll::-webkit-scrollbar { display: none; }
.wd-btn { flex: 0 0 48px; height: 68px; border-radius: 16px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; scroll-snap-align: center; }
.wd-btn .wd { font-size: 11px; color: var(--muted); font-weight: 600; }
.wd-btn .dn { font-size: 18px; font-weight: 800; }
.wd-btn i { width: 6px; height: 6px; border-radius: 3px; background: var(--coral); }
.wd-btn i.no { background: transparent; }
.wd-btn.past { opacity: .6; }
.wd-btn.today { box-shadow: inset 0 0 0 2px var(--surface); opacity: 1; }
.wd-btn.sel { background: var(--surface); color: #fff; opacity: 1; }
.wd-btn.sel .wd { color: var(--muted-on-dark); }
.wd-btn.sel i { background: var(--lime); }

/* yenileme adımları */
.rsteps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.rsteps > div { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; }
.rsteps i { height: 6px; border-radius: 3px; background: var(--line); }
.rsteps .on { color: var(--green-ink); }
.rsteps .on i { background: var(--green); }
.rsteps .ask { color: var(--blue-ink); }
.rsteps .ask i { background: var(--blue); }
.card.alert-card { background: var(--coral-soft); }

/* ilaç planı */
.grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.grid7 .opt { height: 44px; font-size: 13px; }
.step-n { width: 28px; height: 28px; border-radius: 14px; background: var(--surface); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; align-self: flex-end; margin-bottom: 8px; }
.evs { display: flex; flex-direction: column; gap: 14px; padding: 4px 4px 4px 6px; border-left: 2px solid var(--line); margin-left: 8px; }
.ev { display: flex; gap: 12px; align-items: flex-start; position: relative; }
.ev-dot { width: 14px; height: 14px; border-radius: 7px; margin-left: -14px; margin-top: 4px; flex-shrink: 0; box-shadow: 0 0 0 3px var(--bg); }

/* kayıt sekmeleri kaydırılabilir */
.seg.scroll { overflow-x: auto; scrollbar-width: none; }
.seg.scroll::-webkit-scrollbar { display: none; }
.seg.scroll > button { flex: 0 0 auto; padding: 0 14px; }

/* rapor: ölçüm × yer seçimi */
.omx { display: flex; flex-direction: column; border-radius: 14px; background: var(--card); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.omx-h, .omx-r { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 68px); align-items: center; }
.omx-h { padding: 8px 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.omx-r { border-top: 1px solid var(--line); min-height: 46px; }
.omx-l { height: 46px; padding: 0 12px; text-align: left; font-size: 15px; font-weight: 600; }
.omx-r.off .omx-l { color: var(--muted); }
.omx-c { height: 46px; display: flex; align-items: center; justify-content: center; }
.omx-c .box { width: 24px; height: 24px; border-radius: 7px; box-shadow: inset 0 0 0 2px #A3AABA; display: flex; align-items: center; justify-content: center; }
.omx-c[aria-pressed="true"] .box { background: var(--surface); color: var(--lime); box-shadow: none; }

/* randevu: etiket, kontrol kartı, geçmiş */
.tagx { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.chipbtn { display: inline-flex; align-items: center; gap: 5px; }
.chipbtn small.cnt { font-weight: 500; color: var(--muted); font-size: 12px; }
.chipbtn[aria-pressed="true"] small.cnt { color: var(--muted-on-dark); }
.chipbtn[aria-pressed="true"] svg { color: var(--lime); }
.kcard { display: flex; flex-direction: column; gap: 10px; }
.ksteps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ksteps > div { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--muted); }
.ksteps i { height: 5px; border-radius: 3px; background: var(--line); }
.ksteps .on i { background: var(--ink); }
.ksteps .cur span { color: var(--ink); font-weight: 700; }
.hstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.hstats .card { padding: 10px 11px; display: flex; flex-direction: column; gap: 2px; border-radius: 18px; }
.hstats span { font-size: 12px; font-weight: 600; color: var(--muted); }
.hstats b { font-size: 18px; font-weight: 800; line-height: 1.15; }
.hstats .card.dark { background: var(--surface); color: #fff; }
.hstats .card.dark span { color: var(--muted-on-dark); }
.hitem { display: flex; gap: 12px; padding: 12px; text-align: left; width: 100%; align-items: flex-start; }
.hdate { width: 52px; flex: 0 0 auto; border-radius: 14px; background: var(--bg); display: flex; flex-direction: column; align-items: center; padding: 7px 0; }
.hdate b { font-size: 19px; line-height: 1; }
.hdate span { font-size: 11px; font-weight: 700; color: var(--muted); }
.hnote { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--text-2); background: var(--bg); border-radius: 10px; padding: 6px 9px; margin-top: 3px; }
.hnote svg { flex: 0 0 auto; margin-top: 1px; }

/* çizelge düzen seçimi */
.czlay { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 14px; border-radius: 18px; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.czlay span { font-size: 12.5px; color: var(--muted); }
.czlay.on { background: var(--surface); color: #fff; box-shadow: none; }
.czlay.on span { color: var(--muted-on-dark); }
a.card, a.stat, a.item { color: inherit; text-decoration: none; }
/* DSÖ bölgeleri */
.ch-z.z-low { fill: #E8EEFF; } .ch-z.z-ok { fill: #E7F6EE; } .ch-z.z-mid { fill: #FFF4D9; } .ch-z.z-high { fill: #FFE7E0; } .ch-z.z-crit { fill: #FFD2C7; }
.ch-z-t { font-size: 10px; font-weight: 700; }
.zt-low { fill: #2F5BEA; color: #2F5BEA; } .zt-ok { fill: #0B7A5A; color: #0B7A5A; } .zt-mid { fill: #8A5A00; color: #8A5A00; } .zt-high { fill: #B42318; color: #B42318; } .zt-crit { fill: #8E1B0E; color: #8E1B0E; }
.ch-pt.zp-low { fill: #2F5BEA; } .ch-pt.zp-mid { fill: #D99A00; } .ch-pt.zp-high { fill: #D2461F; } .ch-pt.zp-crit { fill: #8E1B0E; }
.ch-ref.r-doc { stroke: #6B3FD1; } .ch-ref-t.r-doc { fill: #6B3FD1; }
.ch-chip.z-ok { background: var(--green-soft); } .ch-chip.z-ok b { color: var(--green-ink); }
.ch-chip.z-mid { background: var(--amber-soft); } .ch-chip.z-mid b { color: var(--amber-ink); }
.ch-chip.z-high, .ch-chip.z-crit { background: var(--coral-soft); } .ch-chip.z-high b, .ch-chip.z-crit b { color: var(--coral-ink); }
.ch-chip.z-low { background: var(--blue-soft); } .ch-chip.z-low b { color: var(--blue-ink); }
.ch-sub { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 4px 0 -4px; }
.ch-src { font-size: 12px; color: var(--muted); line-height: 1.45; }
.zlist { background: var(--bg); border-radius: 16px; padding: 4px 12px; }
.zrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.zrow:first-child { border-top: none; }
.zrow b { font-size: 13px; }
.zsw { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto; }
.zsw.z-low { background: #E8EEFF; box-shadow: inset 0 0 0 1.5px #2F5BEA; } .zsw.z-ok { background: #E7F6EE; box-shadow: inset 0 0 0 1.5px #0B7A5A; }
.zsw.z-mid { background: #FFF4D9; box-shadow: inset 0 0 0 1.5px #8A5A00; } .zsw.z-high { background: #FFE7E0; box-shadow: inset 0 0 0 1.5px #B42318; }
.zsw.z-crit { background: #FFD2C7; box-shadow: inset 0 0 0 1.5px #8E1B0E; }
:root[data-theme="dark"] .ch-z.z-low { fill: rgba(91,127,255,.16); } :root[data-theme="dark"] .ch-z.z-ok { fill: rgba(111,211,165,.12); }
:root[data-theme="dark"] .ch-z.z-mid { fill: rgba(242,198,101,.14); } :root[data-theme="dark"] .ch-z.z-high { fill: rgba(255,107,74,.16); } :root[data-theme="dark"] .ch-z.z-crit { fill: rgba(255,107,74,.28); }
:root[data-theme="dark"] .zt-low { fill: #A9BCFF; color: #A9BCFF; } :root[data-theme="dark"] .zt-ok { fill: #6FD3A5; color: #6FD3A5; }
:root[data-theme="dark"] .zt-mid { fill: #F2C665; color: #F2C665; } :root[data-theme="dark"] .zt-high, :root[data-theme="dark"] .zt-crit { fill: #FF9E86; color: #FF9E86; }
:root[data-theme="dark"] .ch-ref.r-doc { stroke: #A98BFF; } :root[data-theme="dark"] .ch-ref-t.r-doc { fill: #A98BFF; }
.ch-tip[hidden] { display: none; }
/* karekod okutma */
.scan-cam { position: relative; margin: 0; height: 62vh; min-height: 360px; background: #0E1525; overflow: hidden; border-radius: 0 0 28px 28px; }
.scan-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 50%; top: 48%; width: 220px; height: 220px; transform: translate(-50%, -50%); border: 3px solid #C6F36B; border-radius: 22px; box-shadow: 0 0 0 2000px rgba(14,21,37,.45); }
.scan-top { position: absolute; left: 16px; right: 16px; top: 14px; display: flex; justify-content: space-between; align-items: center; color: #fff; font-size: 17px; }
.scan-hint { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #E4E7EF; font-size: 14px; font-weight: 600; }
.radio { width: 24px; height: 24px; border-radius: 12px; box-shadow: inset 0 0 0 2px #C9CEDA; flex-shrink: 0; position: relative; }
.radio.on { background: var(--surface); box-shadow: none; } .radio.on::after { content: ''; position: absolute; left: 8px; top: 8px; width: 8px; height: 8px; border-radius: 4px; background: var(--lime); }
.apfile { position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--bg); }
.apfile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.apfile button { position: absolute; right: 2px; top: 2px; width: 22px; height: 22px; border-radius: 11px; background: rgba(14,21,37,.75); color: #fff; display: flex; align-items: center; justify-content: center; }

/* su kapları */
.cup-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cup { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 10px; border: 2px solid transparent; border-radius: 20px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.cup b { font-size: 18px; font-weight: 800; line-height: 1.1; }
.cup span { font-size: 12px; font-weight: 600; color: var(--text-2); line-height: 1.2; text-align: center; }
.cup-svg { width: 52px; height: 72px; margin: 2px 0; }
.cup-line { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.cup-water { fill: #7CB7FF; }
.cup-cap { fill: currentColor; }
.cup-band { fill: #2F5BEA; opacity: .18; }
.cup-bub { fill: #fff; opacity: .9; }
.cup-grid > .cup:last-child:nth-child(3n+1) { grid-column: 2; }
.cup[aria-pressed="true"] { border-color: var(--blue, #2F5BEA); background: var(--blue-soft, #E5ECFF); }
.cup[aria-pressed="true"] b { color: var(--blue-ink, #1E3FB0); }
.cup:active { transform: scale(.97); }
