/* =====================================================================
   Koza — Tasarım sistemi (Yön C · Canlı ve modern)
   Tek kaynak: tokenlar + temel + bileşen kütüphanesi + kabuklar.
   Belgeler: docs/TASARIM.md · Canlı örnek: docs/tasarim/stil.html (node docs/stil-uret.mjs)
   Yükleme sırası (index.html): fonts → app.css → views.css → patient.css → doctor.css
   Ekran dosyaları bu dosyadaki sınıfları kullanır/üzerine yazar; app.css'teki
   token ADLARI ve bileşen sınıfları kararlı API'dir.

   İçindekiler
    1. Tokenlar (açık / koyu / sistem yedeği / ortak)
    2. Temel + yardımcı sınıflar
    3. Düğmeler
    4. Çipler, seviye rozetleri, sayaç rozeti
    5. Kart, ikon karosu, liste satırı
    6. Form: alan, girdi, birimli girdi, onay, segment, anahtar
    7. Avatar
    8. Uyarılar: alert-card, urgent (acil), sos, banner, push-prompt
    9. Gebelik kahramanı (hero), ince şerit, randevu tarihi
   10. İlerleme çubuğu, halka, zaman çizelgesi, iskelet, boş durum
   11. Alt pencere (sheet), sonuç bloğu, bildirim (toast)
   12. Hasta kabuğu: .p-app, üst başlık, kapsül sekme çubuğu
   13. Doktor kabuğu: .d-app, KPI şeridi, triyaj satırı, tablo
   14. Grafik
   15. Ekran parçaları (varsayılanlar; ekran dosyaları geçersiz kılabilir)
   16. Eski sınıflar (geçiş dönemi uyumluluğu)
   17. Yazdırma
   ===================================================================== */

/* ---------- 1. Tokenlar ---------- */

/* Ortak (temadan bağımsız) */
:root {
  --font: 'Plus Jakarta Sans Variable', 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-emoji: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;

  /* tipografi ölçeği */
  --fs-display: 88px;
  --fs-h1: 28px;
  --fs-h2: 20px;
  --fs-h3: 17px;
  --fs-body: 16px;
  --fs-sm: 14px;
  --fs-xs: 13px;
  --fs-label: 12.5px;

  /* boşluk */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --gutter: 20px;

  /* yarıçap */
  --r-xs: 10px; --r-sm: 14px; --r-md: 18px; --r-lg: 24px; --r-xl: 30px; --r-pill: 999px;

  /* cam (yalnızca sekme çubuğu, alt pencere, yapışkan başlık) */
  --blur: blur(22px) saturate(170%);

  /* güvenli alan: Capacitor'ın enjekte ettiği değer, yoksa env() */
  --safe-t: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-r: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  --safe-b: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-l: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));

  /* hareket */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: .18s;

  /* katmanlar */
  --z-tabbar: 40; --z-statusbar: 45; --z-topbar: 30; --z-sheet: 60; --z-toast: 70;

  /* onay kutusu tiki (beyaz, temadan bağımsız) */
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

