/* Layout and table styles */
 .tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .tab-buttons button {
    margin-right: 0;
    position: relative;
  }

  .tab-buttons .tab-badge {
    position: absolute;
    top: -0.4rem;
    right: -0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #d93025;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(217, 48, 37, 0.35);
  }

  [data-theme="dark"] .tab-buttons .tab-badge {
    background: #ff6b6b;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.45);
    color: #1f1f1f;
  }

  .tab-buttons .tab-badge[hidden] {
    display: none;
  }

  .tab-buttons button.has-pending-replies {
    box-shadow: 0 0 0 1px rgba(217, 48, 37, 0.35);
  }

  [data-theme="dark"] .tab-buttons button.has-pending-replies {
    box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.45);
  }

  #tabSettingsBtn {
    margin-left: auto;
  }

  #dataContainer {
    margin-top: 1.5rem;
    background: var(--container-bg);
    border: 1px solid var(--panel-border-color);
    border-radius: 6px;
    padding: 1rem;
    min-height: 80px;
  }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

  th,
  td {
    padding: 0.75rem;
    border-top: 1px solid var(--panel-border-color);
    text-align: left;
  }

  thead th {
    background: var(--table-header-bg);
    font-weight: 500;
  }

  tbody tr:hover {
    background-color: var(--table-hover-bg);
  }

  .scraped-data-table {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--panel-border-color);
    border-radius: 6px;
    margin-top: 0.5rem;
  }

#emailToolsSection,
#trackingToolsSection,
#draftsSection,
#PeopleSearchSection {
  margin-top: 1rem;
  display: none;
}

#emailToolsSection {
  display: block;
}

  .panel {
    border: 1px solid var(--panel-border-color);
    border-radius: 6px;
    padding: 1rem;
    background: var(--container-bg);
  }

.panel h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.settings-optout-panel {
  margin-bottom: 2rem;
  padding: 1.25rem;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
}

.settings-card,
.settings-optout-panel {
  scroll-margin-top: 6rem;
}

.settings-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.settings-header__description {
  margin: 0;
  color: var(--muted-text-color);
  font-size: 0.95rem;
  line-height: 1.5;
}

.settings-layout {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2rem;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.settings-sidebar {
  position: relative;
  width: 100%;
}

.settings-sidebar__inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--panel-border-color);
  border-radius: 8px;
  background: var(--container-bg);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  width: 100%;
}

.settings-sidebar__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.settings-sidebar__description {
  margin: 0;
  color: var(--muted-text-color);
  font-size: 0.9rem;
  line-height: 1.5;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-nav__link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.settings-nav__link:hover,
.settings-nav__link:focus-visible {
  background: var(--table-hover-bg);
  outline: none;
}

.settings-nav__link[aria-current="true"] {
  background: var(--table-hover-bg);
  color: var(--link-color, inherit);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--panel-border-color);
}

[data-theme="dark"] .settings-sidebar__inner {
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.35);
}

