/* ==========================================================================
   Chambers — Bootstrap 5.3 design system
   --------------------------------------------------------------------------
   Drop-in stylesheet loaded AFTER bootstrap.min.css. It retones Bootstrap by
   overriding its CSS custom properties — no SCSS build step required.
   When we want deeper control later, these tokens map 1:1 to Bootstrap's
   SCSS variables ($primary, $body-bg, $border-radius, ...).
   ========================================================================== */

/* ---- 1. Design tokens --------------------------------------------------- */
:root {
  /* Figma brand palette */
  --cb-brown:        #3d2208;   /* espresso / primary */
  --cb-brown-700:    #2e1905;
  --cb-brown-100:    #eee8e2;
  --cb-sage:         #d5d1aa;
  --cb-sage-100:     #f2f1e4;
  --cb-sky:          #d4e4f4;
  --cb-sky-100:      #edf4fb;
  --cb-parchment:    #f1ebe3;
  --cb-green:        #34433b;
  --cb-green-700:    #2a362f;

  /* Surfaces */
  --cb-bg:           #f8f6f2;   /* app background (warm cream) */
  --cb-surface:      #ffffff;   /* cards, inputs, sidebar */
  --cb-surface-soft: #fbfaf8;
  --cb-border:       #dedbd4;   /* hairlines */
  --cb-border-light: #ece9e3;

  /* Text */
  --cb-text:         #211f1d;
  --cb-text-muted:   #6d6964;
  --cb-text-faint:   #99948d;

  /* Type families */
  --cb-font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --cb-font-display: "Instrument Serif", Georgia, serif;
  /* Accent / status fills (soft pastels) */
  --cb-pink:         #f8e8e8;   --cb-pink-ink:   #a9252d;
  --cb-blue:         var(--cb-sky-100); --cb-blue-ink: #275b89;
  --cb-mint:         #e8f3e9;   --cb-mint-ink:   #317446;
  --cb-folder-tab:     var(--cb-sky);
  --cb-folder-tab-sub: var(--cb-sage);

  /* Tag palette (chips with colored dots) */
  --cb-tag-orange:   #b45309;
  --cb-tag-green:    #15803d;
  --cb-tag-blue:     #1d4ed8;
  --cb-tag-purple:   #7c3aed;
  --cb-tag-red:      #be123c;
  --cb-tag-teal:     #0f766e;

  /* Radii & shadow */
  --cb-radius-xs:    4px;
  --cb-radius-sm:    6px;
  --cb-radius:       8px;
  --cb-radius-lg:    12px;
  --cb-shadow-sm:    0 1px 2px rgba(61, 34, 8, .05);
  --cb-shadow:       0 8px 24px rgba(61, 34, 8, .09);

  /* Shared interaction states */
  --cb-focus-ring:   0 0 0 3px rgba(61, 34, 8, .14);
  --cb-transition:   150ms ease;

  /* ---- Map tokens onto Bootstrap's global CSS variables ---- */
  --bs-body-bg:           var(--cb-bg);
  --bs-body-color:        var(--cb-text);
  --bs-secondary-color:   var(--cb-text-muted);
  --bs-tertiary-color:    var(--cb-text-faint);
  --bs-border-color:      var(--cb-border);
  --bs-border-radius:     var(--cb-radius);
  --bs-border-radius-sm:  var(--cb-radius-sm);
  --bs-border-radius-lg:  var(--cb-radius-lg);
  --bs-border-radius-xl:  var(--cb-radius-lg);
  --bs-emphasis-color:    var(--cb-text);

  --bs-primary:           var(--cb-brown);
  --bs-primary-rgb:       61, 34, 8;
  --bs-link-color:        var(--cb-brown);
  --bs-link-color-rgb:    61, 34, 8;
  --bs-link-hover-color:  var(--cb-brown-700);

  --bs-font-sans-serif: var(--cb-font-sans);
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-font-size: .9375rem;
  --bs-body-line-height: 1.5;
}

/* ---- 2. Base & typography ---------------------------------------------- */
body {
  background-color: var(--cb-bg);
  color: var(--cb-text);
  -webkit-font-smoothing: antialiased;
}

.cb-legal-document {
  max-width: 760px;
}
.cb-legal-document h2 {
  font-size: 1.15rem;
  margin-top: 2rem;
}
.cb-legal-document p {
  line-height: 1.7;
}

h1, h2, .h1, .h2,
.cb-display-title {
  font-family: var(--cb-font-display);
  font-weight: 400;
  letter-spacing: -.015em;
}

h3, h4, h5, h6,
.h3, .h4, .h5, .h6 {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--cb-text);
}

body h1, body h2,
body h1[class], body h2[class] { font-weight: 400; }
h1, .h1 { font-size: clamp(2rem, 3vw, 2.75rem); line-height: 1.05; }
h2, .h2 { line-height: 1.12; }
p { text-wrap: pretty; }

.text-muted { color: var(--cb-text-muted) !important; }

/* Uppercase section label (sidebar groups: SEARCH / COMPILE / TRACK) */
.cb-eyebrow {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cb-text-faint);
}

/* ---- 3. Buttons -------------------------------------------------------- */
.btn {
  --bs-btn-border-radius: 8px;
  --bs-btn-font-size: .875rem;
  --bs-btn-font-weight: 600;
  --bs-btn-line-height: 1.25;
  --bs-btn-padding-y: .45rem;
  --bs-btn-padding-x: .875rem;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--cb-transition), background-color var(--cb-transition),
              border-color var(--cb-transition), box-shadow var(--cb-transition),
              transform var(--cb-transition);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { box-shadow: var(--cb-focus-ring); }
.btn-sm {
  --bs-btn-font-size: .8125rem;
  --bs-btn-padding-y: .34rem;
  --bs-btn-padding-x: .7rem;
  min-height: 30px;
}
.btn-lg {
  --bs-btn-font-size: .9375rem;
  --bs-btn-padding-y: .65rem;
  --bs-btn-padding-x: 1.1rem;
  min-height: 44px;
}

/* Primary = espresso brown */
.btn-primary {
  --bs-btn-bg: var(--cb-brown);
  --bs-btn-border-color: var(--cb-brown);
  --bs-btn-hover-bg: var(--cb-brown-700);
  --bs-btn-hover-border-color: var(--cb-brown-700);
  --bs-btn-active-bg: var(--cb-brown-700);
  --bs-btn-active-border-color: var(--cb-brown-700);
  --bs-btn-disabled-bg: var(--cb-brown);
  --bs-btn-disabled-border-color: var(--cb-brown);
  --bs-btn-disabled-opacity: .38;
  --bs-btn-font-weight: 500;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 16px;
  padding-right: 16px;
}

