:root {
  --bg: #e8e4da;
  --panel: #ebe6dc;
  --ink: #1a1f1a;
  --muted: #6a736a;
  --line: #d0c8b4;
  --accent: #1b6b4a;
  --mine: #d4edd9;
  --theirs: #fff;
  --quote: #e8eef6;
  --font: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}
.app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f3efe6;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.icon-btn.active {
  background: #fff;
  border-color: var(--line);
  color: var(--accent);
}
.nav-btn {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background: #fff;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  color: var(--ink);
}

.nav-btn.active {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.nav-label {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}
.offers-panel {
  position: absolute;
  inset: 41px 0 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: #f4f1ea;
  border-top: 1px solid var(--line);
}
.offers-panel.hidden {
  display: none !important;
}
.app {
  position: relative;
}
.offers-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #faf7f1 0%, #f3efe6 100%);
}
.offers-head-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.offers-panel-head strong {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.offers-panel-head .muted {
  font-size: 0.8rem;
  color: var(--muted);
}
.offers-subtitle {
  max-width: 560px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}
.offers-clear-filters {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #59655d;
  font: inherit;
  font-size: 0.73rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.offers-clear-filters:hover {
  color: var(--accent);
}
.offers-meta-row {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
}
.offers-meta-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.7rem;
}
.offers-meta-dates {
  font-size: 0.7rem;
  font-weight: 400;
}
.offers-meta-dates:not(:empty)::before {
  content: "·";
  margin-right: 8px;
  color: var(--muted);
  font-weight: 400;
}
.offers-stat-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--ink);
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
}
.offers-stat-pill:hover {
  border-color: #b7dfc6;
  background: #f8fcf9;
}
.offers-stat-pill.active {
  border-color: #b7dfc6;
  background: #f3fbf6;
  color: #146043;
}
.offers-panel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.offers-panel-actions input[type="search"] {
  width: 200px;
  height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
}
.offers-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.offers-check:has(input:checked) {
  background: #e6f5ec;
  border-color: #b7dfc6;
  color: #146043;
}
.offers-check input {
  accent-color: var(--accent);
}
.offers-active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: #efe9dc;
}
.offers-active-filters.hidden {
  display: none !important;
}
.offers-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(480px, 100%);
  min-height: 28px;
  padding: 0 4px 0 10px;
  border-radius: 999px;
  border: 1px solid #c8e2d2;
  background: #e6f5ec;
  color: #146043;
  font-size: 0.75rem;
}
.offers-filter-chip-meta {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  margin-right: 2px;
  border-radius: 999px;
  background: rgba(20, 96, 67, 0.12);
  color: #146043;
  white-space: nowrap;
}
.offers-filter-chip-label {
  font-weight: 650;
  color: #3d6b54;
  opacity: 0.85;
}
.offers-filter-chip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.offers-filter-chip-clear {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #146043;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.offers-filter-chip-clear:hover {
  background: rgba(20, 96, 67, 0.12);
}
.status-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 0;
  font-family: inherit;
  line-height: inherit;
}
.status-pill.new {
  background: #e6f5ec;
  color: #146043;
}
.status-pill.old {
  background: #eee9df;
  color: #6a736a;
}
button.status-pill-link {
  cursor: pointer;
  text-decoration: none;
}
button.status-pill-link:hover {
  filter: brightness(0.97);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.source-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 6px;
  background: #efe9dc;
  color: #4a524a;
  white-space: nowrap;
}
.source-pill.source-chat {
  background: #e8f0ea;
  color: #146043;
}
.source-pill.source-google-sheet {
  background: #e6f4ea;
  color: #137333;
}
.source-pill.source-google-drive {
  background: #e8f0fe;
  color: #1967d2;
}
.source-pill.source-excel {
  background: #e6f4ea;
  color: #0d652d;
}
.source-pill.source-csv {
  background: #e6f4ea;
  color: #0d652d;
}
.source-pill.source-pdf {
  background: #fce8e6;
  color: #c5221f;
}
.source-pill.source-image {
  background: #fef7e0;
  color: #8a5a00;
}
.source-pill.source-word {
  background: #e8f0fe;
  color: #185abc;
}
.source-pill.source-file {
  background: #eee9df;
  color: #5f6368;
}
a.source-pill.source-link {
  text-decoration: none;
  cursor: pointer;
}
a.source-pill.source-link:hover {
  filter: brightness(0.96);
  outline: 1px solid rgba(0, 0, 0, 0.12);
}
.offers-table th.col-date,
.offers-table td.col-date {
  font-variant-numeric: tabular-nums;
  max-width: 100px;
}
.offers-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background:
    radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.035) 1px, transparent 0)
      0 0 / 18px 18px,
    #f7f4ee;
}
.offers-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
  background: transparent;
}
.offers-table th,
.offers-table td {
  border-bottom: 1px solid rgba(208, 200, 180, 0.7);
  padding: 9px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(255, 255, 255, 0.92);
}
.offers-table th.col-num,
.offers-table td.col-num {
  width: 36px;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.offers-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3efe6;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
}
.offers-table th.sortable {
  cursor: pointer;
  user-select: none;
  padding-right: 18px;
}
.offers-table th.sortable::after {
  content: "↕";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.62rem;
  opacity: 0.35;
}
.offers-table th.sortable {
  position: sticky;
}
.offers-table th.sortable.sorted {
  color: var(--accent);
}
.offers-table th.sortable.sorted-asc::after {
  content: "↑";
  opacity: 0.9;
}
.offers-table th.sortable.sorted-desc::after {
  content: "↓";
  opacity: 0.9;
}
.offers-table th.sortable:hover {
  color: var(--ink);
  background: #efe9dc;
}
.offers-table tr.clickable {
  cursor: pointer;
}
.offers-table tr:hover td {
  background: #f7fbf8;
}
.offers-table td.wrap {
  white-space: normal;
  max-width: 280px;
}
.offers-table .app-cell {
  font-weight: 650;
  color: var(--accent);
  cursor: pointer;
}
.offers-table:not(.unique-view) .col-shares {
  display: none;
}
.offers-table th.col-shares,
.offers-table td.col-shares {
  text-align: center;
  width: 4.5rem;
  white-space: nowrap;
}
.offers-table td.col-shares {
  font-weight: 650;
  color: #3d6b54;
}
.shares-filter-btn {
  color: #3d6b54;
  text-align: center;
  width: 100%;
}
.offers-filter-chip.hidden {
  display: none !important;
}
.pkg-filter-btn {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
}
.pkg-filter-btn:hover {
  text-decoration-color: currentColor;
}
.offers-table .src-sheet {
  color: #8a5a00;
  font-size: 0.68rem;
  margin-left: 4px;
}
.adv-filter-btn {
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
}
.adv-filter-btn:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}
.adv-filter-btn.active {
  color: var(--accent);
  text-decoration-color: currentColor;
}
.followup-am-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #f3efe6;
}
.followup-am-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  cursor: pointer;
}
.followup-am-chip:hover,
.followup-am-chip.active {
  border-color: var(--accent);
  background: #e6f5ec;
}
.followup-am-chip .fu-need {
  color: #a33;
  font-weight: 700;
}
.followup-am-chip .fu-chased {
  color: #8a5a00;
  font-weight: 650;
}
.followup-am-chip .fu-ok {
  color: var(--accent);
  font-weight: 650;
}
.followup-am-chip .fu-focus-metric {
  background: #fff;
  border: 0.5px solid currentColor;
  border-radius: 6px;
  padding: 1px 5px;
}
.followup-am-chip .fu-chip-sub {
  font-size: 0.65rem;
  opacity: 0.85;
}
.followup-am-chip [data-status] {
  cursor: pointer;
}

