* { box-sizing: border-box; }

body {
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  background: #f4f5f7;
  color: #1a1a1a;
}

header {
  background: #1a1a1a;
  color: #fff;
  padding: 1rem 1.5rem;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

header h1 {
  margin: 0;
  font-size: 1.25rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.role-badge {
  background: #374151;
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.role-badge.role-super_admin {
  background: #b45309;
}

.role-badge.role-team_admin {
  background: #1d4ed8;
}

.plan-usage-badge {
  background: #6366f1;
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.plan-usage-track {
  display: inline-block;
  width: 70px;
  height: 6px;
  border-radius: 999px;
  background: #374151;
  overflow: hidden;
}

.plan-usage-fill {
  display: block;
  height: 100%;
  background: #6366f1;
  border-radius: 999px;
}

.plan-usage-fill.plan-usage-fill-warn {
  background: #f59e0b;
}

.plan-usage-fill.plan-usage-fill-danger {
  background: #dc2626;
}

.account-plan-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.account-usage-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
}

.account-usage-label {
  width: 100px;
  font-size: 0.9rem;
  color: #444;
}

.account-usage-track {
  width: 220px;
  height: 8px;
}

.account-usage-text {
  font-size: 0.85rem;
  color: #666;
  font-variant-numeric: tabular-nums;
}

.landing-back-to-app-bar {
  background: #eef2ff;
  border-bottom: 1px solid #c7d2fe;
  padding: 0.6rem 1.5rem;
  text-align: center;
}

.landing-back-to-app-bar button {
  background: none;
  border: none;
  color: #4338ca;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}

.upgrade-modal-comparison {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}

.upgrade-modal-comparison > div {
  flex: 1;
  background: #f4f5f7;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
}

.upgrade-modal-comparison h4 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
}

#main-nav {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.nav-tab-btn {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid #374151;
}

.nav-tab-btn.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.ws-linxi-number-display {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #6366f1;
}

.muted {
  color: #777;
  font-size: 0.9rem;
}

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

th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

th {
  color: #555;
  font-weight: 600;
}

.table-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

#contacts-search {
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 220px;
}

button {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
}

button:disabled {
  background: #b7c6ec;
  cursor: not-allowed;
}

.row-delete-btn {
  background: #dc2626;
}

.row-action-btn-sm {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  border-radius: 5px;
}

.secondary {
  background: #e5e7eb;
  color: #1a1a1a;
}

.hidden {
  display: none;
}

select {
  font-size: 0.9rem;
  padding: 0.25rem 0.4rem;
}

.result {
  min-height: 1.2em;
  font-size: 0.9rem;
}

.error {
  color: #dc2626;
}

.success {
  color: #16a34a;
}

.login-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 340px;
}

.login-card h1 {
  margin-top: 0;
  margin-bottom: 0.15rem;
  font-size: 1.25rem;
}

.login-tagline {
  margin-top: 0;
  margin-bottom: 1.1rem;
  font-size: 0.85rem;
}

#login-form label,
#add-user-form input,
#add-user-form select {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

#login-form input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#login-form button {
  width: 100%;
  margin-top: 0.5rem;
}

#add-user-form input,
#add-user-form select,
#ws-add-member-form input,
#ws-add-member-form select,
#ws-add-group-form input {
  padding: 0.45rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-width: 280px;
}

#ws-add-group-form input[type="color"] {
  padding: 0.2rem;
  max-width: 60px;
}

#compose-section label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.3rem;
}

#compose-body {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  resize: vertical;
}

#recipient-type,
#recipient-group-select {
  width: 100%;
  max-width: 280px;
  padding: 0.45rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-top: 0.4rem;
}

#send-btn {
  margin-top: 1rem;
}

.progress-bar-track {
  margin-top: 0.75rem;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0;
  background: #2563eb;
  transition: width 0.2s ease;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  text-transform: capitalize;
}

.badge-direction-inbound {
  background: #16a34a;
}

.badge-direction-outbound {
  background: #1d4ed8;
}

.badge-status-delivered,
.badge-status-sent {
  background: #16a34a;
}

