

:root {
  color-scheme: light;

  --bg: #eef2f7;
  --bg-elevated: #ffffff;
  --bg-sunken: #e7ecf3;
  --border: #dfe6ef;
  --border-strong: #c8d2df;

  --text: #2f3b4c;
  --text-muted: #606d84;
  --text-faint: #7d899c;

  --brand: #36718f;
  --brand-hover: #2c5d77;
  --brand-soft: #e7f0f5;
  --brand-contrast: #ffffff;

  --danger: #b25151;
  --danger-soft: #f9ecec;
  --success: #3a7c60;
  --success-soft: #e8f2ed;
  --warning: #9a6f2f;
  --warning-soft: #f9f1e2;

  --cat-low: #3f8ba6;
  --cat-optimal: #3a7c60;
  --cat-normal: #6b8f3d;
  --cat-highnormal: #9a7b2f;
  --cat-stage1: #b4703f;
  --cat-stage2: #b25151;
  --cat-crisis: #8c3a44;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: 0 16px 40px rgb(47 59 76 / 0.16);

  --header-h: 54px;
  --tabbar-h: 60px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);

  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 .875rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  white-space: nowrap;
  min-width: 0;
}
.app-brand:hover { text-decoration: none; }
.app-brand svg { width: 24px; height: 24px; flex: none; }

.app-brand-ad { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.header-spacer { flex: 1; }

.patient-switch {
  display: flex;
  align-items: center;
  gap: .4rem;
  min-width: 0;
  max-width: 42vw;
}
.patient-switch select {
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  padding: .32rem 1.75rem .32rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background-color: var(--bg-sunken);

  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23606d84' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 10px 7px;
  color: var(--text);
  max-width: 100%;
  appearance: none;
  cursor: pointer;
  text-overflow: ellipsis;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { background: var(--bg-sunken); color: var(--text); text-decoration: none; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.active {
  background: var(--brand-soft);
  border-color: transparent;
  color: var(--brand);
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem .875rem 2rem;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.page-head .subtitle { color: var(--text-muted); font-size: .875rem; margin: 0; }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: .875rem;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .875rem;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { color: var(--text-muted); font-size: .8125rem; margin: -.4rem 0 .875rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;

  min-height: 38px;
  padding: .4rem .95rem;
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s;
  text-align: center;
}
.btn:hover { background: var(--bg-sunken); text-decoration: none; }

.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-contrast);
}
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

.btn-danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-sunken); color: var(--text); }

.btn.mesgul {
  opacity: .65;
  cursor: progress;
  pointer-events: none;
}
.btn.mesgul::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: none;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: dugme-donus .6s linear infinite;
}
@keyframes dugme-donus { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .btn.mesgul::before { animation: none; opacity: .5; }
}

.btn-sm { min-height: 30px; padding: .2rem .65rem; font-size: .78rem; }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

.field { margin-bottom: .875rem; }
.field label, .form-label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .3rem;
}

.input, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%;
  min-height: 42px;
  padding: .45rem .7rem;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
textarea { min-height: 80px; resize: vertical; line-height: 1.5; }

input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }

.hint { font-size: .78rem; color: var(--text-faint); margin-top: .25rem; }

.ozel-aralik summary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem 0;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  list-style: none;
}
.ozel-aralik summary::-webkit-details-marker { display: none; }
.ozel-aralik summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s;
}
.ozel-aralik[open] summary::before { transform: rotate(45deg); }
.ozel-aralik[open] > form { margin-top: .6rem; }

.validation-summary, .field-error {
  color: var(--danger);
  font-size: .8125rem;
}
.validation-summary {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  margin-bottom: 1rem;
}
.validation-summary ul { margin: 0; padding-left: 1.1rem; }
.validation-summary:empty { display: none; }
.field-error { display: block; margin-top: .25rem; }

.bp-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }

