/* Local :root override removed — global styles.css provides the
   luxe design tokens (bone/ocean/sage/Fraunces/DM Sans). */

/* Base typography */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-weight: 300; line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5 { font-family: var(--serif); font-weight: 400; line-height: 1.15; color: var(--ink); letter-spacing: 0.03em; }
h1 { font-size: clamp(28px,4vw,44px); letter-spacing: 0.04em; }
h2 { font-size: clamp(22px,3vw,32px); letter-spacing: 0.035em; }
h3 { font-size: 20px; letter-spacing: 0.03em; }
p { line-height: 1.7; }

/* Override body to remove page constraints for this full-bleed layout */
body { margin: 0; padding: 0; }
/* Topbar — local layout only. Visual styling (black bg, white text, hard
   buttons, brand mark) inherited from styles.css. */
.topbar { padding: 12px 24px !important; position: relative !important; z-index: 100; display: flex !important; align-items: center; gap: 24px; }

/* .brand layout — visual styling inherited from styles.css. */
.brand { display:flex;align-items:center;gap:12px;text-decoration:none;flex-shrink:0; }
.nav-actions { display:flex;align-items:center;gap:8px;flex-shrink:0; }
.chip { display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;font-size:11px;font-weight:500;letter-spacing:.04em;background:var(--surface);color:var(--muted);border:1px solid var(--border);white-space:nowrap; }
.chip.green { background:var(--green-light);color:var(--green);border-color:rgba(45,106,79,.2); }
.chip.amber { background:var(--amber-light);color:var(--amber);border-color:rgba(181,98,10,.2); }
.chip.blue { background:var(--accent-light);color:var(--accent);border-color:rgba(61,90,128,.2); }
.chip.red { background:var(--red-light);color:var(--red);border-color:rgba(184,50,50,.2); }
input[type="text"],input[type="email"],input[type="password"],input[type="number"],textarea,select { width:100%;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:11px 14px;font-size:14px;font-family:var(--sans);font-weight:300;color:var(--ink);outline:none;transition:border-color .2s;appearance:none; }
input:focus,textarea:focus,select:focus { border-color:var(--accent); }
textarea { resize:vertical;min-height:120px;line-height:1.6; }
label { font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:500;display:block;margin-bottom:6px; }
.form-stack { display:flex;flex-direction:column;gap:16px; }
::-webkit-scrollbar { width:5px;height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border);border-radius:3px; }
.spinner { display:inline-block;width:14px;height:14px;border:2px solid rgba(255,255,255,.3);border-top-color:white;border-radius:50%;animation:spin .8s linear infinite;vertical-align:middle; }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes fadeUp { from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)} }

/* ── Layout ── */
html, body { height: 100%; overflow: hidden; }
body { display: flex; flex-direction: column; }

/* ── Shell: FLEX row (was grid) — fixes Safari flex:1 child height propagation ──
   NOTE: visibility starts VISIBLE. We previously hid the shell until role was
   confirmed (to prevent a client-side flash before redirect), but that meant
   any JS error before the reveal line left users staring at a blank page.
   The redirect for wrong-role users still happens via window.location.replace,
   so the worst case now is a ~200ms flash instead of an indefinite blank. */
.hub-shell {
  display: flex;
  flex-direction: row;
  gap: 0;
  flex: 1;
  visibility: visible;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar — LUXE ivory shiplap ── */
.hub-sidebar {
  background:
    repeating-linear-gradient(0deg,
      rgba(20, 19, 15, 0.05) 0,
      rgba(20, 19, 15, 0.05) 1px,
      transparent 1px,
      transparent 80px),
    var(--ivory);
  border-right: 1px solid var(--line-w);
  width: 240px;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.22s ease;
  position: relative;
}
/* Hamburger toggle — styled as a sidebar item */
.sidebar-toggle { font-size: 18px !important; }
.hub-sidebar.collapsed .sidebar-toggle .si-label { opacity: 0 !important; width: 0 !important; }
.sidebar-items-wrap { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 8px; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.sidebar-section-label {
  font-family: var(--sans);
  font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--whisper); font-weight: 600; padding: 14px 4px 5px;
  white-space: nowrap; overflow: hidden;
  transition: opacity 0.18s, height 0.22s, padding 0.22s;
}
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 0;
  font-size: 13.5px; color: var(--ink-soft);
  cursor: pointer; border: none; background: transparent;
  text-align: left; font-family: var(--sans); font-weight: 400;
  transition: background 0.15s, color 0.15s, padding 0.22s; width: 100%; text-decoration: none;
  white-space: nowrap; overflow: hidden;
  position: relative;
}
.sidebar-item:hover { background: var(--bone); color: var(--ink); }
.sidebar-item:hover .si-icon { color: var(--ocean-d); }
.sidebar-item.active {
  background: var(--paper); color: var(--ink); font-weight: 500;
  box-shadow: 0 1px 2px rgba(31,61,82,0.05), 0 0 0 1px var(--line-w);
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: -1px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--ocean-d);
  border-radius: 2px;
}
/* Collapsed mode: move the active accent bar from the left edge to a
   centered short underline below the icon — keeps the icon visually
   centered in the 60px-wide sidebar. */
.hub-sidebar.collapsed .sidebar-item.active::before {
  left: 50%; top: auto; bottom: 4px;
  width: 16px; height: 2px;
  transform: translateX(-50%);
}
.sidebar-item.active .si-icon { color: var(--ocean-d); opacity: 1; }
.sidebar-item .si-icon { font-size: 14px; width: 20px; flex-shrink: 0; color: var(--muted); opacity: 0.85; transition: color 0.22s; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.sidebar-item .si-icon i { display: inline-block; line-height: 1; }
.si-label { transition: opacity 0.18s; white-space: nowrap; overflow: hidden; flex: 1; }
.sidebar-badge {
  margin-left: auto; background: var(--ocean-d); color: #fff;
  font-size: 10px; font-weight: 500; padding: 2px 7px;
  border-radius: 999px; min-width: 20px; text-align: center; flex-shrink: 0;
  letter-spacing: 0.02em;
}
.sidebar-badge.red { background: var(--red); }
.sidebar-divider { height: 1px; background: var(--line-w); margin: 6px 4px; flex-shrink: 0; transition: margin 0.22s; }
.sidebar-profile {
  padding: 14px; border-bottom: 1px solid var(--line-w);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  transition: padding 0.22s; overflow: hidden;
}
.sidebar-signout {
  padding: 4px 10px 10px; flex-shrink: 0;
  border-top: 1px solid var(--line-w);
}
.sidebar-profile-info { overflow: hidden; transition: opacity 0.18s, width 0.22s; white-space: nowrap; }
.sidebar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ocean-w); color: var(--ocean-d);
  border: 1px solid var(--line-w);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 13px; font-weight: 500; flex-shrink: 0; overflow: hidden;
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-profile-name { font-size: 13px; color: var(--ink); font-weight: 500; }
.sidebar-profile-role { font-size: 11px; color: var(--muted); }

