/* ─── Nebula Mail — futuristic glass UI ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg-0: #070912;
  --bg-1: #0c1022;
  --glass: rgba(20, 26, 48, 0.55);
  --glass-strong: rgba(24, 30, 56, 0.82);
  --stroke: rgba(120, 140, 220, 0.16);
  --stroke-strong: rgba(140, 160, 240, 0.35);
  --txt: #e8ecff;
  --txt-dim: #9aa3c9;
  --txt-faint: #6b74a0;
  --accent: #4de3ff;
  --accent-2: #a06bff;
  --accent-3: #ff6bd6;
  --grad: linear-gradient(120deg, #4de3ff 0%, #a06bff 55%, #ff6bd6 100%);
  --danger: #ff5d73;
  --ok: #45e0a8;
  --inset: rgba(8, 11, 26, 0.6);   /* recessed surfaces: inputs, chips, badges */
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  --body-bg: radial-gradient(1200px 800px at 15% -10%, #16214d 0%, transparent 55%),
             radial-gradient(1000px 700px at 110% 20%, #3a1550 0%, transparent 50%), var(--bg-0);
}

/* ─── Light theme ───────────────────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg-0: #eef1f8;
  --bg-1: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --stroke: rgba(40, 50, 100, 0.14);
  --stroke-strong: rgba(40, 50, 100, 0.30);
  --txt: #1a2138;
  --txt-dim: #55608a;
  --txt-faint: #8b93b5;
  --inset: rgba(30, 45, 100, 0.06);
  --shadow: 0 16px 44px rgba(40, 50, 90, 0.16);
  --body-bg: radial-gradient(1200px 800px at 15% -10%, #dce6ff 0%, transparent 55%),
             radial-gradient(1000px 700px at 110% 20%, #f2e2ff 0%, transparent 50%), var(--bg-0);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--body-bg);
  color: var(--txt);
  overflow: hidden;
}
h1, h2, h3, .brand span { font-family: 'Space Grotesk', sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--txt-dim); font-size: 13px; margin: 4px 0 10px; }

/* Glass surfaces */
.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

/* Brand */
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 26px; margin: 0; letter-spacing: 0.5px; }
.brand.small span { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; }
.brand-orb {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 24px rgba(160, 107, 255, 0.7), inset 0 0 10px rgba(255,255,255,0.4);
  animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); filter: brightness(1);} 50% { transform: scale(1.08); filter: brightness(1.25);} }

/* ─── Login ─────────────────────────────────────────────────────────────── */
.login-screen { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; overflow: hidden; }
.aurora {
  position: absolute; inset: -30%;
  background: conic-gradient(from 0deg, #4de3ff, #a06bff, #ff6bd6, #4de3ff);
  filter: blur(120px); opacity: 0.28;
  animation: spin 22s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-card {
  position: relative; width: 400px; max-width: 92vw; padding: 34px;
  border-radius: 22px; display: flex; flex-direction: column; gap: 14px;
}
.login-card .brand { justify-content: center; margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--txt-dim); margin: -6px 0 12px; }
.login-card label, .field label, .setting-block label:not(.switch) { font-size: 12px; color: var(--txt-dim); display: block; }
.login-card label { display: flex; flex-direction: column; gap: 6px; }
.hint { color: var(--txt-faint); }
input, .editor {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: var(--inset); border: 1px solid var(--stroke);
  color: var(--txt); font-size: 14px; font-family: inherit; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, .editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 227, 255, 0.15);
}
.btn-primary {
  border: none; cursor: pointer; padding: 12px 18px;
  border-radius: 12px; font-weight: 600; font-size: 14px; color: #05060f;
  background: var(--grad); background-size: 180% 180%;
  box-shadow: 0 8px 24px rgba(120, 90, 240, 0.4);
  transition: transform 0.15s, box-shadow 0.2s, background-position 0.4s;
}
.btn-primary:hover { transform: translateY(-1px); background-position: 100% 0; box-shadow: 0 12px 30px rgba(120, 90, 240, 0.55); }
.btn-primary:active { transform: translateY(0); }
.error-line { color: var(--danger); font-size: 13px; min-height: 16px; text-align: center; }