[data-theme="dark"] .settings-nav__link[aria-current="true"] {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.settings-sidebar__tips {
  border-top: 1px solid var(--panel-border-color);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-sidebar__tips-heading {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.settings-sidebar__tips-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted-text-color);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: disc;
}

.settings-sidebar__tips-list li {
  margin: 0;
}

.settings-card__subsection {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-card__subheading {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.settings-form__details {
  border: 1px solid var(--panel-border-color);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  background: var(--subtle-panel-bg, #f8fbff);
  margin-top: 0.5rem;
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
}

.settings-form__details > summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.settings-form__details[open] > summary {
  margin-bottom: 0.65rem;
}

.settings-form__details > summary::marker,
.settings-form__details > summary::-webkit-details-marker {
  display: none;
}

.settings-form__details > summary::after {
  content: '\25BE';
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.settings-form__details[open] > summary::after {
  transform: rotate(180deg);
}

.settings-form__details-body {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.settings-form__hint--standalone {
  margin: 0 0 0.5rem;
}

.settings-card__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.settings-card__description {
  margin: 0.35rem 0 0;
  color: var(--muted-text-color);
  font-size: 0.95rem;
}

.settings-card__status {
  margin-top: -0.75rem;
}

.settings-card__subheading {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.call-numbers-layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}

.call-numbers-layout__form,
.call-numbers-layout__list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.call-numbers-layout__hint {
  margin: 0;
}

.settings-optout-panel__header {
  margin-bottom: 0.75rem;
}

.settings-optout-panel__description {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--muted-text-color);
}

.settings-optout-panel__form {
  display: grid;
  gap: 0.75rem;
  align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 1rem;
}

.settings-optout-panel__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-optout-panel__field input {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--panel-border-color);
  border-radius: 4px;
}

.settings-optout-panel__bulk {
  margin-bottom: 1rem;
}

.settings-optout-panel__bulk textarea {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--panel-border-color);
  border-radius: 4px;
  resize: vertical;
}

.settings-optout-panel__bulk-actions {
  margin-top: 0.5rem;
}

.settings-optout-panel__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.settings-optout-panel__count {
  font-weight: 600;
}

.settings-optout-panel__status {
  margin-bottom: 0.5rem;
}

.settings-optout-panel__table-wrapper {
  overflow-x: auto;
}

.settings-optout-panel__table {
  width: 100%;
  border-collapse: collapse;
}

.settings-optout-panel__table th,
.settings-optout-panel__table td {
  vertical-align: top;
}

.settings-optout-panel__table td:last-child {
  white-space: normal;
}

.settings-optout-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.settings-optout-panel__history-row {
  background: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] .settings-optout-panel__history-row {
  background: rgba(255, 255, 255, 0.04);
}

.settings-optout-panel__history-cell {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--panel-border-color);
  white-space: normal;
  overflow-wrap: anywhere;
}

.settings-optout-history__header {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.settings-optout-history__message {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted-text-color);
}

.settings-optout-history__message[data-status="success"] {
  color: #22543d;
}

.settings-optout-history__message[data-status="error"] {
  color: #742a2a;
}

[data-theme="dark"] .settings-optout-history__message[data-status="success"] {
  color: #9ae6b4;
}

[data-theme="dark"] .settings-optout-history__message[data-status="error"] {
  color: #feb2b2;
}

.settings-optout-history__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-optout-history__thread {
  border: 1px solid var(--panel-border-color);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  background: var(--container-bg);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

[data-theme="dark"] .settings-optout-history__thread {
  background: rgba(255, 255, 255, 0.03);
}

.settings-optout-history__thread-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.settings-optout-history__thread-title {
  margin: 0;
  font-size: 1rem;
}

.settings-optout-history__thread-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted-text-color);
  text-align: right;
}

.settings-optout-history__thread-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-text-color);
}

.settings-optout-history__thread-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.settings-optout-history__thread-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.25rem;
}

.settings-optout-history__lead-summary {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-text-color);
}

.settings-optout-history__lead-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(56, 161, 105, 0.18);
  color: #22543d;
}

[data-theme="dark"] .settings-optout-history__lead-pill {
  background: rgba(56, 161, 105, 0.25);
  color: #9ae6b4;
}

.settings-optout-history__empty {
  font-size: 0.9rem;
  color: var(--muted-text-color);
}

.settings-form {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.settings-form--compact {
  grid-template-columns: minmax(0, 1fr);
}

.settings-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.settings-form__field[hidden] {
  display: none !important;
}

.settings-form__field label,
.settings-form__field span {
  font-weight: 500;
}

.settings-form__label {
  font-weight: 600;
}

.settings-form__field input,
.settings-form__field select,
.settings-form__field textarea {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--panel-border-color);
  border-radius: 4px;
  background: var(--input-bg, #fff);
  font: inherit;
}

.settings-form__field textarea {
  resize: vertical;
  min-height: 120px;
}

.settings-form__field--full {
  grid-column: 1 / -1;
}

.settings-form__field--nested {
  grid-column: 1 / -1;
  margin-top: 0.65rem;
  margin-left: 0.35rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--panel-border-color);
}

