/*
 * quotable.css — App-specific components for Quotable
 * Extends biz-catalyst-core.css with qu- prefixed classes.
 * All colours use bc- design tokens; the only raw colour literal is #fff
 * (white text on brand / coloured backgrounds — a design constant), plus one
 * rgba() white for the header tagline. Box-shadows use the --bc-shadow* scale.
 * Some spacing/size values remain literal rem.
 */

/* =====================================================================
   DASHBOARD
   ===================================================================== */

.qu-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--bc-space-3, 0.75rem);
  margin-top: var(--bc-space-4, 1rem);
}

.qu-stat-card {
  background: var(--bc-surface-raised);
  border-radius: var(--bc-radius, 0.5rem);
  padding: var(--bc-space-4, 1rem);
}

.qu-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--bc-brand-primary);
  line-height: 1;
}

.qu-view-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bc-brand-primary);
}

/* =====================================================================
   PROPOSAL FORM — LINE ITEMS & TOTALS
   ===================================================================== */

.qu-line-items {
  overflow-x: auto;
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius, 0.5rem);
  margin-bottom: var(--bc-space-5, 1.25rem);
}

.qu-totals {
  background: var(--bc-surface-raised);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius, 0.5rem);
  padding: var(--bc-space-4, 1rem) var(--bc-space-5, 1.25rem);
  margin-bottom: var(--bc-space-5, 1.25rem);
}

.qu-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--bc-space-2, 0.5rem) 0;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--bc-border);
}

.qu-total-row:last-child {
  border-bottom: none;
}

.qu-total-row--grand {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--bc-primary);
  border-top: 2px solid var(--bc-border);
  padding-top: var(--bc-space-3, 0.75rem);
  margin-top: var(--bc-space-2, 0.5rem);
}

/* Questions section */
.qu-questions-section {
  margin: var(--bc-space-8, 2rem) 0;
  padding: var(--bc-space-6, 1.5rem);
  background: var(--bc-warning-tint);
  border: 2px solid var(--bc-warning);
  border-radius: var(--bc-radius-lg, 0.75rem);
}

.qu-questions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--bc-space-4, 1rem);
}

.qu-questions-header h3 {
  color: var(--bc-warning);
  margin: 0;
  font-size: 1.125rem;
}

/* =====================================================================
   REFERENCE FIELD PICKER
   ===================================================================== */

.qu-ref-picker {
  position: relative;
}

.qu-ref-selected {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.qu-ref-selected-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bc-surface-raised);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius-full);
  padding: 0.125rem 0.5rem 0.125rem 0.75rem;
  font-size: 0.85rem;
  color: var(--bc-primary);
}

.qu-ref-selected-item__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--bc-danger);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
}

.qu-ref-selected-item__remove:hover {
  color: var(--bc-danger-hover, var(--bc-danger));
}

.qu-ref-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bc-surface);
  border: 1px solid var(--bc-border);
  border-top: none;
  border-radius: 0 0 var(--bc-radius, 0.5rem) var(--bc-radius, 0.5rem);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--bc-shadow-md);
}

.qu-ref-result {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--bc-border);
  font-size: 0.9rem;
}

.qu-ref-result:last-child {
  border-bottom: none;
}

.qu-ref-result:hover {
  background: var(--bc-surface-raised);
}

.qu-ref-result__title {
  font-weight: 500;
  color: var(--bc-primary);
}

.qu-ref-result__subtitle {
  font-size: 0.8125rem;
  color: var(--bc-text-muted);
}

/* =====================================================================
   SETTINGS — BRANDING PREVIEW
   ===================================================================== */

.qu-preview-proposal {
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius, 0.5rem);
  overflow: hidden;
  box-shadow: var(--bc-shadow-md);
}

