/* Thrive plan compare — shared by Marketplace Directory + Plan Finder.
   Relies on brand tokens (--forest, --sage-lt, --cloud, --navy, --body-gray,
   --lt-border, --black, --font-head, --font-body, --radius-*). Falls back if missing. */

.tc-root {
  --tc-forest: var(--forest, #1F5C42);
  --tc-forest-d: var(--forest-d, #163f2e);
  --tc-sage: var(--sage-lt, #EEF4F1);
  --tc-cloud: var(--cloud, #F5F6F8);
  --tc-navy: var(--navy, #162B3B);
  --tc-body: var(--body-gray, #4B5563);
  --tc-border: var(--lt-border, #E5E7EB);
  --tc-black: var(--black, #0F1B14);
  --tc-head: var(--font-head, 'Plus Jakarta Sans', system-ui, sans-serif);
  --tc-body-font: var(--font-body, Inter, system-ui, sans-serif);
  --tc-radius: var(--radius-md, 14px);
  --tc-pill: var(--radius-pill, 999px);
  --tc-amber: #D9A441;
  --tc-amber-bg: #FFF7E6;
  font-family: var(--tc-body-font);
  color: var(--tc-black);
}

/* —— Add button on cards / rows —— */
.tc-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1.5px solid var(--tc-forest);
  background: #fff;
  color: var(--tc-forest);
  font: 700 13px/1.2 var(--tc-head);
  border-radius: var(--tc-pill);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.tc-add:hover { background: var(--tc-sage); }
.tc-add:focus-visible { outline: 2px solid var(--tc-forest); outline-offset: 2px; }
.tc-add[aria-pressed="true"],
.tc-add.is-added {
  background: var(--tc-forest);
  color: #fff;
  border-color: var(--tc-forest);
}
.tc-add:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.tc-add--row {
  margin: 0;
  padding: 6px 12px;
  white-space: nowrap;
}

/* —— Sticky tray —— */
.tc-tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  background: #fff;
  border-top: 1px solid var(--tc-border);
  box-shadow: 0 -8px 28px rgba(15, 27, 20, .12);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateY(110%);
  transition: transform .22s ease;
}
.tc-tray.is-open { transform: translateY(0); }
.tc-tray-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 20px;
  align-items: center;
}
.tc-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.tc-slot {
  min-height: 64px;
  border: 1.5px dashed var(--tc-border);
  border-radius: var(--tc-radius);
  background: var(--tc-cloud);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  position: relative;
}
.tc-slot.is-filled {
  border-style: solid;
  border-color: var(--tc-forest);
  background: #fff;
}
.tc-slot-empty {
  font-size: 13px;
  font-weight: 600;
  color: var(--tc-body);
  text-align: center;
}
.tc-slot-metal {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tc-forest);
}
.tc-slot-name {
  font-family: var(--tc-head);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--tc-black);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tc-slot-issuer {
  font-size: 12px;
  color: var(--tc-body);
}
.tc-slot-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--tc-body);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.tc-slot-x:hover { background: var(--tc-sage); color: var(--tc-black); }

.tc-tray-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.tc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: var(--tc-pill);
  border: 0;
  font: 700 14px/1.2 var(--tc-head);
  cursor: pointer;
  text-decoration: none;
}
.tc-btn:focus-visible { outline: 2px solid var(--tc-forest); outline-offset: 2px; }
.tc-btn--primary {
  background: var(--tc-forest);
  color: #fff;
}
.tc-btn--primary:hover { background: var(--tc-forest-d); }
.tc-btn--primary:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.tc-btn--ghost {
  background: #fff;
  color: var(--tc-forest);
  border: 1.5px solid var(--tc-border);
}
.tc-btn--ghost:hover { border-color: var(--tc-forest); background: var(--tc-sage); }
.tc-btn--link {
  background: transparent;
  color: var(--tc-body);
  padding: 8px 10px;
  font-weight: 600;
  font-size: 13px;
}
.tc-btn--link:hover { color: var(--tc-black); }

.tc-tray-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--tc-body);
}

/* —— Overlay (picker + panel) —— */
.tc-tray.tc-tray--parked,
.tc-tray.tc-tray--parked.is-open {
  transform: translateY(110%) !important;
  pointer-events: none !important;
}
.tc-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(15, 27, 20, .45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.tc-overlay.is-open { display: flex; }
.tc-sheet {
  width: min(960px, 100%);
  max-height: min(94vh, 860px);
  height: min(94vh, 860px);
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 40px rgba(15, 27, 20, .2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 860px) {
  .tc-overlay { align-items: center; padding: 24px; }
  .tc-sheet {
    border-radius: var(--tc-radius);
    max-height: min(88vh, 820px);
    height: auto;
  }
}
.tc-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--tc-border);
}
.tc-sheet-head h2 {
  margin: 0;
  font-family: var(--tc-head);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.tc-sheet-sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--tc-body);
}
.tc-sheet-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--tc-cloud);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--tc-black);
}
.tc-sheet-close:hover { background: var(--tc-sage); }
.tc-sheet-body {
  padding: 16px 20px 24px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.tc-sheet-foot {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--tc-border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  background: #fff;
}

/* —— Picker —— */
.tc-steps {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.tc-steps li {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--tc-body);
  padding: 6px 10px;
  border-radius: var(--tc-pill);
  background: var(--tc-cloud);
}
.tc-steps li.is-active {
  background: var(--tc-sage);
  color: var(--tc-forest);
}
.tc-search {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1.5px solid var(--tc-border);
  border-radius: var(--tc-radius);
  font: 400 15px/1.3 var(--tc-body-font);
  margin-bottom: 12px;
}
.tc-search:focus {
  outline: none;
  border-color: var(--tc-forest);
  box-shadow: 0 0 0 3px rgba(31, 92, 66, .15);
}
.tc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tc-list-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--tc-border);
  background: #fff;
  border-radius: var(--tc-radius);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tc-list-btn:hover,
