/* Meil — Swiss/Minimal arayüz (ui-ux-pro-max tasarım sistemi)
   Palet: inbox mavisi #2563EB · Tipografi: Plus Jakarta Sans + Fira Code */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Fira+Code:wght@400;500;600&family=Fira+Sans:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;          /* Swiss inbox mavisi */
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-text: #1d4ed8;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --green: #059669;
  --green-soft: #ecfdf5;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.12);
  --radius: 10px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg: #0b1220;
  --panel: #101827;
  --panel-2: #1e293b;
  --border: #283548;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft: #172554;
  --accent-text: #93b4f8;
  --red: #f87171;
  --red-soft: #2d1a1c;
  --amber: #fbbf24;
  --amber-soft: #2c2410;
  --green: #34d399;
  --green-soft: #06281e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.25s;
}

/* ---------- Üst bar ---------- */
#topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.2px; }

.topbar-search {
  flex: 1; max-width: 560px; margin: 0 auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; height: 38px;
  display: flex; align-items: center; gap: 8px; padding: 0 14px;
  color: var(--muted); box-shadow: var(--shadow);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.topbar-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.topbar-search input {
  border: none; outline: none; background: none; flex: 1;
  font-size: 13.5px; font-family: inherit; color: var(--text);
}
.topbar-search kbd {
  font-size: 11px; color: var(--muted); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; font-family: inherit;
}
.topbar-right { display: flex; align-items: center; gap: 10px; min-width: 150px; justify-content: flex-end; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; border-radius: 999px; padding: 8px 16px;
  font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.pill:active { transform: scale(0.97); }
.pill.accent { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.pill.accent:hover { background: var(--accent-hover); }
.pill.ghost { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.pill.ghost:hover { background: var(--panel-2); }
.pill.danger-ghost { background: none; color: var(--red); border: 1px solid var(--border); font-weight: 500; }
.pill.danger-ghost:hover { background: var(--red-soft); border-color: var(--red); }
.pill:disabled { opacity: 0.55; cursor: not-allowed; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel); cursor: pointer; font-size: 15px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.icon-btn:hover { background: var(--panel-2); border-color: var(--accent); color: var(--accent-text); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-btn.on { color: var(--amber); border-color: var(--amber); background: var(--amber-soft); }

#layout { flex: 1; display: flex; overflow: hidden; gap: 12px; padding: 0 12px 12px; }

/* ---------- Sol ray ---------- */
#rail {
  width: 74px; display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding-top: 6px; flex-shrink: 0;
}
.rail-btn {
  background: none; border: none; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); width: 100%; padding: 4px 0;
}
.rail-tile {
  width: 44px; height: 44px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.rail-btn:hover .rail-tile { background: var(--panel); box-shadow: var(--shadow); }
.rail-btn.active { color: var(--accent-text); }
.rail-btn.active .rail-tile {
  background: var(--accent-soft); color: var(--accent-text); box-shadow: var(--shadow);
}
.rail-label { font-size: 10.5px; font-weight: 600; }

.view { flex: 1; display: flex; overflow: hidden; gap: 12px; }

/* ---------- Liste paneli ---------- */
#list-panel {
  width: 390px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.panel-header { padding: 16px 16px 10px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-title-row h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.pill-select {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-family: inherit;
  max-width: 170px; cursor: pointer;
}

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; border: 1px solid var(--border); background: var(--panel);
  color: var(--muted); border-radius: 6px; padding: 5px 12px;
  font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: all 0.2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-text); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .n { opacity: 0.7; font-weight: 500; margin-left: 3px; }

/* Görünüm sekmeleri (Gelen/Yıldızlı/Bekleyen/Ertelenen/Arşiv) */
.view-tabs {
  display: flex; gap: 2px; margin-bottom: 10px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px;
}
.view-tab {
  flex: 1; border: none; background: none; padding: 6px 2px; cursor: pointer;
  font-size: 11px; font-weight: 600; font-family: inherit; color: var(--muted);
  border-radius: 6px; white-space: nowrap; position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.view-tab svg { flex-shrink: 0; }
.view-tab:hover { color: var(--text); }
.view-tab.active { background: var(--panel); color: var(--accent-text); box-shadow: var(--shadow); }
.view-tab .vn { font-weight: 500; opacity: 0.7; font-size: 10.5px; }

/* Okunmamış gösterimi + yıldız */
.email-item { position: relative; }
.email-item .unread-dot {
  width: 8px; height: 8px; border-radius: 99px; background: var(--accent-bright, var(--accent));
  position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
}
.email-item.unread .from, .email-item.unread .subject { font-weight: 800; }
.star-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  opacity: 0.4; padding: 0 2px; flex-shrink: 0; transition: all 0.2s;
  display: inline-flex; align-items: center;
}
.star-btn:hover { opacity: 1; color: var(--amber); }
.star-btn.on { opacity: 1; color: var(--amber); }
.star-btn:hover { opacity: 0.8; }
.rail-badge {
  position: absolute; top: 2px; right: 12px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 6px;
  min-width: 17px;
}
.detail-toolbar { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; }

#email-list { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.email-item {
  display: flex; gap: 11px; padding: 12px; margin-bottom: 6px;
  border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent; position: relative;
  transition: background 0.12s, border-color 0.12s;
}
.email-item:hover { background: var(--panel-2); }
.email-item.active { background: var(--accent-soft); border-color: var(--accent); }
.email-item .item-body { flex: 1; min-width: 0; }
.email-item .row1 { display: flex; justify-content: space-between; align-items: baseline; }
.email-item .from { font-weight: 650; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-item .time { font-family: "Fira Code", monospace; font-size: 10.5px; color: var(--muted); flex-shrink: 0; margin-left: 8px; }
.email-item .subject { font-size: 13px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-item .summary {
  font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.email-item .meta { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; align-items: center; }

/* ---------- Avatar ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13.5px;
}
.avatar.small { width: 32px; height: 32px; font-size: 12px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-hover)); }
.avatar.large { width: 48px; height: 48px; font-size: 17px; border-radius: 14px; }

/* Kullanıcı menüsü (avatar → çıkış) */
.user-wrap { position: relative; }
button.avatar { border: none; padding: 0; cursor: pointer; }
button.avatar:hover { filter: brightness(1.06); }
.user-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 200;
  min-width: 208px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; overflow: hidden;
}
.user-menu[hidden] { display: none; }
.user-menu-head { display: flex; align-items: center; gap: 11px; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.user-menu-id { display: flex; flex-direction: column; line-height: 1.25; }
.user-menu-id b { font-size: 14px; color: var(--text); }
.user-menu-id span { font-size: 12px; color: var(--muted); }
.user-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 11px; border: none; background: transparent; cursor: pointer;
  border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--text); text-align: left;
}
.user-menu-item:hover { background: var(--panel-2); color: var(--accent-text); }
.user-menu-item svg { color: var(--muted); }
.user-menu-item:hover svg { color: var(--accent-text); }

/* ---------- Rozetler ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 8px; border-radius: 5px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
  font-weight: 550;
}
.badge.cat { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; font-weight: 650; }
.badge.acct { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge.p-yüksek { background: var(--red-soft); color: var(--red); border-color: transparent; font-weight: 650; }
.badge.p-orta { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.badge.p-düşük { background: var(--green-soft); color: var(--green); border-color: transparent; }
.badge.replied { background: var(--green-soft); color: var(--green); border-color: transparent; }

/* ---------- Detay paneli ---------- */
#detail-panel {
  flex: 1; overflow-y: auto; padding: 22px 26px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.placeholder { text-align: center; color: var(--muted); margin-top: 130px; font-size: 14px; }
.placeholder-icon { font-size: 46px; margin-bottom: 12px; opacity: 0.45; }

.detail-header { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.detail-subject { font-size: 21px; font-weight: 750; letter-spacing: -0.3px; line-height: 1.3; }
.detail-meta { color: var(--muted); font-size: 13px; margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.card {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.card h3 {
  font-family: "Fira Code", monospace;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin-bottom: 11px; font-weight: 600;
}
.card .body-text { white-space: pre-wrap; font-size: 14px; line-height: 1.6; max-height: 360px; overflow-y: auto; }

.summary-card {
  background: linear-gradient(135deg, var(--accent-soft), var(--panel-2));
  border-color: transparent; position: relative;
}
.summary-card h3 { color: var(--accent-text); }
.summary-card p { font-size: 14.5px; line-height: 1.55; }
#thread-sum-holder { margin-top: 12px; }
.thread-summary {
  padding: 12px 14px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.55;
}
.thread-summary .ts-action {
  margin-top: 8px; font-weight: 650; color: var(--accent-text);
  display: flex; align-items: center; gap: 6px; font-size: 13px;
}

/* Giriş ekranı (PIN) */
#auth-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
#auth-panel {
  width: min(360px, 90vw); text-align: center;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); padding: 36px 28px;
  display: flex; flex-direction: column; gap: 12px;
}
.auth-brand .brand-mark { width: 52px; height: 52px; font-size: 24px; margin: 0 auto; }
#auth-panel h2 { font-size: 20px; font-weight: 750; letter-spacing: -0.3px; }
.auth-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
#auth-panel input {
  width: 100%; padding: 12px 15px; font-size: 15px; text-align: left; letter-spacing: 0.3px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#auth-panel input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-field { position: relative; display: flex; }
.auth-field input { padding-right: 44px; }
.auth-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer; font-size: 16px;
  width: 34px; height: 34px; border-radius: 8px; line-height: 1;
}
.auth-eye:hover { background: var(--panel); }
.auth-strength { display: flex; align-items: center; gap: 9px; margin: -3px 2px 0; }
.auth-strength i {
  flex: 1; height: 5px; border-radius: 4px; background: var(--border);
  position: relative; overflow: hidden;
}
.auth-strength i::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--sw, 0%);
  background: var(--sc, var(--accent)); border-radius: 4px; transition: width .25s, background .25s;
}
.auth-strength span { font-size: 11px; font-weight: 650; color: var(--muted); min-width: 54px; text-align: right; }
.auth-caps { font-size: 12px; color: #d97706; font-weight: 650; margin: -3px 0 0; }
#auth-panel .pill { justify-content: center; padding: 11px; font-size: 14px; }
.auth-error { min-height: 18px; font-size: 12.5px; color: var(--red); font-weight: 600; }

/* Kullanıcı menüsü etiketi */
.menu-tag {
  margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
}
.menu-tag.on { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }

/* Genel modal (2FA) */
.modal-overlay {
  position: fixed; inset: 0; z-index: 420; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(3px); padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  position: relative; width: min(420px, 94vw); max-height: 88vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 26px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-close {
  position: absolute; top: 12px; right: 14px; border: none; background: transparent;
  font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; width: 30px; height: 30px; border-radius: 8px;
}
.modal-close:hover { background: var(--panel-2); color: var(--text); }
.modal-title { font-size: 18px; font-weight: 750; letter-spacing: -0.2px; }
.modal-muted { font-size: 13px; color: var(--muted); line-height: 1.55; }
.modal-muted b { color: var(--text); font-weight: 650; }
.pill.modal-wide { justify-content: center; width: 100%; padding: 11px; font-size: 14px; }
.pill.danger { background: var(--red); color: #fff; }
.pill.danger:hover { filter: brightness(1.06); }
.tf-qr {
  align-self: center; width: 190px; height: 190px; padding: 10px; background: #fff;
  border-radius: 12px; border: 1px solid var(--border);
}
.tf-qr svg { width: 100%; height: 100%; display: block; }
.tf-secret {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px;
}
.tf-secret span { font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.tf-secret code { font-family: "Fira Code", monospace; font-size: 13px; letter-spacing: 1px; color: var(--text); word-break: break-all; }
.tf-input {
  width: 100%; padding: 11px 14px; font-size: 16px; text-align: center; letter-spacing: 3px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2);
  color: var(--text); font-family: "Fira Code", monospace;
}
.tf-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tf-codes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px;
}
.tf-codes code { font-family: "Fira Code", monospace; font-size: 13px; text-align: center; color: var(--text); }
.tf-ok { font-size: 15px; font-weight: 700; color: var(--green, #16a34a); }

/* Giriş kayıtları */
.modal-wide-card { width: min(560px, 96vw); }
.log-list { display: flex; flex-direction: column; max-height: 56vh; overflow-y: auto; margin: 0 -4px; }
.log-row {
  display: grid; grid-template-columns: 12px 1fr auto auto; align-items: center; gap: 12px;
  padding: 9px 6px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.log-row:last-child { border-bottom: none; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.log-dot.ok { background: #16a34a; }
.log-dot.bad { background: var(--red); }
.log-dot.warn { background: #d97706; }
.log-dot.muted { background: var(--faint, #94a3b8); }
.log-ev { font-weight: 600; color: var(--text); }
.log-ip { font-family: "Fira Code", monospace; font-size: 12px; color: var(--muted); }
.log-ts { font-size: 12px; color: var(--faint, #94a3b8); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Global arama paleti (Cmd+K) */
#gs-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh; background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}
#gs-panel {
  width: min(640px, 92vw); background: var(--panel);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28); overflow: hidden;
}
.gs-inputrow {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted);
}
#gs-input {
  flex: 1; border: none; outline: none; background: transparent;
  color: var(--text); font-size: 15.5px; font-family: inherit;
}
.gs-inputrow kbd {
  font-family: "Fira Code", monospace; font-size: 10px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px;
}
#gs-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.gs-hint { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }
.gs-group {
  font-family: "Fira Code", monospace; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); padding: 10px 12px 4px;
}
.gs-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: 8px; cursor: pointer; color: var(--text);
}
.gs-item svg { flex-shrink: 0; color: var(--muted); }
.gs-item:hover, .gs-item.sel { background: var(--accent-soft); }
.gs-item.sel .gs-title { color: var(--accent-text); }
.gs-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.gs-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-snip { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-snip mark { background: var(--amber-soft); color: var(--amber); border-radius: 3px; padding: 0 2px; }
.gs-meta { font-family: "Fira Code", monospace; font-size: 10.5px; color: var(--muted); flex-shrink: 0; }

/* Gelen kutusuyla sohbet (AI'ya Sor) */
#chat-btn { white-space: nowrap; }
.chat-log {
  min-height: 220px; max-height: 46vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; padding: 4px 2px;
}
.chat-empty { text-align: center; padding: 24px 10px; color: var(--muted); }
.chat-empty p { font-size: 13.5px; margin-bottom: 14px; }
.chat-suggestion {
  display: block; width: 100%; margin: 6px 0; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text); font-size: 13px; text-align: left;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.chat-suggestion:hover { border-color: var(--accent); background: var(--accent-soft); }
.chat-msg {
  max-width: 86%; padding: 10px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.55; white-space: pre-wrap;
}
.chat-msg.user {
  align-self: flex-end; background: var(--accent); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.assistant {
  align-self: flex-start; background: var(--panel-2);
  border: 1px solid var(--border); border-bottom-left-radius: 4px;
}
.chat-msg.pending { color: var(--muted); font-style: italic; }
.chat-sources { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.chat-source {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--panel);
  color: var(--accent-text); font-size: 12px; font-weight: 600; cursor: pointer;
  text-align: left; transition: border-color 0.15s;
}
.chat-source:hover { border-color: var(--accent); }
input#chat-input {
  flex: 1; padding: 10px 14px; font-size: 13.5px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); color: var(--text);
}
input#chat-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Konuşma dizisi (thread) */
.badge.thread { color: var(--accent-text); background: var(--accent-soft); }
.thread-list { display: flex; flex-direction: column; gap: 8px; }
.thread-msg {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel); overflow: hidden;
}
.thread-msg .tm-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  cursor: pointer; transition: background 0.15s;
}
.thread-msg .tm-head:hover { background: var(--panel-2); }
.thread-msg .tm-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tm-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tm-from { font-weight: 650; font-size: 13.5px; }
.tm-snippet {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thread-msg.open .tm-snippet { display: none; }
.tm-time { font-family: "Fira Code", monospace; font-size: 10.5px; color: var(--muted); flex-shrink: 0; }
.thread-msg .tm-body { display: none; padding: 0 12px 14px 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.thread-msg.open { border-color: var(--accent); }
.thread-msg.open .tm-body { display: block; }

textarea#reply-text {
  width: 100%; min-height: 170px; padding: 14px; font-size: 14px; line-height: 1.55;
  font-family: inherit; border: 1px solid var(--border); border-radius: var(--radius-sm);
  resize: vertical; background: var(--panel); color: var(--text);
}
textarea#reply-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.reply-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
input#regen-instruction {
  flex: 1; min-width: 200px; padding: 9px 14px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 999px; font-family: inherit;
  background: var(--panel); color: var(--text);
}
input#regen-instruction:focus { outline: none; border-color: var(--accent); }

.attachment-list a {
  display: inline-flex; align-items: center; gap: 7px; margin: 3px 8px 3px 0;
  padding: 8px 14px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; font-size: 13px; color: var(--accent-text);
  text-decoration: none; font-weight: 600; transition: all 0.15s;
}
.attachment-list a:hover { border-color: var(--accent); background: var(--accent-soft); }
.attachment-list .size { color: var(--muted); font-weight: 400; }

/* ---------- Sayfalar ---------- */
.page {
  flex: 1; overflow-y: auto; padding: 26px 32px; max-width: 920px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin: 0 auto;
}
.page-wide { max-width: 1280px; }
.page-title { font-size: 22px; font-weight: 750; letter-spacing: -0.3px; }
.page-desc { color: var(--muted); font-size: 14px; margin: 8px 0 22px; line-height: 1.5; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.page-header .page-desc { max-width: 640px; }
.page-actions { flex-shrink: 0; padding-top: 6px; }
.search-inline {
  width: 100%; max-width: 340px; padding: 8px 14px; margin-bottom: 14px;
  font-size: 13px; border: 1px solid var(--border); border-radius: 999px;
  font-family: inherit; background: var(--panel-2); color: var(--text);
}
.search-inline:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

table.dataroom {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
table.dataroom th, table.dataroom td {
  padding: 11px 15px; text-align: left; font-size: 13.5px;
  border-bottom: 1px solid var(--border);
}
table.dataroom tr:last-child td { border-bottom: none; }
table.dataroom tbody tr:hover { background: var(--panel-2); }
table.dataroom th {
  background: var(--panel-2); color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.6px;
}
table.dataroom a { color: var(--accent-text); text-decoration: none; font-weight: 650; }
table.dataroom .file-note { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: pre-wrap; }
table.dataroom .file-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.mini-btn {
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 7px; padding: 5px 9px; font-size: 12px; cursor: pointer;
  font-family: inherit; white-space: nowrap;
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.mini-btn.accent { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.mini-btn.accent:hover { border-color: var(--accent-hover); background: #d4e8e0; }
.mini-btn.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.shared-badge { font-size: 11px; color: var(--accent-text); font-weight: 650; }

/* ---------- Dataroom v2 ---------- */
#dr-side {
  width: 265px; flex-shrink: 0; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.dr-stats {
  background: var(--accent-soft); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 16px; font-size: 12.5px;
  color: var(--accent-text); font-weight: 600; line-height: 1.7;
}
.dr-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#dr-side h3 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--muted); font-weight: 700;
}
.dr-activity-title { margin: 18px 0 8px; }
.dr-folder {
  display: flex; align-items: center; gap: 7px; padding: 6px 9px;
  border-radius: 7px; cursor: pointer; font-size: 13px;
  color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.dr-folder:hover { background: var(--panel-2); }
.dr-folder.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.dr-folder .indent { flex-shrink: 0; }

.dr-act-row { display: flex; gap: 8px; padding: 6px 2px; font-size: 12px; border-bottom: 1px solid var(--border); }
.dr-act-row:last-child { border-bottom: none; }
.dr-act-icon { flex-shrink: 0; }
.dr-act-body { flex: 1; min-width: 0; }
.dr-act-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-act-time { color: var(--muted); font-size: 11px; }

#dr-main {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.dr-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.dr-toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dr-toolbar-actions .search-inline { margin-bottom: 0; max-width: 260px; }
.dr-breadcrumb { font-size: 15px; font-weight: 700; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.dr-breadcrumb a { color: var(--accent-text); text-decoration: none; cursor: pointer; }
.dr-breadcrumb .sep { color: var(--muted); font-weight: 400; }
.dr-filters { margin-bottom: 10px; }
.dr-bulkbar {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  background: var(--accent-soft); border-radius: var(--radius-sm); margin-bottom: 10px;
  font-size: 13px; font-weight: 650; color: var(--accent-text);
}
#dataroom-list { flex: 1; overflow-y: auto; }
table.dataroom input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.dr-fav { cursor: pointer; font-size: 15px; opacity: 0.35; background: none; border: none; }
.dr-fav.on { opacity: 1; }
.file-name-link { cursor: pointer; font-weight: 600; }
.file-name-link:hover { color: var(--accent-text); text-decoration: underline; }
.tag-chip {
  display: inline-block; font-size: 10.5px; padding: 1px 8px; border-radius: 999px;
  background: var(--amber-soft); color: var(--amber); font-weight: 650; margin: 2px 3px 0 0;
}
#preview-frame { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.modal-wide { max-width: 900px !important; }
.modal-list button { width: 100%; text-align: left; margin-bottom: 6px; }

/* ---------- Modal ---------- */
#modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 14, 20, 0.45); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
#modal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 22px; width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto;
}
#modal h3 { font-size: 16px; font-weight: 750; margin-bottom: 4px; letter-spacing: -0.2px; }
#modal .modal-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; word-break: break-all; }
#modal textarea {
  width: 100%; min-height: 90px; padding: 11px; font-size: 13.5px; line-height: 1.5;
  font-family: inherit; border: 1px solid var(--border); border-radius: var(--radius-sm);
  resize: vertical; background: var(--panel-2); color: var(--text);
}
#modal textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; flex-wrap: wrap; }
.share-url {
  display: flex; gap: 8px; align-items: center; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 12.5px; word-break: break-all;
}
.share-url code { flex: 1; font-family: ui-monospace, monospace; }

/* ---------- Hesap kartları ---------- */
.account-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 18px; margin-bottom: 10px;
}
.account-card .info { flex: 1; }
.account-card .name { font-weight: 700; font-size: 15px; }
.account-card .detail { color: var(--muted); font-size: 12px; margin-top: 3px; }

.form-card h3 { font-size: 15px; text-transform: none; letter-spacing: -0.2px; color: var(--text); font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.form-grid label {
  font-size: 12px; color: var(--muted); display: flex; flex-direction: column;
  gap: 5px; font-weight: 650;
}
.form-grid input, .form-grid select {
  padding: 9px 12px; font-size: 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit; font-weight: 400;
  background: var(--panel); color: var(--text);
}
.form-grid input:focus, .form-grid select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.hint { font-size: 12.5px; color: var(--muted); margin: 14px 0; line-height: 1.55; }
.hint a { color: var(--accent-text); }
#acc-save { margin-top: 4px; }

/* ---------- Takvim ---------- */
#view-calendar { flex-wrap: wrap; overflow-y: auto; }
#cal-main {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  min-width: 320px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-nav h2 { font-size: 18px; font-weight: 750; min-width: 150px; text-align: center; letter-spacing: -0.2px; }
.cal-actions { display: flex; gap: 8px; }

.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  margin-bottom: 6px; padding: 0 2px;
}
.cal-weekdays span {
  font-family: "Fira Code", monospace; font-size: 10.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; text-align: center;
}

#cal-grid {
  flex: 1; display: grid; grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr; gap: 6px; overflow-y: auto;
}
.cal-cell {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px; min-height: 84px; cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; gap: 3px;
  transition: border-color 0.12s, background 0.12s;
  background: var(--panel);
}
.cal-cell:hover { background: var(--panel-2); }
.cal-cell.other { opacity: 0.4; }
.cal-cell.selected { border-color: var(--accent); background: var(--accent-soft); }
.cal-cell .daynum {
  font-family: "Fira Code", monospace; font-size: 11.5px; font-weight: 500; color: var(--muted);
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
}
.cal-cell.today .daynum { background: var(--accent); color: #fff; }
.cal-event-chip {
  font-size: 10.5px; font-weight: 600; color: #fff; border-radius: 5px;
  padding: 1px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-more { font-size: 10px; color: var(--muted); font-weight: 600; }

#cal-side {
  width: 340px; max-width: 100%; flex-shrink: 0; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.side-title { font-size: 15px; font-weight: 750; margin-bottom: 10px; letter-spacing: -0.2px; }

.day-event {
  display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--border); margin-bottom: 7px;
  align-items: flex-start;
}
.day-event .bar { width: 4px; border-radius: 99px; align-self: stretch; flex-shrink: 0; }
.day-event .ev-body { flex: 1; min-width: 0; }
.day-event .ev-title { font-size: 13.5px; font-weight: 650; }
.day-event .ev-meta { font-family: "Fira Code", monospace; font-size: 11px; color: var(--muted); margin-top: 3px; }
.day-event .ev-del, .cal-source-row .ev-del {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: 2px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: color 0.15s, background 0.15s;
}
.day-event .ev-del:hover, .cal-source-row .ev-del:hover { color: var(--red); background: var(--panel-2); }

.cal-source-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 4px;
  font-size: 13px; border-bottom: 1px solid var(--border);
}
.cal-source-row:last-child { border-bottom: none; }
.cal-source-row .dot { width: 10px; height: 10px; border-radius: 99px; flex-shrink: 0; }
.cal-source-row .src-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-source-row .src-type { font-size: 11px; color: var(--muted); }

.form-col { display: flex; flex-direction: column; gap: 9px; }
.form-row { display: flex; gap: 9px; }
.form-row > * { flex: 1; }
.form-col input, .form-col select {
  padding: 9px 12px; font-size: 13.5px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit;
  background: var(--panel); color: var(--text); width: 100%;
}
.form-col input:focus, .form-col select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Mail detayındaki etkinlik kartı */
.event-card { border-left: 3px solid var(--accent); }
.event-card .ev-line { font-size: 14px; margin-bottom: 4px; }
.event-card .ev-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.event-card select {
  padding: 8px 12px; font-size: 13px; border: 1px solid var(--border);
  border-radius: 999px; font-family: inherit; background: var(--panel); color: var(--text);
}

/* ---------- Dataroom Layout ---------- */
.page.page-dataroom-layout,
#view-dataroom .page {
  max-width: 100%; padding: 0; overflow: hidden; margin: 0; background: transparent;
  border: none; box-shadow: none; border-radius: 0;
}
.page-dataroom-layout {
  display: flex; gap: 16px; height: calc(100vh - 56px - 40px); overflow: hidden;
}
.dataroom-left {
  flex: 1; display: flex; flex-direction: column; overflow-y: auto; min-width: 0;
}
.dataroom-right {
  width: 320px; border-left: 1px solid var(--border); overflow-y: auto;
  background: var(--panel-2); border-radius: 14px; padding: 16px;
}

/* Breadcrumb Navigation */
.breadcrumb {
  display: flex; align-items: center; gap: 8px; padding: 8px 0; margin-bottom: 12px;
  font-size: 13px; flex-wrap: wrap;
}
.breadcrumb-btn {
  background: none; border: none; color: var(--accent); cursor: pointer; font-weight: 500;
  font-family: inherit; padding: 4px 8px; border-radius: 6px; transition: background 0.2s;
}
.breadcrumb-btn:hover { background: var(--accent-soft); }

/* Folder Navigation */
.folder-btn {
  background: none; border: none; color: var(--text); cursor: pointer; font-weight: 500;
  font-family: inherit; padding: 8px 12px; border-radius: 8px; transition: background 0.2s;
  width: 100%; text-align: left; font-size: 14px;
}
.folder-btn:hover { background: var(--panel-2); }
.folder-row { background: var(--panel-2); }

/* File Actions */
.file-name-btn {
  background: none; border: none; color: var(--text); cursor: pointer; font-weight: 400;
  font-family: inherit; padding: 0; font-size: 13.5px; transition: color 0.2s;
}
.file-name-btn:hover { color: var(--accent); }

/* Notes Panel */
.notes-panel {
  display: flex; flex-direction: column; gap: 12px;
}
.notes-panel h3 {
  font-size: 14px; font-weight: 600; word-break: break-word; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.notes-list {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
  min-height: 120px;
}

.note-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px; font-size: 13px;
}
.note-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  justify-content: space-between; flex-wrap: wrap;
}
.note-author {
  font-weight: 600; color: var(--accent); font-size: 12px;
}
.note-time {
  font-size: 11px; color: var(--muted);
}
.note-delete-btn {
  background: none; border: none; color: var(--red); cursor: pointer; font-size: 14px;
  padding: 0 4px; transition: opacity 0.2s;
}
.note-delete-btn:hover { opacity: 0.7; }
.note-content {
  color: var(--text); line-height: 1.4; word-break: break-word;
}

.add-note-form {
  display: flex; flex-direction: column; gap: 8px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.add-note-form input,
.add-note-form textarea {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); color: var(--text); font-family: inherit; font-size: 12.5px;
  transition: border-color 0.2s;
}
.add-note-form input:focus,
.add-note-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.add-note-form textarea {
  resize: vertical; min-height: 80px; line-height: 1.4;
}

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--text); color: var(--bg); padding: 11px 22px; border-radius: 999px;
  font-size: 13.5px; font-weight: 550; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; max-width: 660px; z-index: 100;
  box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--red); color: #fff; }

/* ---------- Kaydırma çubukları ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   Dataroom v3 — Swiss/Minimal tasarım sistemi (ui-ux-pro-max)
   Palet: kurumsal mavi #2563EB + anlaşma yeşili #059669
   Tipografi: Fira Sans (gövde) + Fira Code (veri/başlık)
   ============================================================ */

#view-dataroom {
  --dr-primary: #2563eb;
  --dr-on-primary: #ffffff;
  --dr-accent: #059669;
  --dr-bg: #f8fafc;
  --dr-fg: #0f172a;
  --dr-muted-fg: #64748b;
  --dr-surface: #ffffff;
  --dr-muted: #f1f5f9;
  --dr-border: #e2e8f0;
  --dr-destructive: #dc2626;
  --dr-destructive-soft: #fef2f2;
  --dr-primary-soft: #eff6ff;
  --dr-accent-soft: #ecfdf5;
  --dr-amber: #b45309;
  --dr-amber-soft: #fffbeb;
  --dr-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --dr-radius: 8px;
  font-family: "Fira Sans", -apple-system, "Segoe UI", sans-serif;
  gap: 12px;
  color: var(--dr-fg);
}
[data-theme="dark"] #view-dataroom {
  --dr-primary: #3b82f6;
  --dr-accent: #10b981;
  --dr-bg: #0b1220;
  --dr-fg: #e2e8f0;
  --dr-muted-fg: #94a3b8;
  --dr-surface: #101827;
  --dr-muted: #1e293b;
  --dr-border: #283548;
  --dr-destructive: #f87171;
  --dr-destructive-soft: #2d1a1c;
  --dr-primary-soft: #172554;
  --dr-accent-soft: #06281e;
  --dr-amber: #fbbf24;
  --dr-amber-soft: #2c2410;
  --dr-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

#view-dataroom .dr-mono { font-family: "Fira Code", ui-monospace, monospace; font-size: 12px; }
#view-dataroom .dr-muted { color: var(--dr-muted-fg); }
#view-dataroom .dr-hint { color: var(--dr-muted-fg); font-size: 12.5px; }

/* ---- Sol panel ---- */
#dr-side {
  width: 250px; flex-shrink: 0; overflow-y: auto;
  background: var(--dr-surface); border: 1px solid var(--dr-border);
  border-radius: var(--dr-radius); box-shadow: var(--dr-shadow); padding: 16px;
}
#view-dataroom .dr-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px;
  background: none; padding: 0; color: inherit; font-weight: 400;
}
.dr-stat {
  border: 1px solid var(--dr-border); border-radius: var(--dr-radius);
  padding: 10px; display: flex; flex-direction: column; gap: 2px;
  font-size: 11px; color: var(--dr-muted-fg);
}
.dr-stat:first-child { grid-column: span 2; background: var(--dr-primary-soft); border-color: transparent; }
.dr-stat-n { font-family: "Fira Code", monospace; font-size: 17px; font-weight: 600; color: var(--dr-fg); }
.dr-stat:first-child .dr-stat-n { color: var(--dr-primary); }

#view-dataroom .dr-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#dr-side h3 {
  font-family: "Fira Code", monospace; font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--dr-muted-fg); font-weight: 600;
}
#view-dataroom .dr-activity-title { margin: 22px 0 10px; }