.qu-preview-header {
  padding: 2.5rem 1.875rem;
  color: #fff; /* white text on brand */
  text-align: center;
  transition: background 0.3s ease;
  background: var(--bc-primary);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.qu-preview-header h1 {
  color: #fff; /* white text on brand */
  font-size: 1.5rem;
  margin: 0 0 0.625rem 0;
}

.qu-preview-header p {
  font-size: 0.875rem;
  opacity: 0.9;
  margin: 0;
}

.qu-preview-footer {
  background: var(--bc-surface-raised);
  padding: 1.25rem 1.875rem;
  text-align: center;
}

.qu-preview-footer p {
  color: var(--bc-text-muted);
  font-size: 0.8125rem;
  margin: 0;
}

/* Logo upload / preview drop area (settings) */
.qu-logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 6rem;
  padding: var(--bc-space-4);
  border: 1px dashed var(--bc-border);
  border-radius: var(--bc-radius);
  background: var(--bc-surface-raised);
  color: var(--bc-text-muted);
}

.qu-logo-preview img {
  max-height: 5rem;
  max-width: 100%;
  object-fit: contain;
}

/* Custom field rows in settings */
.qu-drag-handle {
  color: var(--bc-text-muted);
  user-select: none;
  cursor: move;
  font-weight: bold;
}

.qu-custom-field-row td {
  vertical-align: middle;
}

/* =====================================================================
   VIEWER
   ===================================================================== */

/* Outer wrapper */
.qu-viewer {
  max-width: 56.25rem;
  margin: 2.5rem auto;
  background: var(--bc-surface);
  box-shadow: var(--bc-shadow-lg);
  border-radius: 0.5rem;
  overflow: hidden;
}

/* ── 1. Brand header ──────────────────────────────────────────────── */

.qu-proposal-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bc-brand-primary, var(--bc-primary));
  padding: 1.75rem 2.5rem;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.qu-proposal-header__logo {
  max-height: 60px;
  max-width: 120px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}

.qu-proposal-header__copy {
  flex: 1;
}

.qu-proposal-header__company {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff; /* white text on brand */
  line-height: 1.2;
}

.qu-proposal-header__tagline {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 0.25rem;
}

/* ── 2. Meta band ─────────────────────────────────────────────────── */

.qu-proposal-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bc-surface-raised);
  border-bottom: 1px solid var(--bc-border);
  padding: 1.375rem 2.5rem;
  gap: 2rem;
}

@media (max-width: 640px) {
  .qu-proposal-meta {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.25rem 1.25rem;
  }
}

.qu-proposal-meta__heading {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bc-text-muted);
  margin-bottom: 0.625rem;
}

.qu-proposal-meta__row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3125rem;
}

.qu-proposal-meta__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bc-text-muted);
  white-space: nowrap;
  min-width: 4rem;
  flex-shrink: 0;
}

.qu-proposal-meta__value {
  font-size: 0.9375rem;
  color: var(--bc-text);
}

.qu-proposal-meta__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bc-text);
  margin-bottom: 0.1875rem;
}

.qu-proposal-meta__company {
  font-size: 0.9375rem;
  color: var(--bc-text);
  margin-bottom: 0.1875rem;
}

.qu-proposal-meta__email {
  font-size: 0.875rem;
  color: var(--bc-text-muted);
}

/* ── 3. Body ──────────────────────────────────────────────────────── */

.qu-proposal-body {
  padding: 2rem 2.5rem 2.5rem;
}

@media (max-width: 640px) {
  .qu-proposal-body {
    padding: 1.5rem 1.25rem 2rem;
  }
}

/* Status banners */
.qu-status-banner {
  padding: 0.875rem 1.25rem;
  border-radius: var(--bc-radius, 0.5rem);
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.9375rem;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.qu-status-banner--accepted {
  background: var(--bc-success-tint);
  color: var(--bc-success);
  border: 1px solid var(--bc-success-border);
}

.qu-status-banner--declined {
  background: var(--bc-danger-tint);
  color: var(--bc-danger);
  border: 1px solid var(--bc-danger-border);
}

/* Proposal title — dark, never brand colour */
.qu-proposal-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--bc-text);
  margin: 0 0 1.75rem;
  line-height: 1.3;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bc-border);
}

/* Custom fields strip */
.qu-proposal-custom-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-bottom: 1.75rem;
}

.qu-proposal-custom-fields .bc-form-group {
  margin: 0;
}

/* ── 4. Line items ────────────────────────────────────────────────── */

.qu-viewer-line-items {
  overflow-x: auto;
  margin-bottom: 0;
}