.badge-status-failed,
.badge-status-undelivered {
  background: #dc2626;
}

.badge-status-queued {
  background: #6b7280;
}

.badge-status-received {
  background: #0d9488;
}

.badge-clickable {
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Two classes always beats one in specificity regardless of source
   order, so .modal-overlay.hidden reliably wins over .modal-overlay's
   own `display: flex` -- see the CSS-specificity bug this fixed on the
   original single-ID version of this rule. */
.modal-overlay.hidden {
  display: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.modal h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.modal p {
  font-size: 0.9rem;
  margin: 0.4rem 0;
}

.modal a {
  color: #2563eb;
}

.modal #error-modal-close-btn {
  margin-top: 0.75rem;
}

.confirm-modal {
  max-width: 320px;
}

.campaign-rate-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0 0.9rem;
}

.campaign-rate-number {
  width: 60px;
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
}

#campaign-rate-unit {
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
}

#campaign-schedule-at {
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
}

.campaign-detail-modal {
  max-width: 720px;
  width: 100%;
}

.campaign-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.6rem 0;
}

.campaign-stat-pill {
  background: #f4f5f7;
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.campaign-stat-pill strong {
  display: block;
  font-size: 1rem;
}

.campaign-recipients-scroll {
  max-height: 45vh;
  overflow-y: auto;
  margin: 0.5rem 0;
}

.campaign-quick-reply {
  display: flex;
  gap: 0.3rem;
}

.campaign-quick-reply input {
  width: 140px;
  padding: 0.25rem 0.4rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 0.78rem;
}

.confirm-modal-actions {
  justify-content: flex-end;
  margin-top: 1rem;
}

#new-workspace-form label,
#ws-settings-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.3rem;
}

#new-workspace-form input,
#ws-settings-form input,
#new-apikey-value {
  display: block;
  width: 100%;
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#new-apikey-value {
  margin: 0.75rem 0;
  font-family: monospace;
  background: #f4f5f7;
}

#ws-settings-form input:read-only {
  background: #f4f5f7;
  color: #666;
  cursor: default;
}

/* --- Workspace switcher --- */

.workspace-switcher select {
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #4b5563;
  background: #27272a;
  color: #fff;
  font-size: 0.9rem;
  max-width: 220px;
}

/* --- Links tab --- */

.links-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.links-list-panel {
  border-right: 1px solid #e0e0e0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 80vh;
  overflow-y: auto;
}

/* ID selectors always outrank a plain .hidden class, regardless of
   source order -- these need the matching #id.hidden override or they
   can never actually hide (same underlying issue as
   .manage-organize-panel.hidden above, worse here since it's not even
   a source-order tiebreak). */
#links-search-panel.hidden,
#contacts-search-panel.hidden,
#create-organize-panel.hidden,
#upload-panel.hidden,
#new-campaign-panel.hidden {
  display: none;
}

#links-search-panel,
#contacts-search-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

#create-organize-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

#upload-panel {
  margin-top: 0.75rem;
}

#links-search {
  padding: 0.45rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 100%;
}

.links-bulk-toolbar {
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
}

.links-bulk-toolbar select {
  max-width: 110px;
}

