/* ── Discovery hero ──────────────────────────────────────────────────────────── */

.tb-discovery-hero {
  background: linear-gradient(160deg, #1a2f1e 0%, #2d4a32 60%, #3a5a40 100%);
  color: #fff;
  padding: 2.25rem 0 2rem;
}

.tb-discovery-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.tb-discovery-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.tb-discovery-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: .2rem;
}

.tb-discovery-subtitle {
  font-size: .9rem;
  opacity: .75;
  margin: 0;
}

.tb-discovery-nav {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
  padding-top: .35rem;
}

.tb-hero-btn {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
}
.tb-hero-btn:hover {
  background: rgba(255,255,255,.25);
  color: #fff;
  border-color: rgba(255,255,255,.5);
}

.tb-hero-btn-ghost {
  background: none;
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.2);
}
.tb-hero-btn-ghost:hover {
  color: #fff;
  border-color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.08);
}

/* ── Search bar (inside hero) ─────────────────────────────────────────────────── */

.tb-search-form {
  display: flex;
  gap: .5rem;
  width: 100%;
  max-width: 620px;
}

.tb-search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.5);
  pointer-events: none;
}

.tb-search-input {
  padding-left: 2.25rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
}
.tb-search-input::placeholder { color: rgba(255,255,255,.5); }
.tb-search-input:focus {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.5);
  color: #fff;
  box-shadow: 0 0 0 .2rem rgba(255,255,255,.1);
}

/* ── Discovery grid — centred flex so few cards don't hug the left ────────────── */

.tb-discovery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  padding-top: .25rem;
}

/* ── Buddy card ──────────────────────────────────────────────────────────────── */

.tb-buddy-card {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  padding: 1.5rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .6rem;
  width: 240px;
  flex: 0 1 240px;
  min-height: 220px;
  transition: box-shadow .15s, transform .15s;
}

.tb-buddy-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

/* ── Avatar ──────────────────────────────────────────────────────────────────── */

.tb-buddy-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary) 0%, #2d7a45 100%);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,60,.25);
}

.tb-buddy-avatar-sm {
  width: 36px;
  height: 36px;
  font-size: .95rem;
}

.tb-buddy-name {
  font-weight: 700;
  font-size: .95rem;
}

.tb-buddy-bio {
  font-size: .82rem;
  color: var(--clr-muted);
  margin: 0;
  line-height: 1.5;
  flex: 1;
}

.tb-buddy-bio--empty {
  font-style: italic;
  opacity: .5;
}

.tb-buddy-actions {
  margin-top: auto;
  padding-top: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .4rem;
}

/* ── Travel style tags ────────────────────────────────────────────────────────── */

.tb-style-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  justify-content: center;
}

.tb-style-tag {
  background: var(--clr-primary-pale);
  color: var(--clr-primary);
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .55rem;
  border-radius: var(--r-pill);
}

/* ── Non-TB user fallback result ─────────────────────────────────────────────── */

.tb-non-tb-result {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  max-width: 420px;
  margin: 1rem auto 0;
}

/* ── Connection list ──────────────────────────────────────────────────────────── */

.tb-conn-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tb-conn-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--clr-border);
}

.tb-conn-item:last-child {
  border-bottom: none;
}

.tb-conn-info {
  flex: 1;
  min-width: 0;
}

.tb-conn-name {
  font-weight: 600;
  font-size: .95rem;
}

.tb-conn-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}

/* ── Recipient selector (share forms) ─────────────────────────────────────────── */

.tb-recipient-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.tb-recipient-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .85rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.tb-recipient-row:has(input:checked) {
  border-color: var(--clr-primary);
  background: var(--clr-primary-pale);
}

.tb-recipient-row input[type="radio"] {
  margin: 0;
}

/* ── Shared-with-me list ──────────────────────────────────────────────────────── */

.tb-share-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tb-share-item {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--clr-border);
}

.tb-share-item:last-child {
  border-bottom: none;
}

.tb-share-info {
  flex: 1;
  min-width: 0;
}

