/* =============================================================================
   admin.css — Hope Channel CRM styles, layered on /css/mc-core.css.

   mc-core.css is the Mission Control design system, copied verbatim: tokens,
   navbar, page header, toolbar pills, toasts, confirm dialogs, workspace
   tables. This file holds everything the CRM adds on top of it:

     1. CRM tokens         colours only this app uses (mention pills)
     2. Bootstrap theme    Bootstrap's components re-pointed at MC's tokens, so
                           the ~40 existing views pick up the look without each
                           being rewritten in mc-* markup
     3. Chrome             the CRM's navbar additions (dropdowns, icon buttons)
     4. Components         meta sidebar, side panel, mentions, notes, markdown

   Rules: a new colour goes in :root as a token, never inline in a rule.
   Build from tokens. Reuse an mc-* or ea-wk-* class before writing a new one.
   ============================================================================= */

/* ---------- 1. CRM tokens ---------- */
:root {
  /* @-mention pills: one hue per entity type, text dark enough to read at 12px */
  --mention-contact-bg: #e7f1ff;
  --mention-contact-bg-hover: #d0e2ff;
  --mention-contact-ink: #1d4ed8;
  --mention-channel-bg: var(--ok-chip-bg);
  --mention-channel-bg-hover: #d6ecdf;
  --mention-channel-ink: var(--ok-deep);
  --mention-region-bg: #e3f7fb;
  --mention-region-bg-hover: #c7eef5;
  --mention-region-ink: #087990;

  /* Info has no tone in MC; the CRM needs one for Bootstrap's info badges and alerts */
  --info-bg: #eef4fd;
  --info-border: #c9dbf5;
  --info-text: #1e4f91;

  /* Chart palette (lib/chart-colors.js hands these out). The first four are
     Mission Control's comparison slot colours (lib/budget-compare.js
     BASE_COLORS) in the same order, the fifth its Engagement pink; the rest
     are spread round the wheel so twelve categories stay apart. Accents only:
     bars, dots, edges, never text. */
  --chart-1: #3b82f6;
  --chart-2: #f97316;
  --chart-3: #a855f7;
  --chart-4: #10b981;
  --chart-5: #ec4899;
  --chart-6: #0ea5e9;
  --chart-7: #eab308;
  --chart-8: #6366f1;
  --chart-9: #14b8a6;
  --chart-10: #f43f5e;
  --chart-11: #84cc16;
  --chart-12: #64748b;

  /* ---------- 2. Bootstrap theme: variables ----------
     Bootstrap 5.3 reads most of its colours from these, so re-pointing them
     here re-themes every utility (.text-muted, .border, .bg-light, links…) at
     once. `primary` becomes the dark ink: MC has no blue, and a pressed or
     primary thing is filled --dark there (amber means live/money). */
  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--ink);
  --bs-body-color-rgb: 31, 39, 51;
  /* White, as in MC: Bootstrap paints inputs (and their :focus state), modals
     and dropdowns with this. The grey page comes from `body` in mc-core.css. */
  --bs-body-bg: var(--surface);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-color: var(--faint);
  --bs-secondary-bg: var(--panel);
  --bs-tertiary-bg: var(--panel);
  --bs-heading-color: var(--ink);
  --bs-border-color: var(--card-border);
  --bs-border-color-translucent: var(--border);
  --bs-border-radius: 8px;
  --bs-border-radius-sm: 6px;
  --bs-border-radius-lg: 12px;
  --bs-link-color: var(--accent-ink);
  --bs-link-color-rgb: 176, 125, 18;
  --bs-link-hover-color: #8a5f08;
  --bs-link-hover-color-rgb: 138, 95, 8;
  --bs-focus-ring-color: rgba(18, 22, 29, 0.15);
  --bs-font-monospace: var(--font-mono);
  --bs-code-color: var(--accent-ink);

  --bs-primary: #1f2733;
  --bs-primary-rgb: 31, 39, 51;
  --bs-secondary-rgb: 90, 100, 114;
  --bs-success-rgb: 47, 158, 99;
  --bs-danger-rgb: 201, 66, 79;
  --bs-warning-rgb: 224, 165, 47;
  --bs-light-rgb: 246, 247, 249;
  --bs-dark-rgb: 18, 22, 29;
  --bs-primary-text-emphasis: var(--ink);
  --bs-primary-bg-subtle: var(--panel);
  --bs-primary-border-subtle: var(--card-border);
  --bs-success-text-emphasis: var(--ok-deep);
  --bs-success-bg-subtle: var(--ok-bg);
  --bs-success-border-subtle: var(--ok-border);
  --bs-warning-text-emphasis: var(--warn-text);
  --bs-warning-bg-subtle: var(--warn-bg-2);
  --bs-warning-border-subtle: var(--warn-border);
  --bs-danger-text-emphasis: var(--bad-text);
  --bs-danger-bg-subtle: var(--bad-bg-2);
  --bs-danger-border-subtle: var(--bad-border);
  --bs-info-text-emphasis: var(--info-text);
  --bs-info-bg-subtle: var(--info-bg);
  --bs-info-border-subtle: var(--info-border);
  --bs-secondary-text-emphasis: var(--ink-2);
  --bs-secondary-bg-subtle: var(--panel);
  --bs-secondary-border-subtle: var(--card-border);
}

