:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --text: #171b24;
  --muted: #5d6573;
  --border: #e1e4ea;
  --brand: #1f3a5f;
  --brand-2: #2b4c78;
  --brand-text: #ffffff;
  --gold: #c9a45c;
  --accent: #1d5fd1;
  --accent-soft: #e8effc;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --warn: #9a5b00;
  --warn-soft: #fff3d6;
  --ok: #1b7a3d;
  --ok-soft: #e4f4ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(16 24 40 / 5%), 0 1px 3px rgb(16 24 40 / 7%);
  --nav-h: 62px;

  /* Tür rozetleri beyaz yazı taşır: her iki temada da yeterli kontrast için koyu tonlar */
  --t-ceza: #b42318; --t-bam: #6e3aa8; --t-icra: #b54708; --t-hukuk: #175cd3; --t-cbs: #0e7166;
  --t-yargitay: #3538cd; --t-idare: #2b6e30; --t-aym: #7a4d00; --t-diger: #5d6573;
  --d-a: #1b7a3d; --d-b: #5f8a1b; --d-c: #b38600; --d-d: #7b3fb5; --d-e: #3949ab; --d-i: #d9711c; --d-p: #6b7280; --d-k: #374151;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --surface: #171b23; --surface-2: #222733; --text: #e8eaef; --muted: #a0a7b4;
    --border: #2b313d; --brand: #14243d; --brand-2: #1c3254; --accent: #6b9cff; --accent-soft: #1d2a44;
    --danger: #ff7b7b; --danger-soft: #3a1d1f; --warn: #f5c56a; --warn-soft: #3a2f12; --ok: #5bd18b; --ok-soft: #173325;
    --shadow: none;
    --d-a: #5bd18b; --d-b: #a6d65a; --d-c: #e8c04a; --d-d: #b98cf0; --d-e: #8c9cff; --d-i: #f0a050; --d-p: #9ca3af; --d-k: #9ca3af;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116; --surface: #171b23; --surface-2: #222733; --text: #e8eaef; --muted: #a0a7b4;
  --border: #2b313d; --brand: #14243d; --brand-2: #1c3254; --accent: #6b9cff; --accent-soft: #1d2a44;
  --danger: #ff7b7b; --danger-soft: #3a1d1f; --warn: #f5c56a; --warn-soft: #3a2f12; --ok: #5bd18b; --ok-soft: #173325;
  --shadow: none;
  --d-a: #5bd18b; --d-b: #a6d65a; --d-c: #e8c04a; --d-d: #b98cf0; --d-e: #8c9cff; --d-i: #f0a050; --d-p: #9ca3af; --d-k: #9ca3af;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