/* Secondary = quiet outline on white */
.btn-outline-secondary,
.btn-light {
  --bs-btn-color: #404040;
  --bs-btn-bg: var(--cb-surface);
  --bs-btn-border-color: var(--cb-border);
  --bs-btn-hover-color: #404040;
  --bs-btn-hover-bg: var(--cb-bg);
  --bs-btn-hover-border-color: #c9c5bd;
  --bs-btn-active-bg: var(--cb-bg);
  --bs-btn-active-border-color: var(--cb-border);
  --bs-btn-font-weight: 500;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.btn-secondary {
  --bs-btn-color: var(--cb-text);
  --bs-btn-bg: var(--cb-sage);
  --bs-btn-border-color: var(--cb-sage);
  --bs-btn-hover-color: var(--cb-text);
  --bs-btn-hover-bg: #c9c493;
  --bs-btn-hover-border-color: #c9c493;
  --bs-btn-active-color: var(--cb-text);
  --bs-btn-active-bg: #beb983;
  --bs-btn-active-border-color: #beb983;
}

.btn-link {
  --bs-btn-color: var(--cb-brown);
  --bs-btn-hover-color: var(--cb-brown-700);
  text-underline-offset: .18em;
}

.btn-danger {
  --bs-btn-bg: #c9343d;
  --bs-btn-border-color: #c9343d;
  --bs-btn-hover-bg: #ac2831;
  --bs-btn-hover-border-color: #ac2831;
  --bs-btn-active-bg: #98232b;
  --bs-btn-active-border-color: #98232b;
}
.btn-outline-danger {
  --bs-btn-color: #b62c35;
  --bs-btn-border-color: #dc9ca1;
  --bs-btn-hover-bg: #c9343d;
  --bs-btn-hover-border-color: #c9343d;
}

.btn-outline-primary {
  --bs-btn-color: var(--cb-brown);
  --bs-btn-border-color: var(--cb-brown);
  --bs-btn-hover-bg: var(--cb-brown);
  --bs-btn-hover-border-color: var(--cb-brown);
  --bs-btn-active-bg: var(--cb-brown-700);
}

/* ---- 4. Forms ---------------------------------------------------------- */
.form-control,
.form-select {
  border-radius: 8px;
  border-color: #d4d4d4;
  min-height: 38px;
  padding: .48rem 20px;
  background-color: #ffffff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .05);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #404040;
}
.form-control::placeholder { color: var(--cb-text-faint); }
.form-control:focus,
.form-select:focus {
  border-color: var(--cb-brown);
  box-shadow: var(--cb-focus-ring);
}
.form-label { font-size: .84rem; font-weight: 500; color: #404040; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--cb-brown); border-color: var(--cb-brown); }
.form-check-input:focus { border-color: var(--cb-brown); box-shadow: var(--cb-focus-ring); }
.cb-required::after {
  content: " *";
  color: var(--cb-tag-red);
  font-weight: 700;
}
.form-control[aria-invalid="true"],
.form-select[aria-invalid="true"] {
  border-color: var(--cb-tag-red);
  box-shadow: 0 0 0 3px rgba(190, 18, 60, .12);
}

/* Password field with inline show/hide toggle */
.cb-password { position: relative; }
.cb-password input { padding-right: 3.5rem; }
.cb-password [data-toggle-password] {
  position: absolute;
  top: 50%;
  right: .6rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--cb-text-muted);
  font-size: 11.8px;
  font-weight: 500;
  padding: .2rem .4rem;
  cursor: pointer;
}
.cb-field-error { color: var(--cb-tag-red); font-size: .82rem; margin-top: .3rem; }
.cb-help { color: var(--cb-text-faint); font-size: .8rem; margin-top: .3rem; }
.cb-google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  width: 440px;
  max-width: 100%;
  height: 40px;
  padding: 0 20px;
  background-color: #ffffff;
  border: 1px solid #d4d4d4;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .05);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #404040;
}
.cb-google-button:hover,
.cb-google-button:focus-visible {
  background-color: #ffffff;
  border-color: #d4d4d4;
  color: #404040;
}
.cb-auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--cb-text-faint);
  font-size: .75rem;
  margin: 1.25rem 0;
}
.cb-auth-divider::before,
.cb-auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--cb-border);
}

.cb-auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cb-auth-body > .cb-auth-shell {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
}
.cb-auth-body > .cb-auth-shell > * { width: 100%; }
.cb-auth-footer { width: 100%; padding: 1.5rem 0; }

.cb-auth-shell h1.h3 { font-size: 31px; }
.cb-auth-aside { font-size: 14px; }
.cb-auth-subheading { font-size: 14px; }
.cb-auth-shell .btn.w-100 {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cb-auth-shell { max-width: 460px; }
.cb-auth-shell-wide { max-width: 540px; }

.cb-auth-shell a,
.cb-auth-footer a {
  text-decoration: none;
}
.cb-auth-shell a:hover:not(.btn),
.cb-auth-footer a:hover:not(.btn) {
  text-decoration: underline;
  color: var(--cb-brown-700);
}

.cb-role-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
}
.cb-role-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}
.cb-role-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.cb-role-option-content {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .45rem .55rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-sm);
  background: var(--cb-surface);
  color: var(--cb-text);
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  transition: border-color var(--cb-transition), background-color var(--cb-transition), box-shadow var(--cb-transition);
}
.cb-role-option-content svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cb-role-option:hover .cb-role-option-content { background: var(--cb-surface-soft); }
.cb-role-option input:checked + .cb-role-option-content {
  border-color: var(--cb-brown);
  background: var(--cb-brown-100);
  box-shadow: inset 0 0 0 1px var(--cb-brown);
}
.cb-role-option input:focus-visible + .cb-role-option-content { box-shadow: var(--cb-focus-ring); }

@media (max-width: 575.98px) {
  .cb-role-options { grid-template-columns: 1fr; }
  .cb-role-option-content { justify-content: flex-start; padding-inline: .8rem; }
}

/* Searchable multi-select with removable pills (task assignees). */
.cb-tag-select.cb-tag-select--enhanced { display: none; }
.cb-tag-picker { position: relative; }
.cb-tag-picker-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  min-height: 48px;
  padding: .45rem .6rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-sm);
  background: var(--cb-surface);
  cursor: text;
}
.cb-tag-picker-control:focus-within {
  border-color: var(--cb-green);
  box-shadow: 0 0 0 3px rgba(52, 67, 59, .12);
}
.cb-tag-picker-pills {
  display: contents;
}
.cb-tag-picker-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  max-width: 100%;
  padding: .3rem .4rem .3rem .7rem;
  border: 1px solid #cddbd3;
  border-radius: 999px;
  background: #edf4f0;
  color: var(--cb-green-700);
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.2;
}
.cb-tag-picker-pill-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cb-tag-picker-remove {
  display: inline-grid;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cb-green-700);
  font-size: 1rem;
  line-height: 1;
}
.cb-tag-picker-remove:hover,
.cb-tag-picker-remove:focus-visible { background: rgba(52, 67, 59, .12); }
.cb-tag-picker-input {
  flex: 1 1 170px;
  min-width: 110px;
  min-height: 30px;
  padding: .2rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--cb-text);
}
.cb-tag-picker-input::placeholder { color: var(--cb-text-faint); }
.cb-tag-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1060;
  max-height: 240px;
  overflow-y: auto;
  padding: .35rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-sm);
  background: var(--cb-surface);
  box-shadow: var(--cb-shadow);
}
.cb-tag-picker-menu[hidden] { display: none; }
.cb-tag-picker-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: .6rem .7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cb-text);
  text-align: left;
}
.cb-tag-picker-option:hover,
.cb-tag-picker-option:focus-visible { background: var(--cb-bg); outline: 0; }
.cb-tag-picker-option[aria-selected="true"] {
  background: #edf4f0;
  color: var(--cb-green-700);
  font-weight: 500;
}
.cb-tag-picker-empty {
  padding: .65rem .7rem;
  color: var(--cb-text-muted);
  font-size: .86rem;
}

