/* App accent override: soft/recessed surfaces are light blue in the product
   (mint remains a marketing colour). Loaded after main.css so this wins. */
:root {
  --surface-recessed:    #E0EAF0;
  --brand-gold-soft:     #E0EAF0;
  --status-success-soft: #E0EAF0;
  --status-warning-soft: #E0EAF0;
  --status-info-soft:    #E0EAF0;
}

/* ════════════════════════════════════════
   WORKSPACE — authenticated product shell
   Applies only when .ws-body is present
════════════════════════════════════════ */

/* Ensure [hidden] always wins */
[hidden] { display: none !important; }

/* ── Shell ───────────────────────────────────────────────────────────────── */

.ws-body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-sans);
  background: var(--surface-canvas);
}

/* ── Loading state ───────────────────────────────────────────────────────── */

.ws-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-navy);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ws-loader__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(243, 250, 255, 0.15);
  border-top-color: #F3FAFF;
  border-radius: 50%;
  animation: ws-spin 0.75s linear infinite;
}

@keyframes ws-spin {
  to { transform: rotate(360deg); }
}

/* Hide layout while loading, show once auth guard removes is-loading */
body.is-loading .sb-layout {
  opacity: 0;
  pointer-events: none;
}

body:not(.is-loading) .ws-loader {
  display: none;
}

/* ── Top bar overrides ───────────────────────────────────────────────────── */

.ws-topbar {
  /* Inherits sb-topbar base; layout adjusted for search centre slot */
  justify-content: space-between;
  gap: var(--space-2);
}

.ws-topbar__breadcrumb {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--color-gold-light);
  white-space: nowrap;
}

.ws-topbar__tenant {
  font-weight: 600;
}

.ws-topbar__sep {
  opacity: 0.5;
}

.ws-topbar__section {
  opacity: 0.8;
}

/* ── Top bar search ──────────────────────────────────────────────────────── */
/* A compact rounded pill that sits with the other top-right controls (right
   next to notifications) — clicking it opens the centered search palette
   below, rather than typing inline. */

.ws-topbar__search {
  display: inline-flex; align-items: center; gap: 0.5rem;
  width: 180px; box-sizing: border-box; flex-shrink: 0;
  background: rgba(243, 250, 255, 0.1);
  color: rgba(243, 250, 255, 0.85);
  border: 1px solid rgba(243, 250, 255, 0.15);
  border-radius: 999px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.ws-topbar__search svg { flex-shrink: 0; opacity: 0.7; }
.ws-topbar__search:hover,
.ws-topbar__search:focus-visible {
  border-color: rgba(243, 250, 255, 0.35);
  background: rgba(243, 250, 255, 0.14);
  outline: none;
}
.ws-topbar__search-label {
  flex: 1; min-width: 0; text-align: left;
  color: rgba(243, 250, 255, 0.55);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-topbar__search-hint {
  flex-shrink: 0;
  font-size: 0.65625rem;
  color: rgba(243, 250, 255, 0.5);
  border: 1px solid rgba(243, 250, 255, 0.25);
  border-radius: 5px;
  padding: 1px 5px;
  user-select: none;
}

/* ── Search palette — opens centred over the page ────────────────────────── */

.ws-search-palette-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10, 37, 54, 0.6); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 20px 20px;
  animation: overlayIn 0.15s ease;
}
.ws-search-palette {
  width: 100%; max-width: 640px; max-height: 70vh;
  background: var(--surface-elevated);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(10, 37, 54, 0.35);
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.ws-search-palette__bar {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding: 14px 16px; border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.ws-search-palette__input {
  flex: 1; min-width: 0; border: none; outline: none; background: none;
  font-size: 0.9375rem; font-family: var(--font-sans); color: var(--brand-navy);
}
.ws-search-palette__input::placeholder { color: var(--text-muted); }
/* base.css's input:focus-visible rule (type+pseudo-class) otherwise outranks
   a lone class selector and draws its accessibility ring here too — this
   box is deliberately chrome-free, so beat it explicitly. */
.ws-search-palette__input:focus,
.ws-search-palette__input:focus-visible { outline: none; border-color: transparent; box-shadow: none; }
.ws-search-palette__close {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(10, 37, 54, 0.08); color: var(--text-muted);
  font-size: 0.75rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.ws-search-palette__close:hover { background: rgba(10, 37, 54, 0.16); color: var(--brand-navy); }
.ws-search-palette__results { overflow-y: auto; flex: 1; }
.ws-search-palette__results:empty { min-height: 0; }

/* ── Search results (rendered inside the palette's results pane) ────────── */

.ws-sugg-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 1rem 0.25rem;
}
.ws-sugg-label--sep { border-top: 1px solid var(--border-subtle); }
.ws-sugg-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  transition: background 0.1s;
}
.ws-sugg-item:hover { background: var(--surface-recessed); }
.ws-sugg-item:last-child { padding-bottom: 0.75rem; }
.ws-sugg-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
}
.ws-sugg-icon--matter {
  background: var(--brand-gold-soft);
  color: var(--brand-gold-deep);
}
.ws-sugg-icon--matter svg { width: 16px; height: 16px; }
.ws-sugg-icon--person {
  background: var(--brand-navy-soft);
  color: var(--surface-canvas);
  letter-spacing: 0.02em;
}
.ws-sugg-body { flex: 1; min-width: 0; }
.ws-sugg-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.ws-sugg-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.ws-sugg-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 100px;
  background: var(--surface-recessed);
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.ws-sugg-badge--active   { background: var(--status-success-soft); color: var(--status-success); }
.ws-sugg-badge--closed   { background: var(--surface-recessed); color: var(--text-muted); }
.ws-sugg-badge--draft    { background: var(--status-info-soft); color: var(--status-info); }
.ws-sugg-badge--intake   { background: var(--status-warning-soft); color: var(--status-warning); }
.ws-sugg-empty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.ws-sugg-empty__icon { opacity: 0.4; display: flex; }
.ws-sugg-empty__icon svg { width: 16px; height: 16px; }

/* ── Top bar right actions ───────────────────────────────────────────────── */

.ws-topbar__right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ws-new-matter-btn {
  background: var(--color-gold-2); /* mint on the Cape Cod topbar */
  color: var(--color-navy);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.ws-new-matter-btn:hover {
  background: var(--color-gold-2);
  filter: brightness(0.94);
}

.ws-new-matter-btn:active {
  transform: scale(0.97);
}

/* ── Notifications button ────────────────────────────────────────────────── */

.ws-notif-btn {
  position: relative;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: rgba(243, 250, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition-fast);
  flex-shrink: 0;
}

.ws-notif-btn:hover {
  color: #F3FAFF;
}

.ws-notif-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.ws-notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-danger);
  border: 2px solid var(--brand-navy);
}

/* ── Account menu / user chip (bottom of sidebar) ────────────────────────── */

.ws-account-menu {
  position: relative;
  width: 100%;
}
.sb-sidebar__footer { padding: 8px 8px 10px; }

/* Legacy .ws-avatar kept in case anything targets it still */
.ws-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-gold);
  color: #F3FAFF;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  user-select: none;
}

/* User chip — full-width row at the bottom of the sidebar (Claude-style) */
.ws-user-chip {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  background: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  color: #F3FAFF;
  font-family: var(--font-sans);
  text-align: left;
}
.ws-user-chip:hover {
  background: rgba(243, 250, 255,0.08);
  border-color: rgba(243, 250, 255,0.12);
}
#ws-avatar-initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-gold);
  color: #F3FAFF;
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.ws-user-chip__name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: rgba(243, 250, 255,0.9);
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-user-chip__chevron {
  color: rgba(243, 250, 255,0.5);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── Account dropdown — opens upward from the sidebar footer ─────────────── */

.ws-account-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(10, 37, 54, 0.28);
  z-index: 200;
  overflow: hidden;
  border: 1px solid rgba(10, 37, 54, 0.06);
}

.ws-account-dropdown__header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem;
  background: var(--color-cream-2);
}

.ws-account-dropdown__header strong {
  font-size: 0.9375rem;
  color: var(--color-navy);
  font-weight: 700;
  line-height: 1.3;
}

.ws-account-dropdown__header span {
  font-size: 0.75rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-account-dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: var(--color-navy);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
  transition: background var(--transition-fast);
}

.ws-account-dropdown__item:hover {
  background: var(--color-cream);
}

.ws-account-dropdown__item svg { flex-shrink: 0; }

.ws-account-dropdown__item--danger {
  color: var(--status-danger);
}

.ws-account-dropdown__item--danger:hover {
  background: var(--status-danger-soft);
}

.ws-account-dropdown__divider {
  height: 1px;
  background: rgba(10, 37, 54, 0.08);
  margin: 0.25rem 0;
}

/* ── Notifications panel ─────────────────────────────────────────────────── */

.ws-notif-panel {
  position: fixed;
  top: 64px;
  right: 1rem;
  width: 360px;
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(10, 37, 54, 0.18);
  z-index: 200;
  overflow: hidden;
  border: 1px solid rgba(10, 37, 54, 0.06);
}

.ws-notif-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(10, 37, 54, 0.08);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
}

.ws-notif-panel__mark-all {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--color-gold);
  cursor: pointer;
  padding: 0;
  font-family: var(--font-sans);
  transition: color var(--transition-fast);
}

.ws-notif-panel__mark-all:hover {
  color: var(--color-gold-2);
}

.ws-notif-panel__list {
  max-height: 400px;
  overflow-y: auto;
}

.ws-notif-panel__empty {
  padding: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-muted);
  margin: 0;
}

/* ── Notification items ──────────────────────────────────────────────────── */

.ws-notif-item {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(10, 37, 54, 0.06);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  transition: background var(--transition-fast);
}

.ws-notif-item:last-child {
  border-bottom: none;
}

.ws-notif-item:hover {
  background: var(--color-cream);
}

.ws-notif-item.is-unread {
  background: var(--color-gold-bg);
}

.ws-notif-item.is-unread:hover {
  background: var(--brand-gold-light);
}

.ws-notif-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-gold);
  margin-top: 4px;
  flex-shrink: 0;
}

.ws-notif-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.ws-notif-item__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
  line-height: 1.3;
}

.ws-notif-item__body-text {
  font-size: 0.8125rem;
  color: var(--color-muted);
  line-height: 1.4;
}

.ws-notif-item__time {
  font-size: 0.6875rem;
  color: var(--color-muted);
}

/* ── Sidebar additions ───────────────────────────────────────────────────── */

.ws-sidebar {
  /* sb-sidebar provides base; this class adds workspace-specific overrides */
}

/* ── Matters page layout ─────────────────────────────────────────────────── */

.ws-matters-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100%;
  overflow: hidden;
}
.ws-matters-list-col {
  border-right: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.ws-matters-detail-col {
  overflow-y: auto;
  background: var(--surface-canvas);
}

/* ── Matters tabs ────────────────────────────────────────────────────────── */

.ws-matters-toolbar {
  padding: 0.875rem 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  flex-shrink: 0;
}
.ws-cases-tabs {
  display: flex;
  flex-direction: row;
  gap: 0;
}
.ws-cases-tab {
  padding: 0.5rem 0.875rem 0.75rem;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.ws-cases-tab:hover { color: var(--brand-navy); }
.ws-cases-tab.is-active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-navy);
  font-weight: 600;
}
.ws-cases-tab__count {
  font-size: 0.625rem;
  background: var(--surface-recessed);
  color: var(--text-muted);
  padding: 1px 5px;
  border-radius: 100px;
  font-weight: 700;
  line-height: 1.5;
}
.ws-cases-tab.is-active .ws-cases-tab__count {
  background: var(--brand-navy);
  color: var(--surface-canvas);
}

/* AI button in toolbar */
.ws-ai-btn {
  margin-left: auto;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-gold-deep);
  background: var(--brand-gold-soft);
  border: 1px solid var(--brand-gold);
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: var(--font-sans);
}
.ws-ai-btn:hover {
  background: var(--brand-gold);
  color: var(--brand-navy-deep);
}

/* Matters view — full-height flex layout */
#view-matters {
  position: relative;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden;
}
#view-matters > .sb-cases-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.ws-matters-ai-corner {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  z-index: 20;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-gold-deep);
  background: var(--brand-gold-soft);
  border: 1px solid var(--brand-gold);
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: var(--font-sans);
}
.ws-matters-ai-corner:hover {
  background: var(--brand-gold);
  color: var(--brand-navy-deep);
}

/* ── Matters search ── */
.ws-matters-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
}
.ws-matters-search {
  background: var(--surface-elevated);
  padding: 0.5rem 0.875rem 0.625rem;
  border-bottom: 1px solid var(--border-subtle);
}
.ws-search-wrap {
  display: flex;
  align-items: center;
  /* Always white — never the recessed/mint surface */
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 0.625rem;
  gap: 0.375rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.ws-search-wrap:hover:not(:focus-within) { background: var(--surface-elevated); border-color: var(--border-strong); }
.ws-search-wrap:focus-within {
  border-color: var(--brand-navy-soft);
  box-shadow: 0 0 0 2px rgba(51, 86, 109, 0.14);
  background: var(--surface-elevated);
}
.ws-search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ws-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.8125rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  padding: 0.4375rem 0;
  min-width: 0;
}
.ws-search-input::placeholder { color: var(--text-muted); }
.ws-search-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}
.ws-search-clear:hover { background: var(--border-subtle); color: var(--text-primary); }
.ws-search-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.ws-search-empty__icon { font-size: 1.5rem; opacity: 0.4; }
.ws-search-empty__text { font-size: 0.875rem; color: var(--text-muted); }

/* Tab content scroll */
#ws-tab-content {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem 0;
}

/* ── Matter list rows — compact: title + one meta line ───────────────────── */

.sb-case-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.55rem 1rem 0.625rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s;
  border-left: 2px solid transparent;
  position: relative;
}
.sb-case-card:hover {
  background: rgba(10, 37, 54, 0.03);
}
.sb-case-card.is-active {
  background: var(--surface-elevated);
  border-left-color: var(--brand-navy);
}
.sb-case-card__title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sb-case-card.is-active .sb-case-card__title { color: var(--brand-navy-deep); }
.sb-case-card__meta-line {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-case-card__meta-line .ws-case-chip { margin-left: 6px; vertical-align: 1px; }

/* Status pills */
.sb-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.sb-status-pill--active  { background: var(--status-success-soft); color: var(--status-success); }
.sb-status-pill--closed  { background: var(--surface-recessed);    color: var(--text-muted); }
.sb-status-pill--pending { background: var(--status-warning-soft); color: var(--status-warning); }
.sb-status-pill--draft   { background: var(--status-info-soft);    color: var(--status-info); }

/* Practice area tag */
.sb-practice-pill {
  display: inline-flex;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Visibility / shared chips */
.ws-case-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  white-space: nowrap;
}
.ws-case-chip--shared  { background: var(--brand-gold-soft);  color: var(--brand-gold-deep); }
.ws-case-chip--private { background: var(--surface-recessed); color: var(--text-muted); }
.ws-case-chip--firm    { background: var(--status-info-soft); color: var(--status-info); }
.ws-case-chip--open    { background: var(--status-success-soft); color: var(--status-success); }
.ws-case-chip--closed  { background: var(--surface-recessed); color: var(--text-muted); }

/* Doc count */
.sb-case-card__doc-count {
  font-size: 0.625rem;
  color: var(--text-muted);
  margin-left: auto;
  letter-spacing: 0.02em;
}

/* ── New matter wizard overlay ───────────────────────────────────────────────
   Overlay/backdrop/panel/close are owned by wizard.css — do not restyle here,
   duplicate rules leak properties (e.g. panel padding) into the wz2 layout. */

.ws-wizard-step {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ws-wizard-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-navy);
  margin: 0 0 0.25rem;
  line-height: 1.3;
}

.ws-wizard-sub {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin: 0;
  line-height: 1.5;
}

.ws-wizard-progress {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.ws-wizard-progress__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-cream);
  transition: background var(--transition-fast);
}

.ws-wizard-progress__dot.is-active {
  background: var(--color-navy);
}

.ws-wizard-progress__dot.is-done {
  background: var(--color-gold);
}

.ws-wizard-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ── Share slide-over ────────────────────────────────────────────────────── */

.ws-share-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
}

.ws-share-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 37, 54, 0.4);
}

.ws-share-panel__drawer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 420px;
  background: var(--surface-elevated);
  box-shadow: -4px 0 32px rgba(10, 37, 54, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ws-share-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-line);
  flex-shrink: 0;
}

.ws-share-panel__header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-navy);
}

.ws-share-panel__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background var(--transition-fast);
  font-family: var(--font-sans);
  line-height: 1;
}

.ws-share-panel__close:hover {
  color: var(--color-navy);
  background: var(--color-cream);
}

.ws-share-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ws-share-input-wrap {
  position: relative;
}

.ws-share-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-elevated);
  color: var(--color-navy);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition-fast);
}

.ws-share-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(51, 86, 109, 0.12);
}

.ws-share-permission {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface-elevated);
  color: var(--color-navy);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
}

.ws-share-permission:focus {
  border-color: var(--color-gold);
}

.ws-share-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.ws-share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-cream-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-line);
}

.ws-share-row__principal {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.ws-share-row__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
}

.ws-share-row__meta {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.ws-share-row__revoke {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--status-danger);
  font-family: var(--font-sans);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.ws-share-row__revoke:hover {
  background: var(--status-danger-soft);
}

/* ── Upsell / tier gate panel ────────────────────────────────────────────── */

.ws-upsell {
  padding: 3rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.ws-upsell__icon {
  font-size: 2.5rem;
  line-height: 1;
}

.ws-upsell__heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-navy);
  margin: 0;
}

.ws-upsell__body {
  font-size: 0.9375rem;
  color: var(--color-muted);
  max-width: 400px;
  margin: 0;
  line-height: 1.6;
}

.ws-upsell__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Permission / info notice ────────────────────────────────────────────── */

.ws-permission-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-gold-bg);
  border: 1px solid var(--color-gold-light);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--brand-gold-deep);
  line-height: 1.4;
}

/* ── Action bar ──────────────────────────────────────────────────────────── */

.ws-action-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.875rem var(--space-2);
  background: var(--color-cream-2);
  border-bottom: 1px solid var(--color-line);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Upload area ─────────────────────────────────────────────────────────── */