.qu-viewer-line-items .bc-table {
  width: 100%;
  margin-bottom: 0;
}

.qu-viewer-line-items .bc-table thead th {
  background: var(--bc-surface-raised);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bc-text-muted);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--bc-border);
}

.qu-viewer-line-items .bc-table td {
  padding: 0.875rem 1rem;
  color: var(--bc-text);
  vertical-align: top;
}

.qu-line-item__description {
  font-weight: 500;
  color: var(--bc-text);
  line-height: 1.5;
}

.qu-line-item__notes {
  font-size: 0.8125rem;
  color: var(--bc-text-muted);
  margin-top: 0.25rem;
  font-style: italic;
}

/* ── 5. Totals block ──────────────────────────────────────────────── */

.qu-totals-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 1.25rem 1rem 0.25rem;
  margin-bottom: 2rem;
  border-top: 1px solid var(--bc-border);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.qu-totals-row {
  display: flex;
  gap: 2rem;
  padding: 0.3125rem 0;
  width: 100%;
  max-width: 22rem;
  justify-content: space-between;
}

.qu-totals-label {
  font-size: 0.9375rem;
  color: var(--bc-text-muted);
}

.qu-totals-value {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--bc-text);
  text-align: right;
  min-width: 5.5rem;
}

.qu-totals-row--grand {
  border-top: 2px solid var(--bc-border);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}

.qu-totals-row--grand .qu-totals-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bc-brand-primary, var(--bc-primary));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qu-totals-row--grand .qu-totals-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bc-brand-primary, var(--bc-primary));
}

/* ── 6. Action buttons ────────────────────────────────────────────── */

.qu-proposal-actions {
  display: flex;
  gap: 0.875rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.qu-proposal-actions .bc-btn {
  min-width: 10rem;
  padding: 0.75rem 1.5rem;
}

@media (max-width: 640px) {
  .qu-proposal-actions {
    flex-direction: column;
  }

  .qu-proposal-actions .bc-btn {
    width: 100%;
    min-width: auto;
  }
}

/* ── 7. Footer ────────────────────────────────────────────────────── */

.qu-proposal-footer {
  background: var(--bc-surface-raised);
  border-top: 1px solid var(--bc-border);
  padding: 1.5rem 2.5rem;
  color: var(--bc-text-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.qu-proposal-footer p {
  margin: 0;
}

.qu-proposal-footer__contact {
  margin-top: 0.75rem;
  color: var(--bc-text);
  font-weight: 500;
}

/* ── 8. Internal preview banner ───────────────────────────────────── */

.qu-internal-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bc-surface-raised);
  border-bottom: 2px solid var(--bc-brand-primary, var(--bc-primary));
  padding: 0.625rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bc-text);
  z-index: 9999;
  box-shadow: var(--bc-shadow-md);
}

/* =====================================================================
   ADMIN
   ===================================================================== */

.qu-admin-stat-value--active {
  color: var(--bc-success);
}

.qu-admin-stat-value--frozen {
  color: var(--bc-warning);
}

.qu-admin-stat-value--deleted {
  color: var(--bc-danger);
}

.qu-password-display {
  background: var(--bc-warning-tint);
  border: 2px solid var(--bc-warning);
  padding: 0.9375rem;
  border-radius: var(--bc-radius, 0.5rem);
  margin-top: 0.625rem;
}

.qu-password-display code {
  font-size: 1rem;
  font-weight: bold;
  background: var(--bc-warning-tint);
  padding: 0.3125rem 0.625rem;
  border-radius: 0.25rem;
}

/* =====================================================================
   REGISTRATION
   ===================================================================== */

