@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --bg: #06080d;
  --surface: #0b0f18;
  --card: #0f1520;
  --raised: #141c2a;
  --raised2: #1a2438;
  --border: #1c2640;
  --border2: #243050;
  --accent: #4070ff;
  --accent-glow: rgba(64,112,255,.15);
  --a2: #6ea8fe;
  --a3: rgba(110,168,254,.08);
  --text: #e4eaf8;
  --muted: #46576e;
  --sub: #7a8ea8;
  --green: #2ed8a0;
  --green-g: rgba(46,216,160,.08);
  --red: #ff6b6b;
  --amber: #f5a623;
  --purple: #9d78f5;
  --purple-g: rgba(157,120,245,.1);
  --sidebar-w: 280px;
  --right-w: 360px;
  --topbar-h: 58px;
  --radius: 10px;
  --radius-lg: 14px;
}

html { height: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif;
  height: 100vh; overflow: hidden; display: flex; flex-direction: column;
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBARS ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── TOPBAR ──────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem;
  flex-shrink: 0; z-index: 50;
}
.topbar-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.logo-icon {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { width: 16px; height: 16px; fill: white; }
.logo-text { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.logo-text .sendy { color: var(--a2); }
.logo-text .voice { color: var(--text); }
.topbar-divider { width: 1px; height: 20px; background: var(--border); }
.topbar-spacer { flex: 1; }
.topbar-badge {
  display: flex; align-items: center; gap: .4rem; padding: .3rem .8rem;
  background: var(--raised); border: 1px solid var(--border2);
  border-radius: 20px; font-size: .72rem; color: var(--sub);
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: livepulse 2s ease-in-out infinite; }
@keyframes livepulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.8)} }
.topbar-btn {
  display: flex; align-items: center; gap: .4rem; padding: .4rem 1rem;
  background: var(--purple-g); border: 1px solid rgba(157,120,245,.22);
  border-radius: 8px; color: var(--purple); font-family: 'Inter', sans-serif;
  font-size: .75rem; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.topbar-btn:hover { background: rgba(157,120,245,.18); border-color: rgba(157,120,245,.4); }
#gmailStatusRow { display: flex; align-items: center; gap: .5rem; }

/* ── WORKSPACE ───────────────────────────────────────────────────────────── */
.workspace {
  flex: 1; display: grid; overflow: hidden;
  grid-template-columns: var(--sidebar-w) 1fr var(--right-w);
}

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-header {
  padding: 1rem 1rem .75rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.sidebar-title { font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sidebar-actions { display: flex; align-items: center; gap: .4rem; }
.sidebar-icon-btn {
  width: 26px; height: 26px; border-radius: 6px; background: transparent;
  border: 1px solid var(--border2); display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: var(--muted); transition: all .15s;
}
.sidebar-icon-btn:hover { color: var(--a2); border-color: rgba(110,168,254,.3); background: var(--a3); }
.inbox-list { flex: 1; overflow-y: auto; padding: .5rem .6rem; }
.msg-item {
  padding: .7rem .8rem; border-radius: var(--radius); cursor: pointer;
  transition: all .15s; border: 1px solid transparent; margin-bottom: 2px;
}
.msg-item:hover { background: var(--raised); border-color: var(--border2); }
.msg-item.selected { background: var(--accent-glow); border-color: rgba(64,112,255,.25); }
.msg-item.new-highlight { border-color: var(--amber); animation: newPulse 2.5s ease-out; }
@keyframes newPulse { 0%{background:rgba(245,166,35,.1)} 100%{background:transparent} }
.msg-top { display: flex; align-items: center; gap: .5rem; margin-bottom: .2rem; }
.msg-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--raised2);
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; font-weight: 600; color: var(--sub); flex-shrink: 0;
}
.msg-from { font-size: .78rem; font-weight: 500; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time { font-size: .6rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }
.msg-subject { font-size: .72rem; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: .15rem; }
.msg-preview { font-size: .68rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread .msg-from { color: var(--text); font-weight: 600; }
.unread .msg-subject { color: var(--a2); }
.unread-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.tab-badge {
  position: absolute; top: -4px; right: -4px; background: var(--red);
  color: white; font-size: .55rem; font-weight: 700; width: 15px; height: 15px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.sidebar-footer { padding: .75rem 1rem; border-top: 1px solid var(--border); flex-shrink: 0; display: flex; flex-direction: column; gap: .5rem; }
.view-all-btn {
  width: 100%; padding: .5rem; background: transparent;
  border: 1px solid var(--border2); border-radius: 8px;
  color: var(--sub); font-family: 'Inter', sans-serif;
  font-size: .72rem; cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
}
.view-all-btn:hover { border-color: var(--accent); color: var(--a2); background: var(--a3); }
.poll-row { display: flex; align-items: center; justify-content: space-between; }
.poll-label { font-size: .68rem; color: var(--muted); }
.poll-toggle {
  width: 34px; height: 18px; border-radius: 9px; background: var(--border2);
  border: none; cursor: pointer; position: relative; transition: background .2s; flex-shrink: 0;
}
.poll-toggle.on { background: var(--accent); }
.poll-toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%; background: white;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.poll-toggle.on::after { transform: translateX(16px); }

/* ── SKELETON ────────────────────────────────────────────────────────────── */
.skeleton-row {
  background: var(--raised); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; position: relative;
}
.skeleton-row::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.03) 50%, transparent 100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }

/* ── MAIN PANEL ──────────────────────────────────────────────────────────── */
.main-panel { display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.main-content {
  flex: 1; overflow-y: auto; padding: 1.5rem 1.75rem;
  display: flex; flex-direction: column; gap: 1.25rem;
}

/* ── SECTION CARDS ───────────────────────────────────────────────────────── */
.section-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: visible;
  transition: border-color .2s;
}
.section-card:focus-within { border-color: var(--border2); }
.section-head {
  padding: .85rem 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.section-head-title {
  font-size: .62rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.section-body { padding: 1.25rem; }
.resize-hint { font-size: .65rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }

/* ── EMAIL DETAIL ────────────────────────────────────────────────────────── */
.email-detail-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.email-detail-header {
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--surface), var(--card));
}
.email-detail-subject { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; line-height: 1.4; }
.email-detail-meta { font-size: .75rem; color: var(--muted); display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.email-detail-meta span { color: var(--sub); }
.meta-chip {
  padding: .15rem .55rem; background: var(--raised); border: 1px solid var(--border2);
  border-radius: 4px; font-size: .68rem; font-family: 'JetBrains Mono', monospace; color: var(--sub);
}
.email-detail-body {
  padding: 1.25rem 1.4rem; font-size: .88rem; line-height: 1.85;
  color: var(--sub); white-space: pre-wrap;
  max-height: 320px; overflow-y: auto;
  border-bottom: 1px solid var(--border);
}
.email-detail-images { padding: 1rem 1.4rem; }
.img-label { font-size: .6rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .6rem; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6rem; }
.email-img {
  width: 100%; height: 100px; object-fit: cover; border-radius: 8px;
  cursor: pointer; border: 1px solid var(--border2);
  transition: opacity .15s, transform .15s, border-color .15s;
}
.email-img:hover { opacity: .88; transform: scale(1.02); border-color: var(--accent); }
.reply-hint {
  margin: 0 1.4rem 1rem;
  padding: .65rem 1rem; background: var(--a3);
  border: 1px solid rgba(110,168,254,.18); border-radius: 9px;
  font-size: .75rem; color: var(--a2);
  display: flex; align-items: center; gap: .5rem;
  cursor: pointer; transition: all .15s;
}
.reply-hint:hover { background: rgba(110,168,254,.14); border-color: rgba(110,168,254,.35); }

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1.5rem; color: var(--muted);
  font-size: .82rem; line-height: 1.7;
}
.empty-icon { width: 36px; height: 36px; margin: 0 auto .75rem; opacity: .2; display: block; }
.loading-row { display: flex; align-items: center; gap: .5rem; padding: .75rem; color: var(--muted); font-size: .78rem; }

/* ── TEXTAREAS (all resizable) ───────────────────────────────────────────── */
textarea {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  line-height: 1.8;
  padding: .9rem 1.1rem;
  outline: none;
  resize: vertical;
  min-height: 120px;
  max-height: 700px;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  display: block;
}
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(64,112,255,.1);
}
textarea::placeholder { color: var(--muted); }
.tx-footer { display: flex; justify-content: space-between; align-items: center; margin-top: .6rem; }
.tx-meta { font-size: .68rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.expand-hint {
  font-size: .65rem; color: var(--muted); display: flex; align-items: center;
  gap: .3rem; cursor: default; user-select: none;
}

/* ── MIC ─────────────────────────────────────────────────────────────────── */
.mic-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.mic-btn {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1.5px solid var(--border2); background: var(--raised2);
  cursor: pointer; outline: none;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .2s;
}
.mic-btn svg { width: 22px; height: 22px; fill: var(--sub); transition: fill .2s; }
.mic-btn:hover { border-color: var(--accent); background: var(--a3); }
.mic-btn.rec { border-color: var(--red); background: rgba(255,107,107,.1); box-shadow: 0 0 0 6px rgba(255,107,107,.08); }
.mic-btn.rec svg { fill: var(--red); }
.mic-info { flex: 1; }
.mic-status { font-size: .82rem; color: var(--muted); transition: color .2s; }
.mic-status.on { color: var(--red); }
.bars { display: flex; align-items: center; gap: 3px; height: 20px; opacity: 0; transition: opacity .3s; margin-top: .3rem; }
.bars.show { opacity: 1; }
.bar { width: 3px; border-radius: 2px; background: var(--red); opacity: .8; }

/* ── RIGHT PANEL ─────────────────────────────────────────────────────────── */
.right-panel {
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.right-panel-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0;
}
.rpanel-tab {
  flex: 1; padding: .85rem .5rem; font-size: .72rem; font-weight: 500;
  color: var(--muted); cursor: pointer; transition: all .15s;
  border-bottom: 2px solid transparent; text-align: center;
}
.rpanel-tab.on { color: var(--a2); border-bottom-color: var(--accent); background: var(--a3); }
.rpanel-tab:hover:not(.on) { color: var(--text); }
.right-panel-content { flex: 1; overflow-y: auto; }
.rpanel-section { display: none; padding: 1.25rem; flex-direction: column; gap: .9rem; }
.rpanel-section.active { display: flex; }
.rpanel-label { font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ── TONE PILLS ──────────────────────────────────────────────────────────── */
.tone-pill {
  padding: .3rem .8rem; border-radius: 20px; font-size: .7rem; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border2); color: var(--muted);
  background: transparent; font-family: 'Inter', sans-serif; transition: all .15s;
}
.tone-pill.on { background: var(--purple-g); border-color: rgba(157,120,245,.4); color: var(--purple); }
.tone-pill:hover:not(.on) { color: var(--text); border-color: var(--border2); }

/* ── QUICK CHIPS ─────────────────────────────────────────────────────────── */
.quick-chip {
  padding: .25rem .65rem; border-radius: 20px; font-size: .68rem; font-weight: 400;
  cursor: pointer; border: 1px solid var(--border); color: var(--muted);
  background: transparent; font-family: 'Inter', sans-serif; transition: all .15s; white-space: nowrap;
}
.quick-chip:hover { background: var(--purple-g); border-color: rgba(157,120,245,.3); color: var(--purple); }

/* ── CUSTOM PROMPT ───────────────────────────────────────────────────────── */
.custom-prompt-input {
  width: 100%; background: var(--raised); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text); font-family: 'Inter', sans-serif;
  font-size: .82rem; padding: .65rem 3.5rem .65rem .9rem;
  outline: none; transition: border-color .2s; -webkit-appearance: none;
}
.custom-prompt-input:focus { border-color: rgba(157,120,245,.5); box-shadow: 0 0 0 3px var(--purple-g); }
.custom-prompt-input::placeholder { color: var(--muted); }

/* ── SUGGEST BTN ─────────────────────────────────────────────────────────── */
.suggest-btn {
  width: 100%; padding: .7rem; background: var(--purple-g);
  border: 1px solid rgba(157,120,245,.28); border-radius: var(--radius);
  color: var(--purple); font-family: 'Inter', sans-serif;
  font-size: .8rem; font-weight: 500; cursor: pointer;
  transition: all .2s; display: flex; align-items: center; justify-content: center; gap: .4rem;
}
.suggest-btn:hover { background: rgba(157,120,245,.18); border-color: rgba(157,120,245,.45); }
.suggest-btn:disabled { opacity: .4; cursor: default; }

/* ── SUGGESTION PILLS ────────────────────────────────────────────────────── */
.suggestion-pill {
  background: var(--raised); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: .8rem 1rem; cursor: pointer; transition: all .18s;
}
.suggestion-pill:hover { border-color: rgba(157,120,245,.35); background: var(--raised2); }
.suggestion-pill.selected { border-color: rgba(157,120,245,.5); background: var(--purple-g); }
.suggestion-label { font-size: .6rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--purple); margin-bottom: .3rem; }
.suggestion-text { font-size: .82rem; color: var(--text); line-height: 1.55; }