.fu-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 999px;
}
.fu-pill.needs_followup {
  background: #fde8e8;
  color: #a12626;
}
.fu-pill.chased {
  background: #f8efd8;
  color: #8a5a00;
}
.fu-pill.confirmed {
  background: #e6f5ec;
  color: #146043;
}
.followup-table td.snip {
  white-space: normal;
  max-width: 220px;
  font-size: 0.72rem;
  color: var(--muted);
}
.followup-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.followup-table th.sortable:hover {
  color: var(--accent);
}
.followup-table td.fu-miss {
  color: #a12626;
  font-weight: 650;
}
.followup-table td.fu-silent {
  color: #8a5a00;
  font-style: italic;
}
.followup-table th.col-pkgs,
.followup-table td.col-pkgs {
  min-width: 180px;
  max-width: 380px;
}
.fu-pkg-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.35;
}
.fu-pkg-row,
.fu-pkg-rest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}
.fu-pkg-rest.hidden {
  display: none;
}
.fu-pkg-count {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.8rem;
}
.fu-pkg-chip {
  display: inline-block;
  margin: 0;
  padding: 1px 6px;
  border: 1px solid #c5ddd0;
  border-radius: 4px;
  background: #f3faf6;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  font-weight: 650;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fu-pkg-chip:hover {
  border-color: var(--accent);
  background: #e6f5ec;
}
.fu-pkg-chip.fu-pkg-focus {
  outline: 2px solid #e89b2d;
  outline-offset: 1px;
  background: #fff4d6;
}
.fu-pkg-more {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: underline;
  padding: 0 2px;
}
.fu-pkg-more:hover {
  color: var(--ink);
}
.brand-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.9rem;
}
.brand-name {
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1;
  white-space: nowrap;
}

.brand-name::first-letter {
  color: var(--accent);
}