.bp-box {
  background: var(--bg-sunken);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: .5rem .4rem .45rem;
  text-align: center;
}
.bp-box.sys { border-color: color-mix(in srgb, var(--cat-stage2) 45%, var(--border-strong)); }
.bp-box.dia { border-color: color-mix(in srgb, var(--brand) 45%, var(--border-strong)); }
.bp-box.pulse { border-color: color-mix(in srgb, var(--cat-optimal) 45%, var(--border-strong)); }

.bp-box .bp-label {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.bp-box input {
  width: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-family: var(--font-num);
  font-size: 2rem;
  font-weight: 700;
  padding: .1rem 0;
  min-height: auto;
  color: var(--text);
  -moz-appearance: textfield;
}
.bp-box input::-webkit-outer-spin-button,
.bp-box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bp-box input:focus { outline: none; }
.bp-box .bp-unit { font-size: .68rem; color: var(--text-faint); }

.stepper { display: flex; gap: .3rem; margin-top: .4rem; }
.stepper button {
  flex: 1;
  min-height: 34px;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.stepper button:active { background: var(--brand-soft); }

.live-preview {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .875rem 0;
  padding: .6rem .8rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--cat-optimal);
  background: var(--bg-sunken);
}
.live-preview .lp-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--cat-optimal); flex: none;
}
.live-preview .lp-name { font-weight: 700; font-size: .9375rem; }
.live-preview .lp-desc { font-size: .78rem; color: var(--text-muted); }

.tag-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-picker input { position: absolute; opacity: 0; pointer-events: none; }
.tag-picker span {
  display: inline-block;
  padding: .32rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.tag-picker input:checked + span {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}
.tag-picker input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }

.segmented {
  display: flex;
  gap: 0;
  padding: 3px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: .45rem .4rem;
  text-align: center;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  border-radius: calc(var(--radius-sm) - 3px);
  background: transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.segmented input:checked + label {
  background: var(--bg-elevated);
  color: var(--brand);
  box-shadow: 0 1px 3px rgb(47 59 76 / .14);
}
.segmented input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: -2px; }

.segmented > a {
  flex: 1 1 0;
  min-width: 0;
  padding: .45rem .4rem;
  text-align: center;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: calc(var(--radius-sm) - 3px);
}
.segmented > a:hover { text-decoration: none; color: var(--text); }
.segmented > a.secili {
  background: var(--bg-elevated);
  color: var(--brand);
  box-shadow: 0 1px 3px rgb(47 59 76 / .14);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .625rem;
  margin-bottom: 1rem;
}
.stat {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem .85rem;
  overflow: hidden;
}

.stat[class*="cat-"]::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--cat);
}
.stat-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: .2rem;
}
.stat-value {
  font-family: var(--font-num);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
}
.stat-sub { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }

.stat-trend {
  margin-top: .3rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
}
.stat-trend.trend-iyi  { color: var(--success); }
.stat-trend.trend-kotu { color: var(--warning); }

.bulgular {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}
.bulgular li {
  padding: .55rem .7rem;
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);

  border-left: 3px solid var(--border);
  font-size: .8125rem;
  line-height: 1.45;
}
.bulgular li.bulgu-dikkat {
  background: var(--warning-soft);
  border-left-color: var(--warning);
}
.bulgu-baslik {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: .1rem;
}
.bulgu-dikkat .bulgu-baslik { color: var(--warning); }
.bulgu-metin { color: var(--text); }

.cat-low       { --cat: var(--cat-low); }
.cat-optimal   { --cat: var(--cat-optimal); }
.cat-normal    { --cat: var(--cat-normal); }
.cat-highnormal{ --cat: var(--cat-highnormal); }
.cat-stage1    { --cat: var(--cat-stage1); }
.cat-stage2    { --cat: var(--cat-stage2); }
.cat-crisis    { --cat: var(--cat-crisis); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .6rem;
  font-size: .72rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--cat, var(--brand)) 15%, transparent);
  color: var(--cat, var(--brand));
  border: 1px solid color-mix(in srgb, var(--cat, var(--brand)) 35%, transparent);
  white-space: nowrap;
}