/* ── PILLS / CORRECTION ──────────────────────────────────────────────────── */
.pills { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill {
  padding: .3rem .8rem; border-radius: 20px; font-size: .7rem; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border2); color: var(--muted);
  background: transparent; transition: all .15s;
}
.pill.on { background: var(--a3); border-color: rgba(110,168,254,.35); color: var(--a2); }

/* ── AI / CORRECTION ─────────────────────────────────────────────────────── */
.ai-btn {
  width: 100%; padding: .7rem; background: var(--a3);
  border: 1px solid rgba(110,168,254,.25); border-radius: var(--radius);
  color: var(--a2); font-family: 'Inter', sans-serif;
  font-size: .8rem; font-weight: 500; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
}
.ai-btn:hover { background: rgba(110,168,254,.14); border-color: rgba(110,168,254,.4); }
.ai-btn:disabled { opacity: .4; cursor: default; }
.result-box {
  background: var(--raised); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: .85rem 1rem; min-height: 60px;
  font-size: .85rem; line-height: 1.75; color: var(--muted); font-style: italic;
}
.result-box.has { color: var(--text); font-style: normal; }
ins { background: rgba(46,216,160,.1); color: var(--green); text-decoration: none; border-radius: 3px; padding: 0 2px; }
.use-btn {
  width: 100%; padding: .55rem; background: transparent;
  border: 1px solid rgba(46,216,160,.22); border-radius: 8px;
  color: var(--green); font-family: 'Inter', sans-serif;
  font-size: .76rem; cursor: pointer; transition: all .2s; opacity: .4;
}
.use-btn:not(:disabled) { opacity: 1; }
.use-btn:not(:disabled):hover { background: var(--green-g); }
.use-btn:disabled { cursor: default; }

/* ── SEND BTN ────────────────────────────────────────────────────────────── */
.send-btn {
  width: 100%; display: flex; align-items: center; gap: .85rem;
  padding: .9rem 1.1rem; background: var(--raised);
  border: 1px solid var(--border2); border-radius: var(--radius);
  cursor: pointer; transition: all .18s;
}
.send-btn:hover { border-color: var(--accent); background: var(--raised2); }
.s-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gi { background: rgba(234,67,53,.1); border: 1px solid rgba(234,67,53,.18); }
.s-label { font-size: .8rem; font-weight: 500; color: var(--text); }
.s-sub { font-size: .66rem; color: var(--muted); margin-top: .1rem; }