.company-picker {
  position: relative;
  margin-left: 4px;
}
.company-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.company-picker-btn:hover {
  border-color: #c8e2d2;
  background: #f8fcf9;
}
.company-picker-logo {
  display: block;
  height: 20px;
  width: auto;
  max-width: 108px;
  object-fit: contain;
  object-position: left center;
}
.company-picker-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
}
.company-picker-caret {
  flex: 0 0 auto;
  opacity: 0.55;
}
.company-picker-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 220;
  min-width: 196px;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.company-picker-menu.hidden {
  display: none !important;
}
.company-picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 650;
}
.company-picker-option:hover {
  background: #f5f0e8;
}
.company-picker-option.selected {
  background: #e6f5ec;
  color: #146043;
}
.company-picker-option-logo {
  display: block;
  height: 22px;
  width: auto;
  max-width: 120px;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: left center;
}
.company-picker-option-fallback {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eee9df;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ink);
}
.company-picker-option {
  position: relative;
  padding-right: 10px;
}
.company-picker-upload {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.company-picker-upload:hover:not(:disabled) {
  background: #e6f5ec;
  color: #146043;
}
.company-picker-upload:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.company-picker-note {
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--muted);
}
.company-picker-empty {
  padding: 8px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  max-width: 260px;
  white-space: normal;
  cursor: default;
}
.source-toggle {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 2px;
  margin-left: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.source-toggle-btn {
  border: 0;
  background: transparent;
  border-radius: 999px;
  height: 22px;
  padding: 0 11px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.source-toggle-btn:hover {
  color: var(--ink);
}
.source-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}
/* Live = connector health LED (green ok / red fault). Works even when Old is selected. */
.source-toggle-btn#sourceLiveBtn.live-ok {
  color: #0d5c3d;
  box-shadow: 0 0 0 0 rgba(27, 107, 74, 0.35);
  animation: live-ok-pulse 2.4s ease-out infinite;
}
.source-toggle-btn#sourceLiveBtn.live-ok.active {
  background: #1b6b4a;
  color: #fff;
  box-shadow: 0 0 0 0 rgba(27, 107, 74, 0.5);
  animation: live-ok-pulse 2s ease-out infinite;
}
.source-toggle-btn#sourceLiveBtn.live-bad {
  color: #9b1c1c;
  box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.35);
  animation: live-bad-pulse 1.6s ease-out infinite;
}
.source-toggle-btn#sourceLiveBtn.live-bad.active {
  background: #b42318;
  color: #fff;
  box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.5);
  animation: live-bad-pulse 1.4s ease-out infinite;
}
@keyframes live-ok-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(27, 107, 74, 0.45),
      0 0 10px rgba(27, 107, 74, 0.35);
  }
  70% {
    box-shadow:
      0 0 0 7px rgba(27, 107, 74, 0),
      0 0 0 rgba(27, 107, 74, 0);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(27, 107, 74, 0),
      0 0 0 rgba(27, 107, 74, 0);
  }
}
@keyframes live-bad-pulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(180, 35, 24, 0.5),
      0 0 10px rgba(180, 35, 24, 0.4);
  }
  70% {
    box-shadow:
      0 0 0 7px rgba(180, 35, 24, 0),
      0 0 0 rgba(180, 35, 24, 0);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(180, 35, 24, 0),
      0 0 0 rgba(180, 35, 24, 0);
  }
}
.filters {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: end;
  flex-wrap: wrap;
}
.filters select {
  min-width: 118px;
  cursor: pointer;
  color: var(--ink);
}
.filters select:disabled {
  opacity: 1;
  color: var(--ink);
  cursor: pointer;
  pointer-events: auto;
}
.search-with-hint {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-with-hint input[type="search"] {
  padding-right: 40px;
  min-width: 250px;
}
.search-with-hint.has-text .search-hint {
  opacity: 0;
}
.search-hint {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--muted);
  background: #f3efe6;
  border-radius: 5px;
  padding: 1px 5px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0.85;
}
.topbar {
  flex-wrap: wrap;
}
.active-filter-bar {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin: 2px 0 0;
  border-radius: 7px;
  background: rgba(27, 107, 74, 0.09);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 650;
}
.active-filter-icon {
  font-size: 0.7rem;
}
.active-filter-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-filter-clear {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  border-radius: 4px;
}
.active-filter-clear:hover {
  background: rgba(27, 107, 74, 0.15);
}
.date-picker {
  position: relative;
}
.date-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 10px 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  max-width: 260px;
}
.date-picker-btn svg {
  flex-shrink: 0;
  color: var(--muted);
}
.date-picker-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.date-picker-btn:hover {
  border-color: #c2bba8;
}
.date-picker-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 107, 74, 0.12);
}
.date-picker-btn.active svg {
  color: var(--accent);
}
.date-picker-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 292px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(40, 36, 24, 0.16);
}
.date-picker-pop.hidden {
  display: none;
}
.dp-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.dp-chip {
  border: 1px solid var(--line);
  background: #f7f4ee;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--ink);
  cursor: pointer;
}
.dp-chip:hover {
  background: #efe9dc;
}
.dp-chip.active {
  background: #e6f5ec;
  border-color: var(--accent);
  color: #146043;
}
.dp-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 8px;
}
.dp-cal-title {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
  justify-content: center;
}
.dp-cal-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 650;
  padding: 3px 6px;
  cursor: pointer;
  max-width: 100%;
}
.dp-month-select {
  flex: 1 1 auto;
  min-width: 0;
}
.dp-year-select {
  flex: 0 0 4.6rem;
}
.dp-cal-select:hover {
  border-color: #c2bba8;
}
.dp-cal-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(27, 107, 74, 0.12);
}
.dp-weekdays,
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.dp-weekdays span {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  padding: 2px 0 4px;
}
.dp-day {
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.dp-day:hover {
  background: #efe9dc;
}
.dp-day.outside {
  color: #b3aa98;
  font-weight: 500;
}
.dp-day.today {
  box-shadow: inset 0 0 0 1px var(--accent);
}
.dp-day.disabled,
.dp-day:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.dp-day.in-range {
  background: #e6f5ec;
  border-radius: 0;
}
.dp-day.start,
.dp-day.end {
  background: var(--accent);
  color: #fff;
}
.dp-day.start {
  border-radius: 8px 0 0 8px;
}
.dp-day.end {
  border-radius: 0 8px 8px 0;
}
.dp-day.start.end,
.dp-day.single {
  border-radius: 8px;
}
.dp-day.start:hover,
.dp-day.end:hover {
  background: #165c40;
  color: #fff;
}
.dp-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.dp-hint {
  flex: 1;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 650;
}
.dp-foot .btn {
  padding: 4px 10px;
  font-size: 0.75rem;
}
input,
select,
button {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  background: #fff;
  font-size: 0.82rem;
}
input[type="search"] {
  width: 170px;
}
.offers-filter-label {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}
.btn {
  cursor: pointer;
  background: #fff;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 650;
}
.btn-primary:hover {
  filter: brightness(1.05);
}
.btn-toggle.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.hidden {
  display: none !important;
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #f0ebe1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 1rem;
  font-weight: 650;
  color: var(--muted);
}
.sidebar-tabs {
  display: flex;
  gap: 2px;
}
.side-tab {
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--muted);
}
.side-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.sheet-detail {
  overflow: auto;
  padding: 12px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.sheet-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.sheet-card h3 {
  margin: 0 0 6px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 650;
}
.sheet-link {
  word-break: break-all;
  font-size: 0.82rem;
  color: #1a5fb4;
}
.sheet-msg {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.86rem;
  line-height: 1.35;
  margin: 0;
}
.pkg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pkg-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  font-size: 0.8rem;
  padding: 5px 8px;
  border-radius: 6px;
  background: #f7f4ee;
}
.pkg-list li.new {
  background: #e6f5ec;
  outline: 1px solid #b7dfc6;
}
.pkg-list .tag {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  color: #146043;
  text-transform: uppercase;
}
.pkg-list .old {
  color: var(--muted);
  font-size: 0.65rem;
}
.sidebar-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 8px 8px;
}
.sidebar-tools input[type="search"],
.sidebar-tools select {
  width: 100%;
  font-size: 0.75rem;
  padding: 5px 7px;
  background: #fff;
}
.pill {
  background: #d6ebe0;
  color: var(--accent);
  border-radius: 999px;
  padding: 0 6px;
  font-size: 0.72rem;
}
.conv-list {
  overflow: auto;
  padding: 2px 6px 10px;
  flex: 1;
  min-height: 0;
}
.conv-item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.conv-item:hover {
  background: rgba(255, 255, 255, 0.65);
}
.conv-item.active {
  background: #fff;
  box-shadow: inset 2px 0 0 var(--accent);
}
.conv-item.am-item .conv-title {
  font-weight: 650;
}
.conv-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.conv-row .conv-item {
  flex: 1;
  min-width: 0;
}
.conv-item.live-gone,
.conv-item.live-gone:hover,
.conv-item.live-gone.active {
  background: transparent;
  box-shadow: none;
}
.conv-item.live-gone.active {
  box-shadow: inset 2px 0 0 var(--accent);
  background: #fff;
}
.conv-item.live-gone .conv-title {
  color: inherit;
}
.conv-dot-out {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #c45046;
}
.conv-del {
  flex-shrink: 0;
  align-self: center;
  border: 1px solid var(--line);
  background: #fff;
  color: #8f2f28;
  font-size: 0.68rem;
  font-weight: 650;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.conv-del:hover {
  background: #f6ddd9;
  border-color: #e8c0ba;
}
.live-delete-btn {
  font-size: 0.72rem !important;
  padding: 4px 10px !important;
  white-space: nowrap;
  background: #fff;
  border: 1px solid #c45046;
  color: #8f2f28;
  font-weight: 650;
}
.live-delete-btn:hover {
  background: #f6ddd9;
}
.live-delete-btn.hidden {
  display: none !important;
}
.am-roster-summary {
  margin: 2px 4px 8px;
  padding: 7px 9px;
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.am-roster-summary strong {
  color: var(--accent);
  font-weight: 700;
}
.am-back {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 6px 10px 8px;
  margin-bottom: 2px;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--accent);
  cursor: pointer;
  border-radius: 6px;
}
.am-back:hover {
  background: rgba(255, 255, 255, 0.65);
}
.conv-top,
.conv-sub {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.conv-title {
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}
.conv-time {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.68rem;
  padding-top: 2px;
}
.conv-sub-text {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}
.conv-count {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}
.exchange {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
  padding: 1px 6px;
  letter-spacing: 0.02em;
}
.exchange .ex-us {
  color: var(--accent);
}
.exchange .ex-sep {
  color: var(--muted);
  margin: 0 1px;
}
.exchange .ex-them {
  color: #8a4b12;
}
.exchange.heavy {
  background: #fde8d8;
  outline: 1px solid #e8b48a;
}
.exchange.heavy .ex-them {
  color: #a03a00;
}
.exchange.scoped {
  background: #e8f0fa;
  outline: 1px solid #b7c9e0;
}
.conv-stats {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.export-confidence {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  padding: 0 5px;
  line-height: 1.45;
  letter-spacing: 0.01em;
}
.export-confidence.compact {
  background: transparent;
  outline: none;
  opacity: 0.9;
}
.export-confidence.conf-low {
  color: #a03a00;
}
.export-confidence.compact.conf-low {
  background: rgba(253, 232, 216, 0.65);
}
.export-confidence.conf-med {
  color: #8a4b12;
}
.export-confidence.compact.conf-med {
  background: rgba(245, 235, 224, 0.75);
}
.export-confidence.conf-high {
  color: var(--accent);
}
.export-confidence.compact.conf-high {
  background: rgba(230, 243, 239, 0.75);
}
.export-confidence:not(.compact) {
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 6px;
  font-size: 0.68rem;
}
.export-confidence:not(.compact).conf-low {
  background: #fde8d8;
  outline: 1px solid #e8b48a;
}
.export-confidence:not(.compact).conf-med {
  background: #f5ebe0;
  outline: 1px solid #dcc4a8;
}
.export-confidence:not(.compact).conf-high {
  background: #e6f3ef;
  outline: 1px solid #a8cfc4;
}
.exchange-detail {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: #8a4b12;
  font-weight: 600;
}

.thread {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
}
.empty {
  margin: auto;
  color: var(--muted);
  font-size: 0.9rem;
}
.thread-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.thread-panel.hidden {
  display: none;
}
.thread-head {
  border-bottom: 1px solid var(--line);
  background: #f7f3ec;
  flex-shrink: 0;
}
.thread-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  min-height: 56px;
}
.thread-head-main.hidden {
  display: none;
}
.thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.thread-who {
  min-width: 0;
  flex: 1;
}
.thread-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-conf {
  margin: 3px 0 0;
  font-size: 0.72rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-conf.hidden {
  display: none;
}
.thread-conf-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 600;
}
.thread-conf-line .export-confidence {
  font-size: 0.68rem;
}
.thread-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  justify-content: flex-end;
}
.thread-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  min-height: 56px;
}
.thread-search-bar.hidden {
  display: none;
}
.thread-search-bar input[type="search"] {
  flex: 1;
  width: auto;
  min-width: 0;
  height: 36px;
  border-radius: 18px;
  padding: 0 14px;
  background: #fff;
  font-size: 0.88rem;
}
.thread-search-bar .hit-nav {
  margin-top: 0;
}
.thread-context {
  flex-shrink: 0;
  padding: 7px 14px;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.35;
  color: #5a4a28;
  background: #f3ead4;
  border-bottom: 1px solid #e4d6b4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-context.hidden {
  display: none;
}
.thread-context.live-gone {
  color: #7a2e28;
  background: #f6ddd9;
  border-bottom-color: #e8c0ba;
  white-space: normal;
}
.followup-back-btn {
  font-size: 0.72rem !important;
  padding: 4px 10px !important;
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 650;
}
.followup-back-btn:hover {
  background: #e6f5ec;
}
.followup-back-btn.hidden {
  display: none !important;
}
.offers-back-btn {
  font-size: 0.72rem !important;
  padding: 4px 10px !important;
  white-space: nowrap;
  background: #fff;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-weight: 650;
}
.offers-back-btn:hover {
  background: #e6f5ec;
}
.offers-back-btn.hidden {
  display: none !important;
}
.offers-table tr.offers-return-focus td {
  background: #fff4d6 !important;
  box-shadow: inset 3px 0 0 var(--accent);
}
.fu-origin-btn {
  font-size: 0.72rem !important;
  padding: 4px 10px !important;
  white-space: nowrap;
  background: #fff8e8;
  border: 1px solid #c48a1a;
  color: #8a5a00;
  font-weight: 700;
}
.fu-origin-btn:hover {
  background: #ffefcc;
}
.fu-origin-btn.hidden {
  display: none !important;
}
.row.focus-msg-origin .bubble {
  outline: 2px solid #c48a1a;
  box-shadow: 0 0 0 3px rgba(196, 138, 26, 0.2);
}
.row.focus-msg-follow .bubble {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 107, 74, 0.18);
}
.pkg-sheet tr.fu-pkg-row-hit td {
  background: #fde8e8;
}
.pkg-sheet tr.fu-pkg-row-hit.fu-pkg-clickable {
  cursor: pointer;
}
.pkg-sheet tr.fu-pkg-row-hit.fu-pkg-clickable:hover td {
  background: #f8d4d4;
}
.pkg-sheet tr.fu-pkg-row-selected td {
  background: #f5c0c0 !important;
  box-shadow: inset 3px 0 0 #a12626;
}
.pkg-sheet tr.fu-pkg-row-selected td.pkg-p mark.hit {
  background: #e8a0a0;
  outline: 1px solid #a12626;
}
.pkg-sheet tr.fu-pkg-row-hit td.pkg-p mark.hit {
  background: #f5c0c0;
  outline: 1px solid #c44;
}
.followup-table tr.fu-return-focus td {
  background: #fff4d6 !important;
  box-shadow: inset 3px 0 0 var(--accent);
}
.followup-table tr.fu-return-focus td.app-cell {
  outline: 2px solid #e89b2d;
  outline-offset: -2px;
}
.hit-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1px 4px;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--muted);
}
.hit-nav.hidden {
  display: none !important;
}
.hit-btn {
  width: 22px;
  height: 20px;
  padding: 0;
  line-height: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  border-radius: 5px;
  font-size: 0.65rem;
}
.hit-btn:hover {
  background: #efe9dc;
}
.hit-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.25;
}