.legend { display: flex; flex-wrap: wrap; gap: .35rem; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.matrix-kutu {
  max-height: calc(100dvh - var(--header-h) - var(--tabbar-h) - 6rem);
  overflow: auto;
  overscroll-behavior: contain;
}

.matrix {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 720px;
  font-size: .8125rem;
}
.matrix th, .matrix td {
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0;
  vertical-align: top;
}
.matrix tr > *:last-child { border-right: none; }
.matrix tbody tr:last-child > * { border-bottom: none; }
.matrix thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: .5rem .3rem;
  background: var(--bg-sunken);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
}
.matrix thead th small {
  display: block;
  font-weight: 600;
  font-size: .66rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-faint);
}
.matrix .col-date {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 92px;
  min-width: 92px;
  background: var(--bg-sunken);
  padding: .5rem .4rem;
  text-align: center;

  box-shadow: 4px 0 8px -6px rgb(47 59 76 / .35);
}
.matrix thead .col-date { z-index: 3; }
.matrix .col-date .d-day { font-weight: 700; font-size: .875rem; }
.matrix .col-date .d-dow { font-size: .68rem; color: var(--text-faint); }

.cell {
  display: block;
  padding: .4rem .35rem;
  min-height: 54px;
  text-align: center;
  color: var(--text);
  border-left: 3px solid transparent;
}
a.cell:hover { background: var(--bg-sunken); text-decoration: none; }
.cell.filled { border-left-color: var(--cat, var(--border)); }
.cell .c-bp {
  font-family: var(--font-num);
  font-size: .95rem;
  font-weight: 700;
  color: var(--cat, var(--text));
  letter-spacing: -.02em;
}
.cell .c-meta { font-size: .68rem; color: var(--text-muted); }
.cell .c-time { font-size: .66rem; color: var(--text-faint); }
.cell.empty { color: var(--text-faint); }
.cell.empty .plus { font-size: 1.1rem; opacity: .35; }
a.cell.empty:hover .plus { opacity: 1; color: var(--brand); }
.cell + .cell { border-top: 1px dashed var(--border); }

.day-group { margin-bottom: 1rem; }
.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .35rem .2rem;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: .4rem;
}
.day-head .day-avg { font-weight: 600; font-size: .75rem; color: var(--text-faint); }

.rec {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .5rem .6rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: .4rem;
  color: var(--text);
  transition: transform .08s;
}
a.rec:hover { text-decoration: none; background: var(--bg-sunken); }
a.rec:active { transform: scale(.99); }

.rec-bp {
  font-family: var(--font-num);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cat, var(--text));
  background: color-mix(in srgb, var(--cat, var(--border-strong)) 13%, transparent);
  border-radius: var(--radius-sm);
  padding: .3rem .55rem;
  min-width: 84px;
  text-align: center;
  letter-spacing: -.02em;
  flex: none;
}
.rec-body { flex: 1 1 0; min-width: 0; }

.rec-slot {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-meta {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: .75rem;
  line-height: 1.35;
  color: var(--text-muted);
}
.rec-pulse {
  flex: none;
  font-family: var(--font-num);
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}
.rec-pulse small { display: block; font-size: .62rem; font-family: var(--font); }

.chart-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-wrap svg { display: block; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .5rem;
}
.chart-legend i {
  display: inline-block;
  width: 14px; height: 3px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: .3rem;
}

.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  font-size: .66rem;
  font-weight: 600;
  color: var(--text-faint);
}
.tabbar a:hover { text-decoration: none; }
.tabbar a.active { color: var(--brand); }

.tabbar a svg {
  box-sizing: content-box;
  width: 21px;
  height: 21px;
  padding: .2rem .85rem;
  border-radius: var(--radius-pill);
  transition: background .18s;
}
.tabbar a.active svg { background: var(--brand-soft); }