.tc-list-btn:focus-visible {
  border-color: var(--tc-forest);
  background: var(--tc-sage);
}
.tc-list-btn strong {
  font-family: var(--tc-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--tc-black);
}
.tc-list-btn span {
  font-size: 13px;
  color: var(--tc-body);
}
.tc-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--tc-body);
}
.tc-back {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--tc-forest);
  font: 700 13px/1.3 var(--tc-head);
  cursor: pointer;
}
.tc-empty {
  margin: 18px 0;
  text-align: center;
  color: var(--tc-body);
  font-size: 14px;
}

/* —— Compare panel table —— */
.tc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius);
  background: #fff;
}
.tc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  font-size: 14px;
}
.tc-table th,
.tc-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--tc-border);
  vertical-align: top;
  text-align: left;
}
.tc-table thead th {
  background: var(--tc-sage);
  font-family: var(--tc-head);
  font-weight: 800;
  font-size: 14px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.tc-table th:first-child,
.tc-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--tc-cloud);
  font-weight: 700;
  color: var(--tc-body);
  min-width: 118px;
  box-shadow: 1px 0 0 var(--tc-border);
}
.tc-table thead th:first-child {
  background: var(--tc-sage);
  z-index: 3;
}
.tc-table tbody tr:last-child td { border-bottom: 0; }
.tc-table .tc-diff {
  background: var(--tc-amber-bg);
}
.tc-table .tc-diff:first-child {
  background: #FCEFD3;
}
.tc-plan-head-metal {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tc-forest);
  margin-bottom: 2px;
}
.tc-plan-head-name {
  display: block;
  font-size: 15px;
  line-height: 1.3;
}
.tc-plan-head-issuer {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--tc-body);
  margin-top: 2px;
}
.tc-disclaimer {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--tc-body);
  line-height: 1.5;
}
.tc-disclaimer a {
  color: var(--tc-forest);
  font-weight: 700;
}

/* Body padding so tray does not cover content */
body.tc-has-tray {
  padding-bottom: 120px;
}
@media (max-width: 640px) {
  .tc-tray-inner { grid-template-columns: 1fr; }
  .tc-slots { grid-template-columns: 1fr; }
  .tc-slot { min-height: 52px; }
  .tc-tray-actions { justify-content: stretch; }
  .tc-tray-actions .tc-btn { flex: 1 1 auto; }
  body.tc-has-tray { padding-bottom: 280px; }
}