/* `clip`, not `hidden`: hidden makes the body a scroll container, and every
   sticky thing inside it (the page header, the meta sidebar) then sticks to a
   box that never scrolls — MC's style guide §4.5. clip stops the sideways
   page scroll without that. */
html, body {
  overflow-x: clip;
}

/* Titles in the display face, as MC sets them. h6 stays in the body face: the
   CRM uses it for small labels, where Space Grotesk reads as a heading. */
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 {
  font-family: var(--font-display);
  font-weight: 600;
}

/* ---------- 2. Bootstrap theme: components ---------- */

/* Cards wear the workspace panel's shape (.ea-wk-panel): a hairline wash and a
   12px radius, flat at rest. */
.card {
  --bs-card-border-color: var(--border);
  --bs-card-border-radius: 12px;
  --bs-card-inner-border-radius: 11px;
  --bs-card-cap-bg: var(--surface);
  --bs-card-cap-padding-y: 12px;
  --bs-card-cap-padding-x: 14px;
  --bs-card-bg: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.card-header {
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--ink);
}
.card-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
}

/* Tables wear .ea-wk-table's type: 13px rows, uppercase mono-spaced kicker
   headings on the panel fill, a track-coloured rule between rows. */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--track);
  --bs-table-hover-bg: var(--panel);
  --bs-table-hover-color: var(--ink);
  --bs-table-striped-bg: rgba(0, 0, 0, 0.015);
  --bs-table-active-bg: var(--warn-bg-3);
  margin-bottom: 0;
  font-size: 13px;
}
.table > thead > tr > th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.table > thead > tr > th a {
  color: inherit;
  text-decoration: none;
}
.table > tbody > tr > td {
  vertical-align: middle;
}
.table > tbody > tr:last-child > td {
  border-bottom: 0;
}
/* A table flush inside a card keeps the card's rounded top corners. */
.card > .table > thead > tr:first-child > th:first-child,
.card > .card-body.p-0 > .table > thead > tr:first-child > th:first-child,
.card > .card-body.p-0 > .table-responsive > .table > thead > tr:first-child > th:first-child {
  border-top-left-radius: 11px;
}
.card > .table > thead > tr:first-child > th:last-child,
.card > .card-body.p-0 > .table > thead > tr:first-child > th:last-child,
.card > .card-body.p-0 > .table-responsive > .table > thead > tr:first-child > th:last-child {
  border-top-right-radius: 11px;
}