.dr-icon-btn {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--dr-border);
  background: var(--dr-surface); color: var(--dr-muted-fg); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.dr-icon-btn:hover { border-color: var(--dr-primary); color: var(--dr-primary); }
.dr-icon-btn:focus-visible { outline: 2px solid var(--dr-primary); outline-offset: 1px; }
.dr-icon-btn.sm { width: 22px; height: 22px; border: none; }

#view-dataroom .dr-folder {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--dr-fg);
  white-space: nowrap; overflow: hidden; transition: background 0.2s, color 0.2s;
  border-left: 2px solid transparent;
}
#view-dataroom .dr-folder span { overflow: hidden; text-overflow: ellipsis; }
#view-dataroom .dr-folder svg { flex-shrink: 0; color: var(--dr-muted-fg); }
#view-dataroom .dr-folder:hover { background: var(--dr-muted); }
#view-dataroom .dr-folder.active {
  background: var(--dr-primary-soft); color: var(--dr-primary);
  border-left-color: var(--dr-primary); font-weight: 600;
}
#view-dataroom .dr-folder.active svg { color: var(--dr-primary); }
#view-dataroom .dr-folder:focus-visible { outline: 2px solid var(--dr-primary); outline-offset: 1px; }

#view-dataroom .dr-act-row {
  display: flex; flex-direction: column; gap: 1px; padding: 7px 0;
  font-size: 12px; border-bottom: 1px solid var(--dr-border);
}
#view-dataroom .dr-act-row:last-child { border-bottom: none; }
#view-dataroom .dr-act-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dr-fg); }
#view-dataroom .dr-act-text strong { font-weight: 600; }
#view-dataroom .dr-act-time { color: var(--dr-muted-fg); font-size: 11px; font-family: "Fira Code", monospace; }