.ws-upload-area {
  border: 2px dashed var(--color-line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: var(--color-muted);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  user-select: none;
}

.ws-upload-area:hover,
.ws-upload-area.is-dragging {
  border-color: var(--color-gold);
  background: rgba(51, 86, 109, 0.06);
  color: var(--color-navy);
}

.ws-upload-area p {
  margin: 0;
  font-size: 0.875rem;
}

.ws-upload-area__icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* ── Tier badges ─────────────────────────────────────────────────────────── */

.ws-tier-badge {
  /* Inherits sb-nav-pro-badge / sb-nav-firm-badge from sandbox.css */
  font-size: 0.5625rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  /* Hide the search bar on small screens (keyboard shortcut hint irrelevant) */
  .ws-topbar__search-wrap {
    display: none;
  }

  /* Sidebar becomes off-canvas */
  .ws-sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    bottom: 0;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    box-shadow: 4px 0 24px rgba(10, 37, 54, 0.12);
  }

  .ws-sidebar-open .ws-sidebar {
    transform: translateX(0);
  }

  /* Overlay behind open sidebar */
  .ws-sidebar-open::before {
    content: '';
    position: fixed;
    inset: 64px 0 0 0;
    background: rgba(10, 37, 54, 0.35);
    z-index: 140;
  }

  /* Wizard full-bleed on mobile */
  .ws-wizard-overlay {
    align-items: flex-end;
  }

  .ws-wizard-panel {
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 92vh;
  }

  /* Share drawer full-width on mobile */
  .ws-share-panel__drawer {
    width: 100%;
  }

  /* Notifications panel full-width on mobile */
  .ws-notif-panel {
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
  }

  /* New matter button — hide text, keep icon-like */
  .ws-new-matter-btn {
    padding: 0.4rem 0.625rem;
    font-size: 0.75rem;
  }
}

/* ── Toast notifications ─────────────────────────────────────────────────── */

.ws-toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9000;
  background: var(--brand-navy);
  color: var(--surface-canvas);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md, 6px);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  line-height: 1.4;
  max-width: 360px;
  box-shadow: 0 4px 16px rgba(10, 37, 54, 0.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.ws-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ws-toast--error {
  background: var(--status-danger);
}

/* ── Dashboard v10 ─────────────────────────────────────────────────── */
.ws-dashboard {
  padding: 0;
  flex: none;
  background: var(--surface-canvas);
}

/* Greeting band — navy bar at top */
.ws-dash-greeting {
  background: var(--surface-topbar);
  padding: 1.75rem 2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  overflow: hidden;
  max-height: 200px;
  transition: max-height 0.26s ease, padding 0.26s ease, opacity 0.2s ease;
}
/* Scrolling the dashboard down tucks the greeting away so more of the
   calendar is visible; scrolling back to the top brings it back. */
.ws-dash-greeting.is-collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}
.ws-dash-greeting__h1 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-inverse);
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
}
.ws-dash-greeting__sub {
  font-size: 0.875rem;
  color: var(--text-inverse-muted);
  margin: 0;
}
.ws-dash-greeting__date {
  font-size: 0.75rem;
  color: var(--text-inverse-muted);
  text-align: right;
  flex-shrink: 0;
}

/* KPI strip */
.ws-dash-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
}
.ws-dash-kpi {
  padding: 1.5rem 2rem;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ws-dash-kpi:last-child { border-right: none; }
.ws-dash-kpi__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ws-dash-kpi__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-serif);
}
.ws-dash-kpi__value--accent { color: var(--brand-gold-deep); }
.ws-dash-kpi__value--danger { color: var(--status-danger); }
.ws-dash-kpi__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main content area */
.ws-dash-body {
  padding: 2rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
}
.ws-dash-main {}
.ws-dash-aside {}

/* Section heading */
.ws-dash-section {
  margin-bottom: 2rem;
}
.ws-dash-section__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0 0 1.125rem;
}

/* Urgent deadlines */
.ws-urgent-tiles {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.ws-urgent-tile {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.125rem;
  min-width: 140px;
  flex: 1 1 140px;
  max-width: 200px;
}
.ws-urgent-tile.is-red  { border-left-color: var(--status-danger); }
.ws-urgent-tile.is-gold { border-left-color: var(--status-warning); }
.ws-urgent-tile.is-grey { border-left-color: var(--border-strong); }
.ws-urgent-tile__days {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-navy);
  line-height: 1;
  margin-bottom: 0.3rem;
  font-family: var(--font-serif);
}
.ws-urgent-tile.is-red  .ws-urgent-tile__days { color: var(--status-danger); }
.ws-urgent-tile.is-gold .ws-urgent-tile__days { color: var(--status-warning); }
.ws-urgent-tile__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-urgent-tile__matter {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Recent matter cards */
.ws-recent-matters {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.ws-recent-matter-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.125rem 1.375rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.ws-recent-matter-card:hover {
  border-color: var(--brand-gold);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}
.ws-recent-matter-card__badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-recessed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.ws-recent-matter-card__body { flex: 1; min-width: 0; }
.ws-recent-matter-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.125rem;
}
.ws-recent-matter-card__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.ws-recent-matter-card__status {
  display: inline-flex;
  padding: 0.1rem 0.4rem;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
}
.ws-recent-matter-card__status--active { background: var(--status-success-soft); color: var(--status-success); }
.ws-recent-matter-card__status--closed { background: var(--surface-recessed); color: var(--text-muted); }
.ws-recent-matter-card__cta {
  background: none;
  border: none;
  color: var(--brand-gold-deep);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.ws-recent-matter-card:hover .ws-recent-matter-card__cta { opacity: 1; }

/* Quick actions */
.ws-quick-actions {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}
.ws-quick-action {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}
.ws-quick-action:hover {
  border-color: var(--brand-gold);
  color: var(--brand-navy);
  background: var(--brand-gold-soft);
}
.ws-quick-action--primary {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: var(--surface-canvas);
}
.ws-quick-action--primary:hover {
  background: var(--brand-navy-deep);
  border-color: var(--brand-navy-deep);
  color: var(--surface-canvas);
}

/* Aside: practice stats */
.ws-dash-practice-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1rem;
}
.ws-dash-practice-card__header {
  background: var(--brand-navy);
  padding: 0.875rem 1.25rem;
}
.ws-dash-practice-card__title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-inverse-muted);
  margin: 0;
}
.ws-practice-rows {
  display: flex;
  flex-direction: column;
}
.ws-practice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.ws-practice-row:last-child { border-bottom: none; }
.ws-practice-row__label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.ws-practice-row__value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-navy);
  font-variant-numeric: tabular-nums;
}
.ws-practice-row__value--accent { color: var(--brand-gold-deep); }

/* Aside: activity feed */
.ws-dash-activity-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ws-dash-activity-card__header {
  background: var(--brand-navy);
  padding: 0.875rem 1.25rem;
}
.ws-dash-activity-card__title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-inverse-muted);
  margin: 0;
}
.ws-activity-feed {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}
.ws-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.ws-activity-item:last-child { border-bottom: none; }
.ws-activity-item__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-gold);
  margin-top: 0.3rem;
  flex-shrink: 0;
}
.ws-activity-item__body {
  flex: 1;
  min-width: 0;
}
.ws-activity-item__text {
  font-size: 0.8125rem;
  color: var(--text-primary);
  line-height: 1.4;
}
.ws-activity-item__time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}
.ws-activity-empty {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 1rem 1.25rem;
  margin: 0;
}

/* ── View header ──────────────────────────────────────────────────── */
.ws-view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--brand-navy-light);
  gap: 1rem;
}
.ws-view-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-inverse);
  margin: 0;
}
.ws-view-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

/* ── Placeholder states ───────────────────────────────────────────── */
.ws-clients-container {
  padding: 2rem;
}
.ws-clients-placeholder {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 420px;
  margin: 0 auto;
}
.ws-placeholder-icon {
  font-size: 2.5rem;
  color: var(--brand-gold);
  margin-bottom: 1rem;
}
.ws-placeholder-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-inverse);
  margin: 0 0 0.5rem;
}
.ws-placeholder-body {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  line-height: 1.6;
}

/* ── Paralegal grid (v10 styles below at end of file) ─────────────── */

/* ── Responsive dashboard ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .ws-dash-body {
    grid-template-columns: 1fr;
  }
  .ws-dash-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .ws-dash-kpi-strip { grid-template-columns: 1fr 1fr; }
  .ws-dash-body { padding: 1rem; }
  .ws-dash-greeting { padding: 1.25rem 1rem; }
  .ws-dash-greeting__date { display: none; }
}

/* ── Assistant v9 ─────────────────────────────────────────────────── */
/* (assistant styles consolidated below in v10 block) */

/* ═══════════════════════════════════════════════════════════════════
   Playground v10 — full-page layout
   ═══════════════════════════════════════════════════════════════════ */
#view-playground {
  background: var(--surface-canvas);
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden;
}

/* ── Wizard — fills the full view ── */
.ws-pg-wizard {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-elevated);
}
.ws-pg-stepper {
  background: var(--brand-navy-deep);
  padding: 0.875rem 3rem;
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(243, 250, 255,0.07);
}
.ws-pg-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}
.ws-pg-step__num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(243, 250, 255,0.15);
  color: rgba(243, 250, 255,0.6);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.ws-pg-step__lbl {
  font-size: 0.75rem;
  color: rgba(243, 250, 255,0.55);
  font-weight: 500;
}
.ws-pg-step.is-active .ws-pg-step__num { background: var(--brand-gold); color: var(--brand-navy-deep); }
.ws-pg-step.is-active .ws-pg-step__lbl { color: #F3FAFF; font-weight: 600; }
.ws-pg-step.is-done  .ws-pg-step__num { background: var(--status-success); color: var(--surface-canvas); }
.ws-pg-step.is-done  .ws-pg-step__lbl { color: rgba(243, 250, 255,0.4); }
.ws-pg-step-sep {
  width: 28px;
  height: 1px;
  background: rgba(243, 250, 255,0.2);
  flex-shrink: 0;
}
.ws-pg-wizard__body {
  flex: 1;
  overflow-y: auto;
  padding: 3rem 3rem 2rem;
  background: var(--surface-elevated);
}
.ws-pg-wizard__inner {
  max-width: 1140px;
  margin: 0 auto;
  width: 100%;
}
.ws-pg-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 1rem;
  align-items: stretch;
}
.ws-pg-card {
  position: relative;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.375rem 1.5rem 1.5rem;
  /* overflow must stay visible: the matter and jurisdiction dropdowns
     extend past the card's bounds */
}
.ws-pg-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, var(--surface-recessed), rgba(224, 234, 240, 0));
}
.ws-pg-card--span { grid-column: 1 / -1; }
.ws-pg-card__head { margin-bottom: 0.875rem; }
.ws-pg-card__title {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: var(--tracking-snug);
  color: var(--brand-navy);
}
.ws-pg-card__hint {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0.25rem 0 0;
}
@media (max-width: 900px) {
  .ws-pg-grid { grid-template-columns: 1fr; }
}
.ws-pg-wizard__title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand-navy);
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}
.ws-pg-wizard__footer {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 3rem;
  background: var(--surface-canvas);
  border-top: 1px solid var(--border-subtle);
}
/* ── Matter dropdown picker ── */
.ws-pg-matter-picker {
  position: relative;
  max-width: 500px;
}
.ws-pg-matter-picker__trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-canvas);
  padding: 0.65rem 0.875rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ws-pg-matter-picker__trigger:focus-visible,
.ws-pg-matter-picker__trigger[aria-expanded="true"] {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px var(--brand-gold-soft);
  outline: none;
}
.ws-pg-matter-picker__label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-pg-matter-picker__label.is-placeholder { color: var(--text-muted); }
.ws-pg-matter-picker__chevron {
  font-size: 0.625rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ws-pg-matter-picker__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 50;
  overflow: hidden;
}
.ws-pg-matter-picker__filter {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--surface-recessed);
  outline: none;
}
.ws-pg-matter-picker__filter::placeholder { color: var(--text-muted); }
.ws-pg-matter-picker__list {
  max-height: 240px;
  overflow-y: auto;
}
.ws-pg-matter-picker__loading,
.ws-pg-matter-picker__empty {
  padding: 0.875rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}
.ws-pg-matter-picker__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 1rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--border-subtle);
}
.ws-pg-matter-picker__item:last-child { border-bottom: none; }
.ws-pg-matter-picker__item:hover { background: var(--surface-recessed); }
.ws-pg-matter-picker__item.is-selected { background: var(--brand-gold-soft); }
.ws-pg-matter-picker__item-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-pg-matter-picker__item-ref {
  font-size: 0.6875rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-family: var(--font-mono, monospace);
}