.qu-subdomain-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.qu-subdomain-input {
  flex: 1;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.qu-subdomain-suffix {
  background: var(--bc-surface-raised);
  border: 2px solid var(--bc-border);
  border-left: none;
  border-top-right-radius: var(--bc-radius, 0.5rem);
  border-bottom-right-radius: var(--bc-radius, 0.5rem);
  padding: 0.75rem 1rem;
  color: var(--bc-text-muted);
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.qu-availability-check {
  min-height: 1.25rem;
  margin-top: 0.3125rem;
  font-size: 0.8125rem;
}

.qu-availability-check--available {
  color: var(--bc-success);
}

.qu-availability-check--unavailable {
  color: var(--bc-danger);
}

.qu-availability-check--checking {
  color: var(--bc-text-muted);
}

.qu-suggestion-chips {
  margin-top: 0.625rem;
}

.qu-suggestion-chip {
  display: inline-block;
  background: var(--bc-surface-raised);
  color: var(--bc-brand-primary, var(--bc-primary));
  padding: 0.3125rem 0.75rem;
  border-radius: var(--bc-radius-full);
  font-size: 0.8125rem;
  margin: 0.1875rem;
  cursor: pointer;
  border: 1px solid var(--bc-border);
  transition: background 0.15s, color 0.15s;
}

.qu-suggestion-chip:hover {
  background: var(--bc-brand-primary, var(--bc-primary));
  color: #fff; /* white text on brand */
}

/* =====================================================================
   HORIZONTAL FORM LAYOUT (qu-form-horizontal)
   Labels sit to the left of their input rather than above.
   Apply to a bc-card or any container that wraps bc-form-group elements.
   ===================================================================== */

.qu-form-horizontal .bc-form-group {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.25rem 0.75rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.qu-form-horizontal .bc-label {
  text-align: right;
  margin-bottom: 0;
  font-size: 0.8125rem;
  color: var(--bc-text-muted);
  white-space: normal; /* wrap long labels in the fixed column rather than clip */
  align-self: center;
}

/* Textarea labels align to top */
.qu-form-horizontal .bc-form-group:has(textarea) .bc-label {
  align-self: start;
  padding-top: 0.5rem;
}

/* Form hints push to second column */
.qu-form-horizontal .bc-form-hint {
  grid-column: 2;
  font-size: 0.75rem;
  margin-top: 0.125rem;
}

/* bc-form-row: two side-by-side groups, each with their own label */
.qu-form-horizontal .bc-form-row {
  display: flex;
  gap: 1.5rem;
}

/* =====================================================================
   A3a — OWNER SURFACES (Detail page, form grid, Markdown editor, picker)
   ===================================================================== */

/* Responsive form grid (translated from Scribe's Quick Merge). Short fields pair
   up; long fields span the row via __full. Reflows to one column on mobile. */
.qu-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--bc-space-4);
}
.qu-form-grid > .bc-form-group { margin-bottom: 0; }
.qu-form-grid__full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .qu-form-grid { grid-template-columns: 1fr; }
}

/* Read-only value (Detail custom fields + client block) */
.qu-read-value {
  font-size: var(--bc-font-size-sm);
  color: var(--bc-text);
  white-space: pre-wrap;
  word-break: break-word;
}
.qu-read-value:empty::before { content: '—'; color: var(--bc-text-muted); }