/* ── SPINNER ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid rgba(110,168,254,.2); border-top-color: var(--a2);
  animation: spin .55s linear infinite; display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── OVERLAYS ────────────────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: var(--bg); z-index: 100;
  flex-direction: column; overflow: hidden;
}
.overlay-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1.5rem; border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0;
}
.overlay-title { font-size: .95rem; font-weight: 500; color: var(--text); flex: 1; }
.back-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--raised); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text); transition: all .15s;
}
.back-btn:hover { border-color: var(--accent); color: var(--a2); }
.overlay-refresh {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--raised); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--sub); transition: all .15s;
}
.overlay-refresh:hover { color: var(--a2); border-color: rgba(110,168,254,.3); }
.overlay-search {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0;
  background: var(--surface);
}
.overlay-search svg { color: var(--muted); flex-shrink: 0; }
.overlay-search input {
  flex: 1; background: none; border: none; outline: none;
  font-family: 'Inter', sans-serif; font-size: .88rem; color: var(--text);
}
.overlay-search input::placeholder { color: var(--muted); }
.overlay-filter {
  display: flex; gap: .4rem; padding: .65rem 1.5rem;
  border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--surface);
}
.filter-pill {
  padding: .3rem .85rem; border-radius: 20px; font-size: .72rem; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border2); color: var(--muted);
  background: transparent; font-family: 'Inter', sans-serif; transition: all .15s;
}
.filter-pill.on { background: var(--a3); border-color: rgba(110,168,254,.35); color: var(--a2); }
.full-inbox-list { flex: 1; overflow-y: auto; padding: .75rem 1.5rem; display: flex; flex-direction: column; gap: .4rem; }
.load-more-btn {
  padding: .55rem 1.6rem; background: var(--raised); border: 1px solid var(--border2);
  border-radius: 8px; color: var(--sub); font-family: 'Inter', sans-serif;
  font-size: .78rem; cursor: pointer; transition: all .18s;
}
.load-more-btn:hover { border-color: var(--accent); color: var(--a2); }

/* ── IMAGE VIEWER ────────────────────────────────────────────────────────── */
.img-viewer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.9);
  z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.img-viewer-inner {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); overflow: hidden;
  max-width: min(1000px, 95vw); max-height: 90vh;
  display: flex; flex-direction: column;
}
.img-viewer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.img-viewer-name { font-size: .82rem; color: var(--sub); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-viewer-close {
  width: 30px; height: 30px; border-radius: 7px; background: var(--raised);
  border: 1px solid var(--border2); display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: var(--text); flex-shrink: 0; transition: all .15s;
}
.img-viewer-close:hover { border-color: var(--red); color: var(--red); }
.img-viewer-img { max-width: 100%; max-height: 78vh; object-fit: contain; display: block; }

/* ── LEGAL RESEARCH ──────────────────────────────────────────────────────── */
.legal-source-pill {
  padding: .3rem .85rem; border-radius: 20px; font-size: .72rem; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border2); color: var(--muted);
  background: transparent; font-family: 'Inter', sans-serif; transition: all .15s;
}
.legal-source-pill.on { background: var(--purple-g); border-color: rgba(157,120,245,.35); color: var(--purple); }
.legal-search-row { display: flex; gap: .6rem; padding: .85rem 1.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--surface); }
.legal-search-wrap {
  flex: 1; display: flex; align-items: center; gap: .6rem;
  background: var(--raised); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 0 1rem; transition: border-color .2s;
}
.legal-search-wrap:focus-within { border-color: rgba(157,120,245,.5); box-shadow: 0 0 0 3px var(--purple-g); }
.legal-search-input { flex: 1; background: none; border: none; outline: none; font-family: 'Inter', sans-serif; font-size: .88rem; color: var(--text); padding: .7rem 0; }
.legal-search-input::placeholder { color: var(--muted); }
.legal-search-btn {
  padding: .65rem 1.4rem; background: var(--purple-g);
  border: 1px solid rgba(157,120,245,.3); border-radius: var(--radius);
  color: var(--purple); font-family: 'Inter', sans-serif;
  font-size: .82rem; font-weight: 500; cursor: pointer; transition: all .18s; white-space: nowrap;
}
.legal-search-btn:hover:not(:disabled) { background: rgba(157,120,245,.2); border-color: rgba(157,120,245,.5); }
.legal-search-btn:disabled { opacity: .4; cursor: default; }
.legal-chip {
  padding: .28rem .7rem; border-radius: 20px; font-size: .68rem;
  cursor: pointer; border: 1px solid var(--border); color: var(--muted);
  background: transparent; font-family: 'Inter', sans-serif; transition: all .15s; white-space: nowrap;
}
.legal-chip:hover { background: var(--purple-g); border-color: rgba(157,120,245,.3); color: var(--purple); }
.legal-results { flex: 1; overflow-y: auto; }
.legal-results-inner { padding: 1.5rem 2rem; display: flex; flex-direction: column; gap: 1rem; max-width: 940px; margin: 0 auto; width: 100%; }
.legal-empty { text-align: center; padding: 5rem 2rem; color: var(--muted); font-size: .85rem; line-height: 1.8; display: flex; flex-direction: column; align-items: center; }
.legal-query-badge { display: inline-block; padding: .3rem 1rem; background: var(--purple-g); border: 1px solid rgba(157,120,245,.2); border-radius: 20px; font-size: .72rem; color: var(--purple); }
.legal-summary { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--purple); border-radius: 0 var(--radius) var(--radius) 0; padding: 1rem 1.25rem; font-size: .9rem; line-height: 1.85; color: var(--text); }
.legal-section-label { font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: .25rem; }
.legal-case-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; transition: border-color .15s; }
.legal-case-card:hover { border-color: var(--border2); }
.legal-case-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.legal-case-name { font-size: .88rem; font-weight: 500; color: var(--a2); line-height: 1.4; flex: 1; }
.legal-case-court { font-size: .65rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; font-family: 'JetBrains Mono', monospace; padding: .2rem .5rem; background: var(--raised); border-radius: 4px; }
.legal-case-principle { font-size: .84rem; color: var(--text); line-height: 1.7; }
.legal-case-relevance { font-size: .78rem; color: var(--sub); line-height: 1.6; }
.legal-citation { font-size: .68rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; padding: .3rem .65rem; background: var(--raised); border-radius: 5px; display: inline-block; border: 1px solid var(--border); }
.legal-save-btn { align-self: flex-start; padding: .3rem .75rem; background: transparent; border: 1px solid var(--border2); border-radius: 6px; color: var(--muted); font-family: 'Inter', sans-serif; font-size: .68rem; cursor: pointer; display: flex; align-items: center; gap: .35rem; transition: all .15s; }
.legal-save-btn:hover { border-color: rgba(157,120,245,.4); color: var(--purple); background: var(--purple-g); }
.legal-legis-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem; }
.legal-legis-name { font-size: .84rem; font-weight: 500; color: var(--green); margin-bottom: .25rem; }
.legal-legis-section { font-size: .68rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-bottom: .35rem; }
.legal-legis-effect { font-size: .8rem; color: var(--sub); line-height: 1.65; }
.legal-principles-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; }
.legal-principle-item { display: flex; align-items: flex-start; gap: .65rem; font-size: .84rem; color: var(--sub); line-height: 1.65; }
.legal-practice-note { background: rgba(245,166,35,.05); border: 1px solid rgba(245,166,35,.15); border-radius: var(--radius); padding: .9rem 1.1rem; font-size: .84rem; color: var(--sub); line-height: 1.75; display: flex; gap: .65rem; }
.legal-disclaimer { font-size: .68rem; color: var(--muted); text-align: center; padding: .65rem; border-top: 1px solid var(--border); line-height: 1.6; }
.legal-notes-bar { border-top: 1px solid var(--border); padding: .85rem 1.5rem; flex-shrink: 0; background: var(--surface); }
.saved-note-item { display: flex; align-items: center; gap: .65rem; background: var(--raised); border: 1px solid var(--border2); border-radius: 8px; padding: .55rem .8rem; }
.send-to-client-btn { display: flex; align-items: center; gap: .4rem; padding: .4rem 1rem; background: var(--green-g); border: 1px solid rgba(46,216,160,.22); border-radius: 20px; color: var(--green); font-family: 'Inter', sans-serif; font-size: .73rem; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap; }
.send-to-client-btn:hover { background: rgba(46,216,160,.15); border-color: rgba(46,216,160,.4); }

/* ── CLIENT PANEL ────────────────────────────────────────────────────────── */
.client-panel { position: absolute; inset: 0; background: var(--bg); flex-direction: column; z-index: 10; overflow-y: auto; }
.client-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); flex-shrink: 0; position: sticky; top: 0; background: var(--card); z-index: 1; }
.client-panel-title { font-size: .95rem; font-weight: 500; color: var(--text); }
.client-panel-body { padding: 1.5rem 2rem; display: flex; flex-direction: column; gap: 1.1rem; max-width: 800px; margin: 0 auto; width: 100%; }
.client-field-group { display: flex; flex-direction: column; gap: .45rem; }
.client-label { font-size: .62rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.client-input { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); font-family: 'Inter', sans-serif; font-size: .9rem; padding: .75rem 1rem; outline: none; transition: border-color .2s, box-shadow .2s; }
.client-input:focus { border-color: rgba(157,120,245,.5); box-shadow: 0 0 0 3px var(--purple-g); }
.client-input::placeholder { color: var(--muted); }
.client-select { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); font-family: 'Inter', sans-serif; font-size: .9rem; padding: .75rem 1rem; outline: none; cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2346576e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.client-textarea { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); font-family: 'Inter', sans-serif; font-size: .88rem; line-height: 1.7; padding: .8rem 1rem; outline: none; resize: vertical; transition: border-color .2s; min-height: 90px; width: 100%; }
.client-textarea:focus { border-color: rgba(157,120,245,.5); box-shadow: 0 0 0 3px var(--purple-g); }
.client-textarea::placeholder { color: var(--muted); }
.client-draft-textarea { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); font-family: 'Inter', sans-serif; font-size: .9rem; line-height: 1.85; padding: 1rem; outline: none; resize: vertical; width: 100%; transition: border-color .2s; min-height: 280px; max-height: 700px; }
.client-draft-textarea:focus { border-color: rgba(46,216,160,.4); box-shadow: 0 0 0 3px var(--green-g); }
.client-action-btn { flex: 1; padding: .72rem; border-radius: var(--radius); font-family: 'Inter', sans-serif; font-size: .82rem; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .5rem; transition: all .18s; }
.client-action-btn.gmail { background: rgba(234,67,53,.08); border: 1px solid rgba(234,67,53,.2); color: #ff8a80; }
.client-action-btn.gmail:hover { background: rgba(234,67,53,.14); border-color: rgba(234,67,53,.35); }
.client-action-btn.copy { background: var(--raised); border: 1px solid var(--border2); color: var(--sub); }
.client-action-btn.copy:hover { border-color: var(--accent); color: var(--a2); }
.case-checkbox-row { display: flex; align-items: flex-start; gap: .8rem; background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); padding: .85rem 1rem; cursor: pointer; transition: all .15s; }
.case-checkbox-row:hover { border-color: rgba(157,120,245,.35); background: var(--raised2); }
.case-checkbox-row.dimmed { opacity: .35; }
.case-checkbox { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; accent-color: var(--purple); cursor: pointer; }
.case-checkbox-content { flex: 1; min-width: 0; }
.case-checkbox-name { font-size: .82rem; font-weight: 500; color: var(--a2); line-height: 1.4; margin-bottom: .25rem; }
.case-checkbox-principle { font-size: .75rem; color: var(--sub); line-height: 1.6; }