/* Buttons take the MC pill: 600 weight, fully rounded. Primary is the dark
   fill MC uses for its one "go" button (.mc-confirm-btn.is-primary); the
   outlined secondary is .mc-toolbar-btn. Inside an input group a pill would
   meet a square-ish input, so there they keep the control radius. */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-font-size: 13px;
  --bs-btn-border-radius: 999px;
  --bs-btn-padding-x: 14px;
  --bs-btn-focus-box-shadow: 0 0 0 3px rgba(18, 22, 29, 0.15);
}
.btn-sm {
  --bs-btn-font-size: 12px;
  --bs-btn-padding-x: 12px;
  --bs-btn-border-radius: 999px;
}
.btn-lg {
  --bs-btn-border-radius: 999px;
}
.input-group > .btn,
.input-group > .btn-sm {
  --bs-btn-border-radius: 8px;
}
.btn-primary {
  --bs-btn-bg: var(--dark);
  --bs-btn-border-color: var(--dark);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--dark-ribbon);
  --bs-btn-hover-border-color: var(--dark-ribbon);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #000;
  --bs-btn-active-border-color: #000;
  --bs-btn-disabled-bg: var(--dark);
  --bs-btn-disabled-border-color: var(--dark);
}
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-dark,
.btn-light,
.btn-secondary {
  --bs-btn-bg: var(--surface);
  --bs-btn-border-color: var(--card-border);
  --bs-btn-color: var(--muted);
  --bs-btn-hover-bg: var(--panel);
  --bs-btn-hover-border-color: var(--card-border);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-active-bg: var(--dark);
  --bs-btn-active-border-color: var(--dark);
  --bs-btn-active-color: #fff;
  --bs-btn-disabled-bg: var(--surface);
  --bs-btn-disabled-border-color: var(--card-border);
  --bs-btn-disabled-color: var(--faint);
}
.btn-success {
  --bs-btn-bg: var(--ok);
  --bs-btn-border-color: var(--ok);
  --bs-btn-hover-bg: var(--ok-deep);
  --bs-btn-hover-border-color: var(--ok-deep);
  --bs-btn-active-bg: var(--ok-deep);
}
.btn-outline-success {
  --bs-btn-color: var(--ok-deep);
  --bs-btn-border-color: var(--ok-border);
  --bs-btn-hover-bg: var(--ok-bg);
  --bs-btn-hover-border-color: var(--ok);
  --bs-btn-hover-color: var(--ok-deep);
  --bs-btn-active-bg: var(--ok);
}
.btn-danger {
  --bs-btn-bg: var(--bad);
  --bs-btn-border-color: var(--bad);
  --bs-btn-hover-bg: var(--bad-text);
  --bs-btn-hover-border-color: var(--bad-text);
  --bs-btn-active-bg: var(--bad-text);
}
.btn-outline-danger {
  --bs-btn-bg: var(--surface);
  --bs-btn-color: var(--bad);
  --bs-btn-border-color: var(--bad-border);
  --bs-btn-hover-bg: var(--bad-bg);
  --bs-btn-hover-border-color: var(--bad);
  --bs-btn-hover-color: var(--bad-text);
  --bs-btn-active-bg: var(--bad);
  --bs-btn-active-border-color: var(--bad);
}
.btn-warning {
  --bs-btn-bg: var(--warn);
  --bs-btn-border-color: var(--warn);
  --bs-btn-color: #1b1b1b;
  --bs-btn-hover-bg: var(--warn-border-2);
  --bs-btn-hover-border-color: var(--warn-border-2);
}
.btn-outline-warning {
  --bs-btn-color: var(--warn-text);
  --bs-btn-border-color: var(--warn-border);
  --bs-btn-hover-bg: var(--warn-bg-2);
  --bs-btn-hover-border-color: var(--warn);
  --bs-btn-hover-color: var(--warn-text);
}
.btn-outline-info {
  --bs-btn-color: var(--info-text);
  --bs-btn-border-color: var(--info-border);
  --bs-btn-hover-bg: var(--info-bg);
  --bs-btn-hover-border-color: var(--info-text);
  --bs-btn-hover-color: var(--info-text);
}
.btn-link {
  --bs-btn-color: var(--accent-ink);
  --bs-btn-hover-color: #8a5f08;
  --bs-btn-font-weight: 500;
}
.btn-check:checked + .btn-outline-primary,
.btn-check:checked + .btn-outline-secondary {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

/* Form controls: the 8px control radius and panel-grey focus of .ea-wk-search. */
.form-control,
.form-select {
  border-color: var(--card-border);
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--ink);
}
.form-control-sm,
.form-select-sm {
  font-size: 12.5px;
  border-radius: 6px;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(18, 22, 29, 0.08);
}
.form-control::placeholder {
  color: var(--faint);
}
.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.form-text {
  color: var(--muted);
  font-size: 12px;
}
.form-check-input:checked {
  background-color: var(--dark);
  border-color: var(--dark);
}
.form-check-input:focus {
  border-color: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(18, 22, 29, 0.1);
}
.input-group-text {
  background: var(--panel);
  border-color: var(--card-border);
  color: var(--muted);
}