/* Hamburger toggle that sits inside the profile card, right-aligned. */
.sidebar-profile-toggle {
  margin-left: auto;
  flex-shrink: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  color: var(--muted); cursor: pointer;
  border-radius: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sidebar-profile-toggle:hover { background: var(--surface); color: var(--ink); border-color: var(--border); }
.sidebar-profile-toggle i { font-size: 18px; }
/* When the sidebar is collapsed: hide the avatar entirely and show only
   the hamburger toggle, centered, so the user has a single clear affordance
   to re-expand the sidebar. */
.hub-sidebar.collapsed .sidebar-avatar { display: none; }
.hub-sidebar.collapsed .sidebar-profile { justify-content: center; padding: 12px 0; gap: 0; }
.hub-sidebar.collapsed .sidebar-profile-toggle { margin-left: 0; }

/* ── Collapsed sidebar ── */
.hub-sidebar.collapsed { width: 60px; }
.hub-sidebar.collapsed .sidebar-section-label { opacity: 0; height: 0; padding: 0; pointer-events: none; }
.hub-sidebar.collapsed .si-label { opacity: 0; width: 0; pointer-events: none; }
.hub-sidebar.collapsed .sidebar-badge { opacity: 0; width: 0; min-width: 0; padding: 0; margin: 0; overflow: hidden; pointer-events: none; }
.hub-sidebar.collapsed .sidebar-item { justify-content: center; padding: 10px; gap: 0; }
.hub-sidebar.collapsed .sidebar-items-wrap { padding: 4px 8px 8px; }
.hub-sidebar.collapsed .sidebar-divider { margin: 6px 8px; }
.hub-sidebar.collapsed .sidebar-profile { justify-content: center; padding: 12px 0; gap: 0; }
.hub-sidebar.collapsed .sidebar-signout .sidebar-item { justify-content: center; padding: 10px; gap: 0; }
.hub-sidebar.collapsed .sidebar-profile-info { opacity: 0; width: 0; }

/* ── Main content — no padding, hero touches sidebar ── */
.hub-main {
  padding: 0 0 0;
  background: var(--bg);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
}
/* Reliable bottom breathing room — padding-bottom on a flex overflow container is clipped in WebKit */
.hub-main::after { content: ''; display: block; height: 56px; flex-shrink: 0; }
.section { display: none; }
.section.active { display: flex; flex-direction: column; gap: 24px; }
/* Full-height sections: fill hub-main so their internal panes scroll */
#section-clients.active,
#section-journal.active,
#section-todo.active,
#section-notes.active,
#section-boards.active,
#section-assignments.active { flex: 1; min-height: 0; }
/* Bottom breathing room for every master-detail section. The inner
   widgets (clients-layout, asgn-shell, notes-shell) get a generous
   min-height below so they fill the screen comfortably instead of
   collapsing to content size; this padding ensures there's always
   visible margin between the widget bottom and the page edge.
   The 56px .hub-main::after sits below this padding on the
   sections that don't suppress it. */
#section-clients.active,
#section-notes.active,
#section-assignments.active { padding-bottom: 40px; }

/* Substantial min-height on the three big master-detail widgets so
   the user gets a comfortable working surface regardless of how
   much hero / filter chrome sits above. Clamped: at least 560px on
   small viewports, scales with the viewport on larger screens, and
   capped at 1200px so 4K monitors don't blow it out. With a 240px
   sidebar at standard zoom, the widget is comfortably taller than
   most laptop screens; collapsing the sidebar (60px) automatically
   widens it because hub-main is flex:1 in the shell row.
   The `.hub-main` ancestor lifts specificity above the bare class
   selectors below that set `min-height: 0` for flex-shrink behavior
   — we want the widget to grow generously, not collapse to content. */
.hub-main .clients-layout,
.hub-main .asgn-shell,
.hub-main .notes-shell {
  min-height: clamp(560px, calc(100vh - 280px), 1200px);
}
/* Journal section: fills hub-main, journal-app fills remaining height.
   Side + bottom padding gives the journal-app and gdocs panel breathing
   room from the page edges instead of slamming flush. */
/* My Journal tab: the 3-panel app fills the first screen (viewport-height,
   not a brittle offset calc), and the "Recent Entries" log sits below it —
   reachable by scrolling. The section scrolls; the app's own panels scroll
   internally. Google Docs / Full Entry Log tabs hide the app + log and let
   their panel fill (flex:1) — JS toggles which panel is visible. */
#section-journal.active { flex: 1 !important; min-height: 0 !important; gap: 0 !important; padding: 12px 16px 20px !important; overflow-y: auto !important; overflow-x: hidden !important; }
#section-journal .tj-journal-app { flex: 0 0 auto !important; height: 78vh !important; min-height: 520px !important; overflow: hidden !important; }
#section-journal .tj-gdocs-panel { flex: 1 !important; min-height: 0 !important; height: auto !important; }
/* Full Entry Log panel fills the viewport on its tab. */
#section-journal .el-panel { flex: 1 !important; min-height: 0 !important; }
/* Recent Entries log: visibility is driven by tjSwitchTab (shown on the
   My Journal tab only). No display override here — that previously hid it. */
/* Suppress bottom spacer for full-height sections that manage their own scroll */
.hub-main:has(#section-journal.active)::after,
.hub-main:has(#section-todo.active)::after,
.hub-main:has(#section-clients.active)::after,
.hub-main:has(#section-notes.active)::after,
.hub-main:has(#section-assignments.active)::after { display: none; }
/* To-Do section: fills hub-main and scrolls internally */
#section-todo.active { flex: 1 !important; min-height: 0 !important; overflow-y: auto !important; }
/* Clinical framework picker */
/* Clinical-framework picker: grouped dropdown + live description panel. */
.cf-control { max-width: 560px; }
.cf-select { width: 100%; font-family: var(--sans); font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 11px 14px; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L2 4h8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.cf-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cf-desc-panel { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--border); border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
.cf-desc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cf-desc-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.cf-tag { font-size: 10px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.cf-desc-body { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
/* Journal log (below the editor, visible when scrolling) */
.tj-jlog-section { padding: 28px 32px 48px; }
.tj-jlog-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tj-jlog-header h3 { font-size: 17px; font-family: var(--sans); font-weight: 600; letter-spacing: -0.01em; }
.tj-jlog-header span { font-size: 12px; color: var(--muted); }
.tj-jlog-card { display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--border); border-radius: 0; overflow: hidden; background: var(--card); }
.tj-jlog-entry { display: flex; align-items: flex-start; gap: 16px; padding: 16px 20px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.tj-jlog-entry:last-child { border-bottom: none; }
.tj-jlog-entry:hover { background: var(--surface); }
.tj-jlog-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 6px; }
.tj-jlog-meta { display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
.tj-jlog-date { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.tj-jlog-body { flex: 1; min-width: 0; }
.tj-jlog-subject { font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tj-jlog-excerpt { font-size: 12px; color: var(--muted); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tj-jlog-words { font-size: 11px; color: var(--muted); flex-shrink: 0; margin-top: 2px; }
.tj-jlog-delete { flex-shrink: 0; background: none; border: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 2px 4px; border-radius: 4px; opacity: 0.55; transition: opacity 0.15s, color 0.15s; line-height: 1; }
.tj-jlog-entry:hover .tj-jlog-delete { opacity: 1; }
.tj-jlog-delete:hover { color: var(--red, #c0392b); }
@media (hover: none) { .tj-jlog-delete { opacity: 1; } }
.tj-jlog-empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.8; }

/* ── In-app rich-text editor (Google Docs editing) ── */
.ss-rte-toolbar { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 7px 12px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ss-rte-toolbar select { width: auto; max-width: 170px; flex: 0 0 auto; font-size: 12px; padding: 4px 24px 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); font-family: var(--sans); cursor: pointer; }
/* Icon format buttons only — exclude the .btn Cancel/Save buttons so they
   keep their normal width and don't collapse into squished squares. */
.ss-rte-toolbar > button:not(.btn) { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; transition: background .12s, border-color .12s; }
.ss-rte-toolbar > button:not(.btn):hover { background: var(--surface); border-color: var(--ink); }
.ss-rte-color { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); color: var(--ink); cursor: pointer; position: relative; font-size: 13px; }
.ss-rte-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
/* Gray canvas that holds the page (Google Docs print-layout feel) */
.ss-rte-canvas { flex: 1; min-height: 0; overflow-y: auto; background: #e9e9e7; padding: 28px 16px; }
/* The editable "page": white 8.5in sheet, ~0.9in margins, drop shadow */
.ss-rte-surface { max-width: 816px; margin: 0 auto; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,0.18); border-radius: 2px; padding: 76px 84px; min-height: 1056px; color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.7; outline: none; }
.ss-rte-surface:focus { outline: none; }
.ss-rte-surface h1 { font-size: 22px; margin: 0 0 10px; }
.ss-rte-surface h2 { font-size: 18px; margin: 16px 0 8px; }
.ss-rte-surface h3 { font-size: 15px; margin: 14px 0 6px; }
.ss-rte-surface p { margin: 0 0 10px; }
.ss-rte-surface ul, .ss-rte-surface ol { margin: 0 0 10px; padding-left: 24px; }
.ss-rte-surface a { color: #1a73e8; }
/* Editable spreadsheet grid */
.ss-grid-scroll { flex: 1; min-height: 0; overflow: auto; background: var(--card); }
.ss-grid { border-collapse: collapse; width: max-content; min-width: 100%; }
.ss-grid-cell { border: 1px solid var(--border); padding: 6px 10px; font-size: 13px; color: var(--ink); min-width: 96px; max-width: 320px; outline: none; white-space: pre-wrap; }
.ss-grid-cell:focus { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.ss-grid tr:first-child .ss-grid-cell { font-weight: 600; background: var(--surface); }

/* ── Full Entry Log (therapist journal) ── */
.el-panel { display:flex; flex-direction:column; flex:1; min-height:0; border:1px solid var(--border); border-top:none; overflow:hidden; background:var(--bg); }
.el-topbar { display:flex; align-items:center; gap:12px; padding:14px 20px; border-bottom:1px solid var(--border); background:var(--card); flex-shrink:0; flex-wrap:wrap; }
.el-search-wrap { display:flex; align-items:center; gap:8px; flex:1; min-width:180px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:8px 12px; }
.el-search-wrap input { border:none; background:transparent; font-size:13px; outline:none; flex:1; color:var(--ink); }
.el-controls { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.el-controls select { font-size:12px; padding:7px 10px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--ink); cursor:pointer; }
.el-view-toggle { display:flex; gap:2px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:2px; }
.el-vbtn { width:30px; height:30px; border:none; background:transparent; border-radius:6px; cursor:pointer; color:var(--muted); display:flex; align-items:center; justify-content:center; font-size:14px; transition:all .15s; }
.el-vbtn.active { background:var(--card); color:var(--ink); box-shadow:0 1px 3px var(--shadow); }
.el-tabs { display:flex; gap:0; border-bottom:1px solid var(--border); background:var(--card); flex-shrink:0; padding:0 20px; }
.el-tab { background:none; border:none; border-bottom:2px solid transparent; padding:11px 16px; font-size:13px; font-family:var(--sans); font-weight:500; color:var(--muted); cursor:pointer; transition:all .15s; display:flex; align-items:center; gap:6px; margin-bottom:-1px; }
.el-tab.active { color:var(--ink); border-bottom-color:var(--accent); }
.el-content { flex:1; overflow-y:auto; padding:20px; min-height:0; }
.el-group-header { font-size:11px; font-weight:600; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); margin:20px 0 10px; padding-bottom:6px; border-bottom:1px solid var(--border); }
.el-group-header:first-child { margin-top:0; }
.el-list-item { display:flex; align-items:flex-start; gap:14px; padding:14px 16px; background:var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); margin-bottom:6px; cursor:pointer; transition:all .15s; }
.el-list-item:hover { border-color:var(--accent); box-shadow:0 2px 8px var(--shadow); }
.el-list-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); flex-shrink:0; margin-top:5px; }
.el-list-main { flex:1; min-width:0; }
.el-list-subject { font-size:14px; font-weight:500; color:var(--ink); margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.el-list-excerpt { font-size:12px; color:var(--muted); line-height:1.5; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.el-list-meta { display:flex; align-items:center; gap:8px; margin-top:6px; flex-wrap:wrap; }
.el-list-date { font-size:11px; color:var(--muted); }
.el-list-words { font-size:11px; color:var(--muted); }
.el-label-chip { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:999px; font-size:10px; font-weight:500; background:var(--accent-light); color:var(--accent); border:1px solid rgba(61,90,128,.15); margin-right:4px; }
.el-add-label { background:none; border:1px dashed var(--border); border-radius:999px; padding:2px 8px; font-size:10px; color:var(--muted); cursor:pointer; font-family:var(--sans); }
.el-add-label:hover { border-color:var(--accent); color:var(--accent); }
.el-list-actions { display:flex; gap:6px; flex-shrink:0; opacity:0; transition:opacity .15s; }
.el-list-item:hover .el-list-actions { opacity:1; }
.el-list-btn { background:none; border:1px solid var(--border); border-radius:var(--radius-sm); padding:5px 9px; font-size:11px; color:var(--muted); cursor:pointer; font-family:var(--sans); transition:all .15s; }
.el-list-btn:hover { color:var(--ink); border-color:var(--ink); }
.el-list-btn.danger:hover { color:var(--red,#c0392b); border-color:var(--red,#c0392b); }
.el-has-analysis { width:16px; height:16px; border-radius:50%; background:var(--purple-light,#ede7f6); color:var(--purple,#7c3aed); display:flex; align-items:center; justify-content:center; font-size:9px; flex-shrink:0; margin-top:2px; }
.el-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px,1fr)); gap:12px; }
.el-grid-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:16px; cursor:pointer; transition:all .15s; display:flex; flex-direction:column; gap:8px; }
.el-grid-card:hover { border-color:var(--accent); box-shadow:0 4px 16px var(--shadow); transform:translateY(-1px); }
.el-grid-date { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
.el-grid-subject { font-size:14px; font-weight:500; color:var(--ink); line-height:1.3; }
.el-grid-excerpt { font-size:12px; color:var(--muted); line-height:1.5; overflow:hidden; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; flex:1; }
.el-grid-footer { display:flex; align-items:center; justify-content:space-between; margin-top:4px; }
.el-grid-words { font-size:11px; color:var(--muted); }
.el-summary-card { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:18px; margin-bottom:10px; }
.el-summary-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:10px; }
.el-summary-date { font-size:11px; color:var(--muted); }
.el-summary-subject { font-size:15px; font-weight:500; color:var(--ink); }
.el-summary-text { font-size:13px; color:var(--ink); line-height:1.7; }
.el-summary-badges { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.el-no-analysis { display:flex; flex-direction:column; align-items:center; gap:8px; padding:32px; text-align:center; color:var(--muted); }
.el-empty { display:flex; flex-direction:column; align-items:center; gap:12px; padding:60px 20px; text-align:center; color:var(--muted); }
.el-empty i { font-size:36px; opacity:.3; }
.el-empty p { font-size:14px; }

.section-hero {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 4px;
}
.section-hero h1 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 4px; }
.section-hero p { font-size: 14px; color: var(--muted); }

/* ── Cards ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 24px; box-shadow: 0 2px 16px var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.card-header h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; font-family: var(--sans); margin: 0; }

/* ── Overview hero banner — LUXE editorial paper card, HARD edges, touches sidebar ── */
.ov-hero {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 56px 64px 0;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(92,143,168,0.06),
    0 20px 48px -22px rgba(31,61,82,0.22);
}
/* Ocean gradient rail on top — the luxe signature */
.ov-hero::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ocean-d) 0%, var(--ocean) 35%, var(--ocean-f) 65%, var(--ocean) 100%);
}
.ov-hero-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.ov-hero-text { flex: 1; min-width: 180px; }
.ov-hero-text h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "opsz" 96, "SOFT" 50;
  font-size: clamp(28px, 4vw, 48px);
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.0;
  margin: 8px 0 6px;
}
.ov-hero-text h2 em {
  font-style: italic;
  color: var(--ocean-d);
  font-variation-settings: "opsz" 96, "SOFT" 100, "wght" 300;
}
.ov-hero-sub { font-size: 14px; color: var(--ink-soft); margin-top: 4px; font-family: var(--serif); font-weight: 350; font-variation-settings: "opsz" 24, "SOFT" 50; }
.ov-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.ov-stat-tiles { display: flex; border-top: 1px solid var(--line-w); margin: 0 -64px; }
.ov-stat-tile { padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--line-w); min-width: 86px; flex: 1; }
.ov-stat-tile:first-child { padding-left: 64px; }
.ov-stat-tile:last-child { border-right: none; padding-right: 64px; }
.ov-st-label { font-family: var(--sans); font-size: 10.5px; color: var(--muted); letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.ov-st-num {
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: "opsz" 72, "SOFT" 50;
  font-size: 36px;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.025em;
  font-feature-settings: "tnum";
}
.ov-st-num em { font-style: italic; color: var(--ocean-f); font-variation-settings: "opsz" 72, "SOFT" 100, "wght" 300; }
.ov-st-sub { font-size: 11.5px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-top: 6px; }

/* ── Overview body (left content + right clients sidebar) ── */
.ov-body { display: grid; grid-template-columns: 1fr 280px; padding: 32px 64px 48px; gap: 22px; align-items: stretch; }
/* All non-overview sections need horizontal padding now that hub-main has none.
   Side gutters tightened from 64px to 28px so panels feel proportioned
   to the surrounding chrome instead of floating in empty space. */
.section:not(#section-overview) { padding: 20px 28px 28px; }
/* Journal: tighter still because its 3-panel grid is self-contained. */
#section-journal { padding: 16px 12px 20px; }
.ov-content { display: flex; flex-direction: column; gap: 20px; }
.ov-sidebar { display: flex; flex-direction: column; }
.ov-sidebar .card { flex: 1; display: flex; flex-direction: column; }
.ov-sidebar .card .card-header { flex-shrink: 0; }
.jentry-card { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 0; padding: 14px 16px; margin-bottom: 10px; transition: border-color 0.15s, box-shadow 0.15s; cursor: pointer; }
.jentry-card:last-child { margin-bottom: 0; }
.jentry-card.entry-green { border-left-color: var(--green); }
.jentry-card:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(61,90,128,0.08); }
.je-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.je-date { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0.04em; }
.je-excerpt { font-size: 13px; color: var(--ink); line-height: 1.6; }

/* ── Calendar ── */
.cal-controls { display: flex; align-items: center; gap: 12px; }
.cal-controls h3 { font-size: 18px; }
.cal-view-toggle { display: flex; border: 1px solid var(--border); border-radius: 0; overflow: hidden; }
.cal-view-btn { padding: 6px 14px; font-size: 12px; font-family: var(--sans); border: none; background: transparent; cursor: pointer; color: var(--muted); transition: all 0.15s; }
.cal-view-btn.active { background: var(--ink); color: #fff; }

.week-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
}
.week-header { background: var(--surface); padding: 10px 8px; font-size: 12px; font-weight: 500; text-align: center; border-bottom: 1px solid var(--border); color: var(--muted); position: relative; }
/* Today: a clean highlight around just the date number (filled circle),
   not a full-block fill of the whole header cell. */
.week-header.today { background: transparent; color: var(--accent); font-weight: 600; }
.week-header.today strong {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin-top: 3px;
  background: var(--ink); color: #fff; border-radius: 50%;
  font-size: 12px; line-height: 1; font-weight: 600;
}
.week-time { padding: 0 8px; font-size: 11px; color: var(--muted); text-align: center; border-right: 1px solid var(--border); height: 56px; display: flex; align-items: center; justify-content: center; }
.week-cell { border-right: 1px solid var(--border); border-bottom: 1px solid rgba(216,208,192,0.4); height: 56px; position: relative; transition: background 0.1s; }
.week-cell:hover { background: var(--surface); }
.week-cell:last-child { border-right: none; }
.cal-event {
  position: absolute; left: 2px; right: 2px; top: 2px;
  background: var(--accent); color: #fff; border-radius: 4px;
  font-size: 11px; padding: 3px 6px; cursor: pointer;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  box-shadow: 0 1px 4px rgba(61,90,128,0.3);
}
.cal-event.green { background: var(--green); }
.cal-event.amber { background: var(--amber); }
.cal-event.cal-event--shared { background: transparent; color: var(--accent); border: 1.5px dashed var(--accent); box-shadow: none; }

/* ── Overview Week Time-Slot Grid (shared with client dashboard) ── */
.ovwk-tgrid {
  display: grid;
  grid-template-columns: 44px repeat(7, 1fr);
  overflow: hidden;
  border-top: 1px solid var(--border);
}
.ovwk-thdr {
  background: var(--surface);
  padding: 8px 4px 7px;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  line-height: 1.3;
}
.ovwk-thdr.today { color: var(--accent); }
.ovwk-thdr.time-lbl { background: var(--surface); }
.ovwk-ttime {
  font-size: 9px;
  color: var(--muted);
  height: 36px;
  display: flex;
  align-items: flex-start;
  padding: 4px 5px 0 0;
  justify-content: flex-end;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid rgba(216,208,192,0.35);
  white-space: nowrap;
}
.ovwk-tcell {
  height: 36px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid rgba(216,208,192,0.35);
  position: relative;
  transition: background 0.1s;
}
.ovwk-tcell:hover { background: rgba(61,90,128,0.04); }
.ovwk-tcell.today-col { background: rgba(61,90,128,0.03); }
.ovwk-tcell:last-child { border-right: none; }
.ovwk-tev {
  position: absolute;
  left: 2px; right: 2px; top: 2px; bottom: 2px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  padding: 0 5px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--sans);
  box-shadow: 0 1px 3px rgba(61,90,128,0.25);
  z-index: 1;
  display: flex;
  align-items: center;
}
.ovwk-tev:hover { opacity: 0.82; }
.ovwk-tev.green  { background: var(--green); }
.ovwk-tev.purple { background: var(--purple); }
.ovwk-tev.gold   { background: var(--gold); }
.ovwk-tev.amber  { background: var(--amber); }
.ovwk-tev.red    { background: #c0392b; }

.upcoming-list { display: flex; flex-direction: column; gap: 10px; }
.upcoming-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 0;
  transition: border-color 0.15s;
}
.upcoming-item:hover { border-color: var(--accent); }
.upcoming-time { font-size: 13px; font-weight: 500; min-width: 80px; color: var(--ink); }
.upcoming-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.upcoming-dot.green { background: var(--green); }
.upcoming-dot.amber { background: var(--amber); }
.upcoming-info { flex: 1; }
.upcoming-info strong { font-size: 14px; display: block; margin-bottom: 2px; }
.upcoming-info span { font-size: 12px; color: var(--muted); }
.upcoming-actions { display: flex; gap: 8px; }

/* ── Appointment Modal ── */
.appt-overlay {
  position: fixed; inset: 0; background: rgba(26,24,20,0.4);
  backdrop-filter: blur(4px); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.appt-overlay.open { display: flex; }
.appt-modal {
  background: var(--card); border-radius: 0;
  width: min(680px, 100%); max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(26,24,20,0.2);
  animation: fadeUp 0.2s ease;
}
.appt-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.appt-modal-header h3 { font-size: 18px; }
.appt-modal-body { padding: 24px; }
.appt-modal-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-top: 1px solid var(--border); gap: 12px;
}
.appt-delete-btn {
  background: transparent; color: var(--red); border: 1px solid rgba(184,50,50,.2);
  font-size: 13px; padding: 8px 16px; border-radius: 0;
  cursor: pointer; font-family: var(--sans); transition: all 0.15s;
}
.appt-delete-btn:hover { background: var(--red-light); }

/* ── Schedule layout ── */
.schedule-layout { display: flex; flex-direction: column; gap: 20px; }
.day-notes-panel { display: flex; flex-direction: row; align-items: stretch; gap: 24px; }
.dnp-label { min-width: 145px; max-width: 165px; display: flex; flex-direction: column; }
.dnp-actions { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; min-width: 95px; }
.day-sel-date { font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.day-sel-desc { font-size: 12px; color: var(--muted); margin-bottom: 0; line-height: 1.5; }

/* ── Client detail tab content ── */
.cdp-assign-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 0; background: var(--surface); margin-bottom: 8px; transition: border-color .15s; }
.cdp-assign-item:hover { border-color: var(--accent); }
.cdp-meet-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 0; background: var(--surface); margin-bottom: 8px; transition: border-color .15s; }
.cdp-meet-item:hover { border-color: var(--accent); }
.cdp-meet-time { font-size: 13px; font-weight: 500; min-width: 130px; line-height: 1.4; }
.cdp-meet-info { flex: 1; }
.cdp-meet-info strong { font-size: 13px; display: block; }
.cdp-meet-info span { font-size: 11px; color: var(--muted); }

@media (max-width: 460px) { .day-notes-panel { flex-direction: column; } .dnp-label { max-width: 100%; } }

/* ── Client roster ── */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.client-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0; padding: 20px;
  box-shadow: 0 2px 12px var(--shadow);
  cursor: pointer; transition: all 0.2s;
}
.client-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px var(--shadow); border-color: var(--accent); }
.client-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.client-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 16px; flex-shrink: 0;
}
.client-name { font-size: 15px; font-weight: 500; margin-bottom: 2px; }
.client-meta { font-size: 12px; color: var(--muted); }
.client-stats { display: flex; gap: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.client-stat { font-size: 12px; color: var(--muted); }
.client-stat strong { display: block; font-size: 15px; color: var(--ink); font-weight: 500; }

/* Client detail panel */
.client-detail-overlay {
  position: fixed; inset: 0; background: rgba(26,24,20,0.4);
  backdrop-filter: blur(4px); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.client-detail-overlay.open { display: flex; }
.client-detail-panel {
  background: var(--card); border-radius: 0;
  width: min(780px, 100%); max-height: 88vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(26,24,20,0.2);
  animation: fadeUp 0.2s ease;
}
.cdp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
.cdp-body { padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.cdp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.cdp-tab { padding: 8px 16px; font-size: 13px; border: none; background: transparent; cursor: pointer; color: var(--muted); font-family: var(--sans); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; }
.cdp-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.close-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 6px 12px; cursor: pointer; font-size: 13px; font-family: var(--sans); }

/* ── Pending requests panel ── */
.tc-find-panel { background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 16px 20px; margin-bottom: 16px; }
.tc-find-row { display: flex; align-items: center; gap: 10px; }
.tc-find-icon { color: var(--muted); font-size: 15px; flex-shrink: 0; }
.tc-find-input { flex: 1; padding: 9px 13px; border: 1px solid var(--border); border-radius: 0; font-family: var(--sans); font-size: 13px; background: var(--surface); color: var(--ink); outline: none; }
.tc-find-input:focus { border-color: var(--accent); }
.tc-find-result-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 0; }
.tc-find-av { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-light); color: var(--accent); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-family: var(--sans); }
.tc-find-info { flex: 1; min-width: 0; }
.tc-find-name { font-size: 13px; font-weight: 500; font-family: var(--sans); }
.tc-find-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.pending-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0; box-shadow: 0 2px 16px var(--shadow);
  margin-bottom: 20px; overflow: hidden;
}
.pending-panel-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px 13px; border-bottom: 1px solid var(--border);
}
.pending-panel-icon {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent-light);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.pending-panel-title {
  font-size: 14px; font-weight: 600; font-family: var(--sans);
  letter-spacing: -0.01em; color: var(--ink); flex: 1;
}
.pending-panel-count {
  background: var(--accent); color: #fff; border-radius: 12px;
  padding: 2px 9px; font-size: 11px; font-weight: 600;
  font-family: var(--sans); flex-shrink: 0;
}
.pending-panel-list { display: flex; flex-direction: column; }
.pending-req-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px; border-bottom: 1px solid rgba(216,208,192,0.45);
  transition: background .12s;
}
.pending-req-row:last-child { border-bottom: none; }
.pending-req-row:hover { background: var(--surface); }
.pending-req-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-light); border: 1px solid rgba(61,90,128,.15);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 14px; flex-shrink: 0;
}
.pending-req-info { flex: 1; min-width: 0; }
.pending-req-name {
  font-size: 14px; font-weight: 500; color: var(--ink);
  line-height: 1.3; font-family: var(--sans);
}
.pending-req-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pending-req-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Clients master-detail layout ── */
.clients-layout { display: grid; grid-template-columns: 280px 1fr; gap: 0; align-items: stretch; border: 1px solid var(--border); border-radius: 0; overflow: hidden; box-shadow: 0 2px 16px var(--shadow); flex: 1; min-height: 0; }
.clients-left { background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.clients-left-header { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.clients-left-list { overflow-y: auto; flex: 1; }
.client-menu-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid rgba(216,208,192,0.4); transition: background .12s; border-left: 3px solid transparent; }
.client-menu-item:hover { background: var(--surface); }
.client-menu-item.active { background: var(--accent-light); border-left-color: var(--accent); }
.client-menu-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 13px; flex-shrink: 0; }
.client-menu-name { font-size: 13px; font-weight: 500; margin-bottom: 1px; }
.client-menu-meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 168px; }
/* min-height: 0 is essential — without it, this flex column's children
   (the messages thread in particular) can't trigger overflow scrolling.
   Classic flex+overflow trap: an unbounded parent collapses the inner
   overflow-y:auto into "grow the page instead of scroll the panel." */