/* Açık tema (varsayılan) */
:root,
[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf6f9;
  --bg-2: #f5eff5;
  --bg-fade: rgba(251, 246, 249, 0);
  --bg-fade-2: rgba(251, 246, 249, .92);
  --surface: #ffffff;
  --surface-2: #f6eff5;
  --surface-3: #eee4ec;
  --surface-raised: #ffffff;
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .86);
  --glass-border: rgba(255, 255, 255, .75);
  --glass-solid: #fdf9fc;
  --scrim: rgba(28, 10, 34, .44);
  --line: rgba(45, 20, 55, .10);
  --line-strong: rgba(45, 20, 55, .20);
  /* etkileşimli denetim sınırı (onay kutusu, tik, anahtar, girdi, çerçeveli düğme): zemine karşı ≥ 3:1 */
  --control-line: rgba(45, 20, 55, .5);

  --ink: #1d1424;
  --ink-2: #4a3f55;
  --muted: #6b6076;
  --inverse: #1d1424;
  --on-inverse: #ffffff;

  /* marka: gül · mor · şeftali · teal */
  --brand: #b8345f;
  --brand-ink: #9e2a52;
  --brand-soft: #fde4ed;
  --brand-line: rgba(184, 52, 95, .28);
  --brand-solid: #b8345f;
  --brand-solid-hover: #a12b52;
  --on-brand: #ffffff;
  --accent: #6a45d8;
  --accent-ink: #4a32b5;
  --accent-soft: #eee9ff;
  --peach: #f59a6e;
  --peach-ink: #9a4614;
  --peach-soft: #ffeadd;
  --peach-line: rgba(232, 128, 80, .42);
  --teal: #1f7470;
  --teal-ink: #17625f;
  --teal-soft: #dcf1ee;
  --teal-solid: #1f7470;
  --focus: #6a45d8;

  /* uyarı seviyeleri — KIRMIZI YALNIZCA ACİL */
  --acil: #d92d20;
  --acil-ink: #b42318;
  --acil-bg: #fef3f2;
  --acil-bg-2: #fee4e2;
  --acil-line: #fecdca;
  --acil-solid: #d92d20;
  --on-acil: #ffffff;
  --bugun: #f79009;
  --bugun-ink: #b54708;
  --bugun-bg: #fffaeb;
  --bugun-line: #fedf89;
  --bilgi: #0ba5ec;
  --bilgi-ink: #026aa2;
  --bilgi-bg: #f0f9ff;
  --bilgi-line: #b9e6fe;
  --ok: #17b26a;
  --ok-ink: #067647;
  --ok-bg: #ecfdf3;
  --ok-line: #abefc6;
  --toast-ok: #75e0a7;
  --toast-warn: #fec84b;

  /* grafik */
  --c-1: #b8345f;
  --c-2: #6a45d8;
  --c-3: #1f7470;
  --c-ref: #b54708;
  --c-band: rgba(23, 178, 106, .10);

  /* mesh + tek kahraman gradyanı */
  --mesh-a: rgba(243, 155, 184, .50);
  --mesh-b: rgba(190, 170, 255, .50);
  --mesh-c: rgba(255, 198, 166, .50);
  --grad-hero:
    radial-gradient(60% 55% at 100% 0%, rgba(255, 168, 128, .88) 0%, rgba(255, 168, 128, 0) 72%),
    radial-gradient(75% 70% at 0% 100%, rgba(110, 70, 225, .92) 0%, rgba(110, 70, 225, 0) 72%),
    linear-gradient(155deg, #c93c6e 0%, #a33a97 55%, #7447dc 100%);
  --grad-fab: linear-gradient(135deg, #c93c6e 0%, #7b4fe6 100%);
  --grad-kpi-acil: linear-gradient(180deg, #fee4e2 0%, #fef3f2 100%);

  /* derinlik */
  --shadow-1: 0 1px 2px rgba(60, 20, 70, .05), 0 6px 20px -10px rgba(60, 20, 70, .14);
  --shadow-2: 0 2px 6px rgba(60, 20, 70, .06), 0 18px 40px -18px rgba(60, 20, 70, .26);
  --shadow-3: 0 -16px 48px -16px rgba(40, 10, 50, .38);
  --shadow-hero: 0 18px 40px -16px rgba(170, 50, 120, .55);
  --shadow-fab: 0 12px 26px -10px rgba(170, 50, 120, .7);

  /* doktor kenar çubuğu (her iki temada koyu) */
  --side-bg: #1b1322;

  /* yerel krom: theme.js / native.js okur */
  --chrome-color: #fbf6f9;
  --system-bars: light;

  --skel: #efe6ee;
  --skel-hi: #f9f4f8;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6076' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Koyu tema: mor-erik tonlu yüzeyler (saf siyah değil) */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #150f1c;
  --bg-2: #120d18;
  --bg-fade: rgba(21, 15, 28, 0);
  --bg-fade-2: rgba(21, 15, 28, .92);
  --surface: #201829;
  --surface-2: #2a2135;
  --surface-3: #352a42;
  --surface-raised: #3d3150;
  --glass: rgba(38, 29, 50, .72);
  --glass-strong: rgba(34, 26, 45, .88);
  --glass-border: rgba(255, 255, 255, .10);
  --glass-solid: #241c2f;
  --scrim: rgba(5, 2, 8, .62);
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .22);
  --control-line: rgba(255, 255, 255, .4);

  --ink: #f6eff9;
  --ink-2: #dacfe3;
  --muted: #ada1b8;
  --inverse: #f6eff9;
  --on-inverse: #1d1424;

  --brand: #ff86ad;
  --brand-ink: #ffa3c1;
  --brand-soft: rgba(255, 134, 173, .15);
  --brand-line: rgba(255, 134, 173, .34);
  --brand-solid: #c43b74;
  --brand-solid-hover: #ad3266;
  --on-brand: #ffffff;
  --accent: #b39bff;
  --accent-ink: #cbbdff;
  --accent-soft: rgba(179, 155, 255, .16);
  --peach: #ffb894;
  --peach-ink: #ffc2a3;
  --peach-soft: rgba(255, 170, 130, .15);
  --peach-line: rgba(255, 170, 130, .34);
  --teal: #5fd0c4;
  --teal-ink: #86e0d6;
  --teal-soft: rgba(95, 208, 196, .15);
  --teal-solid: #1d7c76;
  --focus: #b39bff;

  --acil: #ff8a80;
  --acil-ink: #ffa59c;
  --acil-bg: rgba(255, 110, 100, .13);
  --acil-bg-2: rgba(255, 110, 100, .22);
  --acil-line: rgba(255, 138, 128, .42);
  --acil-solid: #d92d20;
  --on-acil: #ffffff;
  --bugun: #fdb022;
  --bugun-ink: #fec84b;
  --bugun-bg: rgba(253, 176, 34, .12);
  --bugun-line: rgba(253, 176, 34, .36);
  --bilgi: #36bffa;
  --bilgi-ink: #7cd4fd;
  --bilgi-bg: rgba(54, 191, 250, .12);
  --bilgi-line: rgba(54, 191, 250, .36);
  --ok: #47cd89;
  --ok-ink: #75e0a7;
  --ok-bg: rgba(71, 205, 137, .12);
  --ok-line: rgba(71, 205, 137, .34);
  --toast-ok: #067647;
  --toast-warn: #b54708;

  --c-1: #ff86ad;
  --c-2: #b39bff;
  --c-3: #5fd0c4;
  --c-ref: #fec84b;
  --c-band: rgba(71, 205, 137, .12);

  --mesh-a: rgba(201, 60, 110, .34);
  --mesh-b: rgba(118, 78, 230, .34);
  --mesh-c: rgba(245, 154, 110, .10);
  --grad-hero:
    radial-gradient(60% 55% at 100% 0%, rgba(255, 150, 115, .55) 0%, rgba(255, 150, 115, 0) 72%),
    radial-gradient(75% 70% at 0% 100%, rgba(90, 52, 200, .9) 0%, rgba(90, 52, 200, 0) 72%),
    linear-gradient(155deg, #a52d60 0%, #7d2c82 55%, #4f34aa 100%);
  --grad-fab: linear-gradient(135deg, #c43b74 0%, #6d45d6 100%);
  --grad-kpi-acil: linear-gradient(180deg, rgba(255, 110, 100, .24) 0%, rgba(255, 110, 100, .10) 100%);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .6);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 48px -20px rgba(0, 0, 0, .7);
  --shadow-3: 0 -16px 48px -12px rgba(0, 0, 0, .7);
  --shadow-hero: 0 18px 40px -16px rgba(120, 30, 90, .7);
  --shadow-fab: 0 12px 26px -10px rgba(0, 0, 0, .7);

  --side-bg: #0f0a14;

  --chrome-color: #150f1c;
  --system-bars: dark;

  --skel: #2a2135;
  --skel-hi: #352a42;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ada1b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Sistem yedeği: theme.js çalışmadıysa (data-theme yoksa) işletim sistemi tercihine uy */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #150f1c; --bg-2: #120d18; --bg-fade: rgba(21, 15, 28, 0); --bg-fade-2: rgba(21, 15, 28, .92);
    --surface: #201829; --surface-2: #2a2135; --surface-3: #352a42; --surface-raised: #3d3150;
    --glass: rgba(38, 29, 50, .72); --glass-strong: rgba(34, 26, 45, .88); --glass-border: rgba(255, 255, 255, .10); --glass-solid: #241c2f;
    --scrim: rgba(5, 2, 8, .62); --line: rgba(255, 255, 255, .10); --line-strong: rgba(255, 255, 255, .22); --control-line: rgba(255, 255, 255, .4);
    --ink: #f6eff9; --ink-2: #dacfe3; --muted: #ada1b8; --inverse: #f6eff9; --on-inverse: #1d1424;
    --brand: #ff86ad; --brand-ink: #ffa3c1; --brand-soft: rgba(255, 134, 173, .15); --brand-line: rgba(255, 134, 173, .34);
    --brand-solid: #c43b74; --brand-solid-hover: #ad3266; --on-brand: #ffffff;
    --accent: #b39bff; --accent-ink: #cbbdff; --accent-soft: rgba(179, 155, 255, .16);
    --peach: #ffb894; --peach-ink: #ffc2a3; --peach-soft: rgba(255, 170, 130, .15); --peach-line: rgba(255, 170, 130, .34);
    --teal: #5fd0c4; --teal-ink: #86e0d6; --teal-soft: rgba(95, 208, 196, .15); --teal-solid: #1d7c76; --focus: #b39bff;
    --acil: #ff8a80; --acil-ink: #ffa59c; --acil-bg: rgba(255, 110, 100, .13); --acil-bg-2: rgba(255, 110, 100, .22); --acil-line: rgba(255, 138, 128, .42); --acil-solid: #d92d20; --on-acil: #ffffff;
    --bugun: #fdb022; --bugun-ink: #fec84b; --bugun-bg: rgba(253, 176, 34, .12); --bugun-line: rgba(253, 176, 34, .36);
    --bilgi: #36bffa; --bilgi-ink: #7cd4fd; --bilgi-bg: rgba(54, 191, 250, .12); --bilgi-line: rgba(54, 191, 250, .36);
    --ok: #47cd89; --ok-ink: #75e0a7; --ok-bg: rgba(71, 205, 137, .12); --ok-line: rgba(71, 205, 137, .34);
    --toast-ok: #067647; --toast-warn: #b54708;
    --c-1: #ff86ad; --c-2: #b39bff; --c-3: #5fd0c4; --c-ref: #fec84b; --c-band: rgba(71, 205, 137, .12);
    --mesh-a: rgba(201, 60, 110, .34); --mesh-b: rgba(118, 78, 230, .34); --mesh-c: rgba(245, 154, 110, .10);
    --grad-hero:
      radial-gradient(60% 55% at 100% 0%, rgba(255, 150, 115, .55) 0%, rgba(255, 150, 115, 0) 72%),
      radial-gradient(75% 70% at 0% 100%, rgba(90, 52, 200, .9) 0%, rgba(90, 52, 200, 0) 72%),
      linear-gradient(155deg, #a52d60 0%, #7d2c82 55%, #4f34aa 100%);
    --grad-fab: linear-gradient(135deg, #c43b74 0%, #6d45d6 100%);
    --grad-kpi-acil: linear-gradient(180deg, rgba(255, 110, 100, .24) 0%, rgba(255, 110, 100, .10) 100%);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -14px rgba(0, 0, 0, .6);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 48px -20px rgba(0, 0, 0, .7);
    --shadow-3: 0 -16px 48px -12px rgba(0, 0, 0, .7);
    --shadow-hero: 0 18px 40px -16px rgba(120, 30, 90, .7);
    --shadow-fab: 0 12px 26px -10px rgba(0, 0, 0, .7);
    --side-bg: #0f0a14; --chrome-color: #150f1c; --system-bars: dark;
    --skel: #2a2135; --skel-hi: #352a42;
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ada1b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
}

/* Eski token adları (geçiş dönemi; yeni kodda KULLANMAYIN) */
:root, [data-theme] {
  --red: var(--acil); --red-soft: var(--acil-bg);
  --amber: var(--bugun-ink); --amber-soft: var(--bugun-bg);
  --green: var(--ok-ink); --green-soft: var(--ok-bg);
  --blue: var(--bilgi-ink); --blue-soft: var(--bilgi-bg);
  --brand-2: var(--brand);
  --radius: var(--r-md); --radius-sm: var(--r-xs);
  --shadow: var(--shadow-1);
}

/* ---------- 2. Temel ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Klavye odağı yüzen sekme çubuğu / yapışkan başlık altında kalmasın (WCAG 2.4.11); patient.js/doctor.js ayrıca kaydırır */
html { scroll-padding-top: calc(64px + var(--safe-t)); scroll-padding-bottom: calc(124px + var(--safe-b)); }
html.is-doctor { scroll-padding-bottom: 16px; scroll-padding-top: 0; }
@media (max-width: 900px) { html.is-doctor { scroll-padding-top: calc(72px + var(--safe-t)); } }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
/* Tema geçişinde tüm geçişleri bir kare kapat (theme.js ekler) */
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--brand-ink); text-underline-offset: 2px; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
h1 { font-size: var(--fs-h1); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: var(--fs-h2); line-height: 1.25; font-weight: 800; letter-spacing: -.015em; }
h3 { font-size: var(--fs-h3); line-height: 1.3; font-weight: 750; letter-spacing: -.01em; }
h4 { font-size: 15px; line-height: 1.35; font-weight: 750; }
p { margin: 0; }
b, strong { font-weight: 750; }
small { font-size: var(--fs-xs); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-4) 0; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* Odak halkası: her etkileşimli öğede aynı, görünür */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 1px; }

/* İkon: icons.js tüm SVG'lere class="i" verir */
svg.i { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }

/* Yardımcılar */
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }
.strong { font-weight: 750; }
.num, .tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
/* Tablo rakamları içinde ondalık virgül orantılı (rakam genişliğinde boşluk bırakmaz) */
.dec { font-variant-numeric: normal; font-feature-settings: normal; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 6px; }
.stack-lg > * + * { margin-top: 20px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* Tipografi sınıfları */
.t-display { font-size: var(--fs-display); line-height: .86; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.t-h1 { font-size: var(--fs-h1); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.t-h2 { font-size: var(--fs-h2); line-height: 1.25; font-weight: 800; letter-spacing: -.015em; }
.t-h3 { font-size: var(--fs-h3); line-height: 1.3; font-weight: 750; letter-spacing: -.01em; }
.t-body { font-size: var(--fs-body); line-height: 1.5; }
.kicker, .t-label { font-size: var(--fs-label); font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lead { font-size: var(--fs-body); color: var(--ink-2); }
.m { font-size: var(--fs-sm); color: var(--muted); line-height: 1.4; }
.m b { color: var(--ink); }

.link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--brand-ink); font-weight: 750; font-size: var(--fs-sm); text-decoration: none; }
.link svg.i { width: 16px; height: 16px; }
.link:hover { text-decoration: underline; }
.linkbtn {
  position: relative; display: inline; background: none; border: 0; padding: 0; margin: 0;
  color: var(--brand-ink); font-weight: 750; cursor: pointer; text-decoration: underline; text-decoration-color: var(--brand-line); text-underline-offset: 3px;
}
.linkbtn::after { content: ""; position: absolute; inset: -12px -6px; } /* dokunma alanı ≥ 44px */
.linkbtn:hover { text-decoration-color: currentColor; }

.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--fs-xs); margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 3. Düğmeler ----------
   .btn = birincil (DÜZ marka rengi, gradyan yok)
   .secondary  marka yumuşak   .ghost  nötr dolgu   .outline/.line  ince çerçeve
   .danger  YALNIZCA acil eylemler (112, acile başvur)   .teal  doktor kimliği
   .white / .on-acil  kırmızı acil kartın içinde
   boyut: .lg 54 · (varsayılan) 48 · .sm 44 · .xs 36 (+görünmez dokunma alanı)   .block  tam genişlik   .icon  kare */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: var(--r-pill);
  background: var(--brand-solid); color: var(--on-brand);
  font-size: var(--fs-body); font-weight: 750; line-height: 1.1; letter-spacing: 0;
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  transition: background-color var(--dur), box-shadow var(--dur), transform .06s, filter var(--dur);
}
.btn svg.i { width: 19px; height: 19px; }
.btn:hover { background: var(--brand-solid-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: default; pointer-events: none; }
.btn.block { display: flex; width: 100%; }
.btn.secondary { background: var(--brand-soft); color: var(--brand-ink); }
.btn.secondary:hover { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand-line); }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.outline, .btn.line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--control-line); }
.btn.outline:hover, .btn.line:hover { background: var(--surface-2); }
.btn.danger { background: var(--acil-solid); color: var(--on-acil); }
.btn.danger:hover { background: #c4271b; }
.btn.teal { background: var(--teal-solid); color: #fff; }
.btn.teal:hover { filter: brightness(1.08); background: var(--teal-solid); }
.btn.white { background: #fff; color: #b42318; box-shadow: 0 10px 24px -12px rgba(60, 0, 20, .6); }
.btn.white:hover { background: #fff5f4; }
.btn.on-acil { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7); }
.btn.on-acil:hover { background: rgba(255, 255, 255, .22); }
.btn.lg { min-height: 54px; padding: 0 22px; font-size: 17px; }
.btn.sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn.sm svg.i { width: 18px; height: 18px; }
.btn.xs { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.xs svg.i { width: 16px; height: 16px; }
.btn.xs::after { content: ""; position: absolute; inset: -4px 0; }
.btn.icon { padding: 0; width: 48px; }
.btn.icon.sm { width: 44px; }
.btn.icon.lg { width: 54px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.iconbtn {
  position: relative; flex: none;
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background-color var(--dur);
}
.iconbtn:hover { background: var(--surface-2); }
.iconbtn svg.i { width: 22px; height: 22px; }
.iconbtn.surface, .bell { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); }
.iconbtn.surface:hover, .bell:hover { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-1); }
.iconbtn .badge, .bell .badge { position: absolute; top: -3px; right: -3px; }
.bell { position: relative; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.bell svg.i, .bell svg { width: 22px; height: 22px; }

/* ---------- 4. Çipler ve rozetler ----------
   Seviye = renk + ikon + Türkçe etiket (ui.js → levelChip()).
   .chip.acil  .chip.bugun  .chip.bilgi  .chip.ok   (eski: .red .amber .blue/.info .green)
   Renk çipleri: .brand .violet .peach .teal .neutral    Kahraman üstünde: .on-hero */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 28px; padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink-2);
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.1; letter-spacing: 0;
  white-space: nowrap; vertical-align: middle;
}
.chip svg.i { width: 15px; height: 15px; margin-left: -3px; stroke-width: 2.3; }
.chip.lg { min-height: 32px; padding: 0 13px; font-size: var(--fs-sm); }
.chip.lg svg.i { width: 16px; height: 16px; }
.chip.acil, .chip.red { background: var(--acil-bg); color: var(--acil-ink); box-shadow: inset 0 0 0 1px var(--acil-line); }
.chip.bugun, .chip.amber { background: var(--bugun-bg); color: var(--bugun-ink); box-shadow: inset 0 0 0 1px var(--bugun-line); }
.chip.bilgi, .chip.blue, .chip.info { background: var(--bilgi-bg); color: var(--bilgi-ink); box-shadow: inset 0 0 0 1px var(--bilgi-line); }
.chip.ok, .chip.green { background: var(--ok-bg); color: var(--ok-ink); box-shadow: inset 0 0 0 1px var(--ok-line); }
.chip.brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip.violet { background: var(--accent-soft); color: var(--accent-ink); }
.chip.peach { background: var(--peach-soft); color: var(--peach-ink); }
.chip.teal { background: var(--teal-soft); color: var(--teal-ink); }
.chip.neutral { background: var(--surface-2); color: var(--ink-2); }
.chip.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
/* Kahraman üstünde koyulaştıran zemin: beyaz küçük yazı gradyanın açık (şeftali) kısmında da AA */
.chip.on-hero { background: rgba(40, 8, 48, .3); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
button.chip, a.chip { position: relative; cursor: pointer; text-decoration: none; border: 0; }
button.chip::after, a.chip::after { content: ""; position: absolute; inset: -8px -2px; }

/* Sayaç rozeti: okunmamış = marka; acil sayısı = kırmızı */
.badge {
  display: inline-grid; place-items: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--brand-solid); color: var(--on-brand);
  font-size: 12px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--bg);
}
.badge.acil { background: var(--acil-solid); color: var(--on-acil); }
.badge.neutral { background: var(--surface-3); color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--line-strong); }
.dot.brand, .udot { background: var(--brand); }
.dot.acil, .dot.red { background: var(--acil); }
.dot.bugun, .dot.amber { background: var(--bugun-ink); }
.dot.bilgi { background: var(--bilgi-ink); }
.dot.ok, .dot.green { background: var(--ok-ink); }
.udot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 4px var(--brand-soft); }