.tb-share-title {
  font-weight: 600;
  color: var(--clr-primary);
  text-decoration: none;
}

.tb-share-title:hover {
  text-decoration: underline;
}

.tb-share-message {
  font-size: .83rem;
  color: var(--clr-muted);
  margin: .3rem 0 .2rem;
  font-style: italic;
}

/* ── Not-discoverable banner ─────────────────────────────────────────────────── */

.tb-undiscoverable-banner {
  background: #fff3cd;
  border-bottom: 1px solid #ffc107;
  color: #664d03;
  padding: .65rem 0;
  font-size: .875rem;
}

/* ── Two-column discovery layout ─────────────────────────────────────────────── */

.tb-discovery-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.75rem;
  align-items: start;
}

.tb-discovery-main {
  min-width: 0;
}

/* ── Your Travel Buddies sidebar panel ───────────────────────────────────────── */

.tb-buddies-panel {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  overflow: hidden;
  position: sticky;
  top: 1.5rem;
}

.tb-buddies-panel-header {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 700;
  font-size: .9rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--clr-border);
  background: var(--clr-primary-pale);
  color: var(--clr-primary);
}

.tb-buddies-count {
  margin-left: auto;
  background: var(--clr-primary);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  border-radius: var(--r-pill);
  padding: .1rem .45rem;
}

.tb-buddies-list {
  display: flex;
  flex-direction: column;
}

.tb-buddy-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--clr-border);
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}

.tb-buddy-row:last-child {
  border-bottom: none;
}

.tb-buddy-row:hover {
  background: var(--clr-primary-pale);
  text-decoration: none;
  color: inherit;
}

.tb-buddy-row-info {
  flex: 1;
  min-width: 0;
}

