/**
 * Billing, Profile, Settings — cards and forms (system light/dark via therabee-web-variables.css).
 */

.billing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
  width: 100%;
  max-width: none;
  align-items: start;
}

/* Usage card spans full width; Promo/Payment/Pricing share the next row; Plan is full width below. */
.billing-grid > .billing-box:first-child {
  grid-column: 1 / -1;
}

.billing-box-full {
  grid-column: 1 / -1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1100px) {
  .billing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .billing-grid {
    grid-template-columns: 1fr;
  }
}

.billing-box,
.profile-box,
.settings-box {
  background: var(--tb-surface);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--tb-shadow-float);
  border: 1px solid var(--tb-border);
  color: var(--tb-text);
}

.billing-box h2,
.profile-box h2,
.settings-box h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--tb-text);
}

.profile-box h2,
.settings-box h2 {
  margin-bottom: 12px;
}

.plan-price {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--tb-text);
}

.plan-price span {
  font-size: 14px;
  color: var(--tb-text-muted);
}

.plan-badge {
  background: var(--tb-badge-user-bg);
  color: var(--tb-badge-user-text);
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  margin-left: 8px;
}

.plan-renewal {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 13px;
  color: var(--tb-text-muted);
}

.plan-renewal--compact {
  margin-top: 8px;
}

.plan-renewal__pending {
  color: var(--tb-text-soft);
  font-weight: 600;
  text-align: right;
  max-width: 58%;
}

.plan-renewal-hint {
  margin-top: 8px;
  margin-bottom: 0;
}

.invoice-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 4px -4px 0;
  padding: 0 4px;
}

.invoice-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--tb-text-soft);
}

.invoice-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--tb-text-soft);
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--tb-border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.invoice-table td {
  padding: 14px 16px;
  border-top: 1px solid var(--tb-border);
  vertical-align: middle;
}

.invoice-table tbody tr:first-child td {
  border-top-color: var(--tb-border);
}

.invoice-table .invoice-col-num {
  max-width: 180px;
}

.invoice-table .invoice-cell-num {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-table .invoice-col-nowrap {
  white-space: nowrap;
}

.billing-deleted-notes {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--tb-border);
}

.billing-deleted-notes__title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tb-text);
}

.billing-deleted-notes__intro {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
}

.billing-deleted-notes-table td,
.billing-deleted-notes-table th {
  font-size: 12px;
}

.invoice-th-action {
  width: 1%;
  padding-right: 8px !important;
}

.invoice-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--tb-badge-pill-bg);
  color: var(--tb-text-soft);
}

.invoice-status-badge--paid {
  background: var(--tb-status-success-bg);
  color: var(--tb-status-success-text);
}

.billing-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--tb-orange-btn-text);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--tb-border);
  background: var(--tb-surface);
  display: inline-block;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.billing-link:hover {
  background: var(--tb-warm-tint2);
  border-color: var(--tb-orange-btn);
  color: var(--tb-orange-btn-text);
}

.payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.billing-btn {
  background: var(--tb-orange-btn);
  color: var(--tb-orange-btn-text);
  border: none;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.billing-btn:hover {
  background: var(--tb-orange-btn-hover-bg);
  color: var(--tb-orange-btn-hover-text);
}

.billing-btn-secondary {
  background: var(--tb-surface);
  color: var(--tb-text-muted);
  border: 1px solid var(--tb-border);
}

.billing-btn-secondary:hover {
  background: var(--tb-control-bg);
}

.billing-grid hr {
  margin: 10px 0;
  border: none;
  border-top: 1px solid var(--tb-border);
}

.note-muted {
  font-size: 12px;
  color: var(--tb-text-muted);
  margin-top: 4px;
}

.note-muted--danger {
  color: var(--tb-alert-danger-text);
  font-weight: 600;
}

.note-muted--warning {
  color: var(--tb-alert-warning-text);
  font-weight: 600;
}

.note-muted--info {
  color: var(--tb-badge-user-text);
  font-weight: 600;
}

.billing-features-list {
  padding-left: 16px;
  margin: 8px 0;
  font-size: 13px;
  color: var(--tb-text-soft);
}

.billing-outstanding-title {
  margin: 10px 0 4px;
  font-weight: 600;
  color: var(--tb-alert-danger-text);
}

.billing-outstanding-title--info {
  color: var(--tb-badge-user-text);
}

.billing-outstanding-list {
  margin-top: 8px;
}

.billing-outstanding-body {
  margin-top: 0;
  color: var(--tb-text-soft);
}

.billing-outstanding {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--tb-alert-danger-bg);
  border: 1px solid var(--tb-alert-danger-border);
  border-radius: 10px;
}

