/* DijiMail Webmail — tasarım değişkenleri (müşteri paneliyle aynı dil) */
:root {
  --font: 'Inter', system-ui, sans-serif;
  --font-head: 'Outfit', var(--font);
  --bg: #0b0f19;
  --bg-2: #111827;
  --bg-3: #1f2937;
  --bg-hover: rgba(255, 255, 255, 0.04);
  --bg-active: rgba(var(--vurgu-rgb), 0.16);
  --line: rgba(255, 255, 255, 0.07);
  --text: #f3f4f6;
  --text-2: #9ca3af;
  --text-3: #6b7280;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --vurgu-rgb: 99, 102, 241;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --sidebar-w: 264px;
  --list-w: 400px;
  --frame-bg: #ffffff;
}
body.light-theme {
  --bg: #f4f5f9;
  --bg-2: #ffffff;
  --bg-3: #eef0f6;
  --bg-hover: rgba(15, 23, 42, 0.04);
  --bg-active: rgba(var(--vurgu-rgb), 0.12);
  --line: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--primary); text-decoration: none; }
[hidden] { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.spacer { flex: 1; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 8px; }

/* Düğmeler */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--bg-3); color: var(--text); font-weight: 500;
  border: 1px solid transparent; transition: background .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-block { width: 100%; justify-content: center; }
.btn-small { padding: 6px 10px; font-size: 13px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm); display: inline-flex;
  align-items: center; justify-content: center; color: var(--text-2);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn.active { color: var(--warning); }
#notify-btn.active { color: var(--success); }
.link-btn { color: var(--primary); font-size: 13px; padding: 4px 8px; }

/* Alanlar */
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input, .compose-row input, .compose-row select, textarea {
  width: 100%; padding: 11px 12px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--line); outline: none;
}
.field input:focus, .compose-row input:focus, textarea:focus { border-color: var(--primary); }
.pw-wrap { position: relative; }
.pw-wrap .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.error-box {
  background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 12px;
}
body.light-theme .error-box { color: #b91c1c; }

/* Ekranlar */
.screen { height: 100%; }
#login-screen {
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(var(--vurgu-rgb), 0.25), transparent 60%), var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand h1 { font-size: 26px; margin: 12px 0 4px; }
.login-brand p { color: var(--text-2); font-size: 14px; }
.brand-mark {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; display: flex;
  align-items: center; justify-content: center; font-size: 24px; color: #fff;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
}
.brand-mark.small { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; margin: 0; }

/* Uygulama düzeni */
#app { display: flex; height: 100%; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 12px;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; font-size: 17px; }
.btn-compose { justify-content: center; padding: 12px; font-size: 15px; }
.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.nav-section { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 6px 10px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border-radius: var(--radius-sm); color: var(--text-2); text-align: left; font-size: 14px;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; }
.nav-item span:first-of-type, .nav-item .nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .dot { flex: none !important; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--bg-active); color: var(--text); font-weight: 600; }
.nav-item .badge { font-size: 12px; font-weight: 600; color: var(--primary); background: rgba(var(--vurgu-rgb), .15); padding: 1px 8px; border-radius: 999px; }
.nav-item.active .badge { background: var(--primary); color: #fff; }
.nav-item.sub { padding-left: 28px; font-size: 13px; }
.nav-ai { color: var(--text); background: linear-gradient(90deg, rgba(139, 92, 246, .18), transparent); border: 1px solid rgba(139, 92, 246, .25); }
.nav-ai i { color: #a78bfa; }
.nav-ai .pill { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #c4b5fd; border: 1px solid rgba(167, 139, 250, .4); padding: 1px 6px; border-radius: 999px; }
.nav-add { color: var(--text-3); font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user-line { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 4px; }
.foot-actions { display: flex; }
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 30; }

.main { flex: 1; display: flex; min-width: 0; }
.list-pane {
  width: var(--list-w); flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg);
}
.pane-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 8px 16px; }
.pane-head h2 { font-size: 20px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane-head .count { color: var(--text-3); font-size: 13px; }
.search-wrap { position: relative; padding: 0 12px 10px 16px; }
.search-wrap > i { position: absolute; left: 28px; top: 12px; color: var(--text-3); font-size: 13px; }
.search-wrap input {
  width: 100%; padding: 9px 36px 9px 34px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); outline: none;
}
.search-wrap input:focus { border-color: var(--primary); }
.search-wrap .icon-btn { position: absolute; right: 14px; top: 2px; width: 32px; height: 32px; }
.list-errors { margin: 0 12px 8px 16px; font-size: 12px; color: #fca5a5; }
.message-list { flex: 1; overflow-y: auto; }
.msg {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 4px 12px; padding: 12px 14px 12px 16px;
  border-bottom: 1px solid var(--line); cursor: pointer; position: relative;
}
.msg:hover { background: var(--bg-hover); }
.msg.active { background: var(--bg-active); }
.msg .avatar { grid-row: span 2; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 600; color: #fff; font-size: 15px; background: var(--primary); flex: none;
}
.msg-from { font-weight: 500; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.msg-date { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.msg-subject { grid-column: 2 / span 2; font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.msg-subject i { color: var(--text-3); font-size: 12px; }
.msg.unread .msg-from, .msg.unread .msg-subject { color: var(--text); font-weight: 600; }
.msg.unread::before { content: ''; position: absolute; left: 6px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--primary); }
.msg .star { color: var(--warning); font-size: 12px; }
.msg .acct { font-size: 11px; padding: 0 6px; border-radius: 999px; color: #fff; opacity: .85; margin-left: auto; flex: none; }
.list-foot { padding: 10px; text-align: center; }
.list-foot .btn { width: 100%; justify-content: center; }
.empty-list { padding: 48px 20px; text-align: center; color: var(--text-3); }
.skeleton { height: 64px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, var(--bg-hover), transparent); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.read-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; background: var(--bg); }
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-3); gap: 12px; }
.empty-state i { font-size: 48px; opacity: .5; }
#reader { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.reader-head { padding: 16px 20px 0; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.reader-top { display: flex; align-items: center; gap: 8px; }
.reader-top h2 { font-size: 20px; line-height: 1.3; flex: 1; word-break: break-word; }
.reader-meta { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; }
.meta-text { flex: 1; min-width: 0; font-size: 14px; }
.meta-from, .meta-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-to { font-size: 13px; }
.meta-date { font-size: 13px; white-space: nowrap; }
.reader-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding-bottom: 10px; }
.reader-actions .btn { padding: 7px 12px; font-size: 13px; }
.reader-attachments { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 12px; }
.att {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--bg-3); border: 1px solid var(--line); font-size: 13px; color: var(--text); max-width: 100%;
}
.att i { color: var(--primary); }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.att small { color: var(--text-3); }
.reader-notice { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: 12px; border-radius: var(--radius-sm); background: rgba(245, 158, 11, .12); font-size: 13px; }
.reader-frame { flex: 1; width: 100%; border: 0; background: var(--frame-bg); }
.loading-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--primary), #8b5cf6, var(--primary)); background-size: 200% 100%; animation: sk 1s infinite linear; z-index: 5; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-card { width: 100%; max-width: 440px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px 20px 20px; max-height: 100%; overflow: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { font-size: 18px; }
.compose-card { max-width: 760px; height: min(86vh, 760px); display: flex; flex-direction: column; padding-bottom: 12px; }
#compose-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.compose-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.compose-row label { width: 60px; flex: none; color: var(--text-3); font-size: 13px; }
.compose-row input, .compose-row select { background: transparent; border: 0; padding: 8px 4px; border-radius: 0; }
.compose-row select { cursor: pointer; }
.compose-row select option { background: var(--bg-2); color: var(--text); }
#compose-body { flex: 1; min-height: 160px; resize: none; border: 0; background: transparent; padding: 14px 4px; line-height: 1.6; }
.compose-attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.compose-attachments .att button { color: var(--text-3); }
.compose-foot { display: flex; flex-wrap: wrap; row-gap: 8px; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 8px; }
.modal.minimized { align-items: flex-end; justify-content: flex-end; background: transparent; pointer-events: none; }
.modal.minimized .compose-card { pointer-events: auto; height: auto; max-width: 320px; }
.modal.minimized #compose-form { display: none; }
.move-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; }

/* Bildirim */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--bg-3); color: var(--text);
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 60; font-size: 14px; max-width: 90vw;
}
.toast.error { border-color: rgba(239, 68, 68, .5); }
.only-mobile { display: none !important; }

/* Tablet: sol çubuk çekmece */
@media (max-width: 1100px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .only-mobile { display: inline-flex !important; }
  .list-pane { width: 360px; }
}
/* Telefon: tek panel */
@media (max-width: 760px) {
  .list-pane { width: 100%; border-right: 0; }
  .read-pane { position: fixed; inset: 0; z-index: 20; transform: translateX(100%); transition: transform .2s ease; }
  .read-pane.open { transform: none; }
  .reader-actions .btn span { display: none; }
  .reader-actions .btn { padding: 8px 10px; }
  .compose-card { height: 100%; max-width: 100%; border-radius: 0; }
  .modal { padding: 0; }
  .modal:not(.compose-wrap) { padding: 16px; }
  .msg { padding-left: 18px; }
  .pane-head h2 { font-size: 18px; }
}