.tabbar .tab-add span { display: none; }
.tabbar .tab-add {
  flex: 0 0 auto;
  width: 60px;
}
.tabbar .tab-add .fab-inner {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-contrast);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 32%, transparent);
  transition: transform .08s;
}
.tabbar .tab-add:active .fab-inner { transform: scale(.94); }
.tabbar .tab-add svg {
  box-sizing: border-box;
  width: 24px; height: 24px;
  padding: 0;
  background: none;
}

.flash {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
}
.flash.flash-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.flash.flash-warn { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }

.tuzak {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.davet-serit { justify-content: space-between; flex-wrap: wrap; }
.davet-serit .btn { border-color: currentColor; color: inherit; background: transparent; }

.kuyruk-dokum { flex-basis: 100%; font-weight: 500; }
.kuyruk-dokum > summary { cursor: pointer; padding: .35rem 0; font-size: .8125rem; }
.kuyruk-dokum ul { margin: .25rem 0 0; padding: 0; list-style: none; }

.kuyruk-dokum li {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .35rem 0;
  border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
}

.kuyruk-dokum em { font-style: normal; color: var(--danger); }
.kuyruk-dokum .btn { margin-left: auto; }

.ptr {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + .5rem);
  left: 50%;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: -1.125rem;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  color: var(--text-muted);
  opacity: 0;

  transform: translateY(-3.5rem);
  pointer-events: none;
}

.ptr-birak { transition: transform .25s ease, opacity .25s ease; }

.ptr svg {
  width: 18px;
  height: 18px;
  transition: transform .15s ease;
}

.ptr-hazir { color: var(--brand); }
.ptr-hazir svg { transform: rotate(180deg); }

.ptr-donuyor { color: var(--brand); }
.ptr-donuyor svg { display: none; }
.ptr-donuyor::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: dugme-donus .6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .ptr-donuyor::before { animation: none; opacity: .5; }
  .ptr svg, .ptr-birak { transition: none; }
}

.alert-note {
  padding: .75rem .85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  font-size: .8125rem;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}
.empty-state svg { width: 52px; height: 52px; color: var(--text-faint); margin-bottom: .5rem; }
.empty-state h3 { color: var(--text); }
.empty-state p { font-size: .875rem; max-width: 34ch; margin-inline: auto; }

.auth-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
}
.auth-card.genis { max-width: 560px; }
.auth-logo { text-align: center; margin-bottom: 1.25rem; }
.auth-logo svg { width: 48px; height: 48px; color: var(--brand); }
.auth-logo h1 { font-size: 1.2rem; margin: .4rem 0 .15rem; }
.auth-logo p { font-size: .8125rem; color: var(--text-muted); margin: 0; }
.auth-foot { text-align: center; font-size: .875rem; margin-top: 1rem; color: var(--text-muted); }

.davet-giris { font-size: .9375rem; color: var(--text-muted); }

.davet-ozet {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  padding: .25rem .75rem;
  margin-bottom: 1rem;
}
.davet-satir {
  display: flex;
  gap: .75rem;
  padding: .5rem 0;
  font-size: .8125rem;
}
.davet-satir + .davet-satir { border-top: 1px solid var(--border); }
.davet-etiket { flex: 0 0 38%; color: var(--text-muted); font-weight: 600; }
.davet-deger { flex: 1; font-weight: 600; }

.davet-baslik { font-size: .9375rem; margin-bottom: .4rem; }

.davet-liste {
  margin: 0 0 1rem;
  padding-left: 1.1rem;
  font-size: .8125rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.davet-liste li { margin-bottom: .2rem; }

body.tanitim { padding-bottom: 0; }

.tanitim-ust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: .875rem;
}

.tanitim-govde {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 .875rem 2rem;
}