/* ---- Ana alan ---- */
#dr-main {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0;
  background: var(--dr-surface); border: 1px solid var(--dr-border);
  border-radius: var(--dr-radius); box-shadow: var(--dr-shadow); padding: 18px 20px;
}
#view-dataroom .dr-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
#view-dataroom .dr-breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 16px; font-weight: 700; letter-spacing: -0.2px;
}
#view-dataroom .dr-breadcrumb a { color: var(--dr-fg); text-decoration: none; cursor: pointer; }
#view-dataroom .dr-breadcrumb a:hover { color: var(--dr-primary); }
#view-dataroom .dr-breadcrumb a:last-child { color: var(--dr-primary); }
#view-dataroom .dr-breadcrumb .sep { color: var(--dr-muted-fg); font-weight: 400; }
#view-dataroom .dr-toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.dr-search {
  display: flex; align-items: center; gap: 7px; padding: 0 12px; height: 34px;
  border: 1px solid var(--dr-border); border-radius: 6px; background: var(--dr-muted);
  color: var(--dr-muted-fg); transition: border-color 0.2s, box-shadow 0.2s; min-width: 220px;
}
.dr-search:focus-within { border-color: var(--dr-primary); box-shadow: 0 0 0 3px var(--dr-primary-soft); background: var(--dr-surface); }
.dr-search input {
  border: none; outline: none; background: none; flex: 1;
  font-size: 13px; font-family: inherit; color: var(--dr-fg);
}