/* Markdown introduction editor (dependency-free: textarea + toolbar + live preview) */
.qu-md__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bc-space-1);
  margin-bottom: var(--bc-space-2);
}
.qu-md__btn {
  padding: var(--bc-space-1) var(--bc-space-2);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius-sm);
  background: var(--bc-surface);
  color: var(--bc-text);
  font-size: var(--bc-font-size-sm);
  cursor: pointer;
}
.qu-md__btn:hover { background: var(--bc-surface-raised); }
.qu-md__area {
  width: 100%;
  min-height: 8rem;
  font-family: var(--bc-font-mono, monospace);
  font-size: var(--bc-font-size-sm);
  resize: vertical;
}
.qu-md__preview-label {
  margin: var(--bc-space-3) 0 var(--bc-space-1);
  font-size: var(--bc-font-size-xs);
  color: var(--bc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.qu-md__preview {
  padding: var(--bc-space-3);
  border: 1px dashed var(--bc-border);
  border-radius: var(--bc-radius-sm);
  background: var(--bc-surface-raised);
  min-height: 3rem;
}

/* Rendered Markdown (Detail introduction + preview). A3b shares this type scale. */
.qu-richtext { color: var(--bc-text); line-height: 1.6; }
.qu-richtext > :first-child { margin-top: 0; }
.qu-richtext > :last-child { margin-bottom: 0; }
.qu-richtext p { margin: 0 0 var(--bc-space-3); }
.qu-richtext h1, .qu-richtext h2, .qu-richtext h3 {
  margin: var(--bc-space-4) 0 var(--bc-space-2);
  line-height: 1.25;
}
.qu-richtext ul, .qu-richtext ol { margin: 0 0 var(--bc-space-3); padding-left: 1.5rem; }
.qu-richtext li { margin-bottom: var(--bc-space-1); }
.qu-richtext a { color: var(--bc-primary); text-decoration: underline; }
.qu-richtext code {
  font-family: var(--bc-font-mono, monospace);
  font-size: 0.9em;
  background: var(--bc-surface-raised);
  padding: 0.1em 0.3em;
  border-radius: var(--bc-radius-sm);
}
.qu-richtext blockquote {
  margin: 0 0 var(--bc-space-3);
  padding-left: var(--bc-space-3);
  border-left: 3px solid var(--bc-border);
  color: var(--bc-text-muted);
}

/* Contact picker (reuses qu-ref-* dropdown/chip styles) */
.qu-contact-picker { position: relative; }
.qu-contact-picker__manual-toggle {
  display: inline-block;
  margin-top: var(--bc-space-2);
  font-size: var(--bc-font-size-sm);
  color: var(--bc-primary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.qu-contact-picker__manual-toggle:hover { text-decoration: underline; }

/* Detail page action bar — primary / secondary / danger grouping */
.qu-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--bc-space-2);
  margin-top: var(--bc-space-3);
}
.qu-detail-actions__spacer { flex: 1 1 auto; }
.qu-detail-actions__group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bc-space-2);
}

/* Dashboard rows open the Detail page */
.qu-row-link { cursor: pointer; }
.qu-row-link:hover { background: var(--bc-surface-raised); }
.qu-row-link:focus-visible { outline: 2px solid var(--bc-primary); outline-offset: -2px; }
.qu-row-link__anchor { color: var(--bc-primary); font-weight: var(--bc-font-weight-medium); text-decoration: none; }
.qu-row-link__anchor:hover { text-decoration: underline; }

.qu-form-horizontal .bc-form-row .bc-form-group {
  flex: 1;
  min-width: 0;
}

/* =====================================================================
   BUTTON GROUP (table action rows)
   ===================================================================== */

.qu-btn-group {
  display: flex;
  gap: 0.375rem;
  flex-wrap: nowrap;
  align-items: center;
}

/* Right-align action buttons when inside a table action cell */
td.bc-table-actions {
  white-space: nowrap;
}

td.bc-table-actions .qu-btn-group {
  justify-content: flex-end;
}

/* Compact height for buttons inside a btn-group (~30% shorter) */
.qu-btn-group .bc-btn--sm {
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
  line-height: 1.2;
}

/* Neutral action button — replaces primary/secondary/success in table rows */
.qu-btn-action {
  background: var(--bc-surface-raised);
  color: var(--bc-primary);
  border: 1px solid var(--bc-border);
}

.qu-btn-action:hover {
  background: var(--bc-border);
  color: var(--bc-primary);
  border-color: var(--bc-border);
}

/* =====================================================================
   FALLBACK TOAST OVERLAY
   Used by showAlert() when BizNotifications CDN is unavailable.
   ===================================================================== */

.qu-toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  width: 320px;
}

.qu-toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--bc-radius);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  pointer-events: auto;
  box-shadow: var(--bc-shadow-lg);
  animation: qu-toast-in 0.2s ease;
}

