/* Shared texting inbox. Uses the design-refresh tokens when present, with fallbacks. */
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--violet, #5843ce);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.inbox-notice { margin-bottom: 16px; }
.panel.inbox {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  min-height: 520px;
  padding: 0;
  overflow: hidden;
}
.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-right: 1px solid var(--line-ui, var(--line, #e5e8df));
  min-width: 0;
}
.inbox-list-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inbox-list .search { width: 100%; }
.inbox-rows { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 560px; }
.inbox-row {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-ui, 12px);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.inbox-row:hover { background: var(--violet-50, #f3f1fd); }
.inbox-row:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--violet-ring, rgba(88, 67, 206, 0.35)); }
.inbox-row.active { background: var(--violet-100, #e7e3fb); }
.inbox-row-top { display: flex; justify-content: space-between; gap: 8px; }
.inbox-row-top time { color: var(--text-3, var(--muted, #747b73)); font-size: 12px; white-space: nowrap; }
.inbox-row.unread strong::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--violet, #5843ce);
  vertical-align: middle;
}
.inbox-row-preview {
  color: var(--text-2, var(--muted, #747b73));
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-row-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.inbox-row-meta:empty { display: none; }
.inbox-none { padding: 24px 12px; color: var(--text-3, var(--muted, #747b73)); text-align: center; }
.inbox-thread { display: flex; flex-direction: column; min-width: 0; }
.inbox-thread-empty { justify-content: center; }
.inbox-thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-ui, var(--line, #e5e8df));
}
.inbox-thread-head h2 { margin: 0; font-size: 17px; }
.inbox-thread-head p { margin: 2px 0 0; }
.inbox-thread-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.inbox-thread-actions select { max-width: 200px; }
.inbox-back { display: none; }
.inbox-back .icon { transform: rotate(180deg); }
.inbox-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 18px;
  list-style: none;
  overflow-y: auto;
  max-height: 520px;
}
.bubble {
  max-width: min(520px, 80%);
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--violet-50, #f3f1fd);
}
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.inbound { align-self: flex-start; border-bottom-left-radius: 4px; background: #f1f2f4; }
.bubble.outbound { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--violet, #5843ce); color: #fff; }
.bubble img { display: block; max-width: 100%; max-height: 320px; margin-top: 6px; border-radius: 10px; }
.bubble-kind { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; opacity: 0.8; }
.bubble-meta { display: block; margin-top: 4px; font-size: 11px; opacity: 0.75; }
.inbox-composer { padding: 12px 18px 16px; border-top: 1px solid var(--line-ui, var(--line, #e5e8df)); }
.inbox-composer textarea, .inbox-new textarea { width: 100%; resize: vertical; font: inherit; }
.inbox-composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.inbox-composer-note { padding: 12px 18px 16px; margin: 0; border-top: 1px solid var(--line-ui, var(--line, #e5e8df)); }
.inbox-new { display: grid; gap: 12px; padding: 18px; max-width: 560px; }
.inbox-settings { margin-top: 16px; padding: 16px 20px; }
.inbox-settings summary strong { font-size: 15px; }
.inbox-settings summary { cursor: pointer; list-style: none; }
.inbox-settings summary span { display: grid; gap: 2px; }
.inbox-settings form { display: grid; gap: 12px; margin-top: 14px; max-width: 640px; }
.inbox-settings .switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }

@media (max-width: 820px) {
  .panel.inbox { grid-template-columns: 1fr; min-height: 0; }
  .inbox-list { border-right: 0; }
  .panel.inbox.has-thread .inbox-list { display: none; }
  .panel.inbox:not(.has-thread) .inbox-thread { display: none; }
  .inbox-back { display: inline-flex; }
  .inbox-thread-head { flex-wrap: wrap; }
  .inbox-thread-actions { margin-left: 0; width: 100%; }
  .bubble { max-width: 88%; }
}

/* API & integrations hub */
.hub-tabs { margin-bottom: 16px; }
.hub-hero { margin-bottom: 18px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.hub-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line-ui, var(--line, #e5e8df));
  border-radius: var(--radius-ui, 12px);
  background: var(--paper, #fff);
  box-shadow: var(--shadow-1, none);
}
.hub-card h3 { margin: 0; font-size: 15px; }
.hub-card p { margin: 0; color: var(--text-2, var(--muted, #747b73)); font-size: 13px; }
.hub-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hub-category { font-size: 11px !important; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.hub-card-action { margin-top: auto; padding-top: 8px; }
.hub-requested { display: inline-flex; align-items: center; gap: 6px; color: var(--ok, #2f7d4f); font-weight: 600; font-size: 13px; }
.hub-requested .icon { width: 16px; height: 16px; }
.hub-pad { padding: 4px 0 12px; }
.hub-form { display: grid; gap: 12px; max-width: 680px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-ui, var(--line, #e5e8df)); }
.hub-form h3 { margin: 0; font-size: 15px; }
.hub-checks { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.hub-checks legend { margin-bottom: 6px; font-weight: 600; }
.hub-checks .check-option { display: flex; gap: 8px; align-items: flex-start; }
.hub-revoked td { opacity: 0.55; }
.hub-hooks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hub-hook { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-ui, var(--line, #e5e8df)); }
.hub-hook p { margin: 4px 0 0; }
.hub-hook-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.hub-secret { margin-bottom: 16px; align-items: flex-start; }
.hub-secret code { display: block; margin: 8px 0; padding: 10px 12px; border-radius: 8px; background: var(--violet-50, #f3f1fd); font-size: 13px; overflow-wrap: anywhere; user-select: all; }
.hub-secret-actions { display: flex; gap: 8px; }
.hub-docs { margin-top: 16px; }
.hub-docs pre { margin: 8px 0; padding: 12px 14px; border-radius: 10px; background: var(--navy, #1d1f3a); color: #f4f4fb; font-size: 12.5px; overflow-x: auto; }
@media (max-width: 820px) {
  .hub-hook { flex-direction: column; align-items: flex-start; }
  .hub-hook-actions { justify-content: flex-start; }
}
.panel > .hub-hooks, .panel > .hub-form, .panel > .hub-pad { padding-left: 20px; padding-right: 20px; }
.panel > .hub-form { padding-bottom: 20px; max-width: 720px; }
.hub-docs { padding: 18px 20px; }
.hub-docs h2 { margin-top: 0; }

/* Settings › Email notifications */
.notify-panel { margin: 18px 0; }
.notify-form { display: grid; gap: 8px; max-width: 640px; padding: 0 20px 20px; }
.notify-form .switch { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-top: 6px; }
.notify-form .field-help { margin: 0 0 6px; }
.notify-panel > .notice, .notify-panel > .field-help { margin: 0 20px 12px; }

/* Settings › Billing and Ring health (customer-promise) */
.billing-panel, .ringhealth-panel { margin: 18px 0; }
.billing-panel > :not(.panel-header), .ringhealth-panel > :not(.panel-header) { margin-left: 20px; margin-right: 20px; }
.billing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 4px; }
.billing-grid p { margin: 0; }
.billing-value { font-weight: 600; font-size: 15px; }
.billing-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.billing-leave { margin-top: 14px; }
.billing-leave summary { cursor: pointer; font-weight: 600; }
.billing-promise { list-style: none; padding: 0; display: grid; gap: 6px; margin-top: 14px; margin-bottom: 8px; }
.billing-promise li { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2, #4b4f66); }
.billing-promise .icon { width: 16px; height: 16px; color: var(--ok, #2f7d4f); flex: none; }
.billing-panel > .field-help:last-child, .ringhealth-panel > .ringhealth-note { margin-bottom: 20px; }
.ringhealth-intro { margin-top: 0; }
.ringhealth-list { list-style: none; padding: 0; margin-top: 8px; margin-bottom: 0; }
.ringhealth-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.3fr) minmax(220px, 1.4fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-ui, var(--line, #e5e8df)); }
.ringhealth-who, .ringhealth-state { display: grid; gap: 4px; }
.ringhealth-state .badge { justify-self: start; }
.ringhealth-backup { display: flex; gap: 6px; align-items: center; }
.ringhealth-backup input { min-width: 0; flex: 1; }
@media (max-width: 820px) { .ringhealth-row { grid-template-columns: 1fr; } }
/* Public promise page */
.promise-page { background: var(--bg, #f6f6f7); }
.promise-main { max-width: 1040px; margin: 0 auto; padding: 32px 16px 56px; }
.promise-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.promise-logo { display: inline-flex; color: var(--navy, #1d1f3a); }
.promise-lockup { height: 40px; width: auto; }
.promise-hero h1 { font-size: clamp(28px, 5vw, 44px); line-height: 1.1; margin: 8px 0 12px; }
.promise-lede { font-size: 18px; color: var(--text-2, #4b4f66); max-width: 640px; }
.promise-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 28px; }
.promise-card { padding: 20px 22px; border-top: 4px solid var(--maple-red, #d0021b); }
.promise-card h2 { margin: 0 0 8px; font-size: 18px; }
.promise-card p { margin: 0; line-height: 1.55; color: var(--text-2, #4b4f66); }
.promise-foot { margin-top: 28px; color: var(--text-3, #6b6f85); font-size: 13px; }