/* Yapay zeka */
.nav-ai .pill.on { color: #6ee7b7; border-color: rgba(110, 231, 183, .5); }
.nav-ai .pill.off { color: var(--text-3); border-color: var(--line); }
.ai-quota { padding: 4px 10px 8px; }
.ai-quota-bar { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.ai-quota-fill { height: 100%; width: 0; background: linear-gradient(90deg, #8b5cf6, #6366f1); border-radius: 999px; transition: width .3s; }
.ai-quota-fill.warn { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.ai-quota-text { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.nav-install { color: #93c5fd; }
.ai-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0 0 10px; }
.btn-ai { padding: 7px 12px; font-size: 13px; border-color: rgba(139, 92, 246, .35); color: #c4b5fd; background: rgba(139, 92, 246, .08); }
.btn-ai:hover { background: rgba(139, 92, 246, .18); }
.btn-ai:disabled { opacity: .5; cursor: progress; }
body.light-theme .btn-ai { color: #6d28d9; }
.ai-panel { border: 1px solid rgba(139, 92, 246, .35); background: rgba(139, 92, 246, .08); border-radius: var(--radius); padding: 10px 14px 12px; margin-bottom: 12px; font-size: 14px; }
.ai-panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: #c4b5fd; }
body.light-theme .ai-panel-head { color: #6d28d9; }
.ai-panel-body ul { margin: 4px 0 8px 18px; }
.ai-panel-body li { margin: 2px 0; }
.ai-panel-body .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ai-panel-body .tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg-3); color: var(--text-2); }
.ai-panel-body .tag.high { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.ai-panel-body .tag.mid { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.ai-panel-body pre { white-space: pre-wrap; font-family: inherit; margin: 0; line-height: 1.55; }
.ai-panel-body .actions-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ai-menu { position: relative; }
.ai-menu-list { position: absolute; bottom: 42px; left: 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 180px; z-index: 5; overflow: hidden; }
.ai-menu-list button { text-align: left; padding: 10px 14px; font-size: 14px; color: var(--text); }
.ai-menu-list button:hover { background: var(--bg-hover); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ayarlar */
.settings-card { max-width: 1080px; width: 100%; height: min(780px, 100%); display: flex; flex-direction: column; overflow: hidden; }
.settings-card > .tabs { flex: none; }
.settings-card > .tab-pane { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 4px; }
/* Geniş ekranda sekmeler solda dikey menü, içerik sağda geniş alan */
@media (min-width: 900px) {
  .settings-card { display: grid; grid-template-columns: 190px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); column-gap: 20px; }
  .settings-card > .modal-head { grid-column: 1 / -1; }
  .settings-card > .tabs { grid-column: 1; grid-row: 2; flex-direction: column; gap: 2px; border-bottom: 0; border-right: 1px solid var(--line); margin: 0; padding-right: 12px; overflow: auto; }
  .settings-card > .tabs .tab { text-align: left; border-bottom: 0; border-radius: var(--radius-sm); padding: 9px 12px; }
  .settings-card > .tabs .tab:hover { background: var(--bg-hover); color: var(--text); }
  .settings-card > .tabs .tab.active { background: var(--bg-active); color: var(--text); }
  .settings-card > .tab-pane { grid-column: 2; grid-row: 2; padding-right: 8px; }
}
/* Çok geniş ekranda hesap kartları iki sütun */
@media (min-width: 1200px) {
  .settings-card [data-pane="accounts"] .acct-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 8px 14px; color: var(--text-2); border-bottom: 2px solid transparent; font-weight: 500; white-space: nowrap; flex: none; }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.switch-row input[type=number], .switch-row select {
  width: 96px; flex: none; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line); outline: none; text-align: center;
}
.switch-row input[type=number]:focus, .switch-row select:focus { border-color: var(--primary); }
.switch-row .unit { color: var(--text-2); font-size: 13px; margin-left: -4px; flex: none; }
.acct-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.acct-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-3); }
.acct-row.dragging { opacity: .5; }
.acct-row.drop-before { box-shadow: 0 -2px 0 var(--primary); }
.acct-row .grip { color: var(--text-3); cursor: grab; padding: 4px; }
.acct-row .acct-main { flex: 1; min-width: 0; }
.acct-row .acct-email { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-row input { width: 100%; background: transparent; border: 0; border-bottom: 1px dashed var(--line); padding: 2px 0; font-weight: 500; }
.acct-row input:focus { outline: none; border-bottom-color: var(--primary); }
.acct-row .acct-alan { display: block; margin-top: 6px; }
.acct-row .acct-alan > span { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.acct-row .acct-alan small { font-weight: 400; color: var(--text-3); }
/* Alan adı grupları: açılır/kapanır başlık + hizalı, sade hesap satırları */
.nav-domain { display: flex; flex-direction: column; margin-top: 4px; }
.nav-group {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px;
  border-radius: var(--radius-sm); color: var(--text-2); font-size: 13px; font-weight: 600; text-align: left;
}
.nav-group:hover { background: var(--bg-hover); color: var(--text); }
.nav-group .chev { width: 18px; text-align: center; font-size: 10px; color: var(--text-3); transition: transform .15s ease; transform: rotate(90deg); }
.nav-domain.collapsed .nav-group .chev { transform: none; }
.nav-group .nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Grubun okunmamış sayısı zarfın içinde: belirgin kenarlı, kapağı V çizgili zarf; okunmamış yoksa içi boş zarfta 0 */
.nav-group .zarf { position: relative; flex: none; display: inline-block; width: 30px; height: 21px; }
.nav-group .zarf svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.nav-group .zarf rect { fill: var(--primary); stroke: color-mix(in srgb, var(--primary) 60%, #fff); stroke-width: 1.5; }
.nav-group .zarf.zero rect { stroke: var(--primary); }
.nav-group .zarf path { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.nav-group .zarf b { position: absolute; left: 0; right: 0; bottom: 1px; text-align: center; font-size: 10px; font-weight: 700; line-height: 10px; color: #fff; }
.nav-group .zarf.zero rect { fill: rgba(var(--vurgu-rgb), .1); }
.nav-group .zarf.zero path { stroke: var(--primary); }
.nav-group .zarf.zero b { color: var(--primary); }
.nav-item.nav-acct .badge {
  flex: none; min-width: 22px; text-align: center; font-size: 12px; font-weight: 600; line-height: 18px;
  color: #fff; background: var(--primary); padding: 0 7px; border-radius: 999px;
}
.nav-group.has-active { color: var(--text); background: var(--bg-active); }
.nav-group-body { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 2px 19px; padding-left: 8px; border-left: 1px solid var(--line); }
.nav-item.nav-acct { padding: 6px 8px; font-size: 13px; gap: 9px; }
.nav-item.nav-acct.in-group { padding-left: 10px; }
.nav-item.nav-acct .dot { width: 7px; height: 7px; }
.nav-item .more { display: none; width: 24px; height: 24px; border-radius: 6px; align-items: center; justify-content: center; color: var(--text-3); flex: none; }
.nav-item:hover .more { display: inline-flex; }
.nav-item .more:hover { background: var(--bg-active); color: var(--text); }

.dot-pick { border: 2px solid transparent; cursor: pointer; width: 16px; height: 16px; }
.dot-pick:hover { border-color: var(--text-2); }
.acct-row { position: relative; }
.color-pop { position: absolute; left: 36px; top: 42px; z-index: 6; display: grid; grid-template-columns: repeat(6, 22px); gap: 6px; padding: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.color-pop button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; }
.color-pop button:hover { border-color: var(--text); }

/* Ajan */
.agent-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.agent-body { flex: 1; overflow-y: auto; padding: 0 16px 24px; max-width: 980px; width: 100%; margin: 0 auto; }
.agent-chat { border: 1px solid rgba(139, 92, 246, .35); background: rgba(139, 92, 246, .06); border-radius: var(--radius); padding: 12px; margin: 4px 0 18px; }
.agent-chat-log { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.agent-chat-log:empty { display: none; }
.bubble { padding: 10px 12px; border-radius: 12px; font-size: 14px; max-width: 90%; white-space: pre-wrap; line-height: 1.5; }
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; }
.bubble.ai { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--line); }
.agent-chat-form { display: flex; gap: 8px; }
.agent-chat-form input { flex: 1; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); outline: none; }
.agent-chat-form input:focus { border-color: var(--primary); }
.agent-intro { border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.agent-intro h3 { margin-bottom: 6px; }
.agent-intro p { color: var(--text-2); font-size: 14px; margin-bottom: 12px; }
.agent-section h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin: 18px 0 8px; font-family: var(--font); font-weight: 600; }
.agent-card { display: grid; grid-template-columns: 10px 1fr; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--radius); margin-bottom: 8px; }
.agent-card .urg { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--text-3); }
.agent-card .urg.yüksek { background: var(--danger); }
.agent-card .urg.orta { background: var(--warning); }
.agent-card .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.agent-card .top strong { color: var(--text); font-size: 14px; }
.agent-card .subject { font-weight: 500; margin: 2px 0; }
.agent-card .summary { font-size: 14px; color: var(--text-2); }
.agent-card .suggest { font-size: 13px; color: #c4b5fd; margin-top: 4px; }
body.light-theme .agent-card .suggest { color: #6d28d9; }
.agent-card .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.agent-card .acts .btn { padding: 6px 10px; font-size: 13px; }
.agent-card.done { opacity: .5; }
.agent-empty { color: var(--text-3); padding: 24px; text-align: center; }

/* İmza */
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-top: 8px; }
.sig-grid .field { margin-bottom: 10px; }
.sig-logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.sig-logo-row img { height: 44px; width: auto; max-width: 140px; border-radius: 6px; background: #fff; padding: 4px; }
.sig-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.sig-preview-wrap .muted { margin-bottom: 4px; }
.sig-preview { width: 100%; height: 170px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
@media (max-width: 760px) { .sig-grid { grid-template-columns: 1fr; } .agent-card .acts .btn span { display: inline; } }

/* Depo */
.asset-upload { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; flex-wrap: wrap; }
.asset-list { display: flex; flex-direction: column; gap: 8px; }
.asset-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-3); }
.asset-row .ico { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--bg-2); color: var(--primary); font-size: 16px; }
.asset-row input, .asset-row textarea { width: 100%; background: transparent; border: 0; border-bottom: 1px dashed var(--line); padding: 2px 0; font-size: 14px; resize: none; }
.asset-row input:focus, .asset-row textarea:focus { outline: none; border-bottom-color: var(--primary); }
.asset-row .meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.asset-row .acts { display: flex; gap: 2px; }
.asset-pick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: var(--radius-sm); text-align: left; color: var(--text); }
.asset-pick:hover { background: var(--bg-hover); }
.asset-pick small { color: var(--text-3); display: block; }
.att.asset-chip { border-color: rgba(var(--vurgu-rgb), .4); }
.agent-context { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #c4b5fd; padding: 6px 10px; margin-bottom: 8px; border: 1px dashed rgba(139, 92, 246, .5); border-radius: var(--radius-sm); }
.agent-context span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-context .icon-btn { width: 26px; height: 26px; }
.bubble.draft { border-color: rgba(139, 92, 246, .5); }
.bubble .btn { margin-top: 8px; }

/* Ajan: sohbet odaklı düzen */
.agent-body { display: flex; flex-direction: column; padding-bottom: 12px; }
.agent-chat-log { flex: 1; gap: 10px; padding: 8px 0; }
.agent-chat-log:empty { display: flex; }
.bubble { max-width: 82%; font-size: 15px; line-height: 1.6; padding: 12px 14px; }
.bubble.ai { position: relative; padding-right: 40px; }
.bubble.hint { color: var(--text-2); font-size: 14px; }
.bubble .speak { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border-radius: 6px; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; }
.bubble .speak:hover, .bubble .speak.on { color: var(--primary); background: var(--bg-hover); }
.agent-pending { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); margin: 4px 0 12px; }
.agent-pending summary { cursor: pointer; padding: 10px 14px; font-size: 14px; color: var(--text-2); list-style: none; }
.agent-pending summary::-webkit-details-marker { display: none; }
.agent-pending[open] summary { border-bottom: 1px solid var(--line); }
.agent-pending #agent-sections { padding: 4px 12px 10px; }
.agent-context { margin: 0 16px; max-width: 980px; width: calc(100% - 32px); align-self: center; }
.agent-chat-form { max-width: 980px; width: 100%; margin: 0 auto; padding: 8px 16px 14px; align-items: flex-end; border-top: 1px solid var(--line); background: var(--bg); }
.agent-chat-form textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; padding: 11px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); outline: none; line-height: 1.5; font-size: 15px; }
.agent-chat-form textarea:focus { border-color: var(--primary); }
.agent-chat-form .icon-btn { width: 44px; height: 44px; flex: none; }
.agent-chat-form .btn { height: 44px; }
#agent-mic.listening { color: var(--danger); animation: pulse 1s infinite; }
#agent-tts-toggle.on { color: var(--success); }
@keyframes pulse { 50% { opacity: .5; } }

/* Bilgi tabanı */
.kb-form { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.kb-form input, .kb-form textarea { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-3); border: 1px solid var(--line); outline: none; }
.kb-form input:focus, .kb-form textarea:focus { border-color: var(--primary); }
.kb-form .btn { align-self: flex-start; }
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-card { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-3); }
.kb-card .kb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.kb-card .kb-head input { flex: 1; background: transparent; border: 0; border-bottom: 1px dashed var(--line); font-weight: 600; padding: 2px 0; }
.kb-card textarea { width: 100%; background: transparent; border: 0; border-bottom: 1px dashed var(--line); resize: vertical; min-height: 40px; font-size: 14px; color: var(--text-2); padding: 2px 0; }
.kb-card input:focus, .kb-card textarea:focus { outline: none; border-bottom-color: var(--primary); }
.kb-card .kb-meta { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.kb-card .tag.agent { background: rgba(139, 92, 246, .18); color: #c4b5fd; }
.kb-card .tag.user { background: rgba(16, 185, 129, .18); color: #6ee7b7; }

/* Rehber */
.contact-tools { display: flex; gap: 8px; align-items: center; margin: 8px 0 12px; flex-wrap: wrap; }
.contact-tools input { flex: 1; min-width: 160px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--bg-3); border: 1px solid var(--line); outline: none; }
.contact-list { display: flex; flex-direction: column; gap: 4px; }
.contact-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 10px 4px 4px; display: flex; gap: 8px; align-items: center; }
.contact-group strong { color: var(--text-2); text-transform: none; letter-spacing: 0; font-size: 12px; }
.contact-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: var(--radius-sm); }
.contact-row:hover { background: var(--bg-hover); }
.contact-row .avatar { width: 34px; height: 34px; font-size: 13px; }
.contact-row input { width: 100%; background: transparent; border: 0; border-bottom: 1px dashed transparent; padding: 1px 0; font-size: 14px; }
.contact-row input:hover, .contact-row input:focus { border-bottom-color: var(--line); outline: none; }
.contact-row .email { font-size: 12px; color: var(--text-3); }
.contact-row .acts { display: flex; }
.contact-row .acts .icon-btn { width: 30px; height: 30px; }
.contact-row .fav { color: var(--warning); }
/* Kota çubukları */
.quota-bar { height: 5px; border-radius: 999px; background: var(--bg-2); overflow: hidden; margin-top: 6px; }
.quota-bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.quota-bar i.warn { background: var(--warning); }
.quota-bar i.full { background: var(--danger); }
.quota-text { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.tag.phish { background: rgba(239, 68, 68, .18); color: #fca5a5; }

/* Arşiv */
.archive-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-3); }
.archive-row .title { font-weight: 500; }
.archive-row .meta { font-size: 12px; color: var(--text-3); }
.archive-row .rule { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; grid-column: 1 / -1; }
.archive-row .rule input { width: 70px; padding: 6px 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); }
.archive-row .rule .btn { padding: 6px 10px; font-size: 13px; }
.nav-item.nav-archive i { color: #93c5fd; }
.msg .archived-mark { font-size: 10px; color: #93c5fd; }

/* Arşiv yeri */
.place-choice { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 12px; margin: 10px 0; }
.place-choice .switch-row:last-child { border-bottom: 0; }
.switch-row input[type=radio] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.archive-warn { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 10px 0; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5;
  background: rgba(59, 130, 246, .1); border: 1px solid rgba(59, 130, 246, .3); color: var(--text); }
.archive-warn i { color: #60a5fa; margin-top: 3px; }
.archive-warn.error { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); }
.archive-warn.error i { color: var(--danger); }
.archive-folder { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-3); }
.archive-folder .title { font-weight: 500; }
.archive-folder .meta { font-size: 12px; color: var(--text-3); }
.archive-folder .actions { display: flex; gap: 6px; }
.archive-folder .btn { padding: 6px 10px; font-size: 13px; }
.empty-list .btn { margin-top: 12px; }

/* İmza: hesap seçimi, seçenekler, şablon galerisi */
.sig-accounts-head { margin-bottom: 6px; }
.sig-accounts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sig-acct { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-3); color: var(--text-2); font-size: 13px; }
.sig-acct:hover { color: var(--text); border-color: var(--text-3); }
.sig-acct.active { border-color: var(--primary); background: var(--bg-active); color: var(--text); font-weight: 600; }
.sig-acct .st { font-size: 11px; color: var(--success); }
.sig-acct .st.off { color: var(--text-3); }
.sig-options { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; margin: 0 0 14px; }
.sig-opt { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.sig-opt input[type=range] { width: 150px; accent-color: var(--primary); }
.sig-opt output { min-width: 48px; color: var(--text); font-variant-numeric: tabular-nums; }
.sig-opt input[type=color] { width: 40px; height: 32px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-3); cursor: pointer; }
.sig-opt select, .sig-actions select { padding: 7px 10px; border-radius: var(--radius-sm); background: var(--bg-3); color: var(--text); border: 1px solid var(--line); }
.sig-section-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 4px 0 8px; }
.sig-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sig-thumb { position: relative; border: 2px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; cursor: pointer; text-align: left; padding: 0; }
.sig-thumb:hover { border-color: var(--text-3); }
.sig-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--vurgu-rgb), .25); }
.sig-thumb .frame { height: 112px; overflow: hidden; pointer-events: none; }
.sig-thumb iframe { width: 600px; height: 280px; border: 0; transform: scale(.36); transform-origin: 0 0; background: #fff; }
.sig-thumb .label { display: block; padding: 6px 10px; font-size: 12px; font-weight: 600; color: #334155; background: #f8fafc; border-top: 1px solid #e2e8f0; }
.sig-preview { height: 220px; }

/* Yazma penceresi: daha büyük, tam ekran, ayrı pencere, imza önizlemesi */
.compose-card { max-width: 1040px; height: min(92vh, 900px); }
.modal.compose-full { padding: 0; }
.modal.compose-full .compose-card { max-width: 100%; height: 100%; border-radius: 0; }
body.compose-popout { overflow: hidden; }
body.compose-popout #sidebar, body.compose-popout #sidebar-backdrop, body.compose-popout #app .main, body.compose-popout #rail, body.compose-popout #ai-dock, body.compose-popout .ws-calendar, body.compose-popout .ws-be { display: none !important; }
body.compose-popout #compose-modal { background: var(--bg); padding: 0; }
body.compose-popout #compose-modal .compose-card { max-width: 100%; height: 100%; border-radius: 0; border: 0; }
body.compose-popout #compose-minimize, body.compose-popout #compose-expand, body.compose-popout #compose-popout { display: none; }
.compose-sig { border-top: 1px dashed var(--line); padding: 8px 0 4px; flex: none; }
.compose-sig-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.compose-sig-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.compose-sig-toggle input { width: 16px; height: 16px; accent-color: var(--primary); }
.compose-sig-hesap { flex: 1 1 auto; min-width: 0; max-width: 280px; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); color: var(--text); }
.compose-sig-hesap option { background: var(--bg-2); color: var(--text); }
#compose-sig-edit { margin-left: auto; }
#compose-sig-goster { font-size: 13px; white-space: nowrap; }
.compose-sig-head { margin-bottom: 0; }
.compose-sig #compose-sig-frame:not([hidden]) { margin-top: 6px; }
.planli-view .pv-imza { display: block; width: 100%; max-width: 640px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; height: 120px; margin: 4px 0 12px; }
#compose-sig-frame { width: 100%; height: 90px; max-height: 200px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.compose-sig.off #compose-sig-frame { opacity: .35; filter: grayscale(1); }
@media (max-width: 760px) { .only-desktop { display: none !important; } }

/* Oltalama uyarısı ve mail eylem düğmeleri */
.ai-warn { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .4); color: var(--text); margin: 4px 0 8px; }
.ai-warn > i { color: var(--danger); margin-top: 3px; font-size: 16px; }
.ai-warn ul { margin: 6px 0 0 18px; font-size: 13px; color: var(--text-2); }
.ai-insight { font-size: 13px; color: var(--text-2); margin: 4px 0 6px; }
.ai-insight i { color: #fbbf24; }
.mail-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.mail-acts .btn { padding: 6px 10px; font-size: 13px; }
.mail-acts .btn.danger-soft { border-color: rgba(239, 68, 68, .4); color: #f87171; }
.mail-acts .btn.danger-soft:hover { background: rgba(239, 68, 68, .1); }
body.light-theme .mail-acts .btn.danger-soft { color: #dc2626; }
.mail-acts-done { font-size: 13px; color: var(--success); display: flex; gap: 6px; align-items: center; }

/* Geriye dönük koruma taraması */
.guard-scan { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin: 10px 0; background: var(--bg-3); }
.guard-scan-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.guard-scan-accounts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); font-size: 13px; cursor: pointer; }
.chip-check input { width: 15px; height: 15px; accent-color: var(--primary); }
.guard-scan-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.guard-scan-row select { padding: 5px 8px; border-radius: 6px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); }
.guard-scan-row .btn { padding: 7px 12px; font-size: 13px; }
.guard-scan-progress { margin-top: 10px; }
.guard-scan-progress .bar { height: 6px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.guard-scan-progress .bar span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .4s; }
.guard-scan-progress .txt { margin-top: 6px; }