/* Searchable single-select used by task matter and assignee filters. */
.cb-search-select.cb-search-select--enhanced { display: none; }
.cb-search-select-picker { position: relative; }
.cb-search-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  width: 100%;
  min-height: 38px;
  padding: .42rem .7rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-sm);
  background: var(--cb-surface);
  color: var(--cb-text);
  text-align: left;
}
.cb-search-select-trigger:hover { border-color: #d4d1c9; }
.cb-search-select-trigger:focus-visible {
  border-color: var(--cb-green);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(52, 67, 59, .12);
}
.cb-search-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cb-search-select-chevron { flex: 0 0 auto; color: var(--cb-text-muted); }
.cb-search-select-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 1060;
  width: 100%;
  min-width: 0;
  padding: .4rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-sm);
  background: var(--cb-surface);
  box-shadow: var(--cb-shadow);
}
.cb-task-filters .row > div { min-width: 0; }
.cb-task-filters .row {
  --bs-gutter-x: .55rem;
  --bs-gutter-y: .45rem;
}
.cb-task-filters .form-label {
  margin-bottom: .2rem !important;
  color: var(--cb-text-muted);
  font-size: .76rem;
  font-weight: 500;
  line-height: 1.15;
}
.cb-task-filters .form-control,
.cb-task-filters .form-select,
.cb-task-filters .btn {
  min-height: 38px;
  padding-top: .3rem;
  padding-bottom: .3rem;
}
.cb-task-filters .cb-tag-picker-control {
  min-height: 38px;
  gap: .3rem;
  padding: .25rem .45rem;
}
.cb-task-filters .cb-tag-picker-input {
  min-height: 26px;
  padding: .1rem;
  font-size: .86rem;
}
.cb-task-filters .cb-tag-picker-pill {
  padding: .2rem .3rem .2rem .55rem;
  font-size: .78rem;
}
.cb-task-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem;
  border-bottom: 1px solid var(--cb-border);
  background: var(--cb-surface);
}
.cb-task-search {
  position: relative;
  width: min(19rem, 100%);
}
.cb-task-search svg {
  position: absolute;
  top: 50%;
  left: .7rem;
  z-index: 1;
  width: 1rem;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--cb-text-muted);
  stroke-width: 1.8;
}
.cb-task-search .form-control { min-height: 38px; padding-left: 2.15rem; }
.cb-filter-menu { position: relative; margin-left: auto; }
.cb-filter-menu > summary { list-style: none; }
.cb-filter-menu > summary::-webkit-details-marker { display: none; }
.cb-filter-trigger { display: inline-flex; align-items: center; gap: .45rem; min-height: 38px; }
.cb-filter-trigger svg { width: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; }
.cb-filter-trigger .cb-filter-chevron {
  width: .8rem;
  height: .8rem;
  margin-left: .05rem;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cb-filter-count {
  display: inline-grid;
  width: 1.15rem;
  height: 1.15rem;
  place-items: center;
  border-radius: 50%;
  background: #111827;
  color: #fff;
  font-size: .65rem;
}
.cb-filter-popover {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  z-index: 1080;
  display: grid;
  grid-template-columns: minmax(12rem, .9fr) minmax(19rem, 1.35fr);
  width: min(46rem, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  background: var(--cb-surface);
  box-shadow: var(--cb-shadow);
}
.cb-filter-nav { padding: .85rem; border-right: 1px solid var(--cb-border); }
.cb-filter-tab {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: .55rem .65rem;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: var(--cb-text);
  text-align: left;
}
.cb-filter-tab:hover, .cb-filter-tab.active { background: var(--cb-bg); }
.cb-filter-content { position: relative; min-height: 22rem; padding: 1rem 1rem 4.25rem; }
.cb-filter-panel { display: none; }
.cb-filter-panel.active { display: block; }
.cb-filter-panel .cb-tag-picker-control { min-height: 42px; }
.cb-filter-actions {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .75rem 1rem;
  border-top: 1px solid var(--cb-border);
  background: var(--cb-surface);
}
.cb-home-summary {
  display: flex;
  min-height: 116px;
  padding: 1rem;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color .15s ease, transform .15s ease;
}
.cb-home-summary:hover { border-color: var(--cb-accent); transform: translateY(-1px); }
.cb-home-summary-count { font-size: 1.8rem; line-height: 1; }
.cb-home-task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem 0;
  border-top: 1px solid var(--cb-border);
}
.cb-home-task-row:first-of-type { border-top: 0; }
.cb-home-task-row strong,
.cb-home-task-row small { display: block; }
.cb-home-section + .cb-home-section {
  padding-top: 1rem;
  border-top: 1px solid var(--cb-border);
}
.cb-repository-stat {
  display: flex;
  min-height: 100px;
  padding: .85rem 1rem;
  flex-direction: column;
  justify-content: space-between;
}
.cb-repository-stat strong { font-size: 1.55rem; line-height: 1; }
a.cb-repository-stat:hover { border-color: var(--cb-accent); }

/* Figma dashboard -------------------------------------------------------- */
.cb-dashboard { width: min(100%, 1280px); margin-inline: auto; }
.cb-dashboard-greeting {
  font-family: var(--cb-font-display);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.05;
  margin-top: 4px;
  margin-bottom: 20px !important;
}
.cb-dashboard-date {
  align-items: center;
  gap: .35rem;
  color: var(--cb-text-muted);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: .8rem;
  font-weight: 500;
}
.cb-dashboard-date svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cb-dashboard-stat {
  position: relative;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.15rem 1.35rem;
  border-radius: var(--cb-radius-lg);
  transition: transform var(--cb-transition), box-shadow var(--cb-transition);
}
.cb-dashboard-stat:hover { transform: translateY(-2px); box-shadow: var(--cb-shadow-sm); }
.cb-dashboard-stat strong {
  display: block;
  margin-bottom: .25rem;
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1;
}
.cb-dashboard-stat span { max-width: calc(100% - 2.5rem); font-size: .82rem; font-weight: 500; }
.cb-dashboard-stat svg {
  position: absolute;
  top: 50%;
  right: 1.35rem;
  width: 26px;
  height: 26px;
  transform: translateY(-50%);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cb-dashboard-stat--overdue { background: #f8ecee; }
.cb-dashboard-stat--overdue svg { color: #b33c4b; }
.cb-dashboard-stat--due { background: #e8f3fc; }
.cb-dashboard-stat--due svg { color: #27769c; }
.cb-dashboard-stat--done { background: #f5f4eb; }
.cb-dashboard-stat--done svg { color: #7d920f; }
.cb-dashboard-panel {
  overflow: hidden;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  background: var(--cb-surface);
}
.cb-dashboard-panel > header {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 6px 1rem;
  border-bottom: 1px solid var(--cb-border-light);
}
.cb-dashboard-panel > header h2 { font-family: var(--cb-font-sans); font-size: 14px; font-weight: 500; }
.cb-dashboard-panel > header .btn { flex-shrink: 0; white-space: nowrap; }
.cb-dashboard-list { padding: .35rem .75rem .55rem; }
.cb-dashboard-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .6rem .35rem;
  border-radius: var(--cb-radius-sm);
  color: var(--cb-text);
  text-decoration: none;
}
.cb-dashboard-row:hover { background: var(--cb-surface-soft); }
.cb-dashboard-row.is-highlighted { background: #f4f4f3; }
.cb-dashboard-row-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--cb-border-light);
  border-radius: 50%;
  background: var(--cb-surface);
}
.cb-dashboard-row-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cb-dashboard-row-icon text {
  fill: currentColor;
  stroke: none;
  font-family: var(--cb-font-sans);
  font-size: 8px;
  font-weight: 700;
}
.cb-dashboard-row-copy { min-width: 0; flex: 1 1 auto; }
.cb-dashboard-row-copy strong,
.cb-dashboard-row-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-dashboard-row-copy strong { font-size: .86rem; font-weight: 600; }
.cb-dashboard-row-copy small { margin-top: .12rem; color: var(--cb-text-muted); font-size: .72rem; }
.cb-dashboard-date-badge {
  flex-shrink: 0;
  padding: .3rem .65rem;
  border-radius: 999px;
  background: #fbf1e6;
  color: #b95a0b;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
}
.cb-dashboard-date-badge.is-today { background: #fdeced; color: #c42d37; }
.cb-dashboard-file-type {
  flex-shrink: 0;
  color: var(--cb-text-faint);
  font-size: .66rem;
  font-weight: 700;
}
.cb-dashboard-empty { padding: 1.5rem .5rem; color: var(--cb-text-muted); font-size: .82rem; }
.cb-month-cal { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .8rem; }
.cb-month-cal th { padding: .45rem 0 .3rem; color: var(--cb-text-muted); font-size: .66rem; font-weight: 600; text-transform: uppercase; text-align: center; }
.cb-month-cal td { height: 46px; padding: .2rem 0; text-align: center; vertical-align: top; border-top: 1px solid var(--cb-border-light); }
.cb-month-cal td.is-outside { color: #c8c6c1; }
.cb-cal-day { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; }
.cb-cal-day.is-today { background: #c42d37; color: #fff; font-weight: 600; }
.cb-cal-dot { display: block; width: 6px; height: 6px; margin: .15rem auto 0; border-radius: 50%; background: #c42d37; }
.cb-quick-reminder { display: grid; gap: .65rem; padding: .75rem 1rem 1rem; }
.cb-quick-reminder .form-label { margin-bottom: .25rem; font-size: .72rem; color: var(--cb-text-muted); }
.cb-quick-reminder-when { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: .5rem; }
.cb-qr-attendees { max-height: 128px; overflow-y: auto; display: grid; gap: .1rem; padding: .4rem .5rem; border: 1px solid var(--cb-border); border-radius: .5rem; }
.cb-qr-attendee { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: .78rem; cursor: pointer; }
.cb-qr-attendee small { color: var(--cb-text-muted); }
.cb-quick-reminder .form-label small { font-weight: 400; color: var(--cb-text-muted); }
.cb-quick-reminder .btn { justify-self: start; }

@media (max-width: 767.98px) {
  .cb-dashboard-greeting { font-size: 2rem; }
  .cb-dashboard-stat { min-height: 96px; }
  .cb-dashboard-panel > header { min-height: 54px; }
}

@media (max-width: 575.98px) {
  .cb-dashboard-panel > header { align-items: flex-start; }
  .cb-dashboard-row { gap: .6rem; }
  .cb-dashboard-row-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .cb-dashboard-date-badge { padding-inline: .5rem; }
}
.cb-notification { transition: background-color .15s ease; }
.cb-notification--unread { background: #fff; }
.cb-notification--read { background: var(--cb-bg); }
.cb-notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cb-brown);
  box-shadow: 0 0 0 3px rgba(61, 34, 8, .08);
}
.cb-search-select-menu[hidden] { display: none; }
.cb-search-select-input {
  width: 100%;
  min-height: 36px;
  margin-bottom: .35rem;
  padding: .4rem .6rem;
  border: 1px solid var(--cb-border);
  border-radius: 6px;
  outline: 0;
}
.cb-search-select-input:focus {
  border-color: var(--cb-green);
  box-shadow: 0 0 0 2px rgba(52, 67, 59, .1);
}
.cb-search-select-options {
  max-height: min(calc(var(--cb-visible-options, 20) * 2.1rem), 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cb-search-select-option {
  display: block;
  width: 100%;
  min-height: 2.1rem;
  padding: .42rem .55rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cb-text);
  font-size: .84rem;
  line-height: 1.3;
  text-align: left;
  overflow-wrap: anywhere;
}
.cb-search-select-option:hover,
.cb-search-select-option:focus-visible { background: var(--cb-bg); outline: 0; }
.cb-search-select-option[aria-selected="true"] {
  background: #edf4f0;
  color: var(--cb-green-700);
  font-weight: 600;
}
.cb-search-select-empty {
  padding: .65rem .55rem;
  color: var(--cb-text-muted);
  font-size: .84rem;
}
.cb-search-select-add {
  color: var(--cb-green-700);
  font-weight: 600;
}
@media (max-width: 575.98px) {
  .cb-search-select-menu { width: 100%; }
}

/* Selectable suggestion chips (e.g. suggested sub-folders) */
.cb-suggest-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--cb-border);
  background: var(--cb-surface);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background .12s, border-color .12s, color .12s;
}
.cb-suggest-chip input { position: absolute; opacity: 0; pointer-events: none; }
.cb-suggest-chip span::before {
  content: "+";
  margin-right: .3rem;
  font-weight: 600;
  color: var(--cb-text-faint);
}
.cb-suggest-chip:hover { border-color: var(--cb-green); }
.cb-suggest-chip:has(input:checked) {
  background: var(--cb-green);
  border-color: var(--cb-green);
  color: #fff;
}
.cb-suggest-chip:has(input:checked) span::before { content: "✓"; color: #fff; }

/* ---- 5. Cards & surfaces ---------------------------------------------- */
.card {
  --bs-card-bg: var(--cb-surface);
  --bs-card-border-color: var(--cb-border);
  --bs-card-border-radius: var(--cb-radius);
  box-shadow: none;
}

.cb-surface {
  background: var(--cb-surface);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
}
.cb-surface > h2.h5 { font-size: 28px; }
.cb-app-main > .cb-surface.text-center { background: none; border: none; }
.cb-empty-illustration { width: 160px; height: auto; margin-bottom: 28px !important; }
.cb-empty-suggestions { margin-top: 40px; }
.cb-empty-state-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 160px);
}

.dropdown-menu {
  --bs-dropdown-border-color: var(--cb-border);
  --bs-dropdown-border-radius: var(--cb-radius);
  --bs-dropdown-link-active-bg: var(--cb-brown);
  --bs-dropdown-link-hover-bg: var(--cb-surface-soft);
  padding: .35rem;
  box-shadow: var(--cb-shadow);
}
.dropdown-item { border-radius: var(--cb-radius-xs); font-size: .875rem; }
.modal-content {
  border-color: var(--cb-border);
  border-radius: var(--cb-radius-lg);
  box-shadow: var(--cb-shadow);
}
.modal-header, .modal-footer { border-color: var(--cb-border-light); }
.table { --bs-table-color: var(--cb-text); --bs-table-border-color: var(--cb-border-light); }
.table > thead { color: var(--cb-text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.list-group { --bs-list-group-border-color: var(--cb-border-light); }

/* ---- 6. Brand mark ----------------------------------------------------- */
.cb-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--cb-font-display);
  font-weight: 400;
  font-size: 1.22rem;
  color: var(--cb-text);
  text-decoration: none;
}
.cb-brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: .12rem;
  line-height: 1;
}
.cb-brand-mark {
  width: 28px;
  height: 28px;
  display: inline-block;
  background: url("../img/logo.81b7df2b810a.svg") center / contain no-repeat;
}
.cb-header-brand { max-width: 12rem; }
.cb-header-workspace-name {
  max-width: 8.75rem;
  color: var(--cb-text-muted);
  font-family: var(--cb-font-sans);
  font-size: .7rem;
  font-weight: 500;
  line-height: 1;
}

/* ---- 7. Compact top navigation ---------------------------------------- */
.cb-app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}
.cb-app-content { min-width: 0; background-color: #fdfdfc; }
.cb-sidebar {
  position: sticky;
  top: 0;
  z-index: 1040;
  display: flex;
  width: 220px;
  height: 100vh;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--cb-border-light);
  background: #fbfbfa;
}
.cb-sidebar-brand {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--cb-border-light);
}
.cb-sidebar-brand .cb-brand { gap: .45rem; font-size: 1.14rem; }
.cb-sidebar-brand .cb-brand-mark { width: 24px; height: 24px; }
.cb-sidebar-close {
  display: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cb-text-muted);
  font-size: 1.5rem;
  line-height: 1;
}
.cb-sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: .75rem .7rem 1rem;
}
.cb-sidebar-section {
  margin: .9rem .45rem .35rem;
  color: var(--cb-text-faint);
  font-family: var(--cb-font-sans);
  font-size: .64rem;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.cb-sidebar-link {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: .65rem;
  padding: .45rem .55rem;
  border: 1px solid transparent;
  border-radius: .6rem;
  color: var(--cb-text);
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
}
/* Subtle "alpha" tag beside an in-progress nav item (e.g. Inbox). */
.cb-alpha-tag {
  margin-left: -.3rem;
  padding: .01rem .32rem;
  border: 1px solid var(--cb-border);
  border-radius: 999px;
  color: var(--cb-text-faint);
  font-size: .55rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  line-height: 1.5;
}
.cb-sidebar-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cb-sidebar-link:hover { background: var(--cb-surface-soft); color: var(--cb-text); }
.cb-sidebar-sublink {
  width: 100%;
  min-height: 32px;
  padding-left: 2.2rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--cb-text-muted);
  font-size: .78rem;
  text-align: left;
}
.cb-sidebar-link.active {
  border-color: var(--cb-border);
  background: var(--cb-surface);
  box-shadow: var(--cb-shadow-sm);
  font-weight: 600;
}
.cb-sidebar-account-wrap {
  flex: 0 0 auto;
  padding: .75rem;
  border-top: 1px solid var(--cb-border-light);
}
.cb-sidebar-account {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: .65rem;
  padding: .25rem;
  border: 0;
  border-radius: .6rem;
  background: transparent;
  color: var(--cb-text);
  text-align: left;
}
.cb-sidebar-account:hover,
.cb-sidebar-account:focus-visible { background: var(--cb-surface-soft); outline: 0; }
.cb-sidebar-account-avatar {
  position: relative;
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #d8ebfb;
  color: #36516a;
  font-size: .72rem;
  font-weight: 600;
}
.cb-sidebar-account-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cb-sidebar-account-copy { display: grid; min-width: 0; line-height: 1.15; }
.cb-sidebar-account-copy strong { font-size: .78rem; font-weight: 500; }
.cb-sidebar-account-copy small { margin-top: .16rem; color: var(--cb-text-muted); font-size: .65rem; }
.cb-sidebar-account-wrap .cb-account-menu { margin-left: .25rem !important; }
.cb-sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--cb-border);
  border-radius: .6rem;
  background: var(--cb-surface);
  color: var(--cb-text);
}
.cb-sidebar-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.cb-sidebar-backdrop { display: none; }