.tanitim-kahraman { text-align: center; padding: 2rem 0 2.5rem; }
.tanitim-kahraman h1 { font-size: 1.75rem; letter-spacing: -.02em; }
.tanitim-alt {
  max-width: 46ch;
  margin: 0 auto .25rem;
  color: var(--text-muted);
  font-size: .9375rem;
}
.tanitim-eylem { justify-content: center; margin: 1.25rem 0 .5rem; }

.tanitim-kartlar {
  display: grid;
  grid-template-columns: 1fr;
  gap: .875rem;
}
.tanitim-kartlar .card { margin-bottom: 0; }
.tanitim-kartlar h2 { font-size: 1rem; margin-bottom: .3rem; }
.tanitim-kartlar p { font-size: .8125rem; color: var(--text-muted); margin: 0; }

.tanitim-ikon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: .6rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
}
.tanitim-ikon svg { width: 20px; height: 20px; }

.tanitim-notlar { margin-top: .875rem; }
.tanitim-notlar h2 { font-size: 1rem; }
.tanitim-notlar .davet-liste { margin-bottom: 0; }

.tanitim-kapanis { text-align: center; padding: 2rem 0 1rem; }
.tanitim-kapanis h2 { font-size: 1.25rem; }

.tanitim-alt-bilgi {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem .875rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .75rem;
  color: var(--text-faint);
}

.gizlilik-modal {
  width: min(640px, 92vw);
  height: min(80vh, 720px);
  padding: 0;
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  display: none;
}
.gizlilik-modal[open] { display: flex; }
.gizlilik-modal::backdrop { background: rgb(20 26 36 / .45); }
.gizlilik-modal-ust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--border);
}
.gizlilik-modal-kapat {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-faint);
  padding: .25rem .5rem;
}
.gizlilik-modal iframe { flex: 1 1 auto; width: 100%; border: none; }

@media (min-width: 720px) {
  .tanitim-kartlar { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 860px) {
  .tanitim-ust { padding: 1rem 1.25rem; }
  .tanitim-govde { padding: 0 1.25rem 3rem; }
  .tanitim-kahraman { padding: 3.5rem 0 3rem; }
  .tanitim-kahraman h1 { font-size: 2.25rem; }
  .tanitim-alt { font-size: 1rem; }
}

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: .8125rem; }
.tiny { font-size: .72rem; }
.num { font-family: var(--font-num); letter-spacing: -.02em; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.flex { display: flex; align-items: center; gap: .5rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.wrap { flex-wrap: wrap; }
.only-desktop { display: none; }

@media (min-width: 860px) {
  body { padding-bottom: 0; }

  .tabbar { display: none; }
  .only-desktop { display: inline-flex; }
  .only-mobile { display: none !important; }

  .app-header { height: 56px; padding: 0 1.25rem; gap: 1rem; }
  .app-brand { font-size: 1.05rem; }
  .app-brand svg { width: 26px; height: 26px; }

  .desktop-nav { display: flex; gap: .15rem; }
  .desktop-nav a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .75rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
  }
  .desktop-nav a:hover { background: var(--bg-sunken); color: var(--text); text-decoration: none; }
  .desktop-nav a.active { background: var(--brand-soft); color: var(--brand); }
  .desktop-nav a svg { width: 17px; height: 17px; }

  .patient-switch { max-width: 260px; }

  .container { padding: 1.25rem 1.25rem 3rem; }

  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: .75rem; }
  .stat { padding: .8rem .9rem; }

  .bulgular { grid-template-columns: 1fr 1fr; }

  h1 { font-size: 1.5rem; }
  .card { padding: 1.1rem; }

  .matrix-kutu { max-height: calc(100dvh - var(--header-h) - 9rem); }
  .matrix { font-size: .875rem; }
  .matrix .col-date { width: 108px; min-width: 108px; }
  .cell { min-height: 58px; }
}