/* Scoped form styles within wizard */
.ws-pg-wizard .form-group {
  margin-bottom: 1.75rem;
  gap: 0.5rem;
}
.ws-pg-wizard .form-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ws-pg-input-row { display: flex; align-items: flex-start; gap: 8px; }
.ws-pg-input-row .ws-pg-textarea { flex: 1; min-width: 0; }
.ws-pg-input-row .ws-mic-btn { margin-top: 0; flex-shrink: 0; }
.ws-pg-wizard textarea.form-input {
  height: auto;
  min-height: 88px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  resize: none;
  border-color: var(--border-subtle);
  background: var(--surface-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
}
.ws-pg-wizard textarea.form-input:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px var(--brand-gold-soft);
}
.ws-pg-wizard select.form-input {
  border-color: var(--border-subtle);
  background: var(--surface-canvas);
  color: var(--text-primary);
  font-size: 0.875rem;
  height: 42px;
}
.ws-pg-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface-recessed);
  border-left: 3px solid var(--brand-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.ws-pg-toggle {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: fit-content;
  background: var(--surface-canvas);
  margin-bottom: 0.875rem;
}
.ws-pg-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 1.375rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
}
.ws-pg-toggle-btn.is-active {
  background: var(--brand-navy);
  color: var(--surface-canvas);
  font-weight: 600;
}
/* ── Mode cards ── */
.ws-pg-modes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.875rem;
}
.ws-pg-mode-card {
  background: var(--surface-canvas);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.ws-pg-mode-card:hover {
  border-color: var(--brand-gold);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-sm);
}
.ws-pg-mode-card input[type="radio"] { display: none; }
.ws-pg-mode-card.is-selected,
.ws-pg-mode-card:has(input:checked) {
  border-color: var(--brand-gold);
  border-width: 2px;
  background: var(--color-gold-bg);
  box-shadow: 0 0 0 3px var(--brand-gold-soft);
}
.ws-pg-mode-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(51, 86, 109, 0.10);
  color: var(--brand-gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.ws-pg-mode-svg { width: 20px; height: 20px; display: block; }
.ws-pg-mode-card:has(input:checked) .ws-pg-mode-card__icon {
  background: var(--brand-gold);
  color: var(--surface-canvas);
}
.ws-pg-mode-card__label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 0.375rem;
  font-family: var(--font-serif);
}
.ws-pg-mode-card__desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ── Role cards ── */
.ws-pg-roles { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ws-pg-role-card {
  background: var(--surface-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 1.125rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ws-pg-role-card:hover { border-color: var(--brand-navy); color: var(--text-primary); }
.ws-pg-role-card input[type="radio"] { display: none; }
.ws-pg-role-card.is-selected,
.ws-pg-role-card:has(input:checked) {
  border-color: var(--brand-navy);
  background: var(--brand-navy);
  color: var(--surface-canvas);
  font-weight: 600;
}

/* ── Lawyer cards ── */
.ws-pg-lawyers { display: flex; flex-direction: column; gap: 0.875rem; }
.ws-pg-lawyer-card {
  background: var(--surface-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ws-pg-lawyer-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.ws-pg-lawyer-card.is-selected {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px var(--brand-gold-soft);
}
.ws-pg-lawyer-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.0625rem;
  color: #F3FAFF;
  flex-shrink: 0;
  border: 2px solid rgba(243, 250, 255,0.2);
}
.ws-pg-lawyer-info { flex: 1; min-width: 0; }
.ws-pg-lawyer-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.2rem; }
.ws-pg-lawyer-style { font-size: 0.8125rem; color: var(--brand-gold-deep); font-style: italic; margin-bottom: 0.5rem; }
.ws-pg-lawyer-bio { font-size: 0.8125rem; color: var(--text-secondary); margin: 0; line-height: 1.5; }
.ws-pg-juror-note {
  background: var(--surface-recessed);
  border-left: 3px solid var(--brand-gold);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

/* ── Difficulty / Duration ── */
.ws-pg-difficulty, .ws-pg-duration { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.ws-pg-diff-btn, .ws-pg-dur-btn {
  background: var(--surface-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.375rem 1.125rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: var(--font-sans);
}
.ws-pg-diff-btn:hover, .ws-pg-dur-btn:hover { border-color: var(--brand-navy); color: var(--text-primary); }
.ws-pg-diff-btn input, .ws-pg-dur-btn input { display: none; }
.ws-pg-diff-btn.is-active, .ws-pg-dur-btn.is-active,
.ws-pg-diff-btn:has(input:checked), .ws-pg-dur-btn:has(input:checked) {
  border-color: var(--brand-navy);
  background: var(--brand-navy);
  color: var(--surface-canvas);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════
   Arena — dark immersive session
   ═══════════════════════════════════════════════════════════════════ */
.ws-pg-session {
  display: grid;
  grid-template-columns: 200px 1fr 240px;
  flex: 1;
  overflow: hidden;
}
.ws-pg-opponent-panel {
  background: var(--brand-navy-deep);
  border-right: 1px solid rgba(243, 250, 255,0.08);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}
.ws-pg-opponent-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: #F3FAFF;
  border: 2px solid rgba(243, 250, 255,0.15);
  margin-bottom: 0.25rem;
}
.ws-pg-opponent-name { font-size: 0.9375rem; font-weight: 700; color: var(--text-inverse); }
.ws-pg-opponent-style { font-size: 0.75rem; color: var(--brand-gold); font-style: italic; line-height: 1.4; }
.ws-pg-session-meta { font-size: 0.6875rem; color: rgba(243, 250, 255,0.4); line-height: 1.65; margin-top: 0.5rem; }
.ws-pg-end-btn { margin-top: auto !important; }
.ws-pg-transcript-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--brand-navy);
  border-right: 1px solid rgba(243, 250, 255,0.06);
}
.ws-pg-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}
.ws-pg-transcript-empty { color: rgba(243, 250, 255,0.35); font-size: 0.875rem; text-align: center; padding: 2.5rem 0; font-style: italic; }
.ws-pg-msg { display: flex; gap: 0.75rem; max-width: 88%; }
.ws-pg-msg--user { align-self: flex-end; flex-direction: row-reverse; }
.ws-pg-msg__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #F3FAFF;
  flex-shrink: 0;
  border: 1.5px solid rgba(243, 250, 255,0.15);
}
.ws-pg-msg__bubble {
  background: rgba(243, 250, 255,0.06);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-inverse-muted);
  border: 1px solid rgba(243, 250, 255,0.1);
}
.ws-pg-msg--user .ws-pg-msg__bubble {
  background: var(--brand-gold);
  border: none;
  color: var(--brand-navy-deep);
  font-weight: 500;
  border-radius: 10px 10px 2px 10px;
}
.ws-pg-msg--opponent .ws-pg-msg__bubble {
  border-left: 3px solid var(--opp-color, var(--brand-gold));
  border-radius: 2px 10px 10px 10px;
  background: rgba(243, 250, 255,0.04);
}
.ws-pg-msg--error .ws-pg-msg__bubble { border-color: var(--status-danger); color: var(--status-danger-soft); }
.ws-pg-composer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(243, 250, 255,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  background: var(--brand-navy-deep);
}
.ws-pg-input {
  width: 100%;
  background: rgba(243, 250, 255,0.07);
  border: 1px solid rgba(243, 250, 255,0.15);
  border-radius: var(--radius-md);
  color: var(--text-inverse);
  font-size: 0.875rem;
  padding: 0.75rem;
  resize: none;
  font-family: var(--font-sans);
  line-height: 1.5;
  transition: border-color 0.15s;
}
.ws-pg-input:focus { outline: none; border-color: var(--brand-gold); }
.ws-pg-input::placeholder { color: rgba(243, 250, 255,0.3); }
.ws-pg-composer-btns { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* ── Juror sidebar ── */
.ws-pg-juror-sidebar {
  background: var(--brand-navy-deep);
  padding: 1.25rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ws-pg-juror-title { font-size: 0.625rem; font-weight: 700; letter-spacing: 0.1em; color: rgba(243, 250, 255,0.35); text-transform: uppercase; }
.ws-pg-juror-card {
  background: rgba(243, 250, 255,0.04);
  border-radius: var(--radius-md);
  padding: 0.875rem;
  border: 1px solid rgba(243, 250, 255,0.08);
}
.ws-pg-juror-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.ws-pg-juror-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 700;
  color: #F3FAFF;
  flex-shrink: 0;
}
.ws-pg-juror-name { font-size: 0.8125rem; font-weight: 600; color: var(--text-inverse); }
.ws-pg-juror-pending { font-size: 0.75rem; color: rgba(243, 250, 255,0.35); margin: 0; font-style: italic; }
.ws-pg-scores { display: flex; flex-direction: column; gap: 0.4rem; }
.ws-pg-score-row { display: flex; align-items: center; gap: 0.375rem; }
.ws-pg-score-label { font-size: 0.625rem; color: rgba(243, 250, 255,0.4); width: 54px; flex-shrink: 0; }
.ws-pg-score-bar { flex: 1; height: 4px; background: rgba(243, 250, 255,0.1); border-radius: 2px; overflow: hidden; }
.ws-pg-score-fill { height: 100%; background: var(--brand-gold); border-radius: 2px; transition: width 0.4s ease; }
.ws-pg-score-val { font-size: 0.625rem; font-weight: 700; color: var(--brand-gold); width: 14px; text-align: right; }
.ws-pg-score-comment { font-size: 0.6875rem; color: rgba(243, 250, 255,0.4); margin: 0.5rem 0 0; line-height: 1.45; font-style: italic; }

/* ── Post-session report ── */
.ws-pg-report {
  flex: 1;
  overflow-y: auto;
  padding: 2.5rem 3rem;
  background: var(--surface-elevated);
}
.ws-pg-report__title { font-family: var(--font-serif); font-size: 1.375rem; font-weight: 700; color: var(--text-primary); margin: 0 0 0.5rem; }
.ws-pg-report__meta { font-size: 0.875rem; color: var(--text-muted); margin: 0 0 1.5rem; }
.ws-pg-report__section { margin-bottom: 1.5rem; }
.ws-pg-report__section-title { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 0.75rem; }
.ws-pg-report__transcript {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}
.ws-pg-report__msg { display: flex; flex-direction: column; gap: 0.2rem; }
.ws-pg-report__msg--user { align-items: flex-end; }
.ws-pg-report__speaker { font-size: 0.625rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ws-pg-report__text { background: var(--surface-recessed); border-radius: var(--radius-md); padding: 0.625rem 0.875rem; font-size: 0.8125rem; color: var(--text-primary); max-width: 80%; line-height: 1.5; }
.ws-pg-report__msg--user .ws-pg-report__text { background: var(--brand-navy); color: var(--surface-canvas); }
.ws-pg-report__actions { margin-top: 1.5rem; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .ws-pg-wizard__body  { padding: 1.5rem 1.25rem; }
  .ws-pg-wizard__footer { padding: 1rem 1.25rem; }
  .ws-pg-stepper { padding: 0.875rem 1.25rem; }
  .ws-pg-session { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .ws-pg-opponent-panel { flex-direction: row; text-align: left; padding: 1rem 1.25rem; }
  .ws-pg-juror-sidebar { display: none; }
}

/* ── Folder breadcrumb (§3.3) ─────────────────────────────────────── */
.ws-docs-breadcrumb {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ws-bc-back {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 0;
  width: fit-content;
  transition: color 0.15s;
}
.ws-bc-back:hover { color: var(--brand-gold); }
.ws-bc-path {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.ws-bc-seg {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.ws-bc-seg:hover { color: var(--brand-gold); }
.ws-bc-seg--current {
  color: var(--text-inverse);
  font-weight: 600;
  pointer-events: none;
}
.ws-bc-sep {
  font-size: 0.875rem;
  color: var(--text-inverse-muted);
}

/* ── New folder dialog (§11) ──────────────────────────────────────── */
#ws-new-folder-dlg {
  background: var(--brand-navy-deep);
  border: 1px solid var(--brand-navy-light);
  border-radius: 12px;
  padding: 0;
  max-width: 480px;
  width: 100%;
  color: var(--surface-canvas);
  box-shadow: 0 20px 60px rgba(10, 37, 54,0.5);
}
#ws-new-folder-dlg::backdrop {
  background: rgba(10, 37, 54,0.6);
  backdrop-filter: blur(2px);
}
.ws-nf-form {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ws-nf-heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-inverse);
  margin: 0 0 0.25rem;
}
.ws-nf-vis-row {
  display: flex;
  gap: 0.5rem;
}
.ws-nf-vis-opt {
  background: var(--brand-navy-mid);
  border: 2px solid var(--brand-navy-light);
  border-radius: 6px;
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.ws-nf-vis-opt input[type="radio"] { display: none; }
.ws-nf-vis-opt:has(input:checked) { border-color: var(--brand-gold); color: var(--text-inverse); font-weight: 600; }
.ws-nf-colors {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.ws-nf-color-swatch {
  cursor: pointer;
  position: relative;
}
.ws-nf-color-swatch input[type="radio"] { display: none; }
.ws-nf-color-swatch span {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
}
.ws-nf-color-swatch:has(input:checked) span {
  border-color: #F3FAFF;
  transform: scale(1.2);
}
.ws-nf-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--brand-navy-light);
  margin-top: 0.5rem;
}

/* ── v10: Page canvas ── */
.ws-body { background: var(--surface-canvas); }

/* ── v10: Dashboard stat tiles ── */
.ws-stat-tile {
  background: var(--surface-sidebar);
  color: var(--text-inverse);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-md);
}
.ws-stat-tile__eyebrow {
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-inverse-muted);
  margin-bottom: 0.5rem;
}
.ws-stat-tile__value {
  font-size: 2rem;
  font-family: var(--font-serif);
  color: var(--brand-gold-soft);
  font-weight: 400;
  line-height: 1.1;
}
.ws-stat-tile__label {
  font-size: 0.75rem;
  color: var(--text-inverse-muted);
  margin-top: 0.25rem;
}

/* ── v10: Status pills ── */
.sb-status-pill--active   { background: var(--status-success-soft); color: var(--status-success); }
.sb-status-pill--closed   { background: var(--surface-recessed);    color: var(--text-muted); }
.sb-status-pill--pending  { background: var(--status-warning-soft); color: var(--status-warning); }
.sb-status-pill--draft    { background: var(--status-info-soft);    color: var(--status-info); }

/* ── v10: Matter stage indicator ── */
.ws-stage-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0.875rem 1.75rem;
  background: var(--brand-navy);
  border-bottom: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.ws-stage-bar::-webkit-scrollbar { display: none; }
.ws-stage-step {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 0;
}
.ws-stage-step__dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(243, 250, 255,0.25);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 700;
  color: rgba(243, 250, 255,0.4);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.ws-stage-step__dot.is-done {
  background: rgba(243, 250, 255,0.15);
  border-color: rgba(243, 250, 255,0.5);
  color: rgba(243, 250, 255,0.9);
}
.ws-stage-step__dot.is-current {
  background: var(--brand-gold);
  border-color: var(--brand-gold);
  color: var(--brand-navy-deep);
  box-shadow: 0 0 0 3px rgba(51, 86, 109,0.3);
}
.ws-stage-step__label {
  font-size: 0.6875rem;
  color: rgba(243, 250, 255,0.4);
  margin-left: 0.375rem;
  white-space: nowrap;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-stage-step.is-current .ws-stage-step__label {
  color: var(--brand-gold);
  font-weight: 600;
}
.ws-stage-step.is-done .ws-stage-step__label { color: rgba(243, 250, 255,0.65); }
.ws-stage-step__connector {
  flex: 1;
  height: 1px;
  background: rgba(243, 250, 255,0.12);
  margin: 0 0.5rem;
  min-width: 16px;
}
.ws-stage-step.is-done + .ws-stage-step .ws-stage-step__connector,
.ws-stage-step__connector.is-done { background: rgba(243, 250, 255,0.35); }

/* ── v10: Action panel ── */
.ws-action-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--border-subtle);
}
.ws-action-group {
  padding: 1.25rem 1.5rem;
  border-right: 1px solid var(--border-subtle);
}
.ws-action-group:last-child { border-right: none; }
.ws-action-group__header {
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--border-subtle);
}
.ws-action-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.875rem 1rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
  position: relative;
  margin-bottom: 0.625rem;
}
.ws-action-card:last-child { margin-bottom: 0; }
.ws-action-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(10, 37, 54,0.08);
  border-color: var(--border-strong);
}
.ws-action-card__icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-recessed);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.625rem;
  font-size: 0.875rem;
  color: var(--brand-navy);
  flex-shrink: 0;
}
.ws-action-card__title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--brand-navy-deep);
  line-height: 1.2;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}
.ws-action-card__desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}
.ws-action-card__run {
  font-size: 0.6875rem;
  color: var(--brand-gold-deep);
  font-weight: 700;
  text-align: right;
  margin-top: 0.625rem;
  letter-spacing: 0.01em;
}
.ws-action-card:hover .ws-action-card__run { text-decoration: underline; }
.ws-action-card[disabled], .ws-action-card.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.ws-action-card.is-running { opacity: 0.6; pointer-events: none; }

/* ── AI run loader ── */
.ws-ai-loader {
  margin: 1rem 1.75rem 1.5rem;
  padding: 1rem 1.25rem 1.125rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  max-width: 560px;
}
.ws-ai-loader__row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.875rem; }
.ws-ai-loader__orb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-recessed);
  color: var(--brand-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: ws-orb-pulse 1.6s ease-in-out infinite;
}
.ws-ai-loader__orb--error { animation: none; background: rgba(220, 38, 38, 0.08); color: #dc2626; }
@keyframes ws-orb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(10, 37, 54, 0.16); }
  50%      { box-shadow: 0 0 0 9px rgba(10, 37, 54, 0); }
}
.ws-ai-loader__title { font-size: 0.8125rem; font-weight: 700; color: var(--brand-navy-deep); }
.ws-ai-loader__phase { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.ws-ai-loader__bar {
  height: 3px;
  border-radius: 999px;
  background: var(--surface-recessed);
  overflow: hidden;
  position: relative;
}
.ws-ai-loader__bar span {
  position: absolute;
  left: -40%;
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: var(--brand-navy);
  animation: ws-bar-slide 1.5s ease-in-out infinite;
}
@keyframes ws-bar-slide { 0% { left: -40%; } 60% { left: 100%; } 100% { left: 100%; } }
.ws-ai-loader--error .ws-ai-loader__bar { display: none; }

/* ── Attach template chip (DRAFT tools) ── */
.ws-tpl-chip {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 55%;
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-navy-soft);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ws-tpl-chip:hover {
  border-color: var(--brand-navy);
  color: var(--brand-navy-deep);
}
.ws-tpl-chip.is-attached {
  border-style: solid;
  border-color: var(--brand-navy);
  background: var(--brand-gold-soft);
  color: var(--brand-navy-deep);
}
.ws-tpl-chip__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-tpl-chip svg { flex-shrink: 0; }

/* ── Template popover ── */
.ws-tpl-pop {
  position: fixed;
  z-index: 1200;
  width: 300px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(10, 37, 54, 0.18);
  overflow: hidden;
}
.ws-tpl-pop__header {
  padding: 0.75rem 1rem 0.125rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--brand-navy-deep);
}
.ws-tpl-pop__sub {
  padding: 0 1rem 0.625rem;
  font-size: 0.6875rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}
.ws-tpl-pop__list {
  max-height: 216px;
  overflow-y: auto;
  padding: 0.375rem;
}
.ws-tpl-pop__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  background: none;
  border: none;
  border-radius: 7px;
  font-size: 0.75rem;
  color: var(--brand-navy-deep);
  text-align: left;
  cursor: pointer;
}
.ws-tpl-pop__row:hover { background: var(--surface-recessed); }
.ws-tpl-pop__radio {
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-tpl-pop__row.is-selected .ws-tpl-pop__radio {
  border-color: var(--brand-navy);
  box-shadow: inset 0 0 0 3px var(--surface-elevated);
  background: var(--brand-navy);
}
.ws-tpl-pop__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-tpl-pop__hint { color: var(--text-muted); font-size: 0.6875rem; }
.ws-tpl-pop__delete {
  display: none;
  color: var(--text-muted);
  flex-shrink: 0;
  padding: 2px;
  border-radius: 4px;
}
.ws-tpl-pop__row:hover .ws-tpl-pop__delete { display: inline-flex; }
.ws-tpl-pop__delete:hover { color: #dc2626; background: rgba(220, 38, 38, 0.08); }
.ws-tpl-pop__footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-top: 1px solid var(--border-subtle);
}
.ws-tpl-pop__formats {
  font-size: 0.625rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── v10: Document row ── */
.ws-doc-row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.ws-doc-row:hover {
  background: var(--surface-recessed);
}
.ws-doc-row.is-selected {
  border-left: 3px solid var(--brand-gold);
  background: var(--surface-elevated);
}
.ws-doc-row__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}
.ws-doc-row__body { flex: 1; min-width: 0; }
.ws-doc-row__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-doc-row__meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}
.ws-doc-row__actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

/* ── v10: Documents 3-pane ── */
.ws-docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr 360px;
  height: 100%;
  overflow: hidden;
}
.ws-docs-layout--no-detail {
  grid-template-columns: 240px 1fr;
}
.ws-docs-folder-pane {
  border-right: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  overflow-y: auto;
  padding: 1rem 0;
}
.ws-docs-list-pane {
  overflow-y: auto;
  padding: 1.25rem;
  background: var(--surface-canvas);
}
.ws-docs-detail-pane {
  border-left: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  overflow-y: auto;
  padding: 1.5rem;
}

/* ── v10: Assistant ── */
/* view-assistant full-height anchor */
#view-assistant {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden;
}
.ws-assist-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--surface-canvas);
}

/* ── Assistant: sidebar + main split (v13) ─────────────────────────────────── */
.ws-assist-wrap.ws-assist-wrap--with-sidebar {
  flex-direction: row;
}
.ws-assist-sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ws-assist-sidebar__head {
  padding: 0.875rem 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.ws-assist-new-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.875rem;
  background: var(--brand-navy);
  color: var(--surface-canvas);
  border: none;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.ws-assist-new-btn:hover { background: var(--brand-navy-deep); }
.ws-assist-sidebar__list {
  flex: 1;
  overflow-y: auto;
  padding: 0.375rem 0;
}
.ws-assist-side-item {
  display: flex;
  align-items: stretch;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.ws-assist-side-item:hover {
  background: var(--surface-recessed);
}
.ws-assist-side-item.is-active {
  background: var(--surface-recessed);
  border-left-color: var(--brand-gold);
}
.ws-assist-side-item__main {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.625rem 0.875rem;
  font-family: inherit;
}
.ws-assist-side-item__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}
.ws-assist-side-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.ws-assist-side-time { margin-left: auto; }
.ws-assist-side-matter {
  background: rgba(51, 86, 109,0.12);
  color: var(--brand-gold-deep);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-assist-side-shared {
  background: rgba(10, 37, 54,0.07);
  color: var(--brand-navy);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-weight: 500;
}
.ws-assist-share-dot { color: var(--brand-gold); font-size: 0.65rem; vertical-align: middle; }
.ws-assist-side-item__menu {
  background: transparent;
  border: none;
  width: 26px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  align-self: stretch;
}
.ws-assist-side-item__menu:hover { color: var(--brand-navy); background: rgba(10, 37, 54,0.05); }

.ws-assist-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ws-assist-title-edit {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-left: 0.4rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
}
.ws-assist-title-edit:hover { background: rgba(10, 37, 54,0.06); color: var(--brand-navy); }

.ws-assist-actions { display: inline-flex; gap: 0.5rem; flex-shrink: 0; }
.ws-assist-action-btn {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--brand-navy);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.625rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.ws-assist-action-btn:hover { border-color: var(--brand-gold); background: var(--color-gold-bg); }

.ws-assist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.625rem;
}
.ws-assist-matter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(51, 86, 109,0.12);
  color: var(--brand-gold-deep);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.ws-assist-matter-chip strong { color: var(--brand-navy); font-weight: 700; }
.ws-assist-matter-chip__x {
  background: rgba(10, 37, 54,0.08);
  border: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.6875rem;
  cursor: pointer;
  color: var(--brand-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ws-assist-link-btn {
  background: var(--surface-elevated);
  border: 1px dashed var(--brand-gold);
  color: var(--brand-gold);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.ws-assist-link-btn:hover { background: var(--color-gold-bg); }

@media (max-width: 880px) {
  .ws-assist-wrap.ws-assist-wrap--with-sidebar { flex-direction: column; }
  .ws-assist-sidebar { width: 100%; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border-subtle); }
}
.ws-assist-header {
  padding: 1.25rem 2rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  flex-shrink: 0;
}
.ws-assist-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.ws-assist-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin: 0;
  font-family: var(--font-serif);
}
.ws-assist-tabs {
  display: flex;
  background: var(--surface-recessed);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}
.ws-assist-tab {
  padding: 0.3rem 0.875rem;
  border-radius: 100px;
  border: none;
  background: none;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.ws-assist-tab.is-active {
  background: var(--surface-elevated);
  color: var(--brand-navy);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}
.ws-assist-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0;
}
.ws-assist-context-strip {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0 0;
}
.ws-assist-context-chip {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  background: var(--brand-gold-soft);
  color: var(--brand-gold-deep);
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 500;
  cursor: pointer;
}
.ws-assist-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ws-assist-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}
.ws-assist-empty__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--brand-gold);
}
.ws-assist-empty__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-navy);
  margin-bottom: 1.25rem;
}
.ws-assist-empty__chips {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.ws-assist-msg--user {
  display: flex;
  justify-content: flex-end;
}
.ws-assist-bubble--user {
  background: var(--brand-navy);
  color: var(--surface-canvas);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
  max-width: 75%;
  font-size: 0.875rem;
  line-height: 1.5;
}
.ws-assist-msg--assistant { display: flex; align-items: flex-start; gap: 0.5rem; }
.ws-assist-bubble--assistant {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--brand-gold);
  padding: 1.125rem 1.25rem;
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
  max-width: 88%;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(10, 37, 54, 0.04);
}