/* ---- Repository Inbox ------------------------------------------------- */
.cb-button-icon {
  width: 1rem;
  height: 1rem;
  margin-right: .25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.15rem;
}
.cb-inbox-intake {
  display: grid;
  grid-template-columns: minmax(18rem, 1.25fr) minmax(15rem, .75fr);
  overflow: hidden;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  background: var(--cb-surface);
}
.cb-inbox-dropzone {
  display: flex;
  min-height: 118px;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  padding: 1rem;
  border-right: 1px dashed var(--cb-border);
  background: var(--cb-surface-soft);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.cb-inbox-dropzone:hover { background: var(--cb-sage-100); border-color: var(--cb-green); }
.cb-inbox-dropzone-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--cb-border);
  border-radius: 50%;
  background: var(--cb-surface);
}
.cb-inbox-dropzone-icon svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cb-inbox-dropzone > span:last-child { display: grid; gap: .2rem; }
.cb-inbox-dropzone small { color: var(--cb-text-muted); }
.cb-inbox-intake-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .35rem;
  padding: 1rem 1.15rem;
  color: var(--cb-text-muted);
  font-size: .82rem;
}
.cb-inbox-intake-copy strong { color: var(--cb-text); font-size: .9rem; }
.cb-inbox-ocr-note { font-size: .72rem; }
.cb-inbox-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.cb-inbox-stats a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: .7rem .85rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-sm);
  background: var(--cb-surface);
  color: var(--cb-text-muted);
  font-size: .8rem;
  text-decoration: none;
}
.cb-inbox-stats strong { color: var(--cb-text); font-size: 1.2rem; }
.cb-inbox-toolbar { display: flex; align-items: center; gap: .5rem; }
.cb-inbox-toolbar .form-select { width: 12rem; min-height: 38px; }
.cb-inbox-list { display: grid; gap: .55rem; }
.cb-inbox-item {
  display: grid;
  grid-template-columns: 54px minmax(12rem, 1fr) minmax(25rem, auto);
  align-items: center;
  gap: .8rem;
  padding: .65rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-sm);
  background: var(--cb-surface);
}
.cb-inbox-preview {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  overflow: hidden;
  border-radius: .5rem;
  background: var(--cb-surface-soft);
  color: var(--cb-text-muted);
  font-size: .66rem;
  font-weight: 700;
  text-decoration: none;
}
.cb-inbox-preview img { width: 100%; height: 100%; object-fit: cover; }
.cb-inbox-file-copy { min-width: 0; }
.cb-inbox-file-copy > a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-inbox-status {
  display: inline-flex;
  margin-top: .35rem;
  padding: .16rem .45rem;
  border-radius: 999px;
  background: var(--cb-blue);
  color: var(--cb-blue-ink);
  font-size: .68rem;
  font-weight: 600;
}
.cb-inbox-status--ready { background: var(--cb-mint); color: var(--cb-mint-ink); }
.cb-inbox-status--needs_attention { background: #fdecec; color: #b4232f; }
.cb-inbox-file-actions { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; }
.cb-inbox-file-actions form { display: flex; align-items: center; gap: .4rem; }
.cb-inbox-file-actions .form-select,
.cb-inbox-file-actions .cb-search-select-picker { width: min(22rem, 28vw); }

@media (max-width: 991.98px) {
  .cb-inbox-item { grid-template-columns: 48px minmax(0, 1fr); }
  .cb-inbox-preview { width: 48px; height: 48px; }
  .cb-inbox-file-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .cb-inbox-file-actions form { flex: 1 1 auto; }
  .cb-inbox-file-actions .form-select,
  .cb-inbox-file-actions .cb-search-select-picker { width: auto; flex: 1 1 auto; }
}
@media (max-width: 767.98px) {
  .cb-inbox-intake { grid-template-columns: 1fr; }
  .cb-inbox-dropzone { border-right: 0; border-bottom: 1px dashed var(--cb-border); }
  .cb-inbox-stats { grid-template-columns: 1fr; }
  .cb-inbox-toolbar { flex-wrap: wrap; }
  .cb-inbox-toolbar .cb-task-search { flex-basis: 100%; }
  .cb-inbox-toolbar .form-select { width: auto; flex: 1 1 10rem; }
  .cb-inbox-file-actions { flex-wrap: wrap; }
  .cb-inbox-file-actions form { flex-basis: 100%; }
}
@media (max-width: 479.98px) {
  .cb-inbox-file-actions form { flex-wrap: wrap; }
  .cb-inbox-file-actions form .form-select,
  .cb-inbox-file-actions form .cb-search-select-picker,
  .cb-inbox-file-actions form .btn { width: 100%; }
}

.cb-app-menu-toggle {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .65rem;
  border: 1px solid var(--cb-border);
  border-radius: .65rem;
  background: var(--cb-surface);
  color: var(--cb-text);
  font-size: .86rem;
  font-weight: 600;
}
.cb-app-menu-toggle:hover,
.cb-app-menu-toggle:focus-visible {
  border-color: var(--cb-brown);
  box-shadow: var(--cb-focus-ring);
  outline: 0;
}
.cb-app-menu-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cb-app-menu-toggle .cb-app-menu-chevron { width: 12px; height: 12px; }
.cb-app-menu-dropdown { min-width: 12rem; }
.cb-app-menu-dropdown .dropdown-item.active {
  background: var(--cb-brown);
  color: #fff;
}
.cb-context-nav {
  min-height: 42px;
  padding: .35rem 1rem;
  border-bottom: 1px solid var(--cb-border);
}
/* Judgment search facets + detail-page cite lists share this row style. */
.cb-facet-row { color: inherit; }
.cb-facet-row:hover { background: rgba(0, 0, 0, .05); }
.cb-facet-row.active { background: rgba(13, 110, 253, .1); color: #0d6efd; font-weight: 600; }
.cb-context-title {
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--cb-text-muted);
  font-size: .84rem;
  font-weight: 500;
  line-height: 1.25;
}
.cb-context-title > a,
.cb-context-title .breadcrumb a { color: var(--cb-text); }
.cb-context-title .breadcrumb {
  flex-wrap: nowrap;
  overflow: hidden;
}
.cb-context-title .breadcrumb-item:not(:last-child) { flex-shrink: 0; }
.cb-context-title .breadcrumb-item:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cb-context-actions:empty { display: none !important; }
.cb-context-actions { gap: 12px; }
.cb-context-actions .btn {
  min-height: 32px;
  padding: .3rem .65rem;
  font-size: .8rem;
}
.cb-context-actions .btn-primary { padding-left: 16px; padding-right: 16px; }
.cb-context-actions .cb-action-menu {
  min-width: 32px;
  min-height: 32px;
  padding: .2rem .45rem;
}
.cb-account-menu-button {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--cb-brown);
  color: #fff;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
}
.cb-header-icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
}
.cb-context-actions .cb-header-icon-button { padding: 0; }
.cb-header-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cb-account-menu-button img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cb-account-menu-fallback {
  display: inline-grid;
  place-items: center;
}
.cb-account-menu-button:hover,
.cb-account-menu-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(70, 38, 8, .14);
  outline: 0;
}
.cb-account-menu {
  width: min(340px, calc(100vw - 1rem));
  overflow: hidden;
  border-color: var(--cb-border);
  border-radius: .9rem;
  box-shadow: var(--cb-shadow);
}
.cb-account-menu-identity { min-width: 0; }
.cb-team-switcher {
  max-height: min(320px, 45vh);
  overflow-y: auto;
}
.cb-team-option {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 42px;
  padding: .4rem .5rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: var(--cb-text);
  text-align: left;
  font-size: .9rem;
}
.cb-team-option:hover { background: var(--cb-bg); }
.cb-team-option.active {
  background: var(--cb-sage-100);
  font-weight: 600;
}
.cb-team-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border-radius: .5rem;
  background: var(--cb-border);
  color: var(--cb-text);
  font-size: .78rem;
  font-weight: 700;
}