@media (max-width: 400px) {
  .grid-3 { grid-template-columns: 1fr; }
  .bp-box input { font-size: 1.7rem; }

  .app-brand-ad { display: none; }
  .patient-switch { max-width: 62vw; }
}

.swal2-container { z-index: 60; padding: .75rem; }
.swal2-container.swal2-backdrop-show { background: rgb(47 59 76 / 0.34); }

.ta-uyari {
  width: min(30rem, calc(100vw - 1.5rem));
  padding: 1.25rem;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-family: var(--font);
}
.ta-uyari-baslik {
  padding: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.ta-uyari-metin {
  margin: .5rem 0 0;
  padding: 0;
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--text-muted);
}
.ta-uyari-eylemler { margin: 1.25rem 0 0; gap: .5rem; }
.ta-uyari-eylemler .btn { flex: 1 1 auto; }

.ta-uyari-giris {
  width: 100%;
  min-height: 46px;
  margin: .875rem 0 0;
  padding: .6rem .75rem;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: none;
}
.ta-uyari-dogrulama {
  margin: .625rem 0 0;
  padding: .5rem .7rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
}
.ta-uyari-dogrulama::before { display: none; }

.ta-uyari .swal2-icon { font-size: .7em; margin: 0 auto 1rem; }
.ta-uyari .swal2-icon.swal2-warning { border-color: var(--warning); color: var(--warning); }
.ta-uyari .swal2-icon.swal2-error { border-color: var(--danger); color: var(--danger); }
.ta-uyari .swal2-icon.swal2-error [class^="swal2-x-mark-line"] { background-color: var(--danger); }
.ta-uyari .swal2-icon.swal2-question { border-color: var(--brand); color: var(--brand); }
.ta-uyari .swal2-icon.swal2-success { border-color: var(--success); color: var(--success); }
.ta-uyari .swal2-icon.swal2-success [class^="swal2-success-line"] { background-color: var(--success); }
.ta-uyari .swal2-icon.swal2-success .swal2-success-ring { border-color: color-mix(in srgb, var(--success) 35%, transparent); }

body.swal2-toast-shown .swal2-container.swal2-top { width: min(30rem, calc(100vw - 1.5rem)); }

.ta-serit.swal2-toast {
  width: 100%;
  max-width: 100%;
  padding: .7rem .85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-family: var(--font);
}
.ta-serit .swal2-timer-progress-bar { background: var(--brand); }
.ta-serit-metin {
  margin: 0;
  padding: 0;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  color: var(--text);
}
.ta-serit.swal2-toast .swal2-icon { margin: 0 .6rem 0 0; }
.ta-serit .swal2-icon.swal2-success { border-color: var(--success); color: var(--success); }
.ta-serit .swal2-icon.swal2-success [class^="swal2-success-line"] { background-color: var(--success); }
.ta-serit .swal2-icon.swal2-warning { border-color: var(--warning); color: var(--warning); }
.ta-serit .swal2-icon.swal2-error { border-color: var(--danger); color: var(--danger); }
.ta-serit .swal2-icon.swal2-error [class^="swal2-x-mark-line"] { background-color: var(--danger); }

@keyframes ta-uyari-acilis {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: none; }
}
@keyframes ta-uyari-kapanis {
  to { opacity: 0; transform: scale(.97); }
}
.ta-uyari-acilis { animation: ta-uyari-acilis .18s ease-out; }
.ta-uyari-kapanis { animation: ta-uyari-kapanis .12s ease-in; }

@media (max-width: 560px) {
  .ta-uyari-eylemler { flex-direction: column-reverse; }
  .ta-uyari-eylemler .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ta-uyari-acilis, .ta-uyari-kapanis { animation: none; }
}

@media print {
  .app-header, .tabbar, .btn, .no-print, .swal2-container { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
  .table-scroll { overflow: visible; border: none; }
  .matrix { min-width: 0; font-size: 9pt; }
  .matrix .col-date { position: static; }
  @page { size: A4 landscape; margin: 10mm; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
