/* Dossier viewer — no external fonts or assets. */
:root {
  --bg: #fbfbfa;
  --panel: #ffffff;
  --ink: #1f2328;
  --ink-2: #4b5563;
  --muted: #6b7280;
  --line: #e7e7e4;
  --line-2: #d9d9d4;
  --accent: #2f5bea;
  --accent-soft: #eef2ff;
  --focus: 0 0 0 3px rgba(47, 91, 234, .25);
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-l: 0 12px 32px rgba(16, 24, 40, .14);

  /* Reading Copy palette (same as the PDF) */
  --rc-isaiah: #007aff;
  --rc-miracle: #f2f2f7;
  --rc-alf: #f8f1e7;
  --rc-neway: #e7f2ec;
  --rc-billing: #eef0f4;
  --rc-wa: #e5f7eb;
  --rc-msgr: #e9e7ff;
  --rc-notary: #fff1dc;
  --wa: #128c4b;
  --msgr: #4b3fd1;
  --notary: #9a5b00;

  --note-bg: #fff7e0; --note-line: #f1d58a; --note-ink: #6b4e00;
  --mark: #ffe28a;
  --warn: #b45309;
  --danger: #c0352b;
  --ok: #11703b;

  --topbar-h: 56px;
  --drawer-w: 460px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink);
  padding: 6px 12px; border-radius: var(--radius-s); font-size: 14px; line-height: 1.3;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f6f6f4; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #2549c4; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: #f1f1ee; }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; padding: 10px 14px; }
.btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn {
  border: 0; background: transparent; width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2);
}
.icon-btn:hover { background: #f1f1ee; }
.link { border: 0; background: none; color: var(--accent); padding: 0; font-size: 13px; }
.link:hover { text-decoration: underline; }
input[type=text], input[type=search], input[type=password], input[type=date], select, textarea {
  border: 1px solid var(--line-2); background: var(--panel); border-radius: var(--radius-s);
  padding: 6px 10px; font-size: 14px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
label.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark, .login-mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.nav { display: flex; gap: 2px; }
.nav a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.ni { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.si { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; position: absolute; left: 10px; pointer-events: none; }
.bi { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.tools { display: flex; align-items: center; gap: 10px; }
.m-only { display: none; }
.nav a:hover { background: #f3f3f0; text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.search { flex: 1; display: flex; align-items: center; gap: 4px; max-width: 440px; margin-left: auto; position: relative; }
.search input { flex: 1; padding: 7px 12px 7px 32px; background: #f6f6f4; border-color: transparent; }
.sresults {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 380px; max-height: min(70vh, 560px); overflow-y: auto; z-index: 40;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-l); padding: 4px;
}
.sr-head, .sr-more, .sr-empty { font-size: 12px; color: var(--muted); padding: 6px 10px; }
.sr { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 7px 10px; }
.sr:hover, .sr:focus { background: var(--accent-soft); outline: none; }
.sr-top { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.sr-top b { font-weight: 650; white-space: nowrap; }
.sr-ch { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.sr-top time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sr-snip { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.sr-where { display: block; font-size: 11px; color: var(--accent); margin-top: 1px; }
.search input:focus { background: var(--panel); }
.search-count { font-size: 12px; color: var(--muted); min-width: 56px; text-align: right; white-space: nowrap; }
.seg { display: inline-flex; background: #f1f1ee; border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; font-size: 13px; color: var(--ink-2); }
.seg button.active { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.author { width: 124px; }
.dev-banner { background: #fff4d6; color: var(--note-ink); text-align: center; font-size: 13px; padding: 4px; border-bottom: 1px solid var(--note-line); }

/* ---------- Layout ---------- */
.shell { position: relative; display: flex; align-items: flex-start; }
.view { flex: 1; min-width: 0; }
.row, .em, .cb-wrap, .frow { scroll-margin-top: calc(var(--topbar-h) + 56px); scroll-margin-bottom: 24px; }
.view:focus { outline: none; }
.loading, .empty { padding: 64px 24px; text-align: center; color: var(--muted); }

/* slim sticky toolbar */
.toolbar {
  position: sticky; top: var(--topbar-h); z-index: 5; background: #fbfbfa;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 24px; border-bottom: 1px solid var(--line);
}
.toolbar .grow { flex: 1; }
.toolbar .count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.toolbar select, .toolbar input[type=date] { font-size: 13px; padding: 4px 8px; }
.filterpanel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; padding: 6px 0 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px solid var(--line-2); background: var(--panel); border-radius: 999px; padding: 3px 11px; font-size: 13px; color: var(--ink-2); }
.chip-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Reading Copy ---------- */
.rc { max-width: 860px; margin: 0 auto; padding: 4px 24px 140px; }
.legend {
  margin: 18px 0 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px 12px;
}
.legend-head { display: flex; align-items: center; gap: 8px; }
.legend-head h2 { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; font-weight: 700; }
.legend-head .grow { flex: 1; }
.legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.legend-item .sw { flex: 0 0 auto; width: 46px; height: 22px; border-radius: 11px 11px 11px 4px; border: 1px solid rgba(0,0,0,.06); }
.legend-item .sw.mine { border-radius: 11px 11px 4px 11px; background: var(--rc-isaiah); border-color: var(--rc-isaiah); }
.legend-foot { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.month { display: flex; align-items: baseline; gap: 10px; margin: 34px 0 6px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.month h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.month span { font-size: 12.5px; color: var(--muted); }
.day { position: sticky; top: calc(var(--topbar-h) + var(--tb-h, 44px)); z-index: 3; text-align: center; margin: 18px 0 6px; pointer-events: none; }
.day span { display: inline-block; min-width: 290px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: #fbfbfa; border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; }
.month-jump { max-width: 190px; }
.enote { justify-content: center; }
.enote-box { max-width: 78%; text-align: center; font-size: 13px; color: var(--ink-2); background: #f1f1ef; border: 1px dashed var(--line-2); border-radius: 12px; padding: 8px 14px; white-space: pre-wrap; }
.enote-box .enote-k { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.enote-box .atts { align-items: center; }
.cnote .atts { align-items: center; margin-top: 6px; }
.cnote { text-align: center; margin: 10px auto; max-width: 80%; font-size: 12.5px; color: #54656f; background: #fff8d6; border-radius: 8px; padding: 6px 12px; }
.chat-tr { font-size: 12.5px; color: var(--ink-2); background: #fff8e6; border-bottom: 1px solid var(--note-line); padding: 6px 16px; }
.em-subj { font-size: 13px; font-weight: 650; color: var(--ink-2); padding: 10px 14px 0 60px; }
.missing { display: flex; flex-direction: column; gap: 4px; padding: 22px; text-align: center; border: 1px dashed #f4c38b; background: #fff8ef; border-radius: 10px; font-size: 13.5px; color: var(--ink-2); }
.missing b { color: var(--warn); }
.btn.big { font-size: 16px; padding: 14px 18px; }
.fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.ref-k { font-size: 10.5px; font-weight: 650; color: var(--ink-2); background: #eef0f4; border-radius: 5px; padding: 0 5px; }
.pill { text-align: center; margin: 12px 0 8px; }
.pill span {
  display: inline-flex; align-items: center; gap: 5px; max-width: 92%; background: #ececef; color: #3a3a3c;
  border-radius: 999px; padding: 3px 11px; font-size: 12px; line-height: 1.35;
}
.row { display: flex; margin: 0 0 9px; }
.row.cont { margin-top: -4px; }
.row.mine { justify-content: flex-end; }
.row.theirs { justify-content: flex-start; }
.stack { max-width: 78%; min-width: 0; display: flex; flex-direction: column; }
.row.mine .stack { align-items: flex-end; }
.row.theirs .stack { align-items: flex-start; }
.meta { font-size: 12px; color: #8e8e93; margin: 0 6px 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.meta .who { color: #1d1d1f; font-weight: 600; }
.meta .role.wa { color: var(--wa); }
.meta .role.msgr { color: var(--msgr); }
.meta .role.notary { color: var(--notary); }
.bubble {
  position: relative; padding: 8px 12px; overflow-wrap: anywhere; cursor: pointer;
  border-radius: 16px 16px 16px 4px; background: var(--rc-miracle); color: #1c1c1e;
  transition: box-shadow .12s ease;
}
.row.mine .bubble { background: var(--rc-isaiah); color: #fff; border-radius: 16px 16px 4px 16px; }
.row.mine .bubble a { color: #fff; text-decoration: underline; }
.row.mine .bubble mark { color: #1c1c1e; }
.b-alf { background: var(--rc-alf) !important; }
.b-neway { background: var(--rc-neway) !important; }
.b-billing { background: var(--rc-billing) !important; }
.b-wa { background: var(--rc-wa) !important; }
.b-msgr { background: var(--rc-msgr) !important; }
.b-notary { background: var(--rc-notary) !important; }
.bubble:hover { box-shadow: 0 0 0 2px rgba(0, 0, 0, .06); }
.bubble.selected { box-shadow: 0 0 0 3px rgba(47, 91, 234, .35); }
.row.hit-current .bubble { box-shadow: 0 0 0 3px var(--mark); }
.body { font-size: 14.5px; line-height: 1.5; }
.body p, .em-body p, .dbody p { margin: 0 0 .6em; white-space: pre-wrap; }
.body p:last-child, .em-body p:last-child, .dbody p:last-child { margin-bottom: 0; }
.body.clamp { max-height: 30em; overflow: hidden; }
.row.mine .more { color: #fff; }
.trflag { font-size: 11.5px; opacity: .75; margin-top: 4px; }
.trflag.warn { color: var(--warn); opacity: 1; }
.row.mine .trflag.warn { color: #ffe2b8; }
.ftr { display: flex; align-items: center; gap: 6px; margin: 2px 6px 0; min-height: 18px; }
.note-btn {
  border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 1px 6px; border-radius: 6px;
  opacity: 0; transition: opacity .12s ease;
}
.row:hover .note-btn, .note-btn:focus, .note-btn.has, .frow:hover .note-btn, .fcard:hover .note-btn, .em:hover .note-btn, .cb-wrap:hover .note-btn { opacity: 1; }
.note-btn:hover { background: rgba(0, 0, 0, .05); color: var(--note-ink); }
.note-btn.has { color: var(--note-ink); }
.tag { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); color: var(--ink-2); }
.tag.rc { border-color: #f4c38b; color: var(--warn); background: #fff6ec; }
.wa-mark { color: var(--wa); font-size: 11px; }
.msgr-mark { color: var(--msgr); font-size: 11px; }

/* attachment cards (same as the PDF) */
.atts { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.row.mine .atts { align-items: flex-end; }
.file {
  display: inline-flex; align-items: center; gap: 8px; max-width: min(460px, 100%); min-width: 0;
  background: #fff; border: 1px solid #e3e3e8; border-radius: 12px; padding: 4px 12px 4px 4px; color: #1c1c1e;
}
.file:hover { text-decoration: none; border-color: var(--accent); }
.row.mine .file { background: #f3f8ff; border-color: #d5e6fb; }
.file-ico {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 700; letter-spacing: .04em; background: #8e8e93; color: #fff;
}
.file-ico.pdf { background: #007aff; } .file-ico.photo { background: #34c759; } .file-ico.word { background: #2b579a; }
.file-ico.video { background: #ff3b30; } .file-ico.excel { background: #1f7a45; } .file-ico.mail { background: #6b7280; } .file-ico.chat { background: #128c4b; }
.file-name { min-width: 0; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.file-name small { display: block; color: var(--muted); font-size: 11.5px; }
.thumb { display: block; width: 260px; height: 195px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #f3f3f0; }

/* ---------- Notes ---------- */
.notes { width: 100%; max-width: 640px; margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.note {
  background: var(--note-bg); border: 1px solid var(--note-line); border-left: 4px solid #e8b931;
  border-radius: 10px; padding: 8px 12px; font-size: 13.5px; color: #3d3000; text-align: left;
}
.note-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--note-ink); margin-bottom: 2px; }
.note-meta b { font-weight: 650; }
.note-actions { margin-left: auto; display: inline-flex; gap: 4px; }
.note-actions button { border: 0; background: transparent; color: var(--note-ink); font-size: 12px; padding: 1px 6px; border-radius: 5px; }
.note-actions button:hover { background: rgba(0, 0, 0, .06); }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.composer { background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 10px; padding: 8px; width: 100%; }
.composer textarea { width: 100%; min-height: 72px; resize: vertical; background: #fff; border-color: var(--note-line); }
.composer-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.composer-actions .hint { font-size: 12px; color: var(--note-ink); margin-right: auto; }

/* ---------- Drawer ---------- */
.drawer {
  width: var(--drawer-w); position: fixed; right: 0; top: var(--topbar-h); bottom: 0; z-index: 15; background: var(--panel); border-left: 1px solid var(--line);
  display: none; flex-direction: column; box-shadow: -8px 0 24px rgba(16, 24, 40, .05);
}
.drawer.open { display: flex; }
.drawer-head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.drawer-title { flex: 1; font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 48px; }
.drawer-body h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 22px 0 8px; font-weight: 650; }
.drawer-body h3:first-child { margin-top: 0; }
dl.meta-list { display: grid; grid-template-columns: 128px 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
dl.meta-list dt { color: var(--muted); }
dl.meta-list dd { margin: 0; overflow-wrap: anywhere; }
.people { display: flex; flex-direction: column; gap: 2px; }
.person b { font-weight: 600; }
.person .email { color: var(--muted); font-size: 12.5px; }
.rc-box { margin-top: 14px; border: 1px solid #f4c38b; background: #fff8ef; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.rc-box b { color: var(--warn); display: block; margin-bottom: 4px; }
.rc-box .rc-line { display: flex; gap: 6px; flex-wrap: wrap; }
.rc-box .rc-line span.k { color: var(--muted); min-width: 72px; }
.rc-box .add { color: var(--ok); }
.rc-box .rem { color: var(--danger); text-decoration: line-through; }
.dbody { overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; background: #fafaf8; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; flex-wrap: wrap; }
.att-row .nm { flex: 1; min-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.dl-group { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.preview { width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: 10px; background: #f3f3f0; }
img.preview { height: auto; max-height: 62vh; object-fit: contain; display: block; }
.preview-empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 10px; font-size: 13.5px; }
.linked { display: flex; flex-direction: column; gap: 6px; }
.linked a { font-size: 13.5px; }

/* ---------- Email (Gmail-like) ---------- */
.inbox { max-width: 1100px; margin: 0 auto; padding: 0 24px 120px; }
.inbox-list { margin-top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.irow {
  display: grid; grid-template-columns: 14px minmax(140px, 230px) minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--ink); cursor: pointer;
}
.irow:last-child { border-bottom: 0; }
.irow:hover { background: #f7f8fa; text-decoration: none; box-shadow: inset 3px 0 0 var(--accent); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #c7c7cc; }
.dot.isaiah { background: var(--rc-isaiah); } .dot.miracle { background: #9ca3af; } .dot.altamirano { background: #c9a46a; }
.dot.neway { background: #4caf7a; } .dot.notary { background: #e0a23a; } .dot.billing { background: #94a3b8; }
.irow .who { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irow .who .n { color: var(--muted); font-weight: 400; font-size: 12.5px; margin-left: 4px; }
.irow .line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.irow .line b { font-weight: 600; }
.irow .line .snip { color: var(--muted); }
.irow .right { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.irow .right .paper { font-size: 13px; }
.irow .right .nc { color: var(--note-ink); }
.thread { max-width: 920px; margin: 0 auto; padding: 10px 24px 140px; }
.thread-head { display: flex; align-items: flex-start; gap: 12px; margin: 8px 0 14px; }
.thread-head h1 { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 600; flex: 1; overflow-wrap: anywhere; }
.thread-sub { color: var(--muted); font-size: 13px; margin: -8px 0 14px; }
.em { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.em.open { box-shadow: var(--shadow); }
.em-h { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 650; color: #fff; background: #9ca3af; flex: 0 0 auto;
}
.avatar.isaiah { background: var(--rc-isaiah); } .avatar.altamirano { background: #b88a4a; } .avatar.neway { background: #3f9a68; }
.avatar.notary { background: #c48419; } .avatar.billing { background: #64748b; } .avatar.wa { background: #25d366; } .avatar.msgr { background: #7c6cf0; }
.em-who { min-width: 0; }
.em-who b { font-weight: 650; font-size: 14px; }
.em-who .role { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.em-who .snip { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-who .tos { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-date { font-size: 12.5px; color: var(--muted); white-space: nowrap; text-align: right; }
.em-b { padding: 0 14px 14px 60px; }
.em-hdrs { font-size: 13px; color: var(--ink-2); display: grid; grid-template-columns: 52px 1fr; gap: 2px 8px; margin-bottom: 10px; }
.em-hdrs .k { color: var(--muted); }
.em-body { overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.6; }
.em-body.isaiah { border-left: 3px solid var(--rc-isaiah); padding-left: 10px; }
.em .atts { margin-top: 10px; }
.em-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.em .notes { max-width: none; }

/* ---------- Chats (WhatsApp-like) ---------- */
.chats { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - var(--topbar-h)); }
.chat-list { border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; }
.crow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid #f0f0ee; color: var(--ink); cursor: pointer; }
.crow:hover { background: #f5f6f6; text-decoration: none; }
.crow.active { background: #eef1f3; }
.crow .avatar { width: 44px; height: 44px; font-size: 15px; }
.crow .nm { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .sub { font-size: 12px; color: var(--muted); }
.crow .last { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow .tm { font-size: 11.5px; color: var(--muted); align-self: start; margin-top: 3px; text-align: right; white-space: nowrap; }
.crow .cnt { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #f0f2f5; border-bottom: 1px solid var(--line); }
.chat-head .avatar { width: 40px; height: 40px; }
.chat-head .ttl { flex: 1; min-width: 0; }
.chat-head .ttl b { display: block; font-size: 15.5px; }
.chat-head .ttl span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-back { display: none; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 6% 120px; background: #efeae2; }
.chat-body.msgr { background: #ffffff; }
.cday { text-align: center; margin: 12px 0; }
.cday span { display: inline-block; background: #ffffffd9; color: #54656f; font-size: 12px; padding: 4px 10px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); }
.chat-body.msgr .cday span { background: transparent; box-shadow: none; color: var(--muted); font-weight: 600; }
.cb-wrap { display: flex; flex-direction: column; margin: 2px 0; }
.cb-wrap.out { align-items: flex-end; }
.cb-wrap.in { align-items: flex-start; }
.cb-wrap.first { margin-top: 10px; }
.cb {
  position: relative; max-width: min(560px, 78%); padding: 6px 9px 6px 10px; border-radius: 8px; background: #fff; color: #111b21;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .13); font-size: 14.2px; line-height: 1.45; cursor: pointer; overflow-wrap: anywhere;
}
.cb-wrap.out .cb { background: #d9fdd3; }
.cb-wrap.first.in .cb { border-top-left-radius: 0; }
.cb-wrap.first.out .cb { border-top-right-radius: 0; }
.chat-body.msgr .cb { box-shadow: none; border-radius: 18px; padding: 8px 12px; background: #f0f0f0; }
.chat-body.msgr .cb-wrap.out .cb { background: #0084ff; color: #fff; }
.chat-body.msgr .cb-wrap.out .cb a { color: #fff; }
.cb.selected { box-shadow: 0 0 0 2px rgba(47, 91, 234, .45); }
.cb-wrap.hit-current .cb { box-shadow: 0 0 0 3px var(--mark); }
.cb .snd { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 1px; color: #1f7aec; }
.cb .txt { white-space: pre-wrap; }
.cb .tm { float: right; margin: 6px 0 -4px 10px; font-size: 11px; color: #667781; }
.chat-body.msgr .cb-wrap.out .cb .tm { color: #dbeafe; }
.cb .atts { margin: 4px 0 2px; }
.cb-wrap .ftr { margin: 1px 4px 0; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); background: #f8f9fa; text-align: center; padding: 24px; }

/* ---------- Files ---------- */
.files-wrap { max-width: 1120px; margin: 0 auto; padding: 8px 24px 120px; }
.flist { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.frow-wrap { display: flex; flex-direction: column; }
.frow {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) minmax(0, 250px) minmax(230px, auto); gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
}
.frow:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.fmain { min-width: 0; cursor: pointer; }
.fname { font-weight: 550; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmeta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.flinks { display: flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
.factions { display: flex; gap: 4px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.fcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.fcard:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.fcard .fname { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fcard .factions { justify-content: flex-start; margin-top: auto; }
.fcard .notes, .frow-wrap .notes { max-width: none; }
.kind { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.mchip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-2); background: #fafaf8; border: 1px solid var(--line-2); border-radius: 8px; padding: 2px 8px; max-width: 100%; }
.mchip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.mchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Payments ---------- */
.pay { max-width: 1100px; margin: 0 auto; padding: 18px 24px 140px; }
.pay h1 { font-size: 22px; margin: 4px 0 2px; }
.pay .asof { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.ptotals { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 8px; }
.ptot { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ptot .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.ptot .usd { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.ptot .mxn { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ptot .nt { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ptot.grand { background: #eaf7ef; border-color: #bfe5cd; }
.ptot.grand .usd { color: #0f5c2f; }
.pcontract { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0 0; font-size: 13.5px; }
.pcontract b { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.psec { margin-top: 30px; }
.psec-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.psec-h h2 { font-size: 16px; margin: 0; }
.psec-h .badge-k { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-radius: 999px; padding: 2px 9px; }
.k-miracle .badge-k { background: #eef0f4; color: #475569; }
.k-stage5 .badge-k { background: #fdecec; color: var(--danger); }
.k-surrogate-schedule .badge-k { background: #e3efff; color: #1d4ed8; }
.k-surrogate-outside .badge-k { background: #fff3cc; color: #8a5a00; }
.k-legal-medical .badge-k { background: #f3e8ff; color: #6b21a8; }
.k-outstanding .badge-k { background: #fdecec; color: var(--danger); }
.ptable-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.k-surrogate-schedule .ptable-wrap { border-left: 5px solid #3b82f6; }
.k-surrogate-outside .ptable-wrap { border-left: 5px solid #f2b705; }
.k-stage5 .ptable-wrap, .k-outstanding .ptable-wrap { border-left: 5px solid #e0524a; }
table.ptable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ptable th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fafaf8; white-space: nowrap; }
.ptable td { padding: 9px 12px; border-bottom: 1px solid #f0f0ee; vertical-align: top; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptable .date { white-space: nowrap; color: var(--ink-2); }
.ptable .desc { min-width: 220px; }
.ptable .ctx { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ptable .ref { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ptable tr.sub td { font-weight: 700; background: #fafaf8; border-top: 1px solid var(--line); }
.ptable tr.hit td { background: #fffbe6; }
.status { font-size: 11.5px; font-weight: 650; border-radius: 999px; padding: 1px 8px; background: #fdecec; color: var(--danger); white-space: nowrap; }
.pnotes { margin: 8px 2px 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.pnotes li { margin: 2px 0; }
.psched { margin-top: 12px; }
.approx { color: var(--muted); }

/* ---------- Notes view ---------- */
.notes-wrap { max-width: 860px; margin: 0 auto; padding: 18px 24px 120px; }
.notes-wrap h2 { font-size: 20px; margin: 6px 0 14px; }
.ncard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.ncard .ntarget { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; flex-wrap: wrap; }
.ncard .ntarget .lbl { color: var(--muted); }
.ncard .ntarget a { font-weight: 600; }
.ncard .excerpt { font-size: 12.5px; color: var(--muted); margin: -4px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ncard .notes { max-width: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-l);
  transition: opacity .18s ease, transform .18s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--danger); }

/* ---------- Login ---------- */
body.login-page { overflow: auto; display: flex; align-items: center; justify-content: center; min-height: 100%; background: var(--bg); }
.login-card { width: min(380px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px 28px; box-shadow: var(--shadow-l); }
.login-card h1 { font-size: 20px; margin: 14px 0 4px; }
.login-card p { margin: 0 0 18px; font-size: 14px; }
.login-card input { width: 100%; padding: 10px 12px; font-size: 15px; margin-bottom: 12px; }
.login-err { color: var(--danger); font-size: 13.5px; min-height: 1.4em; margin: 10px 0 0; }

/* ---------- Responsive ---------- */
/* Wide screens: content always sits left of where the drawer opens, so opening it never moves anything. */
@media (min-width: 1321px) {
  .view.view-files { padding-right: var(--drawer-w); }
}
@media (max-width: 1180px) {
  .author { width: 104px; }
  .drawer { box-shadow: var(--shadow-l); }
}
@media (max-width: 900px) {
  :root { --topbar-h: 56px; --drawer-w: 100vw; }
  .topbar { height: var(--topbar-h); padding: 0 6px; gap: 2px; }
  .brand-name, .nl { display: none; }
  .brand { display: none; }
  .nav { flex: 1; justify-content: space-between; gap: 0; }
  .nav a { padding: 10px; }
  .nav a .ni { width: 21px; height: 21px; }
  .m-only { display: inline-flex; width: 38px; height: 38px; }
  .m-only .ni { width: 20px; height: 20px; }
  .search, .tools { display: none; }
  html.m-search .search { display: flex; position: absolute; left: 0; right: 0; top: var(--topbar-h); max-width: none; margin: 0; padding: 8px; background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  html.m-search .search .si { left: 18px; }
  html.m-search .sresults { left: 8px; right: 8px; min-width: 0; }
  html.m-menu .tools { display: flex; flex-direction: column; align-items: stretch; position: absolute; right: 6px; top: calc(var(--topbar-h) - 4px); background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; box-shadow: var(--shadow-l); }
  html.m-menu .author { width: 220px; }
  .day { top: calc(var(--topbar-h) + var(--tb-h, 44px)); }
  .toolbar { gap: 6px; }
  .rc, .inbox, .thread, .files-wrap, .notes-wrap, .pay { padding-left: 12px; padding-right: 12px; }
  .toolbar { padding: 8px 12px; }
  .legend-grid { grid-template-columns: 1fr; }
  .stack { max-width: 92%; }
  .irow { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .irow .who { grid-column: 2; }
  .irow .line { grid-column: 2 / 4; }
  .em-b { padding-left: 14px; }
  .frow { grid-template-columns: 30px minmax(0, 1fr); }
  .frow .flinks, .frow .factions { grid-column: 2; justify-content: flex-start; }
  .chats { grid-template-columns: 1fr; }
  .chats.has-chat .chat-list { display: none; }
  .chats:not(.has-chat) .chat-pane { display: none; }
  .chat-back { display: inline-flex; }
}
@media print {
  .topbar, .drawer, .toolbar, .note-btn, .ftr, .legend-head button { display: none !important; }
  body { overflow: visible; }
  .shell, .view { height: auto; overflow: visible; display: block; }
}

/* small helpers (no inline styles: CSP) */
.cmid { min-width: 0; }
.ptotals.second { margin-top: 10px; }
.pnotes.final { margin-top: 24px; }
.asof.src { margin-top: 8px; }
.legend-item .sw { background: var(--rc-miracle); }

.row, .em, .cb-wrap { scroll-margin-top: 110px; }

/* ---------- Full-screen raw-data modal ---------- */
html.modal-open { overflow: hidden; }
html.modal-open body { padding-right: var(--sbw, 0px); }
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(15, 18, 24, .55); display: flex; align-items: stretch; justify-content: center; padding: 2.5vh 2vw; }
.modal-card { flex: 1; max-width: 1500px; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-l); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.modal-head { display: flex; align-items: flex-start; gap: 16px; padding: 14px 18px 12px 22px; border-bottom: 1px solid var(--line); }
.mh-main { flex: 1; min-width: 0; }
.mh-line1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mh-who { font-size: 18px; font-weight: 700; }
.mh-role { font-size: 13px; color: var(--muted); }
.mh-when { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.mh-subject { font-size: 14.5px; font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.mh-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn.big { width: 38px; height: 38px; font-size: 18px; }
.badge { font-size: 11px; font-weight: 650; border-radius: 999px; padding: 1px 8px; background: #eef0f4; color: #475569; }
.badge.wa { background: var(--rc-wa); color: var(--wa); }
.badge.msgr { background: var(--rc-msgr); color: var(--msgr); }
.modal-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
.modal-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabs { display: flex; gap: 2px; padding: 8px 18px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 8px 14px; font-size: 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.modal-body { flex: 1; overflow: auto; padding: 14px 22px 40px; min-height: 0; display: flex; flex-direction: column; }
.tab-note { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.tab-note code { font-size: 12px; background: #f3f3f0; border-radius: 4px; padding: 0 4px; }
.tab-bar { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 10px; }
.tab-bar .tab-note { margin: 0; }
.mh3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 14px 0 6px; font-weight: 650; }
.raw-frame { flex: 1; width: 100%; min-height: 60vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
pre.rawpre { margin: 0; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; background: #fafaf8; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
pre.rawpre.wrap { font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #fff; }
pre.rawpre.small { padding: 6px 8px; font-size: 12px; }
.rawtext { font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.rawtext p { margin: 0 0 .7em; white-space: pre-wrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
table.htable { width: 100%; border-collapse: collapse; font-size: 13px; }
.htable th { text-align: left; vertical-align: top; width: 190px; padding: 5px 10px; color: var(--ink-2); font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; border-bottom: 1px solid #f0f0ee; overflow-wrap: anywhere; }
.htable td { padding: 5px 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; border-bottom: 1px solid #f0f0ee; white-space: pre-wrap; overflow-wrap: anywhere; }
.htable tr.pin th, .htable tr.pin td { background: #f5f8ff; }
.htable tr.pin:last-of-type td { border-bottom: 2px solid #d7e1fb; }
.modal-side { border-left: 1px solid var(--line); overflow-y: auto; padding: 4px 18px 40px; background: #fcfcfb; min-height: 0; }
.modal-side h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 20px 0 8px; font-weight: 650; }
.modal-side .actions.first { margin-top: 14px; }
.modal-side dl.meta-list { grid-template-columns: max-content 1fr; }
.modal-side .notes { max-width: none; }
.modal-side .att-row .nm { min-width: 0; flex-basis: 100%; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .modal { padding: 0; }
  .modal-card { border-radius: 0; }
  .modal-head { padding: 10px 10px 10px 14px; flex-wrap: wrap; }
  .mh-actions { width: 100%; justify-content: flex-start; }
  .mh-actions .icon-btn.big { margin-left: auto; }
  .modal-main { display: block; overflow-y: auto; }
  .modal-left, .modal-body { display: block; overflow: visible; }
  .modal-body { padding: 12px 14px 24px; }
  .raw-frame { height: 70vh; }
  .modal-side { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .htable th { width: 110px; }
}
@media print { .modal { display: none !important; } }

/* ---------- Timeline strip (Reading Copy) ---------- */
.tlstrip { position: sticky; top: var(--topbar-h); z-index: 6; background: #fbfbfa; border-bottom: 1px solid var(--line); padding: 4px 24px 0; }
.tl-top { display: flex; align-items: center; gap: 10px; height: 22px; font-size: 12px; color: var(--muted); }
.tl-top .grow { flex: 1; }
.tl-top .count { font-size: 12px; }
.tl-top .btn.small { padding: 1px 8px; font-size: 12px; }
.tl-reading b { color: var(--accent); font-weight: 650; }
.tl-key { display: inline-flex; gap: 10px; flex-wrap: nowrap; overflow: hidden; }
.tl-k { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tl-toggle { display: none; width: 30px; height: 22px; font-size: 14px; }
.tl-axis { position: relative; height: 46px; margin: 0 22px; }
.tl-vol { position: absolute; left: 0; top: 2px; width: 100%; height: 20px; fill: #dfe3ea; }
.tl-base { position: absolute; left: 0; right: 0; top: 22px; height: 1px; background: var(--line-2); }
.tl-tick { position: absolute; top: 22px; height: 5px; border-left: 1px solid var(--line-2); }
.tl-tick span { position: absolute; top: 6px; left: 0; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.tl-tick.yr { border-left-color: var(--ink-2); height: 7px; }
.tl-tick.yr span { color: var(--ink-2); font-weight: 650; }
.tl-here { position: absolute; left: 0; top: 0; width: 100%; height: 30px; pointer-events: none; transform: translateX(0); will-change: transform; }
.tl-here i { position: absolute; left: -1px; top: 0; width: 2px; height: 30px; background: var(--accent); border-radius: 1px; box-shadow: 0 0 0 2px rgba(47, 91, 234, .15); }
.tl-marks { position: absolute; inset: 0; pointer-events: none; }
.tl-m { position: absolute; pointer-events: auto; transform: translate(-50%, -50%); border: 2px solid #fff; padding: 0; border-radius: 50%; background: #64748b; color: #fff; font-size: 9px; font-weight: 700; line-height: 1; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.tl-m.ev { top: 22px; width: 13px; height: 13px; }
.tl-m.nt { top: 11px; width: 10px; height: 10px; border-radius: 2px; transform: translate(-50%, -50%) rotate(45deg); }
.tl-m.cl.ev { width: 18px; height: 18px; }
.tl-m.cl.nt { width: 15px; height: 15px; border-radius: 3px; }
.tl-m:hover, .tl-m:focus-visible { box-shadow: 0 0 0 3px rgba(47, 91, 234, .35); z-index: 2; outline: none; }
.k-agreement { background: #2f5bea !important; } .k-payment { background: #11803f !important; } .k-medical { background: #d63384 !important; }
.k-concern { background: #d9480f !important; } .k-legal { background: #6741d9 !important; } .k-mixed { background: #475569 !important; }
.tl-m.future, .tl-dot.future { background: #fff !important; border: 2px solid currentColor; }
.tl-m.future.k-agreement { color: #2f5bea; } .tl-m.future.k-payment { color: #11803f; } .tl-m.future.k-medical { color: #d63384; } .tl-m.future.k-concern { color: #d9480f; } .tl-m.future.k-legal { color: #6741d9; }
.tl-m.nmark, .tl-dot.nmark { background: #e8a317 !important; }
.tl-m.nt.cl { color: #3d2a00; }
.tl-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #64748b; flex: 0 0 auto; }
.tl-dot.nmark { border-radius: 1px; transform: rotate(45deg); width: 7px; height: 7px; }
.tl-dot.future { color: var(--muted); width: 9px; height: 9px; }
.tl-tip { position: absolute; left: 0; top: 40px; width: 320px; max-height: 60vh; overflow-y: auto; z-index: 8; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow-l); padding: 4px; }
.tl-ti { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 7px; padding: 6px 8px; font-size: 12.5px; color: var(--ink); }
button.tl-ti:hover, button.tl-ti:focus { background: var(--accent-soft); outline: none; }
.tl-td { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.tl-tt { display: block; font-weight: 650; margin-top: 2px; }
.tl-tx { display: block; color: var(--ink-2); margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-more { font-size: 11.5px; color: var(--muted); padding: 4px 8px; }
.row.flash .bubble, .row.flash .enote-box { animation: flash 1.8s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px var(--mark); } 100% { box-shadow: 0 0 0 0 rgba(255, 226, 138, 0); } }
@media (max-width: 900px) {
  .tlstrip { padding: 2px 10px 0; }
  .tl-key { display: none; }
  .tl-toggle { display: inline-flex; }
  .tlstrip.collapsed .tl-axis { display: none; }
  .tlstrip.collapsed { padding-bottom: 2px; }
  .tl-tick:not(.q) span { display: none; }
  .tl-tip { width: min(300px, calc(100vw - 24px)); }
}

/* ---------- Link safety & .eml warning ---------- */
.xl { overflow-wrap: anywhere; }
.xl-u { color: var(--ink-2); text-decoration: underline dotted; text-underline-offset: 2px; }
.row.mine .bubble .xl-u, .chat-body.msgr .cb-wrap.out .xl-u { color: #fff; }
.xl-b { display: inline-block; margin-left: 6px; border: 1px solid rgba(0,0,0,.15); background: rgba(255,255,255,.85); color: var(--ink-2); font-size: 11px; line-height: 1.4; padding: 0 6px; border-radius: 6px; vertical-align: 1px; white-space: nowrap; }
.xl-b:hover { background: #fff; color: var(--accent); border-color: var(--accent); }
.xl-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; padding: 8px 10px; border: 1px solid #f4c38b; background: #fff8ef; color: #7a4100; border-radius: 8px; font-size: 13px; }
.eml-note { display: block; width: 100%; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.em-actions .eml-note, .tab-bar .eml-note { width: auto; display: inline; margin: 0 4px; }
.eml-wrap { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cdlg { position: fixed; inset: 0; z-index: 60; background: rgba(15, 18, 24, .5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cdlg-card { width: min(480px, 100%); background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-l); padding: 20px 22px; }
.cdlg-card h3 { margin: 0 0 8px; font-size: 16px; }
.cdlg-card p { margin: 0 0 16px; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.cdlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