/* Badges become MC's tinted chips: the status tones' chip pairs rather than
   Bootstrap's solid fills, so a row of them reads as metadata, not alarms.
   Scoped to .badge — .bg-* on anything else (avatars, icon discs) keeps the
   solid colour it asked for. */
.badge {
  --bs-badge-font-weight: 600;
  --bs-badge-font-size: 11px;
  --bs-badge-padding-x: 8px;
  --bs-badge-padding-y: 3px;
  --bs-badge-border-radius: 999px;
  letter-spacing: 0.01em;
}
.badge.bg-secondary, .badge.text-bg-secondary { background: var(--track) !important; color: var(--muted) !important; }
.badge.bg-light, .badge.text-bg-light         { background: var(--panel) !important; color: var(--ink-2) !important; box-shadow: inset 0 0 0 1px var(--card-border); }
.badge.bg-success, .badge.text-bg-success     { background: var(--ok-chip-bg) !important; color: var(--ok-deep) !important; }
.badge.bg-warning, .badge.text-bg-warning     { background: var(--warn-bg-2) !important; color: var(--warn-text) !important; }
.badge.bg-danger, .badge.text-bg-danger       { background: var(--bad-bg-2) !important; color: var(--bad-text) !important; }
.badge.bg-info, .badge.text-bg-info           { background: var(--info-bg) !important; color: var(--info-text) !important; }
.badge.bg-primary, .badge.text-bg-primary     { background: var(--ink-2) !important; color: #fff !important; }
.badge.bg-dark, .badge.text-bg-dark           { background: var(--dark) !important; color: #fff !important; }
/* A badge that set its own text colour (bg-light text-dark) keeps the chip's. */
.badge[class*="bg-"].text-dark { color: var(--ink-2) !important; }

/* Alerts use the status tones' three shades: ink, background, border. */
.alert {
  --bs-alert-border-radius: 10px;
  font-size: 13.5px;
}
.alert-success   { --bs-alert-color: var(--ok-deep);   --bs-alert-bg: var(--ok-bg);     --bs-alert-border-color: var(--ok-border); }
.alert-warning   { --bs-alert-color: var(--warn-text); --bs-alert-bg: var(--warn-bg);   --bs-alert-border-color: var(--warn-border); }
.alert-danger    { --bs-alert-color: var(--bad-text);  --bs-alert-bg: var(--bad-bg);    --bs-alert-border-color: var(--bad-border); }
.alert-info      { --bs-alert-color: var(--info-text); --bs-alert-bg: var(--info-bg);   --bs-alert-border-color: var(--info-border); }
.alert-secondary,
.alert-light     { --bs-alert-color: var(--ink-2);     --bs-alert-bg: var(--panel);     --bs-alert-border-color: var(--card-border); }

/* Tabs: an ink underline on the active tab rather than Bootstrap's boxed tab. */
.nav-tabs {
  --bs-nav-tabs-border-color: var(--border);
  --bs-nav-link-color: var(--muted);
  --bs-nav-link-hover-color: var(--ink);
  --bs-nav-link-font-weight: 500;
  gap: 4px;
}
.nav-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 13.5px;
  padding: 8px 12px;
}
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
  color: var(--ink);
  font-weight: 600;
  background: transparent;
  border-bottom-color: var(--dark);
}
.nav-pills {
  --bs-nav-pills-border-radius: 999px;
  --bs-nav-pills-link-active-bg: var(--dark);
  --bs-nav-link-color: var(--muted);
  --bs-nav-link-hover-color: var(--ink);
}