.settings-form__field--checkbox {
  flex-direction: row;
  gap: 0.5rem;
  align-items: center;
}

.settings-form__fieldset {
  grid-column: 1 / -1;
  border: 1px solid var(--panel-border-color);
  border-radius: 6px;
  padding: 1.1rem 1.25rem 1.25rem;
  background: var(--subtle-panel-bg, #f8fbff);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

.settings-form__fieldset legend {
  padding: 0 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.settings-form__fieldset > .settings-form__hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.85rem;
}

.settings-form__fieldset[disabled] {
  opacity: 0.6;
}

.settings-form__inline-control,
.settings-table__inline-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-form__inline-control input[type='url'],
.settings-table__inline-control input[type='url'] {
  flex: 1 1 auto;
}

.settings-form__hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-text-color);
  line-height: 1.5;
}

@media (min-width: 720px) {
  .settings-form--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .settings-form,
  .settings-form__fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.file-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.1rem;
  border: 2px dashed var(--panel-border-color);
  border-radius: 8px;
  background: var(--subtle-panel-bg, #f9fbff);
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.file-upload:hover,
.file-upload:focus-within {
  border-color: var(--accent-color, #2563eb);
  background: rgba(37, 99, 235, 0.05);
}

.file-upload__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload__prompt {
  pointer-events: none;
}

.file-upload__text {
  margin: 0;
  font-size: 0.95rem;
}

.file-upload__action {
  text-decoration: underline;
}

.file-upload__meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-text-color);
}

.file-upload__clear {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  padding: 0;
}

.file-upload--has-file {
  border-style: solid;
  border-color: var(--accent-color, #2563eb);
  background: rgba(37, 99, 235, 0.08);
}

.file-upload--dragover {
  border-color: var(--accent-color, #2563eb);
  background: rgba(37, 99, 235, 0.12);
}

.file-upload__toggle {
  margin-top: 0.4rem;
  padding: 0;
  align-self: flex-start;
}

.settings-form__actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.settings-form__divider {
  grid-column: 1 / -1;
  border-top: 1px solid var(--panel-border-color);
  margin: 0.5rem 0;
}

.settings-form__field-group {
  display: contents;
}

.settings-provider-card {
  border: 1px solid var(--panel-border-color);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--subtle-panel-bg, #f9f9f9);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-provider-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-provider-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.settings-provider-card__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.settings-provider-card__hint {
  font-size: 0.8rem;
}

.settings-table {
  border: 1px solid var(--panel-border-color);
  border-radius: 6px;
  overflow: hidden;
}

.settings-table__table {
  width: 100%;
  border-collapse: collapse;
}

.settings-table__table thead {
  background: var(--table-header-bg);
}

.settings-table__table th,
.settings-table__table td {
  padding: 0.75rem;
  font-size: 0.9rem;
  vertical-align: top;
}

.settings-table__table th {
  text-transform: none;
  font-weight: 600;
}

.settings-table__column--actions {
  min-width: 200px;
}

.settings-table__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

@media (min-width: 720px) {
  .settings-table__actions {
    flex-direction: row;
    align-items: center;
  }
}

.settings-table__action-link {
  padding: 0;
}

.settings-table__details div + div {
  margin-top: 0.25rem;
}

.settings-table__inline-row td {
  background: var(--subtle-panel-bg, #f6f6f6);
  padding: 1.25rem;
  border-top: 1px solid var(--panel-border-color);
}

.settings-table__empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--muted-text-color);
}

.settings-table__inline-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.settings-inline-form .settings-table__inline-input {
  margin-bottom: 0;
}

.settings-table__inline-input:last-child {
  margin-bottom: 0;
}

.settings-table__hint {
  font-size: 0.8rem;
  color: var(--muted-text-color, #6b7280);
  margin: -0.25rem 0 0.5rem;
}

.settings-table__inline-checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.settings-table__inline-checkbox input[type='checkbox'] {
  width: auto;
  margin: 0;
}

.settings-table__row--editing {
  background: var(--table-row-active-bg, rgba(59, 130, 246, 0.08));
}

.settings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-list__item {
  border: 1px solid var(--panel-border-color);
  border-radius: 6px;
  padding: 1rem;
  background: var(--container-bg);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.settings-list__meta {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.settings-list__meta strong {
  font-weight: 600;
}

.settings-list__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.settings-inline-form {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr);
}

.settings-inline-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-inline-form__field--full {
  grid-column: 1 / -1;
}

.settings-inline-form__field input,
.settings-inline-form__field select {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--panel-border-color);
  border-radius: 4px;
  font: inherit;
}

.settings-inline-form__heading {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted-text-color);
}

.settings-inline-form__split {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr);
}

.settings-inline-form__group {
  display: grid;
  gap: 0.75rem;
}

.settings-inline-form__field--static {
  padding: 0.5rem;
  border-radius: 4px;
  background: var(--subtle-panel-bg, #f6f6f6);
}

.settings-inline-form__field--static span:last-child {
  font-weight: 600;
}

.settings-inline-form__field--static span:first-child {
  font-size: 0.85rem;
  color: var(--muted-text-color);
}

.settings-inline-form__field--checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.settings-inline-form__hint {
  font-size: 0.85rem;
  color: var(--muted-text-color);
  line-height: 1.5;
}

.settings-inline-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

@media (min-width: 720px) {
  .settings-inline-form,
  .settings-inline-form__split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.settings-inline-form__actions--spread {
  justify-content: space-between;
  align-items: center;
}

.settings-inline-form__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tp-search-cell {
  text-align: center;
}

/* Deal Tracker layout */
.deal-tracker-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.deal-tracker-toolbar__title {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
}

.deal-tracker-board {
  --deal-board-divider: rgba(148, 163, 184, 0.35);
  --deal-timeline-surface: rgba(255, 255, 255, 0.9);
  --deal-timeline-border: rgba(148, 163, 184, 0.35);
  --deal-timeline-line: rgba(148, 163, 184, 0.35);
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  width: 100%;
  border: 1px solid var(--panel-border-color);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.85));
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

[data-theme="dark"] .deal-tracker-board {
  --deal-board-divider: rgba(71, 85, 105, 0.6);
  --deal-timeline-surface: rgba(30, 41, 59, 0.9);
  --deal-timeline-border: rgba(71, 85, 105, 0.65);
  --deal-timeline-line: rgba(71, 85, 105, 0.65);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.85));
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.55);
}