/* ---- 8. Tags / chips (Trello-style label with dot) -------------------- */
.cb-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--cb-border);
  background: var(--cb-surface);
  font-size: .8rem;
  font-weight: 500;
  color: var(--cb-text);
  line-height: 1.4;
}
.cb-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cb-tag-color, var(--cb-text-faint));
}
.cb-tag.border-0 { border: 1px dashed var(--cb-border) !important; }
.cb-tag.border-0::before { display: none; }
.cb-tag--orange { --cb-tag-color: var(--cb-tag-orange); color: var(--cb-tag-orange); }
.cb-tag--green  { --cb-tag-color: var(--cb-tag-green);  color: var(--cb-tag-green); }
.cb-tag--blue   { --cb-tag-color: var(--cb-tag-blue);   color: var(--cb-tag-blue); }
.cb-tag--purple { --cb-tag-color: var(--cb-tag-purple); color: var(--cb-tag-purple); }
.cb-tag--red    { --cb-tag-color: var(--cb-tag-red);    color: var(--cb-tag-red); }
.cb-tag--teal   { --cb-tag-color: var(--cb-tag-teal);   color: var(--cb-tag-teal); }

/* Removable filter chip */
.cb-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .5rem .3rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--cb-border);
  background: var(--cb-surface);
  font-size: .82rem;
}
.cb-chip .btn-close { font-size: .55rem; }