/* ── Rich AI answer styling (section titles, paragraphs, lists, quotes) ── */
.ws-assist-bubble--assistant .ws-assist-bubble__text { font-size: 0.9375rem; line-height: 1.65; }
.ws-assist-bubble--assistant .result-content > *:first-child { margin-top: 0 !important; }
.ws-assist-bubble--assistant .result-content > *:last-child  { margin-bottom: 0 !important; }

.ws-assist-bubble--assistant .rm-h1,
.ws-assist-bubble--assistant .rm-h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--brand-navy);
  letter-spacing: -0.005em;
  margin: 1.1rem 0 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
}
.ws-assist-bubble--assistant .rm-h1 { font-size: 1.125rem; }
.ws-assist-bubble--assistant .rm-h2 { font-size: 1rem; }
.ws-assist-bubble--assistant .rm-h2::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-gold);
  margin-right: 0.5rem;
  vertical-align: middle;
  transform: translateY(-1px);
}
.ws-assist-bubble--assistant .rm-h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.9rem 0 0.3rem;
  text-transform: none;
  letter-spacing: 0;
}
.ws-assist-bubble--assistant p {
  margin: 0 0 0.7rem;
  line-height: 1.7;
  color: var(--text-primary);
}
.ws-assist-bubble--assistant strong { color: var(--brand-navy); font-weight: 700; }
.ws-assist-bubble--assistant em     { color: var(--text-primary); }
.ws-assist-bubble--assistant ul,
.ws-assist-bubble--assistant ol {
  margin: 0.4rem 0 0.85rem 1.25rem !important;
  padding: 0 !important;
}
.ws-assist-bubble--assistant li {
  margin: 0.25rem 0;
  line-height: 1.65;
}
.ws-assist-bubble--assistant ul li::marker { color: var(--brand-gold); }
.ws-assist-bubble--assistant .rm-quote {
  margin: 0.7rem 0 0.9rem;
  padding: 0.65rem 1rem;
  border-left: 3px solid var(--brand-gold);
  background: var(--brand-gold-soft, rgba(51, 86, 109, 0.08));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  line-height: 1.7;
  color: var(--text-primary);
}
.ws-assist-bubble--assistant .rm-code {
  background: var(--surface-recessed);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.85em;
}
.ws-assist-citations {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.ws-assist-citation {
  padding: 0.15rem 0.5rem;
  background: var(--surface-recessed);
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.ws-assist-provenance {
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.ws-assist-suggestions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  overflow-x: auto;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  scrollbar-width: none;
}
.ws-assist-suggestions::-webkit-scrollbar { display: none; }
.ws-assist-chip {
  flex-shrink: 0;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  background: var(--surface-elevated);
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.ws-assist-chip:hover {
  border-color: var(--brand-gold);
  color: var(--brand-gold-deep);
  background: var(--brand-gold-soft);
}
/* AI-suggested next questions, rendered under the newest answer */
.ws-assist-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.625rem;
}
.ws-assist-followups .ws-assist-chip {
  white-space: normal;
  text-align: left;
}
.ws-assist-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 1rem 2rem 1.25rem;
  background: var(--surface-elevated);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.ws-assist-input {
  flex: 1;
  resize: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--surface-elevated);
  outline: none;
  min-height: 56px;
  max-height: 240px;
  line-height: 1.5;
  transition: border-color var(--transition-fast);
}
.ws-assist-input:focus { border-color: var(--border-focus); }
.ws-assist-send {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--brand-gold);
  color: var(--brand-navy-deep);
  border: none;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}
.ws-assist-send:hover { background: var(--brand-gold-deep); color: var(--surface-canvas); }
.ws-assist-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Thinking indicator (rotating status while waiting for response) ── */
.ws-assist-thinking__bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  background: linear-gradient(
    100deg,
    var(--surface-elevated) 0%,
    var(--brand-gold-soft, rgba(51, 86, 109, 0.08)) 50%,
    var(--surface-elevated) 100%
  );
  background-size: 200% 100%;
  animation: ws-assist-shimmer 2.4s ease-in-out infinite;
}
.ws-assist-thinking__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-gold);
  box-shadow: 0 0 0 0 var(--brand-gold);
  animation: ws-assist-pulse 1.4s ease-out infinite;
  flex-shrink: 0;
}
.ws-assist-thinking__text {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-style: italic;
  letter-spacing: 0.01em;
  animation: ws-assist-fadein 0.32s ease-out both;
}
.ws-assist-thinking__text.is-in {
  animation: ws-assist-fadein 0.32s ease-out both;
}
.ws-assist-thinking__dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 2px;
}
.ws-assist-thinking__dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
  animation: ws-assist-dot 1.2s ease-in-out infinite;
}
.ws-assist-thinking__dots i:nth-child(2) { animation-delay: 0.18s; }
.ws-assist-thinking__dots i:nth-child(3) { animation-delay: 0.36s; }

@keyframes ws-assist-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes ws-assist-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(51, 86, 109, 0.55); transform: scale(0.95); }
  70%  { box-shadow: 0 0 0 10px rgba(51, 86, 109, 0);  transform: scale(1.05); }
  100% { box-shadow: 0 0 0 0 rgba(51, 86, 109, 0);    transform: scale(0.95); }
}
@keyframes ws-assist-fadein {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ws-assist-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40%           { opacity: 1;   transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .ws-assist-thinking__bubble,
  .ws-assist-thinking__pulse,
  .ws-assist-thinking__text,
  .ws-assist-thinking__dots i {
    animation: none;
  }
}

/* ── v10: Stage action results panel ── */
.ws-results-panel {
  margin: 1rem 1.5rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ws-results-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--surface-recessed);
  border-bottom: 1px solid var(--border-subtle);
}
.ws-results-panel__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-navy);
  text-transform: capitalize;
}
.ws-results-panel__meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.ws-results-panel__body { padding: 1rem; }
.ws-result-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ws-result-item:last-child { border-bottom: none; }
.ws-finding-type {
  display: inline-flex;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ws-finding-type--discrepancy { background: var(--status-warning-soft); color: var(--status-warning); }
.ws-finding-type--issue       { background: var(--status-danger-soft);  color: var(--status-danger); }
.ws-finding-type--citation    { background: var(--status-info-soft);    color: var(--status-info); }
.ws-finding-type--gap         { background: var(--status-warning-soft); color: var(--status-warning); }
.ws-result-text { font-size: 0.875rem; color: var(--text-primary); line-height: 1.5; }
.ws-results-panel__actions {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}
.ws-results-suggested {
  padding: 0.875rem 1rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-recessed);
}
.ws-results-suggested__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.ws-results-suggested__chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── v10: Client wizard ── */
.ws-client-wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(10, 37, 54, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.ws-client-wizard {
  width: 100%;
  max-width: 860px;
  height: 90vh;
  max-height: 820px;
  background: var(--surface-canvas);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(10, 37, 54, 0.28);
  position: relative;
}
.ws-client-wizard__header {
  padding: 1.25rem 1.75rem 0;
  background: var(--brand-navy);
  color: var(--surface-canvas);
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}
.ws-client-wizard__title {
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-weight: 700;
  color: #F3FAFF;
  margin: 0 0 1.125rem;
  letter-spacing: -0.01em;
  display: block;
}
.ws-client-wizard__step-dots {
  display: flex;
  gap: 0.5rem;
  padding-bottom: 0;
  margin-bottom: 0;
}
.ws-client-wizard__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(243, 250, 255,0.2);
  transition: background var(--transition-fast);
}
.ws-client-wizard__dot.is-active { background: var(--brand-gold); }
.ws-client-wizard__dot.is-done   { background: rgba(51, 86, 109,0.55); }
.ws-client-wizard__header-bottom {
  height: 3px;
  background: var(--brand-gold);
  margin-top: 0.875rem;
  border-radius: 3px 3px 0 0;
}
.ws-client-wizard__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.75rem 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}
.ws-client-wizard__footer {
  padding: 0.875rem 1.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-elevated);
  flex-shrink: 0;
}
.ws-client-wizard__footer .btn { height: 32px; padding: 0 1rem; font-size: 0.75rem; border-radius: 8px; }
.ws-client-wizard__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(243, 250, 255,0.12);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.8125rem;
  color: rgba(243, 250, 255,0.75);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.ws-client-wizard__close:hover {
  background: rgba(243, 250, 255,0.22);
  color: #F3FAFF;
}
@media (max-width: 900px) {
  .ws-client-wizard-overlay { padding: 0; }
  .ws-client-wizard { max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
}

/* ── Client wizard: form polish ─────────────────────────────────────────── */
.ws-client-wizard__body .form-group {
  margin-bottom: 1rem;
}
.ws-client-wizard__body .form-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted, rgba(10, 37, 54, 0.5));
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}
.ws-client-wizard__body .form-input,
.ws-client-wizard__body textarea.form-input,
.ws-client-wizard__body select.form-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4375rem 0.625rem;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  color: var(--brand-navy);
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(10, 37, 54, 0.04);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  outline: none;
  appearance: none;
}
.ws-client-wizard__body .form-input::placeholder,
.ws-client-wizard__body textarea.form-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}
.ws-client-wizard__body .form-input:hover,
.ws-client-wizard__body textarea.form-input:hover,
.ws-client-wizard__body select.form-input:hover {
  border-color: var(--border-strong);
  background: var(--surface-canvas);
}
.ws-client-wizard__body .form-input:focus,
.ws-client-wizard__body textarea.form-input:focus,
.ws-client-wizard__body select.form-input:focus {
  border-color: var(--brand-gold);
  background: var(--surface-elevated);
  box-shadow: 0 0 0 4px rgba(51, 86, 109, 0.16);
}
.ws-client-wizard__body select.form-input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%230B2545' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}
.ws-client-wizard__body textarea.form-input {
  min-height: 76px;
  resize: none;
  line-height: 1.5;
}

/* Custom radio pill group */
.ws-client-wizard__body .cw-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ws-client-wizard__body .cw-radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.4375rem 0.8rem 0.4375rem 0.7rem;
  font-size: 0.78125rem;
  font-weight: 500;
  color: var(--brand-navy);
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 120ms ease;
  box-shadow: 0 1px 2px rgba(10, 37, 54, 0.04);
}
.ws-client-wizard__body .cw-radio:hover {
  border-color: var(--brand-gold);
  background: var(--color-gold-bg);
}
.ws-client-wizard__body .cw-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.ws-client-wizard__body .cw-radio__dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-elevated);
  position: relative;
  flex-shrink: 0;
  transition: border-color 160ms ease, background 160ms ease;
}
.ws-client-wizard__body .cw-radio__dot::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brand-gold);
  transform: scale(0);
  transition: transform 160ms ease;
}
.ws-client-wizard__body .cw-radio.is-checked {
  border-color: var(--brand-gold);
  background: var(--color-gold-bg);
  box-shadow: 0 0 0 3px rgba(51, 86, 109, 0.16);
}
.ws-client-wizard__body .cw-radio.is-checked .cw-radio__dot {
  border-color: var(--brand-gold);
}
.ws-client-wizard__body .cw-radio.is-checked .cw-radio__dot::after {
  transform: scale(1);
}
.ws-client-wizard__body .cw-radio:focus-within {
  outline: none;
  box-shadow: 0 0 0 3px rgba(51, 86, 109, 0.28);
}

/* Contact block lift */
.ws-client-wizard__body .cw-contact-block {
  background: var(--surface-elevated);
  border-radius: 12px !important;
  border-color: var(--border-subtle) !important;
  box-shadow: 0 1px 3px rgba(10, 37, 54, 0.05);
}

/* ── v10: Paralegal Suite ── */
.ws-paralegal-wrap {
  padding: 2rem 2.5rem 3rem;
  width: 100%;
  box-sizing: border-box;
}
.ws-paralegal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.ws-paralegal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
}
.ws-paralegal-filter {
  font-size: 0.8125rem;
  padding: 0.4rem 0.875rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-canvas);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}
#ws-paralegal-cards {
  /* no extra padding — inherits from .ws-paralegal-wrap */
}
.ws-paralegal-group-header {
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-gold-deep);
  font-weight: 700;
  margin: 2rem 0 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ws-paralegal-group-header:first-child {
  margin-top: 0;
}
.ws-paralegal-group-count {
  font-size: 0.625rem;
  background: var(--brand-gold-soft);
  color: var(--brand-gold-deep);
  border-radius: 100px;
  padding: 0.1rem 0.4rem;
  font-weight: 700;
}
.ws-paralegal-group-header { display: flex; align-items: center; gap: 0.625rem; }
.ws-paralegal-group-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}
.ws-paralegal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.ws-paralegal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1rem 1.125rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.ws-paralegal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-gold), var(--brand-gold-deep));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}
.ws-paralegal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px -10px rgba(10, 37, 54,0.18);
  border-color: var(--brand-gold);
}
.ws-paralegal-card:hover::before { transform: scaleX(1); }
.ws-paralegal-card:active { transform: translateY(-1px); }

.ws-paralegal-card__icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(51, 86, 109, 0.10);
  color: var(--brand-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
  transition: background 180ms ease, color 180ms ease, transform 220ms ease, box-shadow 220ms ease;
}
.ws-paralegal-card__icon-wrap .pp-icon-svg {
  width: 22px;
  height: 22px;
  display: block;
  transition: transform 220ms ease;
}
.ws-paralegal-card:hover .ws-paralegal-card__icon-wrap {
  background: var(--brand-gold);
  color: var(--surface-canvas);
  box-shadow: 0 6px 14px -6px rgba(51, 86, 109, 0.55);
}
.ws-paralegal-card:hover .ws-paralegal-card__icon-wrap .pp-icon-svg {
  transform: scale(1.05);
}
.ws-paralegal-sub {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0;
}
.ws-paralegal-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-navy);
}
.ws-paralegal-card__desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.45;
  flex: 1;
}
.ws-paralegal-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}
.ws-paralegal-card__actions {
  display: inline-flex;
  gap: 0.375rem;
}
.ws-paralegal-card__act {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 200ms ease;
}
.ws-paralegal-card__act .pp-icon-svg { width: 14px; height: 14px; display: block; }
.ws-paralegal-card__act:hover {
  border-color: var(--brand-navy);
  color: var(--brand-navy);
  background: rgba(10, 37, 54, 0.05);
}
.ws-paralegal-card__act.is-set {
  background: var(--brand-gold);
  border-color: var(--brand-gold);
  color: var(--surface-canvas);
}
.ws-paralegal-card__config {
  display: none;
  margin-top: 0.625rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-subtle);
}
.ws-paralegal-card.is-open .ws-paralegal-card__config { display: block; }
.ws-paralegal-card.is-open {
  transform: none;
  cursor: default;
}
.ws-paralegal-card__config .form-group { margin-bottom: 0.75rem; }
.ws-paralegal-card__tpl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.ws-paralegal-card__tpl-status {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ws-paralegal-card__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
  margin-top: 0.625rem;
}
.ws-paralegal-card__run {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--surface-canvas);
  background: var(--brand-navy);
  border: none;
  border-radius: 999px;
  padding: 0.375rem 0.875rem;
  cursor: pointer;
  transition: all 200ms ease;
}
.ws-paralegal-card__run svg { width: 12px; height: 12px; }
.ws-paralegal-card__run:hover {
  background: var(--brand-gold);
  box-shadow: 0 6px 14px -6px rgba(51, 86, 109, 0.55);
}
.ws-paralegal-card__run:disabled { opacity: 0.65; cursor: default; }
.ws-paralegal-chip {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  background: rgba(10, 37, 54, 0.05);
  border-radius: 999px;
  padding: 0.1875rem 0.5625rem;
}
.ws-notif-item__link {
  display: inline-block;
  margin: 2px 0 2px;
  padding: 0;
  border: none;
  background: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-gold);
  cursor: pointer;
}
.ws-notif-item__link:hover { text-decoration: underline; }

/* ── v10: Agents page ── */
.ws-agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
}
.ws-agent-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ws-agent-card__top {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}
.ws-agent-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--brand-gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.ws-agent-card__name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--brand-navy);
}
.ws-agent-card__desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}
.ws-agent-card__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}
.ws-agent-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ws-agent-schedule-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
}
.ws-agent-schedule-badge--active  { background: var(--status-success-soft); color: var(--status-success); }
.ws-agent-schedule-badge--paused  { background: var(--surface-recessed);    color: var(--text-muted); }

/* ── v10: Workflow editor ── */
.ws-workflow-editor {
  display: grid;
  grid-template-columns: 240px 1fr 340px;
  height: 100%;
  background: var(--surface-canvas);
  overflow: hidden;
}
.ws-workflow-sidebar {
  border-right: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.ws-workflow-sidebar__section {
  padding: 0.75rem 1rem 0.25rem;
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}
.ws-workflow-step-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-left: 3px solid transparent;
}
.ws-workflow-step-item:hover    { background: var(--surface-recessed); }
.ws-workflow-step-item.is-active { background: var(--brand-gold-soft); border-left-color: var(--brand-gold); color: var(--brand-navy); font-weight: 600; }
.ws-workflow-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-recessed);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ws-workflow-step-item.is-active .ws-workflow-step-num {
  background: var(--brand-gold);
  color: var(--brand-navy-deep);
}
.ws-workflow-canvas {
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.ws-workflow-node {
  width: 100%;
  max-width: 480px;
  background: var(--surface-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.125rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.ws-workflow-node:hover,
.ws-workflow-node.is-active {
  border-color: var(--brand-gold);
  box-shadow: var(--shadow-sm);
}
.ws-workflow-node__type {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.ws-workflow-node__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-navy);
}
.ws-workflow-arrow {
  width: 2px;
  height: 28px;
  background: var(--border-subtle);
  margin: 4px auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}
.ws-workflow-arrow::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--border-subtle);
}
.ws-workflow-inspector {
  border-left: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ws-workflow-inspector__title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand-navy);
  margin-bottom: 0.25rem;
}
.ws-workflow-inspector__section {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* ── v10: Jurisdiction selector ── */
.ws-jurisdiction-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.625rem;
  border-radius: var(--radius-md);
  background: rgba(243, 250, 255,0.08);
  border: 1px solid rgba(243, 250, 255,0.15);
  color: var(--text-inverse);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.ws-jurisdiction-btn:hover { background: rgba(243, 250, 255,0.15); border-color: rgba(var(--brand-gold), 0.6); }
.ws-jurisdiction-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 16px;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(243, 250, 255, 0.18);
  color: #F3FAFF;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
}
.ws-jurisdiction-label { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }

/* Jurisdiction dropdown menu */
.ws-juris-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 1rem;
  background: none;
  border: none;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.1s;
  text-align: left;
}
.ws-juris-menu-item:hover { background: var(--surface-recessed); }
.ws-juris-menu-item.is-active {
  background: var(--brand-gold-soft);
  font-weight: 600;
  color: var(--brand-navy-deep);
}
.ws-juris-menu-item__flag { font-size: 1rem; flex-shrink: 0; line-height: 1; }
.ws-juris-menu-item__label { flex: 1; }
.ws-juris-menu-item__check { color: var(--brand-gold-deep); flex-shrink: 0; }

/* ── v10: Permission notice ── */
.ws-permission-notice {
  margin: 0.75rem 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--status-info-soft);
  color: var(--status-info);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  border-left: 3px solid var(--status-info);
}

/* ── Matter panel empty state ── */
.sb-case-panel {
  position: relative;
  display: flex;
  flex-direction: column;
}
.ws-panel-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.ws-panel-empty__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  text-align: center;
  max-width: 280px;
}
.ws-panel-empty__icon {
  color: var(--border-strong);
  margin-bottom: 0.5rem;
  opacity: 0.7;
}
.ws-panel-empty__heading {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.ws-panel-empty__body {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.ws-panel-empty__cta {
  margin-top: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 36px;
  padding: 0 1.25rem;
  background: var(--brand-navy);
  color: var(--surface-canvas);
  border: 1px solid var(--brand-navy);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s, border-color 0.15s;
}
.ws-panel-empty__cta:hover {
  background: var(--brand-navy-deep);
  border-color: var(--brand-navy-deep);
}

/* ── v10: Matter detail panel ── */
.sb-case-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem 1.25rem;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
}
.sb-case-panel__title {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--brand-navy-deep);
  line-height: 1.3;
  margin-bottom: 0.375rem;
  letter-spacing: -0.01em;
}
.sb-case-panel__ref {
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}
.sb-case-panel__description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 1.125rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-canvas);
  font-style: italic;
}
.sb-case-panel .sb-action-bar {
  background: var(--surface-canvas);
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 0 0;
  margin-bottom: 0;
}
.sb-case-panel .sb-docs-section {
  padding: 1.25rem 1.75rem;
}
.sb-case-panel #ws-activity-section,
.sb-case-panel [id^="ws-activity-"] {
  padding: 0 1.75rem 1.75rem;
}
.sb-vault-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 0.375rem;
}
.sb-vault-row__name {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb-vault-row__meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.sb-vault-row__hash {
  font-family: var(--font-mono, monospace);
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.sb-vault-row__download {
  flex-shrink: 0;
}
.sb-activity-feed {
  display: flex;
  flex-direction: column;
}
.sb-activity-item {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.4;
}
.sb-activity-item:last-child { border-bottom: none; }
.sb-activity-item__actor { font-weight: 600; color: var(--text-primary); }
.sb-activity-item__action { color: var(--text-secondary); }
.sb-activity-item__time { color: var(--text-muted); font-size: 0.75rem; margin-left: auto; }

/* ════════════════════════════════════════════════════════════
   MATTER DETAIL PANEL (md-*) — tab-based layout
════════════════════════════════════════════════════════════ */

/* Panel must not scroll itself — md-body handles scrolling */
.sb-case-panel {
  overflow: hidden !important;
}

/* ── Header block ── */
.md-header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.md-header__identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.375rem 1.75rem 1.25rem;
  background: var(--brand-navy);
}

.md-header__left {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  min-width: 0;
  flex: 1;
}

.md-ref-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(243, 250, 255,0.1);
  border: 1px solid rgba(243, 250, 255,0.18);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 250, 255,0.7);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 3px;
}

.md-header__title-block { min-width: 0; }

.md-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #F3FAFF;
  line-height: 1.3;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}

.md-subtitle {
  font-size: 0.75rem;
  color: rgba(243, 250, 255,0.5);
  letter-spacing: 0.01em;
}

.md-header__controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.md-hdr-btn {
  height: 30px;
  padding: 0 0.875rem;
  background: rgba(243, 250, 255,0.1);
  border: 1px solid rgba(243, 250, 255,0.22);
  border-radius: 6px;
  color: rgba(243, 250, 255,0.85);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.md-hdr-btn:hover {
  background: rgba(243, 250, 255,0.2);
  color: #F3FAFF;
  border-color: rgba(243, 250, 255,0.4);
}
.md-hdr-btn--ai {
  color: var(--brand-gold);
  border-color: rgba(51, 86, 109,0.45);
}
.md-hdr-btn--ai:hover {
  background: rgba(51, 86, 109,0.15);
  border-color: var(--brand-gold);
  color: var(--color-gold-2);
}
.md-hdr-btn--close,
.md-hdr-btn--reopen {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.md-hdr-btn--reopen {
  background: var(--surface-recessed);
  border-color: var(--surface-recessed);
  color: var(--brand-navy-deep);
  font-weight: 600;
}
.md-hdr-btn--reopen:hover {
  background: var(--surface-elevated);
  border-color: #F3FAFF;
  color: var(--brand-navy-deep);
}
.md-closed-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.5rem;
  padding: 0.15rem 0.55rem;
  background: rgba(243, 250, 255, 0.14);
  border: 1px solid rgba(243, 250, 255, 0.28);
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(243, 250, 255, 0.85);
  vertical-align: 3px;
}

/* ── Stage strip ── */
.md-stage-strip {
  display: flex;
  align-items: center;
  padding: 0.5rem 1.75rem;
  background: var(--brand-navy);
  border-top: 1px solid rgba(243, 250, 255,0.08);
  border-bottom: 1px solid rgba(243, 250, 255,0.08);
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0;
}
.md-stage-strip::-webkit-scrollbar { display: none; }

.md-stage-strip__label {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(243, 250, 255,0.4);
  white-space: nowrap;
  margin-right: 1rem;
  flex-shrink: 0;
}

.md-stage-step {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0;
}

.md-stage-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(243, 250, 255,0.25);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5625rem;
  font-weight: 700;
  color: rgba(243, 250, 255,0.55);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  user-select: none;
}
.md-stage-dot:hover {
  border-color: rgba(243, 250, 255,0.6);
  background: rgba(243, 250, 255,0.1);
  color: #F3FAFF;
}
.md-stage-step.is-done .md-stage-dot {
  background: rgba(243, 250, 255,0.1);
  border-color: rgba(243, 250, 255,0.5);
  color: rgba(243, 250, 255,0.85);
}
.md-stage-step.is-done .md-stage-dot:hover {
  background: rgba(243, 250, 255,0.18);
  border-color: #F3FAFF;
}
.md-stage-step.is-current .md-stage-dot {
  background: var(--brand-gold);
  border-color: var(--brand-gold);
  color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(51, 86, 109,0.3);
}
.md-stage-step.is-current .md-stage-dot:hover {
  background: var(--color-gold-2);
  border-color: var(--color-gold-2);
}

.md-stage-label {
  font-size: 0.6875rem;
  color: rgba(243, 250, 255,0.55);
  margin-left: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.md-stage-step.is-current .md-stage-label {
  color: var(--brand-gold);
  font-weight: 600;
}
.md-stage-step.is-done .md-stage-label { color: rgba(243, 250, 255,0.7); }

.md-stage-connector {
  flex: 1;
  height: 1px;
  background: rgba(243, 250, 255,0.15);
  margin: 0 8px;
  min-width: 16px;
}
.md-stage-connector.is-done { background: rgba(243, 250, 255,0.4); }

/* ── Tab bar ── */
.md-tab-bar {
  display: flex;
  gap: 0;
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 1.75rem;
}

.md-tab {
  padding: 0.75rem 0;
  margin-right: 1.75rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  margin-bottom: -1px;
}
.md-tab:hover { color: var(--text-primary); }
.md-tab.is-active {
  color: var(--brand-navy);
  border-bottom-color: var(--brand-navy);
  font-weight: 600;
}

/* ── Scrollable body ── */
.md-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}
.md-body::-webkit-scrollbar { width: 5px; }
.md-body::-webkit-scrollbar-track { background: transparent; }
.md-body::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }

/* ── Tab panes ── */
.md-pane { display: none; }
.md-pane.is-active { display: block; }

/* ── Overview pane layout ── */
.md-overview-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 0;
  /* Stretch to the viewport so the notes composer sits at the bottom
     of the page (md-notes-section pushes down with margin-top:auto). */
  min-height: calc(100vh - var(--topbar-h) - 170px);
}

.md-overview-main {
  padding: 1.75rem;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.md-overview-aside {
  padding: 1.75rem 1.5rem;
  background: var(--surface-elevated);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.md-overview-section {}

.md-ov-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
  padding-left: 0.625rem;
  border-left: 2px solid var(--brand-gold);
}

.md-ov-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.md-parties-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.md-parties-list li {
  font-size: 0.8125rem;
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  /* White card — never the recessed/mint surface */
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.md-parties-list li.md-party-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.md-party-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-party-row__remove {
  border: none; background: none; cursor: pointer; padding: 2px; flex-shrink: 0;
  color: var(--text-muted); border-radius: 4px; line-height: 1;
  opacity: 0; transition: opacity 120ms, color 120ms;
}
.md-party-row:hover .md-party-row__remove { opacity: 1; }
.md-party-row__remove:hover { color: #B42318; }

.md-parties-list li.md-party-add { padding: 0; background: none; border: none; border-left: none; border-radius: 0; }
.md-party-add-btn {
  display: inline-flex; align-items: center; gap: 5px; width: 100%; box-sizing: border-box;
  padding: 0.5rem 0.75rem; border: 1px dashed var(--border-subtle); border-radius: 6px;
  background: none; color: var(--text-muted); font-size: 0.8125rem; font-family: var(--font-sans);
  cursor: pointer; transition: border-color 120ms, color 120ms;
}
.md-party-add-btn:hover { border-color: var(--brand-navy-soft); color: var(--brand-navy); }

.md-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.md-tag {
  display: inline-flex;
  padding: 0.2rem 0.625rem;
  background: var(--brand-gold-soft);
  color: var(--brand-navy-deep);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── Metadata card ── */
.md-meta-card {
  background: var(--surface-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}
.md-meta-card__heading {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 1rem 0.625rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
}
.md-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.md-meta-row:last-child { border-bottom: none; }
.md-meta-row__key {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.md-meta-row__val {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  text-transform: capitalize;
}

/* ── Quick AI buttons ── */
.md-quick-ai {}
.md-quick-ai__heading {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
}
.md-quick-ai-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  margin-bottom: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.md-quick-ai-btn:last-child { margin-bottom: 0; }
.md-quick-ai-btn:hover {
  border-color: var(--brand-gold);
  box-shadow: 0 2px 8px rgba(51, 86, 109,0.15);
  background: var(--surface-canvas);
}
.md-quick-ai-btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.md-quick-ai-btn__icon {
  font-size: 0.875rem;
  color: var(--brand-navy);
  flex-shrink: 0;
}
.md-quick-ai-btn__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-navy-deep);
  flex: 1;
}
.md-quick-ai-btn__arrow {
  font-size: 0.75rem;
  color: var(--brand-gold-deep);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── AI Tools pane ── */
.md-ai-intro {
  padding: 1.125rem 1.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.md-ai-intro p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 1.125rem;
}
.md-results-area {
  padding: 0;
}

/* ── Documents & Activity pane ── */
.md-tab-body {
  padding: 1.75rem;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .md-overview-grid {
    grid-template-columns: 1fr;
  }
  .md-overview-main { border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .md-stage-label { display: none; }
}
@media (max-width: 640px) {
  .md-header__identity { padding: 1rem 1.25rem; }
  .md-tab-bar { padding: 0 1.25rem; }
  .md-overview-main { padding: 1.25rem; }
  .md-tab-body { padding: 1.25rem; }
}

/* ── Activity feed ── */
.act-feed { display: flex; flex-direction: column; }
.act-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-subtle); align-items: flex-start; }
.act-item:last-child { border-bottom: none; }
.act-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-navy); color: var(--surface-canvas); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.act-body { flex: 1; min-width: 0; }
.act-text { font-size: 13px; color: var(--text-primary); line-height: 1.45; }
.act-actor { font-weight: 700; }
.act-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.act-count { display: inline-block; background: var(--brand-gold-light); color: var(--brand-gold-deep); border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700; margin-left: 6px; }

/* ── Workflow drag-drop ── */
.ws-workflow-step-item[draggable] { cursor: grab; user-select: none; transition: opacity 0.15s; }
.ws-workflow-step-item[draggable]:active { cursor: grabbing; }
.ws-workflow-step-item.drag-over { border-top: 2px solid var(--brand-gold); padding-top: calc(var(--spacing, 8px) - 2px); }
.wf-step-handle { color: var(--text-muted); margin-right: 8px; cursor: grab; font-size: 16px; }

/* ── Paralegal picker modal ───────────────────────────────────────────────── */
.pp-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.pp-tab {
  background: transparent; border: 0; padding: 10px 16px; cursor: pointer;
  font-size: 14px; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.pp-tab.is-active { color: var(--brand-gold); border-bottom-color: var(--brand-gold); font-weight: 600; }

.pp-template-section {
  margin-top: 18px; padding: 14px; border: 1px solid var(--border-subtle);
  border-radius: 6px; background: var(--surface-canvas);
}
.pp-template-section summary { cursor: pointer; padding: 4px 0; font-size: 14px; }
.pp-template-section summary strong { color: var(--text-primary); }
.pp-template-list { margin: 10px 0; }
.pp-template-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pp-template-table th, .pp-template-table td {
  padding: 6px 8px; border-bottom: 1px solid var(--border-subtle); text-align: left;
}
.pp-template-table th { font-weight: 600; color: var(--text-muted); }
.pp-template-controls { display: flex; gap: 8px; margin-top: 8px; }

.btn-link {
  background: transparent; border: 0; padding: 0; cursor: pointer;
  color: var(--brand-gold); text-decoration: underline; font-size: 13px;
}
.btn-link--danger { color: var(--status-danger); }
.pill--success {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--status-success-soft); color: var(--status-success); font-size: 11px; font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════════════
   WORKFLOWS — list, builder, run, runs results
   ════════════════════════════════════════════════════════════════════════════ */

#view-workflows.is-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.ws-wf {
  --wf-radius: 18px;
  --wf-radius-sm: 12px;
  --wf-card-bg: var(--surface-elevated);
  --wf-surface-soft: var(--surface-canvas);
  --wf-ink: var(--text-primary);
  --wf-ink-soft: rgba(10, 37, 54, 0.06);
  --wf-ink-line: var(--border-subtle);
  --wf-gold: var(--brand-gold);
  --wf-gold-soft: rgba(51, 86, 109, 0.14);
  --wf-emerald: var(--status-success);
  --wf-emerald-soft: rgba(10, 37, 54, 0.12);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
  background:
    radial-gradient(900px 320px at 12% -8%, rgba(51, 86, 109,0.10), transparent 60%),
    radial-gradient(720px 280px at 92% -4%, rgba(10, 37, 54,0.06), transparent 65%),
    var(--surface-canvas);
  overflow: hidden;
}
:root[data-theme="dark"] .ws-wf {
  --wf-ink-soft: rgba(243, 250, 255, 0.06);
  --wf-gold-soft: rgba(151, 171, 185, 0.18);
  --wf-emerald-soft: rgba(218, 246, 239, 0.14);
}

/* ── Hero header ─────────────────────────────────────────────────────── */

.ws-wf-header {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: end;
  gap: 0 24px;
  padding: 34px 36px 18px;
  border-bottom: 1px solid var(--wf-ink-line);
}
.ws-wf-header__title {
  grid-row: 2;
  grid-column: 1;
  min-width: 0;
}
.ws-wf-header::before {
  content: "Automation";
  grid-row: 1;
  grid-column: 1 / -1;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--brand-gold-deep);
  margin-bottom: 4px;
}
.ws-wf-h1 {
  font-family: var(--font-serif);
  font-size: 36px; font-weight: 700; color: var(--wf-ink);
  margin: 6px 0 0; letter-spacing: -0.015em; line-height: 1.1;
}
.ws-wf-h1::after {
  content: "";
  display: block; width: 44px; height: 3px;
  background: var(--wf-gold);
  border-radius: 2px;
  margin-top: 12px;
}
.ws-wf-sub {
  font-size: 14.5px; color: var(--text-secondary);
  margin: 14px 0 0; max-width: 620px; line-height: 1.6;
}
.ws-wf-header__actions {
  grid-row: 2;
  grid-column: 2;
  display: flex; gap: 10px; flex-shrink: 0;
  align-self: end;
}

/* ── Tabs (pill segmented control) ───────────────────────────────────── */

.ws-wf-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  margin: 18px 36px 22px;
  background: rgba(10, 37, 54, 0.05);
  border: 1px solid var(--wf-ink-line);
  border-radius: 999px;
  align-self: flex-start;
}
.ws-wf-tab {
  background: transparent; border: none;
  padding: 8px 16px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.ws-wf-tab:hover { color: var(--brand-navy); }
.ws-wf-tab.is-active {
  color: var(--brand-navy);
  background: var(--surface-elevated);
  box-shadow: 0 1px 2px rgba(10, 37, 54,0.08), 0 4px 14px rgba(10, 37, 54,0.06);
}
.ws-wf-tab__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 7px;
  background: rgba(10, 37, 54,0.08); color: var(--brand-navy);
  border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em;
}
.ws-wf-tab.is-active .ws-wf-tab__count {
  background: var(--brand-gold); color: var(--surface-canvas);
}

/* ── List grid ────────────────────────────────────────────────────────── */

.ws-wf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  overflow-y: auto;
  padding: 2px 36px 28px;
}
.ws-wf-card {
  position: relative;
  background: var(--wf-card-bg);
  border: 1px solid var(--wf-ink-line);
  border-radius: var(--wf-radius);
  padding: 20px 20px 16px 26px;
  cursor: pointer;
  display: flex; flex-direction: column;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 1px 0 rgba(10, 37, 54,0.02), 0 1px 3px rgba(10, 37, 54,0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}
.ws-wf-card::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-navy), var(--brand-navy-soft));
  opacity: 0.85;
}
.ws-wf-card:has(.ws-wf-chip--auto:not(.is-paused))::before {
  background: linear-gradient(180deg, var(--wf-emerald), #0A2536);
}
.ws-wf-card:has(.ws-wf-chip--gold)::before {
  background: linear-gradient(180deg, var(--brand-gold), var(--brand-gold-deep));
}
.ws-wf-card:hover, .ws-wf-card:focus-visible {
  border-color: rgba(10, 37, 54,0.22);
  box-shadow: 0 14px 32px rgba(10, 37, 54,0.10), 0 2px 6px rgba(10, 37, 54,0.04);
  transform: translateY(-2px);
  outline: none;
}
.ws-wf-card__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.ws-wf-card__title {
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 700; color: var(--wf-ink);
  margin: 0; line-height: 1.3; flex: 1; min-width: 0;
  letter-spacing: -0.005em;
}
.ws-wf-card__chips { display: flex; flex-wrap: wrap; gap: 4px; flex-shrink: 0; justify-content: flex-end; }
.ws-wf-card__desc {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.6; margin: 0 0 16px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ws-wf-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: auto;
  padding-top: 14px; border-top: 1px solid rgba(10, 37, 54,0.06);
}
.ws-wf-card__meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px;
  font-size: 11.5px; color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Chips */
.ws-wf-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: rgba(10, 37, 54,0.06); color: var(--brand-navy);
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}
.ws-wf-chip--muted { color: var(--text-muted); background: rgba(10, 37, 54,0.04); }
.ws-wf-chip--gold  { background: var(--wf-gold-soft); color: var(--brand-gold-deep); border-color: rgba(51, 86, 109,0.36); }
.ws-wf-chip--auto  { background: var(--wf-emerald-soft); color: var(--wf-emerald); }
.ws-wf-chip--auto.is-paused { background: rgba(10, 37, 54,0.04); color: var(--text-muted); }
.ws-wf-chip__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(10, 37, 54,0.16);
}
.ws-wf-chip--auto.is-paused .ws-wf-chip__dot { opacity: 0.55; box-shadow: none; }