/* Ek önizleme ve ek özeti */
.att-card { max-width: 1100px; width: 100%; height: min(92vh, 960px); display: flex; flex-direction: column; overflow: hidden; }
.att-card .modal-head { flex: none; gap: 10px; }
.att-card .modal-head h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.att-head-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.att-head-acts .btn { padding: 7px 12px; font-size: 13px; }
.att-body { flex: 1; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: auto; background: var(--bg-3); }
.att-frame { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.att-img { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 12px; }
.att-img img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.att-text { margin: 0; padding: 16px; white-space: pre-wrap; font-size: 13px; line-height: 1.55; color: var(--text); }
.att-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px; color: var(--text-2); }
.att { cursor: pointer; }
.att-sum { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.att-sum-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 760px) { .att-head-acts .btn span { display: none; } .att-card { height: 100%; border-radius: 0; } }

.att-sheets { display: flex; flex-direction: column; height: 100%; }
.att-sheet-tabs { display: flex; gap: 2px; padding: 6px 6px 0; background: var(--bg-3); flex: none; overflow-x: auto; }
.att-sheet-tabs button { padding: 6px 12px; font-size: 13px; border-radius: 6px 6px 0 0; color: var(--text-2); background: var(--bg-2); white-space: nowrap; }
.att-sheet-tabs button.active { background: #fff; color: #111827; font-weight: 600; }
.att-sheets .att-frame { flex: 1; min-height: 0; }

.push-row { cursor: default; }
.push-acts { display: flex; gap: 6px; flex-wrap: wrap; flex: none; }
.push-acts .btn { padding: 6px 10px; font-size: 13px; }

/* HTML mail modu */
.compose-html { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.ch-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: none; }
.ch-bar .btn { padding: 6px 10px; font-size: 13px; }
.ch-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.ch-tabs button { padding: 6px 12px; font-size: 13px; color: var(--text-2); }
.ch-tabs button.active { background: var(--bg-active); color: var(--text); font-weight: 600; }
#compose-html-preview { flex: 1; min-height: 240px; width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
#compose-html-code { flex: 1; min-height: 240px; resize: none; font: 12.5px/1.5 Consolas, 'Courier New', monospace; padding: 10px; }
#compose-html-btn.active { border-color: var(--primary); color: var(--primary); }

/* Sabah özetleri */
.agent-digest-btn { padding: 6px 10px; font-size: 13px; }
.bubble.digest, .bubble.digest-list { max-width: 720px; width: 100%; white-space: normal; }
.dg-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.dg-title i { color: #f59e0b; }
.dg-days { display: flex; flex-direction: column; gap: 6px; }
.dg-days .btn { justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 12px; text-transform: none; }
.dg-days .btn small { color: var(--text-3); font-weight: 400; }
.dg-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dg-stats span { background: var(--bg-3); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; }
.dg-stats span.hot { background: rgba(239, 68, 68, .14); color: #ef4444; }
.dg-h { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin: 10px 0 4px; }
.dg-ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dg-item { display: grid; grid-template-columns: minmax(0, 1fr); text-align: left; width: 100%; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-2); }
.dg-item:hover { border-color: var(--primary); }
.dg-from { font-weight: 600; font-size: 13px; }
.dg-subj { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-sum { font-size: 12.5px; color: var(--text-3); }
.dg-f { font-size: 13px; color: var(--text-2); padding: 2px 0; }
.dg-more summary { cursor: pointer; font-size: 13px; color: var(--primary); margin-top: 8px; }
/* Bildirim sihirbazı */
.pw-card { max-width: 520px; }
.pw-steps { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.pw-steps li { display: flex; gap: 12px; align-items: flex-start; }
.pw-n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.pw-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

/* Depo: ekleme formu ve metin kartları */
.asset-form { border: 1px solid var(--primary); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; background: var(--bg-3); }
.asset-form-title { font-weight: 700; margin-bottom: 8px; }
.asset-form .field { margin-bottom: 10px; }
.asset-form textarea { width: 100%; resize: vertical; min-height: 120px; }
.asset-form .req { color: var(--danger); }
.asset-form-acts { display: flex; justify-content: flex-end; gap: 8px; }
.asset-row.is-text .ico { color: #f59e0b; }
.asset-row .a-body { margin: 4px 0; padding: 6px 8px !important; border: 1px dashed var(--line) !important; border-radius: 6px; font-size: 13px !important; line-height: 1.5; resize: vertical !important; min-height: 70px; }

/* HTML modu: önizleme geniş alan alır (önceden imza kutusu yüzünden 240px şeride sıkışıyordu) */
.modal.html-mode .compose-card { height: min(94vh, 980px); }
/* Önizleme hiçbir durumda sıfıra inmez: yer daralırsa form kayar, önizleme en az 360 px kalır */
.modal.html-mode #compose-form { overflow-y: auto; }
.modal.html-mode .compose-html { min-height: 400px; }
.modal.html-mode #compose-html-preview, .modal.html-mode #compose-html-code { min-height: 360px; height: 100%; }
.modal.html-mode .compose-sig { padding: 4px 0 0; }
.modal.html-mode #compose-sig-frame { display: none; }
.modal.html-mode .compose-sig-head { margin-bottom: 0; }

/* Klasör başlığı altında hesap adresi */
.folder-head { flex: 1; min-width: 0; }
.folder-head h2 { line-height: 1.2; }
.folder-account { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.folder-account:empty { display: none; }

/* Özet / çeviri kutusu uzunsa kendi içinde kayar */
.ai-panel-body { max-height: 45vh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-right: 4px; }

/* Yazma düğmesi (yalnız telefonda) */
.compose-fab { display: none; }

/* Telefon: uygulama gibi düzen */
@media (max-width: 760px) {
  /* Listede sağ altta yuvarlak yazma düğmesi */
  .compose-fab {
    display: flex; align-items: center; justify-content: center; position: fixed; right: 18px; bottom: calc(20px + env(safe-area-inset-bottom));
    width: 56px; height: 56px; border-radius: 18px; border: 0; z-index: 15; font-size: 20px; color: #fff; cursor: pointer;
    background: linear-gradient(135deg, var(--primary), #8b5cf6); box-shadow: 0 8px 24px rgba(79, 70, 229, .45);
  }
  .compose-fab:active { transform: scale(.95); }
  body.compose-popout .compose-fab { display: none; }
  .message-list { padding-bottom: 84px; }

  /* Okuma ekranı tamamı kayar: üst bilgi + özet + mail; mail en az ekran boyu kadar */
  #reader { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .reader-head { flex: none; padding: 12px 14px 0; }
  .reader-top h2 { font-size: 17px; }
  .reader-meta { margin: 10px 0 8px; }
  .reader-frame { flex: none; min-height: calc(100vh - 140px); }
  .ai-panel-body { max-height: none; overflow: visible; }

  /* Eylemler altta sabit çubuk: büyük dokunma alanı, yana kaydırılabilir */
  .reader-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 22; margin: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    flex-wrap: nowrap; overflow-x: auto; gap: 2px; background: var(--bg-2); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(0, 0, 0, .25); scrollbar-width: none;
  }
  .reader-actions::-webkit-scrollbar { display: none; }
  .reader-actions .spacer { display: none; }
  .reader-actions .btn, .reader-actions .icon-btn {
    flex: none; min-width: 52px; height: 48px; padding: 4px 8px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; border: 0; background: transparent; border-radius: 12px; font-size: 17px;
  }
  .reader-actions .btn span { display: block; font-size: 10.5px; line-height: 1; color: var(--text-3); }
  .reader-actions .btn:active, .reader-actions .icon-btn:active { background: var(--bg-hover); }
  /* Sık kullanılanlar önde: yanıtla, tümünü, ilet, arşiv, sil; diğerleri sağa kayar */
  .reader-actions [data-act="reply"] { order: 1; }
  .reader-actions [data-act="reply-all"] { order: 2; }
  .reader-actions [data-act="forward"] { order: 3; }
  .reader-actions [data-act="archive"], .reader-actions [data-act="restore"] { order: 4; }
  .reader-actions [data-act="delete"] { order: 5; }
  .reader-actions [data-act="flag"] { order: 6; }
  .reader-actions > * { order: 7; }

  /* Yapay zeka düğmeleri: tek satır, yana kayar */
  .ai-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 12px; }
  .ai-bar::-webkit-scrollbar { display: none; }
  .ai-bar .btn-ai { flex: none; border-radius: 999px; padding: 8px 14px; }

  /* Ekler tek satır, yana kayar */
  .reader-attachments { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .reader-attachments .att { flex: none; }

  /* Liste: daha ferah satırlar, büyük dokunma alanı */
  .msg { padding-top: 14px; padding-bottom: 14px; }
  .pane-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .toast { bottom: calc(90px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  .reader-actions .icon-btn::after { display: block; font-size: 10.5px; line-height: 1; color: var(--text-3); font-family: Inter, system-ui, sans-serif; font-weight: 400; }
  .reader-actions [data-act="archive"]::after { content: 'Arşiv'; }
  .reader-actions [data-act="restore"]::after { content: 'Geri al'; }
  .reader-actions [data-act="delete"]::after { content: 'Sil'; }
  .reader-actions [data-act="flag"]::after { content: 'Yıldız'; }
  .reader-actions [data-act="unread"]::after { content: 'Okunmadı'; }
  .reader-actions [data-act="move"]::after { content: 'Taşı'; }
  .reader-actions [data-act="spam"]::after { content: 'Spam'; }
  .reader-actions [data-act="eml"]::after { content: 'İndir'; }
}

/* ---- Takvim & Görevler ---- */
.nav-calendar i { color: #60a5fa; }
.nav-calendar.active { background: var(--hover, rgba(255,255,255,.06)); }
.calendar-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.calendar-pane[hidden] { display: none; }
.calendar-head { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); min-height: 44px; }
.calendar-head-title { font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.calendar-head-title i { color: #60a5fa; }
.calendar-head .spacer { flex: 1; }
#calendar-frame { flex: 1; width: 100%; border: 0; background: var(--bg); }
.invite-card { display: flex; gap: 14px; margin: 10px 0 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(96,165,250,.35); background: linear-gradient(135deg, rgba(96,165,250,.10), rgba(139,92,246,.06)); }
.invite-card[hidden] { display: none; }
.invite-card .inv-icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(96,165,250,.18); color: #60a5fa; font-size: 18px; flex-shrink: 0; }
.invite-card .inv-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.invite-card .inv-title { font-weight: 700; font-size: 15px; }
.invite-card .inv-when { font-weight: 600; }
.invite-card .inv-line { color: var(--text-2, inherit); overflow-wrap: anywhere; }
.invite-card .inv-line i, .invite-card .inv-when i { width: 16px; opacity: .7; }
.invite-card .inv-status { margin-top: 4px; }
.invite-card .inv-cancel { color: #f87171; font-weight: 700; }
.invite-card .inv-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.invite-card .inv-yes.on { background: #059669; color: #fff; border-color: #059669; }
.invite-card .inv-maybe.on { background: #d97706; color: #fff; border-color: #d97706; }
.invite-card .inv-no.on { background: #dc2626; color: #fff; border-color: #dc2626; }
.invite-card .inv-options { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.invite-card .inv-options[hidden] { display: none; }
.invite-card .inv-comment { width: 100%; resize: vertical; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.invite-card .inv-nosend { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

/* Telefonda eylem çekmecesi: altta 5 sık işlem, yukarı çekince diğerleri (yatay kaydırma yok) */
.sheet-handle, .sheet-backdrop { display: none; }
@media (max-width: 760px) {
  .reader-actions {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px 4px; overflow: visible; flex-wrap: wrap;
    padding: 0 10px calc(8px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; border: 1px solid var(--line); border-bottom: 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .35);
  }
  .sheet-handle { display: flex; grid-column: 1 / -1; order: 0 !important; justify-content: center; padding: 10px 0 6px; cursor: grab; touch-action: none; }
  .sheet-handle span { width: 42px; height: 5px; border-radius: 3px; background: var(--text-3); opacity: .6; }
  .reader-actions .btn, .reader-actions .icon-btn { min-width: 0; width: 100%; height: 58px; font-size: 19px; }
  .reader-actions .btn span, .reader-actions .icon-btn::after { font-size: 11px; }
  /* Kapalıyken yalnız sık kullanılan beş işlem */
  .reader-actions > [data-act]:not([data-act="reply"]):not([data-act="reply-all"]):not([data-act="forward"]):not([data-act="archive"]):not([data-act="restore"]):not([data-act="delete"]) { display: none; }
  .reader-actions.expanded > [data-act]:not([hidden]) { display: inline-flex !important; }
  .reader-actions [hidden] { display: none !important; }
  /* Açıkken ikinci sıra bir ayraçla başlar */
  .reader-actions.expanded::after { content: ''; grid-column: 1 / -1; order: 6; height: 1px; background: var(--line); margin: 4px 0; }
  .reader-actions.expanded > [data-act="flag"] { order: 7; }
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 21; background: rgba(0, 0, 0, .4); }
  .sheet-backdrop[hidden] { display: none; }
}

/* Şifre değiştir */
.pw-meter { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; margin: -4px 0 4px; }
#pw-meter-fill { height: 100%; width: 0; border-radius: 999px; transition: width .2s, background .2s; background: #ef4444; }
#pw-meter-fill.ok { background: #f59e0b; }
#pw-meter-fill.good { background: #10b981; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; color: var(--text-2); cursor: pointer; }
#password-modal { z-index: 56; } /* Ayarlar penceresinin üstünde açılır */
/* Telefonda takvimin kendi üst çubuğu var: webmail başlığı gizlenir */
@media (max-width: 767px) { .calendar-head { display: none; } }

/* Şifre alanında göz düğmesi */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: transparent; color: var(--text-3); border-radius: 8px; cursor: pointer; font-size: 15px; }
.pw-eye:hover { color: var(--text); background: var(--bg-hover); }

.pw-suggest { margin: -2px 0 8px; }
#password-user { color: var(--text-2); }

/* Çoklu seçim */
#select-btn.active { color: var(--primary); background: rgba(79, 70, 229, .12); }
.avatar { position: relative; }
.sel-box { display: none; position: absolute; inset: 0; border-radius: 50%; align-items: center; justify-content: center; font-size: 15px; color: transparent; background: var(--bg-2); border: 2px solid var(--text-3); }
.message-list.selecting .sel-box { display: flex; }
.message-list.selecting .msg.picked .sel-box { background: var(--primary); border-color: var(--primary); color: #fff; }
.message-list.selecting .msg.picked { background: rgba(79, 70, 229, .12); }
.msg:not(.picked) .avatar:hover .sel-box { display: flex; }
.bulk-bar { margin: 0 12px 10px 16px; padding: 8px 10px; border: 1px solid rgba(79, 70, 229, .35); background: rgba(79, 70, 229, .08); border-radius: 12px; }
.bulk-bar.busy { opacity: .6; pointer-events: none; }
.bulk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bulk-all { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.bulk-all input { width: 17px; height: 17px; accent-color: var(--primary); }
.bulk-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.bulk-acts .btn { padding: 6px 10px; font-size: 12.5px; }
.bulk-acts .btn:disabled { opacity: .45; cursor: default; }
.bulk-acts .btn.danger { color: #fca5a5; }
@media (max-width: 760px) {
  .bulk-bar { margin: 0 10px 8px; }
  .bulk-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
  .bulk-acts .btn { flex-direction: column; gap: 3px; height: 54px; padding: 4px 2px; font-size: 16px; justify-content: center; border: 0; background: transparent; }
  .bulk-acts .btn span { font-size: 10.5px; color: var(--text-3); line-height: 1.1; text-align: center; }
  body.selecting .compose-fab { display: none; }
}

/* ---------- Sekmeler (Mail, Takvim, Block Editor) ve sabit yapay zeka paneli ---------- */
:root { --rail-w: 76px; --dock-w: 380px; }
.rail {
  width: var(--rail-w); flex: none; display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  padding: 12px 8px; background: var(--bg-2); border-right: 1px solid var(--line); z-index: 35;
}
.rail-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px;
  border-radius: 12px; color: var(--text-2); font-size: 11px; font-weight: 600; line-height: 1.15; text-align: center;
}
.rail-btn[hidden] { display: none; }
.rail-btn i { font-size: 19px; }
.rail-btn:hover { background: var(--bg-hover); color: var(--text); }
.rail-btn.active { background: var(--bg-active); color: var(--text); }
.rail-btn.active::before { content: ''; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.rail-btn[data-tab="mail"] i { color: #818cf8; }
.rail-btn[data-tab="calendar"] i { color: #60a5fa; }
.rail-btn[data-tab="be"] i { color: #a78bfa; }
.rail-btn .badge {
  position: absolute; top: 4px; right: 8px; min-width: 18px; font-size: 10.5px; font-weight: 700; color: #fff;
  background: var(--primary); padding: 1px 5px; border-radius: 999px;
}
.rail-spacer { flex: 1; }
.rail-ai i { color: #a78bfa; }
.rail-ai.active { background: linear-gradient(180deg, rgba(139, 92, 246, .22), rgba(139, 92, 246, .08)); }
.rail-ai .pill { width: 8px; height: 8px; padding: 0; font-size: 0; border-radius: 50%; position: absolute; top: 8px; right: 14px; background: var(--text-3); border: 0; }
.rail-ai .pill.on { background: #34d399; }
.rail-btn.rail-ai .ai-cekmece {
  position: absolute; left: 3px; top: 50%; margin-top: -6px; font-size: 11px; line-height: 12px; color: #a78bfa; opacity: .75;
  transition: transform .32s cubic-bezier(.32, .72, 0, 1), opacity .2s ease;
}
.rail-ai:hover .ai-cekmece { opacity: 1; transform: translateX(-2px); }
.rail-ai.active .ai-cekmece { transform: rotate(180deg); }
.rail-ai.active:hover .ai-cekmece { transform: rotate(180deg) translateX(-2px); }
.rail-ai:not(.active) .pill.on { animation: ai-nabiz 2.6s ease-in-out infinite; }
@keyframes ai-nabiz { 0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 60% { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); } }
.workspace { flex: 1; min-width: 0; display: flex; position: relative; }
.ws { flex: 1; min-width: 0; display: flex; height: 100%; }
.ws[hidden] { display: none; }
.ws-calendar .calendar-head { display: none; }
#be-frame { flex: 1; width: 100%; height: 100%; border: 0; background: var(--bg); }
.ai-dock {
  --cekmece: .34s cubic-bezier(.32, .72, 0, 1);
  width: 0; flex: none; border-left: 0 solid var(--line); background: var(--bg-2); display: flex; min-width: 0; overflow: hidden;
  transition: width var(--cekmece), border-left-width var(--cekmece);
}
.ai-dock.acik { width: var(--dock-w); border-left-width: 1px; }
.ai-dock .agent-pane { flex: none; width: var(--dock-w); background: var(--bg-2); min-width: 0; }
.ai-dock .agent-body { padding: 0 12px 16px; max-width: none; }
.ai-dock-head { padding: 12px 8px 6px 14px; }
.ai-dock-head h2 { font-size: 16px; }
.ai-dock-durum { padding: 0 14px 8px; display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.ai-dock-durum .count { font-size: 12px; color: var(--text-3); }
.ai-dock-durum .ai-quota { padding: 2px 0 0; }
.ai-dock .agent-chat-form { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
.ai-dock .bubble { max-width: 100%; }
/* Masaüstü: sekme çubuğu en sağda, yapay zeka paneli çubuğun solunda (içerik | yapay zeka | çubuk) */
@media (min-width: 761px) {
  .workspace { order: 1; }
  .ai-dock { order: 2; }
  .rail { order: 3; border-right: 0; border-left: 1px solid var(--line); z-index: 46; } /* çekmece çubuğun arkasına girer */
  .rail-btn.active::before { left: auto; right: -8px; border-radius: 3px 0 0 3px; }
}
/* Orta genişlik: panel içeriğin üstünde, çubuğun hemen solunda açılır */
@media (max-width: 1280px) {
  .ai-dock {
    position: fixed; right: var(--rail-w); top: 0; bottom: 0; z-index: 45; width: var(--dock-w); border-left-width: 1px;
    transform: translateX(100%); box-shadow: none; transition: transform var(--cekmece), box-shadow var(--cekmece);
  }
  .ai-dock.acik { transform: none; box-shadow: -12px 0 30px rgba(0, 0, 0, .35); }
  .ai-dock .agent-pane { flex: 1; width: auto; }
}
/* Telefon: sekmeler altta, yapay zeka tam ekran */
@media (max-width: 760px) {
  #app { flex-direction: column; }
  .rail {
    order: 2; width: 100%; height: calc(58px + env(safe-area-inset-bottom)); flex-direction: row; padding: 4px 6px env(safe-area-inset-bottom);
    border-right: 0; border-top: 1px solid var(--line); gap: 2px;
  }
  .rail-btn { flex: 1; padding: 6px 2px; font-size: 10.5px; gap: 3px; }
  .rail-btn i { font-size: 18px; }
  .rail-btn.active::before { left: 20%; right: 20%; top: -4px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .rail-spacer { display: none; }
  .workspace { order: 1; flex: 1; min-height: 0; }
  .ai-dock, .ai-dock.acik { left: 0; right: 0; width: 100%; bottom: calc(58px + env(safe-area-inset-bottom)); box-shadow: none; border-left: 0; }
  .ai-dock.acik { transform: none; }
  .read-pane { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .compose-fab { bottom: calc(58px + 18px + env(safe-area-inset-bottom)) !important; }
}

/* ---------- Yapay zeka paneli: sohbet uygulaması düzeni (başlık, akış, alttaki yazma kutusu) ---------- */
.ai-dock-head { display: flex; align-items: center; gap: 2px; padding: 10px 8px 8px 14px; border-bottom: 1px solid var(--line); flex: none; }
.ai-dock-baslik { display: flex; flex-direction: column; min-width: 0; }
.ai-dock-baslik strong { font-size: 15px; display: inline-flex; align-items: center; gap: 7px; }
.ai-dock-baslik strong i { color: #a78bfa; }
.ai-dock-alt { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-dock-head .icon-btn { width: 34px; height: 34px; font-size: 15px; color: var(--text-2); }
.ai-dock-head .icon-btn:hover { color: var(--text); }
#agent-save.on i { color: #a78bfa; font-weight: 900; }
.ai-dock-kota { padding: 6px 14px 8px; border-bottom: 1px solid var(--line); flex: none; }
.ai-dock .agent-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 14px 8px; max-width: none; margin: 0; }
.ai-dock .agent-chat-log { gap: 12px; padding: 0; }
.ai-dock .bubble { font-size: 14.5px; line-height: 1.6; max-width: 92%; border-radius: 18px; padding: 10px 14px; }
.ai-dock .bubble.me { border-bottom-right-radius: 6px; }
.ai-dock .bubble.ai { background: transparent; border: 0; padding: 4px 2px 24px; max-width: 100%; }
.ai-dock .bubble.ai.hint { background: var(--bg-3); border-radius: 14px; padding: 12px 14px; color: var(--text-2); font-size: 13.5px; }
.ai-dock .bubble.ai.draft { background: var(--bg-3); border: 1px solid rgba(139, 92, 246, .4); padding: 12px 14px; }
.ai-dock .bubble .speak { top: auto; bottom: 0; left: 0; right: auto; width: 26px; height: 22px; font-size: 12px; }
.ai-dock .bubble.ai.hint .speak { display: none; }
/* Saklanan sohbetler */
.ai-dock .agent-pane { position: relative; }
.agent-saved { position: absolute; inset: 53px 0 0 0; z-index: 5; background: var(--bg-2); display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.agent-saved[hidden] { display: none; }
.agent-saved-head { display: flex; align-items: center; padding: 10px 8px 10px 14px; border-bottom: 1px solid var(--line); }
.agent-saved-list { flex: 1; overflow-y: auto; padding: 6px; }
.saved-row { display: flex; align-items: center; gap: 4px; border-radius: 10px; }
.saved-row:hover { background: var(--bg-hover); }
.saved-ac { flex: 1; min-width: 0; text-align: left; padding: 10px; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.saved-ac strong { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-ac small { color: var(--text-3); font-size: 12px; }
/* Yazma kutusu */
.ai-composer { flex: none; padding: 6px 12px calc(12px + env(safe-area-inset-bottom)); background: var(--bg-2); }
.ai-chips { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.ai-chips:not(:has(> :not([hidden]))) { display: none; }
.ai-composer .agent-context { margin: 0; width: 100%; max-width: none; border-radius: 10px; font-size: 12.5px; padding: 5px 8px; }
.ai-ekran { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); padding: 0 4px; }
.ai-ekran[hidden] { display: none; }
.ai-ekran span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Tek satır: yazı solda, mikrofon ve gönder sağda; yazı uzadıkça kutu yukarı büyür, düğmeler altta kalır */
.agent-chat-form.ai-box { display: flex; flex-direction: row; align-items: flex-end; gap: 4px; max-width: none; width: auto; margin: 0; padding: 6px 6px 6px 16px; border: 1px solid var(--line); border-radius: 24px; background: var(--bg); box-shadow: 0 2px 12px rgba(0, 0, 0, .12); }
.agent-chat-form.ai-box:focus-within { border-color: rgba(139, 92, 246, .6); }
.agent-chat-form.ai-box textarea { flex: 1 1 auto; align-self: center; width: auto; min-width: 0; min-height: 24px; max-height: none; height: 24px; margin: 6px 0; padding: 0; border: 0; border-radius: 0; background: transparent; resize: none; outline: none; font-size: 15px; line-height: 1.6; color: var(--text); overflow-y: hidden; }
.ai-box-row { display: flex; align-items: center; gap: 2px; flex: none; }
#agent-tts-toggle.on, #agent-genis.on { color: #a78bfa; }
/* Geniş panel (masaüstü): sohbet okunaklı genişlikte ortalanır */
.ai-dock.genis { --dock-w: min(880px, calc(100vw - var(--rail-w) - 360px)); }
.ai-dock.genis .agent-chat-log, .ai-dock.genis .ai-composer > * { max-width: 760px; margin-left: auto; margin-right: auto; }
@media (max-width: 760px) { .only-desktop { display: none !important; } }
.ai-box-btn { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); font-size: 15px; }
.ai-box-btn:hover { background: var(--bg-hover); color: var(--text); }
.ai-box-btn[hidden] { display: none; }
#agent-tts-toggle.ai-box-btn.on { color: #34d399; }
.ai-box-ipucu { font-size: 11px; color: var(--text-3); margin-right: 8px; white-space: nowrap; }
.ai-send { width: 36px; height: 36px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; background: var(--bg-3); color: var(--text-3); transition: background .15s; cursor: pointer; flex: none; }
.ai-send.dolu { background: linear-gradient(135deg, #8b5cf6, var(--primary)); color: #fff; }
.ai-send:disabled { opacity: .5; cursor: progress; }
@media (max-width: 760px) {
  .ai-dock-head { padding: calc(8px + env(safe-area-inset-top)) 4px 6px 12px; }
  .ai-box-ipucu { display: none; }
  .agent-chat-form.ai-box textarea { font-size: 16px; height: 26px; }
  .ai-composer { padding-bottom: 10px; }
  .agent-saved { inset: 56px 0 0 0; }
}

/* ---------- Notlar sekmesi ---------- */
.ws-notes { background: var(--bg); }
.notlar-yan { width: 240px; flex: none; border-right: 1px solid var(--line); background: var(--bg-2); display: flex; flex-direction: column; padding: 14px 10px; gap: 8px; overflow-y: auto; }
.notlar-yan-bas { display: flex; align-items: center; padding: 0 4px; }
.notlar-yan-bas strong { font-family: var(--font-head); font-size: 17px; }
.notlar-listeler { display: flex; flex-direction: column; gap: 2px; }
.not-liste { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text-2); text-align: left; font-size: 14px; }
.not-liste i { width: 18px; text-align: center; color: #fbbf24; }
.not-liste span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.not-liste small { font-size: 12px; color: var(--text-3); font-weight: 600; }
.not-liste:hover { background: var(--bg-hover); color: var(--text); }
.not-liste.active { background: var(--bg-active); color: var(--text); font-weight: 600; }
.not-liste-form { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); margin-top: 6px; }
.not-liste-form[hidden] { display: none; }
.not-liste-form input, .not-liste-form select { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); }
.not-liste-form .row, .not-duzen .row { display: flex; justify-content: flex-end; gap: 6px; }
.notlar-ana { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.notlar-bas { display: flex; align-items: center; gap: 10px; padding: 16px 20px 8px; }
.notlar-bas h2 { font-size: 21px; }
.notlar-bas-sol { min-width: 0; }
.notlar-tur { font-size: 12px; color: var(--text-3); }
.notlar-gizle { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.notlar-gizle[hidden], #not-liste-duzenle[hidden] { display: none; }
.not-ekle { display: flex; align-items: center; gap: 10px; margin: 4px 20px 12px; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.not-ekle > i { color: var(--text-3); }
.not-ekle input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 15px; padding: 8px 0; color: var(--text); }
.not-ekle.kart { flex-wrap: wrap; align-items: flex-start; padding: 10px 10px 10px 14px; }
.not-ekle.kart > i { margin-top: 10px; }
.not-ekle.kart textarea { flex-basis: 100%; order: 3; border: 0; border-top: 1px solid var(--line); background: transparent; outline: none; resize: vertical; padding: 8px 0 0 24px; font-size: 14px; color: var(--text); min-height: 48px; font: inherit; }
.not-ekle textarea[hidden] { display: none; }
.not-ekle:focus-within { border-color: var(--primary); }
.notlar-icerik { flex: 1; overflow-y: auto; padding: 0 20px 24px; }
.notlar-bos { text-align: center; color: var(--text-3); padding: 40px 20px; }
.notlar-bos i { font-size: 34px; opacity: .5; }
.notlar-bos p { margin-top: 10px; font-size: 14px; }
.not-madde { display: flex; align-items: flex-start; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.not-tik input { display: none; }
.not-tik span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--text-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin-top: 1px; transition: background .15s, border-color .15s; }
.not-tik span i { font-size: 11px; color: transparent; }
.not-tik input:checked + span { background: #10b981; border-color: #10b981; }
.not-tik input:checked + span i { color: #fff; }
.not-metin { flex: 1; min-width: 0; }
.not-m-baslik { font-size: 15px; overflow-wrap: anywhere; }
.not-m-icerik { font-size: 13px; color: var(--text-2); white-space: pre-wrap; margin-top: 2px; }
.not-madde.yapildi .not-m-baslik { text-decoration: line-through; color: var(--text-3); }
.not-madde.yapildi .not-m-icerik { color: var(--text-3); }
.not-acts { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.not-madde:hover .not-acts { opacity: 1; }
.not-acts .icon-btn, .not-k-bas .icon-btn { width: 30px; height: 30px; font-size: 13px; }
.not-temizle { margin: 12px 6px; font-size: 13px; color: var(--text-3); }
.notlar-icerik.kart-gorunum { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; align-content: start; }
.not-kart { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); padding: 12px 12px 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.not-kart.sabit { border-color: rgba(251, 191, 36, .55); }
.not-kart.sabit [data-not="sabit"] { color: #fbbf24; }
.not-k-bas { display: flex; align-items: center; gap: 2px; }
.not-k-bas strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.not-k-icerik { font-size: 14px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow-y: auto; }
.not-k-tarih { font-size: 11px; color: var(--text-3); }
.not-duzen { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--primary); border-radius: 12px; background: var(--bg-2); margin: 6px 0; }
.not-duzen input, .not-duzen textarea { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.kart-gorunum .not-duzen { margin: 0; }
@media (max-width: 760px) {
  .ws-notes { flex-direction: column; }
  .notlar-yan { width: 100%; flex-direction: row; align-items: center; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; flex: none; }
  .notlar-yan-bas strong { display: none; }
  .notlar-listeler { flex-direction: row; gap: 4px; }
  .not-liste { white-space: nowrap; padding: 7px 10px; }
  .not-liste span { overflow: visible; }
  .not-liste-form { position: fixed; left: 12px; right: 12px; top: 60px; z-index: 30; box-shadow: var(--shadow); }
  .notlar-bas { padding: 12px 14px 6px; }
  .not-ekle { margin: 4px 14px 10px; }
  .notlar-icerik { padding: 0 14px 20px; }
  .not-acts { opacity: 1; }
}

/* ---------- Sabah özeti paneli (Mail sekmesi) ---------- */
.nav-ozet i { color: #fbbf24; }
.ws-ozet { background: var(--bg); }
.ozet-panel { flex: 1; overflow-y: auto; padding: 22px 28px 40px; }
.ozet-izgara { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; max-width: 1200px; }
.ozet-izgara .ozet-blok { margin-bottom: 0; }
.ozet-izgara .ozet-blok.genis { grid-column: 1 / -1; }
.ozet-not { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.ozet-not:hover { background: var(--bg-hover); }
.ozet-not span { font-size: 13px; color: var(--text-2); white-space: pre-wrap; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ozet-not i { color: #fbbf24; font-size: 12px; }
.rail-btn[data-tab="ozet"] i { color: #fbbf24; }
.ozet-panel[hidden] { display: none; }
.ozet-yukleniyor, .ozet-bos { padding: 40px; text-align: center; color: var(--text-3); }
.ozet-bas { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ozet-bas > i { font-size: 26px; color: #fbbf24; }
.ozet-bas h2 { font-size: 22px; }
.ozet-blok { border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); padding: 14px 16px; margin-bottom: 14px; }
.ozet-blok h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ozet-ajanda { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.ozet-ajanda li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.ozet-ajanda .saat { min-width: 52px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ozet-ajanda i { color: #60a5fa; width: 16px; text-align: center; }
.ozet-liste { margin-bottom: 10px; }
.ozet-liste ul { margin: 4px 0 0 18px; font-size: 14px; color: var(--text-2); }
.ozet-alt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ozet-alt select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
@media (max-width: 760px) { .ozet-panel { padding: 12px 14px 24px; } }

/* ---------- Tema ---------- */
.tema-baslik { font-weight: 600; font-size: 13px; color: var(--text-2); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .05em; }
.tema-hazir { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.tema-kart { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px; border: 2px solid var(--line); border-radius: 14px; background: var(--bg-3); text-align: left; color: var(--text); }
.tema-kart:hover { border-color: var(--text-3); }
.tema-kart.secili { border-color: var(--primary); }
.tema-kart strong { font-size: 13.5px; margin-top: 6px; }
.tema-kart small { font-size: 11.5px; color: var(--text-3); }
.tema-onizleme { width: 100%; height: 62px; border-radius: 9px; display: flex; overflow: hidden; background: #111827; border: 1px solid rgba(255,255,255,.08); }
.tema-kart.acik .tema-onizleme { background: #f4f5f9; border-color: rgba(15,23,42,.1); }
.o-yan { width: 22%; background: rgba(255,255,255,.06); }
.tema-kart.acik .o-yan { background: #fff; }
.o-govde { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.o-satir { height: 6px; border-radius: 3px; background: rgba(148,163,184,.45); width: 80%; }
.o-satir.kisa { width: 50%; }
.o-dugme { margin-top: auto; height: 12px; width: 46%; border-radius: 6px; background: var(--o); }
.tema-renk { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tema-renk input[type=color] { width: 44px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 2px; cursor: pointer; }
.tema-alt { margin-top: 12px; }
/* Sade simgeler: renkli simgeler yazı rengini alır */
body.sade-simge .rail-btn i, body.sade-simge .nav-ozet i, body.sade-simge .not-liste i, body.sade-simge .ai-dock-baslik strong i,
body.sade-simge .rail-ai i, body.sade-simge .nav-calendar i, body.sade-simge .ozet-bas > i, body.sade-simge .ozet-ajanda i { color: inherit !important; }
/* Köşeler */
body.kose-keskin { --radius: 4px; --radius-sm: 3px; }
body.kose-keskin .bubble, body.kose-keskin .agent-chat-form.ai-box, body.kose-keskin .not-kart, body.kose-keskin .ozet-blok, body.kose-keskin .rail-btn { border-radius: 6px; }
body.kose-cok { --radius: 18px; --radius-sm: 12px; }
/* Büyük yazı (okuma kolaylığı) */
body.yazi-buyuk { zoom: 1.12; }
.etiket-kisa { display: none; }
@media (max-width: 760px) { .etiket-uzun { display: none; } .etiket-kisa { display: inline; } }
/* Düzenli hatırlatıcılar */
.not-ekle[hidden] { display: none; }
.duzenli-form { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); margin-bottom: 16px; max-width: 760px; }
.duzenli-form input[type=text], .duzenli-form select, .duzenli-form input[type=time], .duzenli-form input[type=date] { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.duzenli-form > input[type=text] { width: 100%; }
.duzenli-satir { display: flex; flex-wrap: wrap; gap: 10px; }
.duzenli-satir label, .duzenli-cb { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.duzenli-satir label[hidden] { display: none; }
.duzenli-form .row { display: flex; justify-content: flex-end; }
.duzenli-liste { max-width: 760px; }
.duzenli-kayit { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.duzenli-kayit > i { color: #a78bfa; }
/* Sabah özeti kartları (yapay zekanın başlattığı sohbet) */
.sabah-kartlar { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.sabah-kart { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-3); text-align: left; color: var(--text); white-space: normal; }
.sabah-kart:hover { border-color: var(--primary); }
.sabah-kart i { margin-top: 3px; width: 16px; text-align: center; }
.sabah-kart.mail i { color: #818cf8; } .sabah-kart.ajanda i { color: #60a5fa; } .sabah-kart.liste i { color: #fbbf24; }
.sabah-kart span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sabah-kart strong { font-size: 13.5px; font-weight: 600; }
.sabah-kart small { font-size: 12px; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
body.sade-simge .sabah-kart i { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  .ai-dock, .rail-btn.rail-ai .ai-cekmece { transition: none; }
  .rail-ai .pill.on { animation: none !important; }
}

/* Klavye kısayolları listesi */
.shortcuts-card { max-width: 520px; }
.shortcuts-list { display: flex; flex-direction: column; margin-top: 10px; }
.shortcut-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.shortcut-row:last-child { border-bottom: 0; }
.shortcut-keys { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; }
.shortcut-keys i { font-style: normal; font-size: 12px; color: var(--text-3); margin: 0 4px; }
.shortcut-keys kbd {
  font-family: inherit; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
  background: var(--bg-hover); border: 1px solid var(--line); border-bottom-width: 2px; color: var(--text);
}

/* Uygulama ayarları (sağ çubuktaki dişli) */
.rail-ayar i { color: var(--text-2); }
.app-settings-card { max-width: 900px; }
.sabah-secimler { display: flex; flex-direction: column; }
.sabah-alt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.sabah-alt .spacer { flex: 1; }
#sabah-saat { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); color-scheme: dark; }
body.light-theme #sabah-saat { color-scheme: light; }
.hesap-bilgi { display: flex; flex-direction: column; }
.hesap-satir { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hesap-satir > span:last-child { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.hesap-kutu { display: inline-flex; align-items: center; gap: 7px; }
.hesap-kutu .dot { width: 8px; height: 8px; border-radius: 50%; }
.hesap-alt { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* Günün özeti: durum raporu */
.rapor-blok { border-color: rgba(var(--vurgu-rgb), .35); }
.rapor-metin { font-size: 14px; line-height: 1.6; }
.rapor-metin h4 { font-size: 13.5px; margin: 12px 0 4px; color: var(--text); }
.rapor-metin h4:first-child { margin-top: 0; }
.rapor-metin p { margin: 0 0 6px; color: var(--text-2); }
.rapor-metin ul { margin: 0 0 4px; padding-left: 18px; }
.rapor-metin li { margin: 2px 0; }
[data-apane="sabah"] .switch-row select { width: auto; min-width: 230px; max-width: 60%; }

/* İleri tarihli mail + oto mesai */
.sched-menu { position: relative; }
.sched-list { min-width: 250px; }
#compose-sched-quick { display: flex; flex-direction: column; }
.sched-custom { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); align-items: center; }
.sched-custom input { flex: 1; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; color-scheme: dark light; }
.planli-uyari { display: flex; gap: 8px; align-items: center; margin: 0 12px 8px 16px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(239, 68, 68, .12); color: #f87171; border: 1px solid rgba(239, 68, 68, .35); font-size: 13px; text-align: left; width: calc(100% - 28px); cursor: pointer; }
.planli-uyari u { margin-left: auto; white-space: nowrap; }
.nav-item .badge.badge-hata { background: #ef4444; color: #fff; }
.planli-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 10px 14px 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.planli-row:hover, .planli-row.active { background: var(--bg-hover); }
.planli-row .avatar { grid-row: span 2; display: flex; align-items: center; justify-content: center; }
.planli-row .p-to { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planli-row .p-subj { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.planli-row .p-when { font-size: 12px; color: var(--primary); white-space: nowrap; }
.planli-row .p-err { font-size: 12px; color: #f87171; white-space: nowrap; }
.planli-row .btn { padding: 4px 10px; font-size: 12px; }
.planli-row.hata .avatar { background: #ef4444 !important; }
.planli-view { padding: 20px 24px; overflow: auto; height: 100%; }
.planli-view h2 { font-size: 20px; margin: 0 0 10px; }
.planli-view .pv-meta { color: var(--text-2); font-size: 14px; line-height: 1.7; margin-bottom: 14px; word-break: break-word; }
.planli-view .pv-when { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: rgba(var(--vurgu-rgb), .15); color: var(--primary); font-weight: 600; font-size: 14px; }
.planli-view .pv-when.hata { background: rgba(239, 68, 68, .15); color: #f87171; }
.planli-view .pv-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.planli-view .pv-zaman { display: flex; gap: 6px; align-items: center; margin: 0 0 12px; }
.planli-view .pv-zaman input { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; color-scheme: dark light; }
.planli-view .pv-body { white-space: pre-wrap; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; font-size: 14px; line-height: 1.6; word-break: break-word; }
.undo-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; gap: 14px; align-items: center; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 999px; padding: 10px 12px 10px 18px; font-size: 14px; }
.undo-toast button { font-weight: 700; color: var(--primary); padding: 4px 10px; border-radius: 999px; }
.undo-toast button:hover { background: var(--bg-hover); }
.mesai-saat { display: flex; gap: 6px; align-items: center; }
.mesai-saat input, .mesai-izin-ekle input { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; color-scheme: dark light; }
.mesai-blok { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.mesai-gunler { display: flex; gap: 6px; flex-wrap: wrap; }
.mesai-gunler label { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 13px; }
.mesai-gunler label.on { background: rgba(var(--vurgu-rgb), .18); border-color: var(--primary); color: var(--primary); }
.mesai-gunler input { display: none; }
.mesai-izinler { display: flex; flex-direction: column; gap: 6px; }
.mesai-izinler .izin { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; padding: 6px 10px; background: var(--bg-2); border-radius: 8px; }
.mesai-izin-ekle { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mesai-izin-ekle input[type=text] { flex: 1; min-width: 140px; }
.mesai-tatiller { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); line-height: 1.7; }
@media (max-width: 760px) { .undo-toast { bottom: 80px; } .planli-view { padding: 16px; } }

/* Yapay zeka modu */
.ws-aimod { background: var(--bg); }
.aimod { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; max-width: 980px; margin: 0 auto; width: 100%; }
.aimod-head { padding: 14px 20px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.aimod-title { font-weight: 700; font-size: 17px; display: flex; gap: 8px; align-items: center; }
.aimod-title i { color: #f472b6; }
.aimod-title small { font-weight: 600; font-size: 11px; color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.aimod-sekmeler { display: flex; gap: 6px; flex-wrap: wrap; }
.aimod-sekmeler button { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--text-2); }
.aimod-sekmeler button:hover { color: var(--text); background: var(--bg-hover); }
.aimod-akis { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.aimod-msg { max-width: 100%; font-size: 14px; line-height: 1.6; }
.aimod-msg p { margin: 0 0 8px; }
.aimod-ben { align-self: flex-end; max-width: 75%; background: rgba(var(--vurgu-rgb), .18); padding: 8px 14px; border-radius: 16px 16px 4px 16px; }
.aimod-o { align-self: stretch; }
.aimod-hata { color: #f87171; }
.aimod-yaziyor { display: inline-flex; gap: 4px; padding: 8px 0; }
.aimod-yaziyor i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); animation: aimodNokta 1s infinite ease-in-out; }
.aimod-yaziyor i:nth-child(2) { animation-delay: .15s; } .aimod-yaziyor i:nth-child(3) { animation-delay: .3s; }
@keyframes aimodNokta { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.aimod-kartlar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.aimod-kart { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.aimod-kart.tam { grid-column: 1 / -1; }
.aimod-kart h4 { margin: 0 0 8px; font-size: 14px; }
.aimod-mail { padding: 8px 0; border-top: 1px solid var(--line); }
.aimod-mail:first-of-type { border-top: 0; }
.aimod-mail.yeni .am-konu { font-weight: 700; }
.am-ust { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.am-ust span { color: var(--text-2); white-space: nowrap; }
.am-konu { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-butonlar { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.am-butonlar button, .aimod-satir button { font-size: 12px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); }
.am-butonlar button:hover, .aimod-satir button:hover { color: var(--text); background: var(--bg-hover); }
.am-govde { white-space: pre-wrap; font-size: 13px; background: var(--bg); border-radius: 8px; padding: 10px; margin-top: 6px; max-height: 320px; overflow: auto; }
.aimod-gun { padding: 6px 0; border-top: 1px solid var(--line); }
.aimod-gun:first-of-type { border-top: 0; }
.ag-ad { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.ag-kayit { display: grid; grid-template-columns: 64px 1fr; gap: 8px; font-size: 13px; padding: 2px 0; }
.aimod-satir { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.aimod-satir:first-of-type { border-top: 0; }
.aimod-satir.acil b::before { content: '● '; color: #ef4444; }
.aimod-taslak .at-satir { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.aimod-taslak .at-satir span { color: var(--text-2); }
.aimod-taslak input, .aimod-taslak textarea { width: 100%; background: transparent; color: var(--text); border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; font: inherit; font-size: 13px; }
.aimod-taslak textarea { margin-top: 6px; resize: vertical; line-height: 1.6; font-size: 14px; background: var(--bg); }
.aimod-taslak.duzenleniyor input, .aimod-taslak.duzenleniyor textarea { border-color: var(--primary); background: var(--bg); }
.at-butonlar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.at-durum { margin-top: 10px; font-size: 13px; color: var(--primary); font-weight: 600; }
.aimod-oneri { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(250, 204, 21, .1); border: 1px solid rgba(250, 204, 21, .3); font-size: 13px; }
.aimod-oneri i { color: #facc15; }
.aimod-oneri span { flex: 1; }
.aimod-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.aimod-form textarea { flex: 1; resize: none; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font: inherit; font-size: 14px; max-height: 160px; }
.aimod-form textarea:focus { outline: none; border-color: var(--primary); }
.rail-btn[data-tab="aimod"] i { color: #f472b6; }
@media (max-width: 760px) {
  .aimod-kartlar { grid-template-columns: minmax(0, 1fr); }
  .aimod-head, .aimod-akis, .aimod-form { padding-left: 12px; padding-right: 12px; }
  .aimod-ben { max-width: 88%; }
}
@media (max-width: 760px) {
  .compose-foot { flex-wrap: wrap; row-gap: 8px; }
  .compose-foot .btn-ghost span { display: none; }
  .compose-foot #compose-send-now span { display: inline; }
  .compose-foot #compose-send { flex: 1 1 auto; justify-content: center; }
}

/* Sıralama menüsü (genel açılır menü) */
.sort-wrap { position: relative; }
.pop-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 60; min-width: 230px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.pop-menu .pop-title { font-size: 12px; color: var(--text-3); padding: 4px 10px 6px; text-transform: uppercase; letter-spacing: .04em; }
.pop-menu button { display: flex; align-items: center; gap: 10px; text-align: left; background: none; border: 0; color: var(--text); font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.pop-menu button:hover { background: var(--bg-hover); }
.pop-menu button i { width: 14px; color: var(--primary); visibility: hidden; }
.pop-menu button.on i { visibility: visible; }
.pop-menu button.on { font-weight: 600; }
.msg-size { color: var(--text-3); font-size: 11px; margin-right: 4px; }
/* Geri dönen mail satırı (Gönderilmiş'in en üstünde) */
.msg.bounce { background: rgba(239, 68, 68, .07); border-left: 3px solid var(--danger); }
.avatar.bounce-x { background: var(--danger) !important; color: #fff; }
.bounce-why { color: #f87171; font-weight: 600; white-space: nowrap; margin-right: 6px; }
.bounce-close { width: 22px; height: 22px; font-size: 11px; margin-right: 4px; vertical-align: middle; }

/* Gelişmiş arama: nerede arayayım seçenekleri, ayrıntılı süzgeçler, sonuç alıntısı */
.arama-secenek { margin: -4px 12px 8px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.arama-secenek[hidden] { display: none; }
.as-satir { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.as-satir[hidden] { display: none; }
.as-et { color: var(--text-3); margin-right: 2px; }
.as-satir button { border: 1px solid var(--line); background: var(--bg-2); color: var(--text-2); border-radius: 999px; padding: 3px 10px; font: inherit; cursor: pointer; }
.as-satir button.on { background: rgba(var(--vurgu-rgb), .18); border-color: rgba(var(--vurgu-rgb), .55); color: var(--text); font-weight: 600; }
.as-satir .as-ayr { margin-left: auto; }
.as-ayrinti { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.as-ayrinti[hidden] { display: none; }
.as-ayrinti label { display: flex; flex-direction: column; gap: 3px; color: var(--text-3); }
.as-ayrinti input:not([type=checkbox]) { background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 13px; color-scheme: dark; }
body.light-theme .as-ayrinti input:not([type=checkbox]) { color-scheme: light; }
.as-ayrinti .as-kutu { flex-direction: row; align-items: center; gap: 6px; color: var(--text-2); }
.as-ayrinti #as-temizle { grid-column: 1 / -1; justify-self: start; font-size: 12.5px; padding: 4px 10px; }
.as-durum { color: var(--text-3); font-size: 12px; }
.as-durum[hidden] { display: none; }
.msg-snip { grid-column: 2 / span 2; font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-snip i { font-size: 11px; margin-right: 2px; }
.msg mark, .msg-snip mark { background: rgba(253, 224, 71, .85); color: #111; border-radius: 2px; padding: 0 1px; }
.arama-bulundu { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; color: var(--text-2); background: rgba(253, 224, 71, .12); border-bottom: 1px solid var(--line); }
.arama-bulundu[hidden] { display: none; }
.arama-bulundu span { margin-right: auto; }
.arama-bulundu .icon-btn { width: 28px; height: 28px; }
@media (max-width: 760px) { .as-ayrinti { grid-template-columns: 1fr; } .as-ayrinti input:not([type=checkbox]) { font-size: 16px; } }

/* Hatırlatıcı planla (yazma penceresi) */
.hat-menu { position: relative; }
#compose-hat-btn.on { color: #a78bfa; border-color: rgba(139, 92, 246, .5); background: rgba(139, 92, 246, .12); }
.hat-panel { position: absolute; bottom: 44px; left: 0; z-index: 6; width: min(380px, calc(100vw - 32px)); background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.hat-panel[hidden] { display: none; }
.hat-panel h4 { font-size: 15px; display: flex; gap: 8px; align-items: center; }
.hat-panel h4 i { color: #a78bfa; }
.hat-aciklama { color: var(--text-2); line-height: 1.5; }
.hat-etiket { color: var(--text-3); font-size: 12px; margin-bottom: -4px; }
.hat-secenek { display: flex; flex-wrap: wrap; gap: 6px; }
.hat-secenek button { border: 1px solid var(--line); background: var(--bg); color: var(--text-2); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.hat-secenek button.on { background: rgba(139, 92, 246, .18); border-color: rgba(139, 92, 246, .6); color: var(--text); font-weight: 600; }
.hat-tarihler { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hat-tarihler[hidden], .hat-ikili[hidden] { display: none; }
.hat-tarih { display: inline-flex; align-items: center; gap: 2px; }
.hat-ikili { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hat-ikili label { display: flex; flex-direction: column; gap: 3px; color: var(--text-3); font-size: 12px; }
.hat-panel input[type=date], .hat-panel select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; color-scheme: dark light; }
.hat-nasil summary { cursor: pointer; color: #a78bfa; font-size: 13px; }
.hat-nasil ul { margin: 8px 0 0 18px; display: flex; flex-direction: column; gap: 5px; color: var(--text-2); line-height: 1.45; font-size: 12.5px; }
.hat-ozet { color: #34d399; font-size: 12.5px; }
.hat-alt { display: flex; align-items: center; gap: 8px; }
.planli-bolum { padding: 12px 16px 6px; font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; display: flex; gap: 6px; align-items: center; }
@media (max-width: 760px) { .hat-panel { position: fixed; left: 12px; right: 12px; bottom: 80px; width: auto; max-height: 70vh; overflow-y: auto; } .hat-panel input[type=date], .hat-panel select { font-size: 16px; } }

/* Kurallar, renkli etiketler, izin ayarları */
.kural-blok { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.kural-baslik { display: flex; flex-direction: column; gap: 2px; }
.etiket-liste { display: flex; flex-wrap: wrap; gap: 6px; }
.etiket-cip { --renk: #64748b; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; background: color-mix(in srgb, var(--renk) 22%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--renk) 60%, transparent); }
.etiket-cip i { color: var(--renk); font-size: 11px; }
.etiket-cip button { background: none; border: 0; color: var(--text-3); cursor: pointer; padding: 0 0 0 2px; }
.etiket-cip.kucuk { font-size: 10.5px; padding: 0 7px; flex: none; cursor: pointer; }
.etiket-ekle { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.etiket-ekle input[type=text] { flex: 1; min-width: 160px; }
.etiket-ekle input[type=color] { width: 38px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.etiket-suzgec { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--line); }
.kural-liste { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.kural-kart { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.kural-kart.kapali { opacity: .6; }
.kural-ust { display: flex; gap: 8px; align-items: center; }
.kural-ust .kural-ad { flex: 1; font-weight: 600; }
.kural-acik { display: inline-flex; gap: 5px; align-items: center; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.kural-bolum { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.kural-izgara { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kural-izgara label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-3); }
.kural-kart input[type=text], .kural-kart input[type=email], .kural-kart select, .izin-ikili input, #izin-konu, #izin-metin, .etiket-ekle input[type=text] { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 13.5px; color-scheme: dark light; }
.kural-kutular { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; grid-column: 1 / -1; font-size: 13px; color: var(--text-2); }
.kural-kutular label { flex-direction: row; align-items: center; gap: 5px; color: var(--text-2); font-size: 13px; }
.kural-alt, .izin-alt { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.kural-bos { padding: 10px 2px; }
.izin-ikili { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.izin-ikili label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--text-3); }
.izin-hesaplar { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
#izin-metin { width: 100%; resize: vertical; line-height: 1.5; }
@media (max-width: 760px) { .kural-izgara, .izin-ikili { grid-template-columns: 1fr; } .kural-kart input, .kural-kart select { font-size: 16px; } }

/* Konuşma görünümü */
.konusma-sayi { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--bg-3); color: var(--text-2); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.konusma-serit { display: flex; align-items: center; gap: 6px; padding: 8px 12px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--bg-2); scrollbar-width: thin; }
.konusma-serit[hidden] { display: none; }
.konusma-baslik { font-size: 12px; color: var(--text-3); white-space: nowrap; margin-right: 4px; }
.konusma-cip { flex: none; border: 1px solid var(--line); background: var(--bg); color: var(--text-2); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.konusma-cip.ben { border-style: dashed; }
.konusma-cip.yeni { font-weight: 700; color: var(--text); }
.konusma-cip.on { background: rgba(var(--vurgu-rgb), .18); border-color: rgba(var(--vurgu-rgb), .6); color: var(--text); }

/* Zengin metin yazma */
.bicim-cubugu { display: flex; align-items: center; gap: 2px; padding: 6px 2px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bicim-cubugu[hidden] { display: none; }
.bicim-cubugu button, .bicim-cubugu label { width: 32px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--text-2); border-radius: 6px; cursor: pointer; font-size: 13px; position: relative; }
.bicim-cubugu button:hover, .bicim-cubugu label:hover { background: var(--bg-hover); color: var(--text); }
.bicim-renk input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.bicim-ayrac { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.compose-rich { flex: 1; min-height: 160px; overflow-y: auto; padding: 14px 4px; line-height: 1.6; outline: none; font-size: 15px; color: var(--text); word-wrap: break-word; overflow-wrap: anywhere; }
.compose-rich[hidden] { display: none; }
.compose-rich:empty::before { content: attr(data-placeholder); color: var(--text-3); pointer-events: none; }
.compose-rich blockquote { border-left: 3px solid var(--line); margin: 6px 0; padding-left: 12px; color: var(--text-2); }
.compose-rich .dm-alinti { margin-top: 12px; color: var(--text-2); }
.compose-rich img { max-width: 100%; height: auto; border-radius: 4px; }
.compose-rich a { color: #818cf8; }
.compose-rich ul, .compose-rich ol { padding-left: 24px; }

/* Abonelikten çık, mail hatırlatma */
.abonelik-serit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.abonelik-butonlar { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.ab-tamam { color: #34d399; font-size: 13px; }
.mhat-serit { display: flex; align-items: center; gap: 10px; color: #fbbf24; }
.mhat-serit button { margin-left: auto; }
.mhat-zil { color: #fbbf24; font-size: 11px; }
.acilir-menu { position: fixed; z-index: 200; min-width: 250px; }

/* Ekipler */
.ekip-liste { display: flex; flex-direction: column; gap: 8px; }
.ekip-kart { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.ekip-uye { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ekip-uye span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ekip-uye select, .ekip-uye-ekle input { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; font: inherit; font-size: 13px; }
.ekip-uye-ekle { display: flex; gap: 6px; }
.ekip-uye-ekle input { flex: 1; }

/* Büyük ekler (bağlantıyla) */
.att.buyuk-ek { border-color: rgba(var(--vurgu-rgb), .5); }
.att.buyuk-ek i { color: #818cf8; }
.buyuk-satir { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 13px; }
.buyuk-satir .bd-ad { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* Toplantı saati önerme (yazma penceresi) */
.bicim-cubugu .bicim-metinli { width: auto; padding: 0 10px; gap: 6px; font-size: 12.5px; }
.randevu-panel { border: 1px solid rgba(var(--vurgu-rgb), .45); border-radius: 10px; padding: 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; background: var(--bg-2); max-height: 46vh; overflow-y: auto; }
.randevu-panel[hidden] { display: none; }
.rp-ust { display: flex; align-items: center; justify-content: space-between; }
.rp-satir { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.rp-satir select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 13px; }
.rp-gunler, .rp-cipler { display: flex; flex-wrap: wrap; gap: 5px; }
.rp-gunler button, .rp-cipler button { border: 1px solid var(--line); background: var(--bg); color: var(--text-2); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.rp-gunler button.on, .rp-cipler button.on { background: rgba(var(--vurgu-rgb), .2); border-color: rgba(var(--vurgu-rgb), .6); color: var(--text); font-weight: 600; }
.rp-gun { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.rp-alt { display: flex; align-items: center; gap: 8px; }

/* İletilen mail (gövdede): asıl mail beyaz zeminde, kendi renkleriyle düzenlenir */
.compose-rich .dm-ilet { background: #fff; color: #111827; border-radius: 6px; padding: 12px; margin-top: 4px; overflow-x: auto; }
.compose-rich .dm-ilet a { color: #4f46e5; }
.acilir-menu [data-ilet] { align-items: flex-start; line-height: 1.35; }
.acilir-menu [data-ilet] i { visibility: visible; margin-top: 3px; }
.acilir-menu [data-ilet].on { background: var(--bg-hover); }

/* Block Editor: yapay zekânın tek tıkla uygulanan önerileri */
.be-oneriler { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.be-oneri-baslik { font-size: 12px; font-weight: 700; color: var(--muted, #64748b); text-transform: uppercase; letter-spacing: .04em; }
.be-oneri { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border, #e2e8f0); border-radius: 10px; background: var(--card, #fff); }
.be-oneri > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.be-oneri > div span { color: var(--muted, #64748b); font-size: 12px; }
.be-oneri .btn { flex-shrink: 0; padding: 4px 10px; font-size: 12px; }

/* Günün özeti: cevap bekleyen / cevaplanan mailler, bekleyen / tamamlanan işler */
.ozet-bas .btn { display: inline-flex; align-items: center; gap: 6px; }
.ozet-durum { max-width: 1200px; margin: 0 0 14px; padding: 12px 16px; border-radius: 14px; background: var(--card, #fff); border: 1px solid var(--border, #e2e8f0); font-size: 14px; }
.ozet-durum p { margin: 0 0 4px; } .ozet-durum ul { margin: 4px 0 0; padding-left: 18px; }
.ozet-sayi { margin-left: auto; min-width: 26px; padding: 1px 8px; border-radius: 999px; background: var(--chip, #eef2ff); font-size: 12px; font-weight: 700; text-align: center; }
.ozet-kutu h3 { display: flex; align-items: center; gap: 6px; }
.ozet-kutu.sicak .ozet-sayi { background: #fee2e2; color: #b91c1c; }
.ozet-kutu.tamam-kutu .ozet-sayi { background: #dcfce7; color: #15803d; }
.ozet-is { margin: 2px 0 8px; padding-left: 18px; font-size: 13px; }
.ozet-is li { margin: 2px 0; }
.ozet-is.tamam li { color: var(--muted, #64748b); text-decoration: line-through; text-decoration-color: rgba(100, 116, 139, .5); }

/* Yapay zekâ modeli: ayar sekmesi, tek istek düğmesi, yeniden dene */
.yz-satir { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.yz-satir .switch-row { border-bottom: 0; flex-direction: column; align-items: stretch; gap: 8px; padding-bottom: 8px; }
.yz-satir select { width: 100%; min-width: 0; }
.yz-satir .btn-small { margin: 0 0 6px; }
#agent-model { width: auto; min-width: 34px; padding: 0 9px; border-radius: 17px; gap: 6px; }
#agent-model.on { color: #a78bfa; background: rgba(139, 92, 246, .14); }
.yz-model-ad { font-size: 12px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yz-model-ad[hidden] { display: none; }
.yz-menu { max-height: 60vh; overflow-y: auto; min-width: 270px; }
.yz-menu .yz-m { display: flex; flex-direction: column; line-height: 1.35; }
.yz-menu .yz-m small { color: var(--text-3); font-size: 12px; }
.bubble .yz-yeniden { position: absolute; bottom: 0; left: 30px; height: 22px; display: inline-flex; align-items: center; gap: 5px; padding: 0 7px; border-radius: 6px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.bubble .yz-yeniden:hover { color: var(--primary); background: var(--bg-hover); }
.bubble:not(.ai) .yz-yeniden { position: static; margin-top: 6px; }
.yz-model-not { margin-top: 4px; font-size: 12px; }
@media (max-width: 480px) { .yz-model-ad { max-width: 64px; } }

/* Asistan: aramada bulunan mailler */
.ai-bulunan { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ai-bulunan-satir { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); flex-wrap: wrap; }
.ai-bulunan-bilgi { display: flex; flex-direction: column; min-width: 0; flex: 1 1 180px; }
.ai-bulunan-bilgi strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-bulunan-dugme { display: flex; gap: 4px; flex-wrap: wrap; }

/* Yapay zekâ modu: tek sohbet, çizilen ekran, belge paneli */
.aimod-akis #agent-chat-log { display: flex; flex-direction: column; gap: 14px; flex: none; height: auto; overflow: visible; padding: 0; }
.aimod-akis .bubble { max-width: 100%; }
.ekran-cizim { width: 100%; }
.workspace.yz-bolunmus { display: flex; }
.workspace.yz-bolunmus > #ws-aimod { flex: 1 1 45%; min-width: 0; }
.workspace.yz-bolunmus > #ws-be { flex: 1 1 55%; min-width: 0; border-left: 1px solid var(--line); }
@media (max-width: 760px) { .workspace.yz-bolunmus { flex-direction: column; } .workspace.yz-bolunmus > #ws-be { border-left: 0; border-top: 1px solid var(--line); } }
.yz-modu-satir { padding: 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; }