.deal-tracker-board__pane {
  display: flex;
  flex-direction: column;
  gap: clamp(1.1rem, 0.9rem + 0.8vw, 1.6rem);
  padding: clamp(1.2rem, 0.95rem + 1vw, 1.9rem);
  min-width: 0;
}

.deal-tracker-board__pane--list {
  border-right: 1px solid var(--deal-board-divider);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(248, 250, 252, 0.4));
}

[data-theme="dark"] .deal-tracker-board__pane--list {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.75), rgba(15, 23, 42, 0.65));
}

.deal-tracker-board__pane--detail {
  gap: clamp(1.35rem, 1.1rem + 0.9vw, 1.95rem);
}

@media (max-width: 960px) {
  .deal-tracker-board {
    grid-template-columns: 1fr;
  }

  .deal-tracker-board__pane--list {
    border-right: none;
    border-bottom: 1px solid var(--deal-board-divider);
  }
}

.deal-tracker-board__header {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.deal-tracker-board__title {
  margin: 0;
  font-size: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
  font-weight: 700;
}

.deal-tracker-board__subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted-text-color);
}

.deal-tracker-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.deal-tracker-list__entry {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.deal-tracker-list__item {
  border: 0;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  text-align: left;
  background: transparent;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.deal-tracker-list__item:hover,
.deal-tracker-list__item:focus-visible {
  background: rgba(30, 64, 175, 0.08);
  color: var(--text-color);
  transform: translateY(-1px);
}
[data-theme="dark"] .deal-tracker-list__item:hover,
[data-theme="dark"] .deal-tracker-list__item:focus-visible {
  background: rgba(148, 163, 184, 0.22);
}

.deal-tracker-list__item.is-active {
  background: rgba(30, 64, 175, 0.12);
  color: var(--text-color);
}

[data-theme="dark"] .deal-tracker-list__item.is-active {
  background: rgba(148, 163, 184, 0.28);
}

.deal-tracker-list__meta {
  font-size: 0.85rem;
  color: var(--muted-text-color);
  line-height: 1.4;
  padding-inline: 0.25rem;
}

.deal-tracker-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted-text-color);
}