.clients-right { background: var(--bg); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cdr-empty { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 400px; flex-direction: column; gap: 10px; }
.cdr-header { padding: 20px 24px; border-bottom: 1px solid var(--border); background: var(--card); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cdr-header-info { flex: 1; }
.cdr-tabs { display: flex; gap: 0; background: var(--card); border-bottom: 1px solid var(--border); padding: 0 24px; }
.cdr-tab { padding: 10px 14px; font-size: 13px; border: none; background: transparent; cursor: pointer; color: var(--muted); font-family: var(--sans); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s; white-space: nowrap; }
.cdr-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.cdr-body { padding: 24px; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cdr-body.messages-mode { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
@media (max-width: 900px) { .clients-layout { grid-template-columns: 1fr; } .clients-left { min-height: auto; max-height: 260px; } }

/* ── Session hub ── */
.launch-btn { background: var(--green); color: #fff; border: none; padding: 9px 18px; border-radius: 0; font-size: 13px; font-family: var(--sans); cursor: pointer; font-weight: 500; transition: opacity 0.15s; }
.launch-btn:hover { opacity: 0.85; }

/* ── Session detail screen ── */

/* ══════════════════════════════════════════════════════════════
   Sessions list — bars rendered inside .drv-cards.
   Mirrors the Clients drv-card pattern but adds a colored time-of-day
   rail on the left and inline title rename.
   ════════════════════════════════════════════════════════════ */
.ssn-group-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.ssn-group-header i { font-size: 13px; }
.ssn-empty-mini {
  padding: 24px 16px; font-size: 13px;
  color: var(--muted); text-align: center;
  background: var(--card); border: 1px dashed var(--border);
  border-radius: 0;
}
/* Wrap a bar + its (optional) inline AI dropdown so the dropdown
   sits below the bar in normal flow instead of squeezing into the
   bar's flex row. */
.ssn-bar-wrap { display: flex; flex-direction: column; }
.ssn-bar-ai-panel {
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  font-size: 13px;
  line-height: 1.6;
}

/* The session bar — a drv-card variant with a colored left rail
   that hints at the time of day (morning/afternoon/evening) and
   becomes accent-colored when the session is upcoming. */
.ssn-bar {
  display: flex; align-items: stretch; gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.12s;
  overflow: hidden;
}
.ssn-bar:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26,24,20,.06);
}
.ssn-bar-rail {
  flex-shrink: 0;
  width: 6px;
  background: var(--muted);
  transition: background 0.15s;
}
.ssn-bar[data-tod="morning"]   .ssn-bar-rail { background: #f5b85a; } /* warm amber */
.ssn-bar[data-tod="afternoon"] .ssn-bar-rail { background: #6ea8c6; } /* mid-blue */
.ssn-bar[data-tod="evening"]   .ssn-bar-rail { background: #7d6da7; } /* dusk-violet */
.ssn-bar[data-state="upcoming"] .ssn-bar-rail { background: var(--accent); }
.ssn-bar[data-state="live"]     .ssn-bar-rail { background: var(--green); }
.ssn-bar[data-state="upcoming"] { border-color: var(--accent); }
.ssn-bar-time {
  flex-shrink: 0;
  width: 110px;
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: center;
  gap: 2px;
}
.ssn-bar-time-primary {
  font-family: var(--serif); font-size: 18px;
  font-weight: 400; color: var(--ink);
  letter-spacing: -0.01em; line-height: 1.1;
}
.ssn-bar-time-secondary {
  font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
}
.ssn-bar-body {
  flex: 1; min-width: 0;
  padding: 16px 20px;
  display: flex; flex-direction: column; justify-content: center;
  gap: 5px;
}
.ssn-bar-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.01em;
  font-family: var(--sans);
  min-width: 0;
}
.ssn-bar-title-text {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.ssn-bar-rename-btn {
  background: none; border: none; padding: 4px;
  cursor: pointer; color: var(--muted);
  border-radius: 0; opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  font-size: 12px; line-height: 1; flex-shrink: 0;
}
.ssn-bar:hover .ssn-bar-rename-btn { opacity: 1; }
.ssn-bar-rename-btn:hover { color: var(--accent); }
.ssn-bar-rename-input {
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.01em;
  border: 1px solid var(--accent);
  background: var(--surface);
  padding: 3px 8px; border-radius: 0;
  width: 100%; max-width: 360px;
  box-sizing: border-box;
  outline: none;
}
.ssn-bar-meta {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  font-size: 12.5px; color: var(--muted);
}
.ssn-bar-meta i { font-size: 12px; opacity: 0.7; margin-right: 3px; }
.ssn-bar-meta .chip {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 0;
}
.ssn-bar-actions {
  flex-shrink: 0;
  padding: 16px 18px;
  display: flex; align-items: center; gap: 8px;
  border-left: 1px solid var(--border);
  background: var(--card);
}
.ssn-bar-arrow {
  font-size: 14px; color: var(--muted);
  opacity: 0.5; transition: transform 0.15s, opacity 0.15s, color 0.15s;
  margin-left: 4px;
}
.ssn-bar:hover .ssn-bar-arrow {
  opacity: 1; transform: translateX(2px); color: var(--accent);
}
@media (max-width: 760px) {
  .ssn-bar { flex-wrap: wrap; }
  .ssn-bar-time { width: 100%; border-right: none; border-bottom: 1px solid var(--border); padding: 10px 16px; flex-direction: row; gap: 12px; align-items: baseline; }
  .ssn-bar-actions { border-left: none; border-top: 1px solid var(--border); width: 100%; justify-content: flex-end; }
}
/* Detail view layout — scoped so the drv-shell's data-view="list" rule
   (which sets display:none) isn't out-specificity'd by this ID selector. */
.drv-shell[data-view="detail"] #sessionDetailView { display: flex; flex-direction: column; gap: 20px; }
.sds-header { display: flex; align-items: center; gap: 14px; padding-bottom: 4px; flex-wrap: wrap; }
.sds-body { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.sds-main { display: flex; flex-direction: column; gap: 20px; }
.sds-transcript { display: flex; flex-direction: column; gap: 10px; max-height: 380px; overflow-y: auto; padding-right: 6px; }
.sds-turn { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(216,208,192,0.35); }
.sds-turn:last-child { border-bottom: none; }
.sds-speaker { font-size: 11px; font-weight: 500; color: var(--accent); min-width: 88px; flex-shrink: 0; padding-top: 3px; letter-spacing: 0.02em; }
.sds-speaker.client { color: var(--green); }
.sds-line { font-size: 13px; line-height: 1.72; color: var(--ink); }
.sds-ai-sidebar { display: flex; flex-direction: column; gap: 12px; }
.sds-ai-block { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 14px 16px; }
.sds-ai-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 7px; }
.sds-ai-value { font-size: 13px; line-height: 1.65; color: var(--ink); }
.sds-mood-bar { height: 5px; background: var(--border); border-radius: 3px; margin: 8px 0 4px; overflow: hidden; }
.sds-mood-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--red) 0%, var(--amber) 45%, var(--green) 100%); }
@media (max-width: 900px) { .sds-body { grid-template-columns: 1fr; } }

/* ── Notes ── */
.notes-shell { display: flex; flex-direction: row; gap: 16px; flex: 1; min-height: 0; }
.notes-shell .notes-list-card { width: 240px; flex-shrink: 0; overflow-y: auto; min-height: 0; }
.notes-shell .note-editor-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#section-notes { gap: 12px; }
#section-notes .note-editor-card textarea { flex: 1; min-height: 0; resize: none; margin-top: 12px; }
.notes-list { display: flex; flex-direction: column; gap: 6px; }
.note-item {
  padding: 12px 14px; border-radius: 0;
  border: 1px solid var(--border); background: var(--card);
  cursor: pointer; transition: all 0.15s;
}
.note-item:hover, .note-item.active { border-color: var(--accent); background: var(--accent-light); }
.note-item .ni-client { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.note-item .ni-date { font-size: 11px; color: var(--muted); }
.note-item .ni-preview { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-editor { display: flex; flex-direction: column; gap: 12px; }
.note-editor textarea { min-height: 320px; font-size: 14px; font-family: var(--sans); line-height: 1.7; padding: 16px; }
.note-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }

/* ── Export menu (Past Sessions) ── */
.export-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 280px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(26,24,20,0.12); padding: 6px; display: none; }
.export-menu.open { display: block; }
.export-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; background: transparent; border: none; cursor: pointer; text-align: left; font-family: var(--sans); transition: background 0.12s; }
.export-menu-item:hover { background: var(--surface); }
.export-menu-item i { font-size: 18px; color: var(--muted); flex-shrink: 0; }
.export-menu-item .emi-title { font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.export-menu-item .emi-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.export-menu-tip { padding: 8px 12px; margin-top: 4px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); line-height: 1.5; }

/* ── Google Docs Tab ── */
.svt-tabs { display:flex; gap:4px; flex-shrink:0; border-bottom:1px solid var(--border); padding-bottom:0; margin-bottom:0; }
.svt-tab { padding:8px 18px; border-radius:var(--radius-sm) var(--radius-sm) 0 0; border:none; background:transparent; cursor:pointer; font-size:13px; font-family:var(--sans); color:var(--muted); display:flex; align-items:center; gap:6px; transition:all 0.15s; border-bottom:2px solid transparent; margin-bottom:-1px; }
.svt-tab:hover { color:var(--ink); background:var(--surface); }
.svt-tab.active { color:var(--accent); border-bottom-color:var(--accent); font-weight:500; }
.notes-tab-bar { display:flex; gap:4px; flex-shrink:0; border-bottom:1px solid var(--border); padding-bottom:12px; }
.notes-tab { padding:7px 16px; border-radius:var(--radius-sm); border:none; background:transparent; cursor:pointer; font-size:13px; font-family:var(--sans); color:var(--muted); display:flex; align-items:center; gap:6px; transition:all 0.15s; }
.notes-tab:hover { background:var(--surface); color:var(--ink); }
.notes-tab.active { background:var(--accent); color:#fff; }
#gdocsPanel { display:none; flex:1; min-height:0; gap:16px; }
#gdocsPanel.gdocs-active { display:flex; }
.gdocs-list-card { width:240px; flex-shrink:0; display:flex; flex-direction:column; min-height:0; padding:16px; }
.gdocs-embed-card { flex:1; display:flex; flex-direction:column; min-height:0; overflow:hidden; padding:0; }
.gdocs-embed-card iframe { flex:1; width:100%; border:none; min-height:0; display:block; }
.gdoc-item { padding:10px 12px; border-radius:var(--radius-sm); border:1px solid var(--border); background:var(--card); cursor:pointer; transition:all 0.15s; flex-shrink:0; }
.gdoc-item:hover, .gdoc-item.gdoc-active { border-color:var(--accent); background:var(--accent-light); }
.gdoc-item .gdi-name { font-size:13px; font-weight:500; margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gdoc-item .gdi-date { font-size:11px; color:var(--muted); }
.gdocs-center-state { display:flex; flex-direction:column; align-items:center; justify-content:center; flex:1; gap:16px; text-align:center; padding:32px; }
.gdocs-search { width:100%; padding:8px 10px; border-radius:var(--radius-sm); border:1px solid var(--border); font-size:12px; font-family:var(--sans); background:var(--surface); color:var(--ink); margin-bottom:8px; flex-shrink:0; box-sizing:border-box; }
.gdocs-search:focus { outline:none; border-color:var(--accent); }

/* ── Earnings ── */
.earnings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.earnings-chart { height: 160px; background: var(--surface); border-radius: 0; display: flex; align-items: flex-end; gap: 8px; padding: 16px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; border-radius: 4px 4px 0 0; background: var(--accent); transition: height 0.3s; }
.bar-label { font-size: 10px; color: var(--muted); }
.payout-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.payout-row:last-child { border-bottom: none; }
.payout-amount { font-weight: 500; color: var(--green); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 2px 12px var(--shadow); }
.stat-num { font-family: var(--serif); font-size: 30px; color: var(--ink); line-height: 1; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-delta { font-size: 12px; margin-top: 4px; }
.stat-delta.up { color: var(--green); }
.stat-delta.down { color: var(--red); }

/* ── Billing panel ── */
.billing-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 24px; gap: 0; }
.billing-tab { padding: 11px 16px; font-size: 13px; border: none; background: transparent; cursor: pointer; color: var(--muted); font-family: var(--sans); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; white-space: nowrap; }
.billing-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }
.inv-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.inv-row:last-child { border-bottom: none; }
.inv-meta { flex: 1; min-width: 160px; }
.inv-meta strong { font-size: 14px; display: block; margin-bottom: 2px; }
.inv-meta small { font-size: 12px; color: var(--muted); }
.inv-amount { font-size: 15px; font-weight: 500; min-width: 60px; text-align: right; }
.inv-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.rate-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rate-row:last-child { border-bottom: none; }
.rate-info { flex: 1; min-width: 160px; }
.rate-info strong { font-size: 14px; display: block; margin-bottom: 2px; }
.rate-info small { font-size: 12px; color: var(--muted); }
.rate-input-wrap { display: flex; align-items: center; gap: 8px; }
.rate-input-wrap input { width: 80px; text-align: center; }
.filter-pill { padding: 5px 13px; border-radius: 999px; border: 1px solid var(--border); background: transparent; font-size: 12px; cursor: pointer; font-family: var(--sans); color: var(--muted); transition: all .15s; }
.filter-pill.active, .filter-pill:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.billing-empty { padding: 40px 0; text-align: center; color: var(--muted); font-size: 13px; }
.pm-card { background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 15px 20px; display: flex; align-items: center; gap: 14px; }
.pm-logo { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; font-weight: 800; letter-spacing: -1px; }
.pm-paypal { background: #e7f0fc; color: #003087; }
.pm-venmo  { background: #e5f6fb; color: #008cff; }
.pm-zelle  { background: #ede9f8; color: #6d1ed4; }
.pm-input  { font-size: 12px; margin-top: 5px; width: 210px; padding: 6px 10px; }
.pm-filter-btn { font-size: 11px; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.pm-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pm-filter-btn:hover:not(.active) { background: var(--surface); color: var(--ink); }

/* ── Transaction detail modal ── */
#txDetailOverlay { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
#txDetailCard { background: var(--card); border-radius: 0; padding: 28px 32px; max-width: 460px; width: 100%; box-shadow: 0 24px 80px rgba(0,0,0,.22); animation: txSlideUp .2s ease; }
@keyframes txSlideUp { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.txd-masked { display: inline-flex; align-items: center; gap: 5px; font-family: monospace; letter-spacing: 2px; font-size: 13px; }
.txd-masked-text { color: var(--ink); }
.txd-reveal-btn { background: none; border: none; cursor: pointer; color: var(--muted); padding: 0; font-size: 13px; line-height: 1; transition: color .15s; flex-shrink: 0; }
.txd-reveal-btn:hover { color: var(--accent); }
.ph-row { cursor: pointer; transition: background .12s; }
.ph-row:hover { background: var(--surface); }

/* ── Toast ── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 0; font-size: 13px; font-family: var(--sans); box-shadow: 0 4px 20px rgba(26,24,20,0.2); transform: translateY(80px); opacity: 0; transition: all 0.3s; z-index: 999; }
.toast.show { transform: translateY(0); opacity: 1; }

/* ── Prescriptions Hub page ── */
.rxhub-layout { display: grid; grid-template-columns: 320px 1fr; gap: 0; align-items: stretch; border: 1px solid var(--border); border-radius: 0; overflow: hidden; box-shadow: 0 2px 16px var(--shadow); flex: 1; min-height: 0; }
.rxhub-left { background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.rxhub-left-header { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.rxhub-filters { display: flex; gap: 5px; flex-wrap: wrap; }
.rxhub-filter-btn { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); background: transparent; font-size: 11px; cursor: pointer; font-family: var(--sans); color: var(--muted); transition: all .15s; white-space: nowrap; }
.rxhub-filter-btn.active, .rxhub-filter-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.rxhub-filter-btn.amber.active { background: var(--amber); border-color: var(--amber); }
.rxhub-filter-btn.red.active { background: var(--red); border-color: var(--red); }
.rxhub-list { overflow-y: auto; flex: 1; }
.rxhub-item { display: flex; flex-direction: column; gap: 7px; padding: 13px 14px; border-bottom: 1px solid rgba(216,208,192,0.4); cursor: pointer; transition: background .12s; border-left: 3px solid transparent; }
.rxhub-item:hover { background: var(--surface); }
.rxhub-item.active { background: var(--accent-light); border-left-color: var(--accent); }
.rxhub-item.expiring { border-left-color: var(--amber); }
.rxhub-item.expiring.active { background: #fff9ed; }
.rxhub-item-top { display: flex; align-items: center; gap: 9px; }
.rxhub-client-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 12px; flex-shrink: 0; }
.rxhub-med-name { font-size: 13px; font-weight: 600; font-family: var(--sans); letter-spacing: -0.01em; line-height: 1.3; color: var(--ink); flex: 1; min-width: 0; }
.rxhub-client-name { font-size: 11px; color: var(--muted); }
/* Refill progress bar */
.rx-progress-wrap { display: flex; flex-direction: column; gap: 4px; }
.rx-progress-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.rx-progress-fill { height: 100%; border-radius: 3px; transition: width .3s; }
.rx-progress-fill.green  { background: var(--green); }
.rx-progress-fill.amber  { background: var(--amber); }
.rx-progress-fill.red    { background: var(--red); }
.rx-progress-meta { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
/* Right detail panel */
.rxhub-right { background: var(--bg); display: flex; flex-direction: column; }
.rxhub-right-empty { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 400px; flex-direction: column; gap: 10px; color: var(--muted); }
.rxhub-detail-header { padding: 20px 24px; border-bottom: 1px solid var(--border); background: var(--card); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rxhub-detail-body { padding: 24px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.rx-timeline { display: flex; flex-direction: column; gap: 0; }
.rx-tl-item { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(216,208,192,0.35); font-size: 13px; }
.rx-tl-item:last-child { border-bottom: none; }
.rx-tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 4px; }
.rx-tl-dot.green { background: var(--green); }
.rx-tl-dot.amber { background: var(--amber); }
.rx-tl-dot.red { background: var(--red); }
@media (max-width: 900px) { .rxhub-layout { grid-template-columns: 1fr; } .rxhub-left { min-height: auto; max-height: 280px; } }

/* ═══ Prescription system ═══ */
.rx-card { background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 16px 18px; margin-bottom: 10px; transition: border-color .15s, box-shadow .15s; }
.rx-card:last-child { margin-bottom: 0; }
.rx-card:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(61,90,128,0.08); }
.rx-card.rx-expired { opacity: .6; }
.rx-card.rx-cancelled { opacity: .5; }
.rx-row1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rx-name { font-size: 13px; font-weight: 600; font-family: var(--sans); letter-spacing: -0.01em; line-height: 1.3; color: var(--ink); }
.rx-brand { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rx-pills { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 12px; margin: 10px 0; }
.rx-pill-item strong { display: block; font-size: 13px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.rx-pill-item span { color: var(--muted); }
.rx-foot { display: flex; gap: 6px; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.rx-refill-banner { background: var(--amber-light); border: 1px solid rgba(181,98,10,.2); border-radius: 0; padding: 11px 14px; margin-bottom: 10px; display: flex; align-items: flex-start; gap: 12px; font-size: 13px; }
.rx-refill-banner i { color: var(--amber); flex-shrink: 0; margin-top: 1px; font-size: 15px; }
.rx-refill-banner .rb-info { flex: 1; }
.rx-refill-banner .rb-info strong { display: block; font-weight: 600; margin-bottom: 2px; }
.rx-refill-banner .rb-info small { color: var(--muted); font-size: 11px; }
.rx-interact-warn { background: var(--red-light); border: 1px solid rgba(184,50,50,.2); border-radius: 0; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.6; }
.fda-drug-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .12s; }
.fda-drug-item:last-child { border-bottom: none; }
.fda-drug-item:hover { background: var(--surface); }
.rx-interact-warn strong { display: block; color: var(--red); font-weight: 600; margin-bottom: 3px; }
.rx-filter-row { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
/* Write-Rx modal */
.rx-overlay { position: fixed; inset: 0; background: rgba(26,24,20,.46); backdrop-filter: blur(4px); z-index: 400; display: none; align-items: center; justify-content: center; padding: 24px; }
.rx-overlay.open { display: flex; }
.rx-modal { background: var(--card); border-radius: 0; width: min(580px,100%); max-height: 91vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(26,24,20,.22); animation: fadeUp .2s ease; }
.rx-modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 1; }
.rx-modal-hd h3 { font-size: 18px; }
.rx-modal-bd { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.rx-modal-ft { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }
.rx-block-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 10px; display: block; }
/* Clinician identity verification */
.rx-verify-box { background: var(--surface); border: 1.5px solid var(--border); border-radius: 0; padding: 16px 18px; transition: border-color .2s, background .2s; }
.rx-verify-box.unlocked { border-color: var(--green); background: var(--green-light); }
.rx-verify-box h4 { font-size: 13px; font-weight: 600; font-family: var(--sans); letter-spacing: -.01em; display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.rx-verify-box p { font-size: 12px; color: var(--muted); margin-bottom: 12px; line-height: 1.55; }
.rx-verify-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rx-unlock-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.rx-lock-icon { font-size: 16px; color: var(--muted); }
.rx-unlock-icon { font-size: 16px; color: var(--green); }

/* ════════════════════════════════════════════════════
   ── Assignments Section ──
   ════════════════════════════════════════════════════ */
.asgn-shell { display: grid; grid-template-columns: 320px 1fr; gap: 0; flex: 1; min-height: 0; border: 1px solid var(--border); border-radius: 0; overflow: hidden; background: var(--card); }
.asgn-left { border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); }
.asgn-left-head { padding: 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.asgn-left-head h3 { font-size: 15px; font-weight: 600; font-family: var(--sans); letter-spacing: -0.01em; }
.asgn-new-btn { width: 100%; background: var(--ink); color: #fff; border: none; border-radius: 0; padding: 10px; font-size: 13px; font-family: var(--sans); font-weight: 500; cursor: pointer; transition: opacity 0.2s; }
.asgn-new-btn:hover { opacity: 0.8; }
.asgn-client-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.asgn-client-tab { font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: transparent; cursor: pointer; font-family: var(--sans); color: var(--muted); transition: all 0.15s; }
.asgn-client-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.asgn-list { flex: 1; overflow-y: auto; padding: 8px; }
.asgn-item { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 0; cursor: pointer; border: 1px solid transparent; margin-bottom: 4px; transition: all 0.15s; border-left: 3px solid transparent; user-select: none; }
.asgn-item:hover { background: var(--card); border-color: var(--border); border-left-color: var(--border); }
.asgn-item.active { background: var(--card); border-color: var(--accent); border-left-color: var(--accent); }
.asgn-item.dragging { opacity: 0.4; }
.asgn-item.drag-over { border-top: 2px solid var(--accent); }
.asgn-drag-handle { color: var(--muted); font-size: 14px; cursor: grab; flex-shrink: 0; }
.asgn-item-info { flex: 1; min-width: 0; }
.asgn-item-title { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asgn-item-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.asgn-right { display: flex; flex-direction: column; overflow: hidden; }
.asgn-empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); text-align: center; padding: 40px; }
.asgn-empty-state i { font-size: 36px; opacity: 0.35; }
.asgn-detail { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.asgn-detail-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.asgn-detail-title { font-size: 18px; font-weight: 600; font-family: var(--sans); letter-spacing: -0.01em; margin-bottom: 4px; }
.asgn-detail-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.asgn-detail-body { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.asgn-desc { font-size: 14px; color: var(--ink); line-height: 1.6; white-space: pre-wrap; }
.asgn-submissions-head { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.asgn-sub-card { border: 1px solid var(--border); border-radius: 0; padding: 12px 14px; background: var(--surface); margin-bottom: 8px; }
.asgn-sub-num { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.asgn-sub-notes { font-size: 13px; color: var(--ink); line-height: 1.55; margin-bottom: 6px; white-space: pre-wrap; }
.asgn-sub-file { font-size: 12px; color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.asgn-sub-file:hover { text-decoration: underline; }
.asgn-sub-time { font-size: 11px; color: var(--muted); margin-top: 6px; }
.asgn-feedback-area { border-top: 1px solid var(--border); padding: 16px 24px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; }
.asgn-feedback-area label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.asgn-feedback-area textarea { min-height: 80px; resize: vertical; font-size: 13px; }
.asgn-feedback-row { display: flex; justify-content: flex-end; }
/* Create / Batch-assign form */
.asgn-form-overlay { position: fixed; inset: 0; background: rgba(26,24,20,.45); z-index: 3000; display: flex; align-items: center; justify-content: center; }
.asgn-form-modal { background: var(--card); border-radius: 0; padding: 28px 32px; width: 520px; max-width: 95vw; box-shadow: 0 16px 48px rgba(26,24,20,.18); display: flex; flex-direction: column; gap: 18px; }
.asgn-form-modal h3 { font-size: 18px; font-weight: 600; font-family: var(--sans); letter-spacing: -0.01em; }
.asgn-client-checks { display: flex; flex-direction: column; gap: 6px; max-height: 160px; overflow-y: auto; border: 1px solid var(--border); border-radius: 0; padding: 10px 12px; background: var(--surface); }
.asgn-client-check { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.asgn-client-check input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; flex-shrink: 0; }
.asgn-remind-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.asgn-remind-row input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }
.asgn-form-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ── Assignments v2 (drill-in, page-locked) ──────────────────────
   Replaces the old two-pane master-detail with a drill-in layout.
   Page locks: only the inner list OR detail scrolls, never both,
   never the section underneath. One scroll context per view.

   Specificity: `.hub-main .drv-*` keeps these rules above the
   generic class selectors so the section padding/min-height
   from the section-bottom-padding block doesn't fight us. */

/* Section reset — the hero is replaced by the compact header bar
   inside the shell, so wipe section padding/gap and let the shell
   own the whole working area. Applies to every drill-view section. */
#section-assignments.drv-active.active,
#section-clients.drv-active.active,
#section-notes.drv-active.active,
#section-sessions.drv-active.active {
  flex: 1 !important;
  min-height: 0 !important;
  padding: 0 !important;
  padding-bottom: 0 !important;
  gap: 0 !important;
  overflow: hidden;
}
/* When in drill-view mode, the hub-main bottom spacer would push our
   shell up and create a scroll. Suppress it. */
.hub-main:has(#section-assignments.drv-active.active)::after,
.hub-main:has(#section-clients.drv-active.active)::after,
.hub-main:has(#section-notes.drv-active.active)::after,
.hub-main:has(#section-sessions.drv-active.active)::after { display: none; }

.drv-shell {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
}

/* Compact header bar — replaces the 3-line section hero.
   Single row. Left side shows context-specific content
   (list breadcrumb OR back button + assignment title).
   Right side shows actions. */
.drv-header {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 32px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}
.drv-header-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 500; }
.drv-header-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); font-family: var(--sans); }
.drv-header-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.drv-header-titlewrap { min-width: 0; flex-shrink: 1; }
.drv-header-spacer { flex: 1; }
.drv-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.drv-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 0;
  font-size: 12.5px; color: var(--muted);
  border: 1px solid var(--border); background: var(--card);
  cursor: pointer; font-family: var(--sans);
  flex-shrink: 0;
}
.drv-back-btn:hover { color: var(--ink); background: var(--surface); border-color: var(--accent); }
.drv-back-btn i { font-size: 13px; }

/* List view filter strip (chips + search). Sits on the second
   row of the header in list view, hidden in detail view. */
.drv-toolbar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 32px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.drv-toolbar input[type="text"] {
  font-size: 12.5px; padding: 7px 12px;
  border: 1px solid var(--border); border-radius: 0;
  background: var(--surface); color: var(--ink);
  font-family: var(--sans);
  max-width: 280px; flex: 1;
}
.drv-toolbar input[type="text"]:focus { border-color: var(--accent); outline: none; }
.drv-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* The body is a single scroll container. Whichever view is active
   uses the full body. Page never scrolls. */
.drv-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  background: var(--bg);
}

/* Views — only one is shown at a time. Display toggling preserves
   list scroll position when returning from detail. */
.drv-shell[data-view="list"]   .drv-detail-view,
.drv-shell[data-view="list"]   .drv-detail-toolbar,
.drv-shell[data-view="detail"] .drv-list-view,
.drv-shell[data-view="detail"] .drv-toolbar { display: none; }
.drv-shell[data-view="detail"] .drv-back-btn { display: inline-flex; }
.drv-shell[data-view="list"]   .drv-back-btn { display: none; }

/* Notes-only third state: Google Docs panel. The gdocsPanel lives
   inside .drv-body alongside the list/detail views. Position it
   absolutely so it occupies the same coordinate space and can be
   toggled cleanly without fighting the absolute-positioned views.
   When `data-view="gdocs"`, both drv views + back button hide and
   the gdocs panel takes the full body. */
#notesShellV2 #gdocsPanel {
  position: absolute; inset: 0;
  display: none;
  flex-direction: row;
  gap: 16px;
  overflow: hidden;
  padding: 24px 32px 40px;
  box-sizing: border-box;
}
/* display:flex (not block) so .gdocs-list-card + .gdocs-embed-card
   lay out side-by-side. The earlier `display:block` rule meant the
   inner cards stacked vertically and the iframe collapsed to 0px. */
#notesShellV2[data-view="gdocs"] #gdocsPanel { display: flex; }
#notesShellV2[data-view="gdocs"] .drv-list-view,
#notesShellV2[data-view="gdocs"] .drv-detail-view,
#notesShellV2[data-view="gdocs"] .drv-back-btn { display: none !important; }

/* .drv-body needs a positioning context so the absolute children
   ground themselves to the body, not to hub-main. */
.drv-body { position: relative; }

/* List view content — full-width cards. */
.drv-list-view { padding: 24px 32px 56px; }
.drv-cards { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.drv-card {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.12s;
}
.drv-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26,24,20,.06);
}
.drv-card.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--card));
}
.drv-card-body { flex: 1; min-width: 0; }
.drv-card-title { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 4px; font-family: var(--sans); }
.drv-card-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.drv-card-meta i { font-size: 12px; opacity: 0.6; margin-right: 3px; }
.drv-card-desc { font-size: 13px; color: var(--muted); line-height: 1.55; margin-top: 10px; }
.drv-card-status { flex-shrink: 0; }
.drv-card-arrow { font-size: 14px; color: var(--muted); opacity: 0.5; flex-shrink: 0; transition: transform 0.15s, opacity 0.15s; }
.drv-card:hover .drv-card-arrow { opacity: 1; transform: translateX(2px); color: var(--accent); }

.drv-empty {
  max-width: 480px; margin: 40px auto;
  padding: 48px 32px; text-align: center;
  background: var(--card); border: 1px dashed var(--border);
  border-radius: 0;
}
.drv-empty i { font-size: 36px; opacity: 0.35; display: block; margin-bottom: 12px; }
.drv-empty p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* Detail view content — full-width, single continuous column. */
.drv-detail-view { padding: 28px 32px 56px; }
.drv-detail-wrap { max-width: 920px; }
/* Fill-height treatment for client detail view: lock drv-body overflow
   and grow the flex chain so the tab panel uses the full available area. */
#clientsShellV2[data-view="detail"] .drv-body { overflow: hidden; }
#clientsShellV2[data-view="detail"] .drv-detail-view {
  height: 100%; box-sizing: border-box; padding: 24px 32px; display: flex; flex-direction: column;
}
#clientsShellV2[data-view="detail"] .drv-detail-wrap {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
}
/* Assignments detail: fill the full vertical space; the feedback area
   grows to take the slack so the page never looks half-empty. */
#asgnShellV2[data-view="detail"] .drv-body { overflow: hidden; }
#asgnShellV2[data-view="detail"] .drv-detail-view { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
#asgnShellV2[data-view="detail"] #asgnRight { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
#asgnShellV2[data-view="detail"] .drv-feedback-block { flex: 1 0 auto; display: flex; flex-direction: column; min-height: 200px; }
#asgnShellV2[data-view="detail"] .drv-feedback-block textarea { flex: 1; min-height: 120px; }
.drv-detail-meta {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  font-size: 13px; color: var(--muted);
  margin-bottom: 22px;
}
.drv-detail-meta i { opacity: 0.6; margin-right: 4px; }
.drv-detail-desc {
  font-size: 14.5px; color: var(--ink); line-height: 1.7;
  white-space: pre-wrap; margin-bottom: 28px;
}
.drv-section-head {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  margin: 0 0 12px;
}
.drv-sub-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0; padding: 16px 18px;
  margin-bottom: 10px;
}
.drv-sub-num { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.drv-sub-notes { font-size: 13px; color: var(--ink); line-height: 1.55; margin-bottom: 8px; white-space: pre-wrap; }
.drv-sub-time { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.drv-feedback-block {
  margin-top: 32px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.drv-feedback-block label { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.drv-feedback-block textarea {
  width: 100%; box-sizing: border-box;
  min-height: 110px; resize: vertical;
  padding: 12px 14px; font-size: 13.5px;
  border: 1px solid var(--border); border-radius: 0;
  background: var(--card); color: var(--ink);
  font-family: var(--sans); line-height: 1.55;
}
.drv-feedback-block textarea:focus { border-color: var(--accent); outline: none; }
.drv-feedback-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ════════════════════════════════════════════════════
   ── Therapist Journal Section ──
   ════════════════════════════════════════════════════ */
#section-journal { gap: 0; overflow: hidden; }
#section-journal .tj-tab-bar {
  display: flex; gap: 12px; flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 0 var(--radius-lg) 0 0;
  padding: 10px 20px;
  background: var(--card);
}
#section-journal .tj-tab { padding: 9px 18px; border-radius: 0; border: none; background: transparent; cursor: pointer; font-size: 13px; font-family: var(--sans); color: var(--muted); display: flex; align-items: center; gap: 6px; transition: all 0.15s; }
#section-journal .tj-tab:hover { background: var(--surface); color: var(--ink); }
#section-journal .tj-tab.active { background: var(--accent); color: #fff; }
#section-journal .tj-journal-app { display: grid; grid-template-columns: 290px 1fr 360px; grid-template-rows: 1fr; gap: 0; flex: 1 1 0; min-height: 0; overflow: hidden; border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--card); }
#section-journal .tj-sidebar { border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); }
#section-journal .tj-sidebar-head { padding: 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
#section-journal .tj-sidebar-head h3 { font-size: 15px; margin-bottom: 10px; font-weight: 600; letter-spacing: -0.01em; font-family: var(--sans); }
#section-journal .tj-new-btn { width: 100%; background: var(--ink); color: #fff; border: none; border-radius: 0; padding: 10px; font-size: 13px; font-family: var(--sans); font-weight: 500; cursor: pointer; transition: opacity 0.2s; }
#section-journal .tj-new-btn:hover { opacity: 0.8; }
#section-journal .tj-filters { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
#section-journal .tj-filters input { padding: 7px 10px; font-size: 12px; }
#section-journal .tj-entry-list { flex: 1; overflow-y: auto; padding: 8px; }
#section-journal .tj-entry-item { position: relative; padding: 11px 32px 11px 13px; border-radius: 0; cursor: pointer; border: 1px solid transparent; margin-bottom: 4px; transition: all 0.15s; border-left: 3px solid transparent; }
#section-journal .tj-entry-item:hover { background: var(--card); border-color: var(--border); border-left-color: var(--border); }
#section-journal .tj-entry-item.active { background: var(--card); border-color: var(--accent); border-left-color: var(--accent); }
#section-journal .tj-entry-date { font-size: 10px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.07em; }
#section-journal .tj-entry-preview { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
#section-journal .tj-entry-meta { font-size: 10px; color: var(--muted); }
#section-journal .tj-entry-actions { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); opacity: 0; pointer-events: none; transition: opacity 0.15s; }
#section-journal .tj-entry-item:hover .tj-entry-actions,
#section-journal .tj-entry-item.active .tj-entry-actions,
#section-journal .tj-entry-item.menu-open .tj-entry-actions { opacity: 1; pointer-events: auto; }
#section-journal .tj-menu-btn { background: none; border: none; cursor: pointer; width: 22px; height: 22px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--muted); padding: 0; }
#section-journal .tj-menu-btn:hover { background: var(--surface); color: var(--ink); }
#section-journal .tj-no-entries { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 12px; line-height: 1.8; }
#section-journal .tj-editor-area { display: flex; flex-direction: column; overflow: hidden; background: var(--card); }
#section-journal .tj-editor-toolbar { padding: 14px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 12px; flex-wrap: wrap; }
#section-journal .tj-editor-meta { display: flex; align-items: center; gap: 12px; flex: 1; }
#section-journal .tj-subject-input { background: transparent; border: none; border-bottom: 1px solid var(--border); border-radius: 0; padding: 6px 2px; font-size: 15px; font-weight: 500; color: var(--ink); width: 200px; }
#section-journal .tj-subject-input:focus { border-color: var(--accent); background: transparent; }
#section-journal .tj-date-label { font-size: 12px; color: var(--muted); }
#section-journal .tj-editor-actions { display: flex; align-items: center; gap: 8px; }
#section-journal .tj-btn-save { background: var(--green); color: #fff; border: none; border-radius: 0; padding: 8px 16px; font-size: 13px; font-family: var(--sans); font-weight: 500; cursor: pointer; transition: opacity 0.2s; }
#section-journal .tj-btn-save:hover { opacity: 0.85; }
#section-journal .tj-btn-del { background: none; color: var(--muted); border: 1px solid var(--border); border-radius: 0; padding: 8px 12px; font-size: 13px; font-family: var(--sans); cursor: pointer; transition: all 0.15s; }
#section-journal .tj-btn-del:hover { color: var(--red); border-color: var(--red); }
#section-journal .tj-btn-dictate { background: none; color: var(--muted); border: 1px solid var(--border); border-radius: 0; width: 38px; height: 38px; padding: 0; font-size: 16px; line-height: 1; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
#section-journal .tj-btn-dictate:hover { color: var(--ink); border-color: var(--ink); }
#section-journal .tj-btn-dictate.recording { color: #fff; background: #e05050; border-color: #e05050; animation: tjDictPulse 1.5s infinite; }
#section-journal .tj-btn-dictate.recording:hover { background: #c0392b; border-color: #c0392b; }
#section-journal .tj-btn-dictate .tj-dictate-label { font-size: 11px; font-family: var(--sans); font-weight: 500; }
@keyframes tjDictPulse { 0%,100%{opacity:1} 50%{opacity:0.7} }
#section-journal .tj-saved-flash { font-size: 11px; color: var(--green); opacity: 0; transition: opacity 0.3s; }
#section-journal .tj-saved-flash.show { opacity: 1; }
#section-journal .tj-editor-scroll { flex: 1; min-height: 0; overflow: hidden; padding: 28px 40px 20px; display: flex; flex-direction: column; background: var(--card); }
#section-journal .tj-empty-editor { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; color: var(--muted); gap: 10px; }
#section-journal .tj-empty-editor .icon { font-size: 40px; }
#section-journal .tj-empty-editor h3 { color: var(--ink); font-size: 22px; font-family: var(--serif); font-weight: 400; }
#section-journal .tj-empty-editor p { font-size: 13px; line-height: 1.7; max-width: 300px; }
#section-journal .tj-prompt-banner { background: var(--purple-light); border: 1px solid rgba(91,63,166,.2); border-radius: 0; padding: 14px 18px; margin-bottom: 18px; display: none; flex-shrink: 0; }
#section-journal .tj-prompt-banner.visible { display: flex; flex-direction: column; }
#section-journal .tj-prompt-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--purple); margin-bottom: 6px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; }
#section-journal .tj-prompt-label .tj-prompt-dismiss { background: none; border: none; cursor: pointer; color: var(--purple); font-size: 13px; padding: 0; line-height: 1; opacity: 0.6; }
#section-journal .tj-prompt-label .tj-prompt-dismiss:hover { opacity: 1; }
#section-journal .tj-prompt-text { font-family: var(--sans); font-size: 14px; line-height: 1.6; color: var(--ink); border: none; background: transparent; resize: none; outline: none; width: 100%; min-height: 28px; padding: 0; }
#section-journal .tj-prompt-text::placeholder { color: rgba(91,63,166,.4); font-style: italic; }
#section-journal .tj-prompt-save-btn { background: none; border: none; cursor: pointer; color: var(--purple); font-size: 11px; font-weight: 600; font-family: var(--sans); padding: 2px 8px; letter-spacing: 0.02em; opacity: 0.8; transition: opacity 0.15s; }
#section-journal .tj-prompt-save-btn:hover { opacity: 1; }
#section-journal .tj-prompt-saved-actions { display: flex; align-items: center; gap: 6px; }
#section-journal .tj-prompt-edit-btn { background: none; border: none; cursor: pointer; color: var(--purple); font-size: 11px; font-weight: 500; font-family: var(--sans); padding: 2px 6px; opacity: 0.6; transition: opacity 0.15s; }
#section-journal .tj-prompt-edit-btn:hover { opacity: 1; }
#section-journal .tj-prompt-saved-text { font-family: var(--serif); font-size: 15px; line-height: 1.6; color: var(--ink); margin: 0; font-style: italic; }
#section-journal .tj-prompt-toggle { background: none; border: 1px dashed rgba(91,63,166,.25); border-radius: 0; padding: 6px 12px; font-size: 12px; color: var(--purple); cursor: pointer; font-family: var(--sans); margin-bottom: 10px; display: none; transition: background 0.15s; }
#section-journal .tj-prompt-toggle:hover { background: rgba(91,63,166,.06); }
#section-journal .tj-prompt-toggle.visible { display: inline-flex; align-items: center; gap: 5px; }
#section-journal .tj-editor-highlight-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#section-journal .tj-editor-highlight-layer { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; overflow-y: auto; white-space: pre-wrap; word-wrap: break-word; font-family: var(--sans); font-size: 16px; line-height: 1.85; color: transparent; padding: 0; margin: 0; border: none; z-index: 0; }
#section-journal .tj-editor-highlight-layer mark { background: rgba(255, 213, 79, 0.35); color: transparent; border-radius: 2px; cursor: pointer; pointer-events: auto; position: relative; }
#section-journal .tj-editor-highlight-layer mark:hover { background: rgba(255, 213, 79, 0.6); }
#section-journal .tj-editor-highlight-layer mark.active { background: rgba(255, 183, 0, 0.5); }
#section-journal #tjJournalEditor { position: relative; width: 100%; height: 100%; min-height: 0; overflow-y: auto; background: transparent; border: none; border-radius: 0; padding: 0; font-family: var(--sans); font-size: 16px; line-height: 1.85; color: var(--ink); resize: none; outline: none; display: block; z-index: 1; box-sizing: border-box; }
#section-journal #tjJournalEditor::placeholder { color: #b8af9e; }
#section-journal .tj-word-counter { font-size: 11px; color: var(--muted); margin-top: 10px; text-align: right; opacity: 0.6; flex-shrink: 0; }
#section-journal .tj-linked-entries-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
#section-journal .tj-linked-entry-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-family: var(--sans); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; cursor: pointer; color: var(--muted); transition: all 0.15s; text-decoration: none; }
#section-journal .tj-linked-entry-chip:hover { border-color: var(--accent); color: var(--accent); }
#section-journal .tj-linked-entry-chip .bi { font-size: 10px; }
#section-journal .tj-link-add-btn { background: none; border: 1px dashed var(--border); border-radius: 999px; padding: 3px 10px; font-size: 11px; color: var(--muted); cursor: pointer; font-family: var(--sans); transition: all 0.15s; }
#section-journal .tj-link-add-btn:hover { border-color: var(--accent); color: var(--accent); }
#section-journal .tj-jnote-quote-preview { background: var(--surface); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 7px 10px; font-size: 11px; color: var(--muted); font-style: italic; margin-bottom: 7px; line-height: 1.5; }
#section-journal .tj-jnote-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 10px 11px; margin-bottom: 8px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
#section-journal .tj-jnote-card:hover { border-color: var(--accent); }
#section-journal .tj-jnote-card.highlight-active { border-color: #d69e2e; background: rgba(255, 213, 79, 0.08); }
#section-journal .tj-jnote-quote { font-size: 11px; color: var(--muted); font-style: italic; margin-bottom: 5px; padding-bottom: 5px; border-bottom: 1px solid var(--border); line-height: 1.5; }
#section-journal .tj-jnote-text { font-size: 12px; line-height: 1.6; color: var(--ink); }
#section-journal .tj-jnote-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
#section-journal .tj-jnote-time { font-size: 10px; color: var(--muted); }
#section-journal .tj-jnote-del { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 11px; padding: 2px 4px; border-radius: 4px; }
#section-journal .tj-jnote-del:hover { color: #c0392b; background: rgba(192,57,43,0.08); }
#section-journal .tj-analysis-panel { border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; background: var(--card); }
#section-journal .tj-panel-head { padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
#section-journal .tj-panel-head h3 { font-size: 16px; margin-bottom: 14px; font-weight: 600; letter-spacing: -0.01em; font-family: var(--sans); }
#section-journal .tj-entry-info { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 10px 12px; margin-bottom: 10px; }
#section-journal .tj-entry-info .aei-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 2px 0; }
#section-journal .tj-entry-info .aei-date { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
#section-journal .tj-entry-info .aei-subject { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
#section-journal .tj-entry-info .aei-words { font-size: 11px; color: var(--muted); }
#section-journal .tj-analyze-btn { width: 100%; background: var(--accent); color: #fff; border: none; border-radius: 0; padding: 11px; font-size: 13px; font-family: var(--sans); font-weight: 500; cursor: pointer; transition: opacity 0.2s; }
#section-journal .tj-analyze-btn:hover { opacity: 0.85; }
#section-journal .tj-analyze-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#section-journal .tj-panel-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
#section-journal .tj-panel-tab { flex: 1; padding: 11px 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; text-align: center; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; transition: all 0.15s; font-family: var(--sans); }
#section-journal .tj-panel-tab.active { color: var(--ink); border-bottom-color: var(--ink); }
#section-journal .tj-panel-body { flex: 1; overflow-y: auto; padding: 14px; }
#section-journal .tj-tab-section { display: none; }
#section-journal .tj-tab-section.active { display: block; }
#section-journal .tj-empty-panel { text-align: center; padding: 32px 12px; color: var(--muted); font-size: 12px; line-height: 1.8; }
#section-journal .tj-empty-panel .ei { font-size: 26px; margin-bottom: 8px; }
#section-journal .tj-cached-banner { background: var(--accent-light); border: 1px solid rgba(61,90,128,0.2); border-radius: 0; padding: 8px 12px; margin-bottom: 12px; font-size: 11px; color: var(--accent); line-height: 1.5; }
#section-journal .tj-analysis-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 12px 14px; margin-bottom: 10px; animation: fadeUp 0.3s ease; }
#section-journal .tj-badge { display: inline-block; font-size: 10px; padding: 2px 9px; border-radius: 999px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 7px; }
#section-journal .tj-badge-warning  { background: var(--amber-light);  color: var(--amber); }
#section-journal .tj-badge-insight  { background: var(--accent-light); color: var(--accent); }
#section-journal .tj-badge-positive { background: var(--green-light);  color: var(--green); }
#section-journal .tj-badge-pattern  { background: var(--purple-light); color: var(--purple); }
#section-journal .tj-card-quote { font-size: 12px; color: var(--muted); font-style: italic; padding-left: 9px; border-left: 2px solid var(--border); margin-bottom: 7px; line-height: 1.5; }
#section-journal .tj-card-text { font-size: 12px; line-height: 1.6; color: var(--ink); }
#section-journal .tj-card-freq { font-size: 10px; color: var(--purple); margin-top: 5px; }
#section-journal .tj-score-item { margin-bottom: 14px; }
#section-journal .tj-score-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
#section-journal .tj-score-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
#section-journal .tj-score-fill { height: 100%; border-radius: 3px; transition: width 1s ease; width: 0%; }
#section-journal .tj-summary-box { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 12px; margin-top: 14px; font-size: 12px; line-height: 1.7; }
#section-journal .tj-summary-box strong { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
#section-journal .tj-prompt-card { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; transition: all 0.15s; }
#section-journal .tj-prompt-card:hover { border-color: var(--purple); background: var(--purple-light); }
#section-journal .tj-prompt-num { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--purple); margin-bottom: 5px; font-weight: 500; }
#section-journal .tj-prompt-q { font-family: var(--serif); font-size: 14px; line-height: 1.5; font-style: italic; color: var(--ink); }
#section-journal .tj-prompt-why { font-size: 11px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
#section-journal .tj-use-hint { font-size: 10px; color: var(--purple); margin-top: 6px; text-align: right; }
#section-journal .tj-gdocs-panel { display: none; height: calc(100vh - 180px); min-height: 400px; flex: none; border-top: 1px solid var(--border); overflow: hidden; }
#section-journal .tj-gdocs-panel.active { display: flex; }
#section-journal .tj-gdocs-list { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; min-height: 0; padding: 16px; border-right: 1px solid var(--border); background: var(--card); }
#section-journal .tj-gdocs-embed { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--card); }
#section-journal .tj-gdocs-embed iframe { flex: 1; width: 100%; border: none; min-height: 0; display: block; }
/* Mobile: stack list above embed; same approach as client side. */
@media (max-width: 760px) {
  #section-journal .tj-gdocs-panel { flex-direction: column; }
  #section-journal .tj-gdocs-list  { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border); }
  #section-journal .tj-gdocs-embed { flex: 1; min-height: 240px; }
}
#section-journal .tj-gdoc-item { padding: 10px 12px; border-radius: 0; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: all 0.15s; margin-bottom: 6px; flex-shrink: 0; }
#section-journal .tj-gdoc-item:hover, #section-journal .tj-gdoc-item.active { border-color: var(--accent); background: var(--accent-light); }
#section-journal .tj-gdoc-name { font-size: 13px; font-weight: 500; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#section-journal .tj-gdoc-date { font-size: 11px; color: var(--muted); }
#section-journal .tj-gdocs-search { width: 100%; padding: 8px 10px; border-radius: 0; border: 1px solid var(--border); font-size: 12px; font-family: var(--sans); background: var(--surface); color: var(--ink); margin-bottom: 8px; flex-shrink: 0; box-sizing: border-box; }
#section-journal .tj-gdocs-search:focus { outline: none; border-color: var(--accent); }

/* ── Collapsible "Your Files" column ── */
#section-journal .tj-gdocs-rail { display: none; }
#section-journal .tj-gdocs-panel.gdocs-collapsed .tj-gdocs-list { display: none; }
#section-journal .tj-gdocs-panel.gdocs-collapsed .tj-gdocs-rail {
  display: flex; width: 36px; flex-shrink: 0; align-items: flex-start; justify-content: center;
  padding-top: 14px; border-right: 1px solid var(--border); background: var(--card);
}
#section-journal .tj-gdocs-rail button {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
  color: var(--muted); width: 26px; height: 26px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 13px; transition: all .12s;
}
#section-journal .tj-gdocs-rail button:hover { color: var(--ink); border-color: var(--ink); }
/* Draggable splitter between the file list and the workspace */
#section-journal .tj-gdocs-splitter { width: 6px; flex-shrink: 0; cursor: col-resize; background: transparent; transition: background .12s; }
#section-journal .tj-gdocs-splitter:hover { background: var(--border); }
#section-journal .tj-gdocs-panel.gdocs-collapsed .tj-gdocs-splitter { display: none; }
/* Roomier file-toolbar buttons (override the tight inline padding) */
#tjGdocsToolbar > .btn { padding: 7px 13px !important; font-size: 12.5px !important; }
#section-journal .tj-gdoc-item { padding: 12px 14px; }
#section-journal .tj-center-state { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 16px; text-align: center; padding: 32px; }
/* Portal menus */
.tj-entry-menu { position: fixed; background: var(--card); border: 1px solid var(--border); border-radius: 0; box-shadow: 0 4px 20px rgba(0,0,0,0.14); z-index: 9999; min-width: 152px; padding: 4px 0; display: none; }
.tj-entry-menu.open { display: block; }
.tj-entry-menu .tj-menu-item { display: flex; align-items: center; gap: 9px; padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--ink); transition: background 0.1s; user-select: none; font-family: var(--sans); }
.tj-entry-menu .tj-menu-item:hover { background: var(--surface); }
.tj-entry-menu .tj-menu-item.danger { color: #c0392b; }
.tj-entry-menu .tj-menu-item.danger:hover { background: #fde8e6; }
.tj-delete-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 10000; align-items: center; justify-content: center; }
.tj-delete-backdrop.open { display: flex; }
.tj-delete-modal { background: var(--card); border-radius: 0; padding: 32px 28px 28px; max-width: 380px; width: calc(100% - 48px); box-shadow: 0 12px 48px rgba(0,0,0,0.22); }
.tj-delete-modal-icon { font-size: 28px; color: #c0392b; margin-bottom: 14px; }
.tj-delete-modal h3 { font-size: 16px; font-weight: 600; font-family: var(--sans); letter-spacing: -0.01em; color: var(--ink); margin: 0 0 8px; }
.tj-delete-modal p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 24px; }
.tj-delete-modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
.tj-delete-modal-btns .tj-btn-cancel { padding: 8px 18px; border: 1.5px solid var(--border); border-radius: 0; background: transparent; cursor: pointer; font-size: 13px; font-family: var(--sans); color: var(--muted); }
.tj-delete-modal-btns .tj-btn-cancel:hover { border-color: var(--ink); color: var(--ink); }
.tj-delete-modal-btns .tj-btn-confirm-del { padding: 8px 18px; border: none; border-radius: 0; background: #c0392b; color: #fff; cursor: pointer; font-size: 13px; font-weight: 600; font-family: var(--sans); }
.tj-delete-modal-btns .tj-btn-confirm-del:hover { background: #a93226; }
@media (max-width: 1300px) { #section-journal .tj-journal-app { grid-template-columns: 220px 1fr 300px; } }
@media (max-width: 1100px) { #section-journal .tj-journal-app { grid-template-columns: 200px 1fr; } #section-journal .tj-analysis-panel { display: none; } }

/* ── Stepped responsive ── */
@media (max-width: 1200px) {
  .hub-sidebar { width: 220px; }
  .hub-sidebar.collapsed { width: 60px; }
}
@media (max-width: 1020px) {
  .hub-sidebar { width: 60px; } /* auto-collapse on small screens */
  .hub-sidebar .sidebar-section-label { opacity: 0; height: 0; padding: 0; pointer-events: none; }
  .hub-sidebar .si-label { opacity: 0; width: 0; pointer-events: none; }
  .hub-sidebar .sidebar-badge { opacity: 0; width: 0; min-width: 0; padding: 0; margin: 0; overflow: hidden; pointer-events: none; }
  .hub-sidebar .sidebar-item { justify-content: center; padding: 10px; gap: 0; }
  .hub-sidebar .sidebar-items-wrap { padding: 4px 8px 8px; }
  .hub-sidebar .sidebar-head { justify-content: center; padding: 14px 0 6px; }
  .hub-sidebar .sidebar-profile { justify-content: center; padding: 14px 0; gap: 0; }
  .hub-sidebar .sidebar-profile-info { opacity: 0; width: 0; }
  .clients-layout { grid-template-columns: 210px 1fr; }
  .rxhub-layout { grid-template-columns: 240px 1fr; }
  .sds-body { grid-template-columns: 1fr 240px; }
}
@media (max-width: 900px) {
  .hub-shell { grid-template-columns: 1fr; grid-template-rows: auto; }
  .hub-sidebar { position: relative; top: 0; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .sidebar-section-label { display: none; }
  .notes-shell { flex-direction: column; }
  .notes-shell .notes-list-card { width: auto; max-height: 220px; }
  .earnings-grid { grid-template-columns: 1fr; }
  .ov-grid-3 { grid-template-columns: 1fr !important; }
  .chat-body { grid-template-columns: 1fr !important; }
  .chat-convos { display: none; }
  /* Adjust luxe full-bleed paddings for mobile */
  .ov-hero { padding: 32px 20px 0; }
  .ov-stat-tiles { margin: 0 -20px; }
  .ov-stat-tile:first-child { padding-left: 20px; }
  .ov-stat-tile:last-child { padding-right: 20px; }
  .ov-body { padding: 20px 16px 32px; grid-template-columns: 1fr; }
  .section:not(#section-overview) { padding: 20px 16px 32px; }
}

/* ── Friends Widget ── */
.ov-grid-3 { display: grid; grid-template-columns: 1fr 1fr 240px; gap: 20px; align-items: start; }
.fw-body { overflow-y: auto; max-height: 228px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.friend-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.friend-row:last-child { border-bottom: none; }
.friend-av { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-light); color: var(--accent); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.p-dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--card); position: absolute; bottom: -1px; right: -1px; }
.p-dot.online { background: var(--green); }
.p-dot.offline { background: var(--border); }
.friend-name-cell { font-size: 13px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-pending { display: flex; align-items: center; gap: 8px; padding: 8px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 2px; font-size: 12px; color: var(--gold); }
.friend-msg-btn { padding: 4px 9px; font-size: 11px; border-radius: 20px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; font-family: var(--sans); transition: all .15s; flex-shrink: 0; }
.friend-msg-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
/* ── Chat Modal ── */
.chat-overlay { position: fixed; inset: 0; background: rgba(26,24,20,.46); z-index: 950; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.chat-overlay.open { opacity: 1; pointer-events: all; }
.chat-modal { background: var(--card); border-radius: 0; width: min(820px,100%); height: min(560px,90vh); display: flex; flex-direction: column; box-shadow: 0 24px 60px rgba(26,24,20,.28); overflow: hidden; animation: fadeUp .2s ease; }
.chat-modal-hdr { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat-body { display: grid; grid-template-columns: 220px 1fr; flex: 1; min-height: 0; overflow: hidden; }
.chat-convos { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface); }
.chat-convo-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .15s; }
.chat-convo-item:hover { background: var(--bg); }
.chat-convo-item.active { background: var(--accent-light); }
.chat-conv-av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-light); color: var(--accent); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; position: relative; }
.chat-convo-meta { flex: 1; min-width: 0; }
.chat-convo-name { font-size: 13px; font-weight: 500; }
.chat-convo-prev { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread-wrap { display: flex; flex-direction: column; min-height: 0; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.chat-bw { display: flex; flex-direction: column; gap: 3px; position: relative; }
.chat-bw.mine { align-items: flex-end; }
.chat-bw.theirs { align-items: flex-start; }
.chat-bubble-row { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.chat-bw.mine .chat-bubble-row { flex-direction: row-reverse; }
.chat-bubble { max-width: 66%; padding: 9px 13px; border-radius: 14px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.chat-bubble.mine { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.theirs { background: var(--surface); color: var(--ink); border-bottom-left-radius: 4px; }
.chat-bubble.retracted { font-style: italic; opacity: 0.72; }
.chat-ts { font-size: 10px; color: var(--muted); }
.chat-msg-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.chat-bubble-row:hover .chat-msg-actions { opacity: 1; }
.chat-msg-actions button { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 4px; font-size: 12px; line-height: 1; }
.chat-msg-actions button:hover { background: var(--surface); color: var(--ink); }
.chat-disclaimer { font-size: 10.5px; color: var(--muted); padding: 6px 16px 10px; line-height: 1.35; background: var(--card); border-top: 1px dashed var(--border); }
.chat-input-row { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0; align-items: flex-end; }
.chat-input-row textarea { flex: 1; border: 1px solid var(--border); border-radius: 0; padding: 9px 12px; font-family: var(--sans); font-size: 13px; resize: none; background: var(--surface); color: var(--ink); outline: none; height: 38px; line-height: 1.4; overflow-y: auto; }
.chat-input-row textarea:focus { border-color: var(--accent); }

/* ── Form inputs (shared) ────────────────────────────────────── */
.form-input { display:block; width:100%; padding:9px 12px; font-size:13px; font-family:var(--sans); font-weight:400; color:var(--ink); background:var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); outline:none; transition:border-color .15s, box-shadow .15s; }
.form-input:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(61,90,128,.1); }
.form-input::placeholder { color:var(--muted); }

/* ── To-Do Section ───────────────────────────────────────────── */
.todo-lanes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .todo-lanes { grid-template-columns: 1fr; } }
.todo-lane-head { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; font-family: var(--sans); letter-spacing: -0.01em; color: var(--ink); margin-bottom: 10px; }
.todo-lane-count { font-size: 11px; font-weight: 500; background: var(--surface); color: var(--muted); padding: 1px 8px; border-radius: 999px; margin-left: 4px; }
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 28px 12px; background: var(--surface); border-radius: 0; border: 1px dashed var(--border); }
.todo-card { background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; transition: box-shadow 0.15s, border-color 0.15s; position: relative; }
.todo-card:hover { box-shadow: 0 2px 10px var(--shadow); border-color: var(--accent); }
.todo-card.done-card { opacity: 0.65; }
.todo-card.done-card .todo-card-title { text-decoration: line-through; color: var(--muted); }
.todo-card-left { flex: 1; min-width: 0; }
.todo-card-title { font-size: 14px; font-weight: 500; font-family: var(--sans); letter-spacing: -0.01em; line-height: 1.35; margin-bottom: 3px; word-break: break-word; }
.todo-card-desc { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 6px; }
.todo-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.todo-pri-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase; }
.todo-pri-badge.high   { background: var(--red-light);   color: var(--red);   border: 1px solid rgba(184,50,50,.18); }
.todo-pri-badge.medium { background: var(--amber-light); color: var(--amber); border: 1px solid rgba(181,98,10,.18); }
.todo-pri-badge.low    { background: var(--green-light); color: var(--green); border: 1px solid rgba(45,106,79,.18); }
.todo-due { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 3px; }
.todo-due.overdue { color: var(--red); font-weight: 500; }
.todo-card-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.todo-action-btn { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--muted); transition: all 0.15s; }
.todo-action-btn:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.todo-action-btn.complete:hover { background: var(--green-light); color: var(--green); border-color: var(--green); }
.todo-action-btn.restore:hover  { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.todo-action-btn.delete:hover   { background: var(--red-light);   color: var(--red);   border-color: var(--red); }
.todo-filter-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 0; font-size: 12px; font-family: var(--sans); font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: var(--card); color: var(--muted); transition: all .15s; }
.todo-filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.todo-filter-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.todo-pri-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.todo-pri-dot.high   { background: var(--red); }
.todo-pri-dot.medium { background: var(--amber); }
.todo-pri-dot.low    { background: var(--green); }
/* ── To-Do: Lists panel ─────────────────────────────────────── */
.todo-layout { display: flex; gap: 20px; align-items: flex-start; }
.todo-lists-panel { width: 200px; flex-shrink: 0; background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 8px 6px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.todo-list-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 0; cursor: pointer; font-size: 13px; font-family: var(--sans); font-weight: 500; color: var(--muted); transition: background .13s, color .13s; user-select: none; }
.todo-list-item:hover { background: var(--surface); color: var(--ink); }
.todo-list-item.active { background: var(--surface); color: var(--ink); font-weight: 600; }
.tli-count { margin-left: auto; font-size: 11px; background: var(--surface); color: var(--muted); padding: 1px 7px; border-radius: 999px; flex-shrink: 0; }
.todo-list-item.active .tli-count { background: var(--border); }
.tli-actions { display: none; gap: 2px; margin-left: auto; flex-shrink: 0; }
.todo-list-item:hover .tli-actions { display: flex; }
.todo-list-item:hover .tli-count { display: none; }
.tli-act-btn { width: 22px; height: 22px; border: none; background: transparent; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.tli-act-btn:hover { background: var(--border); color: var(--ink); }
.todo-lists-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.todo-new-list-btn { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 0; cursor: pointer; font-size: 12px; font-family: var(--sans); font-weight: 500; color: var(--accent); background: transparent; border: none; transition: background .13s; width: 100%; text-align: left; }
.todo-new-list-btn:hover { background: var(--surface); }
.todo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 700px) { .todo-layout { flex-direction: column; } .todo-lists-panel { width: 100%; position: static; } }
/* Action Items panel in overview */
.ai-task-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.ai-task-item:last-child { border-bottom: none; }
.ai-task-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; }
.ai-task-dot.high   { background: var(--red); }
.ai-task-dot.medium { background: var(--amber); }
.ai-task-dot.low    { background: var(--green); }
.ai-task-info { flex: 1; min-width: 0; }
.ai-task-info strong { display: block; font-size: 13px; font-weight: 500; line-height: 1.3; }
.ai-task-info span { font-size: 11px; color: var(--muted); }

/* ── Connect / Directory section ── */
.dir-filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dir-filter-chip {
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; transition: all 0.15s; font-family: var(--sans);
}
.dir-filter-chip.active, .dir-filter-chip:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.dir-filter-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.dir-filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 130px; flex: 1; }
.dir-filter-group label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.dir-therapist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.dir-therapist-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 0;
  padding: 20px; transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.dir-therapist-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.08); border-color: var(--accent); }
.dir-therapist-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dir-therapist-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 16px; flex-shrink: 0; overflow: hidden;
}
.dir-therapist-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dir-therapist-degree { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dir-therapist-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.dir-conn-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.dir-conn-tab {
  padding: 10px 18px; font-size: 13px; font-weight: 500; background: none; border: none;
  color: var(--muted); cursor: pointer; font-family: var(--sans);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s;
}
.dir-conn-tab:hover { color: var(--ink); }
.dir-conn-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.dir-conn-panel { display: none; }
.dir-conn-panel.active { display: block; }

/* Directory visibility banner (driven by profiles.directory_visible) */
.dv-banner { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 14px 18px; border-radius: 0; background: var(--surface); border: 1px solid var(--border); }
.dv-banner.visible { background: color-mix(in srgb, var(--green) 8%, var(--card)); border-color: color-mix(in srgb, var(--green) 30%, var(--border)); }
.dv-banner-icon { font-size: 18px; color: var(--muted); flex-shrink: 0; }
.dv-banner.visible .dv-banner-icon { color: var(--green); }
.dv-banner-body { flex: 1; min-width: 0; }
.dv-banner-title { font-size: 13.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 2px; }
.dv-banner-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }
.dv-banner-cta { font-size: 12px; padding: 7px 14px; flex-shrink: 0; }
@media (max-width: 720px) { .dv-banner { flex-direction: column; align-items: stretch; text-align: left; } .dv-banner-cta { align-self: flex-start; } }

/* ── Settings panel ── */
.st-shell { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.st-nav { display: flex; flex-direction: column; gap: 2px; }
.st-nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-radius: 0; font-size: 13px; color: var(--muted); cursor: pointer; border: none; background: transparent; text-align: left; font-family: var(--sans); transition: all 0.15s; }
.st-nav-item:hover { background: var(--surface); color: var(--ink); }
.st-nav-item.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.st-ni-icon { font-size: 15px; width: 18px; text-align: center; }
.st-panel { display: none; }
.st-panel.active { display: flex; flex-direction: column; gap: 20px; }
.settings-card { background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 24px; box-shadow: 0 2px 16px var(--shadow); }
.settings-card h3 { margin-bottom: 6px; font-family: var(--sans); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.settings-card .sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.avatar-row { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.avatar-large { width: 68px; height: 68px; border-radius: 50%; background: var(--accent-light); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 22px; font-family: var(--serif); overflow: hidden; flex-shrink: 0; border: 2px solid var(--border); }
.avatar-large img { width: 100%; height: 100%; object-fit: cover; }
.credential-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; background: var(--surface); border: 1px solid var(--border); border-radius: 0; gap: 12px; }
.credential-row .cred-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.credential-row .cred-value { font-size: 14px; font-family: monospace; color: var(--ink); }
.verify-gate { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 28px; text-align: center; }
.verify-gate .lock-icon { font-size: 32px; margin-bottom: 12px; }
.verify-gate h4 { margin-bottom: 6px; font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.verify-gate p { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.verify-form { max-width: 300px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.username-wrap { position: relative; display: flex; align-items: center; }
.username-wrap .at-prefix { position: absolute; left: 13px; color: var(--muted); font-size: 14px; pointer-events: none; user-select: none; }
.username-wrap input { padding-left: 26px; }
.username-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
@media (max-width: 760px) { .st-shell { grid-template-columns: 1fr; } }