.qu-toast--success { background: var(--bc-success); color: #fff; }
.qu-toast--error   { background: var(--bc-danger); color: #fff; }
.qu-toast--info    { background: var(--bc-info); color: #fff; }
.qu-toast--warning { background: var(--bc-warning); color: #fff; }

@keyframes qu-toast-in {
  from { opacity: 0; transform: translateY(-0.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =====================================================================
   STATUS PATH (qu-path) — Salesforce-Path-style lifecycle chevrons.
   Happy path: Draft -> Sent -> Viewed -> Accepted. Terminal off-path states
   (declined/expired) replace the final chevron. Open-question is a badge,
   never a path stage. qu- prefixed, Quotable-local (no bc-path until a 2nd app).
   ===================================================================== */

.qu-path {
  display: flex;
  list-style: none;
  margin: 0 0 var(--bc-space-5);
  padding: 0;
}

.qu-path__step {
  flex: 1;
  padding: var(--bc-space-2) var(--bc-space-3);
  background: var(--bc-surface-raised);
  color: var(--bc-text-muted);
  font-size: var(--bc-font-size-sm);
  font-weight: var(--bc-font-weight-medium);
  text-align: center;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 0.75rem) 0, 100% 50%, calc(100% - 0.75rem) 100%, 0 100%, 0.75rem 50%);
  margin-right: 2px;
}

.qu-path__step:first-child {
  clip-path: polygon(0 0, calc(100% - 0.75rem) 0, 100% 50%, calc(100% - 0.75rem) 100%, 0 100%);
}
.qu-path__step:last-child { margin-right: 0; }

.qu-path__step--done      { background: var(--bc-success-tint); color: var(--bc-success); }
.qu-path__step--current   { background: var(--bc-brand-primary, var(--bc-primary)); color: #fff; }
.qu-path__step--declined  { background: var(--bc-danger-tint);  color: var(--bc-danger); }
.qu-path__step--expired   { background: var(--bc-warning-tint); color: var(--bc-warning); }

.qu-path-flag {
  display: inline-flex;
  align-items: center;
  gap: var(--bc-space-1);
  margin-left: var(--bc-space-3);
  padding: var(--bc-space-1) var(--bc-space-2);
  border-radius: var(--bc-radius-full);
  background: var(--bc-warning-tint);
  color: var(--bc-warning);
  font-size: var(--bc-font-size-xs);
  font-weight: var(--bc-font-weight-medium);
}

/* =====================================================================
   TIMELINE (qu-timeline) — basic lifecycle event list (A3 prettifies).
   ===================================================================== */

.qu-timeline {
  list-style: none;
  margin: var(--bc-space-4) 0 0;
  padding: 0 0 0 var(--bc-space-4);
  border-left: 2px solid var(--bc-border);
}

.qu-timeline__item {
  position: relative;
  padding: 0 0 var(--bc-space-4) var(--bc-space-4);
}

.qu-timeline__item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--bc-space-4) - 5px);
  top: 0.35rem;
  width: 9px;
  height: 9px;
  border-radius: var(--bc-radius-full);
  background: var(--bc-brand-primary, var(--bc-primary));
}

.qu-timeline__type {
  font-weight: var(--bc-font-weight-semibold);
  color: var(--bc-text);
  text-transform: capitalize;
}

.qu-timeline__meta {
  font-size: var(--bc-font-size-xs);
  color: var(--bc-text-muted);
}

.qu-timeline__approx { font-style: italic; }

/* =====================================================================
   MODAL BRIDGES
   Core provides the .bc-modal overlay + .bc-modal__panel, but has no
   backdrop element and scopes --wide as `.bc-modal--wide .bc-modal__panel`.
   Quotable's markup uses a separate backdrop div and puts --wide on the
   panel, so these two rules keep that markup working against core.
   ===================================================================== */

.bc-modal__backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* The backdrop is a positioned full-viewport cover; without this the (statically
   positioned) panel paints BEHIND it, so the backdrop swallows every click in the
   modal — Copy buttons, inputs, etc. all just close it. Lift the panel above the
   backdrop: panel clicks hit the panel, only the surrounding backdrop closes. */
.bc-modal__panel {
  position: relative;
  z-index: 1;
}

.bc-modal__panel.bc-modal--wide {
  max-width: 46rem;
}

/* =====================================================================
   PRINT
   ===================================================================== */

@media print {
  @page { size: A4; margin: 0; }

  body {
    background: white;
    margin: 0;
    padding: 0;
  }

  .bc-nav,
  .qu-proposal-actions,
  .qu-internal-banner,
  .bc-modal {
    display: none !important;
  }

  .qu-viewer {
    max-width: none;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .qu-proposal-header {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .qu-status-banner,
  .qu-totals-block {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .qu-viewer-line-items tr {
    page-break-inside: avoid;
  }

  .qu-totals-block {
    page-break-inside: avoid;
  }
}
