/* ============================================================================
   Mailbox — Outlook-style layout. Uses the CRM's theme variables, so light and
   dark mode both work. Prefix: ol-
   ========================================================================== */
.ol-root {
  /* Outlook palette — scoped here so the rest of the CRM keeps its own brand colours */
  --ol-accent: #0f6cbd;           /* Outlook blue: links, counts, focus, unread */
  --ol-accent-hover: #115ea3;
  --ol-sel: #cfe4fa;              /* selected message row */
  --ol-sel-border: transparent;
  --ol-hover: #f5f5f5;            /* hovered row / button */
  --ol-folder-sel: #e6e6e6;       /* selected folder */
  --ol-divider: #e0e0e0;
  --ol-pane: var(--bg-card);
  --ol-folders-w: 200px; --ol-list-w: 330px;   /* Outlook's default pane widths (drag to resize; remembered per user) */
  position: relative; display: flex; flex-direction: column; min-height: 420px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: #242424;
}
.ol-root button { font-family: inherit; }
.ol-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ol-spacer { flex: 1; }
.ol-body { flex: 1; min-height: 0; display: flex; padding: 0 8px 8px; gap: 0; }
.ol-root mark { background: #ffe08a; color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---- ribbon */
.ol-ribbon {
  display: flex; align-items: center; gap: 2px; padding: 6px 10px; flex-wrap: nowrap; overflow: hidden; flex-shrink: 0;
  width: 100%; box-sizing: border-box; background: var(--bg-card); border-bottom: 1px solid var(--border-subtle);
}
.ol-ribbon::-webkit-scrollbar { display: none; }
.ol-rbtn, .ol-newmail {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border: none; border-radius: 6px;
  background: transparent; color: var(--text-primary); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background var(--transition);
}
.ol-rbtn svg, .ol-newmail svg { width: 16px; height: 16px; flex-shrink: 0; }
.ol-rbtn:hover:not(:disabled) { background: var(--bg-hover); }
.ol-rbtn:disabled { opacity: .4; cursor: default; }
.ol-rbtn.on { color: #c4314b; }
.ol-rbtn.icon-only { padding: 0 8px; }
.ol-rbtn-ic { display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); }
.ol-rbtn:hover:not(:disabled) .ol-rbtn-ic { color: var(--ol-accent); }
.ol-rbtn.on .ol-rbtn-ic { color: #c4314b; }
.ol-newmail { background: #242424; color: #fff; padding: 0 14px; margin-right: 4px; font-weight: 600; }
.ol-newmail .ol-rbtn-ic { color: #fff; }
.ol-newmail:hover { background: #3a3a3a; }
:root[data-theme="dark"] .ol-newmail { background: #e8e8e8; color: #1b1b1b; }
:root[data-theme="dark"] .ol-newmail .ol-rbtn-ic { color: #1b1b1b; }
.ol-rsep { width: 1px; height: 18px; background: var(--border-strong); margin: 0 3px; flex-shrink: 0; }
.ol-sync { font-size: 11.5px; color: var(--text-muted); padding-left: 8px; padding-right: 6px; white-space: nowrap; flex-shrink: 0; margin-left: auto; }
.ol-folders-toggle { display: none; width: 34px; height: 34px; border: none; background: transparent; border-radius: 6px; cursor: pointer; color: var(--text-secondary); flex-shrink: 0; }
.ol-folders-toggle svg { width: 20px; height: 20px; }
.ol-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: none; background: transparent; border-radius: 6px; cursor: pointer; color: var(--text-secondary); flex-shrink: 0; }
.ol-iconbtn:hover { background: var(--bg-active); color: var(--text-primary); }
.ol-iconbtn.active { color: var(--ol-accent); background: var(--ol-sel); }
.ol-iconbtn svg { width: 17px; height: 17px; }
.ol-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--bg-card); color: var(--text-primary); font-size: 13px; cursor: pointer; white-space: nowrap;
}
.ol-btn svg { width: 16px; height: 16px; }
.ol-btn:hover { background: var(--bg-hover); }
.ol-btn.primary { background: var(--ol-accent, var(--brand)); border-color: var(--ol-accent, var(--brand)); color: #fff; font-weight: 600; }
.ol-btn.primary:hover { background: var(--ol-accent-hover, var(--brand-hover)); }
.ol-btn.danger { color: var(--danger); }
.ol-btn:disabled { opacity: .5; cursor: default; }

/* ---- panes & splitters */
.ol-folders { width: var(--ol-folders-w); flex-shrink: 0; overflow-y: auto; overflow-x: hidden; background: transparent; padding: 2px 0 8px; transition: width .2s ease; }
.ol-list { 
  width: var(--ol-list-w); 
  min-width: 240px; 
  flex-shrink: 1; 
  display: flex; flex-direction: column; min-height: 0; background: var(--ol-pane); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; position: relative;
  transition: width .2s ease;
}
.ol-reading { 
  flex: 1 1 480px; 
  min-width: 320px; 
  display: flex; flex-direction: column; background: var(--ol-pane); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; position: relative; 
}
.ol-root:not(.folders-collapsed) .ol-list {
  max-width: calc(100% - var(--ol-folders-w) - 460px);
}
.ol-splitter { width: 8px; flex-shrink: 0; cursor: col-resize; position: relative; touch-action: none; }
.ol-splitter::after { content: ""; position: absolute; left: 3px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: transparent; transition: background var(--transition); }
.ol-splitter:hover::after, .ol-splitter.dragging::after, .ol-splitter:focus-visible::after { background: var(--ol-accent); }
body.ol-resizing { cursor: col-resize; user-select: none; }
body.ol-resizing iframe { pointer-events: none; }

/* ---- folder pane */
.ol-folders-top {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px 6px 12px;
  border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; flex-shrink: 0;
}
.ol-folders-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.ol-folders-collapse-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: none;
  background: transparent; border-radius: 6px; cursor: pointer; color: var(--text-secondary); transition: transform .2s ease, background .15s ease;
}
.ol-folders-collapse-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.ol-folders-collapse-btn svg { width: 15px; height: 15px; }

/* Icon-Only Collapsed Rail Mode (Matches Microsoft Outlook) */
.ol-root.folders-collapsed {
  --ol-folders-w: 48px !important;
}
.ol-root.folders-collapsed .ol-folders {
  width: 48px !important; padding: 2px 0 8px; overflow-x: hidden; transition: width .2s ease;
}
.ol-root.folders-collapsed .ol-folders-top {
  justify-content: center; padding: 4px 0; margin-bottom: 4px;
}
.ol-root.folders-collapsed .ol-folders-title {
  display: none !important;
}
.ol-root.folders-collapsed .ol-folders-collapse-btn {
  transform: rotate(180deg);
}
.ol-root.folders-collapsed .ol-fsec-hdr span,
.ol-root.folders-collapsed .ol-fsec-hdr svg,
.ol-root.folders-collapsed .ol-folder-name,
.ol-root.folders-collapsed .ol-folder-count,
.ol-root.folders-collapsed .ol-folder-chev,
.ol-root.folders-collapsed .ol-folder-more {
  display: none !important;
}
.ol-root.folders-collapsed .ol-fsec-hdr {
  display: none !important;
}
.ol-root.folders-collapsed .ol-folder {
  justify-content: center; padding: 0 !important; margin: 3px auto; width: 36px; height: 36px; border-radius: 8px;
}
.ol-root.folders-collapsed .ol-folder-ic svg {
  width: 20px; height: 20px;
}
.ol-root.folders-collapsed .ol-folder.selected::before {
  left: 2px; top: 7px; bottom: 7px; width: 3px;
}
.ol-root.folders-collapsed .ol-splitter[data-which="folders"] {
  display: none !important; pointer-events: none;
}

.ol-fsec-hdr { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 10px; border: none; background: transparent; font-size: 13px; font-weight: 600; color: var(--text-primary); cursor: pointer; text-align: left; border-radius: 6px; }
.ol-fsec-hdr:hover { background: var(--ol-hover); }
.ol-fsec-hdr svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.ol-fsec-hdr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-folder {
  display: flex; align-items: center; gap: 6px; height: 34px; margin: 1px 6px; padding: 0 6px 0 calc(6px + var(--lvl, 0) * 16px);
  border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text-primary); position: relative; outline: none;
}
.ol-folder:hover { background: var(--ol-hover); }
.ol-folder.selected { background: var(--ol-sel); font-weight: 600; }
.ol-folder.selected::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--ol-accent); }
.ol-folder:focus-visible { box-shadow: inset 0 0 0 2px var(--ol-accent); }
.ol-folder.drop { background: var(--ol-sel); box-shadow: inset 0 0 0 2px var(--ol-accent); }
.ol-folder-chev { width: 16px; height: 16px; display: inline-flex; color: var(--text-muted); flex-shrink: 0; }
.ol-folder-chev svg { width: 14px; height: 14px; }
.ol-folder-chev.none { visibility: hidden; }
.ol-folder-ic { display: inline-flex; color: var(--text-secondary); flex-shrink: 0; }
.ol-folder.selected .ol-folder-ic { color: var(--ol-accent); }
.ol-folder-ic svg { width: 18px; height: 18px; }
.ol-folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-folder-count { font-size: 12px; font-weight: 600; color: var(--ol-accent); padding: 0 4px; flex-shrink: 0; }
.ol-folder-more { display: none; width: 24px; height: 24px; border: none; background: transparent; border-radius: 4px; cursor: pointer; color: var(--text-secondary); flex-shrink: 0; align-items: center; justify-content: center; }
.ol-folder-more svg { width: 15px; height: 15px; }
.ol-folder:hover .ol-folder-more, .ol-folder:focus-within .ol-folder-more { display: inline-flex; }
.ol-folder:hover .ol-folder-count { display: none; }
.ol-folder-more:hover { background: var(--bg-active); }
.ol-skel-folders { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.ol-skel-folders i, .ol-skel-line, .ol-skel-lines i, .ol-skel-msg i, .ol-card-skel i { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--bg-active) 25%, var(--bg-hover) 50%, var(--bg-active) 75%); background-size: 200% 100%; animation: ol-shimmer 1.2s linear infinite; }