/* Tamam metni (✓ Alındı · 09:04) ve satır içi not */
.ok-text { display: inline-flex; align-items: center; gap: 3px; color: var(--ok-ink); font-weight: 750; }
.ok-text svg.i { width: 15px; height: 15px; stroke-width: 2.6; }
.note {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px 5px 8px; border-radius: var(--r-pill);
  background: var(--bilgi-bg); color: var(--bilgi-ink);
  font-size: var(--fs-sm); font-weight: 650; line-height: 1.3;
}
.note svg.i { width: 16px; height: 16px; }
.note.bugun { background: var(--bugun-bg); color: var(--bugun-ink); }

/* ---------- 5. Kart, karo, liste ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  color: var(--ink);
}
.card.flat { box-shadow: inset 0 0 0 1px var(--line); }
.card.plain { box-shadow: none; background: var(--surface-2); }
.card.tight { padding: 14px; }
.card.pad-0 { padding: 0; overflow: hidden; }
a.card, .card.interactive { display: block; text-decoration: none; cursor: pointer; transition: box-shadow var(--dur), transform .06s; }
a.card:hover, .card.interactive:hover { box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-2); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-title h2 { font-size: var(--fs-h2); }
.card-title h3 { font-size: var(--fs-h3); }
.card-title .link { min-height: 32px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 6px 2px 10px; }

/* İkon karosu (44px) */
.tile {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink-2);
  font-size: 22px; line-height: 1;
}
.tile svg.i { width: 22px; height: 22px; }
.tile.sm { width: 36px; height: 36px; border-radius: 12px; }
.tile.sm svg.i { width: 19px; height: 19px; }
.tile.lg { width: 56px; height: 56px; border-radius: 19px; }
.tile.lg svg.i { width: 28px; height: 28px; }
.tile.rose, .tile.brand { background: var(--brand-soft); color: var(--brand-ink); }
.tile.violet { background: var(--accent-soft); color: var(--accent-ink); }
.tile.peach { background: var(--peach-soft); color: var(--peach-ink); }
.tile.teal { background: var(--teal-soft); color: var(--teal-ink); }
.tile.blue { background: var(--bilgi-bg); color: var(--bilgi-ink); }
.tile.acil { background: var(--acil-bg); color: var(--acil); box-shadow: inset 0 0 0 1.5px var(--acil-line); }
.tile.bugun { background: var(--bugun-bg); color: var(--bugun-ink); box-shadow: inset 0 0 0 1.5px var(--bugun-line); }
.tile.bilgi { background: var(--bilgi-bg); color: var(--bilgi-ink); box-shadow: inset 0 0 0 1.5px var(--bilgi-line); }
.tile.ok { background: var(--ok-bg); color: var(--ok-ink); box-shadow: inset 0 0 0 1.5px var(--ok-line); }
.emoji { font-family: var(--font-emoji); font-weight: 400; }

/* Liste satırı: [karo] [başlık + meta] [sağ öğe] */
.list-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 12px 0;
  border-top: 1px solid var(--line);
  color: inherit; text-decoration: none;
}
.list-row:first-child, .card-title + .list-row { border-top: 0; }
.list-row .t, .list-row .title { font-size: var(--fs-body); font-weight: 750; line-height: 1.3; }
.list-row .t.done { color: var(--muted); }
.list-row .m { margin-top: 1px; }
a.list-row:hover, button.list-row:hover { background: var(--surface-2); }
button.list-row { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: none; text-align: left; font: inherit; cursor: pointer; }
.list-row > .chev { color: var(--muted); }
.list-row > .chev svg.i, .list-row > svg.i.chev { width: 18px; height: 18px; }
.list { margin: 0; padding: 0; list-style: none; }

/* Anahtar–değer listesi */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: var(--fs-sm); margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- 6. Form ---------- */
label.field, .field { display: block; }
.field > span:first-child, label.field > span { display: block; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.input, select.input, textarea.input {
  display: block; width: 100%;
  min-height: 50px; padding: 12px 14px;
  border: 0; border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--control-line);
  font-size: var(--fs-body); font-weight: 550; line-height: 1.3;
  outline: none; appearance: none; -webkit-appearance: none;
  transition: box-shadow var(--dur);
}
.input::placeholder { color: var(--muted); opacity: 1; font-weight: 500; }
.input:hover { box-shadow: inset 0 0 0 1.5px var(--muted); }
.input:focus, .input:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus), 0 0 0 4px var(--accent-soft); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--bugun-ink); }
select.input { padding-right: 42px; background-image: var(--chev); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; cursor: pointer; }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
input[type="date"].input, input[type="time"].input, input[type="datetime-local"].input { font-variant-numeric: tabular-nums; }
.input::-webkit-calendar-picker-indicator { opacity: .7; cursor: pointer; }
.input.lg, .input-unit .input { font-size: 22px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* Birimli klinik girdi: <span class="input-unit"><input class="input"><em>mmHg</em></span> */
.input-unit { position: relative; display: block; }
.input-unit .input { padding-right: 70px; }
.input-unit > em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); pointer-events: none; }
.hint { font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; line-height: 1.4; }
/* Hata metni: kırmızı DEĞİL (kırmızı yalnızca Acil) — koyu amber + ikon */
.err { display: flex; align-items: flex-start; gap: 6px; color: var(--bugun-ink); font-size: var(--fs-sm); font-weight: 700; line-height: 1.4; }
.err::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.3v.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.3v.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.err[hidden] { display: none; }

/* Onay satırı (checkbox/radio + metin) */
.check {
  display: flex; gap: 12px; align-items: flex-start;
  min-height: 52px; padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
  cursor: pointer; line-height: 1.4;
  transition: background-color var(--dur), box-shadow var(--dur);
}
.check input { margin: 0; flex: none; }
.check:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.check.on { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand-line); }
.check:has(input:checked) { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand-line); }
.check.red-flag.on, .check.acil.on { background: var(--acil-bg); box-shadow: inset 0 0 0 1.5px var(--acil-line); }
.check.red-flag:has(input:checked), .check.acil:has(input:checked) { background: var(--acil-bg); box-shadow: inset 0 0 0 1.5px var(--acil-line); }

/* Onay kutusu / radyo: elle çizilir (tarayıcı accent-color'ı koyu temada kırmızıya kaydırıyor; kırmızı yalnızca Acil) */
input[type="checkbox"]:not(.switch), input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; margin: 0; flex: none;
  display: inline-grid; place-items: center; vertical-align: middle;
  border: 0; border-radius: 7px;
  background: var(--surface) center / 16px no-repeat;
  box-shadow: inset 0 0 0 2px var(--control-line);
  cursor: pointer; transition: background-color var(--dur), box-shadow var(--dur);
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:not(.switch):checked { background-color: var(--brand-solid); background-image: var(--tick); box-shadow: none; }
input[type="radio"]:checked { background: var(--surface); box-shadow: inset 0 0 0 7px var(--brand-solid); }
input[type="checkbox"]:not(.switch):disabled, input[type="radio"]:disabled { opacity: .5; cursor: default; }
.check.red-flag input:checked, .check.acil input:checked { background-color: var(--acil-solid); }