/* ─── App shell ─────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: minmax(0, 1fr); height: 100vh; padding: 14px; gap: 14px; overflow: hidden; }
.sidebar {
  position: relative; min-height: 0;
  border-radius: var(--radius); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px;
}
.sidebar .brand { padding: 4px 6px; }
.compose { margin: 4px 0 6px; }
/* The full folder tree can be long — let it scroll inside the sidebar. */
#folder-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-sep { height: 1px; background: var(--stroke); margin: 4px 0; }
.nav-item, .folder-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 11px; border: none; cursor: pointer;
  background: transparent; color: var(--txt-dim); font-size: 14px; font-family: inherit;
  transition: background 0.18s, color 0.18s;
}
.nav-item:hover, .folder-btn:hover { background: rgba(120, 140, 220, 0.1); color: var(--txt); }
.nav-item.active, .folder-btn.active {
  background: linear-gradient(90deg, rgba(77,227,255,0.16), rgba(160,107,255,0.12));
  color: var(--txt); box-shadow: inset 0 0 0 1px var(--stroke-strong);
}
.folder-btn { justify-content: space-between; padding: 8px 10px; font-size: 13.5px; }
.folder-btn .fname { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; min-width: 0; }
.fname-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcaret { background: none; border: none; color: var(--txt-faint); cursor: pointer; font-size: 9px; width: 14px; flex-shrink: 0; padding: 0; font-family: inherit; }
.fcaret:hover { color: var(--txt); }
.fcaret-sp { display: inline-block; width: 14px; flex-shrink: 0; }
.folder-count { font-size: 11px; color: var(--txt-faint); background: var(--inset); padding: 1px 7px; border-radius: 10px; flex-shrink: 0; }
.folder-count.unread { color: #05060f; background: var(--accent); font-weight: 700; }
.folder-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 0; color: var(--txt-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.icon-btn.sm { width: 24px; height: 24px; font-size: 15px; border-radius: 8px; }
/* Per-folder actions (add subfolder / delete) — revealed on row hover. */
.folder-actions { display: none; align-items: center; gap: 2px; flex-shrink: 0; }
.folder-btn:hover .folder-actions { display: flex; }
.folder-btn:hover .folder-count { display: none; }
.fact { background: none; border: none; color: var(--txt-faint); cursor: pointer; font-size: 13px; width: 20px; height: 20px; border-radius: 6px; padding: 0; line-height: 1; }
.fact:hover { color: var(--txt); background: rgba(120,140,220,0.18); }
.fact.del:hover { color: var(--danger); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.account { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: var(--inset); cursor: pointer; transition: background 0.15s; }
.account:hover { background: rgba(120,140,220,0.12); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 700; color: #05060f; flex-shrink: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.account-meta { overflow: hidden; }
.account-email { font-size: 12px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-sub { font-size: 11px; color: var(--accent); }
.link { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 12px; padding: 0; font-family: inherit; }

/* Account switcher menu */
.account-menu { position: absolute; left: 14px; right: 14px; bottom: 78px; z-index: 45;
  background: var(--glass-strong); backdrop-filter: blur(20px); border: 1px solid var(--stroke-strong);
  border-radius: 14px; padding: 6px; box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; }
.acct-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; cursor: pointer; }
.acct-row:hover { background: rgba(120,140,220,0.12); }
.acct-row.active { background: linear-gradient(90deg, rgba(77,227,255,0.16), rgba(160,107,255,0.12)); }
.acct-email { flex: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-signout { background: none; border: none; color: var(--txt-faint); cursor: pointer; font-size: 13px; flex-shrink: 0; }
.acct-signout:hover { color: var(--danger); }
.acct-sep { height: 1px; background: var(--stroke); margin: 6px 4px; }
.acct-action { width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  color: var(--txt-dim); padding: 9px 10px; border-radius: 10px; font-family: inherit; font-size: 13px; }
.acct-action:hover { background: rgba(120,140,220,0.1); color: var(--txt); }
.acct-action.danger { color: var(--danger); }
.login-close { position: absolute; top: 14px; right: 14px; }
.notif-badge { width: 8px; height: 8px; border-radius: 50%; background: var(--txt-faint); align-self: flex-start; margin-left: 8px; }
.notif-badge.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

/* ─── Views ─────────────────────────────────────────────────────────────── */
.view { min-height: 0; }
.mail-view { display: grid; grid-template-columns: 380px 1fr; gap: 14px; height: 100%; }
.list-pane, .read-pane { border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.pane-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--stroke); }
.pane-head h2 { margin: 0; font-size: 18px; }
.icon-btn { background: rgba(120,140,220,0.08); border: 1px solid var(--stroke); color: var(--txt-dim); cursor: pointer; width: 34px; height: 34px; border-radius: 10px; font-size: 16px; display: grid; place-items: center; transition: 0.18s; }
.icon-btn:hover { color: var(--txt); border-color: var(--stroke-strong); }
.chip-btn { background: rgba(120,140,220,0.1); border: 1px solid var(--stroke); color: var(--txt); cursor: pointer; padding: 7px 14px; border-radius: 10px; font-size: 13px; font-family: inherit; transition: 0.18s; }
.chip-btn:hover { border-color: var(--accent); }

/* Message list */
.message-list { overflow-y: auto; flex: 1; }
.msg-item { padding: 13px 18px; border-bottom: 1px solid rgba(120,140,220,0.07); cursor: pointer; transition: background 0.15s; position: relative; }
.msg-item:hover { background: rgba(120,140,220,0.06); }
.msg-item.active { background: linear-gradient(90deg, rgba(77,227,255,0.12), transparent); box-shadow: inset 3px 0 0 var(--accent); }
.msg-item.unread .msg-from, .msg-item.unread .msg-subject { color: var(--txt); font-weight: 600; }
.msg-item.unread::after { content: ''; position: absolute; right: 16px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.msg-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.msg-from { font-size: 14px; color: var(--txt-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-date { font-size: 11px; color: var(--txt-faint); white-space: nowrap; }
.msg-subject { font-size: 13.5px; color: var(--txt-dim); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-meta { font-size: 11px; color: var(--txt-faint); margin-top: 3px; display: flex; gap: 8px; }
.pill { font-size: 10px; padding: 1px 7px; border-radius: 8px; background: rgba(120,140,220,0.12); color: var(--txt-dim); }
.list-loading, .list-empty { padding: 40px 20px; text-align: center; color: var(--txt-faint); }

/* Reader */
.read-pane { position: relative; }
.reader-empty { flex: 1; display: grid; place-items: center; color: var(--txt-faint); gap: 16px; }
.ghost-orb { width: 90px; height: 90px; border-radius: 50%; background: var(--grad); opacity: 0.18; filter: blur(6px); animation: pulse 5s ease-in-out infinite; }
.reader { display: flex; flex-direction: column; height: 100%; }
.reader-head { padding: 20px 24px; border-bottom: 1px solid var(--stroke); }
.reader-subject { font-size: 20px; margin: 0 0 12px; }
.reader-meta { display: flex; align-items: center; gap: 12px; }
.reader-meta .avatar { width: 42px; height: 42px; font-size: 15px; }
.reader-who { flex: 1; overflow: hidden; }
.reader-name { font-weight: 600; }
.reader-addr { font-size: 12px; color: var(--txt-dim); }
.reader-date { font-size: 12px; color: var(--txt-faint); }
.reader-actions { display: flex; gap: 8px; padding: 12px 24px; border-bottom: 1px solid var(--stroke); flex-wrap: wrap; }
.attachments { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 24px; }
.attach-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 11px; background: var(--inset); border: 1px solid var(--stroke); font-size: 13px; color: var(--txt); text-decoration: none; transition: 0.18s; }
.attach-chip:hover { border-color: var(--accent); }
.attach-chip .sz { color: var(--txt-faint); font-size: 11px; }
.mail-body-frame { flex: 1; width: 100%; border: none; background: #fff; border-radius: 0 0 var(--radius) var(--radius); }

/* ─── Compose / modals ──────────────────────────────────────────────────── */
.compose-overlay { position: fixed; inset: 0; background: rgba(4,6,15,0.6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 50; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.compose-card, .event-card { width: 660px; max-width: 94vw; max-height: 90vh; border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; }
.compose-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--stroke); }
.compose-head h2 { margin: 0; font-size: 17px; }
.field { padding: 10px 20px; border-bottom: 1px solid rgba(120,140,220,0.08); display: flex; align-items: flex-start; gap: 12px; }
.field > label { width: 60px; padding-top: 12px; flex-shrink: 0; }
.field input, .subject-field input { border: none; background: transparent; padding: 12px 0; }
.field input:focus { box-shadow: none; }
.compose-editor { border: none; border-radius: 0; min-height: 200px; max-height: 40vh; overflow-y: auto; padding: 16px 20px; background: transparent; }
.md-toggle.on { color: var(--accent-2); font-weight: 700; }

/* Markdown split editor: source | live preview */
.md-split { display: grid; grid-template-columns: 1fr 1fr; min-height: 220px; max-height: 42vh; border-bottom: 1px solid rgba(120,140,220,0.08); }
.md-input { border: none; border-right: 1px solid var(--stroke); border-radius: 0; resize: none;
  padding: 16px 18px; background: transparent; color: var(--txt);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; overflow-y: auto; }
.md-input:focus { box-shadow: none; }
.md-preview { padding: 16px 18px; overflow-y: auto; font-size: 14px; line-height: 1.5; color: var(--txt); }
.md-preview > :first-child { margin-top: 0; }
.md-preview h1, .md-preview h2, .md-preview h3, .md-preview h4 { margin: .5em 0 .3em; line-height: 1.25; }
.md-preview p { margin: .5em 0; }
.md-preview a { color: var(--accent); }
.md-preview img { max-width: 100%; border-radius: 6px; }
.md-preview code { background: var(--inset); padding: 1px 5px; border-radius: 5px; font-family: ui-monospace, monospace; font-size: .9em; }
.md-preview pre { background: var(--inset); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.md-preview pre code { background: none; padding: 0; }
.md-preview blockquote { border-left: 3px solid var(--accent-2); margin: .6em 0; padding: 2px 0 2px 12px; color: var(--txt-dim); }
.md-preview ul, .md-preview ol { padding-left: 22px; margin: .5em 0; }
.md-preview hr { border: none; border-top: 1px solid var(--stroke); margin: 1em 0; }
@media (max-width: 640px) { .md-split { grid-template-columns: 1fr; } .md-input { border-right: none; border-bottom: 1px solid var(--stroke); } }
.editor:focus { box-shadow: none; }
.editor { line-height: 1.5; }
.editor a { color: var(--accent); }
.attach-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px; }
.attach-row:not(:empty) { padding: 10px 20px; }
.attach-pill { display: flex; align-items: center; gap: 8px; font-size: 12px; background: var(--inset); border: 1px solid var(--stroke); padding: 6px 10px; border-radius: 10px; }
.attach-pill button { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 14px; }
.compose-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--stroke); }
.foot-left { display: flex; align-items: center; gap: 10px; }

/* Recipient chips */
.chips-input { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; position: relative; padding: 8px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: flex; align-items: center; gap: 6px; background: linear-gradient(90deg, rgba(77,227,255,0.18), rgba(160,107,255,0.18)); border: 1px solid var(--stroke-strong); padding: 4px 8px; border-radius: 9px; font-size: 12.5px; }
.chip button { background: none; border: none; color: var(--txt-dim); cursor: pointer; font-size: 13px; line-height: 1; }
.chip-typeahead { flex: 1; min-width: 120px; border: none; background: transparent; padding: 6px 0; }
.chip-typeahead:focus { box-shadow: none; }
.suggestions { position: absolute; top: 100%; left: 0; right: 0; z-index: 60; background: var(--glass-strong); backdrop-filter: blur(20px); border: 1px solid var(--stroke-strong); border-radius: 12px; margin-top: 6px; max-height: 260px; overflow-y: auto; box-shadow: var(--shadow); }
.sugg { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; }
.sugg:hover, .sugg.hi { background: rgba(120,140,220,0.14); }
.sugg .avatar { width: 30px; height: 30px; font-size: 12px; }
.sugg-name { font-size: 13px; }
.sugg-email { font-size: 11px; color: var(--txt-dim); }
.sugg-tag { margin-left: auto; font-size: 10px; color: var(--txt-faint); }

/* ─── Calendar ──────────────────────────────────────────────────────────── */
.people-view, .settings-view { height: 100%; }
.calendar-view { height: 100%; display: grid; grid-template-columns: 1fr 340px; gap: 14px; }
.cal-wrap, .people-wrap, .settings-wrap { height: 100%; border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.cal-head { gap: 14px; justify-content: flex-start; }
.cal-head h2 { min-width: 200px; }
.cal-head #cal-today { margin-left: auto; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); padding: 10px 18px 0; color: var(--txt-faint); font-size: 12px; }
.cal-dow span { text-align: left; padding-left: 4px; }
.cal-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; gap: 6px; padding: 10px 18px 18px; overflow-y: auto; }
.cal-cell { border: 1px solid var(--stroke); border-radius: 12px; padding: 8px; min-height: 92px; cursor: pointer; transition: 0.15s; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.cal-cell:hover { border-color: var(--stroke-strong); background: rgba(120,140,220,0.05); }
.cal-cell.other { opacity: 0.4; }
.cal-cell.today .cal-num { background: var(--grad); color: #05060f; border-radius: 8px; padding: 1px 7px; font-weight: 700; }
.cal-num { font-size: 12px; color: var(--txt-dim); align-self: flex-start; }
.cal-event { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: linear-gradient(90deg, rgba(77,227,255,0.22), rgba(160,107,255,0.22)); border: 1px solid var(--stroke); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; justify-content: space-between; gap: 4px; cursor: pointer; }
.cal-event:hover { border-color: var(--stroke-strong); }
.cal-event button { background: none; border: none; color: var(--txt-dim); cursor: pointer; font-size: 11px; opacity: 0; }
.cal-event:hover button { opacity: 1; }
.cal-more { font-size: 10px; color: var(--txt-faint); padding: 0 6px; }

/* Agenda side panel */
.agenda { border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.agenda-list { flex: 1; position: relative; overflow-y: auto; padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.agenda-day { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--txt-faint); margin: 14px 4px 2px; }
.agenda-day.is-today { color: var(--accent); }
.agenda-item { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--inset); cursor: pointer; transition: 0.15s; align-items: stretch; }
.agenda-item:hover { border-color: var(--stroke-strong); transform: translateX(2px); }
.agenda-item.past { opacity: 0.45; }
.agenda-bar { width: 3px; border-radius: 3px; background: var(--grad); flex-shrink: 0; }
.agenda-main { overflow: hidden; }
.agenda-time { font-size: 11px; color: var(--txt-dim); }
.agenda-title { font-size: 13.5px; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-loc { font-size: 11px; color: var(--txt-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-empty { padding: 34px 16px; text-align: center; color: var(--txt-faint); }

/* Event detail modal */
.detail-card { width: 460px; max-width: 92vw; border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; }
.detail-head-actions { display: flex; gap: 8px; }
.detail-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.detail-row { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--txt); }
.detail-ico { font-size: 16px; flex-shrink: 0; }
.btn-danger { background: rgba(255,93,115,0.12); border: 1px solid rgba(255,93,115,0.4); color: #ffb3bf; cursor: pointer; padding: 9px 16px; border-radius: 11px; font-size: 13px; font-family: inherit; transition: 0.18s; }
.btn-danger:hover { background: rgba(255,93,115,0.22); border-color: var(--danger); }
.ev-times { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.event-card .field { border-bottom: 1px solid rgba(120,140,220,0.08); }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 12px 20px; font-size: 14px; }
.switch.inline { padding: 12px 20px; }
.switch input { display: none; }
.slider { width: 42px; height: 24px; border-radius: 12px; background: var(--inset); border: 1px solid var(--stroke); position: relative; transition: 0.2s; }
.slider::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--txt-dim); transition: 0.2s; }
.switch input:checked + .slider { background: var(--grad); border-color: transparent; }
.switch input:checked + .slider::after { transform: translateX(18px); background: #fff; }

/* ─── People ────────────────────────────────────────────────────────────── */
.people-search { margin: 16px 18px; width: calc(100% - 36px); }
.people-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 0 18px 18px; overflow-y: auto; }
.people-h { font-size: 13px; color: var(--txt-dim); text-transform: uppercase; letter-spacing: 1px; }
.people-list { display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--stroke); background: var(--inset); cursor: pointer; transition: 0.15s; }
.person:hover { border-color: var(--stroke-strong); }
.person .avatar { width: 36px; height: 36px; font-size: 13px; }
.person-name { font-size: 14px; }
.person-email { font-size: 12px; color: var(--txt-dim); }
.person .count { margin-left: auto; font-size: 11px; color: var(--txt-faint); }

/* Settings */
.settings-wrap { overflow-y: auto; }
.setting-block { padding: 20px 24px; border-bottom: 1px solid var(--stroke); }
.setting-block h3 { margin: 0 0 4px; }
.settings-view .editor { min-height: 100px; margin-bottom: 12px; }
.saved-hint { color: var(--ok); font-size: 12px; margin-left: 10px; }
.sig-for { color: var(--accent); }
#notif-label { color: var(--txt-dim); font-size: 13px; }

/* Toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--glass-strong); backdrop-filter: blur(18px); border: 1px solid var(--stroke-strong); padding: 12px 22px; border-radius: 12px; z-index: 100; box-shadow: var(--shadow); font-size: 14px; animation: rise 0.25s; }
.toast.err { border-color: var(--danger); color: var(--danger); }
@keyframes rise { from { transform: translate(-50%, 12px); opacity: 0; } }

/* Undo-send bar */
.undo-bar { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 110;
  background: var(--glass-strong); backdrop-filter: blur(18px); border: 1px solid var(--stroke-strong);
  border-radius: 12px; padding: 13px 18px 15px; box-shadow: var(--shadow); display: flex; align-items: center;
  gap: 18px; min-width: 280px; overflow: hidden; animation: rise 0.2s; }
.undo-bar #undo-text { font-size: 14px; color: var(--txt); }
.undo-btn { background: none; border: none; color: var(--accent); font-weight: 700; cursor: pointer; font-size: 14px; font-family: inherit; }
.undo-btn:hover { text-decoration: underline; }
.undo-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; }
.undo-progress i { display: block; height: 100%; width: 100%; background: var(--grad); transform-origin: left; }
@keyframes undo-shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Outbox */
.outbox-pill { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; margin-bottom: 4px;
  border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--txt);
  background: linear-gradient(90deg, rgba(255,107,214,0.16), rgba(160,107,255,0.14)); border: 1px solid var(--stroke-strong); }
.outbox-pill:hover { border-color: var(--accent-3); }
.outbox-pill .obc { background: var(--accent-3); color: #05060f; font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.outbox-list { max-height: 55vh; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.outbox-item { border: 1px solid var(--stroke); border-radius: 12px; padding: 12px; background: var(--inset); }
.ob-subj { font-size: 14px; color: var(--txt); }
.ob-meta { font-size: 12px; color: var(--txt-dim); margin-top: 2px; }
.ob-err { font-size: 11px; color: var(--danger); margin-top: 4px; }
.outbox-actions { display: flex; gap: 8px; margin-top: 10px; }
.outbox-actions .btn-danger { padding: 7px 12px; font-size: 12px; }
.outbox-actions .chip-btn { padding: 7px 12px; font-size: 12px; }
.outbox-empty { padding: 34px; text-align: center; color: var(--txt-faint); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(120,140,220,0.2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(120,140,220,0.35); background-clip: padding-box; }

/* Responsive */
@media (max-width: 1100px) {
  .app { grid-template-columns: 72px 1fr; }
  .sidebar .brand span, .nav-item span, .account-meta, .folder-btn .fname span:last-child { display: none; }
  .compose { font-size: 0; padding: 12px; }
  .mail-view { grid-template-columns: 320px 1fr; }
  .calendar-view { grid-template-columns: 1fr 280px; }
}
@media (max-width: 800px) {
  .mail-view { grid-template-columns: 1fr; }
  .read-pane { display: none; }
  .mail-view.reading .list-pane { display: none; }
  .mail-view.reading .read-pane { display: flex; }
  .calendar-view { grid-template-columns: 1fr; }
  .agenda { display: none; }
  .people-cols { grid-template-columns: 1fr; }
}