.message-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background-color: #e5ddd5;
  background-image: radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 18px 18px;
}

.row {
  display: flex;
  width: 100%;
}
.row.focus-msg .bubble {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(27, 107, 74, 0.18);
}
.row.mine {
  justify-content: flex-end;
}
.row.theirs,
.row.unknown {
  justify-content: flex-start;
}

.bubble {
  max-width: min(640px, 88%);
  min-width: 120px;
  padding: 6px 10px 4px;
  border-radius: 8px;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.08);
}
.bubble.wide-sheet {
  width: min(680px, 94%);
  max-width: min(720px, 96%);
}
.row.mine .bubble {
  background: var(--mine);
  border-bottom-right-radius: 2px;
}
.row.theirs .bubble {
  background: var(--theirs);
  border-bottom-left-radius: 2px;
}
.row.unknown .bubble {
  background: #f4f0e7;
  border: 1px dashed #cbb;
}

.bubble-sender {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  margin-bottom: 0;
  line-height: 1.2;
}
.row.mine .bubble-sender {
  color: #146043;
}
.row.theirs .bubble-sender {
  color: #2a4570;
}
.row.unknown .bubble-sender {
  color: #666;
}

.quote {
  background: var(--quote);
  border-left: 3px solid #4a6fa5;
  border-radius: 4px;
  padding: 2px 5px;
  margin: 0 0 2px;
  font-size: 0.74rem;
  cursor: pointer;
}
.row.mine .quote {
  border-left-color: var(--accent);
  background: rgba(27, 107, 74, 0.08);
}
.quote-who {
  font-weight: 700;
  font-size: 0.65rem;
  color: #2a4570;
}
.quote-when {
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}
.quote-text {
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}
.quote-hint {
  display: none;
}