.ws-wf-badge {
  display: inline-flex; align-items: center;
  font-size: 10.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(10, 37, 54,0.07); color: var(--brand-navy);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.ws-wf-badge--gold {
  background: var(--wf-gold-soft); color: var(--brand-gold-deep);
}

/* Empty & loading states */
.ws-wf-loading {
  padding: 72px 16px; text-align: center;
  font-size: 14px; color: var(--text-muted);
  margin: 0 36px;
}
.ws-wf-empty {
  margin: 0 36px 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(51, 86, 109,0.10), transparent 60%),
    #F3FAFF;
  border: 1px solid var(--wf-ink-line);
  border-radius: 20px;
  padding: 64px 28px 56px;
  text-align: center;
  color: var(--text-secondary);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  position: relative;
  overflow: hidden;
}
.ws-wf-empty--err { border-color: rgba(220,53,69,0.45); color: var(--status-danger); }
.ws-wf-empty svg  {
  color: var(--brand-gold-deep);
  margin-bottom: 8px;
  width: 56px; height: 56px;
  padding: 14px;
  background: var(--wf-gold-soft);
  border-radius: 50%;
  box-sizing: content-box;
}
.ws-wf-empty h3   {
  font-family: var(--font-serif);
  margin: 0; color: var(--wf-ink); font-size: 22px;
  letter-spacing: -0.01em;
}
.ws-wf-empty p    {
  margin: 0; max-width: 480px; line-height: 1.6; font-size: 14px;
}
.ws-wf-empty__cta { margin-top: 18px; display: flex; gap: 10px; }

/* ── Builder ──────────────────────────────────────────────────────────── */

.ws-wf-builder-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--surface-elevated);
  border: 1px solid var(--wf-ink-line);
  border-radius: var(--wf-radius);
  margin: 18px 36px 16px;
  box-shadow: 0 1px 2px rgba(10, 37, 54,0.04), 0 4px 14px rgba(10, 37, 54,0.04);
}
.ws-wf-back {
  background: rgba(10, 37, 54,0.05);
  border: 1px solid var(--wf-ink-line);
  color: var(--brand-navy);
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; padding: 7px 12px 7px 9px;
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.ws-wf-back:hover {
  background: rgba(10, 37, 54,0.08);
  border-color: rgba(10, 37, 54,0.2);
  transform: translateX(-1px);
}
.ws-wf-builder-title { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.ws-wf-title-input {
  flex: 1; min-width: 0; max-width: 620px;
  background: transparent; border: 1px solid transparent;
  font-family: var(--font-serif);
  font-size: 26px; font-weight: 700; color: var(--wf-ink);
  padding: 6px 10px;
  border-radius: 10px;
  letter-spacing: -0.01em;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ws-wf-title-input:hover {
  background: rgba(10, 37, 54,0.04);
}
.ws-wf-title-input:focus {
  background: var(--surface-elevated);
  border-color: var(--wf-gold);
  box-shadow: 0 0 0 3px var(--wf-gold-soft);
  outline: none;
}
.ws-wf-title-input::placeholder { color: rgba(10, 37, 54,0.32); font-style: italic; }
.ws-wf-dirty {
  color: var(--brand-gold);
  font-size: 22px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(51, 86, 109,0.5));
}
.ws-wf-builder-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.ws-wf-builder {
  display: grid;
  grid-template-columns: 340px 1fr 360px;
  gap: 16px;
  flex: 1;
  min-height: 0;
  padding: 0 36px 28px;
}
.ws-wf-builder__settings,
.ws-wf-builder__canvas,
.ws-wf-builder__inspector {
  background: var(--surface-elevated);
  border: 1px solid var(--wf-ink-line);
  border-radius: var(--wf-radius);
  overflow-y: auto;
  min-height: 0;
  box-shadow: 0 1px 2px rgba(10, 37, 54,0.03);
}

/* Settings pane */
.ws-wf-settings { padding: 20px 20px 24px; }
.ws-wf-settings__heading {
  font-family: var(--font-serif);
  font-size: 12px; font-weight: 700; color: var(--brand-gold-deep);
  margin: 0 0 12px;
  letter-spacing: 0.14em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.ws-wf-settings__heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--wf-ink-line), transparent);
}
.ws-wf-settings .form-group { margin-bottom: 16px; }
.ws-wf-settings textarea { resize: none; }

.ws-wf-toggle {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px;
  background: var(--wf-surface-soft);
  border: 1px solid var(--wf-ink-line);
  border-radius: var(--wf-radius-sm);
  cursor: pointer;
  margin-bottom: 18px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ws-wf-toggle:hover { border-color: rgba(10, 37, 54,0.18); }
.ws-wf-toggle input { display: none; }
.ws-wf-toggle__track {
  width: 38px; height: 22px; border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  flex-shrink: 0; margin-top: 1px;
  transition: background 0.18s ease;
}
.ws-wf-toggle__dot {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface-elevated);
  box-shadow: 0 1px 3px rgba(10, 37, 54,0.22);
  transition: transform 0.2s cubic-bezier(.4,.0,.2,1);
}
.ws-wf-toggle input:checked + .ws-wf-toggle__track {
  background: linear-gradient(135deg, var(--wf-emerald), #0A2536);
}
:root[data-theme="dark"] .ws-wf-toggle input:checked + .ws-wf-toggle__track {
  background: var(--brand-gold-deep);   /* Pure Mint switch on dark */
}
.ws-wf-toggle input:checked + .ws-wf-toggle__track .ws-wf-toggle__dot { transform: translateX(16px); }
.ws-wf-toggle__text { display: flex; flex-direction: column; gap: 3px; }
.ws-wf-toggle__title { font-size: 13px; font-weight: 600; color: var(--brand-navy); }
.ws-wf-toggle__sub   { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

.ws-wf-steps-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; margin-bottom: 12px;
}
.ws-wf-steps-head__actions { display: flex; gap: 6px; }

.ws-wf-steplist { display: flex; flex-direction: column; gap: 14px; }
.ws-wf-steplist__empty {
  font-size: 12.5px; color: var(--text-muted); padding: 12px 0;
  font-style: italic;
}
.ws-wf-lane { }
.ws-wf-lane__head {
  font-size: 10.5px; font-weight: 700;
  color: var(--text-muted); letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.ws-wf-lane__head::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-gold);
}
.ws-wf-lane__steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }

.ws-wf-step {
  display: grid; grid-template-columns: 14px 22px 1fr 24px; gap: 10px;
  align-items: center;
  padding: 11px 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--wf-ink-line);
  border-radius: var(--wf-radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.ws-wf-step:hover {
  background: var(--wf-surface-soft);
  border-color: rgba(10, 37, 54,0.18);
}
.ws-wf-step.is-selected {
  background: var(--wf-gold-soft);
  border-color: var(--wf-gold);
  box-shadow: 0 0 0 3px rgba(51, 86, 109,0.16);
}
.ws-wf-step.is-dragging { opacity: 0.5; transform: scale(0.98); }
.ws-wf-step.is-drop-target { box-shadow: 0 -3px 0 var(--brand-gold) inset; }
.ws-wf-step__handle {
  color: rgba(10, 37, 54,0.30); cursor: grab; line-height: 1;
  font-size: 13px; user-select: none;
  letter-spacing: -2px;
}
.ws-wf-step__handle:active { cursor: grabbing; }
.ws-wf-step__index {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--brand-navy); color: var(--surface-canvas);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.ws-wf-step.is-selected .ws-wf-step__index {
  background: var(--brand-gold);
  box-shadow: 0 2px 6px rgba(51, 86, 109,0.4);
}
.ws-wf-step__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ws-wf-step__name {
  font-weight: 600; color: var(--wf-ink);
  font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ws-wf-step__type {
  font-size: 10.5px; color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ws-wf-step__remove {
  width: 24px; height: 24px; border-radius: 6px;
  border: none; background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  opacity: 0;
}
.ws-wf-step:hover .ws-wf-step__remove,
.ws-wf-step.is-selected .ws-wf-step__remove { opacity: 1; }
.ws-wf-step__remove:hover { background: rgba(220,53,69,0.12); color: var(--status-danger); }

/* Canvas pane — story view */
.ws-wf-builder__canvas {
  padding: 22px;
  background-color: var(--surface-elevated);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(10, 37, 54,0.07) 1px, transparent 0);
  background-size: 18px 18px;
  background-position: 0 0;
}
.ws-wf-canvas__empty {
  padding: 80px 20px; text-align: center;
  color: var(--text-muted); font-size: 14px;
  font-style: italic;
}
.ws-wf-flow { display: flex; flex-direction: column; gap: 20px; }
.ws-wf-flow__lane {
  background: rgba(243, 250, 255,0.7);
  backdrop-filter: blur(2px);
  border: 1px solid var(--wf-ink-line);
  border-radius: var(--wf-radius);
  padding: 16px 18px;
}
.ws-wf-flow__lane-label {
  font-size: 10.5px; font-weight: 700;
  color: var(--brand-gold-deep); letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: inline-flex; align-items: center; gap: 8px;
}
.ws-wf-flow__lane-label::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--brand-gold);
}
.ws-wf-flow__chain {
  display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px;
}
.ws-wf-node {
  background: var(--surface-elevated);
  border: 1.5px solid var(--wf-ink-line);
  border-radius: var(--wf-radius-sm);
  padding: 12px 16px 12px 14px;
  display: inline-flex; flex-direction: column; gap: 3px;
  min-width: 160px; max-width: 240px;
  text-align: left; cursor: pointer;
  font-family: inherit;
  position: relative;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
}
.ws-wf-node::before {
  content: "";
  position: absolute; left: 0; top: 10px; bottom: 10px;
  width: 3px;
  background: var(--brand-gold);
  border-radius: 0 3px 3px 0;
  opacity: 0.85;
}
.ws-wf-node:hover {
  border-color: rgba(10, 37, 54,0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(10, 37, 54,0.08);
}
.ws-wf-node.is-selected {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(51, 86, 109,0.22), 0 4px 14px rgba(51, 86, 109,0.18);
}
.ws-wf-node__icon {
  font-size: 16px; color: var(--brand-gold-deep);
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: var(--wf-gold-soft);
  border-radius: 8px;
  margin-bottom: 4px;
}
.ws-wf-node__name {
  font-size: 13px; font-weight: 700; color: var(--wf-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: -0.005em;
}
.ws-wf-node__type {
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.ws-wf-node__arrow {
  font-size: 18px; color: var(--brand-gold);
  flex-shrink: 0;
  align-self: center;
  opacity: 0.7;
}

/* Recent runs (history) pane inside the canvas */
.ws-wf-history {
  margin-top: 24px;
  background: rgba(243, 250, 255,0.7);
  backdrop-filter: blur(2px);
  border: 1px solid var(--wf-ink-line);
  border-radius: var(--wf-radius);
  padding: 14px 18px;
}
.ws-wf-history__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.ws-wf-history__title {
  font-family: var(--font-serif);
  font-size: 11px; font-weight: 700; color: var(--brand-gold-deep);
  margin: 0; letter-spacing: 0.14em; text-transform: uppercase;
}
.ws-wf-history__refresh {
  border: 1px solid var(--wf-ink-line);
  background: var(--surface-elevated); color: var(--text-muted);
  border-radius: 6px;
  width: 26px; height: 26px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ws-wf-history__refresh:hover {
  background: var(--wf-gold-soft);
  color: var(--brand-gold-deep);
  border-color: var(--brand-gold);
}
.ws-wf-history__empty {
  font-size: 12.5px; color: var(--text-muted);
  font-style: italic;
  padding: 6px 0;
}
.ws-wf-history__list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.ws-wf-history__row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--wf-ink-line);
  border-radius: 10px;
  font-size: 12.5px;
}
.ws-wf-history__meta {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px 12px;
  flex: 1;
  color: var(--text-muted);
}
.ws-wf-history__when {
  color: var(--brand-navy); font-weight: 600;
}
.ws-wf-history__steps,
.ws-wf-history__trigger {
  font-size: 11.5px;
}
.ws-wf-history__view,
.ws-wf-history__cancel {
  background: transparent;
  border: 1px solid var(--wf-ink-line);
  color: var(--brand-navy);
  font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ws-wf-history__view:hover {
  background: var(--wf-gold-soft);
  border-color: var(--brand-gold);
  color: var(--brand-gold-deep);
}
.ws-wf-history__cancel {
  color: var(--status-danger);
  border-color: rgba(220,53,69,0.32);
}
.ws-wf-history__cancel:hover {
  background: rgba(220,53,69,0.10);
  border-color: var(--status-danger);
}

/* Inspector */
.ws-wf-inspector { padding: 20px 20px 24px; }
.ws-wf-inspector__head {
  margin: -20px -20px 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--wf-surface-soft), #F3FAFF);
  border-bottom: 1px solid var(--wf-ink-line);
  border-radius: var(--wf-radius) var(--wf-radius) 0 0;
  border-left: 3px solid var(--brand-gold);
}
.ws-wf-inspector__title {
  font-family: var(--font-serif);
  font-size: 12px; font-weight: 700; color: var(--brand-gold-deep);
  margin: 0; letter-spacing: 0.14em; text-transform: uppercase;
}
.ws-wf-inspector__empty {
  padding: 64px 18px; text-align: center;
  font-size: 13px; color: var(--text-muted);
  font-style: italic;
}
.ws-wf-inspector__notice {
  font-size: 12.5px; color: var(--text-secondary);
  padding: 12px 14px;
  background: var(--wf-surface-soft);
  border: 1px solid var(--wf-ink-line);
  border-left: 3px solid var(--brand-gold);
  border-radius: 0 8px 8px 0;
  margin-bottom: 14px; line-height: 1.55;
}
.ws-wf-prompt {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.6;
  background: var(--wf-surface-soft);
}
.ws-wf-inspector .form-hint {
  display: block;
  font-size: 11.5px; color: var(--text-muted); margin-top: 5px;
  line-height: 1.45;
}

/* Run result modal */
.ws-wf-runbadge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(10, 37, 54,0.08); color: var(--brand-navy);
}
.ws-wf-runbadge--completed { background: var(--status-success-soft); color: var(--status-success); }
.ws-wf-runbadge--failed    { background: rgba(220,53,69,0.18); color: var(--status-danger); }
.ws-wf-runbadge--running   { background: rgba(10, 37, 54,0.10); color: var(--brand-navy); }

.ws-wf-runrow {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.ws-wf-runrow:last-child { border-bottom: none; }
.ws-wf-runrow__head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.ws-wf-runrow__num {
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--brand-navy); color: var(--surface-canvas);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.ws-wf-runrow__status {
  font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.06em;
  background: rgba(10, 37, 54,0.08); color: var(--brand-navy);
}
.ws-wf-runrow__status--done    { background: var(--status-success-soft); color: var(--status-success); }
.ws-wf-runrow__status--error   { background: rgba(220,53,69,0.18); color: var(--status-danger); }
.ws-wf-runrow__status--skipped { background: rgba(10, 37, 54,0.05); color: var(--text-muted); }
.ws-wf-runrow__err {
  font-size: 12px; color: var(--status-danger);
}
.ws-wf-runrow__output {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.6;
  background: var(--wf-surface-soft, var(--surface-canvas));
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--brand-gold);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  white-space: pre-wrap;
  margin: 0;
  max-height: 320px; overflow-y: auto;
}

/* Responsive: builder collapses to a single column under 1100px */
@media (max-width: 1280px) {
  .ws-wf-builder { grid-template-columns: 300px 1fr 320px; }
}
@media (max-width: 1100px) {
  .ws-wf-header { padding: 26px 24px 14px; }
  .ws-wf-tabs   { margin: 14px 24px 18px; }
  .ws-wf-grid,
  .ws-wf-empty,
  .ws-wf-builder-bar,
  .ws-wf-builder { margin-left: 0; margin-right: 0; padding-left: 24px; padding-right: 24px; }
  .ws-wf-builder { grid-template-columns: 1fr; }
  .ws-wf-builder__settings,
  .ws-wf-builder__canvas,
  .ws-wf-builder__inspector { max-height: 420px; }
  .ws-wf-h1 { font-size: 30px; }
}

/* ════════════════════════════════════════════════════════════════════
   Matter notes (Change 12e)
   ════════════════════════════════════════════════════════════════════ */
.md-notes-list { margin: 0.75rem 0; display: flex; flex-direction: column; gap: 0.625rem; }
.md-notes-loading,.md-notes-empty { font-size: 0.8125rem; color: var(--text-muted); padding: 0.25rem 0; }

.md-note-item {
  position: relative; background: var(--surface-elevated);
  border: 1px solid var(--border-subtle); border-radius: 8px;
  padding: 0.75rem 1rem; display: flex; gap: 0.75rem; align-items: flex-start;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.md-note-item:hover { border-color: var(--brand-gold); box-shadow: 0 1px 4px rgba(10, 37, 54,0.06); }
.md-note-body { flex: 1; min-width: 0; }
.md-note-text { font-size: 0.875rem; line-height: 1.65; color: var(--brand-navy); white-space: pre-wrap; word-break: break-word; }
.md-note-meta { margin-top: 0.375rem; font-size: 0.75rem; color: var(--text-muted); }
.md-note-author { font-weight: 600; color: var(--brand-navy); }
.md-note-edited { opacity: 0.6; }

.md-note-actions { display: flex; gap: 0.25rem; flex-shrink: 0; opacity: 0; transition: opacity 150ms ease; }
.md-note-item:hover .md-note-actions { opacity: 1; }
.md-note-btn { background: none; border: 1px solid transparent; border-radius: 4px; padding: 0.25rem 0.5rem; font-size: 0.8125rem; cursor: pointer; color: var(--text-muted); transition: all 120ms; }
.md-note-btn:hover { color: var(--brand-navy); background: var(--surface-recessed); border-color: var(--border-subtle); }
.md-note-btn--del:hover { color: var(--status-danger); }

.md-note-edit-area { width: 100%; box-sizing: border-box; border: 1px solid var(--brand-gold); border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.875rem; font-family: var(--font-sans); color: var(--brand-navy); background: var(--surface-elevated); resize: none; min-height: 70px; outline: none; box-shadow: 0 0 0 3px rgba(51, 86, 109,0.12); }
.md-note-edit-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; justify-content: flex-end; }

.md-notes-add { margin-top: 0.625rem; }
.md-notes-input-row { display: flex; align-items: flex-start; gap: 8px; }
.md-notes-input-row .md-notes-textarea { flex: 1; min-width: 0; }
.md-notes-input-row .ws-mic-btn { margin-top: 0; flex-shrink: 0; }
.md-notes-textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 0.625rem 0.875rem; font-size: 0.875rem; font-family: var(--font-sans); color: var(--brand-navy); background: var(--surface-elevated); resize: none; min-height: 72px; outline: none; transition: border-color 150ms ease; }
.md-notes-textarea:focus { border-color: var(--brand-gold); box-shadow: 0 0 0 3px rgba(51, 86, 109,0.12); }
.md-notes-add-footer { display: flex; align-items: center; justify-content: flex-end; margin-top: 0.5rem; gap: 0.75rem; }