/* ---- mail list */
.ol-list-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); flex-shrink: 0; position: relative; }
.ol-list-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ol-list-title-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--ol-accent); cursor: pointer; margin: 0 2px; }
.ol-list-title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.ol-list-sub { font-size: 12px; color: var(--ol-accent); font-weight: 600; min-height: 0; }
.ol-search-row { display: flex; gap: 6px; align-items: center; }
.ol-search { flex: 1; position: relative; display: flex; align-items: center; }
.ol-search-ic { position: absolute; left: 9px; display: inline-flex; color: var(--text-muted); pointer-events: none; }
.ol-search-ic svg { width: 16px; height: 16px; }
.ol-search input { width: 100%; height: 32px; padding: 0 30px 0 32px !important; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg-card); font-size: 13px; color: var(--text-primary); outline: none; }
.ol-search input:focus { border-color: var(--ol-accent); box-shadow: 0 0 0 1px var(--ol-accent); }
.ol-search input::-webkit-search-cancel-button { display: none; }
.ol-search button { position: absolute; right: 4px; width: 24px; height: 24px; border: none; background: transparent; border-radius: 4px; cursor: pointer; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }
.ol-search button svg { width: 14px; height: 14px; }
.ol-search button[hidden] { display: none; }
.ol-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ol-chips[hidden] { display: none; }
.ol-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--ol-sel); border: 1px solid var(--ol-sel-border); font-size: 12px; }
.ol-chip button { display: inline-flex; border: none; background: transparent; cursor: pointer; width: 18px; height: 18px; align-items: center; justify-content: center; border-radius: 50%; color: var(--text-secondary); }
.ol-chip button:hover { background: var(--bg-active); }
.ol-chip svg { width: 11px; height: 11px; }
.ol-filter-panel {
  position: absolute; z-index: 40; left: 8px; right: 8px; top: calc(100% - 4px); background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 14px; max-height: 70vh; overflow-y: auto;
}
.ol-fp-row { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 12px; }
.ol-fp-chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }
.ol-fp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.ol-fp-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--text-secondary); }
.ol-fp-grid input, .ol-fp-grid select { height: 32px; padding: 0 8px !important; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg-card); font-size: 13px; color: var(--text-primary); min-width: 0; }
.ol-fp-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