.tb-buddy-row-name {
  font-weight: 600;
  font-size: .875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tb-buddy-row-styles {
  font-size: .75rem;
  color: var(--clr-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tb-buddy-row-msg {
  flex-shrink: 0;
  color: var(--clr-muted);
  font-size: 1rem;
  padding: .2rem .35rem;
  border-radius: var(--r-sm);
  transition: color .12s, background .12s;
}

.tb-buddy-row-msg:hover {
  color: var(--clr-primary);
  background: rgba(0,0,0,.06);
}

.tb-buddies-panel-footer {
  padding: .75rem 1rem;
  border-top: 1px solid var(--clr-border);
}

.tb-buddies-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--clr-muted);
}

.tb-buddies-empty i {
  font-size: 1.75rem;
  display: block;
  margin-bottom: .5rem;
  opacity: .4;
}

.tb-buddies-empty p {
  font-size: .82rem;
  margin: 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .tb-discovery-layout {
    grid-template-columns: 1fr;
  }
  .tb-buddies-panel {
    position: static;
    /* Move panel above the grid on smaller screens */
    order: -1;
  }
  .tb-buddies-list {
    /* Horizontal scroll row on tablet */
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tb-buddies-list::-webkit-scrollbar { display: none; }
  .tb-buddy-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: .3rem;
    min-width: 90px;
    padding: .65rem .75rem;
    border-bottom: none;
    border-right: 1px solid var(--clr-border);
  }
  .tb-buddy-row:last-child { border-right: none; }
  .tb-buddy-row-styles { display: none; }
  .tb-buddy-row-msg { display: none; }
}

@media (max-width: 576px) {
  .tb-discovery-hero { padding: 1.5rem 0 1.25rem; }
  .tb-discovery-title { font-size: 1.55rem; }
  .tb-discovery-hero-top { flex-direction: column; gap: .75rem; }
  .tb-discovery-nav { padding-top: 0; }
  .tb-search-form { max-width: 100%; }
  .tb-buddy-card { width: 100%; flex: 1 1 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Settings page
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.tb-settings-hero {
  background: linear-gradient(160deg, #1a2f1e 0%, #2d4a32 60%, #3a5a40 100%);
  padding: 2rem 0 2.25rem;
}

.tb-settings-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Light breadcrumb override inside hero */
.tb-settings-hero .te-breadcrumb li a,
.tb-settings-hero .te-breadcrumb li.active {
  color: rgba(255, 255, 255, .6);
}
.tb-settings-hero .te-breadcrumb li a:hover { color: #fff; }
.tb-settings-hero .te-breadcrumb li + li::before { color: rgba(255, 255, 255, .35); }

.tb-settings-hero-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tb-settings-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
}

.tb-settings-hero-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 .2rem;
  line-height: 1.2;
}

.tb-settings-hero-sub {
  font-size: .88rem;
  color: rgba(255, 255, 255, .65);
  margin: 0;
}

/* ── Page body constraint ─────────────────────────────────────────────────── */

.tb-settings-body {
  max-width: 800px;
  margin-inline: auto;
}

/* ── Status card ─────────────────────────────────────────────────────────── */

.tb-settings-status {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-left: 4px solid var(--clr-border-strong);
  border-radius: var(--r-md);
  padding: 1.35rem 1.5rem;
  margin-top: 1.5rem;
}

.tb-settings-status--active {
  border-left-color: var(--clr-primary);
  background: var(--clr-primary-pale);
}

.tb-settings-status-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--clr-muted);
  flex-shrink: 0;
}

.tb-settings-status--active .tb-settings-status-icon-wrap {
  background: var(--clr-primary);
  border-color: transparent;
  color: #fff;
}

.tb-settings-status-body {
  flex: 1;
  min-width: 0;
}

.tb-settings-status-text {
  font-size: .84rem;
  color: var(--clr-text-mid);
  margin: 0;
  line-height: 1.5;
}

.tb-settings-status-action {
  flex-shrink: 0;
}

/* ── Inner padding for te-section on settings page ───────────────────────── */

.tb-settings-body .te-section {
  padding: 1.75rem 2rem;
}

@media (max-width: 640px) {
  .tb-settings-body .te-section { padding: 1.25rem 1.25rem; }
}

/* ── Profile section header ───────────────────────────────────────────────── */

.tb-settings-section-head {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: .25rem;
}

.tb-settings-section-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--clr-primary-pale);
  color: var(--clr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Inactive hint banner ─────────────────────────────────────────────────── */

.tb-settings-hint {
  display: flex;
  align-items: flex-start;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--r-sm);
  color: #1e40af;
  font-size: .84rem;
  padding: .75rem 1rem;
  line-height: 1.5;
}

.tb-settings-hint i { margin-top: .1rem; }

/* ── Share toggle row ─────────────────────────────────────────────────────── */

.tb-settings-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  padding: 1.1rem 1.25rem;
}

.tb-settings-toggle-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--clr-primary-pale);
  color: var(--clr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: .1rem;
}

.tb-settings-toggle-body {
  flex: 1;
  min-width: 0;
}

/* ── Quick action link cards ──────────────────────────────────────────────── */

.tb-settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.tb-settings-action-card {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, border-color .15s, background .15s;
}

.tb-settings-action-card:hover {
  border-color: var(--clr-primary);
  background: var(--clr-primary-pale);
  box-shadow: var(--sh-sm);
  color: inherit;
  text-decoration: none;
}

.tb-settings-action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--clr-primary-pale);
  color: var(--clr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tb-settings-action-icon--accent {
  background: var(--clr-accent-pale);
  color: var(--clr-accent);
}

.tb-settings-action-body {
  flex: 1;
  min-width: 0;
}

/* ── Settings responsive ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .tb-settings-hero { padding: 1.5rem 0 1.75rem; }
  .tb-settings-hero-title { font-size: 1.45rem; }
  .tb-settings-hero-sub { font-size: .82rem; }

  .tb-settings-status {
    flex-wrap: wrap;
    gap: .75rem;
  }
  .tb-settings-status-action { width: 100%; }
  .tb-settings-status-action .btn { width: 100%; }

  .tb-settings-actions { grid-template-columns: 1fr; }

  .tb-settings-toggle-row { flex-wrap: wrap; gap: .65rem; }
  .tb-settings-toggle-row .form-check { width: 100%; }
}