.billing-outstanding h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--tb-alert-danger-text);
}

.billing-outstanding ul {
  margin: 8px 0 0 18px;
  padding: 0;
  font-size: 13px;
  color: var(--tb-text-soft);
}

.billing-outstanding-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.settings-text--danger {
  color: var(--tb-alert-danger-text);
  font-weight: 600;
}

.settings-text--warning {
  color: var(--tb-alert-warning-text);
  font-weight: 600;
}

.settings-text--info {
  color: var(--tb-badge-user-text);
  font-weight: 600;
}

.settings-delete-summary {
  margin: 12px 0 0;
  color: var(--tb-text-soft);
}

.settings-delete-summary-title {
  margin: 0 0 6px;
  font-weight: 600;
}

.settings-delete-summary-title--danger {
  color: var(--tb-alert-danger-text);
}

.settings-delete-list {
  margin: 0 0 14px 18px;
  padding: 0;
}

/* Profile */
.profile-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
  margin-top: 20px;
  max-width: 900px;
}

.profile-grid > div {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 13px;
}

.profile-field label {
  color: var(--tb-text-muted);
}

.profile-field input {
  border: 1px solid var(--tb-border);
  border-radius: 6px;
  padding: 8px;
  font-size: 14px;
  background: var(--tb-surface);
  color: var(--tb-text);
}

.profile-field input:disabled {
  background: var(--tb-control-bg);
  color: var(--tb-text-muted);
}

.save-profile-btn {
  margin-top: 10px;
  background: var(--tb-orange-btn);
  color: var(--tb-orange-btn-text);
  border: none;
  border-radius: 10px;
  padding: 7px 12px;
  min-height: 34px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: none;
  float: right;
  cursor: pointer;
}

.save-profile-btn:hover {
  background: var(--tb-orange-btn-hover-bg);
}

.profile-password {
  background: var(--tb-primary);
  color: var(--tb-on-primary);
  border: none;
  border-radius: 10px;
  padding: 7px 12px;
  min-height: 34px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: none;
  width: fit-content;
  margin-top: 8px;
}

.profile-password:hover {
  background: var(--tb-primary-hover);
}

.profile-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

.profile-stat {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--tb-hr);
}

.profile-stat:last-child {
  border-bottom: none;
}

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
  margin-top: 20px;
  width: 100%;
  max-width: none;
}

.settings-grid--equal {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.settings-grid--equal > div,
.settings-grid--equal .settings-box {
  height: 100%;
}

.settings-grid > div {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  font-size: 13px;
}

.settings-field label {
  color: var(--tb-text-muted);
}

.settings-field select,
.settings-field input[type="password"],
.settings-field input[type="text"],
.settings-field input[type="email"] {
  border: 1px solid var(--tb-border);
  border-radius: 6px;
  padding: 8px;
  font-size: 14px;
  background: var(--tb-surface);
  color: var(--tb-text);
}

.settings-password-form {
  clear: both;
}

.settings-checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: var(--tb-text);
}

.settings-text {
  margin-top: 6px;
  color: var(--tb-text-muted);
  font-size: 12px;
}

.settings-save {
  margin-top: 10px;
  background: var(--tb-orange-btn);
  color: var(--tb-orange-btn-text);
  border: none;
  border-radius: 10px;
  padding: 7px 12px;
  min-height: 34px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: none;
  float: right;
  cursor: pointer;
}

.settings-save:hover {
  background: var(--tb-orange-btn-hover-bg);
}

.settings-save--secondary {
  float: none;
  background: transparent;
  color: var(--tb-text);
  border: 1px solid var(--tb-border);
  box-shadow: none;
}

.settings-save--secondary:hover {
  background: var(--tb-surface-muted, var(--tb-surface));
}

.settings-save:disabled,
.settings-save--secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.settings-danger-zone {
  border-color: var(--tb-alert-danger-border);
  background: var(--tb-alert-danger-bg);
  width: 100%;
  max-width: none;
  margin-top: 24px;
}