.ol-list-scroll { flex: 1; min-height: 0; overflow-y: auto; outline: none; scroll-behavior: auto; overflow-anchor: none; }   /* the list positions its own rows; the browser's scroll anchoring must not nudge it as well */
.ol-date-hdr { position: sticky; top: 0; z-index: 2; padding: 8px 14px 4px; font-size: 12px; font-weight: 700; color: var(--text-secondary); background: var(--ol-pane); }
.ol-row {
  display: flex; gap: 4px; padding: 8px 10px 8px 4px; margin: 1px 6px; border-radius: 8px; cursor: pointer; position: relative;
  content-visibility: auto; contain-intrinsic-size: auto 78px; border: 1px solid transparent;
}
.ol-row:hover { background: var(--ol-hover); }
.ol-row.selected { background: var(--ol-sel); border-color: var(--ol-sel-border); }
.ol-row.focus:not(.selected) { box-shadow: inset 0 0 0 1px var(--ol-sel-border); }
.ol-row.unread::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--ol-accent); }
.ol-row.child { margin-left: 28px; padding-top: 6px; padding-bottom: 6px; }
.ol-row-lead { display: flex; align-items: flex-start; gap: 0; flex-shrink: 0; padding-top: 2px; }
.ol-row-chev { width: 16px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--text-muted); cursor: pointer; padding: 0; }
.ol-row-chev svg { width: 13px; height: 13px; }
span.ol-row-chev { cursor: default; }
.ol-row-avatar { position: relative; width: 32px; height: 32px; flex-shrink: 0; }
.ol-row-avatar .ol-avatar { position: absolute; inset: 0; }
.ol-row-check { position: absolute; inset: 0; width: 32px; height: 32px; margin: 0; opacity: 0; cursor: pointer; accent-color: var(--ol-accent); z-index: 1; }
.ol-row:hover .ol-row-check, .ol-row.selected .ol-row-check { opacity: 1; background: var(--bg-card); border-radius: 50%; transform: scale(.7); }
.ol-row:hover .ol-row-avatar .ol-avatar, .ol-row.selected .ol-row-avatar .ol-avatar { opacity: 0; }
.ol-row-main { flex: 1; min-width: 0; padding-left: 8px; }
.ol-row-l1, .ol-row-l2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ol-sender { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--text-primary); }
.ol-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.ol-subject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--text-primary); }
.ol-row-l3 { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.ol-row.unread .ol-sender, .ol-row.unread .ol-subject { font-weight: 700; }
.ol-row.unread .ol-subject { color: var(--ol-accent); }
.ol-row.unread .ol-time { color: var(--ol-accent); font-weight: 600; }
.ol-row-icons { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.ol-row-icons svg { width: 14px; height: 14px; }
.ol-ic-att { color: var(--text-muted); display: inline-flex; }
.ol-ic-flag { color: #c4314b; display: inline-flex; }
.ol-ic-imp { color: #c4314b; display: inline-flex; }
.ol-cat { font-size: 10.5px; font-weight: 600; color: #fff; padding: 1px 7px; border-radius: 999px; white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.ol-cat-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.ol-count { font-size: 11px; color: var(--text-secondary); background: var(--bg-active); border-radius: 10px; padding: 0 6px; font-weight: 600; }
.ol-row-actions { position: absolute; right: 8px; top: 6px; display: none; gap: 2px; background: var(--ol-hover); border-radius: 6px; padding: 1px; }
.ol-row.selected .ol-row-actions { background: var(--ol-sel); }
.ol-row:hover .ol-row-actions, .ol-row:focus-within .ol-row-actions { display: inline-flex; }
.ol-row:hover .ol-time { visibility: hidden; }
.ol-row-actions button { width: 26px; height: 26px; border: none; background: transparent; border-radius: 5px; cursor: pointer; color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; }
.ol-row-actions button:hover { background: var(--bg-active); color: var(--text-primary); }
.ol-row-actions button.on { color: #c4314b; }
.ol-row-actions svg { width: 15px; height: 15px; }
.ol-skel-row { display: flex; gap: 12px; padding: 12px 16px; align-items: flex-start; }
.ol-skel-circle { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; background: var(--bg-active); animation: ol-shimmer 1.2s linear infinite; }
.ol-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.ol-skel-lines i:nth-child(1) { width: 45%; } .ol-skel-lines i:nth-child(2) { width: 80%; } .ol-skel-lines i:nth-child(3) { width: 65%; height: 10px; }
.ol-empty { padding: 48px 20px; text-align: center; color: var(--text-muted); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ol-empty svg { width: 40px; height: 40px; opacity: .5; }
.ol-empty-sub { font-size: 12.5px; }
.ol-drag-ghost { position: fixed; top: -100px; left: -100px; background: var(--ol-accent); color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 13px; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- avatars */
.ol-avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 600; font-size: 13px; flex-shrink: 0; user-select: none; }

/* ---- reading pane */
.ol-reading-empty { margin: auto; text-align: center; color: var(--text-muted); padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ol-reading-empty-ic svg { width: 64px; height: 64px; opacity: .35; }
.ol-reading-empty-t { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.ol-reading-empty-s { font-size: 13px; }
.ol-multi-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.ol-thread-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 20px 10px; flex-shrink: 0; flex-wrap: wrap; }
.ol-thread-subject { margin: 0; flex: 1 1 220px; min-width: 0; font-size: 18px; font-weight: 700; line-height: 1.35; word-break: break-word; overflow-wrap: anywhere; white-space: normal; }
.ol-thread-meta { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; padding-top: 2px; }
.ol-thread-count { font-size: 12px; color: var(--text-muted); }
.ol-back { display: none; }
.ol-thread-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 8px; outline: none; scroll-behavior: smooth; overflow-anchor: auto; }
.ol-thread-end { height: 1px; flex-shrink: 0; }
.ol-older { align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg-card); color: var(--ol-accent); font-size: 12.5px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.ol-older svg { width: 14px; height: 14px; }
.ol-older:hover { background: var(--ol-sel); }

.ol-msg { border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); box-shadow: var(--shadow-sm); flex-shrink: 0; transition: border-color var(--transition), box-shadow var(--transition); overflow: hidden; }
.ol-msg:hover { border-color: var(--border-strong); }
.ol-msg.expanded { box-shadow: var(--shadow); }
.ol-msg.unread .ol-mc-sender { font-weight: 700; }
.ol-msg.unread:not(.expanded)::before { content: ""; position: absolute; }
.ol-msg-collapsed, .ol-msg-expanded { display: grid; transition: grid-template-rows .18s ease, opacity .16s ease; }
.ol-msg-collapsed { grid-template-rows: 1fr; opacity: 1; }
.ol-msg-expanded { grid-template-rows: 0fr; opacity: 0; }
.ol-msg.expanded .ol-msg-collapsed { grid-template-rows: 0fr; opacity: 0; }
.ol-msg.expanded .ol-msg-expanded { grid-template-rows: 1fr; opacity: 1; }
.ol-msg-collapsed-in, .ol-msg-expanded-in { min-height: 0; overflow: hidden; }
.ol-msg-expanded-in { border-radius: 8px; }
.ol-msg-collapsed-in { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; border-radius: 8px; outline: none; }
.ol-msg-collapsed-in:hover { background: var(--ol-hover); }
.ol-msg-collapsed-in:focus-visible { box-shadow: inset 0 0 0 2px var(--ol-accent); }
.ol-mc-main { flex: 1; min-width: 0; }
.ol-mc-top { display: flex; justify-content: space-between; gap: 10px; }
.ol-mc-sender { font-size: 14px; font-weight: 600; word-break: break-word; overflow-wrap: anywhere; }
.ol-mc-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.ol-mc-prev { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-mc-clip { color: var(--text-muted); display: inline-flex; }
.ol-mc-clip svg { width: 16px; height: 16px; }

.ol-mh { display: flex; gap: 12px; padding: 14px 16px 8px; align-items: flex-start; cursor: pointer; flex-wrap: wrap; position: relative; }
.ol-mh-main { flex: 1 1 220px; min-width: 0; word-break: break-word; overflow-wrap: anywhere; }
.ol-mh-l1 { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 14px; font-weight: 600; word-break: break-word; overflow-wrap: anywhere; }
.ol-mh-sender { display: inline-block; max-width: 100%; word-break: break-word; overflow-wrap: anywhere; }
.ol-mh-line { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin-top: 2px; word-break: break-word; overflow-wrap: anywhere; max-width: 100%; }
.ol-mh-lbl { color: var(--text-muted); }
.ol-mh-addrs { display: inline-block; max-width: 100%; word-break: break-all; overflow-wrap: anywhere; }
.ol-mh-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; margin-left: auto; }
.ol-mh-actions { display: inline-flex; gap: 2px; }
.ol-mh-actions button { width: 28px; height: 28px; border: none; background: transparent; border-radius: 5px; cursor: pointer; color: #8764b8; display: inline-flex; align-items: center; justify-content: center; }
.ol-mh-actions button:hover { background: var(--bg-active); }
.ol-mh-actions button[data-act="m-forward"] { color: #0f6cbd; } .ol-mh-actions button[data-act="m-more"] { color: var(--text-secondary); }
.ol-mh-actions svg { width: 17px; height: 17px; }
.ol-mh-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; text-align: right; }
.ol-addr { display: inline-block; border: none; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; border-radius: 3px; max-width: 100%; word-break: break-word; overflow-wrap: anywhere; }
.ol-addr:hover { background: var(--bg-active); }
.ol-addr:focus-visible { outline: 2px solid var(--ol-accent); outline-offset: 1px; }
.ol-addr.known { color: var(--ol-accent); }
.ol-mh-sender .ol-addr { font-weight: 600; font-size: 14px; }
.ol-addr-mail { font-weight: 400; color: var(--text-muted); font-size: 12.5px; word-break: break-all !important; overflow-wrap: anywhere !important; display: inline-block; max-width: 100%; }
.ol-addr-more { border: none; background: transparent; color: var(--ol-accent); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0 2px; }
.ol-addr-more:hover { text-decoration: underline; }
.ol-addr-rest[hidden] { display: none; }
.ol-atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 4px; }
.ol-att { display: inline-flex; align-items: center; gap: 10px; min-width: 190px; max-width: 280px; padding: 6px 8px 6px 6px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg-card); cursor: pointer; position: relative; outline: none; }
.ol-att:hover, .ol-att:focus-visible { background: var(--ol-hover); border-color: var(--ol-accent); }
.ol-att-ic { width: 36px; height: 36px; border-radius: 6px; background: var(--c, #605e5c); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background-size: cover; background-position: center; }
.ol-att-ic.thumb { color: transparent; }
.ol-att-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ol-att-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-att-size { font-size: 11.5px; color: var(--text-muted); }
.ol-att-quick { display: inline-flex; gap: 1px; opacity: 0; transition: opacity var(--transition); }
.ol-att:hover .ol-att-quick, .ol-att:focus-within .ol-att-quick { opacity: 1; }
.ol-att-quick button { width: 24px; height: 24px; border: none; background: transparent; border-radius: 4px; cursor: pointer; color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; }
.ol-att-quick button:hover { background: var(--bg-active); }
.ol-att-quick svg { width: 14px; height: 14px; }
.ol-att-all { align-self: center; display: inline-flex; gap: 6px; align-items: center; border: none; background: transparent; color: var(--ol-accent); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 6px 8px; }
.ol-att-all svg { width: 15px; height: 15px; }
.ol-body-frame { display: block; width: 100%; height: 120px; border: none; background: #fff; border-radius: 0 0 8px 8px; margin-top: 6px; color-scheme: light; }
.ol-reply-bar { display: flex; gap: 8px; padding: 10px 16px 14px; background: #fff; border-radius: 0 0 8px 8px; margin-top: -4px; }
:root[data-theme="dark"] .ol-reply-bar { background: var(--bg-card); }
.ol-msg-error { padding: 16px; font-size: 13px; color: var(--danger); display: flex; gap: 8px; align-items: center; }
.ol-msg-error svg { width: 16px; height: 16px; }
.ol-skel-msg { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ol-skel-msg i:nth-child(1) { width: 35%; } .ol-skel-msg i:nth-child(2) { width: 85%; } .ol-skel-msg i:nth-child(3) { width: 60%; }
.ol-skel-line.w60 { width: 60%; height: 22px; }

/* ---- inline composer */
.ol-composer { border: 1px solid var(--ol-accent); border-radius: 8px; background: var(--bg-card); box-shadow: var(--shadow); flex-shrink: 0; margin: 2px 0 6px; animation: ol-pop .18s ease; }
.ol-composer.drop { outline: 2px dashed var(--ol-accent); outline-offset: -4px; }
.ol-cp-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.ol-cp-kind { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--ol-accent); }
.ol-cp-kind svg { width: 16px; height: 16px; }
.ol-cp-status { flex: 1; font-size: 12px; color: var(--text-muted); }
.ol-iconbtn.ol-iconbtn, .ol-cp-head .ol-iconbtn { width: 28px; height: 28px; }
.ol-cp-head > button { width: 28px; height: 28px; border: none; background: transparent; border-radius: 5px; cursor: pointer; color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; }
.ol-cp-head > button:hover { background: var(--bg-active); color: var(--danger); }
.ol-cp-head > button svg { width: 16px; height: 16px; }
.ol-cp-field { display: flex; align-items: flex-start; gap: 8px; padding: 4px 12px; border-bottom: 1px solid var(--border); min-height: 36px; position: relative; }
.ol-cp-field[hidden] { display: none; }
.ol-cp-field > label { width: 34px; padding-top: 7px; font-size: 13px; color: var(--text-muted); flex-shrink: 0; }
.ol-cp-subject { padding: 7px 0; font-size: 13px; }
.ol-rcpt { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; padding: 3px 0; position: relative; }
.ol-rinput { flex: 1; min-width: 120px; border: none !important; outline: none !important; background: transparent; font-size: 13px; padding: 4px 2px !important; height: 26px; box-shadow: none !important; color: var(--text-primary); }
.ol-rchip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 2px 1px 8px; border-radius: 4px; background: var(--bg-active); font-size: 13px; max-width: 100%; }
.ol-rchip.bad { background: var(--danger-soft); color: var(--danger); }
.ol-rchip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-rchip button { width: 18px; height: 18px; border: none; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: inherit; }
.ol-rchip button svg { width: 10px; height: 10px; }
.ol-cp-ccbcc { display: inline-flex; gap: 8px; padding-top: 7px; }
.ol-cp-ccbcc button { border: none; background: transparent; color: var(--ol-accent); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 0; }
.ol-cp-ccbcc button[hidden] { display: none; }
.ol-sug { position: absolute; z-index: 30; left: 0; top: 100%; min-width: 260px; max-width: 360px; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; }
.ol-sug.floating { position: fixed; z-index: 3000; }
.ol-sug-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ol-sug-item.on, .ol-sug-item:hover { background: var(--ol-sel); }
.ol-sug-item span { display: flex; flex-direction: column; min-width: 0; }
.ol-sug-item small { color: var(--text-muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.ol-cp-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 1px; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--bg-elevated); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02); }
.ol-cp-toolbar button { display: inline-flex; align-items: center; gap: 5px; height: 28px; min-width: 28px; justify-content: center; padding: 0 6px; border: none; background: transparent; border-radius: 5px; cursor: pointer; color: var(--text-secondary); font-size: 12.5px; }
.ol-cp-toolbar button:hover { background: var(--bg-active); color: var(--text-primary); }
.ol-cp-toolbar svg { width: 16px; height: 16px; }
.ol-cp-editor { min-height: 140px; max-height: 420px; overflow-y: auto; padding: 12px 14px; font-size: 14px; line-height: 1.5; outline: none; color: var(--text-primary); }
.ol-cp-editor:empty::before { content: attr(data-placeholder); color: var(--text-muted); }
.ol-cp-editor table td { border: 1px solid #bbb; padding: 4px 10px; }
.ol-cp-editor img { max-width: 100%; }
.ol-cp-editor p { margin: 0 0 12px; }
.ol-cp-editor ul, .ol-cp-editor ol { padding-left: 26px; margin: 0 0 12px; }
.ol-cp-editor li { margin: 0 0 4px; }
.ol-cp-editor pre { margin: 0 0 12px; background: #f6f8fa; border: 1px solid #d0d7de; border-radius: 6px; padding: 10px 12px; font-family: Consolas, 'Courier New', monospace; font-size: 12.5px; white-space: pre-wrap; }
.ol-cp-editor blockquote { border-left: 3px solid var(--border-strong); margin: 6px 0; padding-left: 10px; color: var(--text-secondary); }
.ol-mention { color: var(--ol-accent); background: var(--ol-sel); border-radius: 4px; padding: 0 3px; }
.ol-sig { color: var(--text-secondary); border-top: 1px solid transparent; }
.ol-cp-atts { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px; } .ol-cp-atts:empty { display: none; }
.ol-cp-att { display: inline-flex; align-items: center; gap: 8px; padding: 3px 4px 3px 4px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 12.5px; margin-bottom: 6px; }
.ol-cp-att .ol-att-ic { width: 26px; height: 26px; font-size: 8.5px; }
.ol-cp-att small { color: var(--text-muted); }
.ol-cp-att button { width: 20px; height: 20px; border: none; background: transparent; cursor: pointer; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.ol-cp-att button svg { width: 11px; height: 11px; }
.ol-cp-att-n { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-cp-quote-note { padding: 0 14px 8px; font-size: 11.5px; color: var(--text-muted); }
.ol-cp-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.ol-cp-hint { margin-left: auto; font-size: 11.5px; color: var(--text-muted); }
.ol-sigedit-bar { display: flex; gap: 4px; margin-bottom: 6px; }
.ol-sigedit-bar button { width: 30px; height: 28px; border: 1px solid var(--border); background: var(--bg-card); border-radius: 5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ol-sigedit-bar svg { width: 15px; height: 15px; }

/* ---- menus */
.ol-menu { position: fixed; z-index: 4000; min-width: 220px; max-width: 320px; max-height: 70vh; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; outline: none; }
.ol-submenu { z-index: 4001; }
.ol-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: none; background: transparent; border-radius: 5px; font-size: 13.5px; color: var(--text-primary); cursor: pointer; text-align: left; }
.ol-menu-item:hover:not(.disabled), .ol-menu-item:focus-visible { background: var(--ol-sel); outline: none; }
.ol-menu-item.disabled { opacity: .45; cursor: default; }
.ol-menu-item.danger { color: var(--danger); }
.ol-menu-ic { width: 16px; height: 16px; display: inline-flex; color: var(--text-secondary); flex-shrink: 0; }
.ol-menu-ic svg { width: 16px; height: 16px; }
.ol-menu-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-menu-key { font-size: 11.5px; color: var(--text-muted); }
.ol-menu-arrow { display: inline-flex; color: var(--text-muted); } .ol-menu-arrow svg { width: 13px; height: 13px; }
.ol-menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.ol-menu-hdr { padding: 6px 10px 2px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }

/* ---- contact card */
.ol-card { position: fixed; z-index: 3500; width: 372px; max-height: min(640px, 82vh); overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); outline: none; animation: ol-pop .14s ease; }
.ol-card-top { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px 12px; background: linear-gradient(180deg, var(--ol-sel), transparent); }
.ol-card-top.unknown { background: linear-gradient(180deg, var(--bg-active), transparent); }
.ol-card-x { position: absolute; right: 8px; top: 8px; }
.ol-card-name { font-size: 17px; font-weight: 700; text-align: center; }
.ol-card-sub { font-size: 13px; color: var(--text-secondary); text-align: center; }
.ol-card-badge { margin-top: 2px; font-size: 11px; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--ol-sel); color: var(--ol-accent); }
.ol-card-body { padding: 4px 16px 8px; display: flex; flex-direction: column; gap: 2px; }
.ol-card-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; padding: 4px 0; }
.ol-card-row svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; margin-top: 2px; }
.ol-card-row a { color: var(--ol-accent); text-decoration: none; word-break: break-all; }
.ol-card-row span { word-break: break-word; }
.ol-card-note { font-size: 12.5px; color: var(--text-secondary); background: var(--bg-elevated); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.ol-card-poss { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0 0; }
.ol-card-poss .ol-btn { height: 26px; font-size: 12px; }
.ol-card-btns { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px 14px; }
.ol-card-btns.icons { padding: 4px 12px 8px; justify-content: space-between; flex-wrap: nowrap; }
.ol-card-btns.icons button { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; min-width: 0; padding: 6px 2px; border: none; background: transparent; border-radius: 8px; cursor: pointer; color: var(--text-secondary); font-size: 11px; }
.ol-card-btns.icons button:hover:not(:disabled) { background: var(--ol-sel); color: var(--ol-accent); }
.ol-card-btns.icons button:disabled { opacity: .35; cursor: default; }
.ol-card-btns.icons svg { width: 18px; height: 18px; }
.ol-card-tabs { display: flex; gap: 2px; padding: 0 10px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ol-card-tabs button { padding: 9px 8px; border: none; background: transparent; font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.ol-card-tabs button.on { color: var(--ol-accent); border-bottom-color: var(--ol-accent); }
.ol-card-tabs i { font-style: normal; font-size: 10.5px; background: var(--bg-active); border-radius: 8px; padding: 0 5px; }
.ol-card-pane { padding: 6px 16px 14px; min-height: 60px; }
.ol-card-li { display: flex; flex-direction: column; gap: 1px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.ol-card-li:last-child { border-bottom: none; }
.ol-card-li.muted { color: var(--text-muted); font-size: 12.5px; border: none; }
.ol-card-li-t { font-size: 13px; }
.ol-card-li-s { font-size: 11.5px; color: var(--text-muted); }
.ol-card-skel { padding: 24px 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.ol-card-skel i.c { width: 64px; height: 64px; border-radius: 50%; }
.ol-card-skel i { width: 70%; } .ol-card-skel i:nth-child(3) { width: 90%; }
.ol-pick-row { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ol-pick-row:hover { background: var(--ol-sel); } .ol-pick-row span { font-size: 12px; color: var(--text-muted); }

/* ---- attachment preview */
.ol-preview { position: fixed; inset: 0; z-index: 3800; background: rgba(15, 15, 20, .86); display: flex; flex-direction: column; outline: none; animation: ol-fade .15s ease; }
.ol-preview-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #fff; background: rgba(0, 0, 0, .35); }
.ol-preview-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.ol-preview-nav { display: inline-flex; gap: 4px; }
.ol-preview-bar button { color: #fff; background: rgba(255, 255, 255, .12); border-color: transparent; }
.ol-preview-bar button:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
.ol-preview-bar button:disabled { opacity: .35; }
.ol-preview-nav button, .ol-preview-bar .ol-iconbtn { width: 32px; height: 32px; border: none; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ol-preview-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.ol-preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; }
.ol-preview-body iframe { width: min(1000px, 100%); height: 100%; border: none; background: #fff; border-radius: 6px; }
.ol-preview-msg { color: #fff; text-align: center; font-size: 15px; line-height: 1.6; }
.ol-preview-text { width: min(1000px, 100%); max-height: 100%; overflow: auto; background: #fff; color: #222; padding: 18px; border-radius: 6px; font: 13px/1.5 Consolas, monospace; white-space: pre-wrap; margin: 0; }

/* ---- connect / misc */
.ol-connect { max-width: 460px; margin: 60px auto; text-align: center; padding: 48px 24px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; }
.ol-connect-ic svg { width: 52px; height: 52px; color: var(--ol-accent, var(--brand)); }
.ol-connect h2 { margin: 14px 0 8px; font-size: 17px; }
.ol-connect p { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.ol-scrim { display: none; }
.ol-shortcuts { display: grid; gap: 8px; }
.ol-shortcuts div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.ol-shortcuts kbd { font: 12px Consolas, monospace; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 7px; }

@keyframes ol-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes ol-pop { from { opacity: 0; transform: translateY(4px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes ol-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- responsive: wide >=1000, medium 700-1000 (folders become a drawer), narrow <700 (one pane at a time) */
.ol-root[data-layout="medium"] .ol-folders-toggle, .ol-root[data-layout="narrow"] .ol-folders-toggle { display: inline-flex; }
.ol-root[data-layout="medium"] .ol-folders, .ol-root[data-layout="narrow"] .ol-folders {
  position: absolute; z-index: 60; left: 0; top: 0; bottom: 0; width: 260px; background: var(--bg-card); border-right: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg); transform: translateX(-102%); transition: transform .2s ease; padding-top: 8px;
}
.ol-root.drawer-open .ol-folders { transform: none; }
.ol-root.drawer-open .ol-scrim { display: block; position: absolute; inset: 0; z-index: 55; background: rgba(0, 0, 0, .3); }
.ol-root[data-layout="medium"] .ol-splitter[data-which="folders"], .ol-root[data-layout="narrow"] .ol-splitter { display: none; }
.ol-root[data-layout="narrow"] .ol-list { width: 100% !important; }
.ol-root[data-layout="narrow"] .ol-reading { display: none; position: absolute; inset: 0; z-index: 30; border-radius: 12px; }
.ol-root[data-layout="narrow"].reading-open .ol-reading { display: flex; }
.ol-root[data-layout="narrow"] .ol-back { display: inline-flex; }
.ol-root[data-layout="narrow"] .ol-rbtn-lbl, .ol-root[data-layout="medium"] .ol-rbtn-lbl { display: none; }
.ol-root[data-layout="narrow"] .ol-newmail .ol-rbtn-lbl { display: inline; }
.ol-root[data-layout="narrow"] .ol-body { padding: 0 4px 4px; }
.ol-root[data-layout="narrow"] .ol-mh { flex-wrap: wrap; }
.ol-root[data-layout="narrow"] .ol-card, .ol-card { max-width: calc(100vw - 16px); }

/* ---- accessibility */
.ol-root :focus-visible { outline: 2px solid var(--ol-accent); outline-offset: 1px; }
.ol-list-scroll:focus-visible { outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) {
  .ol-msg-collapsed, .ol-msg-expanded, .ol-composer, .ol-card, .ol-preview, .ol-folders { transition: none !important; animation: none !important; }
  .ol-thread-scroll { scroll-behavior: auto; }
  .ol-skel-folders i, .ol-skel-line, .ol-skel-lines i, .ol-skel-msg i, .ol-card-skel i, .ol-skel-circle { animation: none; }
}
@media (forced-colors: active) {
  .ol-row.selected, .ol-folder.selected { outline: 2px solid Highlight; }
  .ol-row.unread::before { background: Highlight; }
  .ol-btn.primary, .ol-newmail { border: 1px solid ButtonText; }
  .ol-att, .ol-msg, .ol-composer, .ol-card { border-color: CanvasText; }
}

/* ---- in-app dialogs (replace prompt/confirm) ---- */
.ol-dialog-ov { position: fixed; inset: 0; z-index: 3000; background: rgba(15, 23, 42, .38); display: flex; align-items: center; justify-content: center; padding: 16px; animation: ol-fade .12s ease-out; }
.ol-dialog { width: min(420px, 100%); background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 16px 48px rgba(0, 0, 0, .28); padding: 20px 22px 16px; animation: ol-pop .14s ease-out; }
.ol-dialog-t { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.ol-dialog-m { font-size: 14px; color: var(--text-secondary); line-height: 1.45; margin-bottom: 4px; }
.ol-dialog-l { display: block; font-size: 13px; color: var(--text-secondary); margin: 8px 0 2px; }
.ol-dialog-in { display: block; width: 100%; box-sizing: border-box; height: 36px; margin-top: 6px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg-card); color: var(--text-primary); font: inherit; }
.ol-dialog-in:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.ol-dialog-b { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.ol-dialog .ol-btn { height: 34px; padding: 0 16px; }
.ol-dialog .ol-btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
@keyframes ol-pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ol-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ol-dialog, .ol-dialog-ov { animation: none; } }
/* ---- meeting invitations, attached items, zip / slides previews ---- */
.ol-meet { margin: 4px 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); overflow: hidden; }
.ol-meet-banner { padding: 8px 14px; font-size: 13px; background: #eef3f8; border-bottom: 1px solid var(--border); }
.ol-meet-banner.cancel { background: #fde7e9; color: #a4262c; font-weight: 600; }
.ol-meet-banner.out { background: #fff4ce; color: #6b4e00; }
.ol-meet-card { display: flex; gap: 14px; padding: 14px; }
.ol-meet-tile { flex: 0 0 52px; height: 56px; border: 1px solid var(--border-strong); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; }
.ol-meet-tile span { font-size: 11px; text-transform: uppercase; color: #c4314b; font-weight: 700; letter-spacing: .04em; }
.ol-meet-tile b { font-size: 22px; line-height: 1; color: var(--text-primary); }
.ol-meet-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ol-meet-title { font-size: 16px; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.ol-meet-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-secondary); }
.ol-meet-row svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: var(--text-muted); }
.ol-meet-tz, .ol-meet-rec { color: var(--text-muted); }
.ol-meet-join .ol-btn { height: 30px; text-decoration: none; }
.ol-meet-attendees { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.ol-meet-att-line { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 13px; }
.ol-meet-att-lbl { color: var(--text-muted); min-width: 58px; font-size: 12px; }
.ol-meet-att { display: inline-flex; align-items: center; gap: 5px; }
.ol-meet-att i, .ol-meet-mine i { width: 9px; height: 9px; border-radius: 50%; background: #a19f9d; display: inline-block; flex-shrink: 0; }
.ol-meet-att.ok i, .ol-meet-mine.ok i { background: #107c10; } .ol-meet-att.tent i, .ol-meet-mine.tent i { background: #f7b500; } .ol-meet-att.no i, .ol-meet-mine.no i { background: #c50f1f; }
.ol-meet-more { color: var(--text-muted); }
.ol-meet-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; margin-top: 4px; }
.ol-meet-mine { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.ol-meet-showas { color: var(--text-muted); }
.ol-meet-conflict { flex-basis: 100%; display: flex; align-items: center; gap: 6px; color: #a4262c; }
.ol-meet-conflict svg { width: 15px; height: 15px; }
.ol-meet-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px 80px; }
.ol-meet-split { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; background: var(--bg-card); }
.ol-meet-btn, .ol-meet-caret { border: none; background: none; font: inherit; font-size: 13px; color: var(--text-primary); cursor: pointer; height: 30px; display: inline-flex; align-items: center; gap: 6px; }
.ol-meet-btn { padding: 0 12px; } .ol-meet-caret { padding: 0 6px; border-left: 1px solid var(--border); }
.ol-meet-btn svg, .ol-meet-caret svg { width: 14px; height: 14px; }
.ol-meet-btn:hover, .ol-meet-caret:hover { background: var(--bg-hover); }
.ol-meet-btn.on { background: var(--ol-sel); color: var(--ol-accent); font-weight: 600; }
.ol-meet-btn:disabled { opacity: .55; cursor: default; }
.ol-meet-btn:focus-visible, .ol-meet-caret:focus-visible { outline: 2px solid var(--ol-accent); outline-offset: -2px; }
.ol-meet-agenda { border-top: 1px solid var(--border); padding: 8px 14px 12px; background: color-mix(in srgb, var(--bg-card) 94%, #000); }
.ol-ag-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ol-ag-toggle { border: none; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; }
.ol-ag-toggle svg { width: 12px; height: 12px; transition: transform .15s; } .ol-ag-toggle[aria-expanded=false] svg { transform: rotate(-90deg); }
.ol-ag-alldays { display: flex; gap: 6px; flex-wrap: wrap; } .ol-ag-allday { font-size: 11px; background: #eef3f8; border-radius: 4px; padding: 1px 6px; color: var(--text-secondary); }
.ol-ag-body { position: relative; margin-left: 46px; border-left: 1px solid var(--border-strong); }
.ol-ag-hr { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); height: 0; } .ol-ag-hr span { position: absolute; left: -46px; top: -8px; width: 40px; text-align: right; font-size: 10.5px; color: var(--text-muted); }
.ol-ag-lane { position: absolute; inset: 0 8px 0 4px; }
.ol-ag-ev { position: absolute; left: 0; right: 0; box-sizing: border-box; padding: 1px 6px; font-size: 11.5px; line-height: 1.25; overflow: hidden; border-radius: 4px; background: #dbe7f5; border-left: 3px solid #0f6cbd; color: #1f3a5f; }
.ol-ag-ev b { font-weight: 600; margin-right: 4px; }
.ol-ag-ev.tent { background: repeating-linear-gradient(135deg, #e8f0fa, #e8f0fa 6px, #f7fafd 6px, #f7fafd 12px); }
.ol-ag-ev.conflict { background: #fde7e9; border-left-color: #c50f1f; color: #6b0d16; }
.ol-ag-ev.this { background: var(--ol-accent); border-left-color: var(--ol-accent-hover); color: #fff; z-index: 2; left: 10%; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.ol-atts-note, .ol-msg-fallback { margin: 4px 0 8px; padding: 8px 12px; border-radius: 6px; font-size: 13px; background: #fff8e1; border: 1px solid #f2dd9a; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ol-msg-fallback { display: block; background: var(--bg-card); border-color: var(--border); color: var(--text-secondary); } .ol-msg-fallback-h { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.ol-atts-note svg { width: 15px; height: 15px; color: #8a6d00; }
/* attached items / zip / slides inside the preview overlay */
.ol-item-wrap { max-width: 820px; margin: 20px auto; padding: 0 20px; background: var(--bg-card); border-radius: 8px; } .ol-item-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding-top: 14px; }
.ol-item-subject { margin: 4px 0 8px; font-size: 18px; } .ol-item-line { font-size: 13px; color: var(--text-secondary); margin: 2px 0; } .ol-item-line > span { display: inline-block; min-width: 42px; color: var(--text-muted); }
.ol-item-frame { width: 100%; border: 1px solid var(--border); border-radius: 6px; margin: 10px 0 16px; min-height: 120px; background: #fff; } .ol-item-body { padding: 4px 14px 16px; font-size: 14px; }
.ol-zip { max-width: 720px; margin: 20px auto; background: var(--bg-card); border-radius: 8px; padding: 8px 0; } .ol-zip-head { padding: 8px 16px; font-size: 12px; color: var(--text-muted); }
.ol-zip ul { list-style: none; margin: 0; padding: 0; } .ol-zip li { display: flex; align-items: center; gap: 8px; padding: 5px 16px; font-size: 13px; border-top: 1px solid var(--border); } .ol-zip li em { margin-left: auto; font-style: normal; color: var(--text-muted); font-size: 12px; }
.ol-slides { max-width: 760px; margin: 16px auto; display: flex; flex-direction: column; gap: 12px; padding: 0 16px 24px; } .ol-slides-note { font-size: 12px; color: #fff; opacity: .85; text-align: center; }
.ol-slide { background: #fff; color: #222; border-radius: 6px; aspect-ratio: 16 / 9; padding: 22px 30px; overflow: auto; box-shadow: 0 2px 10px rgba(0,0,0,.3); position: relative; } .ol-slide p { margin: 4px 0; font-size: 15px; } .ol-slide p.ttl { font-size: 22px; font-weight: 600; margin-bottom: 10px; } .ol-slide p.muted { color: #999; }
.ol-slide-n { position: absolute; right: 12px; bottom: 8px; font-size: 11px; color: #999; }
@media (max-width: 640px) { .ol-meet-card { flex-direction: column; } .ol-meet-actions { padding-left: 14px; } }
@media (prefers-reduced-motion: reduce) { .ol-ag-toggle svg { transition: none; } }
@media (forced-colors: active) { .ol-ag-ev, .ol-meet-btn.on { outline: 1px solid CanvasText; } }
.ol-zip-dir { color: var(--text-muted); }

/* virtual list: date label that follows the viewport, and the spacers around the rendered window */
.ol-hdr-float { position: sticky; top: 0; z-index: 3; height: 0; overflow: visible; }
.ol-hdr-float .ol-date-float { position: absolute; left: 0; right: 0; top: 0; }
#ol-vwin .ol-date-hdr { position: static; }
#ol-vtop, #ol-vbot { flex: none; }

/* ============================================================================
   Outlook ribbon — menu tabs (File / Home / View / Help) over a floating toolbar
   ========================================================================== */
.ol-ribbon-wrap { flex-shrink: 0; padding: 0 10px 6px; position: relative; }
.ol-menutabs { display: flex; align-items: center; gap: 2px; height: 36px; padding: 0 4px; }
.ol-mtab { position: relative; height: 34px; padding: 0 12px; border: none; background: transparent; font-size: 14px; color: #242424; cursor: pointer; border-radius: 6px; }
.ol-mtab:hover { background: var(--ol-hover); }
.ol-mtab.on { font-weight: 600; }
.ol-mtab.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 1px; height: 2px; border-radius: 2px; background: #242424; }
.ol-mtab:focus-visible, .ol-rbtn:focus-visible, .ol-caret:focus-visible, .ol-newmail:focus-visible { outline: 2px solid var(--ol-accent); outline-offset: -2px; }
.ol-ribbon-toggle { width: 28px; height: 28px; }
.ol-ribbon-wrap .ol-ribbon { height: 48px; padding: 5px 8px; gap: 1px; width: auto; border: none; border-radius: 12px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.14), 0 0 0 1px rgba(0,0,0,.05); overflow: hidden; }
.ol-ritem { display: inline-flex; align-items: center; flex-shrink: 0; }
.ol-ritem .ol-rbtn, .ol-ribbon-wrap .ol-rbtn { height: 36px; padding: 0 9px; border-radius: 6px; font-size: 14px; font-weight: 400; color: #242424; gap: 7px; }
.ol-ribbon-wrap .ol-rbtn svg, .ol-ribbon-wrap .ol-newmail svg { width: 20px; height: 20px; }
.ol-ribbon-wrap .ol-rbtn:hover:not(:disabled), .ol-caret:hover:not(:disabled) { background: #ebebeb; }
.ol-ribbon-wrap .ol-rbtn.on { background: var(--ol-sel); }
.ol-ribbon-wrap .ol-rbtn:disabled, .ol-caret:disabled { opacity: .38; cursor: default; }
.ol-split .ol-rbtn { border-top-right-radius: 0; border-bottom-right-radius: 0; padding-right: 7px; }
.ol-caret { width: 18px; height: 36px; padding: 0; border: none; background: transparent; border-radius: 0 6px 6px 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #616161; flex-shrink: 0; }
.ol-caret svg { width: 12px; height: 12px; }
.ol-ribbon-wrap .ol-newmail { height: 38px; padding: 0 12px 0 14px; border-radius: 8px 0 0 8px; background: #242424; color: #fff; font-size: 15px; font-weight: 600; margin: 0; }
.ol-ribbon-wrap .ol-newmail:hover:not(:disabled) { background: #3b3b3b; }
.ol-ribbon-wrap .ol-newmail .ol-rbtn-ic { color: #fff; }
.ol-split-primary .ol-caret { height: 38px; width: 26px; background: #242424; color: #fff; border-radius: 0 8px 8px 0; border-left: 1px solid rgba(255,255,255,.22); }
.ol-split-primary .ol-caret:hover:not(:disabled) { background: #3b3b3b; }
.ol-ritem.compact .ol-rbtn-lbl { display: none; }
.ol-ritem.compact .ol-rbtn { padding: 0 7px; }
.ol-ribbon-wrap .ol-rbtn-ic { color: #424242; }
.ol-ribbon-wrap .ol-rbtn:hover:not(:disabled) .ol-rbtn-ic { color: inherit; }
#rb-archive .ol-rbtn-ic { color: #107c10; } #rb-junk .ol-rbtn-ic { color: #d13438; } #rb-move .ol-rbtn-ic, #rb-forward .ol-rbtn-ic { color: #0f6cbd; }
#rb-reply .ol-rbtn-ic, #rb-replyall .ol-rbtn-ic { color: #8764b8; } #rb-flag .ol-rbtn-ic, #rb-flag.on .ol-rbtn-ic { color: #c4314b; } #rb-quick .ol-rbtn-ic { color: #e3a21a; } #rb-cat .ol-rbtn-ic { color: #605e5c; }
.ol-rsep { height: 24px; margin: 0 5px; background: #d1d1d1; }
.ol-ribbon-wrap .ol-sync { margin-left: 0; }
.ol-ribbon-wrap.ribbon-collapsed .ol-ribbon { display: none; }
.ol-ribbon-wrap.ribbon-collapsed.ribbon-peek .ol-ribbon { display: flex; position: absolute; left: 10px; right: 10px; top: 36px; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.ol-qs-form { display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.ol-qs-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.ol-qs-actions { display: flex; flex-direction: column; gap: 8px; }
.ol-qs-actions .ol-qs-chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.ol-qs-chk select { height: 32px; margin-left: 6px; }

/* ---- View tab: reading pane position, density, preview, conversations */
.ol-root[data-rp="bottom"] .ol-body { display: grid; grid-template-columns: var(--ol-folders-w) 8px minmax(0, 1fr); grid-template-rows: minmax(160px, 42%) minmax(0, 1fr); }
.ol-root[data-rp="bottom"] .ol-folders { grid-column: 1; grid-row: 1 / span 2; }
.ol-root[data-rp="bottom"] .ol-splitter[data-which="folders"] { grid-column: 2; grid-row: 1 / span 2; }
.ol-root[data-rp="bottom"] .ol-splitter[data-which="list"] { display: none; }
.ol-root[data-rp="bottom"] .ol-list { grid-column: 3; grid-row: 1; width: auto !important; max-width: none !important; margin-bottom: 6px; }
.ol-root[data-rp="bottom"] .ol-reading { grid-column: 3; grid-row: 2; }
.ol-root[data-rp="off"] .ol-splitter[data-which="list"] { display: none; }
.ol-root[data-rp="off"] .ol-list { flex: 1; width: auto !important; max-width: none !important; }
.ol-root[data-rp="off"] .ol-reading { display: none; position: absolute; inset: 0; z-index: 30; border-radius: 12px; }
.ol-root[data-rp="off"].reading-open .ol-reading { display: flex; }
.ol-root[data-rp="off"].reading-open .ol-list { visibility: hidden; }
.ol-root[data-rp="off"] .ol-back { display: inline-flex; }
/* Compact = one line per message, like Outlook: sender | subject … time */
.ol-root.dens-compact .ol-row { padding-top: 4px; padding-bottom: 4px; align-items: center; }
.ol-root.dens-compact .ol-row-avatar, .ol-root.dens-compact .ol-row-check { width: 26px; height: 26px; }
.ol-root.dens-compact .ol-row-avatar .ol-avatar { width: 26px; height: 26px; font-size: 11px; }
.ol-root.dens-compact .ol-row-lead { padding-top: 0; align-items: center; }
.ol-root.dens-compact .ol-row-main { display: flex; align-items: center; gap: 12px; }
.ol-root.dens-compact .ol-row-l1 { flex: 0 1 38%; min-width: 0; }
.ol-root.dens-compact .ol-row-l2 { flex: 1 1 62%; margin-top: 0; min-width: 0; }
.ol-root.dens-compact .ol-row-chips, .ol-root.dens-compact .ol-row-rsvp { display: none; }
.ol-root.dens-compact .ol-row-actions { top: 50%; transform: translateY(-50%); }
.ol-root.dens-compact .ol-row-l3, .ol-root.no-preview .ol-row-l3 { display: none; }

.ol-root.no-conv .ol-row-chev, .ol-root.no-conv .ol-count { visibility: hidden; }

/* ============================================================================
   Folder pane — Outlook look: grey selected row, black outline icons, plain bold counts
   ========================================================================== */
.ol-fsec-hdr { padding: 8px 10px; font-size: 15px; font-weight: 600; color: #242424; }
.ol-fsec-hdr svg { width: 12px; height: 12px; color: #616161; }
.ol-folder { height: 36px; margin: 1px 6px; border-radius: 6px; font-size: 14px; color: #242424; gap: 8px; }
.ol-folder:hover { background: #ededed; }
.ol-folder.selected { background: var(--ol-folder-sel); font-weight: 600; }
.ol-folder.selected::before { display: none; }
.ol-folder-ic, .ol-folder.selected .ol-folder-ic { color: #424242; }
.ol-folder-ic svg { width: 20px; height: 20px; }
.ol-folder-count { font-size: 13px; font-weight: 600; color: #242424; padding: 0 2px; }
.ol-folder-count.plain { font-weight: 400; color: #616161; }
.ol-folder:focus-visible { box-shadow: inset 0 0 0 2px var(--ol-accent); }
.ol-folders-title { color: #616161; }

/* ============================================================================
   Message list — Outlook rows: full width, hairline dividers, light-blue selection
   ========================================================================== */
.ol-list { border-radius: 8px; }
.ol-row { margin: 0; border: none; border-bottom: 1px solid var(--ol-divider); border-radius: 0; padding: 10px 12px 10px 2px; }
.ol-row:hover { background: var(--ol-hover); }
.ol-row.selected { background: var(--ol-sel); }
.ol-row.selected:hover { background: #c3dcf6; }
.ol-row.focus:not(.selected) { box-shadow: inset 0 0 0 1px #8a8886; }
.ol-row.unread::before { left: 0; top: 0; bottom: 0; width: 3px; border-radius: 0; }
.ol-row.child { margin-left: 0; padding-left: 30px; }
.ol-sender { font-size: 14px; color: #242424; }
.ol-subject { font-size: 14px; color: #242424; }
.ol-time { font-size: 12px; color: #616161; }
.ol-row-l3 { font-size: 13px; color: #616161; margin-top: 2px; }
.ol-row.unread .ol-sender { font-weight: 700; color: #242424; }
.ol-row.unread .ol-subject { font-weight: 600; color: var(--ol-accent); }
.ol-row.unread .ol-time { color: var(--ol-accent); font-weight: 600; }
.ol-row-l2 { margin-top: 1px; }
.ol-row:hover .ol-row-icons { visibility: hidden; }
.ol-row:hover .ol-time { visibility: visible; }
.ol-row-actions { top: 4px; right: 8px; background: transparent; }
.ol-row-actions button { background: rgba(255,255,255,.92); }
.ol-row-icons svg { width: 15px; height: 15px; }
.ol-ic-att { color: #616161; }
.ol-count { background: transparent; border: 1px solid #c8c8c8; color: #424242; font-weight: 600; }
.ol-date-hdr { display: flex; align-items: center; gap: 6px; padding: 7px 12px 5px 10px; font-size: 14px; font-weight: 600; color: #242424; background: #fff; cursor: pointer; border-bottom: 1px solid var(--ol-divider); }
.ol-date-hdr svg { width: 12px; height: 12px; color: #616161; flex-shrink: 0; }
.ol-date-hdr:hover { background: var(--ol-hover); }
.ol-hdr-float .ol-date-float { left: 0; right: 0; box-shadow: 0 1px 0 var(--ol-divider); }
.ol-list-scroll:focus-visible { outline: 2px solid var(--ol-accent); outline-offset: -2px; }
.ol-row-chev { color: #616161; }

/* ---- list header: Focused / Other tabs, filter + sort icons */
.ol-list-head { padding: 8px 12px 8px; border-bottom: none; }
.ol-list-title-row { margin-bottom: 8px; gap: 8px; min-height: 32px; }
.ol-list-title { font-size: 16px; font-weight: 600; }
.ol-focus-tabs { display: inline-flex; gap: 16px; margin-left: 6px; }
.ol-focus-tabs[hidden], .ol-list-titles[hidden] { display: none; }
.ol-focus-tabs button { position: relative; border: none; background: transparent; padding: 4px 0; font-size: 16px; color: #616161; cursor: pointer; }
.ol-focus-tabs button.on { color: #242424; font-weight: 600; }
.ol-focus-tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: #242424; border-radius: 2px; }
.ol-focus-tabs button:focus-visible { outline: 2px solid var(--ol-accent); outline-offset: 2px; }

/* ---- attachment chips under a row */
.ol-row-chips { display: flex; gap: 6px; margin-top: 6px; min-width: 0; }
.ol-achip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px 0 4px; border: 1px solid #d1d1d1; border-radius: 4px; background: #fff; font-size: 12.5px; color: #424242; max-width: 100%; min-width: 0; }
.ol-achip b { font-size: 8px; line-height: 1; padding: 3px 3px; border-radius: 2px; background: #605e5c; color: #fff; letter-spacing: .02em; flex-shrink: 0; }
.ol-achip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-achip.more { padding: 0 8px; flex-shrink: 0; color: #616161; }
.ol-achip.skel { width: 140px; border-color: transparent; background: linear-gradient(90deg, #ececec 25%, #f6f6f6 50%, #ececec 75%); background-size: 200% 100%; animation: ol-shimmer 1.2s linear infinite; }
.ol-row.selected .ol-achip { background: #fff; }
@media (prefers-reduced-motion: reduce) { .ol-achip.skel { animation: none; } }

/* ---- meeting invitation row: date, conflicts and RSVP */
.ol-row-rsvp { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 5px 8px; border: 1px solid #d1d1d1; border-radius: 6px; background: #fff; min-width: 0; }
.ol-rsvp-ic svg { width: 18px; height: 18px; color: #616161; }
.ol-rsvp-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 13px; color: #242424; line-height: 1.25; }
.ol-rsvp-txt span, .ol-rsvp-txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-rsvp-txt small { color: #616161; font-size: 12px; }
.ol-row-rsvp.clash .ol-rsvp-txt small { color: #a4262c; font-weight: 600; }
.ol-rsvp-btn { flex-shrink: 0; height: 28px; padding: 0 14px; border: 1px solid #8a8886; border-radius: 4px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: #242424; background: #fff; }
.ol-row-rsvp .skel { width: 160px; height: 30px; }

/* the list is virtualised (only rows near the screen exist), so rows are always laid out — and their heights are measured exactly */
.ol-row { content-visibility: visible; contain-intrinsic-size: none; }

/* ============================================================================
   Reading pane — Outlook attachment chips, banner, subject
   ========================================================================== */
.ol-thread-subject { font-size: 20px; font-weight: 400; color: #242424; line-height: 1.3; }
.ol-atts { gap: 8px; padding: 8px 16px 6px; }
.ol-att { min-width: 200px; max-width: 300px; padding: 5px 4px 5px 8px; gap: 8px; border: 1px solid #e0e0e0; border-radius: 6px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.ol-att:hover, .ol-att:focus-visible { background: #f5f5f5; border-color: #c8c8c8; }
.ol-att-ic { width: 26px; height: 26px; border-radius: 4px; font-size: 8px; letter-spacing: .02em; }
.ol-att-name { font-size: 14px; color: #242424; }
.ol-att-size { font-size: 12px; font-weight: 600; color: #616161; }
.ol-att-quick { opacity: 1; }
.ol-att-quick [data-act="att-preview"], .ol-att-quick [data-act="att-download"] { display: none; }
.ol-att:hover .ol-att-quick [data-act="att-preview"], .ol-att:hover .ol-att-quick [data-act="att-download"], .ol-att:focus-within .ol-att-quick button { display: inline-flex; }
.ol-att-quick [data-act="att-menu"] { color: #424242; }
.ol-banner { display: flex; align-items: center; gap: 10px; margin: 4px 16px 6px; padding: 8px 12px; border-radius: 6px; background: #f5f5f5; font-size: 14px; color: #242424; }
.ol-banner-ic svg { width: 18px; height: 18px; color: #616161; display: block; }
.ol-banner span:nth-child(2) { flex: 1; }
.ol-banner .ol-btn { height: 28px; font-size: 13px; }
.ol-reading { border-radius: 8px; }

/* Shift+Enter: the conversation takes over the whole mailbox */
.ol-root.reading-max .ol-reading { display: flex; position: absolute; inset: 0; z-index: 35; border-radius: 12px; }
.ol-root.reading-max .ol-back { display: inline-flex; }

/* ---- select-all banner ("Select all N messages") and smaller row tick-mark ---- */
.ol-allbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 14px; font-size: 12.5px; background: var(--ol-sel); color: var(--text-primary); border-bottom: 1px solid var(--border); }
.ol-allbar[hidden] { display: none; }
.ol-allbar button { border: none; background: none; color: var(--ol-accent); font: inherit; font-weight: 700; cursor: pointer; padding: 2px 4px; border-radius: 4px; } .ol-allbar button:hover { text-decoration: underline; }
.ol-allbar-prog { flex: 1; min-width: 120px; height: 5px; border-radius: 99px; background: rgba(0,0,0,.1); overflow: hidden; } .ol-allbar-prog i { display: block; height: 100%; background: var(--ol-accent); transition: width .25s; }
.ol-row:hover .ol-row-check, .ol-row.selected .ol-row-check { transform: scale(.5); }

.ol-to { color: var(--text-muted); font-weight: 500; font-size: .92em; margin-right: 2px; }



/* red [Draft] marker (like Outlook) */
.ol-draft { color: #c50f1f; font-weight: 600; margin-right: 4px; }
/* ====== Mail takes the whole window like Outlook: app bar + icon rail (body.mail-full is set by renderPage for the mailbox page) ====== */
body.mail-full .sidebar, body.mail-full .topbar, body.mail-full .win-bar { display: none !important; }
body.mail-full .main-content { margin: 0 !important; padding: 0 !important; width: 100% !important; max-width: none !important; }
body.mail-full .page-container { padding: 0 !important; margin: 0 !important; overflow: hidden; }
body.mail-full .ol-root {
  position: fixed; inset: 0; z-index: 100; height: 100vh !important; width: 100vw; min-height: 0; border: 0; border-radius: 0;
  display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: 48px auto minmax(0, 1fr);
  --ol-folders-w: 188px; --ol-list-w: 350px;
}
:root:not([data-theme="dark"]) body.mail-full .ol-root { background: #f0f0f0; }
.ol-appbar { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px 0 4px; background: var(--bg-card, #fff); box-sizing: border-box; min-width: 0; }
.ol-ab-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: none; border-radius: 4px; background: transparent; color: #424242; cursor: pointer; flex-shrink: 0; }
.ol-ab-btn svg { width: 20px; height: 20px; }
.ol-ab-btn:hover { background: #f5f5f5; }
.ol-brand { display: flex; align-items: center; gap: 10px; width: 212px; flex-shrink: 0; text-decoration: none; color: var(--ol-accent); font-size: 18px; font-weight: 600; letter-spacing: -.1px; overflow: hidden; }
.ol-brand img { height: 26px; width: auto; max-width: 110px; object-fit: contain; }
.ol-appbar .ol-search { position: relative; display: flex; align-items: center; width: 350px; max-width: 100%; min-width: 0; height: 32px; box-sizing: border-box; border: 1px solid #d1d1d1; border-radius: 4px; background: #fff; padding: 0 8px; gap: 8px; }
.ol-appbar .ol-search:hover { border-color: #b3b3b3; }
.ol-appbar .ol-search:focus-within { border-color: var(--ol-accent); box-shadow: 0 0 0 1px var(--ol-accent) inset; }
.ol-appbar .ol-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font: inherit; font-size: 14px; color: #242424; height: 100%; padding: 0; }
.ol-appbar .ol-search-ic svg { width: 16px; height: 16px; color: #424242; }
.ol-ab-avatar { width: 32px; height: 32px; border-radius: 50%; border: none; background: #e6e6e6; color: #424242; font: 600 13px/32px "Segoe UI", system-ui, sans-serif; cursor: pointer; flex-shrink: 0; }
.ol-ab-avatar:hover { box-shadow: 0 0 0 2px #cfcfcf; }
.ol-rail { grid-column: 1; grid-row: 2 / 4; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; background: transparent; overflow-y: auto; scrollbar-width: none; }
.ol-rail::-webkit-scrollbar { display: none; }
.ol-rail-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 4px; color: #424242; flex-shrink: 0; }
.ol-rail-btn svg { width: 20px; height: 20px; }
.ol-rail-btn:hover { background: #e6e6e6; }
.ol-rail-btn.on { color: var(--ol-accent); }
.ol-rail-btn.on::before { content: ""; position: absolute; left: -4px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--ol-accent); }
body.mail-full .ol-ribbon { grid-column: 2; grid-row: 2; width: auto; margin: 0 8px 8px; border: 0; border-radius: 8px; padding: 4px 8px; box-shadow: 0 0 2px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.14); }
body.mail-full .ol-body { grid-column: 2; grid-row: 3; min-height: 0; }
body.mail-full .ol-root[data-layout="narrow"] { grid-template-columns: minmax(0, 1fr); }
body.mail-full .ol-root[data-layout="narrow"] .ol-rail, body.mail-full .ol-root[data-layout="narrow"] .ol-brand { display: none; }
body.mail-full .ol-root[data-layout="narrow"] .ol-ribbon, body.mail-full .ol-root[data-layout="narrow"] .ol-body { grid-column: 1; }
body.mail-full .ol-root[data-layout="narrow"] .ol-appbar .ol-search { flex: 1; width: auto; }
/* ====== Part 2: list header + folder pane like Outlook ====== */
body.mail-full .ol-folders-top, body.mail-full .ol-list-sub { display: none; }
body.mail-full .ol-folders-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-right: 6px; color: #424242; border-radius: 4px; }
body.mail-full .ol-folders-toggle:hover { background: #e6e6e6; }
body.mail-full .ol-folder, body.mail-full .ol-fsec-hdr { border-radius: 4px; }
body.mail-full .ol-fsec-hdr { font-size: 14px; }
body.mail-full .ol-folders { padding-top: 6px; }
.ol-order-btn[data-dir="asc"] svg { transform: rotate(180deg); }
body.mail-full .ol-list-head .ol-iconbtn { width: 32px; height: 32px; border-radius: 4px; color: #424242; }
body.mail-full .ol-list-head .ol-iconbtn:hover { background: #f0f0f0; }
body.mail-full .ol-list-title { font-size: 16px; font-weight: 600; color: #242424; }
/* ====== Part 3: compose docked over the reading pane (Outlook inline compose) ====== */
#modal-overlay.docked { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; animation: none; }
#modal-card.docked { position: fixed; margin: 0; max-width: none; max-height: none; pointer-events: auto; display: flex; flex-direction: column; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 0 2px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.14); overflow: hidden; animation: none; }
#modal-card.docked .modal-header { display: none; }
#modal-card.docked .modal-footer { order: -1; display: flex; align-items: center; gap: 6px; padding: 10px 14px; border: 0; border-bottom: 1px solid #ebebeb; background: #fff; flex-wrap: wrap; }
#modal-card.docked .modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px 16px; }
#modal-card.docked #compose-send-btn { order: -10; height: 32px !important; padding: 0 16px !important; border-radius: 4px; background: #242424; color: #fff; font-size: 14px; font-weight: 600; box-shadow: none; }
#modal-card.docked #compose-send-btn:hover { background: #3a3a3a; }
#modal-card.docked #compose-attach-btn { order: -9; height: 32px !important; padding: 0 10px !important; border: 0; background: transparent; font-size: 14px; color: #242424; }
#modal-card.docked #compose-attach-btn:hover { background: #f0f0f0; }
#modal-card.docked .modal-footer .btn-secondary:not(#compose-attach-btn) { height: 32px !important; padding: 0 12px !important; border: 0; background: transparent; font-size: 14px; color: #424242; }
#modal-card.docked .compose-field-row > label { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 32px; padding: 0 8px; border: 1px solid #d1d1d1; border-radius: 4px; font-size: 14px; color: #242424; background: #fff; box-sizing: border-box; }
#modal-card.docked .compose-from-row { font-size: 13px; color: #616161; padding: 2px 0 6px; }
#modal-card.docked #compose-subject { border: 0; border-bottom: 1px solid #d1d1d1; border-radius: 0; box-shadow: none; padding-left: 0; font-size: 20px; font-weight: 400; background: transparent; }
#modal-card.docked #compose-subject:focus { border-bottom-color: #0f6cbd; }
#modal-card.docked .compose-body-editable { font-size: 14px; min-height: 180px; }
/* reading-pane header action colours (Outlook: purple reply arrows, blue forward) */
.ol-mh-actions button[data-act="m-reply"] svg, .ol-mh-actions button[data-act="m-replyall"] svg { color: #8764b8; }
.ol-mh-actions button[data-act="m-forward"] svg { color: #0f6cbd; }
.ol-mh-actions button { width: 32px; height: 31px; border-radius: 4px; }
#modal-card.docked .compose-field-row > label { white-space: nowrap; }
#modal-card.docked .compose-field-row:has(#compose-subject) > label { display: none; }
#modal-card.docked .compose-field-row:has(#compose-subject) { margin-top: 6px; }

/* ====== Part 4: search drop-down, menu headers ====== */
.ol-sp { position: absolute; left: 0; top: calc(100% + 4px); width: 520px; max-width: 92vw; background: #fff; border-radius: 8px; box-shadow: 0 0 2px rgba(0,0,0,.12), 0 8px 16px rgba(0,0,0,.14); padding: 8px 0; z-index: 300; font-size: 14px; color: #242424; }
.ol-sp-scope { display: flex; align-items: center; gap: 6px; padding: 4px 16px 8px; color: #616161; font-size: 13px; }
.ol-sp-scope button { border: 1px solid #d1d1d1; background: #fff; border-radius: 14px; height: 26px; padding: 0 12px; font: inherit; font-size: 13px; cursor: pointer; color: #242424; }
.ol-sp-scope button.on { background: #cfe4fa; border-color: #0f6cbd; color: #0f6cbd; font-weight: 600; }
.ol-sp-hd { padding: 8px 16px 4px; font-size: 12px; font-weight: 600; color: #616161; }
.ol-sp-it { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; border: 0; background: transparent; text-align: left; font: inherit; cursor: pointer; color: #242424; }
.ol-sp-it:hover { background: #f5f5f5; }
.ol-sp-it .ic svg { width: 16px; height: 16px; color: #616161; }
.ol-sp-it .av { width: 32px; height: 32px; border-radius: 50%; background: #d9a3cf; color: #3a1c35; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.ol-sp-it .tx { display: flex; flex-direction: column; min-width: 0; }
.ol-sp-it .tx small { color: #616161; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-sp-none { padding: 12px 16px; color: #616161; }
.ol-menu-hdr { padding: 8px 12px 4px; font-size: 12px; color: #616161; font-weight: 400; }
/* ====== Part 5: Outlook-style Settings window ====== */
.ol-set-ov { position: fixed; inset: 0; z-index: 700; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif; }
.ol-set { display: flex; width: min(960px, 96vw); height: min(640px, 92vh); background: #fff; border-radius: 8px; box-shadow: 0 32px 64px rgba(0,0,0,.28), 0 0 8px rgba(0,0,0,.2); overflow: hidden; color: #242424; }
.ol-set-nav { width: 208px; flex-shrink: 0; background: #fafafa; border-right: 1px solid #e0e0e0; padding: 20px 0 12px; display: flex; flex-direction: column; }
.ol-set-nav h2 { margin: 0 0 14px 16px; font-size: 18px; font-weight: 600; }
.ol-set-grp { padding: 6px 16px; font-size: 12px; color: #616161; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.ol-set-nav nav { display: flex; flex-direction: column; flex: 1; }
.ol-set-nav nav button { position: relative; text-align: left; border: 0; background: transparent; padding: 9px 16px; font: inherit; font-size: 14px; color: #424242; cursor: pointer; }
.ol-set-nav nav button:hover { background: #f0f0f0; }
.ol-set-nav nav button.on { color: #242424; font-weight: 600; }
.ol-set-nav nav button.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: #242424; }
.ol-set-more button { border: 0; background: none; color: #0f6cbd; font: inherit; font-size: 13px; cursor: pointer; padding: 8px 16px; text-align: left; }
.ol-set-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ol-set-main header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px 24px; border-bottom: 1px solid #ebebeb; }
.ol-set-main header h3 { margin: 0; font-size: 18px; font-weight: 600; }
.ol-set-body { flex: 1; overflow-y: auto; padding: 8px 32px 28px 24px; }
.ol-set-body h4 { margin: 20px 0 4px; font-size: 15px; font-weight: 600; }
.ol-set-body p { margin: 4px 0 8px; font-size: 14px; color: #424242; }
.ol-set-body hr { border: 0; border-top: 1px solid #e8e8e8; margin: 22px 0 0; }
.ol-set-chk, .ol-set-rad { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.ol-set-chk input, .ol-set-rad input { position: absolute; opacity: 0; pointer-events: none; }
.ol-set-chk i { width: 16px; height: 16px; border: 1px solid #616161; border-radius: 2px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ol-set-chk input:checked + i { background: #242424; border-color: #242424; }
.ol-set-chk input:checked + i::after { content: ""; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.ol-set-rad i { width: 16px; height: 16px; border: 1px solid #616161; border-radius: 50%; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ol-set-rad input:checked + i::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #242424; }
.ol-set-chk input:focus-visible + i, .ol-set-rad input:focus-visible + i { outline: 2px solid #0f6cbd; outline-offset: 2px; }
/* ====== Mail keeps the CRM's own left menu (labels, collapse, theme); it sits to the right of it ====== */
body.mail-full .sidebar { display: flex !important; }
body.mail-full .ol-root { left: var(--ol-sbw, 72px); width: auto; grid-template-columns: minmax(0, 1fr); }
body.mail-full .ol-appbar, body.mail-full .ol-ribbon, body.mail-full .ol-body { grid-column: 1; }
body.mail-full .ol-rail { display: none; }
.ol-brand { width: auto; min-width: 150px; }
body.mail-full .ol-appbar .ol-search { margin-left: 28px; }
@media (max-width: 1000px) { body.mail-full .ol-root { left: 0; } }
body.mail-full .ol-root { left: 0; right: 0; width: auto; }
@media (max-width: 1000px) { body.mail-full .ol-root { left: 0; } }