/* Segment kontrol: radyo tabanlı (form) veya düğme tabanlı (aria-pressed / .on)
   <div class="seg" role="radiogroup"><label><input type="radio" name="x" value="a" checked><span>A</span></label>…</div> */
.seg { display: flex; padding: 4px; gap: 2px; border-radius: var(--r-pill); background: var(--surface-2); }
.seg.inline { display: inline-flex; }
.seg label, .seg button {
  position: relative; flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 14px;
  border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--ink-2);
  font-size: var(--fs-sm); font-weight: 700; text-align: center; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur), color var(--dur), box-shadow var(--dur);
}
.seg label > span { display: inline-flex; align-items: center; gap: 6px; }
.seg svg.i { width: 17px; height: 17px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label.on, .seg button.on, .seg button[aria-pressed="true"], .seg button[aria-selected="true"] {
  background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}
.seg label:has(input:checked) { background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 1px; }
/* :has() yoksa (iOS 15.0–15.3, eski WebView): seçim ui.js'in eklediği .on ile, odak halkası iç etikette */
@supports not selector(:has(*)) {
  .seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 8px; border-radius: var(--r-pill); }
}
.seg button b, .seg label b { color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }

/* Anahtar (switch): <input type="checkbox" class="switch"> */
.switch {
  appearance: none; -webkit-appearance: none; flex: none;
  position: relative; width: 52px; height: 32px; margin: 0;
  border-radius: var(--r-pill); background: var(--control-line);
  cursor: pointer; transition: background-color var(--dur);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
  transition: transform var(--dur) var(--ease);
}
.switch:checked { background: var(--brand-solid); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: .5; cursor: default; }
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; cursor: pointer; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-row .grow > small, .switch-row .hint { display: block; margin-top: 2px; }

/* Adım göstergesi */
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps i { flex: 1; height: 5px; border-radius: var(--r-pill); background: var(--line); }
.steps i.on { background: var(--brand-solid); }