/* ════════════════════════════════════════════════════════════════════
   Matter header Edit button + Assign-client button + client dropdown (Change 33)
   ════════════════════════════════════════════════════════════════════ */
.md-hdr-btn--ghost { background: rgba(243, 250, 255,0.15); color: #F3FAFF; border: 1px solid rgba(243, 250, 255,0.35); }
.md-hdr-btn--ghost:hover { background: rgba(243, 250, 255,0.25); }

.ws-client-dropdown { background: var(--surface-elevated); border: 1px solid var(--border-subtle); border-radius: 10px; box-shadow: 0 8px 24px rgba(10, 37, 54,0.12); overflow: hidden; }
.ws-client-dropdown__search-wrap { padding: 8px; border-bottom: 1px solid var(--border-subtle); }
.ws-client-dropdown__search { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--border-subtle); border-radius: 6px; font-size: 0.8125rem; box-sizing: border-box; }
.ws-client-dropdown__list { max-height: 220px; overflow-y: auto; }
.ws-client-dropdown__item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 9px 12px; border: none; background: none; cursor: pointer; text-align: left; gap: 1px; }
.ws-client-dropdown__item:hover { background: var(--surface-recessed); }
.ws-client-dropdown__item-name { font-size: 0.875rem; font-weight: 500; color: var(--brand-navy); }
.ws-client-dropdown__item-meta { font-size: 0.75rem; color: var(--text-muted); }

/* ── ws-modal (used by Edit matter, Add/edit contact) ── */
.ws-modal-overlay { position: fixed; inset: 0; background: rgba(10, 37, 54,0.55); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.ws-modal { background: var(--surface-elevated); border-radius: 16px; box-shadow: 0 24px 64px rgba(10, 37, 54,0.25); width: 100%; max-width: 560px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.ws-modal--md { max-width: 560px; }
.ws-modal__header { display: flex; align-items: center; justify-content: space-between; padding: 0.875rem 1.125rem; border-bottom: 1px solid var(--border-subtle); }
.ws-modal__title { font-size: 0.9375rem; font-weight: 700; color: var(--brand-navy); margin: 0; }
.ws-modal__close {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: rgba(10, 37, 54, 0.08); border: none; font-size: 0.8125rem; line-height: 1;
  color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.ws-modal__close:hover { background: rgba(10, 37, 54, 0.16); color: var(--brand-navy); }
.ws-modal__body { padding: 1rem 1.125rem; overflow-y: auto; }
.ws-modal__body .form-group { margin-bottom: 0.875rem; }
.ws-modal__body .form-group:last-child { margin-bottom: 0; }
.ws-modal__footer { display: flex; justify-content: flex-end; gap: 0.625rem; padding: 0.75rem 1.125rem; border-top: 1px solid var(--border-subtle); }

/* ── Documents folders (Change 34b) ── */
.ws-docs-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ws-folder-select-wrap { margin-bottom: 12px; }
/* legacy .ws-doc-folder-heading rule removed — styled in the v17 section below */

/* ════════════════════════════════════════════════════════════════════
   Upload progress toasts (Change 34a)
   ════════════════════════════════════════════════════════════════════ */
.ws-upload-toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.ws-upload-toast { background: var(--surface-elevated); border: 1px solid var(--border-subtle); border-radius: 10px; box-shadow: 0 4px 20px rgba(10, 37, 54,0.12); padding: 12px 16px; min-width: 280px; max-width: 340px; transition: opacity 300ms, transform 300ms; }
.ws-upload-toast.is-leaving { opacity: 0; transform: translateX(20px); }
.ws-upload-toast__top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ws-upload-toast__icon { font-size: 1rem; color: var(--brand-navy); }
.ws-upload-toast__name { flex: 1; font-size: 0.8125rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-upload-toast__pct { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.ws-upload-toast__track { height: 4px; background: var(--surface-recessed); border-radius: 2px; overflow: hidden; }
.ws-upload-toast__bar { height: 100%; background: var(--brand-navy); border-radius: 2px; transition: width 200ms linear; }
.ws-upload-toast__bar.is-success { background: var(--status-success); }
.ws-upload-toast__bar.is-error   { background: var(--status-danger); }

/* ════════════════════════════════════════════════════════════════════
   Share panel searchable user picker (Change 15)
   ════════════════════════════════════════════════════════════════════ */
.ws-share-user-wrap { position: relative; }
.ws-share-user-input { width: 100%; box-sizing: border-box; }
.ws-share-user-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 600; background: var(--surface-elevated); border: 1px solid var(--border-subtle); border-radius: 8px; box-shadow: 0 8px 24px rgba(10, 37, 54,0.12); max-height: 220px; overflow-y: auto; display: none; }
.ws-share-user-wrap.is-open .ws-share-user-dropdown { display: block; }
.ws-share-user-option { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.875rem; font-size: 0.875rem; cursor: pointer; transition: background 120ms ease; }
.ws-share-user-option:hover { background: var(--surface-recessed); }
.ws-share-user-option__name { font-weight: 600; color: var(--brand-navy); }
.ws-share-user-option__role { font-size: 0.75rem; color: var(--text-muted); }
.ws-share-user-empty { padding: 0.75rem; font-size: 0.8125rem; color: var(--text-muted); text-align: center; }

/* ════════════════════════════════════════════════════════════════════
   Clients page header + cards (Change 31)
   ════════════════════════════════════════════════════════════════════ */
.ws-clients-page {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 2.5rem 2.75rem 2.75rem;
  background: var(--surface-canvas);
}
.ws-clients-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.75rem; padding-bottom: 1.375rem;
  border-bottom: 1px solid rgba(10, 37, 54,0.08);
}
.ws-clients-header__title {
  font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700;
  color: var(--brand-navy); margin: 0; letter-spacing: -0.01em;
}
.ws-clients-header__sub { font-size: 0.8125rem; color: var(--text-secondary); margin: 0.25rem 0 0; }
.btn--gold { background: var(--brand-gold); color: var(--surface-canvas); border: none; border-radius: var(--radius-md, 8px); padding: 0 18px; height: 36px; font-size: 0.875rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 150ms; }
.btn--gold:hover { background: var(--brand-gold-deep); }

.ws-clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ws-client-card { background: var(--surface-elevated); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow 150ms, border-color 150ms; cursor: pointer; }
.ws-client-card:hover { border-color: var(--brand-navy); box-shadow: 0 4px 16px rgba(10, 37, 54,0.10); }
.ws-client-card__header { display: flex; align-items: center; gap: 12px; }
.ws-client-card__avatar { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-soft) 100%); color: var(--surface-canvas); font-size: 0.9375rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; letter-spacing: 0.03em; }
.ws-client-card__name { font-size: 0.9375rem; font-weight: 600; color: var(--brand-navy); line-height: 1.3; }
.ws-client-card__tag { display: inline-block; margin-top: 4px; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand-gold); background: rgba(51, 86, 109,0.1); border-radius: 4px; padding: 2px 7px; }
.ws-client-card__notes { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.55; flex: 1; }
.ws-client-card__footer { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border-subtle); }
.ws-client-card__action-btn { flex: 1; height: 32px; font-size: 0.8125rem; font-weight: 500; border-radius: 6px; border: 1px solid var(--border-subtle); background: var(--surface-canvas); color: var(--text-secondary); cursor: pointer; transition: background 120ms, border-color 120ms; }
.ws-client-card__action-btn:hover { background: var(--surface-recessed); border-color: var(--border-strong); }
.ws-client-card__action-btn--danger { color: var(--status-danger); }
.ws-client-card__action-btn--danger:hover { background: var(--status-danger-soft); border-color: var(--status-danger); }

/* ════════════════════════════════════════════════════════════════════
   Help & Support tab (Change 28a) + Team CSV (Change 26a)
   ════════════════════════════════════════════════════════════════════ */
.ws-help-section { max-width: 600px; }
.ws-settings-section-title { font-size: 1.0625rem; font-weight: 700; color: var(--brand-navy); margin: 0 0 1rem; }
.ws-help-contact-card { display: flex; align-items: flex-start; gap: 16px; background: var(--surface-canvas); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 20px 24px; }
.ws-help-contact-card__icon { font-size: 1.25rem; margin-top: 2px; }
.ws-help-contact-card__label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.ws-help-contact-card__value { font-size: 0.9375rem; font-weight: 600; color: var(--brand-navy); text-decoration: none; }
.ws-help-contact-card__value:hover { text-decoration: underline; }
.ws-help-contact-card__note { font-size: 0.8125rem; color: var(--text-muted); margin-top: 4px; }
.ws-help-guide-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; background: var(--brand-navy); border-radius: 10px; padding: 20px 24px; color: var(--surface-canvas); margin-bottom: 16px; }
.ws-help-guide-card__text { flex: 1 1 320px; min-width: 0; }
.ws-help-guide-card__text strong { font-size: 1rem; }
.ws-help-guide-card__text p { font-size: 0.8125rem; color: rgba(243, 250, 255, 0.7); margin: 4px 0 0; }
.ws-help-guide-card .btn { flex-shrink: 0; }

.ws-team-csv-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.ws-team-csv-upload-label { cursor: pointer; }
.ws-team-csv-template-link { font-size: 0.8125rem; color: var(--brand-gold); text-decoration: none; border-bottom: 1px dashed var(--brand-gold); }
.ws-team-csv-template-link:hover { opacity: 0.8; }
.ws-team-csv-preview-box { margin-top: 12px; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 10px 12px; background: var(--surface-elevated); }
.ws-team-csv-prow { font-size: 0.8125rem; color: var(--brand-navy); padding: 2px 0; }
.ws-team-csv-prow--bad { color: var(--status-warning); }

.ws-wf-genpanel {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.ws-wf-genpanel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 0;
}
.ws-wf-genpanel__title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: var(--tracking-snug);
  color: var(--text-primary);
  margin: 0;
}
.ws-wf-genpanel__close {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--surface-recessed);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.ws-wf-genpanel__close:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
}
.ws-wf-genpanel__body {
  padding: 14px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ws-wf-genpanel__input {
  width: 100%;
  min-height: 100px;
  resize: none;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.ws-wf-genpanel__input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(51, 86, 109, 0.15);
}
.ws-wf-genpanel__input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
.ws-wf-genpanel__hint {
  font-size: 0.6875rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}
.ws-wf-genpanel__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px 18px;
}

/* ── Generate dialog v2: larger, example chips, capability tip ── */

.ws-wf-genpanel--lg {
  width: min(680px, calc(100vw - 48px));
  max-width: none;
}

.ws-wf-genpanel__spark {
  color: var(--brand-gold);
  margin-right: 2px;
}

.ws-wf-genpanel__sub {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.ws-wf-genpanel__labelrow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-wf-genpanel__input--lg {
  min-height: 140px;
  font-size: 0.84375rem;
}

.ws-wf-genpanel__examples {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.ws-wf-genpanel__examples-label {
  font-size: 0.71875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ws-wf-genpanel__chip {
  border: 1px solid var(--border-subtle);
  background: var(--surface-canvas);
  color: var(--text-secondary);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  line-height: 1.3;
  cursor: pointer;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.ws-wf-genpanel__chip:hover {
  border-color: var(--brand-gold);
  color: var(--text-primary);
  background: var(--surface-elevated);
}

.ws-wf-genpanel__foot-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: auto;
}

.ws-wf-genpanel__foot-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Tip icon + hover capability catalog */

.ws-wf-tip {
  position: relative;
  display: inline-flex;
}

.ws-wf-tip__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans);
  line-height: 1;
  cursor: help;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.ws-wf-tip:hover .ws-wf-tip__icon,
.ws-wf-tip:focus-within .ws-wf-tip__icon {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: var(--surface-canvas);
}

.ws-wf-tip__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: -12px;
  z-index: 40;
  width: min(440px, calc(100vw - 80px));
  max-height: 380px;
  overflow-y: auto;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  display: none;
}

.ws-wf-tip:hover .ws-wf-tip__panel,
.ws-wf-tip:focus-within .ws-wf-tip__panel {
  display: block;
}

.ws-wf-tip__heading {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 10px 0 4px;
}

.ws-wf-tip__heading:first-child { margin-top: 0; }

.ws-wf-tip__row {
  font-size: 0.78125rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

.ws-wf-tip__list {
  list-style: disc;
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ws-wf-tip__list li {
  font-size: 0.78125rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.ws-wf-tip__list strong {
  color: var(--text-primary);
  font-weight: 600;
}

.ws-wf-tip__note {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  margin: 10px 0 0;
  padding-top: 8px;
}

/* ════════════════════════════════════════════════════════════════
   v17 MATTER REVAMP — analysis panel, facts strip, simplified list,
   smart wizard, sidebar collapse, vector icons
   ════════════════════════════════════════════════════════════════ */

/* Inline vector icons align with text */
.ws-i { vertical-align: -0.18em; display: inline-block; }

/* ── Matters list: leaner toolbar + "+" ── */
/* Floating "new matter" button: bottom-left of the list column, matching
   the dashboard FAB's placement. The list is a scrolling flex column, so
   margin:auto pins it to the bottom-left and sticky keeps it in view while
   the list scrolls. */
.ws-matters-new {
  position: sticky; bottom: 18px; z-index: 20;
  margin: auto auto 18px 18px;
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 50%; border: none;
  background: var(--brand-navy); color: var(--surface-canvas); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(10, 37, 54, 0.28);
  transition: background 0.15s ease, transform 0.15s ease;
}
.ws-matters-new:hover { background: var(--brand-gold); transform: translateY(-2px); }
.sb-case-card__meta-line .sb-status-pill { margin-left: 6px; vertical-align: 1px; }

/* ── Matter detail: tab bar polish ── */
.md-tab-bar { gap: 4px; padding: 0 1.5rem; }
.md-tab {
  border-radius: 8px 8px 0 0;
  font-weight: 600; letter-spacing: 0.01em;
}
.md-tab.is-active { box-shadow: inset 0 -2px 0 var(--brand-gold); }

/* ── Detail cards (Matter details / Team & parties) ── */
.md-detail-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
}
.md-detail-card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 0.875rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.md-detail-card__title { margin: 0; font-size: 0.9375rem; font-weight: 700; color: var(--brand-navy); }
.md-detail-card__action {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border-subtle); background: none; border-radius: 100px;
  padding: 5px 12px; font-size: 0.75rem; font-weight: 600; color: var(--brand-navy);
  cursor: pointer; font-family: var(--font-sans);
  transition: background 120ms, border-color 120ms;
}
.md-detail-card__action:hover { background: var(--surface-recessed); border-color: var(--border-strong); }

.md-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem 1rem; }
.md-detail-field__label {
  font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
}
.md-detail-field__value { margin-top: 3px; font-size: 0.875rem; font-weight: 600; color: var(--brand-navy); display: inline-block; }
.md-detail-field__value-row { display: flex; align-items: center; gap: 6px; }
.md-detail-field__menu {
  border: none; background: none; cursor: pointer; padding: 2px;
  color: var(--text-muted); border-radius: 4px; line-height: 1;
  opacity: 0; transition: opacity 120ms, color 120ms;
}
.md-detail-field:hover .md-detail-field__menu { opacity: 1; }
.md-detail-field__menu:hover { color: var(--brand-navy); }

.md-detail-subsection { margin-top: 1rem; }
.md-detail-subsection:first-of-type { margin-top: 0; }
.md-detail-sublabel {
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.5rem;
}
.md-detail-empty { font-size: 0.8125rem; color: var(--text-muted); margin: 0; }

.md-parties-cols { display: flex; gap: 1.5rem; }
.md-parties-col { flex: 1; min-width: 0; }

@media (max-width: 720px) {
  .md-detail-grid { grid-template-columns: repeat(2, 1fr); }
  .md-parties-cols { flex-direction: column; gap: 1rem; }
}

/* ── Contributors (Team) strip ── */
.md-contributors-section { margin-bottom: 1.25rem; }
.md-contributors { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 30px; }
.md-contributor-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-navy); color: #F3FAFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.01em;
  border: 2px solid var(--surface-elevated);
  cursor: default;
}
.md-contributor-avatar:hover { background: var(--brand-navy-deep); }
.md-contributor-skel {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(10, 37, 54, 0.08);
}
.md-contributors-empty { font-size: 0.8125rem; color: var(--text-muted); margin: 0; }