/* Dropdowns, modals, pagination, list groups. */
.dropdown-menu {
  --bs-dropdown-border-color: var(--card-border);
  --bs-dropdown-border-radius: 10px;
  --bs-dropdown-font-size: 13.5px;
  --bs-dropdown-link-color: var(--ink-2);
  --bs-dropdown-link-hover-bg: var(--panel);
  --bs-dropdown-link-hover-color: var(--ink);
  --bs-dropdown-link-active-bg: var(--dark);
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  box-shadow: var(--bs-dropdown-box-shadow);
}
.modal {
  --bs-modal-border-color: var(--card-border);
  --bs-modal-border-radius: 14px;
  --bs-modal-inner-border-radius: 13px;
  --bs-modal-header-border-color: var(--border);
  --bs-modal-footer-border-color: var(--border);
  --bs-modal-box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}
.modal-content {
  box-shadow: var(--bs-modal-box-shadow);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}
.modal-backdrop {
  --bs-backdrop-bg: #12161d;
  --bs-backdrop-opacity: 0.45;
}
.pagination {
  --bs-pagination-color: var(--ink-2);
  --bs-pagination-font-size: 13px;
  --bs-pagination-border-color: var(--card-border);
  --bs-pagination-hover-color: var(--ink);
  --bs-pagination-hover-bg: var(--panel);
  --bs-pagination-hover-border-color: var(--card-border);
  --bs-pagination-focus-color: var(--ink);
  --bs-pagination-focus-bg: var(--panel);
  --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(18, 22, 29, 0.1);
  --bs-pagination-active-bg: var(--dark);
  --bs-pagination-active-border-color: var(--dark);
  --bs-pagination-disabled-color: var(--faint);
  --bs-pagination-border-radius: 8px;
}
.list-group {
  --bs-list-group-border-color: var(--border);
  --bs-list-group-active-bg: var(--dark);
  --bs-list-group-active-border-color: var(--dark);
  --bs-list-group-action-hover-bg: var(--panel);
  --bs-list-group-action-hover-color: var(--ink);
}
.progress {
  --bs-progress-bg: var(--track);
  --bs-progress-bar-bg: var(--dark);
  --bs-progress-border-radius: 999px;
}

/* ---------- 3. Chrome: the navbar and page header ----------
   MC's navbar is a fixed 54px bar. The CRM's collapses to a menu below xl, and
   the open menu needs to grow past 54px, so the height becomes a minimum. */
.mc-navbar {
  height: auto;
  min-height: 54px;
}
.mc-navbar .navbar-brand {
  display: inline-flex;
  align-items: center;
}
.mc-navbar .nav-link.dropdown-toggle::after {
  vertical-align: 0.15em;
  opacity: 0.7;
}
/* Trash sits beside the settings cog: an icon button, like MC's nav-cog. */
.mc-navbar .nav-icons {
  display: flex;
  align-items: center;
  gap: 2px;
}
.mc-navbar .nav-user-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--dark);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}
.mc-navbar .dropdown-menu .dropdown-header {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
}
@media (max-width: 1199.98px) {
  .mc-navbar .navbar-collapse {
    padding: 8px 0 12px;
  }
  .mc-navbar .nav-icons {
    margin-top: 8px;
  }
}

/* Printing (the reports have Print buttons): no navbar, and the page header
   prints once at the top as a title rather than sticking. Paper is white. */