.select-all-links {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #555;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.link-card {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}

.link-card-checkbox {
  margin-top: 0.3rem;
  flex-shrink: 0;
}

.link-card:hover {
  background: #f4f5f7;
}

.link-card.active {
  background: #e0e7ff;
}

.link-card-main {
  flex: 1;
  min-width: 0;
}

.link-card-name-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.link-card-time {
  font-weight: 400;
  font-size: 0.75rem;
  white-space: nowrap;
}

.link-card-preview {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unread-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.4rem;
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-circle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.avatar-large {
  width: 56px;
  height: 56px;
  font-size: 1.2rem;
}

/* No height cap/scroll of its own -- this panel grows to fit its
   content (nav + profile + reply box) naturally. .chat-thread below is
   the ONE scrollable region in here; capping this panel too used to
   create a second, outer scrollbar for the whole module (profile card
   included) on top of the thread's own, which is exactly what looked
   "oversized" and confusing on desktop. */
.links-detail-panel {
  padding: 1rem 1.5rem;
}

.link-detail-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.contact-profile-card {
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.contact-profile-fields {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.profile-field {
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.9rem;
  background: transparent;
}

.profile-field:hover,
.profile-field:focus {
  border-color: #ccc;
  background: #fff;
}

.contact-groups {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.group-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.group-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.5rem 0.15rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.group-pill-remove {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.color-swatch {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  vertical-align: middle;
}

.dynamic-fields {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.dynamic-field-row label {
  display: block;
  font-size: 0.7rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dynamic-field-row input {
  width: 100%;
  padding: 0.3rem 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.85rem;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 200px;
  max-height: 45vh;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.date-separator {
  text-align: center;
  font-size: 0.75rem;
  color: #999;
  margin: 0.5rem 0;
}

.chat-row {
  display: flex;
  flex-direction: column;
  max-width: 70%;
}

.chat-outbound {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-inbound {
  align-self: flex-start;
  align-items: flex-start;
}

.chat-bubble {
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-outbound {
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chat-bubble-inbound {
  background: #e5e7eb;
  color: #1a1a1a;
  border-bottom-left-radius: 2px;
}

.chat-meta {
  font-size: 0.7rem;
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.status-icon {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.8rem;
  cursor: default;
  color: inherit;
}

.status-icon.status-failed {
  cursor: pointer;
}

.reply-box {
  margin-top: 0.75rem;
  border-top: 1px solid #eee;
  padding-top: 0.75rem;
}

.reply-box textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  font-family: inherit;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  resize: vertical;
}

.reply-box-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
}

/* --- Compose A2P warning banner --- */

.warning-banner {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #78350f;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

/* --- Setup Wizard --- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.wizard-modal {
  max-width: 560px;
  position: relative;
  padding-top: 2.25rem;
}

.wizard-close-x {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  color: #777;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
}

.wizard-close-x:hover {
  color: #1a1a1a;
}

.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.wizard-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.wizard-progress-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wizard-progress-step.active .wizard-progress-dot {
  background: #2563eb;
  color: #fff;
}

.wizard-progress-step.completed .wizard-progress-dot {
  background: #16a34a;
  color: #fff;
}

.wizard-progress-label {
  font-size: 0.7rem;
  color: #777;
  white-space: nowrap;
}

.wizard-progress-step.active .wizard-progress-label {
  color: #1a1a1a;
  font-weight: 600;
}

.wizard-progress-line {
  width: 36px;
  height: 2px;
  background: #e5e7eb;
  margin-bottom: 1.1rem;
}

.wizard-viewport {
  overflow: hidden;
}

.wizard-track {
  display: block;
}

.wizard-step-panel {
  display: none;
  padding: 0 0.1rem;
}

.wizard-step-panel.active {
  display: block;
}

.wizard-step-panel h4 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.wizard-step-panel label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.3rem;
}

.wizard-step-panel input[type="text"],
.wizard-step-panel input[type="password"] {
  width: 100%;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.password-field,
.input-actions {
  display: flex;
  gap: 0.4rem;
}

.password-field input,
.input-actions input {
  flex: 1;
}

.wizard-note {
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
}

.wizard-verify-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.wizard-verify-col button {
  width: 100%;
}

.wizard-verify-result {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  min-height: 1.2em;
}

.wizard-result-ok {
  color: #16a34a;
  font-weight: 600;
}

.wizard-result-fail {
  color: #dc2626;
  font-weight: 600;
}

.wizard-checklist-item {
  padding: 0.15rem 0;
}

.wizard-checklist-item.ok {
  color: #16a34a;
}

.wizard-checklist-item.warn {
  color: #b45309;
}

.wizard-checklist-item.fail {
  color: #dc2626;
}

.wizard-checklist-item a {
  color: inherit;
  text-decoration: underline;
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.3rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.wizard-summary-card {
  background: #f4f5f7;
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.wizard-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  border-bottom: 1px solid #e5e7eb;
}

.wizard-summary-row:last-child {
  border-bottom: none;
}

.wizard-summary-row span {
  color: #777;
}

.wizard-callout {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #78350f;
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  margin-top: 0.9rem;
}

.wizard-callout-success {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.9rem;
}

.a2p-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.75rem;
}

.a2p-badge.a2p-approved {
  background: #dcfce7;
  color: #166534;
}

.a2p-badge.a2p-processing,
.a2p-badge.a2p-pending {
  background: #fef3c7;
  color: #92400e;
}

.a2p-badge.a2p-unregistered {
  background: #fee2e2;
  color: #991b1b;
}

.a2p-badge.a2p-unknown {
  background: #e5e7eb;
  color: #374151;
}

/* --- Register page --- */

#register-form label {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
}

#register-form input {
  display: block;
  width: 100%;
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#register-form button[type="submit"] {
  width: 100%;
  margin-top: 1.25rem;
}

.field-error {
  color: #dc2626;
  font-size: 0.78rem;
  min-height: 1.1em;
  margin: 0.2rem 0 0;
}

.auth-footer-link {
  text-align: center;
  margin-top: 1rem;
}

.password-strength {
  margin-top: 0.4rem;
}

.password-strength-track {
  height: 5px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  transition: width 0.2s ease, background-color 0.2s ease;
}

.strength-fill-weak {
  width: 33%;
  background: #dc2626;
}

.strength-fill-fair {
  width: 66%;
  background: #f59e0b;
}

.strength-fill-strong {
  width: 100%;
  background: #16a34a;
}

.strength-label {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.strength-label-weak {
  color: #dc2626;
}

.strength-label-fair {
  color: #b45309;
}

.strength-label-strong {
  color: #16a34a;
}

/* --- Privacy / Terms pages --- */

.legal-nav {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.6rem;
}

.legal-nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
}

.legal-nav a:hover,
.legal-nav a.active {
  color: #fff;
  text-decoration: underline;
}

.legal-content {
  max-width: 720px;
}

.legal-content .effective-date {
  color: #777;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.legal-content h3 {
  font-size: 0.95rem;
  margin: 1.5rem 0 0.4rem;
}

.legal-content h3:first-of-type {
  margin-top: 0;
}

.legal-content p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #333;
  margin: 0 0 0.75rem;
}

/* --- Contact lists & tags --- */

.bulk-actions-toolbar,
.create-organize-toolbar,
.contacts-pagination {
  flex-wrap: wrap;
}

.contacts-pagination select {
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
}

.create-organize-toolbar input[type="text"] {
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
  width: 140px;
}

.create-organize-toolbar input[type="color"] {
  padding: 0.1rem;
  width: 32px;
  height: 28px;
}

/* Two-class specificity so this reliably beats .manage-organize-panel's
   own `display: flex` below regardless of source order -- same fix as
   .modal-overlay.hidden (see that rule for the full explanation). */
.manage-organize-panel.hidden {
  display: none;
}

.manage-organize-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0.75rem 0;
  padding: 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.manage-organize-col {
  flex: 1;
  min-width: 220px;
}

.manage-organize-col h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.manage-organize-table {
  width: 100%;
  border-collapse: collapse;
}

.manage-organize-table td,
.manage-organize-table th {
  padding: 0.25rem 0.3rem;
  vertical-align: middle;
}

.manage-organize-table th {
  text-align: left;
  font-size: 0.75rem;
  color: #777;
}

.manage-organize-table input[type="text"] {
  width: 100%;
  padding: 0.3rem 0.4rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
}

.manage-organize-table input[type="color"] {
  padding: 0.1rem;
  width: 28px;
  height: 26px;
}

.manage-organize-table .muted {
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Same fix as .manage-organize-panel.hidden above -- new-group-quick-form
   combines this class with .hidden (for non-admins) and would otherwise
   stay visible since this rule's display: flex is declared after .hidden. */
.bulk-action-group.hidden {
  display: none;
}

.bulk-action-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.contact-name-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #6366f1;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.filter-chip {
  background: #fff;
  color: #374151;
  border: 1.5px solid #d1d5db;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip.active {
  color: #fff;
}

.row-pill {
  display: inline-block;
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  margin: 0.1rem 0.2rem 0.1rem 0;
}

.list-assignment-options {
  margin-top: 0.5rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.6rem;
}

.radio-option input {
  width: auto;
}

.list-sub-fields {
  margin: 0.4rem 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 360px;
}

.list-sub-fields input,
.list-sub-fields select {
  padding: 0.4rem 0.55rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
}

.color-preset-row {
  display: flex;
  gap: 0.5rem;
}

.color-preset {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
}

.color-preset.active {
  border-color: #1a1a1a;
}

#tag-input {
  width: 100%;
  max-width: 360px;
  margin-top: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
}

.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.tag-suggestion-chip {
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #6366f1;
  color: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.5rem 0.15rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-pill-remove {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.tag-pills-select {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.wizard-a2p-raw {
  display: block;
  font-size: 0.7rem;
  margin-top: 0.15rem;
  text-align: right;
}

/* --- Landing page (shown instead of the app shell for anonymous visitors) --- */

.landing-header {
  background: #1a1a1a;
  color: #fff;
  padding: 1rem 1.5rem;
}

.landing-brand {
  font-weight: 700;
  font-size: 1.15rem;
}

.landing-header-tagline {
  margin-left: 0.6rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.landing-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

.landing-main h1 {
  font-size: 2.1rem;
  margin: 0 0 0.75rem;
}

.landing-lede {
  font-size: 1.1rem;
  color: #444;
  margin: 0 0 2rem;
  max-width: 60ch;
}

.landing-cta-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-primary {
  background: #6366f1;
  color: #fff;
}

.btn-secondary {
  background: #e5e7eb;
  color: #1a1a1a;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.landing-features li {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
}

.landing-features strong {
  display: block;
  margin-bottom: 0.3rem;
}

.landing-features span {
  color: #555;
  font-size: 0.92rem;
}

.landing-footer {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  color: #888;
  font-size: 0.85rem;
}

.landing-footer a {
  color: #6366f1;
}

.landing-footer p {
  margin: 0.75rem 0 0;
}

/* --- Landing page: Problem/Solution, Features, Pricing sections --- */

html {
  scroll-behavior: smooth;
}

.landing-section {
  padding: 4rem 1.5rem;
}

.landing-section-alt {
  background: #f9fafb;
}

.landing-section-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.landing-section-inner > h2 {
  font-size: 1.6rem;
  text-align: center;
  margin: 0 0 2.5rem;
}

.landing-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.landing-compare-col {
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
}

.landing-compare-col h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.landing-compare-col ul {
  margin: 0;
  padding-left: 1.2rem;
}

.landing-compare-col li {
  margin-bottom: 0.6rem;
  color: #444;
  font-size: 0.92rem;
}

.landing-compare-old {
  border: 1px solid #fecaca;
}

.landing-compare-old h3 {
  color: #dc2626;
}

.landing-compare-new {
  border: 1px solid #c7d2fe;
}

.landing-compare-new h3 {
  color: #6366f1;
}

.landing-feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.landing-feature-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.5rem;
}

.landing-feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: #6366f1;
}

.landing-feature-card p {
  margin: 0;
  color: #555;
  font-size: 0.92rem;
}

.landing-pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

.landing-pricing-card {
  position: relative;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.75rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.landing-pricing-featured {
  border: 2px solid #6366f1;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.landing-pricing-badge {
  position: absolute;
  top: -0.7rem;
  left: 50%;
  transform: translateX(-50%);
  background: #6366f1;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.landing-pricing-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.landing-price {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
}

.landing-price span {
  font-size: 0.85rem;
  font-weight: 400;
  color: #777;
}

.landing-pricing-card ul {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  flex: 1;
}

.landing-pricing-card li {
  font-size: 0.85rem;
  color: #444;
  padding: 0.35rem 0;
  border-top: 1px solid #f3f4f6;
}

.landing-pricing-card li:first-child {
  border-top: none;
}

.landing-pricing-card .btn {
  text-align: center;
}

.landing-self-hosted {
  text-align: center;
  margin: 2.5rem 0 0;
  color: #555;
  font-size: 0.9rem;
}

.landing-self-hosted a {
  color: #6366f1;
}

@media (max-width: 800px) {
  .landing-compare-grid {
    grid-template-columns: 1fr;
  }

  .landing-pricing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .landing-pricing-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Linxi Card editor (tab-linxicard) --- */

.linxicard-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 2.5rem;
  margin-top: 1.25rem;
}

@media (max-width: 800px) {
  .linxicard-editor-grid {
    grid-template-columns: 1fr;
  }
}

.linxicard-section-heading {
  margin: 0 0 0.9rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #6366f1;
}

.linxicard-editor-form .linxicard-section-heading:not(:first-child) {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

.linxicard-editor-form label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: #374151;
  margin: 0 0 0.5rem;
}

.linxicard-editor-form input[type="text"],
.linxicard-editor-form textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  margin-bottom: 1.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.linxicard-editor-form input[type="text"]:focus,
.linxicard-editor-form textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.linxicard-editor-form textarea {
  resize: vertical;
  min-height: 70px;
}

.linxicard-actions-row {
  margin-top: 0.5rem;
}

.linxicard-color-picker {
  display: flex;
  gap: 0.6rem;
  margin: 0.5rem 0 1.5rem;
}

.linxicard-color-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s;
}

.linxicard-color-swatch:hover {
  transform: scale(1.08);
}

.linxicard-color-swatch.selected {
  border-color: #111827;
  box-shadow: 0 0 0 2px #ffffff inset;
}

.linxicard-slug-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.linxicard-slug-row input[type="text"] {
  margin-bottom: 0;
  flex: 1;
}

.linxicard-slug-prefix {
  font-size: 0.85rem;
  white-space: nowrap;
}

.linxicard-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0.6rem 0 1.5rem;
}

.linxicard-toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-weight: normal;
  margin: 0;
  cursor: pointer;
}

.linxicard-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.85rem;
  color: #1a1a1a;
}

.linxicard-toggle-text .muted {
  font-size: 0.75rem;
}

/* Standard accessible checkbox-driven toggle switch -- the real
   checkbox stays in the DOM (and keeps working exactly as before, same
   ids, same .checked reads/writes in linxicard.js) but is visually
   hidden in favor of the adjacent slider it drives via :checked. */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  transition: background 0.2s;
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: #6366f1;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.toggle-switch input:focus-visible + .toggle-slider {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.linxicard-preview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.linxicard-preview-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}

.linxicard-preview {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  padding: 2.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #ffffff;
  background: linear-gradient(160deg, #6366f1, #4338ca);
  box-shadow: 0 20px 45px -12px rgba(67, 56, 202, 0.55), 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.linxicard-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
}

.linxicard-preview-avatar {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18), 0 0 0 4px rgba(255, 255, 255, 0.25);
}

.linxicard-preview-name {
  position: relative;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.linxicard-preview-bio {
  position: relative;
  font-size: 0.95rem;
  line-height: 1.4;
  opacity: 0.92;
  flex-grow: 1;
}

.linxicard-preview-request-btn {
  position: relative;
  background: #ffffff;
  color: #4338ca;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.75rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 1.1rem 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s, box-shadow 0.15s;
}

.linxicard-preview-request-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.linxicard-preview-qr {
  position: relative;
  width: 60px;
  height: 60px;
  padding: 5px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  margin-bottom: 0.9rem;
}

.linxicard-preview-brand {
  position: relative;
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.85;
  letter-spacing: 0.16em;
}

.linxicard-export-panel {
  width: 100%;
  max-width: 320px;
  background: #f8f9fb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.linxicard-qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.linxicard-qr-preview {
  width: 84px;
  height: 84px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 4px;
}

.linxicard-qr-caption {
  font-size: 0.68rem;
  text-align: center;
  max-width: 90px;
  margin: 0;
}

.linxicard-export-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.linxicard-export-buttons button {
  width: 100%;
  text-align: center;
}

/* --- Public Linxi Card page (public/card.html) --- */

.public-card-body {
  background: #f3f4f6;
}

.public-card-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.public-card {
  --public-card-color: #6366f1;
  width: 100%;
  max-width: 400px;
  background: linear-gradient(160deg, var(--public-card-color), #1f2937);
  border-radius: 24px;
  padding: 3rem 2rem 2rem;
  text-align: center;
  color: #ffffff;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.public-card-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 auto 1.5rem;
}

.public-card-name {
  font-size: 1.8rem;
  margin: 0 0 0.75rem;
}

.public-card-bio {
  font-size: 1rem;
  opacity: 0.92;
  margin: 0 0 1rem;
}

.public-card-contact {
  font-size: 0.9rem;
  opacity: 0.85;
  margin: 0.2rem 0;
}

.public-card-request-btn {
  background: #ffffff;
  color: #111827;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  margin: 1.5rem 0 0.5rem;
}

.public-card-qr {
  width: 88px;
  height: 88px;
  padding: 6px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  margin: 1rem auto 0;
  display: block;
}

.public-card-brand {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.public-card-wordmark {
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.public-card-cta {
  color: #ffffff;
  font-size: 0.85rem;
  text-decoration: underline;
}

/* ==========================================================================
   Mobile -- applies app-wide, on top of every rule above. Tables are the
   one generic (non-scoped) rule here: rather than wrap every table in the
   app in a scroll container, forcing table -> display:block on small
   screens turns the table element itself into the horizontal-scroll
   container (the well-known CSS-only responsive-table trick), so every
   existing table/thead/tbody markup keeps working unmodified.
   ========================================================================== */

@media (max-width: 768px) {
  header {
    padding: 0.75rem 1rem;
  }

  .header-top {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  header h1 {
    font-size: 1.05rem;
  }

  #main-nav {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .nav-tab-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
  }

  main {
    padding: 0.85rem;
    gap: 1rem;
  }

  .card {
    padding: 1rem;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .links-layout {
    grid-template-columns: 1fr;
  }

  .links-list-panel {
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    max-height: 50vh;
  }

  .links-detail-panel {
    max-height: none;
  }

  .contact-profile-fields,
  .dynamic-fields,
  .wizard-verify-buttons {
    grid-template-columns: 1fr;
  }

  .upgrade-modal-comparison {
    flex-direction: column;
  }

  .account-usage-row {
    flex-wrap: wrap;
  }

  .account-usage-track {
    width: auto;
    flex: 1 1 120px;
  }

  .modal-overlay {
    padding: 0.75rem;
  }

  .linxicard-preview-wrap {
    margin-top: 1rem;
  }
}

@media (max-width: 480px) {
  .user-info {
    font-size: 0.8rem;
    gap: 0.4rem;
  }

  .ws-linxi-number-display {
    font-size: 1.3rem;
  }

  .public-card {
    padding: 2.25rem 1.25rem 1.5rem;
  }

  .public-card-avatar {
    width: 96px;
    height: 96px;
    font-size: 2rem;
  }

  .linxicard-preview {
    padding: 1.5rem 1rem;
  }
}

/* --- PWA install banner --- */

.install-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #4f46e5;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
  z-index: 9999;
  font-size: 0.9rem;
  white-space: nowrap;
}

.install-banner button {
  background: white;
  color: #4f46e5;
  border: none;
  padding: 0.35rem 0.85rem;
  border-radius: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
}

.install-banner #install-dismiss {
  background: transparent;
  color: white;
  padding: 0.25rem;
  font-size: 1rem;
}

/* --- Real-time (Socket.io) --- */

.connection-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  margin-left: 0.5rem;
  transition: background 0.3s;
}

.connection-status.connected {
  background: #22c55e;
}

.connection-status.disconnected {
  background: #ef4444;
}

.nav-unread-badge {
  display: none;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  margin-left: 0.35rem;
}

/* --- Reply box send spinner --- */

.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: -1px;
  animation: btn-spinner-spin 0.6s linear infinite;
}

.btn-spinner.hidden {
  display: none;
}

@keyframes btn-spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

.links-active-number {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6366f1;
}

.links-active-number:empty {
  display: none;
}