/* ── Document strip (Overview quick glance) ── */
.md-docstrip {
  display: flex; gap: 0.625rem; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: thin; scrollbar-color: var(--border-subtle) transparent;
}
.md-docstrip::-webkit-scrollbar { height: 5px; }
.md-docstrip::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }
.md-docstrip-card {
  flex: 0 0 auto; width: 108px;
  display: flex; flex-direction: column; align-items: center; gap: 0.375rem;
  background: var(--surface-elevated); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 0.75rem 0.5rem; cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.md-docstrip-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.md-docstrip-card__icon { display: flex; justify-content: center; }
.md-docstrip-card__name {
  font-size: 0.75rem; font-weight: 600; color: var(--brand-navy);
  text-align: center; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.md-docstrip-card__meta { font-size: 0.625rem; color: var(--text-muted); }
.md-docstrip-skel { flex: 0 0 auto; width: 108px; height: 92px; border-radius: 10px; background: rgba(10, 37, 54, 0.06); }
.md-docstrip-empty { font-size: 0.8125rem; color: var(--text-muted); margin: 0; }

/* ── Overview grid: analysis column ── */
.md-overview-grid { grid-template-columns: minmax(0, 1fr) 360px; }
.md-overview-main { display: flex; flex-direction: column; min-height: 100%; }
.md-analysis-col { padding: 0; }

/* ── AI Analysis panel ── */
.md-analysis { display: flex; flex-direction: column; height: 100%; }
.md-analysis__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(10, 37, 54, 0.08);
}
.md-analysis__title {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.9rem; font-weight: 700; color: var(--brand-navy);
}
.md-analysis__title .ws-i { color: var(--brand-gold); }
.md-analysis__run {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(51, 86, 109, 0.35);
  background: var(--surface-elevated); color: var(--brand-gold);
  font-size: 0.75rem; font-weight: 600;
}
.md-analysis__run:hover { background: rgba(51, 86, 109, 0.08); }
.md-analysis__run.is-busy { opacity: 0.6; cursor: progress; }
.md-analysis__feed { flex: 1; overflow-y: auto; padding: 12px 16px; max-height: 60vh; }
.md-analysis__loading, .md-analysis__running {
  font-size: 0.8125rem; color: var(--text-muted); padding: 6px 0;
  display: flex; align-items: center; gap: 7px;
}
.md-analysis__running .ws-i { color: var(--brand-gold); animation: mdSpin 1.4s linear infinite; }
@keyframes mdSpin { to { transform: rotate(360deg); } }

.md-analysis__empty { padding: 8px 2px; }
.md-analysis__empty-title { font-size: 0.875rem; font-weight: 700; color: var(--brand-navy); margin-bottom: 6px; }
.md-analysis__empty p { font-size: 0.78rem; line-height: 1.6; color: var(--text-secondary); margin: 0; }

.md-analysis__entry { padding: 12px 0; border-bottom: 1px solid rgba(10, 37, 54, 0.07); }
.md-analysis__entry:last-child { border-bottom: none; }
.md-analysis__entry-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.md-analysis__stamp { font-size: 0.7rem; font-weight: 700; color: var(--brand-navy); }
.md-analysis__trigger {
  font-size: 0.65rem; font-weight: 600; padding: 2px 8px; border-radius: 100px;
  background: var(--brand-gold-soft); color: var(--brand-navy); white-space: nowrap;
}
.md-analysis__body { font-size: 0.8125rem; line-height: 1.62; color: var(--text-primary); }
.md-analysis__body h3 { font-size: 0.8rem; margin: 12px 0 4px; color: var(--brand-navy); }
.md-analysis__opp {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 0.72rem; font-weight: 600; color: var(--brand-gold);
}
.md-analysis__cites { margin-top: 10px; border-left: 3px solid var(--brand-gold); padding: 6px 10px; background: rgba(51, 86, 109, 0.05); border-radius: 0 8px 8px 0; }
.md-analysis__cites-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 4px; }
.md-analysis__cite { margin-bottom: 5px; }
.md-analysis__cite-ref { display: block; font-size: 0.75rem; font-weight: 700; color: var(--brand-navy); }
.md-analysis__cite-why { display: block; font-size: 0.72rem; color: var(--text-secondary); line-height: 1.45; }

.md-analysis__direction {
  border-top: 1px solid rgba(10, 37, 54, 0.08);
  padding: 14px 16px 16px; background: var(--surface-elevated);
  display: flex; flex-direction: column; gap: 10px;
}
.md-analysis__dir-label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--brand-navy-soft); }
.md-analysis__dir-row { display: flex; gap: 8px; }
.md-analysis__dir-row .md-analysis__select { flex: 1; min-width: 0; font-size: 0.8125rem; height: 38px; padding: 0 12px; }
.md-analysis__note {
  font-size: 0.8125rem; resize: none; line-height: 1.55;
  padding: 10px 12px; background: var(--surface-elevated); border-radius: 8px;
}
.md-analysis__opponent {
  font-size: 0.8125rem; height: 38px; padding: 0 12px;
  background: var(--surface-elevated); border-radius: 8px;
}
.md-analysis__auto {
  font-size: 0.6875rem; font-weight: 600; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 5px;
}
.md-analysis__auto::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-gold); opacity: 0.85;
}
.md-analysis__save { align-self: stretch; justify-content: center; }

/* ── AI Tools: icon chips (blue, never green) ── */
.ws-action-card__icon-wrap {
  background: rgba(51, 86, 109, 0.10) !important;
  color: var(--brand-gold) !important;
  border-radius: 9px;
}

/* ── Documents toolbar button ── */
.md-toolbar-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(10, 37, 54, 0.14);
  background: var(--surface-elevated); color: var(--brand-navy);
  font-size: 0.8125rem; font-weight: 600;
}
.md-toolbar-btn:hover { border-color: var(--brand-gold); color: var(--brand-gold); }

/* ── Smart wizard (wz2) ── */
/* Sized up: the intake modal is the firm's front door — give it room. Scoped
   to this overlay so other flows keep the default 820px shell. */
#ws-wizard-overlay .ws-wizard-panel {
  max-width: 1060px;
  height: min(720px, 90vh);
  max-height: 90vh;
}
.wz2 { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.wz2-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1.125rem 3.25rem 1.125rem 1.75rem;
  background: var(--brand-navy); flex-shrink: 0;
  /* Match the panel's own corner radius — otherwise the header's hard
     rectangular corner meets the panel's rounded overflow:hidden clip and
     antialiases into a thin light seam at the top edge. */
  border-radius: 16px 16px 0 0;
}
.wz2-title { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; color: #FFFFFF; margin: 0 0 4px; }
.wz2-body { flex: 1; min-height: 0; overflow-y: auto; padding: 1.5rem 1.75rem 0.75rem; background: var(--surface-elevated); }
.wz2-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 1.5rem; align-items: start; }
.wz2 .form-group { margin-bottom: 1rem; }
.wz2 .form-label {
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted, rgba(10, 37, 54, 0.5)); margin-bottom: 5px; display: block;
}
.wz2 .form-input, .wz2 .form-select {
  height: 32px; font-size: 0.75rem; background: var(--surface-elevated);
  border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 0 0.625rem; color: var(--brand-navy-deep);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wz2 .form-input::placeholder { color: rgba(10, 37, 54, 0.35); }
.wz2 .form-input:hover, .wz2 .form-select:hover { border-color: var(--brand-navy-soft); }
.wz2 .form-input:focus, .wz2 .form-select:focus {
  outline: none; border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(10, 37, 54, 0.08);
}
.wz2 .form-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2333566D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
  padding-right: 2.25rem;
  cursor: pointer;
}
.wz2 textarea.form-input { height: auto; resize: none; padding: 0.625rem 0.75rem; line-height: 1.6; }
.wz2 .form-hint { font-size: 0.6875rem; line-height: 1.5; margin-top: 0.35rem; }
.wz2-other-wrap { margin-top: 0.4rem; }
.wz2-other-wrap[hidden] { display: none; }
.wz2 .wz2-other-input { background: var(--surface-recessed); border-color: var(--border-subtle); }
.wz2 .wz2-other-input:focus { background: var(--surface-elevated); }
/* Classification/access side panel — a plain rounded card, no accent stripe. */
.wz2-side {
  background: #E9F1F6;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem 1.125rem 0.25rem;
}
.wz2-side .form-group { margin-bottom: 0.875rem; }
.wz2-side__label {
  font-size: 0.6875rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--brand-navy-soft); margin-bottom: 0.75rem;
}
.wz2-input-row { display: flex; align-items: flex-start; gap: 8px; }
.wz2-input-row textarea { flex: 1; min-width: 0; }
.wz2-input-row .ws-mic-btn { margin-top: 0; flex-shrink: 0; }
.wz2-steps { display: flex; gap: 6px; flex-shrink: 0; }
.wz2-step {
  font-size: 0.6875rem; font-weight: 600; padding: 4px 12px; border-radius: 100px;
  background: rgba(243, 250, 255, 0.14); color: rgba(243, 250, 255, 0.75);
}
.wz2-step.is-active { background: var(--surface-elevated); color: var(--brand-navy); }
.wz2-step.is-done { background: #E0EAF0; color: var(--brand-navy); }
.wz2-row { display: flex; gap: 12px; }
.wz2-row .form-group { flex: 1; min-width: 0; }

/* ── Searchable client combobox (wz2-combo) ── */
.wz2-combo { position: relative; }
.wz2-combo__trigger {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; text-align: left; cursor: pointer;
}
.wz2-combo__label {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-muted);
}
.wz2-combo.has-value .wz2-combo__label { color: var(--text-primary); font-weight: 500; }
.wz2-combo__clear {
  display: none;
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: 0.625rem; line-height: 20px; text-align: center;
  color: var(--text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.wz2-combo.has-value .wz2-combo__clear { display: inline-block; }
.wz2-combo__clear:hover { background: var(--status-danger-soft); color: var(--status-danger); }
.wz2-combo__caret { flex-shrink: 0; font-size: 0.625rem; color: var(--text-muted); transition: transform var(--transition-fast); }
.wz2-combo.is-open .wz2-combo__caret { transform: rotate(180deg); }
.wz2-combo__dd {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
}
.wz2-combo__search { margin-bottom: 0.375rem; font-size: 0.78125rem; }
.wz2-combo__list { max-height: 220px; overflow-y: auto; }
.wz2-combo__item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem; color: var(--text-primary);
  cursor: pointer;
}
.wz2-combo__item:hover { background: var(--surface-recessed); }
.wz2-combo__item.is-selected { background: var(--brand-gold-soft); font-weight: 600; }
.wz2-combo__avatar {
  flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-soft) 100%);
  color: var(--surface-canvas);
  font-size: 0.625rem; font-weight: 700; letter-spacing: 0.03em;
  display: inline-flex; align-items: center; justify-content: center;
}
.wz2-combo__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wz2-combo__empty { padding: 0.75rem 0.625rem; font-size: 0.78125rem; color: var(--text-muted); }

.wz2-footer {
  display: flex; justify-content: flex-end; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1.75rem; border-top: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  margin-top: 0; flex-shrink: 0;
}
.wz2-footer .btn { height: 32px; padding: 0 1rem; font-size: 0.75rem; border-radius: 8px; }
.wz2-footer .form-error { margin: 0 auto 0 0; font-size: 0.75rem; }
@media (max-width: 720px) {
  .wz2-grid { grid-template-columns: 1fr; }
  .wz2-head { flex-direction: column; align-items: flex-start; padding: 1rem 3rem 1rem 1.25rem; }
  .wz2-body { padding: 1.25rem 1.25rem 0.5rem; }
  .wz2-footer { padding: 0.75rem 1.25rem; }
  #ws-wizard-overlay .ws-wizard-panel { height: auto; }
}

/* ── Matter document editor (wsde) ── */
.wsde-overlay { position: fixed; inset: 0; z-index: 950; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.wsde-backdrop { position: absolute; inset: 0; background: rgba(10, 37, 54, 0.6); backdrop-filter: blur(3px); }
.wsde-panel {
  position: relative; z-index: 1; width: 100%; max-width: 920px;
  height: 90vh; max-height: 900px;
  background: var(--surface-elevated); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(10, 37, 54, 0.28);
}
.wsde-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem 1.5rem; background: var(--brand-navy); flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}
.wsde-title { font-family: var(--font-serif); font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.01em; color: #FFFFFF; margin: 0 0 2px; }
.wsde-close {
  background: rgba(243, 250, 255, 0.18); border: 1px solid rgba(243, 250, 255, 0.35);
  width: 24px; height: 24px; border-radius: 50%; font-size: 0.8125rem; color: #FFFFFF;
  cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.15s;
}
.wsde-close:hover { background: rgba(243, 250, 255, 0.3); }
.wsde-bar {
  display: flex; align-items: center; gap: 1rem; padding: 0.5rem 1.125rem;
  border-bottom: 1px solid var(--border-subtle); background: var(--surface-elevated); flex-shrink: 0;
}
.wsde-doc-title {
  flex: 1; min-width: 0; border: none; outline: none;
  font-family: var(--font-sans); font-size: 0.9375rem; font-weight: 700; color: var(--brand-navy);
  background: none; padding: 6px 0;
}
.wsde-doc-title::placeholder { color: var(--text-muted); font-weight: 500; }
.wsde-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.wsde-font {
  height: 28px; padding: 0 8px; max-width: 150px;
  border: 1px solid var(--border-subtle); border-radius: 8px;
  background: var(--surface-elevated); color: var(--brand-navy);
  font-family: var(--font-sans); font-size: 0.71875rem; font-weight: 600;
  cursor: pointer;
}
.wsde-font:hover { background: #E9F1F6; }
.wsde-tool {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent;
  background: none; cursor: pointer; font-size: 0.8125rem; color: var(--brand-navy);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-sans);
  transition: background 0.12s, border-color 0.12s;
}
.wsde-tool:hover { background: #E9F1F6; border-color: var(--border-subtle); }
.wsde-tools__sep { width: 1px; height: 18px; background: var(--border-subtle); margin: 0 6px; }
.wsde-swatch {
  width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
  border: 2px solid #FFFFFF; box-shadow: 0 0 0 1px var(--border-strong);
  padding: 0; transition: transform 0.12s;
}
.wsde-swatch:hover { transform: scale(1.15); }
.wsde-scroll { flex: 1; min-height: 0; overflow-y: auto; background: #DFE7EE; padding: 1.5rem; }
.wsde-page {
  background: var(--surface-elevated); max-width: 740px; min-height: calc(100% - 2px);
  margin: 0 auto; padding: 3.5rem 4rem; border-radius: 2px;
  box-shadow: 0 2px 12px rgba(10, 37, 54, 0.14);
  font-family: var(--font-sans); font-size: 0.9375rem; line-height: 1.75;
  color: var(--brand-navy); outline: none; overflow-wrap: break-word;
}
.wsde-page:empty::before { content: 'Start writing…'; color: var(--text-muted); }
.wsde-footer {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.625rem 1.125rem; border-top: 1px solid var(--border-subtle);
  background: var(--surface-elevated); flex-shrink: 0;
}
.wsde-folder-label { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand-navy-soft); }
.wsde-folder {
  height: 32px; min-width: 190px; padding: 0 10px; font-size: 0.78125rem;
  font-family: var(--font-sans); color: var(--brand-navy);
  border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--surface-elevated);
}
.wsde-err { margin: 0 0 0 auto; font-size: 0.75rem; }
.wsde-footer .btn--ghost { margin-left: auto; }
.wsde-err:not([hidden]) ~ .btn--ghost { margin-left: 0; }
.wsde-footer .btn { height: 32px; padding: 0 1rem; font-size: 0.75rem; border-radius: 8px; }
@media (max-width: 760px) {
  .wsde-page { padding: 1.75rem 1.5rem; }
  .wsde-bar { flex-wrap: wrap; }
}

/* ── Sidebar collapse ── */
.sb-sidebar { transition: width 0.16s ease, min-width 0.16s ease; }
.sb-collapse-btn {
  align-self: flex-end;
  width: 30px; height: 30px;
  margin: 10px 10px 2px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(243, 250, 255, 0.12); border-radius: 8px; cursor: pointer;
  background: rgba(243, 250, 255, 0.04); color: rgba(243, 250, 255, 0.62);
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sb-collapse-btn svg { transition: transform 0.2s ease; flex-shrink: 0; }
.sb-collapse-btn:hover {
  background: rgba(243, 250, 255, 0.10); color: #F3FAFF;
  border-color: rgba(243, 250, 255, 0.22);
}
@media (min-width: 768px) {
  .sb-sidebar.is-collapsed { width: 60px; min-width: 60px; }
  .sb-sidebar.is-collapsed .sb-nav-item__label,
  .sb-sidebar.is-collapsed .sb-nav-pro-badge,
  .sb-sidebar.is-collapsed .sb-nav-firm-badge { display: none; }
  .sb-sidebar.is-collapsed .sb-nav-item { justify-content: center; padding: 12px; }
  .sb-sidebar.is-collapsed .sb-collapse-btn { align-self: center; margin-right: 0; margin-left: 0; }
  /* Keep the footer visible when collapsed — just the avatar circle, no
     name/chevron — so there's still a face to click for the account menu. */
  .sb-sidebar.is-collapsed .sb-sidebar__footer { display: flex; justify-content: center; padding: 8px 0 10px; }
  .sb-sidebar.is-collapsed .ws-user-chip { width: auto; margin: 0 auto; padding: 0; border-radius: 50%; }
  .sb-sidebar.is-collapsed .ws-user-chip__name,
  .sb-sidebar.is-collapsed .ws-user-chip__chevron { display: none; }
}
@media (max-width: 767px) { .sb-collapse-btn { display: none; } }

/* ── Matter detail responsive ── */
@media (max-width: 1180px) {
  .md-overview-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 980px) {
  .md-overview-grid { grid-template-columns: 1fr; }
  .md-analysis-col { border-top: 1px solid rgba(10, 37, 54, 0.08); }
  .md-analysis__feed { max-height: 46vh; }
  .md-facts { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
}
@media (max-width: 700px) {
  .wz2-row { flex-direction: column; gap: 0; }
  .md-analysis__dir-row { flex-direction: column; }
  .md-analysis__save { align-self: stretch; }
}

/* ── Matter Documents tab: folder sections ── */
.ws-doc-folder-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 18px 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid rgba(10, 37, 54, 0.08);
}
.ws-doc-folder-heading__name {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.8125rem; font-weight: 700; color: var(--brand-navy);
}
.ws-doc-folder-heading__name .ws-i { color: var(--brand-gold); }
.ws-doc-folder-heading__count {
  font-size: 0.6875rem; font-weight: 600; padding: 1px 8px; border-radius: 100px;
  background: rgba(51, 86, 109, 0.10); color: var(--brand-gold); margin-left: 4px;
}
.ws-doc-folder-del {
  width: 26px; height: 26px; border-radius: 7px; border: none; cursor: pointer;
  background: transparent; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.ws-doc-folder-del:hover { background: var(--status-danger-soft); color: var(--status-danger); }
.ws-doc-folder-empty { font-size: 0.78rem; color: var(--text-muted); margin: 2px 0 6px; }