/* ── TOPBAR LEGAL BTN ─────────────────────────────────────────────────────── */
.legal-launch-btn { display: flex; align-items: center; gap: .4rem; padding: .4rem 1rem; background: var(--purple-g); border: 1px solid rgba(157,120,245,.22); border-radius: 8px; color: var(--purple); font-family: 'Inter', sans-serif; font-size: .75rem; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap; }
.legal-launch-btn:hover { background: rgba(157,120,245,.18); border-color: rgba(157,120,245,.4); }

/* ── FETCH BTN ───────────────────────────────────────────────────────────── */
.fetch-btn { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; background: transparent; border: 1px solid var(--border2); border-radius: 8px; color: var(--sub); font-family: 'Inter', sans-serif; font-size: .75rem; cursor: pointer; transition: all .15s; }
.fetch-btn:hover { border-color: var(--accent); color: var(--a2); }
.fetch-btn:disabled { opacity: .4; cursor: default; }

/* ── TOAST ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--raised2); border: 1px solid var(--border2);
  border-radius: 10px; padding: .6rem 1.25rem;
  font-size: .78rem; color: var(--sub);
  opacity: 0; transition: all .25s; pointer-events: none;
  white-space: nowrap; z-index: 999;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── MISC ────────────────────────────────────────────────────────────────── */
.img-placeholder { border-radius: 8px; overflow: hidden; }
.loading-body { opacity: .5; }
.view-inbox-btn { width: 100%; margin-top: .6rem; padding: .55rem; background: transparent; border: 1px solid var(--border2); border-radius: 8px; color: var(--sub); font-family: 'Inter', sans-serif; font-size: .72rem; cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; gap: .4rem; }
.view-inbox-btn:hover { border-color: var(--accent); color: var(--a2); background: var(--a3); }

/* ── FULL INBOX WORKSPACE ────────────────────────────────────────────────── */
.fi-topbar {
  height: var(--topbar-h); background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 1.5rem; gap: .75rem; flex-shrink: 0;
}
.fi-title { font-size: .95rem; font-weight: 600; color: var(--text); }

.fi-workspace {
  flex: 1; display: grid; overflow: hidden;
  grid-template-columns: 320px 1fr var(--right-w);
}

.fi-sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.fi-search-area { border-bottom: 1px solid var(--border); flex-shrink: 0; padding: .65rem .75rem .35rem; display: flex; flex-direction: column; gap: .4rem; }
.fi-search-row {
  display: flex; align-items: center; gap: .45rem;
  background: var(--raised); border: 1px solid var(--border2);
  border-radius: 8px; padding: 0 .75rem;
  transition: border-color .2s;
}
.fi-search-row:focus-within { border-color: var(--accent); }
.fi-search-input {
  flex: 1; background: none; border: none; outline: none;
  font-family: 'Inter', sans-serif; font-size: .8rem; color: var(--text); padding: .55rem 0;
}
.fi-search-input::placeholder { color: var(--muted); }
.fi-clear-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .7rem; padding: 0; line-height: 1; flex-shrink: 0; }
.fi-clear-btn:hover { color: var(--text); }

.fi-email-list { flex: 1; overflow-y: auto; padding: .4rem .5rem; }
.fi-email-list::-webkit-scrollbar { width: 4px; }
.fi-email-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.fi-main { display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.fi-main-content { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; }
.fi-main-content::-webkit-scrollbar { width: 5px; }
.fi-main-content::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

.fi-empty-detail {
  text-align: center; padding: 3rem 2rem; color: var(--muted);
  font-size: .85rem; line-height: 1.75;
  display: flex; flex-direction: column; align-items: center;
}

/* ── ANALYSE BUTTON ──────────────────────────────────────────────────────── */
.analyse-btn {
  display: flex; align-items: center; gap: .4rem;
  padding: .4rem .9rem; background: rgba(96,165,250,.08);
  border: 1px solid rgba(96,165,250,.22); border-radius: 8px;
  color: var(--a2); font-family: 'Inter', sans-serif;
  font-size: .73rem; font-weight: 500; cursor: pointer;
  transition: all .15s; white-space: nowrap; flex-shrink: 0;
}
.analyse-btn:hover { background: rgba(96,165,250,.16); border-color: rgba(96,165,250,.4); }
.analyse-btn:disabled { opacity: .5; cursor: default; }

/* ── ANALYSIS CARD ───────────────────────────────────────────────────────── */
.analysis-card {
  background: var(--card); border: 1px solid var(--border);
  border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 1.25rem 1.4rem; display: flex; flex-direction: column; gap: .9rem;
  animation: fadeSlideIn .2s ease-out;
}
@keyframes fadeSlideIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }

.analysis-header {
  display: flex; align-items: center; gap: .5rem;
  font-size: .72rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  padding-bottom: .75rem; border-bottom: 1px solid var(--border);
}
.analysis-badge {
  padding: .25rem .7rem; border-radius: 20px;
  font-size: .68rem; font-weight: 600; border: 1px solid;
  letter-spacing: .04em;
}
.analysis-section { display: flex; flex-direction: column; gap: .35rem; }
.analysis-section-label {
  font-size: .6rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.analysis-plain {
  background: linear-gradient(135deg, rgba(64,112,255,.06), rgba(157,120,245,.06));
  border: 1px solid rgba(64,112,255,.18);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .85rem 1rem; font-size: .88rem; line-height: 1.8;
  color: var(--text); font-weight: 400;
}
.analysis-text { font-size: .82rem; color: var(--sub); line-height: 1.7; }
.analysis-list {
  list-style: none; display: flex; flex-direction: column; gap: .35rem;
}
.analysis-list li {
  font-size: .8rem; color: var(--sub); line-height: 1.6;
  padding-left: 1rem; position: relative;
}
.analysis-list li::before {
  content: '·'; position: absolute; left: 0;
  color: var(--accent); font-weight: 700;
}
.analysis-list.action li {
  padding-left: 0; display: flex; align-items: flex-start; gap: .5rem;
}
.analysis-list.action li::before { display: none; }
.analysis-meta-block {
  background: var(--raised); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: .85rem 1rem;
  display: flex; flex-direction: column; gap: .3rem;
}
.analysis-tone-badge {
  display: inline-block; padding: .25rem .7rem;
  background: rgba(157,120,245,.1); border: 1px solid rgba(157,120,245,.25);
  border-radius: 20px; font-size: .75rem; font-weight: 500; color: var(--purple);
  width: fit-content;
}
.analysis-deadline {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--amber); font-weight: 500;
}

/* ── PDF BRIEF ANALYSER ──────────────────────────────────────────────────── */
.pdf-launch-btn { display: flex; align-items: center; gap: .4rem; padding: .4rem 1rem; background: rgba(46,216,160,.08); border: 1px solid rgba(46,216,160,.22); border-radius: 8px; color: var(--green); font-family: 'Inter', sans-serif; font-size: .75rem; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap; }
.pdf-launch-btn:hover { background: rgba(46,216,160,.15); border-color: rgba(46,216,160,.4); }

.pdf-workspace { flex: 1; display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }

.pdf-sidebar { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.pdf-sidebar-inner { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.pdf-sidebar::-webkit-scrollbar { width: 4px; }
.pdf-sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.pdf-drop-zone { border: 2px dashed var(--border2); border-radius: var(--radius-lg); padding: 1.75rem 1rem; display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; transition: all .2s; }
.pdf-drop-zone:hover { border-color: var(--green); background: rgba(46,216,160,.04); }
.pdf-drop-zone.dragging { border-color: var(--green); background: rgba(46,216,160,.08); }
.pdf-drop-text { font-size: .85rem; font-weight: 500; color: var(--text); margin-bottom: .3rem; }
.pdf-drop-hint { font-size: .72rem; color: var(--muted); }

.pdf-file-info { display: flex; align-items: center; gap: .75rem; background: rgba(46,216,160,.06); border: 1px solid rgba(46,216,160,.2); border-radius: var(--radius); padding: .75rem 1rem; }
.pdf-file-icon { width: 34px; height: 34px; background: rgba(46,216,160,.12); border: 1px solid rgba(46,216,160,.2); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--green); flex-shrink: 0; }
.pdf-file-name { font-size: .8rem; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-file-size { font-size: .68rem; color: var(--green); margin-top: .1rem; }

.pdf-control-group { display: flex; flex-direction: column; gap: .5rem; }
.pdf-control-label { font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pdf-radio-row { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--sub); cursor: pointer; padding: .2rem 0; }
.pdf-radio-row input { accent-color: var(--green); cursor: pointer; }
.pdf-radio-row:hover { color: var(--text); }
.pdf-check-row { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--sub); cursor: pointer; padding: .15rem 0; }
.pdf-check-row input { accent-color: var(--accent); cursor: pointer; }
.pdf-check-row:hover { color: var(--text); }
.pdf-instructions-input { width: 100%; background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); color: var(--text); font-family: 'Inter', sans-serif; font-size: .82rem; line-height: 1.65; padding: .7rem .9rem; outline: none; resize: vertical; min-height: 70px; transition: border-color .2s; }
.pdf-instructions-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46,216,160,.08); }
.pdf-instructions-input::placeholder { color: var(--muted); }
.pdf-analyse-btn { width: 100%; padding: .75rem; background: rgba(46,216,160,.1); border: 1px solid rgba(46,216,160,.28); border-radius: var(--radius); color: var(--green); font-family: 'Inter', sans-serif; font-size: .85rem; font-weight: 500; cursor: pointer; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: .45rem; }
.pdf-analyse-btn:hover:not(:disabled) { background: rgba(46,216,160,.18); border-color: rgba(46,216,160,.45); }
.pdf-analyse-btn:disabled { opacity: .4; cursor: default; }

.pdf-results-panel { overflow-y: auto; background: var(--bg); }
.pdf-results-panel::-webkit-scrollbar { width: 6px; }
.pdf-results-panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

.pdf-empty { text-align: center; padding: 5rem 2rem; color: var(--muted); font-size: .85rem; line-height: 1.8; display: flex; flex-direction: column; align-items: center; }

.pdf-analysis-loading { padding: 2rem; }
.pdf-loading-header { display: flex; align-items: center; gap: .75rem; font-size: .85rem; color: var(--sub); margin-bottom: 1rem; }

.pdf-error { display: flex; align-items: flex-start; gap: .75rem; padding: 1.5rem; color: var(--red); font-size: .85rem; }

.pdf-analysis-inner { padding: 1.5rem 2rem; display: flex; flex-direction: column; gap: 1.1rem; max-width: 920px; }

.pdf-analysis-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.pdf-doc-type { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: .2rem; }
.pdf-file-ref { font-size: .72rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.pdf-copy-btn { display: flex; align-items: center; gap: .4rem; padding: .4rem .9rem; background: var(--raised); border: 1px solid var(--border2); border-radius: 8px; color: var(--sub); font-family: 'Inter', sans-serif; font-size: .72rem; cursor: pointer; transition: all .15s; white-space: nowrap; flex-shrink: 0; }
.pdf-copy-btn:hover { border-color: var(--accent); color: var(--a2); }

.pdf-executive-summary { background: linear-gradient(135deg, rgba(46,216,160,.06), rgba(64,112,255,.06)); border: 1px solid rgba(46,216,160,.18); border-left: 3px solid var(--green); border-radius: 0 var(--radius) var(--radius) 0; padding: 1rem 1.25rem; font-size: .92rem; line-height: 1.85; color: var(--text); }

.pdf-urgent-banner { background: rgba(255,107,107,.06); border: 1px solid rgba(255,107,107,.22); border-radius: var(--radius); padding: .9rem 1.1rem; display: flex; align-items: flex-start; gap: .75rem; color: var(--red); }

.pdf-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.pdf-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pdf-section-header { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); font-size: .65rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pdf-section-body { padding: .9rem 1rem; }

.pdf-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.pdf-list li { font-size: .82rem; color: var(--sub); line-height: 1.65; padding-left: 1.1rem; position: relative; }
.pdf-list li::before { content: '·'; position: absolute; left: 0; color: var(--bullet-color, var(--accent)); font-weight: 700; font-size: 1rem; line-height: 1.2; }

.pdf-party-row { display: flex; align-items: flex-start; gap: .65rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.pdf-party-row:last-child { border-bottom: none; }
.pdf-party-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--raised2); display: flex; align-items: center; justify-content: center; font-size: .6rem; font-weight: 600; color: var(--sub); flex-shrink: 0; margin-top: 1px; }
.pdf-party-name { font-size: .82rem; font-weight: 500; color: var(--text); }
.pdf-party-role { font-size: .72rem; color: var(--muted); line-height: 1.5; }

.pdf-chrono { display: flex; flex-direction: column; gap: 0; }
.pdf-chrono-row { display: grid; grid-template-columns: 110px 1fr; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.pdf-chrono-row:last-child { border-bottom: none; }
.pdf-chrono-date { font-size: .7rem; color: var(--purple); font-family: 'JetBrains Mono', monospace; font-weight: 500; padding-top: 2px; }
.pdf-chrono-event { font-size: .82rem; color: var(--sub); line-height: 1.6; }

.pdf-issue-card { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: .5rem; }
.pdf-issue-card:last-child { margin-bottom: 0; }
.pdf-issue-title { font-size: .85rem; font-weight: 500; color: var(--a2); margin-bottom: .3rem; }
.pdf-issue-text { font-size: .8rem; color: var(--sub); line-height: 1.65; }
.pdf-issue-position { font-size: .75rem; color: var(--muted); margin-top: .35rem; padding-top: .35rem; border-top: 1px solid var(--border); font-style: italic; }

.pdf-evidence-row { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); padding: .75rem .9rem; margin-bottom: .4rem; }
.pdf-evidence-row:last-child { margin-bottom: 0; }
.pdf-evidence-item { font-size: .82rem; color: var(--text); font-weight: 500; }
.pdf-evidence-notes { font-size: .75rem; color: var(--muted); margin-top: .35rem; line-height: 1.5; }
.pdf-badge { padding: .2rem .55rem; border-radius: 20px; font-size: .65rem; font-weight: 600; border: 1px solid; }

.pdf-strategy { font-size: .85rem; color: var(--sub); line-height: 1.85; white-space: pre-wrap; }
.pdf-steps { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .45rem; }
.pdf-steps li { font-size: .82rem; color: var(--sub); line-height: 1.65; }
.pdf-disclaimer { font-size: .68rem; color: var(--muted); text-align: center; padding: .65rem; border-top: 1px solid var(--border); line-height: 1.6; }

/* ── FEE ESTIMATOR ───────────────────────────────────────────────────────── */
.fee-launch-btn { display: flex; align-items: center; gap: .4rem; padding: .4rem 1rem; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.22); border-radius: 8px; color: var(--amber); font-family: 'Inter', sans-serif; font-size: .75rem; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap; }
.fee-launch-btn:hover { background: rgba(251,191,36,.15); border-color: rgba(251,191,36,.4); }

.fee-workspace { flex: 1; display: grid; grid-template-columns: 340px 1fr; overflow: hidden; }

.fee-sidebar { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.fee-sidebar::-webkit-scrollbar { width: 4px; }
.fee-sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.fee-sidebar-inner { padding: 1.25rem; display: flex; flex-direction: column; gap: .9rem; }

.fee-section-group { display: flex; flex-direction: column; gap: .55rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; }
.fee-group-label { font-size: .6rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .1rem; }
.fee-field { display: flex; flex-direction: column; gap: .3rem; }
.fee-label { font-size: .72rem; color: var(--sub); }
.fee-input { background: var(--raised); border: 1px solid var(--border2); border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif; font-size: .85rem; padding: .6rem .9rem; outline: none; transition: border-color .2s; width: 100%; -webkit-appearance: none; }
.fee-input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(251,191,36,.08); }
.fee-input::placeholder { color: var(--muted); }
.fee-select { background: var(--raised); border: 1px solid var(--border2); border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif; font-size: .85rem; padding: .6rem .9rem; outline: none; cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2346576e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.2rem; transition: border-color .2s; }
.fee-select:focus { border-color: var(--amber); }
.fee-textarea { background: var(--raised); border: 1px solid var(--border2); border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif; font-size: .83rem; line-height: 1.65; padding: .65rem .9rem; outline: none; resize: vertical; min-height: 70px; width: 100%; transition: border-color .2s; }
.fee-textarea:focus { border-color: var(--amber); }
.fee-textarea::placeholder { color: var(--muted); }
.fee-generate-btn { width: 100%; padding: .78rem; background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.28); border-radius: var(--radius); color: var(--amber); font-family: 'Inter', sans-serif; font-size: .88rem; font-weight: 500; cursor: pointer; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: .45rem; }
.fee-generate-btn:hover:not(:disabled) { background: rgba(251,191,36,.18); border-color: rgba(251,191,36,.45); }
.fee-generate-btn:disabled { opacity: .4; cursor: default; }

.fee-preview-panel { overflow-y: auto; background: var(--bg); }
.fee-preview-panel::-webkit-scrollbar { width: 6px; }
.fee-preview-panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.fee-empty { text-align: center; padding: 5rem 2rem; color: var(--muted); font-size: .85rem; line-height: 1.8; display: flex; flex-direction: column; align-items: center; }