.bubble-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.35;
}
.bubble-body-empty {
  min-height: 0;
}
.media-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  white-space: normal;
}
.bubble-body:not(:empty) .media-stack:first-child {
  margin-top: 0;
}
.media-thumb {
  display: block;
  max-width: min(360px, 100%);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.4);
  line-height: 0;
}
.media-thumb img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  background: #f7f4ee;
}
.media-video {
  max-width: min(360px, 100%);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #111;
}
.media-video video {
  display: block;
  width: 100%;
  max-height: 360px;
}
.media-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1.3;
}
a.media-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.media-chip-missing {
  color: var(--muted);
  background: rgba(0, 0, 0, 0.03);
}
.media-chip-kind {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.media-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-chip-note {
  flex: 0 0 auto;
  font-size: 0.65rem;
  color: var(--muted);
}
.bubble.wide-sheet .bubble-body,
.bubble-body:has(.pkg-sheet-wrap) {
  white-space: normal;
  max-width: none;
  width: 100%;
}
.pkg-intro {
  white-space: pre-wrap;
  margin-bottom: 8px;
  line-height: 1.35;
}
.pkg-tail {
  white-space: pre-wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}
.pkg-sheet-wrap {
  overflow-x: auto;
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}
.pkg-sheet {
  width: 100%;
  min-width: 320px;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 0.76rem;
  line-height: 1.35;
}
.pkg-sheet th {
  text-align: left;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}
.pkg-sheet td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  vertical-align: top;
}
.pkg-sheet tr:last-child td {
  border-bottom: 0;
}
.pkg-sheet tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}
.pkg-sheet .pkg-n {
  width: 32px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-right: 6px;
}
.pkg-sheet .pkg-a {
  font-weight: 600;
  min-width: 120px;
  max-width: 220px;
}
.pkg-sheet .pkg-p {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--accent);
  word-break: break-all;
  min-width: 140px;
}
.pkg-sheet .pkg-v {
  color: var(--muted);
  white-space: nowrap;
}
.row.mine .pkg-sheet-wrap {
  background: rgba(255, 255, 255, 0.4);
}
.row.theirs .pkg-sheet-wrap,
.row.unknown .pkg-sheet-wrap {
  background: rgba(255, 255, 255, 0.9);
}
.mention {
  color: #1a5fb4;
  font-weight: 650;
  background: rgba(26, 95, 180, 0.08);
  border-radius: 4px;
  padding: 0 2px;
}
mark.hit {
  background: #ffe08a;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}
mark.hit.active-hit {
  outline: 2px solid #c47a00;
  background: #ffd24d;
}
mark.fu-done {
  background: #c8ead8;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}
mark.fu-done.active-hit {
  outline: 2px solid #2a7a4b;
  background: #9fd4b3;
}
.pkg-sheet tr.fu-pkg-row-chased td {
  background: #eef8f1;
}
.pkg-sheet tr.fu-pkg-row-chased.fu-pkg-clickable:hover td {
  background: #dcefe3;
}
.pkg-sheet tr.fu-pkg-row-chased.fu-pkg-row-selected td {
  background: #c8ead8 !important;
  box-shadow: inset 3px 0 0 #2a7a4b;
}
.bubble-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-size: 0.6rem;
  color: var(--muted);
  margin-top: 0;
  line-height: 1.2;
}
.bubble-foot-time {
  text-align: right;
}
.msg-feedback-toggle {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  margin-right: auto;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.55;
  transition:
    opacity 0.12s ease,
    color 0.12s ease,
    background 0.12s ease;
}
.bubble:hover .msg-feedback-toggle {
  opacity: 0.85;
}
.msg-feedback-toggle:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}
.msg-feedback-toggle.has-answer {
  color: var(--accent);
  opacity: 1;
}
.msg-feedback-toggle[aria-expanded="true"] {
  background: rgba(27, 107, 74, 0.14);
  color: var(--accent);
  opacity: 1;
}
.msg-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition:
    max-height 0.15s ease,
    opacity 0.15s ease,
    margin-top 0.15s ease;
  font-size: 0.66rem;
  color: var(--muted);
}
.msg-feedback.open {
  max-height: 40px;
  opacity: 1;
  margin-top: 4px;
}
.msg-feedback-label {
  font-weight: 650;
  white-space: nowrap;
}
.msg-feedback-opt {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 1px 7px 1px 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.045);
  white-space: nowrap;
}
.msg-feedback-opt:hover {
  background: rgba(27, 107, 74, 0.14);
}
.msg-feedback-opt input {
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.msg-feedback-status {
  font-weight: 650;
  color: var(--accent);
  white-space: nowrap;
}
.day-sep {
  align-self: center;
  margin: 4px 0 2px;
  padding: 1px 8px;
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.row.system {
  justify-content: center;
  margin: 6px 0;
}
.sys-event {
  max-width: 92%;
  text-align: center;
  padding: 6px 12px;
  border-radius: 10px;
  background: #f3efe6;
  border: 1px dashed #cfc6b4;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
.sys-event-text {
  display: block;
  color: #4a534a;
  font-weight: 550;
}
.sys-event-time {
  display: block;
  margin-top: 2px;
  font-size: 0.62rem;
  color: var(--muted);
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    max-height: 30vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .message-list {
    padding: 8px 10px;
  }
  .bubble {
    max-width: 94%;
  }
  .bubble.wide-sheet {
    width: 96%;
    max-width: 96%;
  }
}

.login-body {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: #f2f0e9;
}
.login-card {
  width: min(380px, 100%);
  padding: 28px 28px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f4ed;
}
.login-logo {
  display: block;
  height: 36px;
  width: auto;
  margin: 0 auto 14px;
}
.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-sub {
  margin: 4px 0 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}
.login-card label {
  display: block;
  margin: 10px 0 4px;
  font-size: 0.75rem;
  font-weight: 650;
  color: #3d463d;
}
.login-card input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background: #fff;
}
.login-submit {
  width: 100%;
  height: 38px;
  margin-top: 16px;
  font-size: 0.88rem;
}
.login-err {
  min-height: 1.2em;
  margin: 10px 0 0;
  color: #9a2f2f;
  font-size: 0.78rem;
}
.login-forgot-row {
  margin: 12px 0 0;
  text-align: center;
}
.login-forgot {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.login-forgot:hover {
  color: #146043;
}
.login-forgot-msg {
  min-height: 1.2em;
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ── Auto-sync / indexing indicator ─────────────────────────────── */
.company-picker-note--syncing {
  color: var(--accent, #4a9eff);
  font-style: italic;
  animation: sync-pulse 1.5s ease-in-out infinite;
}

.company-picker-option--syncing {
  opacity: 0.6;
  cursor: not-allowed;
}
.company-picker-option--syncing:hover {
  background: none;
}

@keyframes sync-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}
/* ── Usability refinement ─────────────────────────────────────── */
:root {
  --focus: #165c40;
  --focus-ring: rgba(27, 107, 74, 0.22);
  --surface: #faf8f4;
}

button,
input,
select,
a {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  border-color: var(--focus);
}
::selection {
  background: #cce8d7;
  color: var(--ink);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #b8b09f transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: #c3bcad;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background-color: #a79f90;
}

.topbar {
  padding: 7px 12px;
  background: rgba(250, 248, 244, 0.96);
  box-shadow: 0 1px 0 rgba(48, 43, 30, 0.04);
  z-index: 10;
}
.nav-btn {
  min-height: 30px;
}
.offers-panel {
  inset: 0;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(48, 43, 30, 0.16);
}
.offers-panel-head {
  padding: 10px 18px;
}
.offers-panel-head strong {
  font-size: 1.1rem;
}
.btn {
  font-weight: 600;
}
.btn:hover {
  border-color: #b7ae9e;
  background: #fcfbf8;
}
.btn-primary:hover {
  border-color: #b7ae9e;
  background: #165c40c6;
}

.layout {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
}
.sidebar {
  background: #f5f1e9;
}

.sidebar-tools {
  padding: 0 10px 10px;
}
.conv-list {
  padding: 2px 8px 12px;
}
.conv-item {
  padding: 10px;
  border-radius: 9px;
}
.conv-item:hover {
  background: rgba(255, 255, 255, 0.8);
}
.conv-item.active {
  box-shadow:
    inset 3px 0 0 var(--accent),
    0 1px 2px rgba(40, 35, 24, 0.06);
}

.empty {
  max-width: 320px;
  padding: 26px;
  text-align: center;
  line-height: 1.5;
}
.empty::before {
  content: "";
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;

  border: 1px solid #c8e2d2;
  border-radius: 14px;
  background-color: white;
  background-image: url("/static/img/message-icon.png");
  background-size: 49px;
  background-repeat: no-repeat;
  background-position: center;

  box-shadow: inset 0 0 0 4px #f4fbf6;
}
.thread-head {
  background: rgba(250, 248, 244, 0.97);
}
.message-list {
  padding: 14px clamp(14px, 3vw, 32px) 28px;
}
.bubble {
  max-width: min(720px, 82%);
}

@media (max-width: 800px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px;
  }
  .brand-row,
  .filters {
    width: 100%;
  }
  .brand-row {
    overflow-x: auto;
    padding-bottom: 1px;
  }
  .filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .filters > * {
    flex: 0 0 auto;
  }
  .sidebar {
    max-height: 34vh;
  }
  .offers-panel-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .offers-panel-actions {
    width: 100%;
  }
  .offers-panel-actions input[type="search"] {
    flex: 1 1 170px;
    width: auto;
  }
  .offers-active-filters {
    padding: 8px 12px;
  }
  .thread-head-main {
    align-items: flex-start;
    padding: 8px 10px;
  }
}

@media (max-width: 480px) {
  .company-picker-label {
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .source-toggle-btn {
    padding: 0 9px;
  }
  .sidebar {
    max-height: 38vh;
  }
  .thread-avatar {
    width: 34px;
    height: 34px;
  }
  .thread-head h2 {
    font-size: 0.88rem;
  }
  .thread-sub {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Offers inherits the same range calendar as Chats. Keep its popup above the panel. */
.topbar {
  z-index: auto;
}
.offers-date-picker-btn {
  max-width: 240px;
}
.offers-date-picker-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Clear, in-panel request feedback for range changes and scans. */
.table-loading-row td {
  height: min(calc(100dvh - 210px));
  padding: 0 !important;
  white-space: normal !important;
  background: transparent !important;
}
.table-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  color: var(--muted);
  font-size: 0.82rem;
}
.table-loading strong {
  display: block;
  color: var(--ink);
  font-size: 0.88rem;
}
.table-loading small {
  display: block;
  margin-top: 2px;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 3px solid #c8e2d2;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: table-spinner 0.75s linear infinite;
}
@keyframes table-spinner {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation: none;
    border-top-color: #c8e2d2;
  }
}

/* Follow-up action queue — clarity-first workspace */
.followup-panel .offers-panel-head {
  align-items: flex-start;
  background: linear-gradient(135deg, #fbfaf6 0%, #f2f7f3 100%);
}
.followup-panel .offers-panel-head > div:first-child strong {
  font-size: 1.1rem;
}
.followup-panel .offers-panel-head > div:first-child .muted {
  max-width: 680px;
}
.followup-panel .offers-sort {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}
.followup-panel .offers-sort select {
  min-width: 184px;
  color: var(--ink);
}
.followup-guide {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid #d9e4dc;
  background: #f4faf6;
}
.followup-guide-intro {
  display: grid;
  gap: 2px;
  max-width: 590px;
}
.followup-guide-kicker {
  color: var(--accent);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.followup-guide-intro strong {
  font-size: 0.82rem;
}
.followup-guide-intro > span:last-child {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.followup-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #3d6b54;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.followup-steps li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.followup-steps li + li::before {
  content: "→";
  margin-right: 3px;
  color: #93ad9d;
}
.followup-steps span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dcefe3;
  color: var(--accent);
  font-size: 0.65rem;
}
.followup-am-stats {
  min-height: 48px;
  padding: 12px 18px;
  background: #fff;
}
.followup-am-chip {
  min-height: 33px;
  border-radius: 10px;
  box-shadow: 0 1px 1px rgba(40, 35, 24, 0.03);
}
.followup-table td {
  padding-top: 11px;
  padding-bottom: 11px;
}
.followup-table tr.clickable:hover td {
  background: #f3faf5;
}
.followup-table td:nth-child(3) {
  font-weight: 700;
  color: var(--ink);
}
.followup-table .fu-miss {
  color: #a12626;
}

@media (max-width: 900px) {
  .followup-guide {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding: 11px 12px;
  }
  .followup-steps {
    white-space: normal;
    flex-wrap: wrap;
  }
}
@media (max-width: 720px) {
  .followup-panel .offers-panel-head > div:last-child {
    width: 100%;
    align-items: stretch !important;
  }
  .followup-panel .offers-panel-actions {
    width: 100%;
  }
  .followup-panel .offers-sort {
    justify-content: space-between;
  }
  .followup-table thead {
    display: none;
  }
  .followup-table,
  .followup-table tbody {
    display: block;
    width: 100%;
  }
  .followup-table tbody {
    padding: 10px;
  }
  .followup-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px 12px;
    margin-bottom: 9px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }
  .followup-table td {
    display: block;
    max-width: none;
    padding: 0;
    border: 0;
    white-space: normal;
  }
  .followup-table td.col-num {
    display: none;
  }
  .followup-table td.col-date {
    grid-column: 2;
    grid-row: 1;
    color: var(--muted);
    font-size: 0.68rem;
  }
  .followup-table td:nth-child(3) {
    grid-column: 1;
    grid-row: 1;
    padding-right: 8px;
  }
  .followup-table td.col-pkgs {
    grid-column: 1 / -1;
  }
  .followup-table td.snip {
    grid-column: 1 / -1;
    padding-top: 7px;
    border-top: 1px solid #eee9df;
    max-width: none;
  }
  .followup-table .table-loading-row {
    display: table-row;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
  }
}

/* Data table readability — scan columns, then act on a row. */
.offers-table-wrap {
  background: #f8f6f1;
}
.offers-table {
  border-collapse: separate;
  border-spacing: 0 5px;
  padding: 0 10px 10px;
}
.offers-table thead th {
  top: 0;
  padding-top: 12px;
  padding-bottom: 10px;
  background: #f8f6f1;
  color: #667168;
  box-shadow: inset 0 -1px 0 var(--line);
}
.offers-table tbody td {
  background: #fff;
  border-top: 1px solid #e5dfd2;
  border-bottom: 1px solid #e5dfd2;
  box-shadow: 0 1px 1px rgba(40, 35, 24, 0.025);
}
.offers-table tbody td:first-child {
  border-left: 1px solid #e5dfd2;
  border-radius: 8px 0 0 8px;
}
.offers-table tbody td:last-child {
  border-right: 1px solid #e5dfd2;
  border-radius: 0 8px 8px 0;
}
.offers-table tr.clickable {
  transition:
    transform 120ms ease,
    filter 120ms ease;
}
.offers-table tr.clickable:hover {
  transform: translateY(-1px);
}
.offers-table tr.clickable:hover td {
  background: #f3faf5;
  border-color: #c9e2d2;
}
.offers-table .col-date,
.offers-table .col-num,
.offers-table .col-shares {
  font-variant-numeric: tabular-nums;
}
.offers-table .col-date {
  color: #546157;
  font-weight: 650;
}
.offers-table td.col-num {
  color: #879087;
  font-size: 0.68rem;
}
.offers-table .app-cell {
  color: #146043;
}

.followup-table tbody td:nth-child(3) {
  min-width: 190px;
  color: #26382d;
}
.followup-table .fu-pkg-cell {
  gap: 7px;
}
.followup-table .fu-pkg-count {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eaf5ee;
  color: #146043;
  font-size: 0.71rem;
}
.followup-table .fu-pkg-more {
  color: #346b4c;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #c8e2d2;
  border-radius: 999px;
  padding: 2px 7px;
  background: #fff;
}
.followup-table .fu-pkg-more:hover {
  background: #eaf5ee;
}
.followup-table td.snip {
  min-width: 180px;
  font-weight: 650;
  line-height: 1.4;
}
.followup-table td.fu-miss {
  color: #9c3027;
  background: #fffafa;
}
.followup-table tr.fu-return-focus td {
  background: #fff7dd !important;
  border-color: #e8c56b;
}

@media (max-width: 720px) {
  .offers-table {
    border-spacing: 0 7px;
    padding: 0 8px 8px;
  }
  .offers-table tbody td:first-child,
  .offers-table tbody td:last-child {
    border-radius: 0;
  }
  .followup-table tr {
    box-shadow: 0 1px 3px rgba(40, 35, 24, 0.05);
  }
  .followup-table td.fu-miss {
    background: transparent;
  }
}

/* Keep package and follow-up cells stable: package names scroll, never expand a row. */
.followup-table .fu-pkg-cell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 32px;
}
.followup-table .fu-pkg-row {
  display: block;
}
.followup-table .fu-pkg-rest {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 420px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 3px;
  scrollbar-width: thin;
}
.followup-table .fu-pkg-chip {
  flex: 0 0 auto;
  max-width: 180px;
}
.followup-table td.snip {
  height: 48px;
  vertical-align: middle;
}
.followup-table td.snip.fu-miss {
  border-left: 3px solid #d6645c;
}
@media (max-width: 720px) {
  .followup-table .fu-pkg-cell {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .followup-table .fu-pkg-rest {
    max-width: 100%;
  }
  .followup-table td.snip {
    height: auto;
    min-height: 36px;
  }
}

/* Keep package and follow-up cells stable: package names scroll, never expand a row. */
.followup-table .fu-pkg-cell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 32px;
}
.followup-table .fu-pkg-row {
  display: block;
}
.followup-table .fu-pkg-rest {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 420px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 3px;
  scrollbar-width: thin;
}
.followup-table .fu-pkg-chip {
  flex: 0 0 auto;
  max-width: 180px;
}
.followup-table td.snip {
  height: 48px;
  vertical-align: middle;
}
.followup-table td.snip.fu-miss {
  border-left: 3px solid #d6645c;
}
@media (max-width: 720px) {
  .followup-table .fu-pkg-cell {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .followup-table .fu-pkg-rest {
    max-width: 100%;
  }
  .followup-table td.snip {
    height: auto;
    min-height: 36px;
  }
}

/* Offers: keep the context and controls readable before the wide table. */
@media (max-width: 900px) {
  .offers-panel-head {
    align-items: flex-start;
  }
  .offers-panel-actions {
    justify-content: flex-start;
  }
  .offers-panel-actions input[type="search"] {
    width: min(100%, 270px);
  }
}
@media (max-width: 620px) {
  .offers-panel-head {
    flex-direction: column;
  }
  .offers-panel-actions {
    width: 100%;
  }
  .offers-panel-actions input[type="search"] {
    flex: 1 1 100%;
    width: 100%;
  }
  .offers-subtitle {
    max-width: none;
  }
  .offers-clear-filters {
    margin-left: 0;
  }
}

.loader-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card {
  --bg-color: #fffefe00;
  background-color: var(--bg-color);
  padding: 1rem 2rem;
  border-radius: 1.25rem;
}

.loader {
  color: var(--text-secondary);
  opacity: 0.7;
  font-family: "Poppins", sans-serif;
  font-weight: 400;
  font-size: 17px;

  display: flex;
  align-items: center;
  justify-content: center;

  height: 40px;
  padding: 10px;
  border-radius: 8px;

  white-space: nowrap;
}

.loader p {
  margin: 0;
}

.words {
  height: 40px;
  margin-left: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  font-size: 22px;
  font-weight: 700;
}

.words::after {
  content: "";
  position: absolute;
  inset: 0;

  background: linear-gradient(
    var(--bg-color) 10%,
    transparent 30%,
    transparent 70%,
    var(--bg-color) 90%
  );

  z-index: 20;
  pointer-events: none;
}

.word {
  display: block;
  height: 40px;
  line-height: 40px;
  padding: 0;

  color: var(--accent);
  white-space: nowrap;

  animation: spin_4991 4s infinite;
}

@keyframes spin_4991 {
  10% {
    transform: translateY(-40px);
  }

  25% {
    transform: translateY(-40px);
  }

  35% {
    transform: translateY(-80px);
  }

  50% {
    transform: translateY(-80px);
  }

  60% {
    transform: translateY(-120px);
  }

  75% {
    transform: translateY(-120px);
  }

  85% {
    transform: translateY(-160px);
  }

  100% {
    transform: translateY(-160px);
  }
}
/* ── Company busy lock (chat screen) ────────────────────────────────
   While the selected company is indexing/uploading, controls outside
   the company picker and logout are disabled.
   The company picker remains completely unchanged and interactive.
*/

/* Dim the main layout */
body.company-busy .layout {
  opacity: 0.6;
}

/* Disable everything in topbar and layout */
body.company-busy .topbar *,
body.company-busy .layout * {
  pointer-events: none !important;
}

/* Disabled visual style */
body.company-busy
  :is(
    .topbar :is(button, a, input, select, textarea, [role="option"]),
    .layout :is(button, a, input, select, textarea, [role="option"])
  ) {
  filter: grayscale(1);
  opacity: 0.55;
  color: var(--muted, #8a8171) !important;
  border-color: var(--line, #d8d2c3) !important;
  background: var(--surface-muted, #ece8de) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

/* ── Logout stays active ─────────────────────────────────────────── */

body.company-busy #logoutBtn {
  pointer-events: auto !important;
  opacity: 1 !important;
  filter: none !important;
  color: inherit !important;
  border-color: initial !important;
  background: initial !important;
  cursor: pointer !important;
  box-shadow: inherit !important;
}

/* ── Company picker stays COMPLETELY unchanged ───────────────────── */

/* Container itself */
body.company-busy #companyPicker {
  pointer-events: auto !important;
  opacity: 1 !important;
  filter: none !important;
  cursor: pointer !important;
  box-shadow: inherit !important;
}

/* Everything inside picker */
body.company-busy #companyPicker,
body.company-busy #companyPicker *,
body.company-busy #companyPicker button,
body.company-busy #companyPicker input,
body.company-busy #companyPicker select,
body.company-busy #companyPicker [role="option"],
body.company-busy #companyPicker [role="listbox"] {
  pointer-events: auto !important;
}
/* ── Company busy lock ───────────────────────────────────────────── */

body.company-busy .topbar *,
body.company-busy .layout * {
  pointer-events: none !important;
}

/* Disabled controls */
body.company-busy
  :is(
    .topbar :is(button, a, input, select, textarea, [role="option"]),
    .layout :is(button, a, input, select, textarea, [role="option"])
  ):not(#companyPicker):not(#logoutBtn) {
  filter: grayscale(1);
  opacity: 0.55;
  color: var(--muted, #8a8171) !important;
  border-color: var(--line, #d8d2c3) !important;
  background: var(--surface-muted, #ece8de) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}

/* ── Logout remains active ──────────────────────────────────────── */

body.company-busy #logoutBtn {
  pointer-events: auto !important;
  opacity: 1 !important;
  filter: none !important;
  cursor: pointer !important;
}

/* ── Company picker remains completely normal ───────────────────── */

body.company-busy #companyPicker,
body.company-busy #companyPicker * {
  pointer-events: auto !important;
  opacity: 1 !important;
  filter: none !important;
  cursor: pointer !important;
}