.settings-danger-zone h2 {
  color: var(--tb-alert-danger-text);
}

.btn-danger-outline {
  margin-top: 10px;
  background: var(--tb-surface);
  color: var(--tb-red-deep);
  border: 1px solid var(--tb-red-deep);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger-outline:hover {
  background: var(--tb-fee-bg);
}

.btn-pay-outstanding {
  margin-top: 10px;
  margin-right: 10px;
  background: var(--tb-orange-btn);
  color: var(--tb-orange-btn-text);
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-pay-outstanding:hover {
  background: var(--tb-orange-btn-hover-bg);
}

.settings-delete-dialog {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  width: min(520px, calc(100vw - 2rem));
  max-height: min(90vh, calc(100vh - 2rem));
  height: fit-content;
  overflow-y: auto;
  border: 1px solid var(--tb-border);
  border-radius: 12px;
  padding: 0;
  box-shadow: var(--tb-shadow-modal);
  background: var(--tb-surface);
  color: var(--tb-text);
}

.settings-delete-dialog::backdrop {
  background: var(--tb-backdrop);
}

.settings-delete-dialog-inner {
  padding: 20px 22px;
}

.settings-delete-dialog h3 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
  color: var(--tb-text);
}

.settings-delete-dialog .settings-text {
  margin-top: 0;
}

.settings-delete-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.settings-delete-dialog a {
  color: var(--tb-teal-link);
}

.billing-outstanding-body--spaced {
  margin-top: 8px;
}

.btn-danger-outline--neutral {
  border-color: var(--tb-border);
  color: var(--tb-text-soft);
}

.btn-pay-outstanding--link {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
}

@media (max-width: 768px) {
  .profile-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Billing usage banner (dashboard lists, recording, billing) */
.tb-billing-usage-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--tb-border);
  background: var(--tb-surface);
  font-size: 13px;
  line-height: 1.45;
  color: var(--tb-text-soft);
}

.tb-billing-usage-banner__message {
  margin: 0;
  color: inherit;
}

.tb-billing-usage-banner__message strong {
  color: var(--tb-text);
  font-weight: 600;
}

.tb-billing-usage-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  flex-shrink: 0;
}

.tb-billing-usage-banner__cta {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--tb-primary);
  color: var(--tb-on-primary, #fff);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.tb-billing-usage-banner__cta:hover {
  filter: brightness(1.05);
  color: var(--tb-on-primary, #fff);
}

.tb-billing-usage-banner__link {
  font-size: 13px;
  font-weight: 500;
  color: var(--tb-primary);
  text-decoration: none;
}

.tb-billing-usage-banner__link:hover {
  text-decoration: underline;
}

.tb-billing-usage-banner--trial,
.tb-billing-usage-banner--trial_low {
  border-color: color-mix(in srgb, var(--tb-primary) 25%, var(--tb-border));
  background: color-mix(in srgb, var(--tb-primary) 6%, var(--tb-surface));
}

.tb-billing-usage-banner--trial_exhausted {
  border-color: var(--tb-border);
  background: var(--tb-control-bg);
}

.tb-billing-usage-banner--paywall {
  border-color: var(--tb-alert-warning-border);
  background: var(--tb-alert-warning-bg);
  color: var(--tb-alert-warning-text);
}

.tb-billing-usage-banner--paywall .tb-billing-usage-banner__message strong {
  color: var(--tb-alert-warning-text);
}

.tb-billing-usage-banner--paid_active {
  border-color: var(--tb-border);
  background: var(--tb-control-bg);
}

.tb-billing-usage-banner__submessage {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--tb-text-muted);
}

.tb-billing-usage-banner__submessage strong {
  color: var(--tb-text-soft);
  font-weight: 600;
}

.tb-billing-usage-banner--premium-upsell {
  border-color: color-mix(in srgb, var(--tb-primary) 22%, var(--tb-border));
}