@media print {
  .mc-navbar { display: none !important; }
  .mc-page-header {
    position: static;
    background: none;
    margin: 0 0 1rem;
    padding: 0 0 8px;
  }
  body { background: #fff !important; }
  main.container-fluid { padding: 0 !important; }
}

/* ---------- 4. Components ---------- */

/* Meta sidebar: WordPress-style boxes beside an edit form, wearing the panel
   shape. Sticky below the page header strip. */
.meta-sidebar {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 106px);
  overflow: auto;
  padding-bottom: 1rem;
}
.meta-sidebar .mb-3 {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
}
.meta-sidebar .mb-3 > label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.meta-sidebar .mb-3 .form-control,
.meta-sidebar .mb-3 .form-select,
.meta-sidebar .mb-3 .btn {
  margin-bottom: 0.5rem;
}
@media (max-width: 767.98px) {
  .meta-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding-bottom: 0;
  }
}

/* Typeahead results in the committee / region / media-entity forms */
.typeahead-item {
  cursor: pointer;
  border-bottom: 1px solid var(--track);
}
.typeahead-item:last-child { border-bottom: none; }
.typeahead-item:hover { background: var(--panel); }
.typeahead-item.active { background: var(--warn-bg-3); box-shadow: inset 3px 0 0 var(--dark); }

/* List toolbar (partials/_table_controls.ejs): MC's .ea-wk-toolbar standing on
   its own above the table rather than heading a panel, so no bottom rule. The
   search takes what the chips and selects leave. */
.tc-bar .ea-wk-toolbar {
  border-bottom: 0;
}
.tc-bar .pl-selects select {
  max-width: 220px;
}

/* Initials disc for a contact without a photo (partials/_avatar.ejs). The
   partial sets the size; this is the look. */
.initials-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--track);
  color: var(--ink-2);
  font-family: var(--font-display);
  font-weight: 600;
}

