/* Terapi Asistanım — marka kimliği 1.0 (Asistan petrolü, not sarısı, Plus Jakarta Sans) */
:root {
  color-scheme: light;
  --paper: #F4FAFA; --surface: #FFFFFF; --surface-2: #EEF7F7;
  --ink: #0F2227; --ink-2: #33474C; --muted: #5F767B;
  --line: #DAE9EA; --line-soft: #E8F2F3;
  --brand: #0E7C86; --brand-ink: #0A5F68; --brand-deep: #061F24; --brand-light: #45C4C9;
  --soft: #E0F3F3; --amber: #FFC857; --amber-ink: #8A5B00; --amber-bg: #FFF4DA;
  --red: #B42318; --red-bg: #FDECEA; --ok: #0F6B4A; --ok-bg: #E3F5EA;
  --side: #061F24; --side-ink: #C8DEE0; --side-muted: #86A7AB;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --shadow: 0 10px 30px -14px rgba(6, 50, 56, .24), 0 2px 6px rgba(6, 50, 56, .05);
  --r: 16px;
}
/* Varsayılan açık tema. Koyu tema yalnızca seçilirse (data-theme="dark") ya da
   "Cihaza göre" seçilip cihaz koyu moddaysa (data-theme="system") uygulanır. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #061519; --surface: #0C2126; --surface-2: #122B31;
  --ink: #E8F4F5; --ink-2: #C2D8DB; --muted: #8DABB0;
  --line: #1C3A40; --line-soft: #16303A;
  --brand: #45C4C9; --brand-ink: #74D6DA; --soft: #14323A;
  --amber-ink: #FFD98A; --amber-bg: #3A2F14; --red: #F08579; --red-bg: #3A1C18; --ok: #6FD9A8; --ok-bg: #143427;
  --side: #030E10; --shadow: 0 14px 34px -16px rgba(0, 0, 0, .7);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --paper: #061519; --surface: #0C2126; --surface-2: #122B31;
    --ink: #E8F4F5; --ink-2: #C2D8DB; --muted: #8DABB0;
    --line: #1C3A40; --line-soft: #16303A;
    --brand: #45C4C9; --brand-ink: #74D6DA; --soft: #14323A;
    --amber-ink: #FFD98A; --amber-bg: #3A2F14; --red: #F08579; --red-bg: #3A1C18; --ok: #6FD9A8; --ok-bg: #143427;
    --side: #030E10; --shadow: 0 14px 34px -16px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
/* iPhone'da sayfa kenarlarından esneyip alt menünün altında boşluk göstermesin */
html, body { overscroll-behavior-y: none; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.025em; line-height: 1.2; text-wrap: balance; }
p { margin: 0; }
a { color: var(--brand); }
svg.i { width: 18px; height: 18px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

/* ---------- iskelet ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { background: var(--side); color: var(--side-ink); padding: 22px 14px; display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100vh; height: 100dvh; }
.side .brandline { display: block; padding: 2px 8px 22px; }
.side .brandline img { width: 158px; height: auto; display: block; }
.side nav { display: grid; gap: 3px; }
.side a.nav { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px; color: inherit; text-decoration: none; font-weight: 500; }
.side a.nav:hover { background: rgba(255, 255, 255, .05); color: #FFFFFF; }
.side a.nav.on { background: rgba(69, 196, 201, .14); color: #FFFFFF; }
.side a.nav.on svg { color: var(--brand-light); }
.side .foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 12.5px; color: var(--side-muted); display: grid; gap: 2px; }
.side .foot b { color: #E6F1F2; font-weight: 600; font-size: 13.5px; }
.side .foot form { margin-top: 8px; }
.side .foot button { background: none; border: 0; color: var(--side-muted); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.main { min-width: 0; padding: 28px 32px 64px; display: grid; gap: 20px; align-content: start; max-width: 1180px; width: 100%; }
.topbar, .tabbar { display: none; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.head small { color: var(--muted); font-size: 13.5px; display: block; margin-bottom: 2px; }
.head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13.5px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.crumb:hover { color: var(--brand); }

/* ---------- düğmeler, rozetler ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 10px 18px; font: 700 14px/1.2 var(--sans); background: var(--brand); color: #FFFFFF; border: 1px solid transparent; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--brand-ink); }
.btn svg { width: 16px; height: 16px; }
.btn.ghost { background: var(--surface); color: var(--brand-ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: var(--red); }
.btn.link { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 600; }
:root[data-theme="dark"] .btn:not(.ghost):not(.link) { color: #031417; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .btn:not(.ghost):not(.link) { color: #031417; } }

/* Logo: açık zeminde renkli, koyu temada koyu zemin sürümü */
.logo-dark { display: none !important; }
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .logo-light { display: none !important; }
  :root[data-theme="system"] .logo-dark { display: block !important; }
}