.deal-tracker-timeline {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 0.95rem + 0.9vw, 1.95rem);
}

.deal-tracker-timeline__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: clamp(1rem, 0.8rem + 0.7vw, 1.5rem);
  align-items: stretch;
}

.deal-tracker-timeline__title {
  margin: 0;
  font-size: clamp(1.35rem, 1.15rem + 0.6vw, 1.7rem);
  font-weight: 700;
}

.deal-tracker-timeline__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
  margin-left: auto;
}

.deal-tracker-action-btn {
  border: 0;
  background: transparent;
  color: var(--muted-text-color);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.deal-tracker-action-btn:hover,
.deal-tracker-action-btn:focus-visible {
  background: rgba(30, 64, 175, 0.14);
  color: var(--text-color);
  box-shadow: 0 12px 30px -20px rgba(15, 23, 42, 0.45);
}

.deal-tracker-action-btn:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.deal-tracker-action-btn--danger {
  color: #dc2626;
}

.deal-tracker-action-btn--danger:hover,
.deal-tracker-action-btn--danger:focus-visible {
  background: rgba(220, 38, 38, 0.14);
  color: #b91c1c;
}

[data-theme="dark"] .deal-tracker-action-btn {
  color: rgba(226, 232, 240, 0.75);
}

[data-theme="dark"] .deal-tracker-action-btn:hover,
[data-theme="dark"] .deal-tracker-action-btn:focus-visible {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  box-shadow: 0 12px 32px -20px rgba(15, 23, 42, 0.65);
}

[data-theme="dark"] .deal-tracker-action-btn--danger {
  color: #fca5a5;
}

[data-theme="dark"] .deal-tracker-action-btn--danger:hover,
[data-theme="dark"] .deal-tracker-action-btn--danger:focus-visible {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

@media (max-width: 720px) {
  .deal-tracker-timeline__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.deal-tracker-summary {
  display: grid;
  gap: 0.45rem;
  padding: clamp(0.9rem, 0.75rem + 0.6vw, 1.15rem);
  border-radius: 14px;
  border: 1px solid var(--deal-timeline-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(226, 232, 240, 0.65));
  box-shadow: 0 22px 44px -34px rgba(15, 23, 42, 0.5);
}

[data-theme="dark"] .deal-tracker-summary {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.9));
  box-shadow: 0 24px 46px -32px rgba(15, 23, 42, 0.75);
}

.deal-tracker-summary p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted-text-color);
}

.deal-tracker-summary strong {
  color: var(--text-color);
}

.deal-tracker-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.deal-tracker-messages {
  --deal-timeline-gap: clamp(1.25rem, 0.95rem + 0.9vw, 1.95rem);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--deal-timeline-gap);
  padding-left: 2.35rem;
  z-index: 0;
}

.deal-tracker-messages::before {
  content: '';
  position: absolute;
  top: 1.35rem;
  bottom: 1.35rem;
  left: 1.1rem;
  width: 2px;
  background: var(--deal-timeline-line);
  opacity: 0.65;
  z-index: 0;
}