/* Tag input (contact skills and roles): the chosen values as pills inside the
   box, and the suggestions below as outlined chips that grey out once taken. */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 10px;
  border-radius: 999px;
  background: var(--track);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
}
.tag-pill-remove {
  border: 0;
  background: none;
  padding: 0 2px;
  line-height: 1;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  border-radius: 50%;
}
.tag-pill-remove:hover {
  color: var(--bad);
}
.tag-chip {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.tag-chip:hover:not(:disabled) {
  background: var(--panel);
  border-color: var(--muted-2);
  color: var(--ink);
}
.tag-chip:disabled {
  background: var(--ok-chip-bg);
  border-color: var(--ok-border);
  color: var(--ok-deep);
  cursor: default;
}

/* @-mention pills in note bodies */
.mention {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
  text-decoration: none;
  font-size: 0.92em;
}
.mention-contact { background: var(--mention-contact-bg); color: var(--mention-contact-ink); }
.mention-contact:hover { background: var(--mention-contact-bg-hover); color: var(--mention-contact-ink); }
.mention-channel { background: var(--mention-channel-bg); color: var(--mention-channel-ink); }
.mention-channel:hover { background: var(--mention-channel-bg-hover); color: var(--mention-channel-ink); }
.mention-region { background: var(--mention-region-bg); color: var(--mention-region-ink); }
.mention-region:hover { background: var(--mention-region-bg-hover); color: var(--mention-region-ink); }
.mention-dropdown .dropdown-item.active { background: var(--dark); color: #fff; }

/* Notes inbox: fixed height so the note body scrolls instead of growing the
   page. 190px = navbar (54) + page header strip (~66) + its margin (24) +
   page bottom padding (24) + slack for the header wrapping. */
.notes-inbox {
  height: calc(100vh - 190px);
  overflow: hidden;
}
.notes-inbox-row {
  height: 100%;
}
.notes-inbox-row > [class*="col-"] {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#noteViewer,
#noteComposer {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#noteViewerBody {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* Markdown content rendered inside note viewers and the launcher result panel.
   Tight spacing and small headings so a paragraph + heading + list doesn't
   eat the whole pane. */
#noteViewerBody,
.launcher-result-body {
  font-size: 14px;
  line-height: 1.45;
}
#noteViewerBody > *:first-child,
.launcher-result-body > *:first-child { margin-top: 0 !important; }
#noteViewerBody > *:last-child,
.launcher-result-body > *:last-child  { margin-bottom: 0 !important; }

#noteViewerBody p,
.launcher-result-body p {
  margin: 0 0 0.35rem;
}

#noteViewerBody h1, .launcher-result-body h1 { font-size: 1.05rem; font-weight: 600; margin: 0.4rem 0 0.15rem; line-height: 1.25; }
#noteViewerBody h2, .launcher-result-body h2 { font-size: 1rem;    font-weight: 600; margin: 0.4rem 0 0.15rem; line-height: 1.25; }
#noteViewerBody h3, .launcher-result-body h3 { font-size: 0.95rem; font-weight: 600; margin: 0.35rem 0 0.1rem; line-height: 1.25; }
#noteViewerBody h4, .launcher-result-body h4,
#noteViewerBody h5, .launcher-result-body h5,
#noteViewerBody h6, .launcher-result-body h6 { font-size: 0.9rem;  font-weight: 600; margin: 0.3rem 0 0.1rem;  line-height: 1.25; }

#noteViewerBody ul, .launcher-result-body ul,
#noteViewerBody ol, .launcher-result-body ol {
  margin: 0.1rem 0 0.35rem;
  padding-left: 1.1rem;
}
#noteViewerBody li, .launcher-result-body li { margin-bottom: 0.05rem; line-height: 1.4; }
#noteViewerBody li > p, .launcher-result-body li > p { margin: 0; }
#noteViewerBody li > ul, .launcher-result-body li > ul,
#noteViewerBody li > ol, .launcher-result-body li > ol { margin: 0.05rem 0 0.1rem; }

#noteViewerBody blockquote,
.launcher-result-body blockquote {
  margin: 0.35rem 0;
  padding: 0.15rem 0.6rem;
  border-left: 3px solid var(--card-border);
  color: var(--muted);
}

#noteViewerBody pre,
.launcher-result-body pre {
  margin: 0.3rem 0;
  padding: 0.4rem 0.6rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.4;
  overflow-x: auto;
}
#noteViewerBody code,
.launcher-result-body code {
  font-family: var(--font-mono);
  background: var(--track);
  color: var(--ink);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.9em;
}
#noteViewerBody pre code,
.launcher-result-body pre code {
  background: transparent;
  padding: 0;
}

#noteViewerBody hr,
.launcher-result-body hr {
  margin: 0.4rem 0;
  border-color: var(--border);
}

#noteViewerBody table,
.launcher-result-body table {
  font-size: 13px;
  margin: 0.3rem 0;
  border-collapse: collapse;
}
#noteViewerBody th, .launcher-result-body th,
#noteViewerBody td, .launcher-result-body td {
  border: 1px solid var(--border);
  padding: 3px 6px;
}

/* @-mention hover card */
.mention-hover-card {
  position: fixed;
  z-index: 2000;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  overflow: hidden;
  animation: mhc-in 0.12s ease-out;
}
@keyframes mhc-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mhc-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
.mhc-photo, .mhc-photo-placeholder, .mhc-channel-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.mhc-photo-placeholder {
  background: var(--ink-2);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.mhc-channel-icon {
  background: var(--mention-channel-bg);
  color: var(--mention-channel-ink);
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.mhc-head-text { flex-grow: 1; min-width: 0; }
.mhc-name { font-family: var(--font-display); font-weight: 600; font-size: 14px; line-height: 1.25; word-break: break-word; }
.mhc-sub  { color: var(--muted); font-size: 12px; margin-top: 2px; }
.mhc-badge { font-size: 10px; font-weight: 600; }
.mhc-body { padding: 8px 14px; }
.mhc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  color: var(--ink-2);
}
.mhc-row i { color: var(--muted); flex-shrink: 0; width: 14px; text-align: center; }
.mhc-row a { color: var(--accent-ink); text-decoration: none; }
.mhc-row a:hover { text-decoration: underline; }
.mhc-foot {
  border-top: 1px solid var(--border);
  padding: 8px 14px;
  background: var(--panel);
}
.mhc-foot a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}
.mhc-foot a:hover { color: var(--accent-ink); }
.mhc-loading, .mhc-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