.dr-select {
  height: 34px; padding: 0 10px; font-size: 12.5px; font-family: inherit;
  border: 1px solid var(--dr-border); border-radius: 6px;
  background: var(--dr-surface); color: var(--dr-fg); cursor: pointer;
}
.dr-select:focus-visible { outline: 2px solid var(--dr-primary); outline-offset: 1px; }

.dr-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  border: 1px solid var(--dr-border); border-radius: 6px;
  background: var(--dr-surface); color: var(--dr-fg);
  transition: all 0.2s; text-decoration: none;
}
.dr-btn:hover { border-color: var(--dr-primary); color: var(--dr-primary); }
.dr-btn:focus-visible { outline: 2px solid var(--dr-primary); outline-offset: 1px; }
.dr-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.dr-btn.primary { background: var(--dr-primary); border-color: var(--dr-primary); color: var(--dr-on-primary); }
.dr-btn.primary:hover { filter: brightness(1.08); color: var(--dr-on-primary); }
.dr-btn.danger { color: var(--dr-destructive); }
.dr-btn.danger:hover { background: var(--dr-destructive-soft); border-color: var(--dr-destructive); }
.dr-btn.ghost { border-color: transparent; color: var(--dr-muted-fg); }

#view-dataroom .dr-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; }
#view-dataroom .dr-chips::-webkit-scrollbar { display: none; }
.dr-chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--dr-border); background: var(--dr-surface); color: var(--dr-muted-fg);
  border-radius: 6px; padding: 5px 12px; font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: all 0.2s;
}
.dr-chip .n { font-family: "Fira Code", monospace; font-size: 11px; opacity: 0.8; }
.dr-chip:hover { border-color: var(--dr-primary); color: var(--dr-primary); }
.dr-chip.active { background: var(--dr-fg); border-color: var(--dr-fg); color: var(--dr-bg); }

#view-dataroom .dr-bulkbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: var(--dr-primary-soft); border: 1px solid var(--dr-primary);
  border-radius: 6px; margin-bottom: 10px;
  font-size: 13px; font-weight: 600; color: var(--dr-primary);
}

#view-dataroom .dr-empty { text-align: center; color: var(--dr-muted-fg); padding: 80px 20px; font-size: 14px; }

/* ---- Tablo ---- */
#dataroom-list { flex: 1; overflow: auto; }
.dr-table { width: 100%; border-collapse: collapse; }
.dr-table th {
  font-family: "Fira Code", monospace; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--dr-muted-fg); font-weight: 600;
  text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--dr-border);
  position: sticky; top: 0; background: var(--dr-surface); z-index: 1;
}
.dr-table td { padding: 10px; border-bottom: 1px solid var(--dr-border); font-size: 13.5px; vertical-align: middle; }
.dr-table tbody tr { cursor: pointer; transition: background 0.15s; }
.dr-table tbody tr:hover { background: var(--dr-muted); }
.dr-table tbody tr.active { background: var(--dr-primary-soft); box-shadow: inset 2px 0 0 var(--dr-primary); }
.dr-table .w-check { width: 34px; }
.dr-table .w-star { width: 34px; }
.dr-table .w-num { text-align: right; white-space: nowrap; }
.dr-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--dr-primary); cursor: pointer; }

.dr-star {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--dr-muted-fg); opacity: 0.5; transition: all 0.2s; border-radius: 4px;
}
.dr-star:hover { opacity: 1; color: var(--dr-amber); }
.dr-star.on { opacity: 1; color: var(--dr-amber); }
.dr-star:focus-visible { outline: 2px solid var(--dr-primary); }

.dr-file-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dr-file-icon {
  width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.dr-ic-pdf { background: var(--dr-destructive-soft); color: var(--dr-destructive); }
.dr-ic-sheet { background: var(--dr-accent-soft); color: var(--dr-accent); }
.dr-ic-doc { background: var(--dr-primary-soft); color: var(--dr-primary); }
.dr-ic-image { background: var(--dr-amber-soft); color: var(--dr-amber); }
.dr-ic-other { background: var(--dr-muted); color: var(--dr-muted-fg); }

.dr-file-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dr-file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-file-sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 11.5px; }
.dr-shared { display: inline-flex; align-items: center; gap: 4px; color: var(--dr-accent); font-weight: 600; }
.dr-tag {
  background: var(--dr-amber-soft); color: var(--dr-amber);
  padding: 1px 7px; border-radius: 4px; font-weight: 600;
  font-family: "Fira Code", monospace; font-size: 10.5px;
}
.dr-note-preview { color: var(--dr-muted-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* ---- İçerik arama + AI belge analizi ---- */
.dr-doctype {
  background: var(--dr-accent-soft); color: var(--dr-accent);
  padding: 1px 7px; border-radius: 4px; font-weight: 600;
  font-family: "Fira Code", monospace; font-size: 10.5px; text-transform: uppercase;
}
.dr-amount { color: var(--dr-accent); font-weight: 650; font-family: "Fira Code", monospace; font-size: 11px; }
.dr-amount.lg { font-size: 14px; margin: 6px 0; }
.dr-snippet {
  display: block; margin-top: 3px; font-size: 11.5px; color: var(--dr-muted-fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 520px;
}
.dr-snippet mark {
  background: var(--dr-amber-soft); color: var(--dr-amber);
  border-radius: 3px; padding: 0 2px; font-weight: 650;
}
.dr-ai-box { display: flex; flex-direction: column; gap: 6px; }
.dr-ai-box p { font-size: 12.5px; line-height: 1.5; color: var(--dr-fg); margin: 0; }
.dr-ai-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- Sağ panel (inspector) ---- */
#dr-inspector {
  width: 330px; flex-shrink: 0; overflow-y: auto;
  background: var(--dr-surface); border: 1px solid var(--dr-border);
  border-radius: var(--dr-radius); box-shadow: var(--dr-shadow); padding: 18px;
  display: flex; flex-direction: column; gap: 18px;
}
.dr-insp-head { display: flex; gap: 10px; align-items: flex-start; }
.dr-insp-head .dr-file-icon { width: 38px; height: 38px; }
.dr-insp-title { flex: 1; min-width: 0; }
.dr-insp-title h3 { font-size: 14.5px; font-weight: 700; word-break: break-word; line-height: 1.35; }
.dr-insp-title .dr-muted { font-size: 11.5px; }

.dr-insp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dr-insp-actions .dr-btn { justify-content: center; height: 32px; font-size: 12.5px; }
.dr-insp-actions .dr-btn.danger { grid-column: span 2; }

.dr-insp-section { border-top: 1px solid var(--dr-border); padding-top: 14px; }
.dr-insp-section h4 {
  font-family: "Fira Code", monospace; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--dr-muted-fg); font-weight: 600; margin-bottom: 10px;
}
.dr-insp-section textarea, .dr-insp-section input:not([type="checkbox"]) {
  width: 100%; padding: 8px 10px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--dr-border); border-radius: 6px;
  background: var(--dr-muted); color: var(--dr-fg); margin-bottom: 8px; resize: vertical;
}
.dr-insp-section textarea:focus, .dr-insp-section input:focus {
  outline: none; border-color: var(--dr-primary); box-shadow: 0 0 0 3px var(--dr-primary-soft);
  background: var(--dr-surface);
}
.dr-insp-row { display: flex; gap: 8px; margin-top: 8px; }
.dr-insp-row .dr-select { flex: 1; }
.dr-share-live { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }

.dr-notes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; max-height: 260px; overflow-y: auto; }
.dr-note { background: var(--dr-muted); border-radius: 6px; padding: 9px 11px; }
.dr-note-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 11px; color: var(--dr-muted-fg); }
.dr-note-author { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--dr-fg); }
.dr-note-time { display: inline-flex; align-items: center; gap: 4px; flex: 1; font-family: "Fira Code", monospace; }
.dr-note-body { font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.dr-note-form input[readonly] { opacity: 0.7; font-size: 12px; }

/* Erişilebilirlik: hareket azaltma */
@media (prefers-reduced-motion: reduce) {
  #view-dataroom * { transition: none !important; }
}

/* Dar ekran: inspector tam genişlik üstte, sol panel gizlenir */
@media (max-width: 1100px) {
  #dr-side { display: none; }
  #dr-inspector { width: 280px; }
}

/* ---- Toplu Mail ---- */
.step-num {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800;
}
.bulk-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 30px 20px; border: 2px dashed var(--border); border-radius: 14px;
  background: var(--panel-2); cursor: pointer; color: var(--muted);
  transition: border-color .18s, background .18s;
}
.bulk-drop:hover, .bulk-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.bulk-drop b { color: var(--text); font-size: 14.5px; }
.bulk-drop span { font-size: 12.5px; }
.bulk-drop svg { color: var(--accent); }
.bulk-fileinfo {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px;
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2);
}
.bulk-fi-name { font-weight: 650; font-size: 13.5px; }
.bulk-fi-stat { font-size: 12.5px; color: var(--muted); }
.bulk-fi-stat b { color: var(--text); }
.bulk-fi-stat.ok b { color: var(--green); }
.bulk-fi-stat.warn b { color: #d97706; }
.pill.mini { margin-left: auto; padding: 5px 12px; font-size: 12px; }
.bulk-table-wrap { margin-top: 14px; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.bulk-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bulk-table th, .bulk-table td {
  padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.bulk-table th { background: var(--panel-2); font-weight: 700; font-size: 11.5px; color: var(--muted); }
.bulk-table tbody tr:last-child td { border-bottom: none; }
.bulk-label { display: block; margin-top: 14px; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.bulk-label input, .bulk-label textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 13px; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--text); font-family: inherit; resize: vertical;
}
.bulk-label input:focus, .bulk-label textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.bulk-chips-row { display: flex; align-items: center; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.bulk-chips-label { font-size: 12px; color: var(--muted); }
.bulk-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.bulk-chip {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--accent-text);
  border-radius: 999px; padding: 4px 11px; font-size: 12px; font-family: "Fira Code", monospace;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.bulk-chip:hover { background: var(--accent-soft); border-color: var(--accent); }
.bulk-opts { display: flex; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.chk-inline { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.bulk-prev-mail {
  margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel);
}
.bulk-prev-head { padding: 11px 14px; background: var(--panel-2); border-bottom: 1px solid var(--border); }
.bulk-prev-to { display: block; font-size: 11.5px; color: var(--muted); }
.bulk-prev-sub { display: block; font-weight: 700; font-size: 14px; margin-top: 3px; }
.bulk-prev-body { padding: 14px; font-size: 13.5px; line-height: 1.6; }
.bulk-send-row { display: flex; gap: 10px; margin: 12px 0 16px; flex-wrap: wrap; }
.bulk-send-row input {
  flex: 1; min-width: 200px; padding: 10px 13px; font-size: 13.5px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text);
}
.bulk-go { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.bulk-bar { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin-top: 18px; }
.bulk-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); transition: width .25s; }
.bulk-stats { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; font-weight: 650; }
.bulk-stats .ok { color: var(--green); }
.bulk-stats .bad { color: var(--red); }
.bulk-stats .muted { color: var(--muted); }
.bulk-log {
  margin-top: 12px; max-height: 260px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2);
}
.bulk-log-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
.bulk-log-row:last-child { border-bottom: none; }
.bulk-log-row.ok > span:first-child { color: var(--green); }
.bulk-log-row.bad > span:first-child { color: var(--red); }
.bulk-log-row.muted { color: var(--muted); }
.bulk-log-row em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--red); }

/* ---- Yapay zekâ sağlayıcı seçimi ---- */
.ai-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.ai-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2);
  transition: border-color .18s, background .18s;
}
.ai-row.sel { border-color: var(--accent); background: var(--accent-soft); }
.ai-row.off { opacity: .55; }
.ai-row.auto { border-style: dashed; }
.ai-pick { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ai-pick input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.ai-name { font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.ai-live {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #fff; background: var(--green, #16a34a); border-radius: 999px; padding: 2px 8px;
}
.ai-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding-left: 26px; }
.ai-meta code { font-family: "Fira Code", monospace; font-size: 11.5px; color: var(--muted); }
.ai-stats { font-size: 11.5px; color: var(--muted); }
.ai-stats.warn { color: #d97706; }
.ai-err { font-size: 11px; color: var(--red); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-row .ai-test { grid-row: 1; grid-column: 2; }

/* ================= Donna — asistan ================= */
.donna-btn {
  display: flex; align-items: center; gap: 8px; position: relative;
  padding: 5px 13px 5px 5px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); color: var(--text); cursor: pointer; font-weight: 650; font-size: 13px;
  transition: border-color .18s, box-shadow .18s, transform .12s;
}
.donna-btn:hover { border-color: var(--accent); box-shadow: 0 4px 14px -6px var(--accent); }
.donna-btn:active { transform: translateY(1px); }
.donna-ava {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .5px;
  background: linear-gradient(135deg, #8b5cf6, var(--accent));
}
.donna-ava.lg { width: 38px; height: 38px; font-size: 16px; border-radius: 13px; }
.donna-dot {
  position: absolute; top: 3px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--panel);
}
@media (max-width: 860px) { .donna-btn-label { display: none; } .donna-btn { padding: 5px; } }

.donna-scrim {
  position: fixed; inset: 0; z-index: 380; background: rgba(15, 23, 42, .35);
  backdrop-filter: blur(2px);
}
.donna-scrim[hidden] { display: none; }

.donna-panel {
  position: fixed; top: 0; right: 0; z-index: 390;
  width: min(420px, 100vw); height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--border);
  box-shadow: -18px 0 46px -22px rgba(15, 23, 42, .5);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.22, .7, .2, 1);
}
.donna-panel.open { transform: none; }
@media (prefers-reduced-motion: reduce) { .donna-panel { transition: none; } }

.donna-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px; border-bottom: 1px solid var(--border); background: var(--panel-2);
}
.donna-id { display: flex; align-items: center; gap: 11px; }
.donna-id b { display: block; font-size: 15px; font-weight: 750; letter-spacing: -.2px; }
.donna-id span#donna-sub { font-size: 11.5px; color: var(--muted); }
.donna-head-actions { display: flex; gap: 4px; }

.donna-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.donna-loading, .donna-msg.thinking { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.donna-loading span, .donna-msg.thinking span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: block;
  animation: dbnc 1s infinite;
}
.donna-loading span:nth-child(2), .donna-msg.thinking span:nth-child(2) { animation-delay: .15s; }
.donna-loading span:nth-child(3), .donna-msg.thinking span:nth-child(3) { animation-delay: .3s; }
@keyframes dbnc { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-4px); opacity: 1; } }