button.tb-billing-usage-banner__cta {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-nav-ask-bea-link {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Settings Plan card — clear status + optional compare block */
.billing-box--plan > h3 {
  margin-bottom: 14px;
}

.billing-plan-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.billing-plan-summary__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--tb-border, #e5e2dc);
}

.billing-plan-summary__current {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.billing-plan-summary__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--tb-text-muted, #6b7280);
}

.billing-plan-summary__renewal {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: var(--tb-text-muted, #6b7280);
}

.billing-plan-summary__renewal strong {
  color: var(--tb-text, #1f2937);
  font-weight: 600;
}

.billing-plan-summary__renewal-label {
  font-weight: 500;
}

.billing-plan-summary__renewal--cancel strong {
  color: #b45309;
}

.billing-plan-summary__copy {
  margin: 0;
  max-width: 72ch;
  line-height: 1.5;
}

.billing-plan-summary__price {
  margin: 0;
}

.billing-plan-summary__action {
  margin: 0;
}

.billing-plan-summary--basic + .premium-compare-compact--embedded {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--tb-border, #e5e2dc);
}

.billing-box--plan .plan-badge {
  margin-left: 0;
}

/* Settings Plan upsell (Basic users) — legacy compact card, kept for other surfaces */
.billing-plan-upsell {
  margin-top: 4px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--tb-surface, #ffffff), var(--tb-surface, #ffffff)) padding-box,
    var(--tb-ai-gradient, linear-gradient(135deg, #2c5f6f 0%, #7c3aed 52%, #e8783a 100%)) border-box;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--tb-heading, #2c5f6f) 8%, transparent);
}

.billing-plan-upsell__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.billing-plan-upsell__eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tb-text-muted, #6b7280);
}

.billing-plan-upsell__current-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--tb-text-muted, #6b7280);
  background: color-mix(in srgb, var(--tb-subtle-bg, #f8f7f3) 92%, var(--tb-surface, #fff));
  border: 1px solid var(--tb-border, #e5e2dc);
}

.billing-plan-upsell__title {
  margin: 0 0 12px;
  font-family: var(--tb-font-heading, Georgia, serif);
  font-size: 1.15rem;
  color: var(--tb-heading, #2c5f6f);
}

.billing-plan-upsell__highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.billing-plan-upsell__highlights li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--tb-ai-gradient-soft, linear-gradient(135deg, rgba(44, 95, 111, 0.14) 0%, rgba(124, 58, 237, 0.12) 52%, rgba(232, 120, 58, 0.14) 100%));
  font-size: 13px;
  line-height: 1.35;
  color: var(--tb-text-soft, #4b5563);
}

.billing-plan-upsell__highlights li strong {
  color: var(--tb-text, #1f2937);
  font-weight: 600;
}

.billing-plan-upsell__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--tb-status-success-text, #2eb885);
}

.billing-plan-upsell__subline {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--tb-text-muted, #6b7280);
}

.billing-plan-upsell__price {
  margin: 0 0 14px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--tb-heading, #2c5f6f);
}

.billing-plan-upsell__price span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--tb-text-muted, #6b7280);
}

.billing-plan-upsell__price-note {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tb-primary, #b17b7e);
}

.billing-plan-upsell__form {
  margin: 0 0 10px;
}

.billing-plan-upsell__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: var(--tb-primary, #b17b7e);
  color: var(--tb-on-primary, #ffffff);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--tb-primary, #b17b7e) 28%, transparent);
  transition: background 0.2s ease, filter 0.2s ease;
}

.billing-plan-upsell__cta:hover {
  background: var(--tb-primary-hover, #a15e61);
}

.billing-plan-upsell__cta-icon {
  width: 16px;
  height: 16px;
}

.billing-plan-upsell__secondary {
  display: inline-flex;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tb-heading, #2c5f6f);
  text-decoration: underline;
  cursor: pointer;
}

.billing-plan-upsell__unavailable {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--tb-alert-warning-bg, #fffbeb) 88%, transparent);
  border: 1px solid var(--tb-alert-warning-border, #fde68a);
  color: var(--tb-alert-warning-text, #92400e);
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .billing-plan-upsell__highlights {
    grid-template-columns: 1fr;
  }

  .billing-plan-summary__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Paywall message block (modal + locked note page) */
.tb-billing-paywall-message {
  margin-top: 4px;
}

.tb-billing-paywall-message__lead {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tb-text-soft);
}

.tb-billing-paywall-message__heading {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--tb-text);
}

.tb-billing-paywall-message__list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 13px;
  line-height: 1.55;
  color: var(--tb-text-soft);
}

.tb-billing-paywall-message__list li + li {
  margin-top: 4px;
}

/* Free notes progress (billing page) */
.tb-free-notes-progress {
  margin: 12px 0 8px;
}

.tb-free-notes-progress__track {
  height: 8px;
  border-radius: 999px;
  background: var(--tb-hr);
  overflow: hidden;
}

.tb-free-notes-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--tb-primary);
  transition: width 0.25s ease;
}

.tb-free-notes-progress__label {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--tb-text-muted);
}

.billing-payment-required-callout {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--tb-alert-warning-border);
  background: var(--tb-alert-warning-bg);
  color: var(--tb-alert-warning-text);
  font-size: 13px;
  line-height: 1.45;
}

.billing-payment-required-callout strong {
  font-weight: 600;
}

.billing-address-form {
  margin-top: 12px;
}

#billing-address:not(:empty) {
  margin-bottom: 16px;
}

.billing-address-label {
  display: block;
  margin: 8px 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tb-text-soft);
}

.billing-address-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 10px;
}