/* ---- 9. Folder card ---------------------------------------------------- */
.cb-folder {
  position: relative;
  background: var(--cb-surface);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  padding: .75rem .85rem;
  margin-top: 14px;          /* room for the tab */
  box-shadow: var(--cb-shadow-sm);
  transition: box-shadow .15s ease;
}
.cb-folder::before {         /* folder tab */
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  width: 46%;
  height: 18px;
  background: var(--cb-folder-tab);
  border-radius: var(--cb-radius) var(--cb-radius) 0 0;
}
/* Sub-folder cards get a distinct pastel tab to set them apart from matters. */
.cb-folder--sub::before { background: var(--cb-folder-tab-sub); }
.cb-folder:hover { box-shadow: var(--cb-shadow); }
/* Lift a card above its neighbours while its action menu is open, so the
   dropdown is never painted under the next card. */
.cb-folder:has(.dropdown-menu.show) { z-index: 5; }
/* Long folder names must wrap instead of pushing the card / action menu out. */
.cb-folder .fw-semibold { overflow-wrap: anywhere; word-break: break-word; }
.cb-action-menu {
  min-width: 2rem;
  min-height: 2rem;
  padding: .25rem .55rem;
  border: 1px solid var(--cb-border);
  color: var(--cb-text);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}
.cb-action-menu:hover,
.cb-action-menu:focus {
  border-color: var(--cb-brown);
  box-shadow: var(--cb-focus-ring);
}

/* ---- Long-name safety nets ------------------------------------------------
   Flex children need min-width:0 before text-truncate can ellipsize them, and
   long titles in breadcrumbs must wrap rather than overflow the header. */
.min-w-0 { min-width: 0; }

/* Kebab (⋮) action menus were too faint to notice (BugList #22): make the dots
   bold and dark so the action affordance is obvious. */
button[aria-label$="actions"] {
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--cb-text);
}
/* Breadcrumb items are flex children; they need min-width:0 to shrink below
   their content width so the long active crumb can wrap instead of forcing the
   header (and whole page) wider. */
.breadcrumb { flex-wrap: wrap; min-width: 0; }
.breadcrumb-item { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }

/* ---- 10. Stat cards (dashboard) --------------------------------------- */
.cb-stat {
  border-radius: var(--cb-radius);
  padding: .9rem 1rem;
  border: 1px solid transparent;
}
.cb-stat .cb-stat-num { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.cb-stat .cb-stat-label { color: var(--cb-text-muted); margin-top: .35rem; }
.cb-stat--pink { background: var(--cb-pink); }
.cb-stat--blue { background: var(--cb-blue); }
.cb-stat--mint { background: var(--cb-mint); }

/* ---- 11. Badges -------------------------------------------------------- */
.cb-badge-today {
  background: var(--cb-pink);
  color: var(--cb-pink-ink);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: .25rem .6rem;
  border-radius: 999px;
}

/* ---- 12. Alerts (flash messages) -------------------------------------- */
.alert { border-radius: var(--cb-radius); border: 1px solid var(--cb-border); }
.alert-success { --bs-alert-color: #285c38; --bs-alert-bg: var(--cb-mint); --bs-alert-border-color: #c4dec9; }
.alert-danger { --bs-alert-color: #8f222a; --bs-alert-bg: var(--cb-pink); --bs-alert-border-color: #edc5c8; }
.alert-warning { --bs-alert-color: #6b4a12; --bs-alert-bg: #faf0d8; --bs-alert-border-color: #ead6a7; }
.alert-info { --bs-alert-color: #275b89; --bs-alert-bg: var(--cb-sky-100); --bs-alert-border-color: #c9dcec; }
.text-bg-danger { background-color: #c9343d !important; }
.text-bg-secondary { background-color: #77716a !important; }
.cb-header-actions .btn { white-space: nowrap; }

/* ---- 12b. Universal search -------------------------------------------- */
#universal-search { position: relative; min-width: 420px; }
#universal-search input { width: 100%; }
.cb-search-controls { display: flex; align-items: center; }
.cb-search-input-shell {
  padding: 3px;
  border: 1px solid #e5e8f2;
  border-radius: 999px;
  background: #f4f6fc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}
.cb-search-mode {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}
.cb-search-mode button {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 30px;
  padding: 0 .65rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #14204e;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.cb-search-mode button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.cb-search-sparkle { color: #c42d86; font-size: 1rem; line-height: 1; }
.cb-search-mode button.active {
  background: var(--cb-surface);
  color: #14204e;
  box-shadow: 0 3px 10px rgba(35, 49, 104, .14), 0 0 0 1px #dce1ef;
}
.cb-search-input-wrap { position: relative; min-width: 0; flex: 1 1 auto; }
.cb-search-input-shell .form-control {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.cb-search-widget.ai-mode .form-control { padding-right: 3.25rem; }
.cb-ask-ai-submit {
  position: absolute;
  top: 3px;
  right: 3px;
  min-height: 26px;
  padding: 0 .55rem;
  border: 0;
  border-radius: 7px;
  background: var(--cb-brown);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
}
.cb-ask-ai-answer { padding: .85rem .9rem; }
.cb-ask-ai-scope { margin-bottom: .45rem; color: var(--cb-text-faint); font-size: .72rem; }
.cb-ask-ai-text { margin: 0; white-space: pre-wrap; font-size: .88rem; line-height: 1.5; }
.cb-ask-ai-sources { margin-top: .75rem; padding-top: .65rem; border-top: 1px solid var(--cb-border-light); }
.cb-ask-ai-sources-title { margin-bottom: .35rem; font-size: .72rem; font-weight: 700; color: var(--cb-text-muted); text-transform: uppercase; letter-spacing: .04em; }
.cb-ask-ai-source { display: block; padding: .35rem 0; color: var(--cb-text); text-decoration: none; font-size: .8rem; }
.cb-ask-ai-source:hover .cb-ask-ai-source-title { text-decoration: underline; }
.cb-ask-ai-source-title { font-weight: 600; }
.cb-ask-ai-source-excerpt { margin-top: .12rem; color: var(--cb-text-muted); line-height: 1.35; }
.cb-search-history-heading {
  padding: .55rem .75rem .3rem;
  color: var(--cb-text-faint);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.cb-search-history-item { border-top: 0; background: transparent; cursor: pointer; }
.cb-search-history-query { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-search-history-scope { color: var(--cb-text-faint); font-size: .72rem; }
.cb-search-creator { display: flex; align-items: center; gap: .4rem; font-size: .78rem; }
/* Search results page (/search/) */
.cb-search-page { max-width: 1080px; margin: 0 auto; }
.cb-search-page-mode { margin-bottom: .8rem; padding: 3px; border: 1px solid #e5e8f2; background: #f4f6fc; }
.cb-search-page-input { margin-bottom: .75rem; }
.cb-search-page-input .form-control {
  min-height: 46px;
  padding-left: 2.5rem;
  border: 1px solid var(--cb-border);
  border-radius: 12px;
  background: var(--cb-surface);
  font-size: .95rem;
}
.cb-search-page-input .cb-ask-ai-submit { top: 8px; right: 8px; min-height: 30px; }
.cb-search-page-input-icon {
  position: absolute;
  top: 50%;
  left: .9rem;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--cb-text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.cb-search-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.cb-search-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 32px;
  padding: 0 .8rem;
  border: 1px solid var(--cb-border);
  border-radius: 999px;
  background: var(--cb-surface);
  color: var(--cb-text);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.cb-search-chips .cb-search-select-trigger {
  width: auto;
  min-height: 32px;
  max-width: 220px;
  padding: 0 .8rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
}
.cb-search-chips .cb-search-select-menu { width: max-content; min-width: 200px; }
.cb-search-chip.selected { border-color: var(--cb-brown); box-shadow: 0 0 0 1px var(--cb-brown); }
.cb-search-chip-check input { margin: 0; }
.cb-search-chip-apply { background: var(--cb-brown); border-color: var(--cb-brown); color: #fff; }
.cb-search-chip-menu { position: relative; }
.cb-search-chip-menu summary::-webkit-details-marker { display: none; }
.cb-search-chip-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1050;
  min-width: 200px;
  padding: .7rem .8rem;
  display: grid;
  gap: .4rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  background: var(--cb-surface);
  box-shadow: var(--cb-shadow);
}
.cb-search-custom-dates { display: inline-flex; gap: .35rem; margin: 0; }
.cb-search-page-body { margin-top: 1.1rem; }
.cb-search-result-count { margin: 0 0 .7rem; color: var(--cb-text-muted); font-size: .8rem; }
.cb-search-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .9rem;
}
.cb-search-card {
  display: block;
  padding: .95rem 1rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  background: var(--cb-surface);
  color: var(--cb-text);
  text-decoration: none;
}
.cb-search-card:hover { border-color: #d4d1c9; box-shadow: var(--cb-shadow); }
.cb-search-card-title { margin: .5rem 0 .3rem; font-weight: 600; font-size: .92rem; }
.cb-search-card-excerpt {
  color: var(--cb-text-muted);
  font-size: .8rem;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}
.cb-search-card-excerpt mark { background: #ffec9e; padding: 0 1px; border-radius: 2px; }
.cb-search-answer-card {
  max-width: 760px;
  background: var(--cb-surface);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-lg);
  overflow: hidden;
}
.cb-search-answer-card .cb-search-item { padding: .8rem .95rem; }
.cb-search-empty-text { color: var(--cb-text-muted); }
.cb-search-item {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  padding: .6rem .75rem;
  text-decoration: none;
  color: var(--cb-text);
  border-bottom: 1px solid var(--cb-border-light);
}
.cb-search-item:last-child { border-bottom: 0; }
.cb-search-item:hover { background: var(--cb-bg); }
.cb-search-type { flex-shrink: 0; font-size: .7rem; }
.cb-search-body { min-width: 0; }
.cb-search-title { font-weight: 500; font-size: .9rem; }
.cb-search-excerpt {
  font-size: .8rem;
  color: var(--cb-text-muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cb-search-excerpt mark { background: #ffec9e; padding: 0 1px; border-radius: 2px; }

/* ---- ChamberFlow ------------------------------------------------------- */
.cb-kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: .75rem;
  overflow-x: auto;
  padding-bottom: .75rem;
}
.cb-kanban-column {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  padding: .75rem;
  border-radius: var(--cb-radius);
  background: #faf6ed;
  border: 1px solid var(--cb-border);
}
.cb-kanban-column--in_progress { background: #eef6fd; }
.cb-kanban-column--under_review { background: #f6f1fb; }
.cb-kanban-column--done { background: #f1f8ee; }
.cb-status-key {
  display: inline-block;
  width: .8rem;
  height: .8rem;
  margin-right: .55rem;
  border-radius: .25rem;
  background: #f4c56d;
  vertical-align: -.05rem;
}
.cb-kanban-column--in_progress .cb-status-key { background: #8ec5f4; }
.cb-kanban-column--under_review .cb-status-key { background: #c8a6e8; }
.cb-kanban-column--done .cb-status-key { background: #a9d29b; }
.cb-column-add {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: .25rem .55rem;
  font-size: .72rem;
  line-height: 1;
  white-space: nowrap;
}
.cb-kanban-column > .cb-kanban-dropzone {
  flex: 1 1 auto;
  align-content: start;
}
.cb-task-card {
  position: relative;
  display: block;
  padding: .75rem;
  border-radius: var(--cb-radius-sm);
  border: 1px dashed #c8c6bf;
  background: var(--cb-surface);
  box-shadow: var(--cb-shadow-sm);
}
.cb-task-card[draggable="true"] > a:first-of-type { padding-right: 1.5rem; }
.cb-task-drag-handle {
  position: absolute;
  top: .55rem;
  right: .55rem;
  z-index: 1;
  width: 24px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: .35rem;
  color: var(--cb-text-faint);
  cursor: grab;
  touch-action: none;
}
.cb-task-drag-handle:hover { background: var(--cb-bg); color: var(--cb-text-muted); }
.cb-task-drag-handle svg { width: 14px; height: 16px; fill: currentColor; }
.cb-task-status-select {
  width: auto;
  min-width: 8.5rem;
  max-width: 100%;
  padding-top: .25rem;
  padding-bottom: .25rem;
  font-size: .78rem;
}
/* Compact status control on task cards: a pill-shaped chip that hugs its label
   with the chevron right beside it (no wide box / far-right chevron gap). */
[data-status-form] { width: fit-content; max-width: 100%; }
[data-status-form] .cb-search-select-picker {
  width: fit-content;
  max-width: 100%;
  font-size: .74rem;
}
[data-status-form] .cb-search-select-trigger {
  justify-content: flex-start;
  gap: .25rem;
  width: auto;
  min-height: 24px;
  padding: .1rem .3rem .1rem .5rem;
  border-radius: 999px;
  border-color: transparent;
  background: var(--cb-bg);
}
[data-status-form] .cb-search-select-trigger:hover {
  border-color: var(--cb-border);
  background: var(--cb-surface);
}
[data-status-form] .cb-search-select-value { flex: 0 1 auto; }
[data-status-form] .cb-search-select-chevron svg { width: 12px; height: 12px; }
[data-status-form] .cb-search-select-menu { min-width: 9rem; }
[data-status-form] .cb-search-select-option {
  min-height: 1.75rem;
  padding: .25rem .4rem;
  font-size: .72rem;
}
.cb-search-select-menu--compact { padding: .3rem; }
.cb-task-dragging { opacity: .35; }
.cb-task-drag-ghost {
  position: fixed;
  z-index: 1100;
  margin: 0;
  pointer-events: none;
  opacity: .92;
  transform: rotate(1deg);
  box-shadow: var(--cb-shadow);
}
.cb-task-card:hover { box-shadow: var(--cb-shadow); }
.cb-task-card[draggable="true"] { cursor: grab; }
.cb-task-card[draggable="true"]:active { cursor: grabbing; }
.cb-task-overdue {
  border-color: #fecaca;
  background: var(--cb-surface);
}
/* Overdue rows in the task list: a faint tint, not a shout — the red date carries the signal. */
.table-danger {
  --bs-table-bg: #fbf2f3;
  --bs-table-striped-bg: #fbf2f3;
  --bs-table-hover-bg: #f6e7e9;
  --bs-table-border-color: #f0dfe1;
}
.cb-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  min-height: 1.05rem;
  max-width: 100%;
  padding: .04rem .32rem;
  border: 0;
  border-radius: 999px;
  color: var(--cb-text-muted);
  background: var(--cb-bg);
  font-size: .6rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-priority-dot { width: .4rem; height: .4rem; border-radius: 50%; background: #d49b00; }
.cb-priority-dot--low { background: #7fa66b; }
.cb-priority-dot--high { background: #dc3545; }
.cb-task-reference-row {
  display: flex;
  align-items: center;
  gap: .2rem;
  min-width: 0;
  margin-bottom: .45rem;
  padding-right: 1.2rem;
}
.cb-task-reference {
  display: flex;
  gap: .12rem;
  min-width: 0;
  color: var(--cb-text-muted);
  font-size: .66rem;
  line-height: 1.2;
  text-decoration: none;
}
.cb-task-reference:hover { color: var(--cb-text); }
.cb-task-copy-link {
  display: inline-grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--cb-text-faint);
}
.cb-task-copy-link:hover,
.cb-task-copy-link:focus-visible { background: var(--cb-bg); color: var(--cb-text); outline: 0; }
.cb-task-copy-link svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cb-task-meta { gap: .3rem; margin-top: .7rem; }
.cb-task-status-form { margin-top: .4rem; }
@media (max-width: 767.98px) {
  .cb-task-toolbar { flex-wrap: wrap; }
  .cb-task-search { flex: 1 1 15rem; width: auto; }
  .cb-filter-popover { grid-template-columns: 1fr; width: min(28rem, calc(100vw - 1.5rem)); }
  .cb-filter-nav { border-right: 0; border-bottom: 1px solid var(--cb-border); }
  .cb-filter-content { min-height: 16rem; }
}
.cb-quick-subtask {
  padding: .65rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-sm);
  background: var(--cb-bg);
}
.cb-quick-subtask[hidden] { display: none; }
.cb-quick-subtask .form-control {
  flex: 1 1 16rem;
  width: auto;
  min-width: 0;
  background: var(--cb-surface);
}
@media (max-width: 575.98px) {
  .cb-quick-subtask .form-control { flex-basis: 100%; }
}
.cb-document-meta { line-height: 1.35; }
.cb-document-sidebar .cb-tag {
  padding: .15rem .48rem;
  font-size: .74rem;
}
.cb-document-sidebar dt { font-size: .82rem; }
.cb-document-sidebar dd { margin-bottom: .75rem; }
.cb-activity-feed { margin-bottom: .25rem; }
.cb-activity-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding-bottom: 1rem;
}
.cb-activity-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 2rem;
  bottom: 0;
  left: .95rem;
  width: 1px;
  background: var(--cb-border);
}
.cb-activity-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex: 0 0 1.9rem;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--cb-parchment);
  color: var(--cb-text-muted);
}
.cb-activity-icon svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cb-activity-icon--created { background: var(--cb-mint); color: var(--cb-mint-ink); }
.cb-activity-icon--file { background: var(--cb-blue); color: var(--cb-blue-ink); }
.cb-activity-icon--person { background: #f3e8ff; color: var(--cb-tag-purple); }
.cb-activity-icon--subtask { background: #e6fffb; color: var(--cb-tag-teal); }
.cb-activity-icon--changed { background: #fff7e6; color: var(--cb-tag-orange); }
.cb-activity-content { min-width: 0; padding-top: .05rem; }
.cb-activity-description { font-size: .88rem; line-height: 1.4; overflow-wrap: anywhere; }
.cb-activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-top: .15rem;
  color: var(--cb-text-muted);
  font-size: .76rem;
}
.cb-kanban-dropzone {
  min-height: 7rem;
  max-height: 68vh;
  overflow-y: auto;
  border-radius: .75rem;
  transition: background-color .15s ease;
}
.cb-drop-active { background: #eef2ff; }
.cb-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  margin-right: -.25rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  font-size: .7rem;
  font-weight: 700;
}
.cb-profile-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 1.25rem;
  font-weight: 700;
}
.cb-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cb-header-search {
  position: relative;
  width: 100%;
  max-width: 620px;
  min-width: 0;
  justify-self: center;
}

.cb-header-search .form-control {
  height: 32px;
  min-height: 32px;
  padding-block: 0;
  border-radius: 10px;
  padding-inline: .8rem;
}

@media (max-width: 991.98px) {
  .cb-header-search {
    order: 3;
    max-width: none;
    justify-self: stretch;
  }
  #universal-search { min-width: 0; }
}

@media (max-width: 575.98px) {
  .cb-search-mode button { padding-inline: .5rem; }
}

@media (max-width: 991.98px) {
  .cb-app-shell { display: block; }
  .cb-sidebar {
    position: fixed;
    left: 0;
    width: min(240px, calc(100vw - 3rem));
    transform: translateX(-105%);
    box-shadow: var(--cb-shadow);
    transition: transform .2s ease;
  }
  .cb-sidebar-close { display: inline-grid; place-items: center; }
  .cb-sidebar-toggle { display: inline-grid; }
  .cb-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1030;
    display: block;
    visibility: hidden;
    padding: 0;
    border: 0;
    background: rgba(20, 18, 15, .36);
    opacity: 0;
    transition: opacity .2s ease, visibility .2s ease;
  }
  .cb-app-shell.sidebar-open .cb-sidebar { transform: translateX(0); }
  .cb-app-shell.sidebar-open .cb-sidebar-backdrop { visibility: visible; opacity: 1; }
  body.cb-sidebar-lock { overflow: hidden; }
}
.cb-search-empty { padding: .75rem; color: var(--cb-text-faint); font-size: .85rem; }

/* ---- 13. Misc utilities ----------------------------------------------- */
.cb-bg     { background: var(--cb-bg); }
.cb-divider { border-bottom: 1px solid var(--cb-border); }
.rounded-cb { border-radius: var(--cb-radius) !important; }

/* Workspace settings shell: compact product tabs, not Bootstrap's blue pills. */
.cb-settings-tabs {
  display: flex;
  gap: 1.25rem;
  margin: -.25rem 0 1rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--cb-border);
  scrollbar-width: none;
}
.cb-settings-tabs::-webkit-scrollbar { display: none; }
.cb-settings-tab {
  flex: 0 0 auto;
  padding: .55rem .1rem .5rem;
  border-bottom: 2px solid transparent;
  color: var(--cb-text-muted);
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--cb-transition), border-color var(--cb-transition);
}
.cb-settings-tab:hover { color: var(--cb-text); }
.cb-settings-tab.active {
  border-bottom-color: var(--cb-brown);
  color: var(--cb-brown);
  font-weight: 600;
}
.cb-settings-panel {
  width: min(100%, 680px);
  padding: 1rem;
}
.cb-settings-panel-header {
  margin: -1rem -1rem 1rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--cb-border-light);
}
.cb-settings-readonly {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem .75rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-sm);
  background: var(--cb-surface-soft);
}
.cb-settings-readonly code {
  flex: 0 0 auto;
  padding: .3rem .5rem;
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius-xs);
  background: var(--cb-surface);
  color: var(--cb-brown);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
}
@media (max-width: 575.98px) {
  .cb-settings-tabs { gap: 1rem; }
  .cb-settings-readonly { align-items: flex-start; }
}

/* ---- 14. Authenticated app density ------------------------------------
   Keep the product compact without shrinking interactive controls below a
   comfortable mouse/tablet target. These rules intentionally live under the
   app shell so public, legal, and authentication pages retain their spacing. */
.cb-app-topbar {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(120px, 1fr) minmax(0, auto);
  align-items: center;
  min-height: 56px;
  padding: .45rem 24px !important;
  gap: .75rem !important;
  border-bottom-color: var(--cb-border-light);
}
.cb-topbar-left {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}
.cb-context-actions { justify-self: end; }

@media (max-width: 991.98px) {
  .cb-app-topbar { display: flex; flex-wrap: wrap; }
  .cb-context-actions { justify-self: unset; }
}

.cb-app-main { padding: 1rem 24px !important; }

.cb-app-main .cb-surface.p-4,
.cb-app-main .card-body { padding: 1rem !important; }

.cb-app-main .cb-surface.p-5 { padding: 1.5rem !important; }

.cb-app-main .row.g-4 {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}

.cb-app-main .g-3 {
  --bs-gutter-x: .75rem;
  --bs-gutter-y: .75rem;
}

.cb-app-main .cb-surface.mt-4 { margin-top: 1rem !important; }
.cb-app-main .mb-4 { margin-bottom: 1rem !important; }
.cb-app-main .mt-4 { margin-top: 1rem !important; }
.cb-app-main .py-3 { padding-top: .65rem !important; padding-bottom: .65rem !important; }

.cb-app-main .table > :not(caption) > * > * {
  padding: .55rem .65rem;
  vertical-align: middle;
}

.cb-app-main .list-group-item.py-3 {
  padding-top: .65rem !important;
  padding-bottom: .65rem !important;
}

@media (max-width: 991.98px) {
  .cb-app-topbar { padding: .45rem .75rem !important; }
  .cb-context-nav { padding-inline: .75rem; }
  .cb-app-main { padding: .75rem !important; }
  .cb-app-main .cb-surface.p-4,
  .cb-app-main .card-body { padding: .85rem !important; }
}

@media (max-width: 575.98px) {
  .cb-header-brand { max-width: 9rem; }
  .cb-header-workspace-name { max-width: 6.25rem; }
  .cb-context-actions { width: 100%; }
}