.donna-brief { display: flex; flex-direction: column; gap: 10px; }
.donna-greet { font-size: 18px; font-weight: 780; letter-spacing: -.3px; }
.donna-headline { font-size: 14px; color: var(--muted); line-height: 1.5; }
.donna-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.donna-stats span {
  font-size: 11.5px; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px;
}
.donna-stats b { color: var(--text); font-weight: 750; }
.donna-items { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.donna-item {
  display: flex; align-items: flex-start; gap: 11px; width: 100%; text-align: left;
  padding: 11px 12px; border: 1px solid var(--border); border-left-width: 3px;
  border-radius: 11px; background: var(--panel-2); cursor: pointer; color: var(--text);
  transition: transform .14s, box-shadow .18s, background .18s;
}
.donna-item:hover { transform: translateX(-2px); box-shadow: var(--shadow); background: var(--panel); }
.donna-item.u-high { border-left-color: var(--red); }
.donna-item.u-mid { border-left-color: var(--accent); }
.donna-item.u-low { border-left-color: var(--border); }
.di-ico { font-size: 15px; line-height: 1.3; }
.di-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.di-main b { font-size: 13.5px; font-weight: 700; }
.di-main span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.di-go { color: var(--muted); font-size: 15px; align-self: center; }
.donna-calm { font-size: 13.5px; color: var(--muted); padding: 14px 0; }
.donna-err { padding: 8px 0; }

.donna-msg { max-width: 92%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; }
.donna-msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.donna-msg.her { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.donna-msg.err { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.donna-srcs { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.donna-src {
  text-align: left; font-size: 11.5px; color: var(--accent-text); background: var(--accent-soft);
  border: none; border-radius: 8px; padding: 5px 9px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.donna-src:hover { filter: brightness(.97); }

.donna-conv-list { display: flex; flex-direction: column; gap: 6px; }
.donna-conv-new {
  text-align: left; font-size: 13px; font-weight: 650; color: var(--accent-text);
  background: var(--accent-soft); border: 1px dashed var(--accent); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; margin-bottom: 4px; font-family: inherit;
}
.donna-conv-new:hover { filter: brightness(.97); }
.donna-conv-row {
  display: flex; align-items: center; gap: 4px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--panel-2); transition: border-color .15s;
}
.donna-conv-row:hover, .donna-conv-row.active { border-color: var(--accent); }
.donna-conv-open {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 9px 11px; border: none; background: transparent; color: var(--text); cursor: pointer;
  font-family: inherit;
}
.donna-conv-open b {
  font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.donna-conv-open span {
  font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.donna-conv-row .icon-btn { flex-shrink: 0; width: 26px; height: 26px; margin-right: 4px; }
.donna-mem-row .donna-conv-open { cursor: default; }
.donna-mem-row .donna-conv-open span {
  font-size: 12.5px; color: var(--text); white-space: normal; overflow: visible;
}
.donna-conv-rename-input {
  width: 100%; padding: 3px 6px; border: 1px solid var(--accent); border-radius: 6px;
  background: var(--panel); color: var(--text); font-size: 12.5px; font-family: inherit;
}

.donna-compose { border-top: 1px solid var(--border); padding: 11px 14px calc(14px + env(safe-area-inset-bottom)); background: var(--panel-2); }
.donna-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.donna-chip {
  font-size: 11.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 11px; cursor: pointer;
}
.donna-chip:hover { border-color: var(--accent); color: var(--accent-text); }
.donna-inputrow { display: flex; gap: 8px; align-items: center; }
.donna-inputrow input {
  flex: 1; padding: 11px 14px; font-size: 13.5px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--panel); color: var(--text);
}
.donna-inputrow input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.donna-send {
  width: 38px; height: 38px; flex-shrink: 0; border: none; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #8b5cf6, var(--accent));
}
.donna-send:disabled { opacity: .5; cursor: default; }

/* Donna — işlem onay kartı */
.donna-action {
  align-self: stretch; display: flex; flex-direction: column; gap: 8px;
  padding: 13px; border: 1px solid var(--accent); border-radius: 13px;
  background: var(--accent-soft);
}
.donna-action.danger { border-color: var(--red); background: var(--red-soft); }
.donna-action.done { border-style: dashed; opacity: .8; }
.da-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.da-head b { font-weight: 750; }
.da-sum { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.da-line { font-size: 12.5px; color: var(--text); }
.da-line code { font-family: "Fira Code", monospace; font-size: 11.5px; word-break: break-all; }
.da-input {
  width: 100%; padding: 9px 11px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 9px; background: var(--panel); color: var(--text);
}
.da-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.da-text { resize: vertical; line-height: 1.5; }
.da-row { display: flex; gap: 6px; }
.da-row .da-input { flex: 1; min-width: 0; }
.da-row .da-dur { max-width: 82px; }
.da-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.da-btns .pill { padding: 7px 15px; font-size: 13px; }
.da-btns .pill.danger { background: var(--red); color: #fff; }
.da-err { font-size: 12px; color: var(--red); font-weight: 600; }
.da-err:empty { display: none; }
.da-done { font-size: 13px; color: var(--muted); font-weight: 650; }
.da-done.ok { color: var(--green); }
.da-muted { color: var(--muted); }

/* ---- Bildirimler (otomasyon uyarıları) ---- */
.donna-notifs {
  border: 1px solid var(--accent); background: var(--accent-soft);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.dn-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 700; color: var(--text);
}
.dn-head .dn-readall {
  background: none; border: none; color: var(--accent); font-weight: 650;
  font-size: 11.5px; cursor: pointer; padding: 0;
}
.donna-notif { display: flex; align-items: flex-start; gap: 8px; }
.dn-body { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.dn-body b { font-size: 12.5px; }
.dn-body span { font-size: 12px; color: var(--muted); }
.dn-read {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--panel); color: var(--muted); cursor: pointer; font-size: 12px; line-height: 1;
}
.dn-read:hover { color: var(--accent); border-color: var(--accent); }

/* ---- Otomasyonlarım (yönetim listesi) ---- */
.donna-auto-list { display: flex; flex-direction: column; gap: 10px; }
.donna-auto-list h4 { font-size: 14px; font-weight: 750; margin: 0; }
.link-btn {
  align-self: flex-start; background: none; border: none; color: var(--accent);
  font-size: 12.5px; font-weight: 650; cursor: pointer; padding: 0;
}
.donna-auto {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel-2);
}
.donna-auto.paused { opacity: 0.6; }
.da2-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.da2-main b { font-size: 13px; }
.da2-main span { font-size: 12px; color: var(--muted); }
.da2-btns { display: flex; gap: 6px; flex-shrink: 0; }
.pill.sm { padding: 5px 11px; font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   POSTA — yeniden tasarım
   Liste: tarama için yoğun ve sakin. Detay: mesaj gövdesi kahraman,
   yanıt aşağıda sabit. Yerleşim taşmalarına karşı her satır kilitli.
   ═══════════════════════════════════════════════════════════════ */

/* ---------- Liste başlığı ---------- */
.panel-header { padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.lp-top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; min-width: 0; }
.lp-top h2 { font-size: 16.5px; font-weight: 750; letter-spacing: -0.3px; flex-shrink: 0; }
.lp-count {
  font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.lp-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.btn-compose {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 7px 14px; border: none; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 650; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: 0 4px 12px -4px var(--accent); transition: transform .12s, box-shadow .2s;
}
.btn-compose:hover { box-shadow: 0 7px 18px -5px var(--accent); transform: translateY(-1px); }
.btn-compose:active { transform: translateY(0); }

.lp-filters { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lp-select {
  flex-shrink: 0; max-width: 120px; border: 1px solid var(--border); background: var(--panel-2);
  color: var(--muted); border-radius: 7px; padding: 5px 8px; font-size: 11.5px;
  font-family: inherit; cursor: pointer;
}
.lp-select:focus { outline: none; border-color: var(--accent); }
.lp-filters .chips { flex: 1; min-width: 0; padding-bottom: 0; }

/* ---------- Liste satırları ---------- */
#email-list { flex: 1; overflow-y: auto; padding: 6px 8px 14px; }
.email-item {
  position: relative; display: flex; gap: 11px; align-items: flex-start;
  padding: 11px 12px 11px 13px; margin-bottom: 3px;
  border: 1px solid transparent; border-left: 3px solid transparent;
  border-radius: 10px; cursor: pointer;
  transition: background .13s, border-color .13s;
}
.email-item::after { content: none; }
.email-item:hover { background: var(--panel-2); }
.email-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.email-item.unread { background: var(--panel); border-left-color: var(--accent); }
.email-item.unread:hover { background: var(--panel-2); }
.email-item.unread .from { font-weight: 800; }
.email-item.unread .subject { font-weight: 700; color: var(--text); }
.email-item.prio { border-left-color: var(--red); }
.email-item.active {
  background: var(--accent-soft); border-color: var(--accent); border-left-color: var(--accent);
}
.email-item .item-body { flex: 1; min-width: 0; }
.email-item .row1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.email-item .from {
  font-weight: 650; font-size: 13.5px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.email-item .time {
  font-size: 11px; color: var(--muted); flex-shrink: 0;
  font-variant-numeric: tabular-nums; transition: opacity .13s;
}
.email-item .subject {
  font-size: 13px; margin-top: 2px; color: var(--text); font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.email-item .summary {
  font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Rozetler asla taşmaz: tek satır + kenarda yumuşak kesme */
.email-item .meta {
  display: flex; gap: 5px; margin-top: 7px; align-items: center;
  flex-wrap: nowrap; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
          mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.email-item .meta > * { flex-shrink: 0; }

/* Hover'da hızlı eylemler tarihin yerini alır (Gmail davranışı) */
.item-tools {
  position: absolute; top: 8px; right: 10px; display: flex; gap: 2px;
  opacity: 0; pointer-events: none; transition: opacity .13s;
  background: linear-gradient(90deg, transparent, var(--panel-2) 22%);
  padding-left: 14px; border-radius: 8px;
}
.email-item:hover .item-tools,
.email-item:focus-within .item-tools { opacity: 1; pointer-events: auto; }
.email-item:hover .time { opacity: 0; }
.email-item .star-btn.on { opacity: 1; }
.email-item:not(:hover) .star-btn.on { position: absolute; top: 10px; right: 10px; opacity: 1; }
.quick-btn, .item-tools .star-btn {
  border: none; background: var(--panel); color: var(--muted); cursor: pointer;
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  opacity: 1; padding: 0; transition: background .13s, color .13s;
}
.quick-btn:hover { background: var(--accent-soft); color: var(--accent-text); }
.item-tools .star-btn:hover { background: var(--amber-soft); color: var(--amber); }
.item-tools .star-btn.on { color: var(--amber); }

/* ---------- Detay: gerçek mail görünümü ---------- */
#detail-panel {
  flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
#detail-panel > .placeholder { margin: auto; }

.mv-head { padding: 20px 26px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mv-title-row { display: flex; align-items: flex-start; gap: 14px; }
.mv-subject {
  flex: 1; min-width: 0; font-size: 20px; font-weight: 750;
  letter-spacing: -0.3px; line-height: 1.35; word-break: break-word;
}
.mv-tools { display: flex; gap: 3px; flex-shrink: 0; }
.detail-back { display: none; flex-shrink: 0; }
.mv-from { display: flex; align-items: center; gap: 11px; margin-top: 14px; min-width: 0; }
.mv-from .avatar { width: 34px; height: 34px; border-radius: 50%; font-size: 12.5px; }
.mv-who { flex: 1; min-width: 0; }
.mv-name {
  font-size: 13.5px; font-weight: 700; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.mv-addr { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.mv-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.mv-sub .badge { margin-left: 2px; }
.mv-tags { display: flex; gap: 5px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; max-width: 45%; }

.mv-scroll { flex: 1; overflow-y: auto; padding: 20px 26px 28px; }

/* AI özeti — kart değil, ince bir vurgu şeridi */
.mv-ai {
  display: flex; gap: 11px; align-items: flex-start; margin-bottom: 20px;
  padding: 12px 15px; border-radius: 11px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
}
.mv-ai-ico { color: var(--accent-text); flex-shrink: 0; line-height: 1; margin-top: 1px; }
.mv-ai-text { min-width: 0; }
.mv-ai-text p { font-size: 13.5px; line-height: 1.55; color: var(--text); }
.mv-ai-more {
  margin-top: 8px; border: none; background: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 650; color: var(--accent-text);
  text-decoration: underline; text-underline-offset: 3px;
}

/* Ekler — sohbet uygulamalarındaki gibi dosya çipleri */
.mv-attach { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.mv-file {
  display: inline-flex; align-items: center; gap: 8px; max-width: 260px;
  padding: 8px 13px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel-2); text-decoration: none; color: var(--text);
  font-size: 12.5px; transition: border-color .15s, background .15s;
}
.mv-file:hover { border-color: var(--accent); background: var(--accent-soft); }
.mv-file-ico { color: var(--muted); flex-shrink: 0; line-height: 1; }
.mv-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mv-file-size { color: var(--muted); font-size: 11px; flex-shrink: 0; }

/* Mesaj gövdesi — sayfanın kahramanı */
.mail-body {
  font-size: 14.5px; line-height: 1.72; color: var(--text);
  max-width: 68ch; word-break: break-word;
}
.mail-body .mb-main { white-space: pre-wrap; }
.mail-body a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.mail-body a:hover { text-decoration-thickness: 2px; }
.mail-empty { color: var(--muted); font-style: italic; }
.mb-quote { margin-top: 18px; }
.mb-quote summary {
  cursor: pointer; font-size: 12px; color: var(--muted); font-weight: 600;
  list-style: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel-2);
}
.mb-quote summary::-webkit-details-marker { display: none; }
.mb-quote summary:hover { border-color: var(--accent); color: var(--accent-text); }
.mb-quote-body {
  white-space: pre-wrap; margin-top: 12px; padding-left: 14px;
  border-left: 3px solid var(--border); color: var(--muted); font-size: 13.5px; line-height: 1.6;
}

/* Yazışma dizisi — katlanabilir mesajlar */
.mv-thread { display: flex; flex-direction: column; gap: 8px; }
.tm { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--panel); }
.tm.mine { background: var(--panel-2); }
.tm-head {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px; cursor: pointer;
  min-width: 0; transition: background .13s;
}
.tm-head:hover { background: var(--panel-2); }
.tm-head .avatar { width: 30px; height: 30px; border-radius: 50%; font-size: 11.5px; }
.tm-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.tm-from { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-snippet { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm.open .tm-snippet { display: none; }
.tm-time { font-size: 11px; color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.tm-caret { color: var(--muted); flex-shrink: 0; display: flex; transition: transform .2s; }
.tm.open .tm-caret { transform: rotate(180deg); }
.tm-body { display: none; padding: 4px 16px 16px; border-top: 1px solid var(--border); }
.tm.open .tm-body { display: block; }
.tm-body .mail-body { padding-top: 12px; }

/* Yanıt alanı — aşağıda sabit, açılınca büyüyen */
.mv-reply { flex-shrink: 0; border-top: 1px solid var(--border); background: var(--panel-2); }
.mvr-collapsed { display: flex; align-items: center; gap: 12px; padding: 12px 26px; min-width: 0; }
.mvr-open {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 9px 18px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); color: var(--text); cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 650;
  transition: border-color .15s, box-shadow .2s, transform .12s;
}
.mvr-open:hover { border-color: var(--accent); color: var(--accent-text); box-shadow: 0 4px 12px -6px var(--accent); }
.mvr-open:active { transform: translateY(1px); }
.mvr-note {
  font-size: 12px; color: var(--muted); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.mv-reply.sent .mvr-note { color: var(--green); font-weight: 600; }
.mvr-form { padding: 14px 26px 18px; display: flex; flex-direction: column; gap: 10px; }
.mvr-to { font-size: 12px; color: var(--muted); }
.mvr-to b { color: var(--text); }
.mvr-form textarea {
  width: 100%; min-height: 130px; max-height: 40vh; resize: vertical;
  padding: 13px 15px; font-family: inherit; font-size: 14px; line-height: 1.6;
  border: 1px solid var(--border); border-radius: 11px; background: var(--panel); color: var(--text);
}
.mvr-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mvr-instr { display: flex; gap: 8px; }
.mvr-instr input {
  flex: 1; min-width: 0; padding: 9px 14px; font-size: 12.5px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text);
}
.mvr-instr input:focus { outline: none; border-color: var(--accent); }
.mvr-instr .pill { flex-shrink: 0; padding: 8px 13px; }
.mvr-await {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted);
  cursor: pointer; user-select: none;
}
.mvr-await input[type="checkbox"] { width: auto; flex: 0 0 auto; }
.mvr-await input[type="number"] {
  width: 46px; flex: 0 0 auto; padding: 3px 6px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--panel); color: var(--text); font-size: 12.5px;
  font-family: inherit; text-align: center;
}
/* Eylem satırı asla sarmalanmaz: gönder sağda sabit, diğerleri solda */
.mvr-actions { display: flex; gap: 8px; align-items: center; }
.mvr-actions .pill { flex-shrink: 0; padding: 9px 16px; font-size: 13px; }
.mvr-actions #send-btn { margin-left: auto; }

/* Dar ekran: detay panelini tam genişliğe al */
@media (max-width: 1000px) {
  .mv-head, .mv-scroll, .mvr-collapsed, .mvr-form { padding-left: 16px; padding-right: 16px; }
  .mv-tags { display: none; }
  .mail-body { max-width: none; }
}

/* [hidden] özniteliği, display kuralları tarafından ezilmemeli */
.mvr-form[hidden], .mvr-collapsed[hidden], .donna-panel[hidden] { display: none !important; }

/* Tespit edilen etkinlik — yeni tasarım diline uygun */
.mv-scroll .event-card {
  background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 11px; padding: 14px 16px; margin-bottom: 20px;
}
.mv-scroll .event-card h3 { margin-bottom: 8px; }
.mv-scroll .event-card .ev-line { font-size: 13.5px; line-height: 1.5; }
.mv-scroll .event-card .ev-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.mv-scroll .event-card select {
  padding: 7px 11px; font-size: 12.5px; font-family: inherit; border: 1px solid var(--border);
  border-radius: 8px; background: var(--panel); color: var(--text); max-width: 190px;
}

/* ---------- Posta: duyarlı yerleşim ---------- */
/* Orta genişlik: liste daralır, detay nefes alır */
@media (max-width: 1180px) {
  #list-panel { width: 330px; }
}
@media (max-width: 1000px) {
  #list-panel { width: 290px; }
  .email-item .summary { -webkit-line-clamp: 1; }
  .mv-subject { font-size: 18px; }
}
/* Dar ekran: üst üste yığ — liste üstte, mail altta */
@media (max-width: 820px) {
  #view-inbox { flex-direction: column; }
  #list-panel { width: auto; max-height: 42vh; }
  #detail-panel { min-height: 320px; }
  .lp-filters { flex-wrap: wrap; }
}
/* Yanıt alanı açıkken bile gövde için yer kalsın */
.mv-reply.expanded { max-height: 62%; overflow-y: auto; }
.mvr-form textarea { min-height: 110px; }

/* ---- Toplu mail: sekmeler + gönderim geçmişi ---- */
.bulk-tabs {
  display: flex; gap: 4px; margin: 4px 0 18px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px; width: fit-content; max-width: 100%;
}
.bulk-tab {
  display: inline-flex; align-items: center; gap: 7px; border: none; background: none;
  padding: 8px 16px; border-radius: 7px; cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 640; color: var(--muted); white-space: nowrap;
  transition: background .15s, color .15s;
}
.bulk-tab:hover { color: var(--text); }
.bulk-tab.active { background: var(--panel); color: var(--accent-text); box-shadow: var(--shadow); }

.bh-search { position: relative; display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.bh-search svg { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.bh-search input {
  flex: 1; min-width: 0; padding: 11px 14px 11px 38px; font-size: 13.5px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel-2); color: var(--text);
}
.bh-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bh-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.bh-stats span {
  font-size: 12px; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px;
}
.bh-stats b { color: var(--text); font-weight: 750; }
.bh-stats .bad b { color: var(--red); }

.bh-camp {
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
  margin-bottom: 9px; overflow: hidden;
}
.bh-camp-head {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px; cursor: pointer;
  min-width: 0; transition: background .13s;
}
.bh-camp-head:hover { background: var(--panel-2); }
.bh-camp-main { flex: 1; min-width: 0; }
.bh-camp-subj {
  font-size: 13.5px; font-weight: 680; display: flex; align-items: center; gap: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bh-camp-meta {
  font-size: 11.5px; color: var(--muted); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bh-camp-nums { display: flex; gap: 9px; font-size: 12px; font-weight: 650; flex-shrink: 0; }
.bh-camp-nums .ok { color: var(--green); }
.bh-camp-nums .bad { color: var(--red); }
.bh-camp-nums .muted { color: var(--muted); }
.bh-caret { color: var(--muted); flex-shrink: 0; transition: transform .2s; font-size: 14px; }
.bh-camp.open .bh-caret { transform: rotate(180deg); }
.bh-camp-body { display: none; border-top: 1px solid var(--border); padding: 6px 8px 8px; }
.bh-camp.open .bh-camp-body { display: block; }

.bh-rcpts { max-height: 340px; overflow-y: auto; }
.bh-rcpts.search { max-height: none; }
.bh-rcpt {
  display: grid; grid-template-columns: 16px minmax(0, 1.1fr) minmax(0, 1.4fr) auto;
  gap: 10px; align-items: center; padding: 8px 10px; font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
.bh-rcpts.search .bh-rcpt { grid-template-columns: 16px minmax(0, 1fr) minmax(0, 1.2fr) auto auto; }
.bh-rcpt:last-child { border-bottom: none; }
.bh-ico { font-weight: 800; }
.bh-rcpt.ok .bh-ico { color: var(--green); }
.bh-rcpt.bad .bh-ico { color: var(--red); }
.bh-rcpt.muted .bh-ico { color: var(--muted); }
.bh-mail { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-subj, .bh-from { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bh-time { color: var(--muted); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bh-err { color: var(--red); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .bh-rcpt, .bh-rcpts.search .bh-rcpt { grid-template-columns: 16px 1fr auto; }
  .bh-subj, .bh-from { display: none; }
}

/* ---- Görevler (Tasks) ---- */

.tasks-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 6px; }
.tasks-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.tasks-status-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tasks-status-chips .chip .vn { opacity: 0.7; font-weight: 500; margin-left: 3px; }
.tasks-filters { display: flex; align-items: center; gap: 10px; }
.tasks-search { position: relative; display: flex; align-items: center; }
.tasks-search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.tasks-search input {
  width: 240px; padding: 8px 12px 8px 34px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--panel); color: var(--text);
  font-size: 13px; font-family: inherit;
}
.tasks-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.task-list { display: flex; flex-direction: column; gap: 10px; }

.task-card {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.task-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.task-card.tk-done { opacity: 0.62; }
.task-card.tk-done .tk-title { text-decoration: line-through; }
.task-card.tk-cancelled { opacity: 0.5; }
.task-card.tk-cancelled .tk-title { text-decoration: line-through; }

.tk-checkbox {
  flex-shrink: 0; width: 21px; height: 21px; margin-top: 2px; border-radius: 50%;
  border: 1.6px solid var(--border); background: var(--panel); cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
  padding: 0; transition: all 0.15s;
}
.tk-checkbox:hover { border-color: var(--accent); }
.tk-checkbox.checked { background: var(--green); border-color: var(--green); }

.tk-body { flex: 1; min-width: 0; }
.tk-title-row { display: flex; align-items: center; gap: 10px; }
.tk-title { font-weight: 650; font-size: 14.5px; }
.tk-priority {
  flex-shrink: 0; margin-left: auto; font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.02em;
}
.tk-pri-dusuk { background: var(--panel-2); color: var(--muted); }
.tk-pri-orta { background: var(--accent-soft); color: var(--accent-text); }
.tk-pri-yuksek { background: var(--amber-soft); color: var(--amber); }
.tk-pri-acil { background: var(--red-soft); color: var(--red); }

.tk-desc {
  color: var(--muted); font-size: 12.5px; margin-top: 4px; line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tk-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.tk-due, .tk-assignee, .tk-tag, .tk-link {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px;
  padding: 3px 8px; border-radius: 6px; background: var(--panel-2); color: var(--muted);
}
.tk-due.tk-today { background: var(--amber-soft); color: var(--amber); }
.tk-due.tk-overdue { background: var(--red-soft); color: var(--red); }
.tk-assignee { background: var(--accent-soft); color: var(--accent-text); }
.tk-tag { background: var(--panel-2); }
.tk-link { background: var(--panel-2); }

.tk-delete { flex-shrink: 0; opacity: 0; transition: opacity 0.15s; }
.task-card:hover .tk-delete { opacity: 1; }
.tk-delete:hover { color: var(--red); }

/* Görev oluşturma/düzenleme modalı — ilişkilendirme */
.tk-link-section { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.tk-link-label { font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 8px; }
.tk-link-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tk-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent-text); font-weight: 600;
}
.tk-chip button {
  display: flex; align-items: center; justify-content: center; border: none;
  background: transparent; color: inherit; cursor: pointer; opacity: 0.7; padding: 2px;
}
.tk-chip button:hover { opacity: 1; }
.tk-link-results {
  max-height: 220px; overflow-y: auto; margin-top: 6px; display: flex;
  flex-direction: column; gap: 8px;
}
.tk-link-group-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); margin-bottom: 4px;
}
.tk-link-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--text); font-size: 12.5px; font-family: inherit;
  cursor: pointer; margin-bottom: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tk-link-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.tk-link-sub { color: var(--muted); font-size: 11px; margin-left: auto; flex-shrink: 0; }
.tk-link-empty { color: var(--muted); font-size: 12px; padding: 6px 0; }

/* ---- Bugün ---- */

.today-summary { margin-bottom: 22px; }
.today-date { color: var(--muted); font-size: 13px; margin-top: 4px; text-transform: capitalize; }
.today-brief { margin-top: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); }
.today-brief b { display: block; font-size: 14.5px; font-weight: 700; color: var(--accent-text); }
.today-brief p { margin-top: 4px; font-size: 13px; color: var(--text); line-height: 1.5; }
.today-headline.muted { margin-top: 12px; font-size: 13px; color: var(--muted); }

.today-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.today-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
  padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.today-card h3 { font-size: 13.5px; font-weight: 700; }
.today-card-head { display: flex; align-items: center; justify-content: space-between; }
.today-card-head h3 { margin: 0; }
.today-card-body { display: flex; flex-direction: column; gap: 8px; }
.today-empty { font-size: 12.5px; color: var(--muted); padding: 4px 0; }

.today-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--panel-2);
}
.today-row[data-open-task], .today-row [data-open-reminder] { cursor: pointer; }
.today-row-time {
  flex-shrink: 0; font-size: 11px; color: var(--muted); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.today-row-time.tk-overdue { color: var(--red); }
.today-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.today-row-main b {
  font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.today-row-main span {
  font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.today-row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.today-row-actions .icon-btn { width: 26px; height: 26px; }
.today-row .tk-checkbox { width: 18px; height: 18px; flex-shrink: 0; }
.today-row .tk-priority { flex-shrink: 0; }

.today-cta {
  width: 100%; text-align: left; padding: 12px 14px; border: 1px dashed var(--accent);
  border-radius: 10px; background: var(--accent-soft); color: var(--accent-text);
  font-size: 13px; font-family: inherit; cursor: pointer;
}
.today-cta b { font-size: 15px; }
.today-cta:hover { filter: brightness(.97); }

/* ============================================================
   MOBİL KABUK — telefon genişliğinde tam uygulama düzeni
   Rail → alt sekme çubuğu, Posta/Dataroom → tek panelli gezinme
   ============================================================ */

button, .rail-btn, .chip, .view-tab, .icon-btn, .pill, .dr-btn, .dr-icon-btn {
  touch-action: manipulation;
}
#modal-overlay, .donna-panel, #dr-inspector, #gs-overlay {
  overscroll-behavior: contain;
}

@media (max-width: 680px) {
  html { color-scheme: light dark; }

  /* ---- Üst bar ---- */
  #topbar {
    height: auto; min-height: 52px; flex-wrap: wrap; row-gap: 8px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  }
  .brand-name { display: none; }
  .brand { min-width: 0; }
  .topbar-search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .topbar-right { min-width: 0; }
  #sync-btn span { display: none; }
  #sync-btn { padding: 9px; }

  /* ---- Ana yerleşim + alt sekme çubuğu ---- */
  #layout {
    flex-direction: column; padding: 0;
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
  }
  #rail {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
    width: auto; flex-direction: row; justify-content: space-around;
    background: var(--panel); border-top: 1px solid var(--border);
    padding: 6px 2px calc(4px + env(safe-area-inset-bottom));
    gap: 0; box-shadow: 0 -2px 12px rgba(15, 23, 42, .06);
  }
  .rail-btn { flex: 1; min-width: 0; padding: 2px 0; }
  .rail-tile { width: 100%; max-width: 46px; height: 34px; border-radius: 10px; margin: 0 auto; }
  .rail-label { font-size: 9.5px; }
  .rail-badge { top: -2px; right: 18%; }

  /* Sadece çok panelli görünümler dikeyde yığılır (tek panelli "page" görünümleri
     satır/sütun yönünden etkilenmez, bu yüzden genele değil, tek tek uygulanır). */
  #view-inbox, #view-dataroom, #view-calendar { flex-direction: column; }

  /* ---- Takvim: yan panel altta akar, sabit flex:1 yükseklik yerine doğal akış ---- */
  #cal-main, #cal-side { flex: none; width: auto; }
  #view-calendar { overflow-y: auto; }
  #cal-main { overflow: visible; }

  /* ---- Posta: tek panelli gezinme ---- */
  #list-panel { width: auto; max-height: none; border-radius: 0; border-width: 0; box-shadow: none; }
  #detail-panel {
    display: none; position: fixed; inset: 0; z-index: 300; border-radius: 0; border-width: 0;
    padding: calc(16px + env(safe-area-inset-top)) 0 calc(16px + env(safe-area-inset-bottom));
  }
  #view-inbox.mail-detail-open #list-panel { display: none; }
  #view-inbox.mail-detail-open #detail-panel { display: block; }
  .detail-back { display: inline-flex; }

  /* Tam ekran bir katman açıkken alt sekme çubuğu gizlenir (okurken dikkat dağıtmasın) */
  #layout:has(#view-inbox.mail-detail-open) #rail,
  #layout:has(#view-dataroom.folders-open) #rail,
  #layout:has(#view-dataroom.inspector-open) #rail {
    display: none;
  }
  body:has(.donna-panel.open) #rail { display: none; }
  body:has(#modal-overlay[style*="flex"]) #rail { display: none; }
  body:has(#auth-overlay[style*="flex"]) #rail { display: none; }
  .mv-head, .mv-scroll, .mvr-collapsed, .mvr-form { padding-left: 16px; padding-right: 16px; }

  /* ---- Dataroom: yan panel + inceleme paneli tam ekran katman ---- */
  #view-dataroom { flex-direction: column; }
  .dr-folders-toggle { display: inline-flex !important; }
  #dr-side {
    display: none; position: fixed; inset: 0; z-index: 320; width: 100%; border-radius: 0;
    padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  }
  #view-dataroom.folders-open #dr-side { display: block; }
  #dr-inspector {
    position: fixed; inset: 0; z-index: 330; border-radius: 0; width: auto;
    padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  }

  /* ---- Modallar: kenarlara daha yakın, üstten taşmasın ---- */
  #modal-overlay { padding: 12px; align-items: flex-end; }
  #modal { max-width: none; max-height: 90vh; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }

  /* ---- Genel araç çubukları: satır satır sar ---- */
  .cal-toolbar, .tasks-toolbar, .dr-toolbar-actions { flex-wrap: wrap; }
  #dr-main .dr-search { flex-basis: 100%; }

  /* ---- Formlar: iki sütun yerine tek sütun ---- */
  .form-grid { grid-template-columns: 1fr; }
}

.dr-folders-toggle { display: none; }
.dr-side-close { display: none; }
@media (max-width: 680px) { .dr-side-close { display: inline-flex; } }