.deal-tracker-messages--nested {
  --deal-timeline-gap: clamp(0.85rem, 0.7rem + 0.6vw, 1.3rem);
  padding-left: 2.1rem;
}

.deal-tracker-messages--nested::before {
  left: 0.9rem;
  top: 1.05rem;
  bottom: 1.05rem;
}

.deal-tracker-messages--empty {
  padding-left: 0;
}

.deal-tracker-messages--empty::before {
  display: none;
}

.deal-timeline-event {
  position: relative;
  display: grid;
  grid-template-columns: min-content 1fr;
  column-gap: 1rem;
  align-items: flex-start;
  z-index: 1;
}

.deal-timeline-event__marker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  border: 2px solid var(--btn-bg);
  background: var(--deal-timeline-surface);
  box-shadow: 0 14px 32px -26px rgba(15, 23, 42, 0.6);
  justify-self: center;
}


.deal-timeline-event__content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.deal-timeline-event--thread .deal-timeline-event__marker {
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 18px 42px -32px rgba(59, 130, 246, 0.65);
}

.deal-timeline-event--thread-message .deal-timeline-event__marker {
  width: 0.95rem;
  height: 0.95rem;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 12px 28px -28px rgba(59, 130, 246, 0.6);
}

.deal-timeline-event--muted .deal-timeline-event__marker {
  border-color: rgba(148, 163, 184, 0.45);
  background: rgba(148, 163, 184, 0.18);
  box-shadow: none;
}

[data-theme="dark"] .deal-timeline-event__marker {
  background: var(--deal-timeline-surface);
  box-shadow: 0 16px 40px -30px rgba(15, 23, 42, 0.85);
}

[data-theme="dark"] .deal-timeline-event--muted .deal-timeline-event__marker {
  background: rgba(51, 65, 85, 0.6);
}

.deal-tracker-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.deal-tracker-participants__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.deal-tracker-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.deal-tracker-table thead th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--panel-border-color);
}

.deal-tracker-table tbody td {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  vertical-align: top;
}

.deal-tracker-table tbody tr:last-child td {
  border-bottom: none;
}

.deal-tracker-role-select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--panel-border-color);
  background: var(--bg-color);
  color: inherit;
}

.deal-tracker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.deal-message-card {
  border: 1px solid var(--deal-timeline-border);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 12px 30px -24px rgba(15, 23, 42, 0.35);
}

[data-theme="dark"] .deal-message-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.85));
  border-color: var(--deal-timeline-border);
}

.deal-message-card__meta {
  font-size: 0.8rem;
  color: var(--muted-text-color);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.deal-message-card__subject {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.deal-message-card__body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-line;
}

.deal-message-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.deal-message-card__footer {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted-text-color);
}

.deal-thread {
  border: 1px solid var(--deal-timeline-border);
  border-radius: 14px;
  padding: 0.4rem 0.75rem 0.75rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 245, 249, 0.8));
  box-shadow: 0 12px 30px -24px rgba(15, 23, 42, 0.35);
}

[data-theme="dark"] .deal-thread {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.85));
  border-color: var(--deal-timeline-border);
}

.deal-thread summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.5rem 0;
}

.deal-thread__messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.deal-tracker-rules {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.deal-tracker-rules__form {
  display: grid;
  gap: 0.75rem;
}

.deal-tracker-rules__form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
}

.deal-tracker-rules__form input,
.deal-tracker-rules__form select {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--panel-border-color);
  background: var(--bg-color);
  color: inherit;
}

.deal-tracker-rules__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.deal-rule-card {
  border: 1px dashed var(--panel-border-color);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.deal-rule-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.deal-message-card--removed {
  border-style: dashed;
  opacity: 0.85;
}

.deal-tracker-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.deal-input {
  width: 100%;
}

.deal-input--textarea {
  min-height: 6rem;
  resize: vertical;
}