@media (max-width: 700px) {
  .billing-address-row {
    grid-template-columns: 1fr;
  }
}

/* Recording modal billing hint */
.recording-billing-hint {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--tb-text-muted);
}

.recording-billing-hint--warning {
  color: var(--tb-alert-warning-text);
}

.recording-billing-hint strong {
  color: var(--tb-text-soft);
  font-weight: 600;
}

/* Session list: payment required badge */
.processing-hint--payment-required {
  color: var(--tb-alert-warning-text);
  background: var(--tb-alert-warning-bg);
  border: 1px solid var(--tb-alert-warning-border);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

/* Sidebar billing action chip */
.sidebar-nav-billing-chip {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: var(--tb-alert-warning-bg);
  color: var(--tb-alert-warning-text);
  border: 1px solid var(--tb-alert-warning-border);
  flex-shrink: 0;
}

.sidebar-shell-billing-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--tb-text-soft);
  background: color-mix(in srgb, var(--tb-primary) 8%, var(--tb-surface));
  border: 1px solid var(--tb-border);
}

.sidebar-shell-billing-chip:hover {
  background: color-mix(in srgb, var(--tb-primary) 12%, var(--tb-surface));
  color: var(--tb-text);
}

.sidebar-shell-billing-chip--paywall {
  background: var(--tb-alert-warning-bg);
  border-color: var(--tb-alert-warning-border);
  color: var(--tb-alert-warning-text);
}

.settings-jump-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  font-size: 14px;
}

.settings-jump-nav a {
  color: var(--tb-primary);
  font-weight: 600;
  text-decoration: none;
}

.settings-jump-nav a:hover {
  text-decoration: underline;
}

.settings-jump-nav span {
  color: var(--tb-text-muted);
}

.settings-billing-section {
  margin-bottom: 32px;
}

.settings-billing-section > h2 {
  margin-bottom: 8px;
}

.settings-billing-section > .note {
  margin-bottom: 16px;
}

/* Profile photo */
.profile-photo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tb-border);
}

.profile-photo-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--tb-sidebar-accent);
  background: var(--tb-control-bg);
  color: var(--tb-sidebar-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-photo-preview .app-icon {
  font-size: 28px;
}

.profile-photo-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.profile-photo-meta p {
  margin: 0;
  font-size: 13px;
  color: var(--tb-text-muted);
  line-height: 1.4;
}

.profile-photo-btn {
  background: var(--tb-primary);
  color: var(--tb-on-primary);
  border: none;
  border-radius: 10px;
  padding: 7px 12px;
  min-height: 34px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  width: fit-content;
}

.profile-photo-btn:hover {
  background: var(--tb-primary-hover);
}

.profile-avatar-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
}

.profile-avatar-preview {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 2px solid var(--tb-sidebar-accent);
  background: var(--tb-control-bg, var(--tb-search-bg));
  color: var(--tb-sidebar-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-preview-icon {
  font-size: 48px;
}

.profile-avatar-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-avatar-choose {
  background: var(--tb-primary);
  color: var(--tb-on-primary);
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.profile-avatar-choose:hover {
  background: var(--tb-primary-hover);
}

.profile-avatar-error {
  margin: 0 0 12px;
  color: var(--tb-danger, #b42318);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.profile-avatar-actions {
  flex-wrap: wrap;
}

.profile-avatar-actions .client-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-avatar-remove {
  margin-right: auto;
}