.fee-result-inner { padding: 1.5rem 2rem; display: flex; flex-direction: column; gap: 1.1rem; max-width: 860px; }

.fee-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.fee-summary-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; }
.fee-summary-card.total { border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.05); }
.fee-summary-label { font-size: .62rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.fee-summary-amount { font-size: 1.75rem; font-weight: 600; color: var(--text); letter-spacing: -.02em; line-height: 1.1; }
.fee-summary-card.total .fee-summary-amount { color: var(--amber); }
.fee-summary-note { font-size: .7rem; color: var(--muted); margin-top: .1rem; }

.fee-breakdown-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fee-breakdown-title { font-size: .62rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: .75rem 1.1rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.fee-breakdown-table { width: 100%; border-collapse: collapse; }
.fee-breakdown-table td { padding: .6rem 1.1rem; font-size: .82rem; border-bottom: 1px solid var(--border); }
.fee-breakdown-item { color: var(--sub); }
.fee-breakdown-amt { text-align: right; color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: .8rem; }
.fee-subtotal-row td { border-top: 1px solid var(--border2); color: var(--sub); font-style: italic; }
.fee-total-row td { font-weight: 600; color: var(--amber); font-size: .9rem; border-top: 2px solid rgba(251,191,36,.25); padding: .8rem 1.1rem; }
.fee-total-row td:last-child { font-family: 'JetBrains Mono', monospace; }

.fee-letter-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fee-letter-header { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1.1rem; background: var(--surface); border-bottom: 1px solid var(--border); gap: 1rem; }
.fee-letter-title { font-size: .62rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.fee-letter-textarea { width: 100%; background: transparent; border: none; color: var(--sub); font-family: 'Inter', sans-serif; font-size: .88rem; line-height: 1.85; padding: 1.25rem 1.4rem; outline: none; resize: vertical; min-height: 420px; max-height: 800px; }
.fee-letter-textarea:focus { background: rgba(255,255,255,.01); }
.fee-action-btn { display: flex; align-items: center; gap: .4rem; padding: .38rem .85rem; border-radius: 7px; font-family: 'Inter', sans-serif; font-size: .72rem; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap; }
.fee-action-btn.copy { background: var(--raised); border: 1px solid var(--border2); color: var(--sub); }
.fee-action-btn.copy:hover { border-color: var(--accent); color: var(--a2); }
.fee-action-btn.email { background: rgba(234,67,53,.08); border: 1px solid rgba(234,67,53,.2); color: #ff8a80; }
.fee-action-btn.email:hover { background: rgba(234,67,53,.14); }

/* ── FEE ESTIMATOR ───────────────────────────────────────────────────────── */
.fee-launch-btn { display: flex; align-items: center; gap: .4rem; padding: .4rem 1rem; background: rgba(245,166,35,.08); border: 1px solid rgba(245,166,35,.22); border-radius: 8px; color: var(--amber); font-family: 'Inter', sans-serif; font-size: .75rem; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap; }
.fee-launch-btn:hover { background: rgba(245,166,35,.15); border-color: rgba(245,166,35,.4); }

.fee-workspace { flex: 1; display: grid; grid-template-columns: 340px 1fr; overflow: hidden; }

.fee-sidebar { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.fee-sidebar::-webkit-scrollbar { width: 4px; }
.fee-sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.fee-sidebar-inner { padding: 1.25rem; display: flex; flex-direction: column; gap: .9rem; }

.fee-section-group { display: flex; flex-direction: column; gap: .6rem; padding: .9rem 1rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.fee-group-label { font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-bottom: .35rem; border-bottom: 1px solid var(--border); }
.fee-field { display: flex; flex-direction: column; gap: .3rem; }
.fee-label { font-size: .72rem; color: var(--sub); }
.fee-input { background: var(--raised); border: 1px solid var(--border2); border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif; font-size: .85rem; padding: .6rem .85rem; outline: none; transition: border-color .2s; width: 100%; }
.fee-input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(245,166,35,.08); }
.fee-input.fee-money { padding-left: 1.6rem; }
.fee-currency { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .82rem; pointer-events: none; }
.fee-select { background: var(--raised); border: 1px solid var(--border2); border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif; font-size: .82rem; padding: .6rem .85rem; outline: none; cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2346576e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; padding-right: 2.2rem; width: 100%; }
.fee-items-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }
.fee-check-row { display: flex; align-items: center; gap: .45rem; font-size: .76rem; color: var(--sub); cursor: pointer; padding: .15rem 0; }
.fee-check-row input { accent-color: var(--amber); cursor: pointer; flex-shrink: 0; }
.fee-check-row:hover { color: var(--text); }
.fee-textarea { width: 100%; background: var(--raised); border: 1px solid var(--border2); border-radius: 8px; color: var(--text); font-family: 'Inter', sans-serif; font-size: .82rem; line-height: 1.65; padding: .65rem .85rem; outline: none; resize: vertical; min-height: 70px; transition: border-color .2s; }
.fee-textarea:focus { border-color: var(--amber); }
.fee-textarea::placeholder { color: var(--muted); }

.fee-live-summary { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); padding: .85rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.fee-live-row { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; color: var(--sub); }
.fee-live-total { font-weight: 600; color: var(--text); border-top: 1px solid var(--border); padding-top: .35rem; margin-top: .1rem; }

.fee-generate-btn { width: 100%; padding: .78rem; background: rgba(245,166,35,.1); border: 1px solid rgba(245,166,35,.28); border-radius: var(--radius); color: var(--amber); font-family: 'Inter', sans-serif; font-size: .85rem; font-weight: 500; cursor: pointer; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: .45rem; }
.fee-generate-btn:hover:not(:disabled) { background: rgba(245,166,35,.18); border-color: rgba(245,166,35,.5); }
.fee-generate-btn:disabled { opacity: .4; cursor: default; }

.fee-output-panel { overflow-y: auto; background: var(--bg); }
.fee-output-panel::-webkit-scrollbar { width: 6px; }
.fee-output-panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

.fee-empty { text-align: center; padding: 5rem 2rem; color: var(--muted); font-size: .85rem; line-height: 1.8; display: flex; flex-direction: column; align-items: center; }

.fee-letter-wrap { display: flex; flex-direction: column; }
.fee-action-bar { padding: .85rem 1.5rem; border-bottom: 1px solid var(--border); background: var(--card); flex-shrink: 0; position: sticky; top: 0; z-index: 1; }
.fee-totals-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.fee-total-chip { display: flex; flex-direction: column; align-items: center; padding: .4rem .85rem; background: var(--raised); border: 1px solid var(--border2); border-radius: 8px; min-width: 80px; }
.fee-total-chip-highlight { background: rgba(245,166,35,.1); border-color: rgba(245,166,35,.28); color: var(--amber); }
.fee-action-btn { display: flex; align-items: center; gap: .4rem; padding: .45rem .9rem; background: var(--raised); border: 1px solid var(--border2); border-radius: 8px; color: var(--sub); font-family: 'Inter', sans-serif; font-size: .73rem; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap; }
.fee-action-btn:hover { border-color: var(--accent); color: var(--a2); }
.fee-action-btn-email { background: rgba(234,67,53,.07); border-color: rgba(234,67,53,.2); color: #ff8a80; }
.fee-action-btn-email:hover { background: rgba(234,67,53,.13); border-color: rgba(234,67,53,.35); color: #ff8a80; }
.fee-action-btn-edit { background: rgba(245,166,35,.07); border-color: rgba(245,166,35,.2); color: var(--amber); }
.fee-action-btn-edit:hover { background: rgba(245,166,35,.13); }

.fee-letter-display { padding: 2rem 2.5rem; font-family: 'Georgia', 'Times New Roman', serif; font-size: .9rem; line-height: 1.9; color: var(--text); white-space: pre-wrap; max-width: 820px; }
.fee-letter-edit { width: 100%; padding: 2rem 2.5rem; font-family: 'Georgia', 'Times New Roman', serif; font-size: .9rem; line-height: 1.9; color: var(--text); background: var(--raised); border: none; outline: none; resize: vertical; min-height: 600px; border-top: 1px solid var(--border); }

/* ── QUICK ACTIONS GRID ──────────────────────────────────────────────────── */
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.qa-tile { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); padding: .9rem .75rem; cursor: pointer; transition: all .18s; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .45rem; font-family: 'Inter', sans-serif; }
.qa-tile:hover { border-color: var(--border2); background: var(--raised2); transform: translateY(-1px); }
.qa-icon { width: 42px; height: 42px; border-radius: 11px; border: 1px solid; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qa-label { font-size: .78rem; font-weight: 500; color: var(--text); }
.qa-sub { font-size: .66rem; color: var(--muted); line-height: 1.4; }

/* ── TODAY'S SUMMARY ─────────────────────────────────────────────────────── */
.summary-empty { text-align: center; color: var(--muted); font-size: .8rem; display: flex; flex-direction: column; align-items: center; }
.summary-greeting { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: .15rem; }
.summary-date { font-size: .72rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-bottom: .85rem; }
.summary-text { font-size: .85rem; color: var(--sub); line-height: 1.8; margin-bottom: 1rem; }
.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.summary-stat { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); padding: .75rem; text-align: center; }
.summary-stat-num { font-size: 1.3rem; font-weight: 600; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.summary-stat-label { font-size: .65rem; color: var(--muted); margin-top: .2rem; }

/* ── TOOL OVERLAYS ───────────────────────────────────────────────────────── */
.tool-workspace { flex: 1; display: grid; grid-template-columns: 320px 1fr; overflow: hidden; }
.tool-sidebar { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
.tool-sidebar::-webkit-scrollbar { width: 4px; }
.tool-sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.tool-sidebar-inner { padding: 1.25rem; display: flex; flex-direction: column; gap: .9rem; }
.tool-empty-state { text-align: center; padding: 5rem 2.5rem; color: var(--muted); font-size: .85rem; line-height: 1.8; display: flex; flex-direction: column; align-items: center; }

/* ── CROSS-EXAM CARDS ────────────────────────────────────────────────────── */
.cx-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cx-section-title { padding: .75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); font-size: .8rem; font-weight: 600; color: var(--amber); }
.cx-section-obj { padding: .6rem 1rem; font-size: .76rem; color: var(--muted); border-bottom: 1px solid var(--border); font-style: italic; }
.cx-q-card { display: flex; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.cx-q-card:last-child { border-bottom: none; }
.cx-q-num { font-size: .65rem; font-weight: 700; color: var(--amber); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; margin-top: 2px; min-width: 22px; }
.cx-q-body { flex: 1; min-width: 0; }
.cx-q-text { font-size: .84rem; color: var(--text); line-height: 1.6; margin-bottom: .35rem; font-style: italic; }
.cx-q-meta { font-size: .74rem; color: var(--muted); line-height: 1.55; margin-bottom: .15rem; }
.cx-q-label { color: var(--sub); font-weight: 500; }
.cx-q-followup { color: var(--amber); }

/* ── CHRONO TABLE ────────────────────────────────────────────────────────── */
.chrono-table-row:nth-child(odd) { background: var(--raised); }
.chrono-table-row:nth-child(even) { background: var(--card); }
.chrono-td-date { padding: .65rem 1rem; color: var(--purple); font-family: 'JetBrains Mono', monospace; font-size: .74rem; white-space: nowrap; vertical-align: top; border-bottom: 1px solid var(--border); }
.chrono-td-event { padding: .65rem 1rem; color: var(--text); font-size: .82rem; line-height: 1.6; border-bottom: 1px solid var(--border); }
.chrono-td-sig { padding: .65rem 1rem; color: var(--sub); font-size: .78rem; line-height: 1.55; border-bottom: 1px solid var(--border); }
.chrono-td-src { padding: .65rem 1rem; color: var(--muted); font-size: .7rem; font-family: 'JetBrains Mono', monospace; border-bottom: 1px solid var(--border); white-space: nowrap; }

/* ── MY MATTERS BUTTON ───────────────────────────────────────────────────── */
.notes-launch-btn { background: rgba(96,165,250,.08); border: 1px solid rgba(96,165,250,.22); color: var(--a2); }
.notes-launch-btn:hover { background: rgba(96,165,250,.16); border-color: rgba(96,165,250,.4); }

/* ── MATTER NOTES WORKSPACE ──────────────────────────────────────────────── */
.mn-workspace { flex: 1; display: grid; grid-template-columns: 280px 1fr 320px; overflow: hidden; }

.mn-sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.mn-search-row { display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.mn-matter-list { flex: 1; overflow-y: auto; padding: .4rem .5rem; }
.mn-matter-list::-webkit-scrollbar { width: 4px; }
.mn-matter-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.mn-item { padding: .75rem .85rem; border-radius: var(--radius); cursor: pointer; border: 1px solid transparent; margin-bottom: 2px; transition: all .15s; }
.mn-item:hover { background: var(--raised); border-color: var(--border2); }
.mn-item.selected { background: var(--accent-glow); border-color: rgba(64,112,255,.25); }
.mn-item-urgent { border-left: 3px solid var(--amber) !important; }
.mn-item-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .2rem; }
.mn-item-name { font-size: .8rem; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mn-status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.mn-item-meta { font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: .1rem; }
.mn-item-date { font-size: .68rem; color: var(--sub); display: flex; align-items: center; gap: .3rem; margin-top: .2rem; }
.mn-item-date.urgent { color: var(--amber); font-weight: 500; }

.mn-main { overflow-y: auto; background: var(--bg); }
.mn-main::-webkit-scrollbar { width: 5px; }
.mn-main::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.mn-detail-empty { text-align: center; padding: 5rem 2rem; color: var(--muted); font-size: .85rem; line-height: 1.8; display: flex; flex-direction: column; align-items: center; }
.mn-detail-inner { padding: 1.5rem 2rem; display: flex; flex-direction: column; gap: 1rem; max-width: 760px; }
.mn-detail-header { display: flex; align-items: flex-start; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.mn-detail-title { font-size: 1.1rem; font-weight: 600; color: var(--text); line-height: 1.4; }
.mn-status-badge { padding: .25rem .75rem; border-radius: 20px; font-size: .7rem; font-weight: 600; border: 1px solid; }
.mn-meta-chip { padding: .2rem .6rem; background: var(--raised); border: 1px solid var(--border2); border-radius: 5px; font-size: .7rem; color: var(--sub); }
.mn-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
.mn-detail-field { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); padding: .75rem 1rem; }
.mn-detail-val { font-size: .85rem; color: var(--text); margin-top: .25rem; }
.mn-hearing-card { display: flex; align-items: flex-start; gap: .85rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.mn-hearing-card.urgent { background: rgba(245,166,35,.05); border-color: rgba(245,166,35,.3); }
.mn-hearing-card svg { color: var(--a2); flex-shrink: 0; margin-top: 2px; }
.mn-hearing-card.urgent svg { color: var(--amber); }

.mn-dl-row { display: grid; grid-template-columns: 120px 1fr auto; gap: .75rem; align-items: center; padding: .5rem .75rem; background: var(--raised); border: 1px solid var(--border2); border-radius: 7px; }
.mn-dl-row.urgent { border-color: rgba(255,107,107,.3); background: rgba(255,107,107,.04); }
.mn-dl-date { font-size: .72rem; color: var(--sub); font-family: 'JetBrains Mono', monospace; }
.mn-dl-label { font-size: .8rem; color: var(--text); }
.mn-dl-countdown { font-size: .68rem; font-weight: 600; color: var(--amber); white-space: nowrap; font-family: 'JetBrains Mono', monospace; }
.mn-dl-row.urgent .mn-dl-countdown { color: var(--red); }

.mn-form-panel { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.mn-form-header { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mn-form-body { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .85rem; }
.mn-form-body::-webkit-scrollbar { width: 4px; }
.mn-form-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
.mn-deadline-row { display: flex; align-items: center; gap: .4rem; }

/* ── AI ASSISTANT CHAT ───────────────────────────────────────────────────── */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem 1.25rem;
  display: flex; flex-direction: column; gap: .75rem;
  min-height: 280px; max-height: 420px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.chat-welcome { display: flex; align-items: flex-start; gap: .85rem; padding: .5rem 0; }
.chat-welcome-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--purple-g); border: 1px solid rgba(157,120,245,.25); display: flex; align-items: center; justify-content: center; color: var(--purple); flex-shrink: 0; }
.chat-welcome-title { font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: .25rem; }
.chat-welcome-sub { font-size: .78rem; color: var(--muted); line-height: 1.65; }

.chat-starters { display: flex; flex-wrap: wrap; gap: .4rem; padding: .25rem 0 .5rem; }
.chat-starter-chip { padding: .3rem .75rem; border-radius: 20px; font-size: .7rem; cursor: pointer; border: 1px solid var(--border2); color: var(--muted); background: transparent; font-family: 'Inter', sans-serif; transition: all .15s; white-space: nowrap; }
.chat-starter-chip:hover { background: var(--purple-g); border-color: rgba(157,120,245,.35); color: var(--purple); }

.chat-bubble { display: flex; align-items: flex-start; gap: .65rem; animation: fadeSlideIn .18s ease-out; }
.chat-bubble.user { flex-direction: row-reverse; }

.chat-avatar { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.assistant-avatar { background: var(--purple-g); border: 1px solid rgba(157,120,245,.22); color: var(--purple); }

.chat-content {
  background: var(--raised); border: 1px solid var(--border2);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: .75rem 1rem; max-width: 88%; font-size: .84rem;
  color: var(--text); line-height: 1.75;
}
.chat-bubble.user .chat-content {
  background: rgba(64,112,255,.1); border-color: rgba(64,112,255,.2);
  border-radius: var(--radius) 0 var(--radius) var(--radius);
  color: var(--a2);
}
.user-content { color: var(--a2); font-size: .84rem; }

.chat-content p { margin-bottom: .5rem; }
.chat-content p:last-of-type { margin-bottom: 0; }
.chat-content ol, .chat-content ul { padding-left: 1.25rem; margin: .4rem 0; }
.chat-content li { margin-bottom: .3rem; font-size: .82rem; line-height: 1.65; }
.chat-content strong { color: var(--a2); font-weight: 600; }
.chat-content em { color: var(--sub); font-style: italic; }

.chat-actions { display: flex; gap: .4rem; margin-top: .6rem; padding-top: .5rem; border-top: 1px solid var(--border); }
.chat-action-btn { padding: .2rem .6rem; border-radius: 6px; font-size: .68rem; cursor: pointer; border: 1px solid var(--border2); color: var(--muted); background: transparent; font-family: 'Inter', sans-serif; transition: all .15s; }
.chat-action-btn:hover { border-color: rgba(157,120,245,.3); color: var(--purple); background: var(--purple-g); }

.chat-typing { display: flex; gap: 4px; align-items: center; padding: .2rem 0; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typingDot 1.2s ease-in-out infinite; }
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typingDot { 0%,60%,100%{transform:translateY(0);opacity:.4} 30%{transform:translateY(-5px);opacity:1} }

.chat-input-row {
  display: flex; align-items: flex-end; gap: .5rem;
  padding: .75rem 1rem; border-top: 1px solid var(--border);
  background: var(--surface); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.chat-mic-btn { width: 34px; height: 34px; border-radius: 50%; background: var(--raised); border: 1px solid var(--border2); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); flex-shrink: 0; transition: all .15s; }
.chat-mic-btn:hover { border-color: var(--purple); color: var(--purple); }
.chat-mic-btn.rec { border-color: var(--red); background: rgba(255,107,107,.1); color: var(--red); }
.chat-input {
  flex: 1; background: var(--raised); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text); font-family: 'Inter', sans-serif;
  font-size: .85rem; line-height: 1.6; padding: .55rem .85rem;
  outline: none; resize: none; transition: border-color .2s;
  max-height: 120px; min-height: 36px; overflow-y: auto;
}
.chat-input:focus { border-color: rgba(157,120,245,.5); box-shadow: 0 0 0 3px var(--purple-g); }
.chat-input::placeholder { color: var(--muted); }
.chat-send-btn {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--purple-g); border: 1px solid rgba(157,120,245,.3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--purple); transition: all .18s;
}
.chat-send-btn:hover { background: rgba(157,120,245,.22); border-color: rgba(157,120,245,.5); }
.chat-send-btn:disabled { opacity: .4; cursor: default; }

/* ── ACCOUNT BUTTON ──────────────────────────────────────────────────────── */
.account-btn { display: flex; align-items: center; gap: .4rem; padding: .4rem .9rem; background: var(--raised); border: 1px solid var(--border2); border-radius: 8px; color: var(--sub); font-family: 'Inter', sans-serif; font-size: .75rem; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap; margin-left: .25rem; }
.account-btn:hover { border-color: var(--accent); color: var(--a2); background: var(--a3); }

/* ── ACCOUNT WORKSPACE ───────────────────────────────────────────────────── */
.account-workspace { flex: 1; overflow-y: auto; padding: 2rem; display: flex; flex-direction: column; gap: 1.1rem; max-width: 700px; margin: 0 auto; width: 100%; }
.account-workspace::-webkit-scrollbar { width: 5px; }
.account-workspace::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.account-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.account-card-header { display: flex; align-items: center; gap: .55rem; padding: .85rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border); font-size: .65rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.account-card-body { padding: 1.25rem; }

/* ── CANCEL STEPS ────────────────────────────────────────────────────────── */
.cancel-steps { display: flex; flex-direction: column; gap: .85rem; margin-bottom: 1.25rem; }
.cancel-step { display: flex; align-items: flex-start; gap: .9rem; }
.cancel-step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-glow); border: 1px solid rgba(64,112,255,.25); display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: var(--a2); flex-shrink: 0; margin-top: 1px; }
.cancel-step-title { font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: .25rem; }
.cancel-step-desc { font-size: .8rem; color: var(--sub); line-height: 1.65; }
.cancel-paypal-btn { display: inline-flex; align-items: center; gap: .45rem; padding: .65rem 1.1rem; background: rgba(96,165,250,.08); border: 1px solid rgba(96,165,250,.22); border-radius: var(--radius); color: var(--a2); font-family: 'Inter', sans-serif; font-size: .8rem; font-weight: 500; text-decoration: none; transition: all .15s; margin-bottom: 1rem; }
.cancel-paypal-btn:hover { background: rgba(96,165,250,.15); border-color: rgba(96,165,250,.4); }
.cancel-note { display: flex; align-items: flex-start; gap: .5rem; font-size: .76rem; color: var(--muted); line-height: 1.6; background: var(--raised); border: 1px solid var(--border2); border-radius: 8px; padding: .65rem .85rem; }
.cancel-note svg { color: var(--amber); flex-shrink: 0; margin-top: 1px; }
.signout-btn { padding: .65rem 1.25rem; background: rgba(255,107,107,.08); border: 1px solid rgba(255,107,107,.2); border-radius: var(--radius); color: var(--red); font-family: 'Inter', sans-serif; font-size: .82rem; font-weight: 500; cursor: pointer; transition: all .15s; }
.signout-btn:hover { background: rgba(255,107,107,.15); border-color: rgba(255,107,107,.4); }

/* ── CANCEL TABS ─────────────────────────────────────────────────────────── */
.cancel-tab { padding: .4rem .9rem; border-radius: 8px; font-size: .78rem; font-weight: 500; cursor: pointer; border: 1px solid var(--border2); color: var(--muted); background: transparent; font-family: 'Inter', sans-serif; transition: all .15s; }
.cancel-tab.on { background: var(--accent-glow); border-color: rgba(64,112,255,.3); color: var(--a2); }
.cancel-tab:hover:not(.on) { color: var(--text); border-color: var(--border2); }

/* ── GUEST SUB LOOKUP ────────────────────────────────────────────────────── */
.guest-sub-lookup { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; }

/* ── ACCOUNT WORKSPACE (TWO COLUMN) ─────────────────────────────────────── */
.account-workspace { flex: 1; overflow-y: auto; padding: 2rem; display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.1rem; align-items: start; max-width: 1100px; margin: 0 auto; width: 100%; }
.account-workspace::-webkit-scrollbar { width: 5px; }
.account-workspace::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.account-col { display: flex; flex-direction: column; gap: 1.1rem; }

/* ── CANCEL TABS ─────────────────────────────────────────────────────────── */
.cancel-tabs { display: flex; gap: .4rem; margin-bottom: 1.1rem; background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); padding: .3rem; }
.cancel-tab { flex: 1; padding: .45rem .75rem; border-radius: 7px; font-family: 'Inter', sans-serif; font-size: .75rem; font-weight: 500; cursor: pointer; border: none; background: transparent; color: var(--muted); transition: all .15s; text-align: center; }
.cancel-tab.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.cancel-tab:hover:not(.on) { color: var(--text); }

/* ── GUEST LOOKUP ────────────────────────────────────────────────────────── */
.guest-sub-lookup { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); padding: 1rem; margin-top: .75rem; }

/* ── SELF-SERVE CANCELLATION ─────────────────────────────────────────────── */
.self-cancel-box { background: var(--raised); border: 1px solid var(--border2); border-radius: var(--radius); padding: 1rem; }
.self-cancel-btn { padding: .65rem 1.1rem; background: rgba(255,107,107,.1); border: 1px solid rgba(255,107,107,.25); border-radius: var(--radius); color: var(--red); font-family: 'Inter', sans-serif; font-size: .8rem; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap; flex-shrink: 0; }
.self-cancel-btn:hover:not(:disabled) { background: rgba(255,107,107,.18); border-color: rgba(255,107,107,.45); }
.self-cancel-btn:disabled { opacity: .5; cursor: default; display: flex; align-items: center; gap: .4rem; }
.cancel-result-success { display: flex; align-items: flex-start; gap: .65rem; background: rgba(46,216,160,.08); border: 1px solid rgba(46,216,160,.25); border-radius: var(--radius); padding: .85rem 1rem; color: var(--green); font-size: .84rem; line-height: 1.6; }
.cancel-result-success svg { flex-shrink: 0; margin-top: 2px; }
.cancel-result-error { background: rgba(255,107,107,.08); border: 1px solid rgba(255,107,107,.22); border-radius: var(--radius); padding: .75rem 1rem; color: var(--red); font-size: .82rem; line-height: 1.6; }