/* ---------- 7. Avatar (nötr baş harfler) ---------- */
.avatar {
  width: 44px; height: 44px; flex: none;
  display: inline-grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px; font-weight: 800; letter-spacing: .02em; line-height: 1;
  text-decoration: none;
}
button.avatar, a.avatar { cursor: pointer; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.brand { background: var(--brand-soft); color: var(--brand-ink); box-shadow: none; }
.avatar.teal { background: var(--teal-soft); color: var(--teal-ink); box-shadow: none; }

/* ---------- 8. Uyarılar ---------- */
/* Seviye kartı: <div class="alert-card bugun"><span class="tile bugun">ikon</span><div class="grow"><h4>…</h4><p>…</p></div></div> */
.alert-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.alert-card h4 { font-size: 16px; margin-bottom: 2px; }
.alert-card p { color: var(--ink-2); }
.alert-card > .tile { width: 40px; height: 40px; border-radius: 13px; }
.alert-card .ico { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; font-size: 20px; line-height: 1; }
.alert-card .ico svg.i { width: 22px; height: 22px; }
.alert-card.acil, .alert-card.red { background: var(--acil-bg); box-shadow: inset 0 0 0 1.5px var(--acil-line); }
.alert-card.acil .ico, .alert-card.red .ico { background: transparent; color: var(--acil-ink); box-shadow: inset 0 0 0 1.5px var(--acil-line); }
.alert-card.acil h4, .alert-card.red h4 { color: var(--acil-ink); }
.alert-card.bugun, .alert-card.amber { background: var(--bugun-bg); box-shadow: inset 0 0 0 1.5px var(--bugun-line); }
.alert-card.bugun .ico, .alert-card.amber .ico { background: transparent; color: var(--bugun-ink); box-shadow: inset 0 0 0 1.5px var(--bugun-line); }
.alert-card.bugun h4, .alert-card.amber h4 { color: var(--bugun-ink); }
.alert-card.bilgi, .alert-card.info { background: var(--bilgi-bg); box-shadow: inset 0 0 0 1.5px var(--bilgi-line); }
.alert-card.bilgi .ico, .alert-card.info .ico { background: transparent; color: var(--bilgi-ink); box-shadow: inset 0 0 0 1.5px var(--bilgi-line); }
.alert-card.bilgi h4, .alert-card.info h4 { color: var(--bilgi-ink); }
.alert-card.ok, .alert-card.green { background: var(--ok-bg); box-shadow: inset 0 0 0 1.5px var(--ok-line); }
.alert-card.ok .ico, .alert-card.green .ico { background: transparent; color: var(--ok-ink); box-shadow: inset 0 0 0 1.5px var(--ok-line); }
.alert-card.ok h4, .alert-card.green h4 { color: var(--ok-ink); }

/* ACİL kart (hasta ana sayfası, onaylanmamış kırmızı uyarı): DÜZ gerçek kırmızı, gradyan yok.
   Gösterildiğinde gebelik kahramanı .hero-slim'e döner. */
.urgent {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 18px; border-radius: var(--r-xl);
  background: var(--acil-solid); color: var(--on-acil);
  box-shadow: 0 22px 44px -20px rgba(180, 20, 10, .65);
}
.urgent::after {
  content: ""; position: absolute; z-index: -1; right: -64px; top: -72px; width: 220px; height: 220px; border-radius: 50%;
  border: 1.5px solid rgba(90, 0, 0, .16);
  box-shadow: 0 0 0 26px rgba(90, 0, 0, .06), 0 0 0 54px rgba(90, 0, 0, .04);
  pointer-events: none;
}
.urgent h2, .urgent h3 { color: #fff; }
.urgent-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.urgent-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 9px;
  border-radius: var(--r-pill); background: #fff; color: #b42318;
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.urgent-badge svg.i { width: 16px; height: 16px; stroke-width: 2.4; }
.urgent-time { font-size: var(--fs-sm); font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.urgent-head { display: flex; gap: 14px; align-items: center; margin-top: 16px; }
.urgent-head h2 { font-size: 23px; line-height: 1.15; letter-spacing: -.02em; }
.urgent-ic {
  position: relative; flex: none; width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .18); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55);
}
/* Nabız halkası yalnızca transform/opacity ile (her karede yeniden boyama yok) */
.urgent-ic::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .55);
  animation: koza-ring 1.8s ease-out infinite; will-change: transform, opacity;
}
.urgent-ic svg.i { width: 26px; height: 26px; stroke-width: 2.3; }
@keyframes koza-ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.55); opacity: 0; } }
.urgent p { margin-top: 12px; font-size: var(--fs-body); line-height: 1.5; color: #fff; }
.urgent p b { font-weight: 800; }
.urgent-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.urgent-acts .btn { min-height: 54px; padding: 0 12px; font-size: 17px; }
.urgent-note { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: var(--fs-sm); font-weight: 650; color: #fff; }
.urgent-note svg.i { width: 18px; height: 18px; flex: none; }
.urgent a:not(.btn) { color: #fff; }
.urgent :focus-visible { outline-color: #fff; }

/* SOS: kırmızı bayrak belirtileri satır içinde + büyük 112 düğmesi */
.sos {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 14px 14px 14px 16px; border-radius: var(--r-lg);
  background: var(--acil-bg); box-shadow: inset 0 0 0 1.5px var(--acil-line);
}
.sos b, .sos .sos-title { display: block; font-size: var(--fs-body); font-weight: 800; color: var(--acil-ink); }
.sos p, .sos .sos-flags { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
.sos .linkbtn { display: inline-block; margin-top: 6px; font-size: var(--fs-sm); color: var(--acil-ink); text-align: left; text-decoration-color: var(--acil-line); }
.sos-call, .sos .btn.danger { min-height: 64px; min-width: 88px; padding: 0 16px; border-radius: 22px; font-size: 22px; font-weight: 800; flex-direction: column; gap: 2px; }
.sos-call svg.i { width: 20px; height: 20px; }
.sos-call small { font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }

/* Tek satırlık bilgi bandı (ör. bildirim izni) */
.banner {
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 6px 6px 6px 14px; border-radius: var(--r-md);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-sm); font-weight: 650; color: var(--ink-2);
}
.banner > svg.i { width: 20px; height: 20px; color: var(--accent-ink); }
.banner .grow { line-height: 1.35; }
.banner .btn { flex: none; }

/* Bildirim izni kartı — "Bugün" kartının ALTINDA; kapatma × kart dolgusu içinde */
.push-prompt {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 4px 12px; align-items: start;
  padding: 14px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
}
.push-prompt .pp-ic { width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.push-prompt .pp-ic svg, .push-prompt .pp-ic svg.i { width: 22px; height: 22px; }
.push-prompt h3, .push-prompt h4 { font-size: 16px; }
.push-prompt p { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
.push-prompt .pp-x { width: 44px; height: 44px; margin: -4px -4px 0 0; }
.push-prompt > .grow:last-child, .push-prompt > .pp-body:last-child { grid-column: 2 / -1; }
.push-prompt .pp-acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- 9. Gebelik kahramanı ---------- */
/* Ekranın TEK gradyan anı. Büyük rakam ve "hafta" etiketi ayrı öğelerdir (yetim nokta yok). */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: block; padding: 20px 22px;
  border-radius: 32px;
  background: var(--grad-hero);
  color: #fff;
  box-shadow: var(--shadow-hero), inset 0 1px 0 rgba(255, 255, 255, .3);
  text-decoration: none;
}
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 40% at 20% 0%, rgba(255, 255, 255, .2), transparent 70%); pointer-events: none; }
.hero[role="button"], a.hero { cursor: pointer; }
.hero :focus-visible, .hero:focus-visible { outline-color: #fff; }
.hero-orb {
  position: absolute; right: 18px; top: 18px;
  width: 104px; height: 104px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .6), rgba(255, 255, 255, .14) 62%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), inset 0 -12px 30px rgba(110, 70, 225, .3), 0 14px 30px -12px rgba(60, 10, 70, .5);
}
.hero-orb > span { font-family: var(--font-emoji); font-size: 56px; line-height: 1; transform: rotate(-12deg); filter: drop-shadow(0 6px 8px rgba(60, 20, 40, .3)); }
.hero-week { display: flex; align-items: flex-end; gap: 10px; margin-top: 10px; }
.hero-num { font-size: 92px; line-height: .8; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin-left: -3px; }
.hero-unit { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 2px; }
.hero-unit > b { font-size: 26px; line-height: 1; font-weight: 800; letter-spacing: -.01em; }
.hero-size { margin-top: 16px; max-width: 30ch; font-size: var(--fs-body); line-height: 1.4; color: rgba(255, 255, 255, .96); }
.hero-size b { font-weight: 800; }
.hero-size .nw { white-space: nowrap; }
.hero-size .sep { margin: 0 6px; }
/* Trimester ilerlemesi: 3 parça (13/14/13 hafta); her <i style="--f:XX%"> */
.hero-prog { display: grid; grid-template-columns: 13fr 14fr 13fr; gap: 5px; margin-top: 18px; }
.hero-prog i { position: relative; height: 8px; border-radius: var(--r-pill); background: linear-gradient(90deg, #fff var(--f, 0%), rgba(255, 255, 255, .28) var(--f, 0%)); }
.hero-prog i.cur::after {
  content: ""; position: absolute; left: var(--f, 0%); top: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .3), 0 4px 10px rgba(60, 10, 60, .35);
}
.hero-meta { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 14px; }
.hero-meta small { display: block; font-size: var(--fs-xs); font-weight: 650; opacity: .9; }
.hero-meta b { display: block; font-size: 22px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-meta .r { text-align: right; }
.hero-meta .r b { font-size: 17px; letter-spacing: -.01em; }
.hero-text { margin-top: 12px; font-size: var(--fs-body); line-height: 1.45; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* İnce şerit: acil uyarı varken kahramanın yerini alır (düz yüzey; uyarı ekranın sahibi) */
.hero-slim {
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 10px 12px 10px 10px; border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  text-decoration: none;
}
.hero-slim .orb-sm {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand-soft);
  font-family: var(--font-emoji); font-size: 24px; line-height: 1;
}
.hero-slim .hs-main { flex: 1; min-width: 0; line-height: 1.25; }
.hero-slim .hs-week { display: flex; align-items: baseline; gap: 6px; }
.hero-slim .hs-week b { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.hero-slim .hs-week span { font-size: var(--fs-body); font-weight: 750; }
.hero-slim .hs-week em { font-style: normal; font-size: var(--fs-sm); color: var(--muted); font-weight: 650; }
.hero-slim small { display: block; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.hero-slim > svg.i { color: var(--muted); width: 20px; height: 20px; }

/* Doktor takip hapı */
.care-pill, .doc-chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 12px 0 4px; margin-top: 10px;
  border-radius: var(--r-pill);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--fs-sm); font-weight: 650; color: var(--ink-2);
}
.doc-chip { padding: 4px 12px; max-width: 100%; }
.care-pill .avatar { width: 28px; height: 28px; font-size: 11px; }
.care-pill svg.i, .doc-chip svg.i { width: 17px; height: 17px; color: var(--teal); }

/* Randevu tarih karosu */
.datetile {
  flex: none; width: 64px; height: 80px; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--brand-solid); color: var(--on-brand);
}
.datetile small { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--on-brand); }
.datetile b { font-size: 32px; line-height: 1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* ---------- 10. İlerleme, halka, zaman çizelgesi, iskelet, boş durum ---------- */
.progress { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--brand-solid); width: var(--p, 0%); transition: width .4s var(--ease); }
.progress.ok > i { background: var(--ok); }
.progress.lg { height: 12px; }
.hero .progress { background: rgba(255, 255, 255, .28); margin-top: 14px; }
.hero .progress > i { background: #fff; }

.ring { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 750; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ring svg { width: 28px; height: 28px; transform: rotate(-90deg); flex: none; }
.ring .ring-track { fill: none; stroke: var(--surface-3); stroke-width: 4.5; }
.ring .ring-fill { fill: none; stroke: var(--brand-solid); stroke-width: 4.5; stroke-linecap: round; transition: stroke-dasharray .4s var(--ease); }
.ring.ok .ring-fill { stroke: var(--ok); }
.ring.lg svg { width: 56px; height: 56px; }

.timeline { position: relative; padding-left: 26px; margin: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--line-strong); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: -24px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); }
.tl-item.now::before { background: var(--brand-solid); box-shadow: 0 0 0 4px var(--brand-soft); }
.tl-item.past { color: var(--muted); }
.tl-item.past::before { background: var(--ok); box-shadow: none; }
.tl-item .tl-when { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-item.now .tl-when { color: var(--brand-ink); }

.skel {
  display: block; height: 14px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--skel) 25%, var(--skel-hi) 45%, var(--skel) 65%);
  background-size: 300% 100%;
  animation: koza-shimmer 1.4s linear infinite;
}
.skel + .skel { margin-top: 10px; }
.skel.lg { height: 22px; }
.skel.block { height: 96px; border-radius: var(--r-md); }
.skel.circle { width: 44px; height: 44px; border-radius: 50%; }
.skel-card { padding: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.skel-card + .skel-card { margin-top: 14px; }
@keyframes koza-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 16px; }
.empty .tile { width: 56px; height: 56px; border-radius: 19px; margin-bottom: 4px; }
.empty .tile svg.i { width: 26px; height: 26px; }
.empty h3 { font-size: var(--fs-h3); }
.empty p { color: var(--muted); max-width: 34ch; }
.empty .btn { margin-top: 8px; }

/* ---------- 11. Alt pencere (sheet / modal) — cam + opak yedek ---------- */
.sheet-wrap {
  position: fixed; inset: 0; z-index: var(--z-sheet);
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--scrim);
  animation: koza-fade var(--dur) ease-out;
}
.sheet-wrap.out { opacity: 0; transition: opacity var(--dur); }
.sheet {
  position: relative;
  width: 100%; max-width: 560px;
  max-height: calc(100vh - var(--safe-t) - 16px);
  max-height: calc(100dvh - var(--safe-t) - 16px);
  overflow: auto; overscroll-behavior: contain;
  padding: 8px var(--gutter) calc(20px + var(--safe-b));
  border-radius: 30px 30px 0 0;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow-3), inset 0 1px 0 var(--glass-border);
  color: var(--ink);
  animation: koza-up .26s var(--ease);
}
.sheet-wide { max-width: 760px; }
.sheet-grab { width: 42px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet-x {
  position: absolute; right: 12px; top: 10px; z-index: 1;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2); cursor: pointer;
  font-size: 22px; line-height: 1;
}
.sheet-x:hover { background: var(--surface-3); }
.sheet-x svg.i { width: 20px; height: 20px; }
.sheet-body > h2:first-child, .sheet h2.sheet-title { padding-right: 48px; margin-bottom: 4px; }
.sheet-acts { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
.sheet-acts.two { grid-template-columns: 1fr 1fr; }
.sheet-acts .btn { min-height: 54px; font-size: 17px; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { border-radius: 30px; padding-bottom: 24px; max-height: calc(100vh - 48px); }
  .sheet-grab { visibility: hidden; height: 0; margin-bottom: 18px; }
}
@keyframes koza-up { from { transform: translateY(36px); opacity: .5; } }
@keyframes koza-fade { from { opacity: 0; } }
html.sheet-open { overflow: hidden; }

.sheet.no-x .sheet-body > h2:first-child { padding-right: 0; }
/* Odak başlığa programla taşınınca halka gösterme (başlık etkileşimli değil) */
.sheet h2[tabindex="-1"]:focus, .sheet h1[tabindex="-1"]:focus { outline: none; }

/* Ölçüm sonucu bloğu (alt pencere içinde; sheet(..., { closeButton: false }) ile — "Tamam" kapatır) */
.result-head { display: flex; gap: 14px; align-items: center; padding-right: 48px; }
.sheet.no-x .result-head { padding-right: 0; }
.result-head h2 { font-size: 22px; line-height: 1.2; }
@media (max-width: 400px) { .result-head h2 { font-size: 20px; } .result-head .tile.lg { width: 48px; height: 48px; border-radius: 16px; } }
/* Teslim satırı: "✓ İletildi · Doç. Dr. … · 09:41". Dar ekranda ad + saat birlikte alt satıra iner;
   ayraç noktası satır başına düşerse kapsayıcının dışında kalıp kırpılır (yetim "·" yok) */
.receipt { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; overflow: hidden; margin-top: 3px; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.receipt .rc-to { position: relative; white-space: nowrap; }
.receipt .rc-to::before { content: "·"; position: absolute; left: -9px; }
.receipt .ok-text, .receipt > b { color: var(--teal-ink); font-weight: 750; }
.receipt svg.i { width: 15px; height: 15px; stroke-width: 2.6; color: var(--teal-ink); }
.reading {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end;
  margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface-2);
}
.reading small, .reading .r-label { display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.reading .r-val { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.reading .r-val b { font-size: 46px; line-height: 1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.reading .r-val span { font-size: var(--fs-sm); font-weight: 750; color: var(--muted); }
.reading .r-target { text-align: right; padding-left: 14px; border-left: 1px solid var(--line-strong); }
.reading .r-target b { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.reading + .chip { margin-top: 10px; }
.result-text { margin-top: 12px; font-size: var(--fs-body); line-height: 1.5; color: var(--ink-2); }
.result-text b { color: var(--ink); }

/* Bildirim (toast): ters renk, seviye ikonu */
#toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: var(--z-toast);
  bottom: calc(104px + var(--safe-b));
  display: grid; gap: 8px; width: min(calc(100vw - 32px), 440px);
  pointer-events: none;
}
body.doctor #toasts { bottom: calc(24px + var(--safe-b)); }
.toast {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--inverse); color: var(--on-inverse);
  box-shadow: var(--shadow-2);
  font-size: var(--fs-body); font-weight: 650; line-height: 1.35;
  transition: opacity .3s, transform .3s var(--ease);
  animation: koza-up .24s var(--ease);
  pointer-events: none; /* eylemsiz: altındaki düğmelere dokunuş geçer */
}
html.sheet-open #toasts, #toasts.top { bottom: auto; top: calc(12px + var(--safe-t)); }
.toast svg.i { width: 20px; height: 20px; flex: none; color: var(--toast-ok); }
.toast-err svg.i, .toast-warn svg.i { color: var(--toast-warn); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- 12. Hasta kabuğu ---------- */
/* <div class="p-app"> <header class="p-head|topbar"> <main class="p-main"> <nav class="tabbar"> */
.p-app {
  position: relative; isolation: isolate;
  max-width: 560px; margin: 0 auto;
  min-height: 100vh; min-height: 100dvh;
  padding: 0 0 calc(112px + var(--safe-b));
  padding-left: var(--safe-l); padding-right: var(--safe-r);
}
/* Ortam mesh'i (üstte, içerikle kayar) */
.p-app::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: 620px; pointer-events: none;
  background:
    radial-gradient(55% 40% at 8% 12%, var(--mesh-a), transparent 72%),
    radial-gradient(60% 42% at 96% 6%, var(--mesh-b), transparent 72%),
    radial-gradient(55% 40% at 72% 58%, var(--mesh-c), transparent 72%);
}
.p-app.has-urgent::before {
  background:
    radial-gradient(45% 36% at 14% 10%, rgba(217, 45, 32, .20), transparent 72%),
    radial-gradient(50% 42% at 92% 6%, var(--mesh-b), transparent 72%);
}
/* Sekme çubuğunun arkasındaki yumuşak geçiş */
.p-app::after {
  content: ""; position: fixed; z-index: calc(var(--z-tabbar) - 1); left: 0; right: 0; bottom: 0;
  height: calc(118px + var(--safe-b)); pointer-events: none;
  background: linear-gradient(180deg, var(--bg-fade) 0%, var(--bg-fade-2) 55%, var(--bg) 100%);
}
.p-head {
  display: flex; align-items: center; gap: 8px;
  padding: calc(14px + var(--safe-t)) var(--gutter) 6px;
}
.p-head .hello, .p-head h1 { flex: 1; min-width: 0; font-size: 30px; line-height: 1.12; font-weight: 800; letter-spacing: -.025em; }
.p-head .kicker { margin-bottom: 2px; }
.p-main { padding: 8px var(--gutter) 16px; }
.p-main > * + * { margin-top: 14px; }

/* Kompakt yapışkan başlık (alt sayfalar) — cam + opak yedek */
.topbar {
  position: sticky; top: 0; z-index: var(--z-topbar);
  display: flex; align-items: center; gap: 6px;
  min-height: calc(56px + var(--safe-t));
  padding: var(--safe-t) calc(var(--gutter) - 8px) 0;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: 0 1px 0 var(--line);
}
.topbar h1, .topbar .title { flex: 1; min-width: 0; font-size: 18px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .iconbtn { color: var(--ink); }
.topbar + .p-main { padding-top: 14px; }
.page-head { margin: 6px 0 4px; }
.page-head h1 { font-size: 32px; line-height: 1.1; letter-spacing: -.025em; }
.page-head .lead { margin-top: 4px; }

/* Durum çubuğu örtüsü (yalnızca kenardan kenara yerel uygulamada görünür: güvenli alan > 0) */
body::before {
  content: ""; position: fixed; z-index: var(--z-statusbar); left: 0; right: 0; top: 0;
  height: var(--safe-t); pointer-events: none;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
body.doctor::before { background: var(--side-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
body.doctor { --chrome-color: var(--side-bg); --system-bars: dark; }

/* Yüzen kapsül sekme çubuğu — cam + opak yedek; ortada gradyanlı "+" */
.tabbar {
  position: fixed; z-index: var(--z-tabbar);
  left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); bottom: calc(12px + var(--safe-b));
  max-width: 520px; margin: 0 auto;
  height: 68px; padding: 0 6px;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  border-radius: var(--r-pill);
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 0 0 1px var(--glass-border), 0 18px 40px -14px rgba(60, 20, 70, .35), 0 2px 8px rgba(60, 20, 70, .08);
}
.tabbar a, .tabbar button {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 56px; margin: 0 2px; padding: 0;
  border: 0; border-radius: var(--r-pill); background: transparent;
  color: var(--muted); text-decoration: none;
  font-size: 12px; font-weight: 750; line-height: 1.1; white-space: nowrap;
  transition: background-color var(--dur), color var(--dur);
}
.tabbar a svg.i, .tabbar a > svg { width: 24px; height: 24px; }
.tabbar a.on, .tabbar a[aria-current="page"] { color: var(--brand-ink); background: var(--brand-soft); }
.tabbar a.on svg.i { stroke-width: 2.3; }
.tabbar a .badge { position: absolute; top: 2px; right: calc(50% - 25px); box-shadow: 0 0 0 2px var(--glass-solid); }
.tabbar a.plus, .tabbar a.plus.on { background: transparent; color: var(--brand-ink); }
.tabbar .fab {
  width: 58px; height: 58px; border-radius: 50%; flex: none;
  display: grid; place-items: center; margin-top: -30px;
  background: var(--grad-fab); color: #fff;
  box-shadow: var(--shadow-fab), 0 0 0 5px var(--glass-solid);
}
.tabbar .fab svg.i, .tabbar .fab svg { width: 28px; height: 28px; stroke-width: 2.6; }
.tabbar a.plus:active .fab { transform: scale(.96); }

/* Cam desteklenmiyorsa opak yüzey */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar, .sheet, .topbar, body::before { background: var(--glass-solid); }
}

/* ---------- 13. Doktor kabuğu ---------- */
body.doctor { background: var(--bg-2); }
.d-app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; background: var(--bg-2); }

/* Koyu kenar çubuğu: her iki temada koyu ("koyu ada" tokenları) */
.d-side, .on-dark {
  --ink: #f3ecf6; --ink-2: #d7cce0; --muted: #a99db4;
  --line: rgba(255, 255, 255, .09); --line-strong: rgba(255, 255, 255, .2); --control-line: rgba(255, 255, 255, .4);
  --surface: rgba(255, 255, 255, .06); --surface-2: rgba(255, 255, 255, .08); --surface-3: rgba(255, 255, 255, .14);
  --brand-ink: #ffa3c1; --brand-soft: rgba(255, 134, 173, .16); --focus: #cbbdff;
  --bg: var(--side-bg);
  color-scheme: dark;
  color: var(--ink);
}
.d-side {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 4px;
  padding: calc(20px + var(--safe-t)) 14px calc(16px + var(--safe-b)) calc(14px + var(--safe-l));
  background: var(--side-bg);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06);
  overflow-y: auto;
}
.d-side .brand-row { padding: 4px 8px 20px; }
.d-side .brand-name { color: #fff; font-size: 22px; }
.d-side .brand-sub { color: var(--muted); }
.d-nav { display: grid; gap: 3px; }
.d-nav a, .d-nav button {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 46px; width: 100%; padding: 0 12px;
  border: 0; border-radius: var(--r-sm); background: none;
  color: var(--ink-2); text-decoration: none; text-align: left;
  font-size: 15px; font-weight: 650; cursor: pointer;
  transition: background-color var(--dur), color var(--dur);
}
.d-nav a:hover, .d-nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.d-nav a.on, .d-nav a[aria-current="page"] { background: var(--brand-solid); color: #fff; font-weight: 750; }
.d-nav svg.i, .d-nav svg { width: 21px; height: 21px; flex: none; }
.d-nav .lbl { flex: 1; min-width: 0; }
.d-nav .badge { margin-left: auto; background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
.d-nav .badge.acil { background: var(--acil-solid); box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
.d-nav a.on .badge:not(.acil) { background: rgba(255, 255, 255, .24); }
.d-nav-label { margin: 18px 12px 6px; font-size: 11.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.d-doc {
  margin-top: auto; display: block;
  padding: 12px; border-radius: var(--r-md);
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  font-size: var(--fs-xs); color: var(--muted); line-height: 1.35;
}
.d-doc b { display: block; color: #fff; font-size: var(--fs-sm); }
.d-doc .linkbtn { color: var(--ink-2); }

.d-main { position: relative; isolation: isolate; min-width: 0; padding: calc(24px + var(--safe-t)) 32px 48px; }
.d-main::before {
  content: ""; position: absolute; z-index: -1; inset: 0 0 auto 0; height: 360px; pointer-events: none; opacity: .55;
  background: radial-gradient(32% 60% at 92% 0%, var(--mesh-b), transparent 70%), radial-gradient(26% 50% at 64% 0%, var(--mesh-a), transparent 70%);
}
.d-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.d-top h1 { font-size: 28px; }
.d-top .sub, .d-top .date { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: var(--fs-sm); font-weight: 650; }
.d-top .sub svg.i, .d-top .date svg.i { width: 17px; height: 17px; }
.d-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.d-app .card { border-radius: var(--r-md); padding: 16px 18px; }
.d-app .btn { border-radius: var(--r-sm); }
.d-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.d-grid > div > * + * { margin-top: 16px; }

/* Arama: hap biçimli girdi + ikon */
.search { position: relative; display: block; }
.search .input { padding-left: 44px; border-radius: var(--r-pill); min-height: 46px; }
.search > svg.i, .search > svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 700 11.5px var(--font); color: var(--muted); padding: 4px 8px; border-radius: 8px; background: var(--surface-2); }

/* KPI şeridi: ince çizgilerle bölünmüş; YALNIZCA açık acil hücresi kırmızı tonlu */
.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-radius: var(--r-md); overflow: hidden;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
}
.kpi {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  min-width: 0; padding: 14px 16px 14px;
  color: var(--ink); text-decoration: none;
  box-shadow: inset 1px 0 0 var(--line), inset 0 -1px 0 var(--line);
}
a.kpi:hover { background: var(--surface-2); }
.kpi .kl { display: flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); line-height: 1.25; }
.kpi .kl svg.i { width: 17px; height: 17px; color: var(--muted); }
.kpi > b, .kpi .kv-num { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi .kf { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; line-height: 1.3; }
.kpi.acil { background: var(--grad-kpi-acil); box-shadow: inset 0 3px 0 var(--acil), inset 1px 0 0 var(--acil-line), inset 0 -1px 0 var(--acil-line); }
.kpi.acil .kl, .kpi.acil > b, .kpi.acil .kl svg.i { color: var(--acil-ink); }

/* Triyaj satırı: SABİT seviye sütunu, iki satır (~70px), sağa hizalı zaman, eylemler */
.triage-list { margin: 0; padding: 0; list-style: none; }
.triage-row {
  display: grid; grid-template-columns: 88px 36px minmax(0, 1fr) 96px auto; gap: 0 12px; align-items: center;
  min-height: 72px; padding: 10px 14px;
  border-top: 1px solid var(--line);
}
.triage-row:first-child { border-top: 0; }
.triage-row.acil { background: var(--acil-bg); box-shadow: inset 3px 0 0 var(--acil); border-top-color: var(--acil-line); border-radius: var(--r-sm); }
.triage-row.acil + .triage-row { border-top-color: transparent; }
.tr-lvl { display: flex; }
.tr-body { min-width: 0; }
.tr-who { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tr-who a, .tr-who b { flex: 0 0 auto; max-width: 100%; font-size: 15px; font-weight: 750; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-who a { padding-block: 11px; margin-block: -11px; }
.tr-who a:hover { text-decoration: underline; }
.tr-meta { flex: 0 100 auto; min-width: 0; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-msg { margin-top: 3px; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.4; }
.tr-msg b { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.tr-time { font-size: var(--fs-xs); color: var(--muted); font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.triage-row.acil .tr-time { color: var(--acil-ink); }
.tr-acts { display: flex; gap: 8px; justify-content: flex-end; }

/* Tablo */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th {
  text-align: left; white-space: nowrap;
  padding: 10px 12px; border-bottom: 1px solid var(--line-strong);
  font-size: 12px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.tbl th[data-sort] { cursor: pointer; }
.tbl th[data-sort]:hover { color: var(--ink); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink-2); }
.tbl td b, .tbl td strong, .tbl td.name { color: var(--ink); }
.tbl td.name { min-width: 170px; font-weight: 700; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface-2); }
.tbl .num, .tbl td.num, .tbl th.num { font-variant-numeric: tabular-nums; text-align: right; }

/* Filtre hapları */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button {
  position: relative; min-height: 40px; padding: 0 14px;
  border: 0; border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: var(--fs-sm); font-weight: 700; cursor: pointer;
}
.filters button::after { content: ""; position: absolute; inset: -2px 0; }
.filters button:hover { background: var(--surface-2); }
.filters button.on, .filters button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); box-shadow: inset 0 0 0 1.5px var(--brand-line); }

/* Sekmeler (hasta dosyası) */
.tabs { display: flex; gap: 2px; margin: 18px 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 46px; padding: 0 14px; margin-bottom: -1px;
  border: 0; border-bottom: 2.5px solid transparent; background: none;
  color: var(--muted); font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.tabs button:hover, .tabs a:hover { color: var(--ink); }
.tabs button.on, .tabs a.on, .tabs [aria-selected="true"] { color: var(--brand-ink); border-bottom-color: var(--brand-solid); }
.tabs button:focus-visible, .tabs a:focus-visible { outline-offset: -3px; border-radius: 10px; }

.p-header { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.p-header .avatar { width: 56px; height: 56px; font-size: 19px; }
.facts { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 8px; font-size: var(--fs-sm); color: var(--muted); }
.facts b { color: var(--ink); font-weight: 750; font-variant-numeric: tabular-nums; }
.p-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.d-mobilebar { display: none; }

@media (max-width: 900px) {
  .d-app { grid-template-columns: minmax(0, 1fr); }
  .d-side {
    position: sticky; top: 0; z-index: var(--z-topbar); height: auto;
    flex-direction: row; align-items: center; gap: 8px;
    padding: calc(8px + var(--safe-t)) calc(10px + var(--safe-r)) 8px calc(12px + var(--safe-l));
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  .d-side::-webkit-scrollbar { display: none; }
  .d-side .brand-row { padding: 0; min-height: 44px; }
  .d-side .brand-sub, .d-doc, .d-nav-label { display: none; }
  .d-nav { margin-left: auto; display: flex; gap: 2px; }
  .d-nav .lbl { display: none; }
  .d-nav a, .d-nav button { width: 46px; justify-content: center; padding: 0; }
  .d-nav .badge { position: absolute; top: 1px; right: -1px; margin: 0; }
  .d-main { padding: 16px calc(var(--gutter) + var(--safe-r)) 40px calc(var(--gutter) + var(--safe-l)); }
  .d-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .triage-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px; }
  .tr-lvl { grid-column: 1 / -1; order: -1; }
  .tr-time { grid-column: 3; grid-row: 2; align-self: start; }
  .tr-acts { grid-column: 1 / -1; justify-content: stretch; }
  .tr-acts .btn { flex: 1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-top h1 { font-size: 22px; }
}
@media (max-width: 480px) {
  .d-side .brand-name { display: none; }
  .d-side .brand-row { min-width: 44px; }
  .d-side .brand-mark { width: 40px; height: 40px; }
  .d-nav a, .d-nav button { width: 44px; }
}

/* ---------- 14. Grafik ---------- */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-ylab, .c-xlab { font-size: 11.5px; font-weight: 650; fill: var(--muted); font-family: var(--font); font-variant-numeric: tabular-nums; }
.c-ylab { text-anchor: end; }
.c-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.c-dot { fill: var(--surface); stroke-width: 2; }
.c-dot-flag { fill: var(--bugun-ink); stroke: var(--surface); stroke-width: 2; }
.c-halo { fill: var(--bugun); opacity: .22; }
.c-ref { stroke-dasharray: 4 4; stroke-width: 1.3; opacity: .85; }
.c-reflab { font-size: 11.5px; font-weight: 750; font-family: var(--font); font-variant-numeric: tabular-nums; }
.c-band { fill: var(--c-band); }
.c-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: var(--fs-xs); font-weight: 650; color: var(--muted); }
.c-legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }
.c-legend-band { height: 10px !important; vertical-align: -1px !important; background: var(--c-band); box-shadow: inset 0 0 0 1px var(--ok-line); }
.chart-empty { padding: 26px; text-align: center; color: var(--muted); font-size: var(--fs-sm); background: var(--surface-2); border-radius: var(--r-md); }
.chart-empty.one { padding: 18px 16px; color: var(--ink-2); }
.chart-empty.one b { color: var(--ink); }
.chart-slot { min-height: 60px; }

/* ---------- 15. Ekran parçaları (varsayılanlar) ---------- */
/* Giriş / kayıt */
.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: calc(24px + var(--safe-t)) var(--gutter) calc(24px + var(--safe-b));
  background:
    radial-gradient(900px 520px at 0% -10%, var(--mesh-a), transparent 60%),
    radial-gradient(800px 480px at 100% 0%, var(--mesh-b), transparent 60%),
    radial-gradient(700px 420px at 100% 110%, var(--mesh-c), transparent 60%),
    var(--bg);
}
.auth-box { width: 100%; max-width: 440px; }
.auth h1 { font-size: 26px; }
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 48px; height: 48px; flex: none; border-radius: 14px; }
.brand-name { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--brand-ink); line-height: 1.1; }
.brand-sub { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.demo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kvkk-text {
  max-height: 240px; overflow: auto; padding: 14px;
  border-radius: var(--r-md); background: var(--surface-2);
  font-size: var(--fs-sm); line-height: 1.55; color: var(--ink-2);
}
.kvkk-text p + p { margin-top: 8px; }
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-weight: 650; }
.boot .brand-mark { width: 56px; height: 56px; }

/* İlaç / yapılacak satırı + yuvarlak onay (tick) */
.todo { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 0; border-top: 1px solid var(--line); }
.todo:first-of-type, .card-title + .todo { border-top: 0; }
.todo .ic { flex: none; width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-2); font-size: 20px; }
.todo .ic svg.i { width: 22px; height: 22px; }
.tick {
  flex: none; width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center;
  border: 2px solid var(--control-line); border-radius: 50%;
  background: transparent; color: transparent; cursor: pointer;
  transition: background-color var(--dur), border-color var(--dur), color var(--dur);
}
.tick svg.i, .tick svg { width: 22px; height: 22px; stroke-width: 2.6; }
.tick:hover { border-color: var(--brand-ink); color: var(--brand-line); }
.tick.on, .tick[aria-pressed="true"] { background: var(--brand-solid); border-color: transparent; color: #fff; }

/* Hafta seçici */
.weeks { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 12px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.weeks::-webkit-scrollbar { display: none; }
.weeks button {
  flex: none; width: 52px; height: 60px; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: 0; border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  font-size: 20px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; cursor: pointer;
}
.weeks button small { font-size: 11px; font-weight: 750; color: var(--muted); letter-spacing: 0; }
.weeks button.past { background: var(--surface-2); box-shadow: none; color: var(--ink-2); }
.weeks button.now { box-shadow: inset 0 0 0 2px var(--brand-line); color: var(--brand-ink); }
.weeks button.sel { width: 62px; height: 70px; font-size: 27px; background: var(--brand-solid); color: var(--on-brand); box-shadow: var(--shadow-1); }
.weeks button.sel small { color: var(--on-brand); }
.wk-head { display: flex; gap: 14px; align-items: center; }
.wk-head .fruit { font-family: var(--font-emoji); font-size: 60px; line-height: 1; }
.sect { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.sect .tile { width: 40px; height: 40px; border-radius: 13px; }
.sect h3, .sect h4 { font-size: 15px; font-weight: 800; }
.sect p { margin-top: 2px; color: var(--ink-2); line-height: 1.45; }
.tipbox { padding: 14px 16px; border-radius: var(--r-lg); background: var(--peach-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--peach-line); }
.tipbox h3, .tipbox h4, .tipbox b { color: var(--peach-ink); }

/* Kayıt karoları */
.log-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.log-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  min-height: 108px; padding: 14px;
  border: 0; border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  text-align: left; cursor: pointer; text-decoration: none;
  transition: box-shadow var(--dur), transform .06s;
}
.log-tile:hover { box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow-2); }
.log-tile:active { transform: scale(.985); }
.log-tile .em { font-family: var(--font-emoji); font-size: 26px; line-height: 1; }
.log-tile b { font-size: var(--fs-body); font-weight: 750; }
.log-tile small { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.log-tile.sel { box-shadow: inset 0 0 0 2px var(--brand-solid), var(--shadow-1); }
.lt-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lt {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  min-height: 92px; padding: 10px 4px; border: 0; border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
  font-size: var(--fs-xs); font-weight: 750; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
}
.lt .tile { width: 42px; height: 42px; }
.lt.sel, .lt[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--brand-solid), var(--shadow-1); }

/* Mesajlaşma */
.chat { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 20px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
/* Zaman satırı yarı saydam DEĞİL (marka zemininde AA); vurgu azaltma ağırlıkla */
.bubble time { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bubble.me time { color: var(--on-brand); }
.bubble.them time { color: var(--muted); }
.bubble.me { align-self: flex-end; background: var(--brand-solid); color: var(--on-brand); border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1); border-bottom-left-radius: 6px; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 50px; max-height: 160px; }
.composer .btn { flex: none; }

/* Hareket / kasılma sayacı — o ekranın tek kahraman anı */
.counter {
  width: 200px; height: 200px; margin: 12px auto; padding: 0;
  display: grid; place-items: center; place-content: center;
  border: 0; border-radius: 50%;
  background: var(--grad-hero); color: #fff;
  box-shadow: var(--shadow-hero), inset 0 1px 0 rgba(255, 255, 255, .3);
  cursor: pointer; user-select: none; touch-action: manipulation;
  transition: transform .08s;
}
.counter:active { transform: scale(.97); }
.counter b { display: block; font-size: 64px; line-height: 1; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.counter span { font-size: var(--fs-sm); font-weight: 650; opacity: .95; }
.counter.on { background: var(--teal-solid); box-shadow: 0 18px 40px -16px rgba(20, 90, 85, .6); }
.clock { font-size: 30px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }

/* Uygulama içi bildirim kutusu */
.inbox-item {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; min-height: 56px; padding: 12px 6px;
  border: 0; border-top: 1px solid var(--line); background: none;
  color: inherit; text-align: left; font: inherit; cursor: pointer; border-radius: 0;
}
.inbox-item:first-of-type { border-top: 0; }
.inbox-item .dot { margin-top: 8px; }
.inbox-item .grow > span { display: block; }
.inbox-item:not(.unread) .strong { font-weight: 550; color: var(--ink-2); }
.inbox-item:hover { background: var(--surface-2); }

.push-slot:empty { display: none; }
.d-main .push-slot:not(:empty) { margin-bottom: 16px; }
.push-sect { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.push-sect summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }

/* Tema seçici (ui.js → themePicker()) */
.theme-pick .seg { max-width: 420px; }

/* ---------- 16. Eski sınıflar (geçiş dönemi uyumluluğu) ----------
   Ekran dosyaları yeni işaretlemeye geçince bu bölüm silinebilir. */
.hero .wk { font-size: var(--fs-sm); font-weight: 700; opacity: .92; }
.hero .big { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hero .fruit { font-family: var(--font-emoji); font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .18)); }
.hero .meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: var(--fs-sm); }
.hero .meta b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.progress.dark { background: var(--surface-3); }
.progress.dark > i { background: var(--brand-solid); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: var(--fs-sm); color: var(--muted); font-weight: 650; }
.stat.red { background: var(--grad-kpi-acil); box-shadow: inset 0 3px 0 var(--acil), inset 0 0 0 1px var(--acil-line); }
.stat.red b { color: var(--acil-ink); }
.stat.amber b { color: var(--bugun-ink); }
.triage { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.triage:first-child { border-top: 0; }
.triage .lvl { width: 4px; align-self: stretch; border-radius: 2px; flex: none; background: var(--line-strong); }
.triage .lvl.red { background: var(--acil); }
.triage .lvl.amber { background: var(--bugun); }
.triage .lvl.info { background: var(--bilgi); }
.triage .who { font-weight: 750; color: var(--ink); }
.triage .acts { display: flex; gap: 6px; flex: none; }
@media (max-width: 600px) {
  .triage { flex-wrap: wrap; }
  .triage .grow { flex-basis: calc(100% - 16px); }
  .triage .acts { width: 100%; padding-left: 16px; }
  .card-title { flex-wrap: wrap; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Telefon ayarları ---------- */
@media (max-width: 600px) {
  .small { font-size: 15px; }
  .m { font-size: 15px; }
  .note, .hint, .sos .linkbtn { font-size: 15px; }
}
@media (max-width: 359px) {
  :root { --gutter: 16px; }
  .hero-num { font-size: 80px; }
  .urgent-acts { grid-template-columns: 1fr; }
  .lt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Hareket azaltma */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .skel { animation: none; }
  .urgent-ic::after { animation: none; display: none; }
}

/* Saydamlık azaltma: cam yerine opak yüzey */
@media (prefers-reduced-transparency: reduce) {
  .tabbar, .sheet, .topbar, body::before { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-solid); }
}

/* Windows Yüksek Karşıtlık / zorunlu renkler: kutu gölgesiyle çizilen sınırlar kaybolmasın */
@media (forced-colors: active) {
  .input, .btn.outline, .btn.line, .check, .switch, .tick, .card, .alert-card, .urgent, .sos, .push-prompt, .chip, .seg { border: 2px solid CanvasText; }
  input[type="checkbox"]:not(.switch), input[type="radio"] { appearance: auto; -webkit-appearance: auto; box-shadow: none; }
  .tick:not(.on):not([aria-pressed="true"]) svg { visibility: hidden; }
  .tick.on, .tick[aria-pressed="true"], .switch:checked { background: Highlight; color: HighlightText; forced-color-adjust: none; }
  .switch::after { background: CanvasText; forced-color-adjust: none; }
  .tabbar a.on, .d-nav a.on, .seg label.on, .seg button.on, .seg button[aria-pressed="true"], .filters button.on { outline: 2px solid Highlight; }
}
@media (forced-colors: active) {
  .seg label:has(input:checked) { outline: 2px solid Highlight; }
}

/* ---------- 17. Yazdırma ---------- */
.print-only { display: none; }
@media print {
  :root, [data-theme] { --bg: #fff; --bg-2: #fff; --surface: #fff; --ink: #000; --ink-2: #222; --muted: #555; --line: #ddd; }
  body, body.doctor { background: #fff; color: #000; }
  body::before, .p-app::before, .p-app::after, .d-main::before { display: none; }
  .d-side, .no-print, .tabs, .sheet-wrap, #toasts, .tabbar, .topbar { display: none !important; }
  .d-app { display: block; background: #fff; }
  .d-main { padding: 0; }
  .print-only { display: block; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .tab-panel { display: block !important; }
}

/* ---------------- Tanıtım rehberi (keçe kukla) — js/tour.js ---------------- */
.tour { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--safe-t) + 64px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 16px) calc(var(--safe-l) + 16px);
  animation: tour-in .25s var(--ease) both; }
.tour::before { content: ""; position: absolute; inset: 0; background: var(--scrim); }
.tour.has-spot::before { background: transparent; }
.tour.card-top { justify-content: flex-start; }
.tour.leaving { animation: tour-out .2s ease both; }
.tour-spot { position: fixed; border-radius: var(--r-md); pointer-events: none; display: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 0 0 9999px var(--scrim); transition: left .3s var(--ease), top .3s var(--ease), width .3s var(--ease), height .3s var(--ease); }
.tour.has-spot .tour-spot { display: block; animation: tour-ring 1.8s ease-in-out infinite; }
.tour-skip { position: fixed; top: calc(var(--safe-t) + 14px); right: calc(var(--safe-r) + 14px); z-index: 2;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: var(--r-pill); font: inherit; font-weight: 700; font-size: var(--fs-sm);
  background: var(--glass-strong); color: var(--ink); box-shadow: 0 6px 20px rgba(28, 10, 34, .18); cursor: pointer;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.tour-skip:hover { background: var(--surface); }
.tour-skip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tour-card { position: relative; width: min(560px, 100%); margin: 0 auto; display: flex; align-items: flex-end; gap: 4px; }
.tour-card.pop .tour-img { animation: tour-pop .5s var(--ease) both, tour-bob 3.2s ease-in-out .5s infinite; }
.tour-puppet { position: relative; flex: 0 0 auto; width: 112px; height: 150px; margin-right: -6px; display: grid; place-items: end center; }
.tour-img { position: relative; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transform-origin: 50% 100%;
  filter: drop-shadow(0 10px 14px rgba(28, 10, 34, .22)); animation: tour-bob 3.2s ease-in-out infinite; }
.tour.talking .tour-img { animation: tour-talk .32s ease-in-out infinite alternate; }
.tour.celebrate .tour-img { animation: tour-hop .9s var(--ease) infinite; }
.tour-shadow { position: absolute; bottom: -4px; left: 50%; width: 70%; height: 12px; margin-left: -35%; border-radius: 50%;
  background: rgba(28, 10, 34, .25); filter: blur(4px); animation: tour-shadow 3.2s ease-in-out infinite; }
.tour-bubble { position: relative; flex: 1 1 auto; min-width: 0; margin-bottom: 18px; padding: 18px 18px 14px; border-radius: var(--r-lg);
  background: var(--surface-raised); color: var(--ink); box-shadow: 0 18px 50px rgba(28, 10, 34, .28); }
.tour-bubble::before { content: ""; position: absolute; left: -9px; bottom: 34px; width: 20px; height: 20px; background: inherit; transform: rotate(45deg); border-radius: 4px; }
.tour-title { margin: 0 0 6px; font-size: 19px; line-height: 1.25; }
.tour-text { margin: 0; min-height: 4.4em; color: var(--ink-2, var(--muted)); font-size: var(--fs-body); line-height: 1.5; }
.tour-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.tour [hidden] { display: none !important; }
.tour-foot .btn { flex: 0 0 auto; }
.tour-dots { display: flex; flex: 1 0 100%; gap: 5px; margin: 0 0 4px; padding: 0; list-style: none; }
.tour-dots li { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); transition: width .25s var(--ease), background .25s; }
.tour-dots li.on { width: 20px; border-radius: 4px; background: var(--brand); }
html.tour-open { overflow: hidden; }
@keyframes tour-in { from { opacity: 0; } }
@keyframes tour-out { to { opacity: 0; } }
@keyframes tour-bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes tour-shadow { 0%, 100% { transform: scaleX(1); opacity: .9; } 50% { transform: scaleX(.8); opacity: .55; } }
@keyframes tour-talk { from { transform: translateY(0) scale(1, 1); } to { transform: translateY(-3px) scale(.97, 1.03); } }
@keyframes tour-pop { 0% { transform: translateY(30px) scale(.6); opacity: 0; } 60% { transform: translateY(-6px) scale(1.06); opacity: 1; } 100% { transform: none; } }
@keyframes tour-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(0) scale(1.08, .92); } 55% { transform: translateY(-18px) scale(.96, 1.04); } }
@keyframes tour-ring { 0%, 100% { box-shadow: 0 0 0 4px rgba(255, 255, 255, .9), 0 0 0 9999px var(--scrim); } 50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, .55), 0 0 0 9999px var(--scrim); } }
@media (min-width: 720px) {
  .tour-puppet { width: 190px; height: 220px; }
  .tour-bubble { padding: 22px 22px 16px; }
  .tour-title { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-img, .tour-shadow, .tour.has-spot .tour-spot { animation: none !important; }
}
@media (forced-colors: active) {
  .tour-bubble, .tour-skip { border: 2px solid CanvasText; }
  .tour-spot { outline: 3px solid Highlight; }
}

/* Giriş ekranı yasal bağlantılar, kayıt tıbbi uyarı, davet kodu düğmeleri */
.auth-legal { margin: 14px 0 0; text-align: center; font-size: var(--fs-xs); color: var(--muted); }
.auth-legal a { color: inherit; }
.med-note { display: flex; gap: 8px; align-items: flex-start; }
.med-note svg.i { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; color: var(--bugun, #f79009); }
.st-invite .row-acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* Hesap silme bağlantısı (Profil > Gizlilik) */
.danger-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--acil-ink); font-weight: 600; }
.danger-link svg.i { width: 17px; height: 17px; }