/* Tema düğmesi (yan menü ve üst çubuk) */
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.theme-toggle svg { width: 16px; height: 16px; }
.topbar .theme-toggle { width: 34px; height: 34px; border-radius: 10px; background: rgba(69, 196, 201, .16); color: #FFFFFF; justify-content: center; }
.topbar .theme-toggle svg { width: 18px; height: 18px; }
.topbar .right { display: flex; gap: 8px; align-items: center; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 4px 11px 4px 9px; white-space: nowrap; border: 0; font-family: inherit; }
.chip svg { width: 14px; height: 14px; }
.c-plan { background: var(--soft); color: var(--brand-ink); }
.c-done { background: var(--ok-bg); color: var(--ok); }
.c-wait { background: var(--amber-bg); color: var(--amber-ink); }
.c-cancel { background: var(--red-bg); color: var(--red); }
.c-muted { background: var(--surface-2); color: var(--muted); }

/* ---------- paneller ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; position: relative; min-width: 0; container-type: inline-size; }
.panel > h2, .panel-h { margin: 0 0 10px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-h a, .panel > h2 a { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; text-decoration: none; }
.panel.flush { padding: 0; overflow: hidden; }
.fold { position: absolute; right: -1px; bottom: -1px; width: 34px; height: 34px; color: var(--paper); pointer-events: none; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: grid; gap: 16px; align-content: start; }
.empty { color: var(--muted); padding: 10px 0; }
.empty b { color: var(--ink); display: block; margin-bottom: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* seans satırı */
.sess { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.sess:first-of-type { border-top: 0; }
.sess .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.sess .who { min-width: 0; text-decoration: none; color: inherit; }
.sess .who b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess .who span { color: var(--muted); font-size: 13px; }
.sess a.who:hover b { color: var(--brand); }
.sess.now { background: var(--surface-2); margin: 0 -12px; padding-inline: 12px; border-radius: 12px; border-top-color: transparent; }
.sess.now + .sess { border-top-color: transparent; }
.sess .side-act { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.sess.is-cancelled .who b, .sess.is-cancelled .t { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

/* Dar panelde durum düğmeleri adın altına iner */
@container (max-width: 600px) {
  .sess { grid-template-columns: 50px minmax(0, 1fr); row-gap: 8px; }
  .sess .side-act { grid-column: 2; justify-content: flex-start; }
}

/* hızlı durum düğmeleri */
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick form { display: contents; }
.quick button { cursor: pointer; }
.quick button:hover { filter: brightness(.96); }

.remind { display: grid; gap: 4px; padding: 8px 30px 8px 0; border-top: 1px solid var(--line-soft); }
.remind:first-of-type { border-top: 0; }
.remind b { font-size: 14px; }
.remind span { color: var(--muted); font-size: 13px; }
.remind form { display: inline; }
.remind .row { display: flex; align-items: flex-start; gap: 10px; }
.tick { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); background: var(--surface); flex: none; cursor: pointer; margin-top: 1px; padding: 0; }
.tick:hover { border-color: var(--brand); background: var(--soft); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 10px; }
.kpi { background: var(--paper); border-radius: 12px; padding: 11px 13px; }
.kpi b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: block; line-height: 1.2; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi.warn b { color: var(--amber-ink); }

.route { width: 100%; height: auto; display: block; margin: 4px 0 2px; }
.rt-line { fill: none; stroke: var(--brand-light); stroke-width: 3; stroke-dasharray: .1 8; stroke-linecap: round; }
.rt-done { fill: var(--brand); }
.rt-plan { fill: var(--surface); stroke: var(--brand); stroke-width: 2.5; }

/* gelişim grafiği */
.chart { width: 100%; max-width: 640px; height: auto; display: block; }
.ch-grid { stroke: var(--line-soft); stroke-width: 1; }
.ch-ax { fill: var(--muted); font: 600 12px var(--sans); }
.ch-val { fill: var(--ink-2); font: 700 12.5px var(--sans); }
.ch-line { fill: none; stroke: var(--brand-light); stroke-width: 3; stroke-dasharray: .1 8; stroke-linecap: round; }
.ch-dot { fill: var(--brand); }
.ch-last { fill: var(--surface); stroke: var(--brand); stroke-width: 3; }
.ch-note { fill: var(--amber); }

/* ---------- formlar ---------- */
form.card { display: grid; gap: 16px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.fields .full { grid-column: 1 / -1; }
@container (max-width: 440px) { .fields { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field small, .hint { font-size: 12.5px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], input[type=tel], select, textarea {
  width: 100%; font: 400 15px/1.4 var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; min-height: 44px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand); flex: none; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + .chip { box-shadow: 0 0 0 2px var(--brand) inset; }
.seg input:focus-visible + .chip { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.goalpick { display: grid; gap: 8px; }
.goalpick .check { padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.goalpick .check:has(input:checked) { border-color: var(--brand); background: var(--surface-2); }

/* yazarak / kalemle */
.note-mode { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg-tabs { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg-tabs button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: 700 13px var(--sans); padding: 7px 14px; border-radius: 999px; cursor: pointer; min-height: 36px; }
.seg-tabs button svg { width: 16px; height: 16px; }
.seg-tabs button[aria-selected="true"] { background: var(--surface); color: var(--brand-ink); box-shadow: 0 1px 3px rgba(6, 50, 56, .14); }

/* el yazısı alanı */
.ink { display: grid; gap: 10px; }
.ink-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; position: sticky; top: 8px; z-index: 5; background: var(--surface); padding: 6px; margin: -6px; border-radius: 14px; }
@media (max-width: 820px) { .ink-tools { top: calc(66px + env(safe-area-inset-top)); } }
.ink-group { display: flex; gap: 6px; align-items: center; }
.ink-swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); background: var(--sw); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.ink-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--brand); }
.ink-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; padding: 0; }
.ink-btn svg { width: 20px; height: 20px; }
.ink-btn[aria-pressed="true"] { background: var(--soft); border-color: var(--brand); color: var(--brand-ink); }
.ink-btn:disabled { opacity: .4; cursor: default; }
.ink-size span { width: var(--dot); height: var(--dot); border-radius: 50%; background: currentColor; }
.ink-sheet { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; --rule: 44px;
  background: #FFFEFA repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--rule) - 1px), #E3EEF0 calc(var(--rule) - 1px), #E3EEF0 var(--rule)); }
.ink-sheet canvas { display: block; width: 100%; touch-action: pan-y pinch-zoom; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: crosshair; }
.ink-empty { position: absolute; left: 0; right: 0; top: 38%; text-align: center; color: #8DA3A7; font-size: 14px; padding: 0 20px; pointer-events: none; }
.ink-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ink-status { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.ink-status.err { background: var(--red-bg); color: var(--red); }
.ink-status.ok { background: var(--ok-bg); color: var(--ok); }
.btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.ink-view { display: block; width: 100%; height: auto; max-width: 760px; background: #FFFEFA; border: 1px solid var(--line-soft); border-radius: 12px; }

/* bilgi mesajları */
.flash, .alert { border-radius: 14px; padding: 12px 16px; font-size: 14px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.warn, .alert.warn { background: var(--amber-bg); color: var(--amber-ink); }
.alert.err { background: var(--red-bg); color: var(--red); }
.note-y { border-radius: 16px; padding: 16px 18px 16px 52px; background: #FFF8E6; border: 1px solid #F6DFA6; color: #3E3212; font-size: 14.5px; position: relative; }
.note-y svg { position: absolute; left: 18px; top: 17px; width: 20px; height: 20px; }
.note-y b { color: #0F2227; }

/* listeler */
.rows { display: grid; }
.rowlink { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.rowlink:first-child { border-top: 0; }
.rowlink:hover { background: var(--surface-2); }
.rowlink b { display: block; }
.rowlink .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowlink .end { text-align: right; font-size: 13px; color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: -.02em; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar form { display: flex; gap: 8px; flex: 1 1 260px; }
.tabs-mini { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs-mini a { text-decoration: none; }

/* danışan dosyası */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; }
.facts div span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.facts div b { font-weight: 600; }
.goal { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.goal:first-of-type { border-top: 0; }
.goal .txt { flex: 1; }
.goal.done .txt { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.goal form { display: inline; }
.tick.on { background: var(--brand); border-color: var(--brand); color: #FFFFFF; display: grid; place-items: center; }
.tick.on svg { width: 14px; height: 14px; }
.inline-add { display: flex; gap: 8px; margin-top: 10px; }
.inline-add input { flex: 1; }
.tabnav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabnav a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabnav a.on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tabpane { display: none; }
.tabpane.on { display: grid; gap: 16px; }
.hist { padding: 14px 0; border-top: 1px solid var(--line-soft); display: grid; gap: 6px; }
.hist:first-of-type { border-top: 0; padding-top: 4px; }
.hist .top { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.hist .top a { font-weight: 700; text-decoration: none; color: var(--ink); }
.hist .top a:hover { color: var(--brand); }
.hist p { white-space: pre-line; color: var(--ink-2); font-size: 14px; }
.hist .lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }
.agroup { display: grid; gap: 8px; }
.agroup + .agroup { border-top: 1px solid var(--line-soft); padding-top: 16px; }
.agroup .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.agroup h3 { font-size: 16px; }
.delta { font-size: 13px; font-weight: 700; color: var(--brand-ink); }
.alist { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.alist form { display: inline; }
.alist button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; font: inherit; }
.alist button:hover { color: var(--red); }
.ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 14px; align-items: center; }
.ledger-row:first-of-type { border-top: 0; }
.ledger-row .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.ledger-row .amt.pay { color: var(--ok); }
.ledger-row small { color: var(--muted); display: block; }
.ledger-row form { display: inline; }
.balance { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.balance.due { color: var(--amber-ink); }

/* takvim */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 150px; display: grid; gap: 6px; align-content: start; }
.day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.day .dh { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.day .dh b { font-size: 18px; color: var(--ink); }
.day .add { opacity: 0; text-decoration: none; font-size: 18px; line-height: 1; color: var(--brand); }
.day:hover .add, .day .add:focus { opacity: 1; }
.ev { display: block; text-decoration: none; color: var(--ink); border-radius: 10px; padding: 7px 8px; background: var(--soft); font-size: 12.5px; line-height: 1.35; border-left: 3px solid var(--brand); }
.ev b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev span { color: var(--muted); }
.ev.done { background: var(--ok-bg); border-left-color: var(--ok); }
.ev.noshow { background: var(--amber-bg); border-left-color: var(--amber); }
.ev.cancelled { background: var(--surface-2); border-left-color: var(--line); color: var(--muted); }
.ev.cancelled b { text-decoration: line-through; }
.weeknav { display: flex; gap: 8px; align-items: center; }

/* giriş ekranı */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; background:
  radial-gradient(1200px 500px at 10% -10%, var(--soft), transparent 60%), var(--paper); }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 22px; }
.auth-card .logo { width: 210px; height: auto; display: block; margin: 0 auto; }
.auth-card .panel { padding: 26px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.auth-card h1 { font-size: 22px; }
.auth-card .slogan { text-align: center; color: var(--muted); font-size: 14px; margin-top: -10px; }
.auth-card .alt { text-align: center; font-size: 14px; color: var(--muted); }

/* ---------- telefon ve tablet ---------- */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
  .day .dh { flex-direction: column; align-items: flex-start; gap: 0; }
  .day .evs { display: grid; gap: 6px; }
  .day .add { opacity: 1; }
}
@media (max-width: 820px) {
  /* Kısa sayfalarda artan yükseklik üst çubuğu şişirmesin: üst çubuk kendi boyunda, kalan alan içeriğin */
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); background: var(--side); position: sticky; top: 0; z-index: 20; }
  .topbar img { width: 138px; height: auto; display: block; }
  .topbar a.me { width: 34px; height: 34px; border-radius: 10px; background: rgba(69, 196, 201, .16); color: #FFFFFF; display: grid; place-items: center; text-decoration: none; font-weight: 800; font-size: 13px; }
  .main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); gap: 16px; }
  .head h1 { font-size: 22px; }
  .head { align-items: flex-start; }
  .head .actions { gap: 6px; }
  .head .actions .btn { padding: 9px 13px; font-size: 13px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 19px; white-space: nowrap; }
  .ink-tools { margin: 0; padding: 4px 0; gap: 8px 10px; }
  .ink-swatch { width: 32px; height: 32px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 0; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--brand); }
  .fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 25; width: 56px; height: 56px; border-radius: 18px; padding: 0; box-shadow: 0 10px 24px -8px rgba(6, 50, 56, .5); }
  .fab svg { width: 24px; height: 24px; }
  .fields { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .sess { grid-template-columns: 48px minmax(0, 1fr); }
  .sess .side-act { grid-column: 2; justify-content: flex-start; }
  .rowlink { padding: 12px 14px; }
}
@media (min-width: 821px) { .fab { display: none; } }

/* iPhone ana ekran uygulaması (durum çubuğu "black-translucent"): iOS görünür yüksekliği durum çubuğu kadar
   kısa hesaplar ve alttaki sabit menü yukarıda kalır. 1) Sayfa yüksekliğine durum çubuğu payı eklenir;
   2) iOS sürümü buna uymazsa diye alt menünün zemini aşağı doğru uzatılır, altta boşluk görünmez. */
@media (display-mode: standalone) {
  html { min-height: calc(100% + env(safe-area-inset-top)); }
  .tabbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 120px; background: var(--surface); }
}

/* Telefon: danışan listesinde sağ sütun adın altına iner */
@media (max-width: 600px) {
  .sess .side-act { grid-column: 1 / -1; }
  .sess .quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .rowlink { grid-template-columns: 40px minmax(0, 1fr); row-gap: 6px; }
  .rowlink .end { grid-column: 2; text-align: left; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
  .rowlink .end br { display: none; }
}

/* Parmakla kullanım: dokunma alanları en az ~36-44 px */
@media (max-width: 820px), (pointer: coarse) {
  .quick button.chip { min-height: 40px; padding: 6px 10px; font-size: 13.5px; justify-content: center; }
  .tick { width: 28px; height: 28px; border-radius: 8px; }
  .goal { align-items: center; }
  .goal .btn.link, .ledger-row .btn.link, .alist button { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; }
  .btn.sm { min-height: 38px; }
  .seg .chip { min-height: 36px; padding: 6px 13px; }
  .side-act .btn.ghost.sm { min-height: 36px; }
}

/* ---------- yazdırılabilir rapor ---------- */
.report { max-width: 820px; margin: 0 auto; padding: 32px 24px 60px; display: grid; gap: 22px; }
.report header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2px solid var(--brand); padding-bottom: 16px; }
.report header img { width: 170px; }
.report h1 { font-size: 24px; }
.report h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-ink); margin-bottom: 8px; }
.report section { break-inside: avoid; }
.report .who { text-align: right; font-size: 13px; color: var(--muted); }
.report .who b { color: var(--ink); font-size: 14px; display: block; }
.report .noprint { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); padding: 14px; border-radius: 14px; }
.report .noprint .field { flex: 1 1 140px; min-width: 0; }
@media (max-width: 600px) {
  .report { padding: 16px 16px 48px; gap: 18px; }
  .report header { flex-direction: column; gap: 12px; }
  .report .who { text-align: left; }
  .report .who img { margin-left: 0 !important; }
  .report .noprint .field { flex-basis: 100%; }
  .report .noprint .btn { flex: 1 1 auto; }
}
.report .sign { margin-top: 30px; display: flex; justify-content: flex-end; }
.report .sign div { border-top: 1px solid var(--ink-2); padding-top: 6px; min-width: 220px; text-align: center; font-size: 13px; }
.report .disclaimer { font-size: 12px; color: var(--muted); }
@media print {
  :root { color-scheme: light; --paper: #FFFFFF; --surface: #FFFFFF; }
  body { background: #FFFFFF; font-size: 11pt; }
  .noprint { display: none !important; }
  .report { padding: 0; max-width: none; }
  .panel { border-color: #D5E5E6; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 16mm 14mm; }
}