/* iOS, 16px altındaki alanlara odaklanınca sayfayı yakınlaştırır */
input, select, textarea { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- üst çubuk ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: var(--brand-text);
  padding-top: env(safe-area-inset-top);
}
.topbar-row { display: flex; align-items: center; gap: 10px; max-width: 1100px; margin: 0 auto; padding: 8px 16px; }
.brand-block { flex: 1; min-width: 0; display: grid; }
.brand { font-size: 17px; margin: 0; letter-spacing: 0.01em; }
.sync { font-size: 11.5px; opacity: 0.85; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8fa3bf; }
.sync.ok::before { background: #5bd18b; }
.sync.err { opacity: 1; color: #ffd0d0; }
.sync.err::before { background: #ff7b7b; }
.tab-select {
  background: rgb(255 255 255 / 12%); color: var(--brand-text); border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 10px; padding: 6px 8px; font-size: 15px;
}
.tab-select option { color: #171b24; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: transparent; border: 0; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: rgb(255 255 255 / 12%); }
.icon-btn.spin svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner { background: var(--warn-soft); color: var(--warn); padding: 8px 16px; font-size: 14px; text-align: center; }

/* ---------- alt menü ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: center;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; max-width: 160px; height: var(--nav-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11.5px;
}
.nav-icon { position: relative; display: grid; place-items: center; width: 52px; height: 28px; border-radius: 14px; transition: background 0.15s; }
.nav-icon svg { width: 22px; height: 22px; }
.bottomnav .active { color: var(--accent); font-weight: 600; }
.bottomnav .active .nav-icon { background: var(--accent-soft); }
.nav-badge {
  position: absolute; top: -4px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 14px; text-align: center;
  border: 2px solid var(--surface);
}

.view { max-width: 1100px; margin: 0 auto; padding: 14px 16px 28px; }
.view.narrow { max-width: 720px; }
.empty { color: var(--muted); text-align: center; padding: 32px 8px; }

/* ---------- iskelet ---------- */
.skeleton { display: grid; gap: 12px; }
.sk { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; border-radius: 12px; animation: shimmer 1.2s infinite; }
.sk-title { height: 44px; width: 60%; }
.sk-search { height: 46px; }
.sk-card { height: 110px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- ana ekran ---------- */
.hello { margin: 2px 0 12px; }
.hello-greet { margin: 0; color: var(--muted); font-size: 14px; }
.hello h2 { margin: 2px 0 0; font-size: 21px; font-weight: 700; }
.hello h2 .muted { font-weight: 500; font-size: 16px; }

.brief {
  background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--accent-soft) 60%, var(--surface)));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.brief-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }
.brief p { margin: 6px 0 0; font-size: 15px; }
.brief-next {
  display: grid; gap: 1px; margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none;
}
.brief-next:hover { border-color: var(--accent); }
.brief-next-title { font-weight: 650; }
.brief-asks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.suggestion {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border-radius: 18px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--surface); color: var(--accent);
  font-size: 14px; text-align: left;
}
.suggestion:hover { background: var(--accent-soft); }

.search-wrap { position: relative; flex: 1; min-width: 0; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search {
  width: 100%; height: 46px; padding: 0 12px 0 38px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
#home-body { margin-top: 12px; }

.pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pill {
  display: grid; justify-items: start; gap: 0; padding: 8px 10px; border-radius: 12px; cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 0;
}
.pill-n { font-size: 22px; font-weight: 700; line-height: 1.15; }
.pill-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pill.late { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.pill.late .pill-n, .pill.late .pill-label { color: var(--danger); }
.pill.today { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.pill.today .pill-n, .pill.today .pill-label { color: var(--warn); }
.pill.zero .pill-n { color: var(--muted); }

.seg-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-btn { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--muted); }
.seg-btn.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- bölümler ---------- */
.section { margin: 16px 0 6px; }
.section > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 4px 0;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
}
.section { scroll-margin-top: 70px; }
.section > summary::-webkit-details-marker { display: none; }
.section > summary::after { content: "›"; margin-left: auto; font-size: 18px; transition: transform 0.15s; }
.section[open] > summary::after { transform: rotate(90deg); }
.count { background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.section.late .section-title, .section.late .count { color: var(--danger); }
.section.late .count { background: var(--danger-soft); }
.section.today .section-title, .section.today .count { color: var(--warn); }
.section.today .count { background: var(--warn-soft); }
.section-hint { margin: -4px 0 8px; font-size: 13px; color: var(--muted); }
.list-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 14px 0 8px; }

/* ---------- kartlar ---------- */
.cards { display: grid; gap: 8px; }
@media (min-width: 900px) {
  .view:not(.narrow) .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.card {
  position: relative; display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 11px 13px 11px 15px; color: inherit; text-decoration: none; box-shadow: var(--shadow); overflow: hidden;
}
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; }
.card.late::before { background: var(--danger); }
.card.today::before { background: var(--warn); }
.card.soon::before { background: color-mix(in srgb, var(--warn) 55%, transparent); }
.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.card:active { transform: scale(0.995); }
.card-head { display: flex; align-items: flex-start; gap: 8px; }
.card-title { flex: 1; min-width: 0; font-weight: 650; font-size: 15.5px; overflow-wrap: anywhere; }
.card-court { color: var(--text); font-size: 14px; margin-top: 1px; overflow-wrap: anywhere; }
.card-sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.card-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.card-task {
  margin-top: 7px; font-size: 14px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-task b { color: var(--text); font-weight: 600; }
.due {
  flex: none; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); color: var(--muted);
}
.due.late { background: var(--danger-soft); color: var(--danger); }
.due.today { background: var(--warn-soft); color: var(--warn); }
.due.soon { background: var(--warn-soft); color: var(--warn); font-weight: 500; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; color: #fff; background: var(--t-diger); white-space: nowrap;
}
.badge.outline { background: transparent; color: var(--muted); border: 1px solid var(--border); font-weight: 500; }
.badge.prio { background: var(--danger-soft); color: var(--danger); }
.badge[data-tur^="Ceza"] { background: var(--t-ceza); }
.badge[data-tur^="BAM"] { background: var(--t-bam); }
.badge[data-tur="İcra"] { background: var(--t-icra); }
.badge[data-tur="Hukuk"] { background: var(--t-hukuk); }
.badge[data-tur="CBS"] { background: var(--t-cbs); }
.badge[data-tur="Yargıtay"] { background: var(--t-yargitay); }
.badge[data-tur="İdare"] { background: var(--t-idare); }
.badge[data-tur="AYM"] { background: var(--t-aym); }
/* Durum: yazı nötr, renk yalnızca yanındaki noktada */
.status { background: var(--surface-2); color: var(--text); font-weight: 500; --dot: var(--d-p); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.status[data-d="A"] { --dot: var(--d-a); } .status[data-d="B"] { --dot: var(--d-b); }
.status[data-d="C"] { --dot: var(--d-c); } .status[data-d="D"] { --dot: var(--d-d); }
.status[data-d="E"] { --dot: var(--d-e); } .status[data-d="İ"] { --dot: var(--d-i); }
.status[data-d="P"] { --dot: var(--d-p); } .status[data-d="K"] { --dot: var(--d-k); }

.fab {
  position: fixed; right: max(16px, calc(50vw - 534px)); z-index: 9;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
  background: var(--accent); color: #fff; text-decoration: none; box-shadow: 0 6px 18px rgb(29 95 209 / 35%);
}

/* ---------- butonlar, filtreler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); white-space: nowrap;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:disabled { opacity: 0.45; cursor: default; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.danger { color: var(--danger); }
.btn.more { margin: 10px auto 0; display: flex; }

.search-row { display: flex; gap: 8px; position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 5; background: var(--bg); padding: 2px 0 10px; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.filter-group + .filter-group { margin-top: 12px; }
.filter-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; }
.filter-actions { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 18px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 14px; user-select: none;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked), .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip:has(input:disabled) { cursor: default; }
.pinned { margin-bottom: 8px; }
.result-info { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; margin: 4px 2px 8px; }
.result-info select { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 4px 6px; font-size: 14px; }

/* ---------- kayıt ---------- */
.record-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.record-head h2 { font-size: 19px; margin: 0; flex: 1; }
.back { text-decoration: none; font-size: 15px; padding: 6px 0; }
.readonly-note { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; font-size: 14px; color: var(--muted); margin: 0 0 12px; }

.record-card {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 14px 18px; box-shadow: var(--shadow); overflow: hidden;
}
.record-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--brand); }
.record-card.late::before { background: var(--danger); }
.record-card.today::before, .record-card.soon::before { background: var(--warn); }
.rc-title { margin: 0; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.rc-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.rc-court { margin: 4px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.rc-due { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rc-label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.rc-due .rc-label { display: inline; }
.rc-block { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.rc-block p { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.ask-row {
  width: 100%; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 11px 14px; cursor: pointer; text-align: left;
  border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); color: var(--accent); font-size: 14px;
}
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.action {
  min-height: 44px; padding: 8px 10px; border-radius: 12px; cursor: pointer; font-weight: 600; font-size: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.action:hover { border-color: var(--accent); }
.action.danger { color: var(--danger); }
.action:disabled { opacity: 0.5; }
.note-form { display: flex; gap: 8px; margin-top: 10px; }
.note-form input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }

.form-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 22px 0 8px; }
details.group { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 0 0 10px; padding: 0 14px; }
details.group > summary {
  list-style: none; cursor: pointer; padding: 13px 0; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 18px; transition: transform 0.15s; }
details.group[open] > summary::after { transform: rotate(90deg); }
details.group.has-changes > summary::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
details.group[open] { padding-bottom: 14px; }
.field { display: block; margin-top: 12px; }
details.group > .field:first-of-type { margin-top: 0; }
.field > .field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input:not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.field.changed > .field-label { color: var(--accent); font-weight: 600; }
.field.changed > .field-label::after { content: " • değişti"; }
.field.conflict { background: var(--warn-soft); border-radius: 10px; padding: 8px; margin-left: -8px; margin-right: -8px; }
.conflict-hint { font-size: 13px; color: var(--warn); margin-top: 6px; overflow-wrap: anywhere; }
.quick-set { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.quick-set .chip { min-height: 32px; font-size: 13px; padding: 0 10px; }
.inline { display: flex; gap: 8px; }
.inline > input { flex: 1; min-width: 0; }

.save-bar {
  position: fixed; left: 0; right: 0; z-index: 9;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  display: flex; gap: 8px; align-items: center; justify-content: flex-end;
  padding: 10px max(16px, calc(50vw - 344px)); background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -6px 16px rgb(0 0 0 / 8%);
  transform: translateY(120%); transition: transform 0.18s ease; visibility: hidden;
}
.save-bar.show { transform: none; visibility: visible; }
.save-bar .hint { margin-right: auto; color: var(--muted); font-size: 13px; }
body[data-route="kayit"] .view, body[data-route="yeni"] .view { padding-bottom: 90px; }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 9px 12px; margin: 12px 0 0; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 20;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px);
  display: flex; align-items: center; gap: 14px;
  background: #1b1f27; color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: 0 6px 20px rgb(0 0 0 / 28%);
  max-width: calc(100vw - 32px); width: max-content; font-size: 14px;
}
.toast[hidden] { display: none; }
.toast button { background: none; border: 0; color: #9cc1ff; font-weight: 700; cursor: pointer; padding: 4px; white-space: nowrap; }
.toast.error { background: var(--danger); }
body[data-route="kayit"] .toast, body[data-route="yeni"] .toast { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 78px); }

/* ---------- panel, özet ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 12px; }
.page-head h2 { font-size: 20px; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.panel h3 { font-size: 15px; margin: 0 0 2px; }
.panel p { margin: 0 0 8px; }
.panel-note { color: var(--muted); font-size: 13px; }
@media (min-width: 900px) {
  .panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
}
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  display: grid; gap: 2px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.tile:hover, .tile:focus-visible { border-color: var(--accent); }
.tile-label { font-size: 13px; color: var(--muted); }
.tile-value { font-size: 28px; font-weight: 650; line-height: 1.2; }
.tile.late { background: var(--danger-soft); }
.tile.late .tile-label, .tile.late .tile-value { color: var(--danger); }

/* Yatay çubuklar: tek seri, tek renk */
.bars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.bar-row {
  width: 100%; display: grid; grid-template-columns: minmax(100px, 44%) 1fr; align-items: center; gap: 10px;
  padding: 7px 4px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left;
}
.bar-row:hover, .bar-row:focus-visible { background: var(--surface-2); }
.bar-label { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-area { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bar-fill { display: block; height: 12px; min-width: 2px; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-value { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- asistan ---------- */
.chat-log { display: grid; gap: 10px; padding-bottom: 84px; }
.chat-empty { text-align: center; padding: 16px 4px; }
.chat-empty p { margin: 6px auto; max-width: 460px; }
.chat-hero { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.chat-hero svg { width: 26px; height: 26px; }
.suggestions { display: grid; gap: 8px; margin-top: 14px; justify-items: center; }
.msg {
  max-width: 88%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--surface); border: 1px solid var(--border);
}
.msg.user { justify-self: end; background: var(--accent); border-color: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.assistant { justify-self: start; border-bottom-left-radius: 6px; }
.msg.error { background: var(--danger-soft); color: var(--danger); }
.msg.typing { display: inline-flex; gap: 4px; padding: 14px; }
.msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.msg.typing span:nth-child(2) { animation-delay: 0.2s; }
.msg.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.proposal {
  justify-self: start; width: min(100%, 520px); background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow);
}
.proposal-head { font-size: 13px; font-weight: 700; color: var(--muted); }
.proposal ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.proposal li { font-size: 14px; overflow-wrap: anywhere; }
.proposal .pk { display: inline-block; min-width: 92px; color: var(--muted); font-size: 13px; }
.proposal .old { text-decoration: line-through; color: var(--muted); }
.proposal-actions { display: flex; gap: 8px; margin-top: 10px; }
.proposal-status { margin: 10px 0 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.proposal-status.ok { color: var(--ok); }
.proposal-status.err { color: var(--danger); }
.proposal.applied { border-color: color-mix(in srgb, var(--ok) 50%, var(--border)); }
.chat-form {
  position: fixed; left: 0; right: 0; z-index: 8;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  display: flex; gap: 8px; padding: 10px max(16px, calc(50vw - 344px)); background: var(--bg); border-top: 1px solid var(--border);
}
.chat-form textarea {
  flex: 1; min-width: 0; resize: none; min-height: 44px; max-height: 140px;
  padding: 10px 14px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface);
}
.chat-form .btn { width: 44px; padding: 0; border-radius: 22px; }

/* ---------- hesap ---------- */
.profile { display: flex; align-items: center; gap: 12px; }
.avatar {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--brand); color: var(--gold); font-weight: 700; font-size: 18px;
}
.avatar.small { width: 30px; height: 30px; font-size: 14px; }
.menu-list { padding: 4px 0; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 13px 16px; border: 0; background: none;
  color: var(--text); text-decoration: none; cursor: pointer; text-align: left; font-size: 15px;
}
.menu-item + .menu-item { border-top: 1px solid var(--border); }
.menu-item span { color: var(--muted); }
.menu-item.danger { color: var(--danger); }
.stack { display: grid; gap: 8px; }
.stack input, .stack select, .user-actions input {
  min-height: 44px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 11px; background: var(--bg); min-width: 0;
}
.user-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.user-list li + li { border-top: 1px solid var(--border); padding-top: 12px; }
.user-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.user-actions form { flex: 1 1 220px; }

/* ---------- giriş ---------- */
.login-page {
  display: grid; place-items: center; min-height: 100vh; padding: 16px;
  background: linear-gradient(160deg, var(--brand), var(--brand-2) 55%, var(--bg) 55.1%);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 26px 24px; display: grid; gap: 12px; box-shadow: 0 12px 40px rgb(16 24 40 / 18%);
}
.login-card img { margin: 0 auto; }
.login-card h1 { text-align: center; margin: 0; font-size: 21px; }
.login-sub { text-align: center; margin: -6px 0 6px; color: var(--muted); font-size: 14px; }
.login-card label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.login-card input { height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); }
.login-card .btn { height: 48px; }
.login-help { text-align: center; color: var(--muted); font-size: 12.5px; margin: 0; }

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

/* ---------- müşterinin öncelikleri: duruşma, EHM, karar, süreli ---------- */
:root {
  --hearing: #175cd3; --hearing-soft: #e8effc;
  --ehm: #b42318; --ehm-soft: #fdecec;
  --karar: #6e3aa8; --karar-soft: #f1eafb;
  --sureli: #9a5b00; --sureli-soft: #fff3d6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --hearing: #8cb4ff; --hearing-soft: #1d2a44; --ehm: #ff8a8a; --ehm-soft: #3a1d1f;
    --karar: #c9a2ff; --karar-soft: #2b2140; --sureli: #f5c56a; --sureli-soft: #3a2f12;
  }
}
:root[data-theme="dark"] {
  --hearing: #8cb4ff; --hearing-soft: #1d2a44; --ehm: #ff8a8a; --ehm-soft: #3a1d1f;
  --karar: #c9a2ff; --karar-soft: #2b2140; --sureli: #f5c56a; --sureli-soft: #3a2f12;
}

.key-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (min-width: 720px) { .key-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.key-tile {
  display: grid; justify-items: start; gap: 1px; text-align: left; cursor: pointer; min-width: 0;
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  border-top: 4px solid var(--tile, var(--border));
}
.key-tile:hover { border-color: var(--tile, var(--accent)); }
.key-n { font-size: 30px; font-weight: 750; line-height: 1.1; color: var(--tile, var(--text)); }
.key-label { font-weight: 650; font-size: 14.5px; }
.key-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.key-tile.hearing { --tile: var(--hearing); background: var(--hearing-soft); }
.key-tile.ehm { --tile: var(--ehm); background: var(--ehm-soft); }
.key-tile.karar { --tile: var(--karar); background: var(--karar-soft); }
.key-tile.deadline { --tile: var(--sureli); background: var(--sureli-soft); }
.key-tile.late { --tile: var(--danger); background: var(--danger-soft); }
.key-tile.zero .key-n { color: var(--muted); }

/* önem süzgeci: yatay kaydırılabilir çip satırı */
.prio-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.prio-chips::-webkit-scrollbar { display: none; }
.prio-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 18px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); font-size: 14px; color: var(--text);
}
.prio-chip b { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.prio-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--pc, transparent); border: 1px solid var(--pc, var(--border)); }
.prio-chip[data-p="all"]::before { display: none; }
.prio-chip[data-p="ÖÖÖ"] { --pc: #b42318; }
.prio-chip[data-p="ÖÖ"] { --pc: #e05a2b; }
.prio-chip[data-p="Ö"] { --pc: #e0a21b; }
.prio-chip[data-p="std"] { --pc: #9aa3b2; }
.prio-chip.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.prio-chip.on b { background: rgb(255 255 255 / 22%); color: inherit; }
#prio-row .prio-chips { margin-bottom: 2px; }

.badge.prio[data-p="ÖÖÖ"] { background: #b42318; color: #fff; }
.badge.prio[data-p="ÖÖ"] { background: #fde3d7; color: #a33a12; }
.badge.prio[data-p="Ö"] { background: #fff1cf; color: #8a5a00; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.prio[data-p="ÖÖ"] { background: #3d2318; color: #ffb08f; }
  :root:not([data-theme="light"]) .badge.prio[data-p="Ö"] { background: #3a2f12; color: #f5c56a; }
}
.badge.flag { font-weight: 700; }
.badge.flag.hearing { background: var(--hearing-soft); color: var(--hearing); }
.badge.flag.ehm { background: var(--ehm); color: #fff; }
.badge.flag.karar { background: var(--karar); color: #fff; }
.badge.flag.sureli { background: var(--sureli-soft); color: var(--sureli); }

.alerts { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.alert-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 12px; border-radius: 17px; cursor: pointer; font-size: 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.alert-chip.late { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.alert-chip.today { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.section.hearing .section-title, .section.hearing .count { color: var(--hearing); }
.section.hearing .count { background: var(--hearing-soft); }
.section.deadline .section-title, .section.deadline .count { color: var(--sureli); }
.section.deadline .count { background: var(--sureli-soft); }
.small-seg { margin: 0 0 10px; }
.small-seg .seg-btn { padding: 6px 10px; font-size: 13.5px; }
.day + .day { margin-top: 12px; }
.day-head { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14.5px; margin: 0 0 6px; }
.empty.small { padding: 8px 0 4px; font-size: 14px; text-align: left; }

.sure-calc { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--sureli-soft); }
.sure-calc .field-label { color: var(--sureli); font-weight: 650; font-size: 13px; }
.sure-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.sure-row label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.sure-row input, .sure-row select { min-height: 42px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-width: 0; width: 100%; }
.sure-result { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--sureli); }
.hello-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.field-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.field-note b { color: var(--text); }

/* Uzun düşünmede birkaç saniye sonra açıklama görünür */
.msg.typing { align-items: center; }
.msg.typing small { margin-left: 8px; color: var(--muted); font-size: 13px; opacity: 0; animation: appear 0.3s ease 6s forwards; }
@keyframes appear { to { opacity: 1; } }

/* bildirimler */
.push-state { margin: 4px 0 8px; font-weight: 600; color: var(--ok); display: flex; align-items: center; gap: 6px; }
.push-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.brief-tip { display: inline-block; margin-top: 10px; font-size: 13.5px; text-decoration: none; }

/* asistan cevabındaki Markdown */
.msg.md { white-space: normal; line-height: 1.5; }
.msg.md > :first-child { margin-top: 0; }
.msg.md > :last-child { margin-bottom: 0; }
.msg.md p { margin: 0 0 8px; }
.msg.md h3, .msg.md h4, .msg.md h5 { margin: 12px 0 6px; line-height: 1.3; }
.msg.md h3 { font-size: 17px; }
.msg.md h4 { font-size: 16px; }
.msg.md h5 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.msg.md ul, .msg.md ol { margin: 4px 0 10px; padding-left: 20px; }
.msg.md li { margin: 3px 0; }
.msg.md li::marker { color: var(--muted); }
.msg.md li > ul, .msg.md li > ol { margin: 4px 0 2px; }
.msg.md strong { font-weight: 650; }
.msg.md a { font-weight: 600; text-decoration: none; }
.msg.md code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.msg.md pre { background: var(--surface-2); padding: 10px; border-radius: 10px; overflow-x: auto; margin: 6px 0 10px; }
.msg.md pre code { background: none; padding: 0; }
.msg.md blockquote { margin: 6px 0 10px; padding: 2px 0 2px 12px; border-left: 3px solid var(--border); color: var(--muted); }
.msg.md hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }
.msg.md .md-table { overflow-x: auto; margin: 6px 0 10px; }
.msg.md table { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
.msg.md th, .msg.md td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.msg.md th { font-weight: 650; color: var(--muted); font-size: 12.5px; }

/* takvim */
:root { --cal: #0e7166; --cal-soft: #e3f4f1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cal: #5fd3c2; --cal-soft: #15302c; } }
:root[data-theme="dark"] { --cal: #5fd3c2; --cal-soft: #15302c; }
.section.calendar .section-title, .section.calendar .count { color: var(--cal); }
.section.calendar .count { background: var(--cal-soft); }
.section-hint.err { color: var(--danger); }
.events { display: grid; gap: 6px; }
.event {
  display: grid; grid-template-columns: 82px 1fr; gap: 10px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--cal); border-radius: 12px; padding: 9px 12px;
}
.ev-time { font-size: 13px; font-weight: 650; color: var(--cal); padding-top: 1px; font-variant-numeric: tabular-nums; }
.ev-title { font-weight: 600; overflow-wrap: anywhere; }
.ev-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ev-rec { display: inline-block; margin-top: 3px; font-size: 13px; font-weight: 600; text-decoration: none; }
.card-note { margin-top: 6px; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }

/* kişiler */
:root { --p-s: #7b3fb5; --p-a: #0e7166; }
.badge.person { background: var(--surface-2); color: var(--text); font-weight: 600; gap: 4px; padding-left: 4px; }
.badge.person i, .person-chip i {
  font-style: normal; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--p-other, #5d6573); color: #fff; font-size: 10px; font-weight: 700;
}
.badge.person i + i { margin-left: -7px; box-shadow: 0 0 0 1.5px var(--surface-2); }
[data-c="S"] { --p-other: var(--p-s); }
[data-c="A"] { --p-other: var(--p-a); }
.person-row { display: flex; gap: 6px; overflow-x: auto; margin: 2px -16px 8px; padding: 0 16px; scrollbar-width: none; }
.person-row::-webkit-scrollbar { display: none; }
.person-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 18px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); font-size: 14px; color: var(--text);
}
.person-chip i { width: 20px; height: 20px; font-size: 11px; }
.person-chip b { font-size: 12px; padding: 1px 7px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.person-chip.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.person-chip.on b { background: rgb(255 255 255 / 22%); color: inherit; }

/* Drive */
.drive-block { margin-top: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.drive-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.folder-row, .file-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 4px; color: inherit; text-decoration: none; border-top: 1px solid var(--border);
}
.drive-head + .folder-row, .file-list > .file-row:first-child { border-top: 0; }
.folder-row svg, .file-row .kind.folder svg { color: #c9a45c; flex: none; }
.folder-row span:not(.chev) { display: grid; min-width: 0; flex: 1; }
.folder-row b, .fname { overflow-wrap: anywhere; font-weight: 600; }
.folder-row small, .fname small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.fname { display: grid; flex: 1; min-width: 0; font-weight: 500; }
.chev { color: var(--muted); font-size: 18px; margin-left: auto; }
.folder-title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.folder-title svg { width: 28px; height: 28px; color: #c9a45c; flex: none; }
.folder-title h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.folder-title p { margin: 2px 0 0; }
.file-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 12px; margin-bottom: 10px; }
.kind { flex: none; width: 46px; text-align: center; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 4px 0; }
.kind.folder { background: none; }
.card-foot .row-btns { gap: 6px; }

/* takvim ekranı */
.cal-head { display: flex; align-items: center; gap: 6px; margin: 2px 0 10px; }
.cal-title { flex: 1; text-align: center; }
.cal-title h2 { margin: 0; font-size: 19px; }
.icon-btn.dark { color: var(--text); font-size: 24px; background: var(--surface); border: 1px solid var(--border); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; }
.cal-wd { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 2px 0 4px; }
.cal-day {
  display: grid; grid-template-rows: auto 1fr; justify-items: center; gap: 2px; min-height: 52px; padding: 5px 0 4px;
  border: 0; border-radius: 10px; background: transparent; cursor: pointer; color: var(--text);
}
.cal-day:hover { background: var(--surface-2); }
.cal-day .num { font-size: 14px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.out { opacity: 0.38; }
.cal-day.we .num { color: var(--muted); }
.cal-day.holiday .num { color: var(--danger); }
.cal-day.today .num { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.sel { background: var(--accent-soft); }
.cal-day.sel .num { background: var(--accent); color: #fff; box-shadow: none; }
.cal-day .dots { display: flex; align-items: center; gap: 3px; min-height: 16px; }
.cal-day .dots b, .cal-legend b {
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--hearing); color: #fff; font-size: 10.5px; line-height: 16px; text-align: center;
}
.cal-day .dots b.key, .cal-legend b.key { background: var(--ehm); }
.cal-day .dots i, .cal-legend i { width: 6px; height: 6px; border-radius: 50%; background: var(--cal); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin: 8px 2px 4px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend b { min-width: 10px; height: 10px; padding: 0; }
.cal-legend .hol { color: var(--danger); font-weight: 600; }
.cal-day-title { margin: 16px 0 8px; font-size: 16px; scroll-margin-top: 70px; }
.holiday-note { margin: -4px 0 10px; color: var(--danger); font-weight: 600; font-size: 14px; }
.cal-others { margin-top: 8px; }
@media (min-width: 900px) { .cal-day { min-height: 70px; } }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 4px 0; font-size: 14px; }

/* özet: yaklaşan duruşmalar */
.hearing-list { padding-bottom: 6px; }
.hl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hl-day { margin: 12px 0 4px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--hearing); }
.hl-row {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 8px 2px; border: 0; border-top: 1px solid var(--border); background: none; color: inherit; text-decoration: none; cursor: pointer; font: inherit;
}
.hl-day + .hl-row { border-top: 0; }
.hl-time { font-weight: 700; font-size: 13.5px; color: var(--hearing); font-variant-numeric: tabular-nums; }
.hl-main { display: grid; min-width: 0; }
.hl-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-main small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-flags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 130px; }
.hl-flags .badge.person { font-size: 11px; }

/* bildirim tercihleri */
.push-prefs { display: grid; gap: 4px; margin: 4px 0 8px; }
.switch, .select-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; cursor: pointer; }
.switch div, .select-row div { display: grid; flex: 1; }
.switch small, .select-row small { color: var(--muted); font-size: 12.5px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span { flex: none; width: 44px; height: 26px; border-radius: 13px; background: var(--border); position: relative; transition: background 0.15s; order: 2; }
.switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 25%); transition: transform 0.15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.select-row select { min-height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); padding: 4px 8px; }

/* dokunulabilir kartlar (içinde düğme olan kartlarda tam yüzey bağlantı) */
.tappable { position: relative; cursor: pointer; }
.card-link { position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.tappable .card-foot a, .tappable .card-foot button, .tappable .ev-rec { position: relative; z-index: 1; }
.tappable:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.event.tappable::after { content: "›"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }

/* etkinlik detayı */
.event-detail::before { background: var(--hearing); }
.ev-desc { white-space: pre-wrap; }
.rc-event { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; text-decoration: none; color: var(--accent); font-weight: 500; }
.linked-record {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; margin-top: 10px; padding: 12px 14px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none;
}
.linked-record > :not(.chev):not(button) { grid-column: 1; }
.linked-record .chev { grid-column: 2; grid-row: 1 / span 3; }
.linked-record small { color: var(--muted); font-size: 13px; }
.linked-record.missing { grid-template-columns: 1fr auto; background: var(--warn-soft); border-color: transparent; }
.linked-record.missing span { display: grid; }
