/* Account Profile Page Styles — brand tokens: css/brand-tokens.css (linked from base.html) */

/* WhatsApp Info Banner - Emerald/Grey Only */
.whatsapp-info-banner {
  padding: 1rem 1.25rem;
  background: var(--brand-green-surface);
  border-left: 3px solid var(--brand-green);
  border-radius: var(--radius-sm);
  margin-bottom: 2rem;
}

.banner-content {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.banner-content strong {
  font-weight: 600;
  color: var(--color-text);
}

.whatsapp-link {
  color: var(--brand-green);
  font-weight: 500;
  text-decoration: none;
  margin-left: 0.5rem;
  transition: color 0.2s ease;
}

.whatsapp-link:hover {
  color: var(--brand-green-hover);
  text-decoration: underline;
}

/* WhatsApp Embedded Signup / Status */
.waba-instructions {
  text-align: center;
  margin-bottom: 1.5rem;
}

.waba-instruction-text {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  line-height: 1.6;
}

.waba-instruction-sub {
  margin: 0;
}

.btn-waba-connect {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  background: linear-gradient(135deg, var(--color-whatsapp) 0%, var(--color-whatsapp-dark) 100%);
  color: var(--color-surface);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-xl);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-waba-connect:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  background: linear-gradient(135deg, var(--color-whatsapp-light) 0%, var(--color-whatsapp-mid) 100%);
}

.btn-waba-connect:active {
  transform: translateY(0);
}

.btn-waba-connect i {
  font-size: var(--font-size-3xl);
}

.btn-waba-connect-sub {
  font-size: var(--font-size-xs);
  font-weight: 400;
  opacity: 0.85;
}

.waba-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.waba-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--brand-green);
  border-radius: var(--radius-round);
  animation: waba-spin 0.8s linear infinite;
}

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

.waba-error-msg {
  margin-top: 1rem;
  padding: 0.875rem 1.25rem;
  background: var(--color-danger-surface);
  border: 1px solid var(--color-danger-border);
  border-left: 3px solid var(--color-danger);
  border-radius: var(--radius-sm);
  color: var(--color-danger-ink-bright);
  font-size: var(--font-size-sm);
  text-align: center;
}

.settings-legacy-manual {
  cursor: pointer;
}

.settings-legacy-manual > summary {
  list-style: none;
}

.waba-status-card {
  border: 2px solid var(--brand-green-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--media-step-violet-soft);
}

.waba-status-card.pending {
  border-color: var(--color-warning-soft-alt);
  background: var(--color-warning-surface);
}

.waba-status-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
  border-bottom: 1px solid var(--brand-green-200);
}

.waba-status-header.pending {
  background: linear-gradient(135deg, var(--color-warning-surface) 0%, var(--color-warning-tint) 100%);
  border-bottom-color: var(--color-warning-soft);
}

.waba-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: var(--font-size-base);
}

.waba-status-badge.connected {
  color: var(--brand-green-ink);
}

.waba-status-badge.connected i {
  color: var(--brand-green);
  font-size: var(--font-size-lg);
}

.waba-status-badge.pending {
  color: var(--color-warning-deep);
}

.waba-status-badge.pending i {
  color: var(--color-warning);
  font-size: var(--font-size-lg);
}

/* Pill badges on /settings: Bootstrap text-bg-* must win over legacy waba colors */
#wabaStatusBadge.waba-status-badge.badge.connected,
#wabaStatusBadge.waba-status-badge.badge.pending {
  color: inherit;
  font-weight: 600;
  gap: 0.38rem;
}

#wabaStatusBadge.waba-status-badge.badge.connected i,
#wabaStatusBadge.waba-status-badge.badge.pending i,
#wabaStatusBadge.waba-status-badge .integration-status-icon i {
  color: inherit;
  font-size: inherit;
}

.waba-status-body {
  padding: 1.25rem;
}

.waba-detail-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--color-border);
}

.waba-detail-row:last-child {
  border-bottom: none;
}

.waba-detail-label {
  min-width: 120px;
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.waba-detail-value {
  flex: 1;
  font-size: var(--font-size-md);
  color: var(--color-text);
  word-break: break-all;
}

.waba-detail-value.font-monospace {
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--font-size-sm);
}

.btn-copy-id {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--brand-action);
  border-radius: var(--radius-pill);
  color: var(--brand-green);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-copy-id:hover {
  background: var(--brand-action);
  color: var(--color-surface);
}

.btn-copy-id.copied {
  background: var(--brand-green-ink);
  border-color: var(--brand-green-ink);
  color: var(--color-surface);
}

.waba-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.btn-waba-verify,
.btn-waba-disconnect {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-waba-verify {
  background: var(--brand-action);
  color: var(--color-surface);
  border: none;
}

.btn-waba-verify:hover {
  background: var(--brand-action-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand);
}

.btn-waba-verify:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-waba-disconnect {
  background: var(--color-surface);
  color: var(--color-danger-bright);
  border: 1px solid var(--color-danger-border);
}

.btn-waba-disconnect:hover {
  background: var(--color-danger-surface);
  border-color: var(--color-danger-bright);
}

details.admin-connection-card > summary {
  cursor: pointer;
  user-select: none;
}

details.admin-connection-card > summary::marker,
details.admin-connection-card > summary::-webkit-details-marker {
  display: none;
  content: '';
}

details.admin-connection-card[open] > summary.card-header h5::after {
  content: ' ▾';
  font-size: 0.8em;
  color: var(--color-text-faint);
}

details.admin-connection-card:not([open]) > summary.card-header h5::after {
  content: ' ▸';
  font-size: 0.8em;
  color: var(--color-text-faint);
}

/* Modern Form Groups */
.form-group-modern {
  margin-bottom: 1.5rem;
}

.form-label-modern {
  display: block;
  font-weight: 600;
  font-size: var(--font-size-md);
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.required-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: var(--brand-green-100);
  color: var(--brand-green-ink);
  font-size: var(--font-size-2xs);
  font-weight: 600;
  border-radius: var(--radius-xs);
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Modern Input Styling */
.form-control-modern,
.form-select-modern {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: var(--font-size-md);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-xs);
  transition: all 0.2s ease;
}

.form-control-modern:focus,
.form-select-modern:focus {
  outline: none;
  background-color: var(--color-surface);
  border-color: var(--brand-green);
  box-shadow: var(--focus-ring);
}

.form-control-modern::placeholder {
  color: var(--color-text-faint);
}

.form-control-modern.font-monospace {
  font-family: 'Courier New', Courier, monospace;
}

/* Input Group Modern */
.input-group-modern {
  display: flex;
  gap: 0.5rem;
}

.input-group-modern .form-select-modern {
  max-width: 120px;
  flex-shrink: 0;
}

.input-group-modern .form-control-modern {
  flex: 1;
}

/* Help Text Modern */
.help-text-modern {
  margin-top: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: var(--color-surface-2);
  border-left: 2px solid var(--color-border-muted);
  border-radius: var(--radius-xs);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.help-text-modern strong {
  color: var(--color-text-secondary);
  font-weight: 600;
}

/* Permission Badges */
.permissions-badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.permission-badge {
  display: inline-block;
  padding: 0.375rem 0.625rem;
  background: var(--brand-green-50);
  color: var(--brand-green-ink-deep);
  font-family: 'Courier New', Courier, monospace;
  font-size: var(--font-size-xs);
  font-weight: 500;
  border: 1px solid var(--brand-green-100);
  border-radius: var(--radius-xs);
}

/* Primary Buttons - Clean Emerald Theme */

.d-flex.gap-2 {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-alt);
}

/* Connessione Agente dialog (moved to <body>): its rows, header and the connection list built in
   account-mcp-connections.js are plain flex rows, not the separated button bars above. */
.agent-connection-modal .d-flex.gap-2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* Service Table */
.service-row { 
  border-bottom: 1px solid var(--color-border);
  transition: all 0.25s ease;
  padding: 0.5rem 0;
}

.service-row:hover {
  background-color: var(--color-surface-2);
}

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

.service-row input, 
.service-row textarea { 
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  background-color: var(--color-surface-2);
  transition: all 0.2s ease;
}

.service-row input:focus, 
.service-row textarea:focus { 
  border-color: var(--brand-green);
  outline: none;
  background-color: white;
  box-shadow: var(--focus-ring);
}

.services-table {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.services-table thead {
  background: linear-gradient(135deg, var(--color-surface-2) 0%, var(--color-surface-3) 100%);
}

.services-table th {
  font-weight: 600;
  color: var(--color-text-emphasis);
  border-bottom: 2px solid var(--color-border);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.services-table th.col-name {
  width: 25%;
}

.services-table th.col-desc {
  width: 45%;
}

.services-table th.col-price {
  width: 20%;
}

.services-table th.col-actions {
  width: 10%;
}

/* Textarea Modern Styling */
textarea.form-control {
  resize: vertical;
}

/* Day Schedule — grid layout: header row + full-width time bands */
#scheduleContainer,
#onboardingScheduleContainer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.day-schedule {
  --studio-accent: var(--brand-green);
  display: grid;
  grid-template-columns: 1.1rem 2.25rem minmax(0, 1fr);
  grid-template-areas:
    "check day studio"
    "times times times";
  gap: 0.45rem 0.65rem;
  align-items: start;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-surface-2);
  transition: all 0.2s ease;
}

.day-schedule:hover {
  border-color: var(--color-border-muted);
  background-color: var(--color-surface-3);
}

.day-schedule.active {
  background: color-mix(in srgb, var(--studio-accent) 8%, white);
  border-color: var(--studio-accent);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--studio-accent) 30%, transparent);
}

.day-schedule__check,
.day-schedule input[type="checkbox"] {
  grid-area: check;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.35rem 0 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--studio-accent);
}

.day-schedule__label,
.day-schedule > label {
  grid-area: day;
  min-width: 0;
  margin: 0;
  padding-top: 0.35rem;
  font-weight: 600;
  color: var(--color-text-emphasis);
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.day-schedule__studio-slot {
  grid-area: studio;
  min-width: 0;
}

.day-schedule__times {
  grid-area: times;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  min-width: 0;
}

/* Mattina / Pomeriggio — equal columns, no overlap */
.day-schedule .slot-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.day-schedule .slot-group.slot-morning {
  border-left: 3px solid var(--color-text-faint);
}

.day-schedule .slot-group.slot-afternoon {
  border-left: 3px solid var(--color-text-muted);
}

.day-schedule.active .slot-group.slot-morning {
  border-left-color: var(--studio-accent);
}

.day-schedule.active .slot-group.slot-afternoon {
  border-left-color: color-mix(in srgb, var(--studio-accent) 75%, black);
}

.day-schedule .slot-group-label {
  font-size: var(--font-size-2xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.day-schedule .slot-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.day-schedule .slot-inputs .slot-sep {
  font-size: var(--font-size-caption);
  color: var(--color-text-faint);
  flex-shrink: 0;
  font-weight: 500;
}

/* Flexible time inputs — fill available space without clipping */
.day-schedule .schedule-time,
.day-schedule input.schedule-time {
  flex: 1 1 4.5rem;
  min-width: 0;
  width: auto;
  max-width: none;
  min-height: 2.125rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 0.4rem 0.35rem;
  font-size: var(--font-size-caption);
  line-height: 1.35;
  background-color: var(--color-surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.day-schedule .schedule-time:focus,
.day-schedule input.schedule-time:focus {
  border-color: var(--studio-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--studio-accent) 20%, transparent);
  outline: none;
}

/* Studio selector injected into .day-schedule__studio-slot */
.day-studio-selector {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.day-schedule.active .day-studio-selector {
  display: flex;
}

.day-studio-dot {
  width: 11px;
  height: 11px;
  min-width: 11px;
  border-radius: var(--radius-xs);
  background: var(--color-text-faint);
  border: 1px solid rgba(var(--rgb-black), 0.1);
  transition: background 0.2s ease;
}

.day-studio-select.form-select,
.day-studio-select {
  font-size: var(--font-size-caption);
  line-height: 1.35;
  padding: 0.35rem 2rem 0.35rem 0.55rem;
  border: 1px solid var(--color-border-muted);
  border-radius: var(--radius-xs);
  background-color: var(--color-surface);
  color: var(--color-text-emphasis);
  cursor: pointer;
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.day-studio-select:focus {
  outline: none;
  border-color: var(--studio-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--studio-accent) 22%, transparent);
}

.day-schedule .schedule-time:disabled,
.day-schedule input.schedule-time:disabled {
  background-color: var(--color-surface-3);
  border-color: var(--color-border);
  color: var(--color-text-faint);
  cursor: not-allowed;
}

/* Mobile: stack Mattina / Pomeriggio vertically */
@media (max-width: 768px) {
  #scheduleContainer,
  #onboardingScheduleContainer {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .btn-waba-connect {
    max-width: 100%;
    padding: 1rem 1.5rem;
    font-size: var(--font-size-base);
  }

  .waba-detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .waba-detail-label {
    min-width: auto;
  }

  .waba-actions {
    flex-direction: column;
  }

  .btn-waba-verify,
  .btn-waba-disconnect {
    width: 100%;
    justify-content: center;
  }

  .day-schedule {
    padding: 0.55rem 0.65rem;
    grid-template-columns: 1.1rem 2rem minmax(0, 1fr);
  }

  .day-schedule__times {
    grid-template-columns: 1fr;
  }

  .day-schedule .slot-group {
    padding: 5px 6px;
  }
}

/* Checkbox Switch Wrapper */
.checkbox-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--color-surface-2) 0%, var(--color-surface-3) 100%);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  transition: all 0.25s ease;
}

.checkbox-switch-wrapper:hover {
  border-color: var(--brand-green);
  background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
}

.checkbox-switch-wrapper input[type="checkbox"] {
  width: 1.5rem;
  height: 1.5rem;
  cursor: pointer;
  accent-color: var(--brand-green);
}

.checkbox-switch-wrapper label {
  margin: 0;
  font-weight: 600;
  color: var(--color-text-emphasis);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-md);
}

.checkbox-switch-wrapper label i {
  color: var(--brand-green);
  font-size: var(--font-size-xl);
}

/* Card Headers with Emerald Theme */
.admin-connection-card {
  border: 1px solid var(--color-border-alt);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.5rem;
  background: var(--color-surface);
}

.admin-connection-card .card-header {
  background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
  border-bottom: 2px solid var(--brand-green);
  padding: 1rem 1.5rem;
}

.card-header h5 {
  color: var(--brand-green-ink);
  font-weight: 600;
  font-size: var(--font-size-base);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header h5 i {
  font-size: var(--font-size-xl);
  color: var(--brand-green);
}

.admin-connection-card .card-body {
  padding: 1.5rem;
  background: var(--color-surface);
}

.card-header .btn-light {
  background-color: white;
  border: 1px solid var(--brand-action);
  color: var(--brand-green);
  font-weight: 600;
  transition: all 0.2s ease;
}

.card-header .btn-light:hover {
  background-color: var(--brand-action);
  border-color: var(--brand-action);
  color: white;
}

/* Form Controls - Clean & Elegant */

.form-text code {
  background: var(--color-surface-3);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-xs);
  font-size: var(--font-size-caption);
  color: var(--brand-green-hover);
}

/* Admin Dashboard Header */
.admin-dashboard-header {
  margin-bottom: 1.5rem;
}

.admin-dashboard-title {
  color: var(--color-text);
  font-weight: 700;
  font-size: var(--font-size-3xl);
  margin-bottom: 0.375rem;
}

.admin-dashboard-subtitle {
  color: var(--color-text-muted);
  font-size: var(--font-size-md);
  margin: 0;
}

/* Automation Settings */
.automation-setting-item {
  padding: 1rem;
  background: var(--brand-green-surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

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

.automation-info {
  flex: 1;
}

.automation-info h6 {
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--font-size-base);
}

.automation-info h6 i {
  color: var(--brand-green);
  margin-right: 0.5rem;
}


.template-info-box {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.template-info-box .alert-heading {
  font-size: var(--font-size-base);
  font-weight: 600;
  margin-bottom: 1rem;
}

.template-info-box code {
  background: var(--brand-green-100);
  color: var(--brand-green-ink);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-xs);
  font-size: var(--font-size-sm);
}

/* Form check switch custom styling for automation toggles */
.automation-header .form-check-input {
  width: 3rem;
  height: 1.5rem;
  cursor: pointer;
}

.automation-header .form-check-input:checked {
  background-color: var(--brand-green);
  border-color: var(--brand-green);
}

.automation-header .form-check-input:focus {
  box-shadow: var(--focus-ring);
}

/* ============================================
   Servizi section – mobile: card layout, no horizontal scroll
   ============================================ */
@media (max-width: 768px) {
  .admin-connection-card .services-table {
    overflow: visible;
    border: none;
    box-shadow: none;
  }

  .admin-connection-card .services-table table {
    display: block;
    width: 100%;
  }

  .admin-connection-card .services-table thead {
    display: none;
  }

  .admin-connection-card .services-table tbody {
    display: block;
  }

  .admin-connection-card .services-table tbody tr {
    display: block;
  }

  /* Each service row becomes a card */
  .admin-connection-card .services-table tr.service-row {
    display: block;
    width: 100%;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-sizing: border-box;
  }

  .admin-connection-card .services-table tr.service-row:last-child {
    margin-bottom: 0;
  }

  /* Each cell stacks vertically with a label */
  .admin-connection-card .services-table tr.service-row td {
    display: block;
    width: 100%;
    padding: 0 0 0.875rem 0;
    border: none;
    box-sizing: border-box;
  }

  .admin-connection-card .services-table tr.service-row td:last-child {
    border-top: 1px solid var(--color-border);
    margin-top: 0.25rem;
  }

  .admin-connection-card .services-table tr.service-row td::before {
    display: block;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .admin-connection-card .services-table tr.service-row td:nth-child(1)::before {
    content: "Nome servizio";
  }

  .admin-connection-card .services-table tr.service-row td:nth-child(2)::before {
    content: "Descrizione";
  }

  .admin-connection-card .services-table tr.service-row td:nth-child(3)::before {
    content: "Prezzo";
  }

  .admin-connection-card .services-table tr.service-row td:nth-child(4)::before {
    content: "";
  }

  /* Full-width inputs and textarea on mobile */
  .admin-connection-card .services-table tr.service-row td input,
  .admin-connection-card .services-table tr.service-row td textarea {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 2.75rem;
  }

  .admin-connection-card .services-table tr.service-row td textarea {
    min-height: 4rem;
    resize: vertical;
  }

  /* Actions cell: full width, button aligned */
  .admin-connection-card .services-table tr.service-row td.text-center {
    text-align: left;
  }

  .admin-connection-card .services-table tr.service-row td .btn {
    width: 100%;
    justify-content: center;
  }

  /* Empty state row (Nessun servizio aggiunto) */
  .admin-connection-card .services-table tbody tr td[colspan="4"] {
    display: block;
    text-align: center;
  }

  .admin-connection-card .services-table tbody tr td[colspan="4"]::before {
    display: none;
  }

  /* Servizi card header: wrap button on small screens */
  .admin-connection-card .card-header.d-flex.justify-content-between.align-items-center {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .admin-connection-card .card-header.d-flex .btn {
    flex-shrink: 0;
  }
}

/* ── Minimal integrations hub (/settings) ───────────────────────────── */

/* Admin config hubs (ref. admin_whatsapp_templates): hero + body share container-fluid width. */
.admin-hub-page {
  width: 100%;
}

.settings-minimal-title {
  font-weight: 700;
  font-size: var(--font-size-xl);
  color: var(--color-ink-slate);
  letter-spacing: -0.02em;
}

.settings-minimal-lead {
  max-width: 40rem;
  line-height: 1.5;
}

.settings-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  grid-auto-flow: row dense;  /* the two-column group cards leave no holes */
  gap: 1.35rem;
  align-items: stretch;
}

@media (min-width: 993px) {
  .settings-tiles-grid {
    grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  }
}

.settings-social-group {
  display: contents;
}

.integration-tile {
  border: 1px solid rgba(var(--rgb-ink), 0.1);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.15rem 1.25rem;
  background: var(--color-surface);
  box-shadow:
    var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
  min-width: 0;
  min-height: 248px;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease;
}

/* Connessioni card anatomy, the same on every card:
   icon · title · one-line description (two lines reserved, so the status pills line up) ·
   status pill · optional detail line · actions at the bottom (primary button, then text links,
   «Disconnetti» last in red). Settings that need a form fold into «Impostazioni». */
.integration-tile-desc {
  max-width: 17rem;
  min-height: calc(2 * 1.35em);
  margin: 0.25rem 0 0;
}

.integration-tile-meta {
  max-width: 100%;
  margin: 0.15rem 0 0;
  font-size: var(--font-size-caption);
  line-height: 1.4;
  color: var(--color-text-muted);
}

.integration-tile-meta strong {
  color: var(--color-text-emphasis);
  font-weight: 600;
}

/* Group cards (Social, Automazioni): two columns wide, one row per item. Below 993px the grid can
   hold a single 220px column (sidebar open at ~770px): «span 2» would add an implicit column and
   scroll sideways, so there the card takes the whole row instead. */
@media (min-width: 768px) {
  .integration-tile--group {
    grid-column: 1 / -1;
  }
}

@media (min-width: 993px) {
  .integration-tile--group {
    grid-column: span 2;
  }
}

.integration-tile-icon-stack {
  display: flex;
  gap: 0.4rem;
}

.integration-tile-icon-stack .platform-icon {
  width: 2.5rem;
  height: 2.5rem;
  font-size: var(--font-size-xl);
}

.integration-rows {
  list-style: none;
  width: 100%;
  margin: 0.85rem 0 0;
  padding: 0;
  text-align: left;
  border-top: 1px solid var(--color-border);
}

.integration-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border);
}

.integration-row:last-child {
  border-bottom: 0;
}

.integration-row__icon.platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
}

.integration-row__text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.integration-row__title {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--color-text-emphasis);
}

.integration-row__hint,
.integration-row__status {
  font-size: var(--font-size-caption);
  line-height: 1.35;
  color: var(--color-text-muted);
}

.integration-row__status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.integration-row__status.is-on {
  color: var(--brand-green-strong);
  font-weight: 600;
}

.integration-row__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  flex-shrink: 0;
}

.integration-row__actions form {
  margin: 0;
}

/* Carla's «Messaggi» switch inside a row: inline, not the full-width block of the old tiles. */
.integration-tile .integration-row .autoreply-msg-toggle {
  width: auto;
  margin: 0;
  padding: 0;
}

.integration-row .autoreply-msg-toggle__control.carla-toggle-switch.form-switch {
  width: auto;
}

/* Phone: icon | text, with the actions under the text. */
@media (max-width: 576px) {
  .integration-row {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    column-gap: 0.75rem;
    row-gap: 0.4rem;
  }

  .integration-row__actions {
    grid-column: 2;
    justify-content: flex-start;
  }
}

/* Company picker of the Fatture in Cloud tile. Bootstrap's .d-flex is display:flex !important and beats the
   [hidden] attribute, so the row showed on every state; display is only set while it is not hidden. */
.integration-tile-choose:not([hidden]) {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.5rem;
}

/* Pagamenti: the explanations fold away inside the card, so it keeps the size of its neighbours. */
.integration-tile-inline-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.integration-tile-inline-form .integration-tile-actions {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.integration-tile-details {
  width: 100%;
  margin-top: 0.5rem;
  text-align: left;
  font-size: var(--font-size-sm);
  color: var(--bs-secondary-color);
}

.integration-tile-details > summary {
  cursor: pointer;
  text-align: center;
  color: var(--bs-link-color);
}

.integration-tile-details[hidden] {
  display: none;
}

.integration-tile-details > p {
  margin: 0.5rem 0 0;
}

.integration-tile:hover {
  border-color: rgba(var(--brand-green-rgb), 0.22);
  box-shadow:
    var(--shadow-popover);
  transform: translateY(-2px);
}

.integration-tile-icon-wrap .platform-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  font-size: var(--font-size-2xl);
  border-radius: var(--radius-md);
}

/* Brand tiles (settings hub is outside .social-connection-card — duplicate social-calendar colors) */
.integration-tile .platform-icon.instagram {
  background: linear-gradient(135deg, var(--color-instagram-orange) 0%, var(--color-instagram-warm) 25%, var(--color-instagram-mid) 50%, var(--color-instagram-deep) 75%, var(--color-instagram-ink) 100%);
  color: var(--color-surface);
}

.integration-tile .platform-icon.facebook {
  background: var(--color-facebook);
  color: var(--color-surface);
}

/* TikTok: solid black tile + cyan/red “glitch” glow on the glyph (brand cue) */
.integration-tile .platform-icon.tiktok {
  background: var(--color-ink-pure);
  color: var(--color-surface);
}

.integration-tile .platform-icon.tiktok i {
  filter: drop-shadow(-1.25px -1.25px 0 rgba(37, 244, 238, 0.9)) drop-shadow(1.25px 1.25px 0 rgba(254, 44, 85, 0.95));
}

.integration-tile .platform-icon.whatsapp {
  background: var(--color-whatsapp);
  color: var(--color-surface);
}

.platform-icon.platform-icon--settings-google {
  background: var(--color-surface);
  color: inherit;
  border: 1px solid rgba(var(--rgb-ink), 0.1);
  box-shadow: var(--shadow-xs);
}

.platform-icon--settings-google .integration-brand-svg--google {
  display: block;
}

.platform-icon.platform-icon--settings-whatsapp {
  background: var(--color-whatsapp);
  color: var(--color-surface);
  border-radius: 22%;
}

.platform-icon--settings-whatsapp .integration-brand-svg--whatsapp {
  display: block;
}

.platform-icon.platform-icon--settings-meta {
  background: var(--color-surface);
  color: inherit;
  border: 1px solid rgba(var(--rgb-ink), 0.1);
  box-shadow: var(--shadow-xs);
}

.integration-brand-img--meta {
  width: 1.625rem;
  height: 1.625rem;
}

/* Fatture in Cloud: the mark is taller than wide (viewBox 229×217), so keep it inside the tile glyph size. */
.integration-brand-img--fic {
  width: 1.875rem;
  height: 1.875rem;
}

.platform-icon.platform-icon--settings-automation {
  background: var(--color-surface);
  color: inherit;
  border: 1px solid rgba(var(--rgb-ink), 0.1);
  box-shadow: var(--shadow-xs);
}

.integration-brand-dual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.integration-brand-img {
  display: block;
  width: 1.375rem;
  height: 1.375rem;
  object-fit: contain;
}

.integration-tile-header {
  position: relative;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 3.25rem;
}

.integration-tile-header .integration-tile-icon-wrap {
  margin: 0;
}

.integration-tile-label {
  font-weight: 600;
  font-size: var(--font-size-caption);
  color: var(--color-text-emphasis);
  margin-top: 0.75rem;
}

/* Compact status pills (dashboard integrations) */
.integration-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.integration-status-pill--muted {
  font-weight: 600;
}

.integration-status-dot {
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  flex-shrink: 0;
  border-radius: var(--radius-round);
  background: currentColor;
  opacity: 0.92;
}

.integration-status-pill.text-bg-success .integration-status-dot {
  background: currentColor;
  opacity: 0.92;
  box-shadow: none;
}

.integration-status-icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.integration-status-icon i {
  font-size: 0.82em;
  vertical-align: -0.05em;
}

.integration-tile-badge-row {
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
  min-height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex-shrink: 0;
}

.integration-tile-badge-row .badge.text-bg-light {
  border: 1px solid var(--color-border);
  color: var(--color-text-muted) !important;
}

.integration-tile #wabaStatusBadge.waba-status-badge.badge {
  gap: 0.38rem;
}

.integration-tile-actions {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 1rem;
  width: 100%;
  flex-shrink: 0;
}

.integration-tile-actions form {
  margin: 0;
}

@media (max-width: 576px) {
  /* Connessioni as a compact list: each card takes the .integration-row anatomy (icon | title,
     status, actions) instead of a tall centred card. The description is dropped; group cards keep theirs. */
  .settings-tiles-grid {
    gap: 0.75rem;
  }

  .integration-tile:not(.integration-tile--group) {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    column-gap: 0.75rem;
    row-gap: 0.2rem;
    align-items: start;
    text-align: left;
    min-height: 0;
    padding: 0.85rem 1rem;
  }

  .integration-tile:not(.integration-tile--group) > * {
    grid-column: 2;
  }

  .integration-tile:not(.integration-tile--group) > .integration-tile-header {
    grid-column: 1;
    grid-row: 1 / span 2;
    min-height: 0;
    justify-content: flex-start;
  }

  .integration-tile:not(.integration-tile--group) .integration-tile-icon-wrap .platform-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: var(--font-size-xl);
  }

  .integration-tile:not(.integration-tile--group) .integration-brand-svg {
    width: 22px;
    height: 22px;
  }

  .integration-tile:not(.integration-tile--group) > .integration-tile-label {
    margin-top: 0;
    font-size: var(--font-size-sm);
  }

  .integration-tile:not(.integration-tile--group) > .integration-tile-desc {
    display: none;
  }

  .integration-tile-badge-row,
  .integration-tile-actions,
  .integration-tile-inline-form .integration-tile-actions {
    justify-content: flex-start;
  }

  .integration-tile-badge-row {
    min-height: 0;
    margin: 0.15rem 0 0;
  }

  .integration-tile-actions {
    margin-top: 0;
    padding-top: 0.5rem;
  }

  .integration-tile-inline-form {
    align-items: stretch;
  }

  .integration-tile-details > summary {
    text-align: left;
  }

  .integration-tile:hover {
    transform: none;
  }
}

/* «Disconnetti» text links: a full 44px tap target on phones. */
@media (max-width: 768px) {
  .integration-disconnect-btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  /* Collega un agente: the server address on its own line, one large copy button under it. */
  .mcp-endpoint-group {
    flex-direction: column;
    gap: 0.5rem;
  }

  .mcp-endpoint-group > .form-control,
  .mcp-endpoint-group > .btn {
    width: 100%;
    margin-left: 0 !important;
    border-radius: var(--bs-border-radius) !important;
  }

  .mcp-endpoint-group > .btn {
    min-height: 44px;
    font-size: var(--bs-body-font-size);
  }
}

#whatsappConnectionModal .waba-detail-row {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem;
  text-align: left;
}

#whatsappConnectionModal .waba-status-body {
  text-align: left;
}

#whatsappConnectionModal .waba-actions {
  justify-content: flex-start;
}

/* Google Calendar tile: account + which calendar Carla syncs */
.integration-tile-account {
  max-width: 100%;
}

.integration-tile-hint {
  max-width: 17rem;
  line-height: 1.45;
}

.google-calendar-current {
  margin-top: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-md);
  background: rgba(var(--brand-green-rgb), 0.06);
  border: 1px solid rgba(var(--brand-green-rgb), 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 0;
}

.google-calendar-current__label {
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
}

.google-calendar-current__value {
  font-weight: 600;
  color: var(--brand-green-ink);
}

.google-calendar-current__id {
  display: block;
  max-width: 100%;
  font-size: var(--font-size-2xs);
  color: var(--color-text-muted);
}

.google-calendar-option {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.google-calendar-option .form-check-input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.google-calendar-option:has(.form-check-input:checked) {
  border-color: var(--brand-green);
  background: rgba(var(--brand-green-rgb), 0.06);
}

.google-calendar-option__title {
  display: block;
  font-weight: 600;
  color: var(--color-text-emphasis);
}

.google-calendar-option__text {
  display: block;
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.settings-legacy-manual .card-header {
  background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
}

/* Per-canale Carla: Messaggi toggle (Connessioni / Impostazioni) */
.social-connection-card .autoreply-msg-toggle {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  margin-top: 0.35rem;
}

.integration-tile .autoreply-msg-toggle {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
  margin-top: 0.65rem;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.15rem 0.15rem;
  text-align: left;
  border: none;
  background: transparent;
  box-shadow: none;
  flex-shrink: 0;
}

.autoreply-msg-toggle {
  box-sizing: border-box;
  transition: opacity 0.15s ease;
}

.autoreply-msg-toggle--inactive {
  opacity: 0.88;
}

.autoreply-msg-toggle__control.carla-toggle-switch.form-switch {
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 0;
  padding-inline-start: 0 !important;
}

.autoreply-msg-toggle__control .form-check-label {
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-caption);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-ink-slate);
  cursor: pointer;
  text-align: left;
}

.autoreply-msg-toggle__control .form-check-input {
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.autoreply-msg-toggle__control .form-check-input:disabled {
  cursor: not-allowed;
}

.autoreply-msg-toggle__note {
  margin: 0.35rem 0 0;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(var(--rgb-ink), 0.08);
  font-size: var(--font-size-2xs);
  line-height: 1.35;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* Posta — modal “Collega un account di posta” (IMAP/SMTP) */
#addAccountModal .posta-preset-grid .preset-btn {
  min-height: var(--control-height);
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-pill);
}

#addAccountModal .posta-preset-grid .btn-check:focus-visible + .preset-btn {
  box-shadow: var(--focus-ring);
}

#addAccountModal .posta-preset-grid .btn-check:checked + .preset-btn {
  font-weight: 700;
}

#addAccountModal .posta-modal-security-note {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--brand-green);
  font-size: var(--font-size-caption);
  color: var(--color-text-secondary);
  line-height: 1.45;
}

#addAccountModal .posta-modal-security-note .bi-shield-check {
  color: var(--brand-green-hover);
  font-size: var(--font-size-base);
  line-height: 1.2;
  margin-top: 0.08rem;
}

#addAccountModal .modal-footer .btn {
  font-weight: 600;
}

/* Posta inbox — account bar + message list */
.posta-inbox-page .admin-dashboard-header {
  margin-bottom: 1rem;
}

.posta-account-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-alt);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
}

.posta-account-bar__identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 12rem;
}

.posta-account-bar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--media-step-violet-soft);
  color: var(--brand-green-hover);
  font-size: var(--font-size-xl);
  flex-shrink: 0;
}

.posta-account-bar__icon--gmail {
  background: var(--color-danger-surface);
  color: var(--color-google);
}

.posta-account-bar__icon--outlook {
  background: var(--color-info-surface);
  color: var(--color-microsoft);
}

.posta-account-bar__icon--aruba {
  background: var(--color-warning-surface-alt);
  color: var(--color-orange-600);
}

.posta-account-bar__text {
  min-width: 0;
}

.posta-account-bar__provider {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-ink-slate);
  line-height: 1.25;
}

.posta-account-bar__email {
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(28rem, 70vw);
}

.posta-account-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.posta-inbox-page .account-dropdown .dropdown-toggle::after {
  content: '';
  border: none;
  margin: 0;
  padding: 0;
}

.posta-inbox-page .account-dropdown .dropdown-menu {
  border: 1px solid var(--color-border-alt);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-card);
  min-width: 240px;
}

.posta-inbox-page .account-dropdown .dropdown-item {
  font-size: var(--font-size-sm);
  padding: 0.5rem 1rem;
  color: var(--color-gray-700);
  border-radius: var(--radius-xs);
  margin: 0.2rem 0.4rem;
}

.posta-inbox-page .account-dropdown .dropdown-item:hover {
  background-color: var(--media-step-violet-soft);
  color: var(--brand-green-hover);
}

.posta-inbox-page .account-dropdown .dropdown-item.active {
  background-color: var(--brand-green-50);
  color: var(--brand-green-hover);
  font-weight: 600;
}

.posta-inbox-page .account-dropdown .dropdown-item small {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 0.15rem;
}

/* Three-pane mail client: folders · message list · reader/composer */
.posta-mail {
  display: grid;
  grid-template-columns: 200px minmax(280px, 360px) minmax(0, 1fr);
  height: calc(100vh - 290px);
  min-height: 560px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-alt);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.posta-mail__rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0.75rem;
  background: var(--color-surface-subtle);
  border-right: 1px solid var(--color-border-alt);
  overflow-y: auto;
}

.posta-compose-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  font-weight: 600;
}

.posta-folders {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.posta-folder-tab {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--color-gray-700);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.posta-folder-tab .bi {
  font-size: var(--font-size-md);
  color: var(--color-text-muted);
}

.posta-folder-tab:hover {
  background: var(--brand-green-50);
  color: var(--brand-green-hover);
}

.posta-folder-tab.active {
  background: var(--brand-green-50);
  color: var(--brand-green-strong);
  font-weight: 600;
}

.posta-folder-tab.active .bi {
  color: var(--brand-green-hover);
}

.posta-folder-tab:focus-visible,
.posta-inbox-page .message-item:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: -2px;
}

.posta-inbox-page .message-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--color-border-alt);
}

.posta-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-alt);
}

.posta-list-title {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-ink-slate);
}

#messageListContent {
  flex: 1;
  overflow-y: auto;
}

.posta-folder-badge {
  margin-left: auto;
  min-width: 1.4rem;
  padding: 0 0.4rem;
  border-radius: var(--radius-pill);
  background: var(--brand-green);
  color: var(--neutral-0);
  font-size: var(--font-size-xs);
  font-weight: 700;
  line-height: 1.4rem;
  text-align: center;
}

.posta-autoreply {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem 0.6rem 2.9rem;
  border-radius: var(--radius-xs);
  background: var(--brand-green-50);
  font-size: var(--font-size-sm);
}

.posta-autoreply small {
  margin-top: 0.2rem;
  font-size: var(--font-size-xs);
  line-height: 1.35;
}

.posta-draft {
  margin: 0 1rem 1rem;
  border: 1px solid var(--brand-green);
  border-radius: var(--radius-xs);
  background: var(--neutral-0);
}

.posta-draft__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem 0.2rem;
  color: var(--brand-green-strong);
  font-weight: 600;
}

.posta-draft__reason {
  margin-left: auto;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

.posta-draft__meta {
  padding: 0 1rem 0.5rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.posta-draft__body {
  display: block;
  width: calc(100% - 2rem);
  margin: 0 1rem;
}

.posta-draft__booking {
  margin: 0.75rem 1rem 0;
  padding-left: 2.5rem;
}

.posta-draft__original {
  margin: 0 1rem 0.5rem;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.posta-search {
  position: relative;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--color-border-alt);
}

.posta-search .bi {
  position: absolute;
  top: 50%;
  left: 1.6rem;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  pointer-events: none;
}

.posta-search input {
  padding-left: 2rem;
}

.posta-load-more {
  display: flex;
  justify-content: center;
  padding: 0.75rem;
}

.posta-inbox-page .message-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  border-bottom: 1px solid var(--color-border-alt);
  border-left: 3px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.posta-inbox-page .message-item:hover {
  background: var(--color-surface-subtle);
}

.posta-inbox-page .message-item.active {
  background: var(--brand-green-50);
  border-left-color: var(--brand-green);
}

.message-item-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--brand-green-50);
  color: var(--brand-green-ink);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.message-item-avatar--lg {
  width: 2.75rem;
  height: 2.75rem;
  font-size: var(--font-size-sm);
}

.message-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.message-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.posta-inbox-page .message-item-from {
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.posta-inbox-page .message-item-subject {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.posta-inbox-page .message-item-date {
  flex-shrink: 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-faint);
}

/* Unread: bold sender + subject and a green dot, like every mail client. */
.posta-inbox-page .message-item.unread .message-item-from,
.posta-inbox-page .message-item.unread .message-item-subject {
  color: var(--color-ink-slate);
  font-weight: 700;
}

.posta-inbox-page .message-item.unread .message-item-date {
  color: var(--brand-green-hover);
  font-weight: 600;
}

.posta-inbox-page .message-item.unread .message-item-avatar {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}

.posta-inbox-page .message-viewer {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
}

#messageViewerContent {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

.posta-inbox-page .message-header {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-alt);
}

.message-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.posta-inbox-page .message-header h3 {
  margin: 0;
  font-size: var(--font-size-xl);
  color: var(--color-ink-deep);
  overflow-wrap: anywhere;
}

.message-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.4rem;
}

/* Sender as Customer/Lead: one quiet line, links out to CRM and calendar. */
.posta-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.85rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--brand-green-100);
  border-radius: var(--radius-xs);
  background: var(--brand-green-50);
  font-size: var(--font-size-sm);
}

.posta-contact.d-none {
  display: none;
}

.posta-contact__icon {
  color: var(--brand-green-hover);
  font-size: var(--font-size-md);
}

.posta-contact__text {
  display: flex;
  flex: 1 1 16rem;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  min-width: 0;
  color: var(--color-gray-700);
}

.posta-contact__kind {
  font-weight: 700;
  color: var(--brand-green-strong);
}

.posta-contact__fact::before {
  content: '·';
  margin-right: 0.6rem;
  color: var(--color-text-muted);
}

.posta-contact__next {
  flex-basis: 100%;
  font-weight: 600;
  color: var(--color-ink-slate);
}

.posta-contact__links {
  display: flex;
  gap: 0.4rem;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.message-attachment {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--color-border-alt);
  border-radius: var(--radius-xs);
  background: var(--color-surface-subtle);
  color: var(--color-gray-700);
  font-size: var(--font-size-sm);
  text-decoration: none;
}

.message-attachment:hover,
.message-attachment:focus-visible {
  border-color: var(--brand-green);
  color: var(--brand-green-strong);
}

.message-attachment__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
}

.message-attachment__size {
  flex-shrink: 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

.message-sender {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.message-sender__text {
  flex: 1;
  min-width: 0;
}

.message-sender__name {
  font-weight: 600;
  color: var(--color-ink-slate);
  overflow-wrap: anywhere;
}

.message-sender__email,
.message-sender__to {
  font-size: var(--font-size-sm);
  font-weight: 400;
  color: var(--color-text-muted);
  overflow-wrap: anywhere;
}

.message-sender__date {
  flex-shrink: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.posta-inbox-page .message-body {
  font-size: var(--font-size-md);
  line-height: 1.6;
  color: var(--color-gray-700);
}

/* The sender's HTML renders inside a sandboxed frame, never in the app DOM. */
.posta-inbox-page .message-frame {
  display: block;
  width: 100%;
  min-height: 360px;
  height: 55vh;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--surface-elevated);
}

/* While replying, shrink the message so the reply box sits in view under it. */
.posta-inbox-page .message-viewer:has(.posta-composer--inline:not(.d-none)) .message-frame {
  min-height: 200px;
  height: 30vh;
}

.posta-inbox-page .empty-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 1;
  min-height: 12rem;
  color: var(--color-gray-400);
  text-align: center;
}

.posta-empty-icon {
  font-size: var(--font-size-6xl);
  color: var(--color-gray-300);
  margin-bottom: 1rem;
}

/* Composer: whole pane for new mail and drafts, a card under the message for replies. */
.posta-composer {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  border: 1px solid var(--color-border-alt);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.posta-composer.d-none {
  display: none;
}

.posta-composer--inline {
  flex: 0 0 auto;
  margin-top: 1.25rem;
  box-shadow: var(--shadow-card);
}

.posta-composer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--color-border-alt);
  background: var(--color-surface-subtle);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.posta-composer__title {
  font-weight: 600;
  color: var(--color-ink-slate);
}

.posta-composer__head-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.posta-composer__field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--color-border-alt);
}

.posta-composer__field label {
  flex-shrink: 0;
  min-width: 4.5rem;
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.posta-composer__field input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0;
  border: none;
  background: transparent;
  color: var(--color-ink-slate);
  font-size: var(--font-size-sm);
}

.posta-composer__field input:focus,
.posta-composer__body:focus {
  outline: none;
}

.posta-composer__field:focus-within {
  border-bottom-color: var(--brand-green);
}

.posta-composer__body {
  flex: 1;
  min-height: 12rem;
  padding: 0.85rem 1rem;
  border: none;
  background: transparent;
  resize: vertical;
  font-size: var(--font-size-md);
  line-height: 1.6;
  color: var(--color-gray-700);
}

.posta-composer__signature {
  padding: 0 1rem 0.5rem;
}

.posta-composer__signature .gmail-reply-signature {
  min-height: 2rem;
  padding: 0.5rem 0 0;
  border-top: 1px dashed var(--color-border-alt);
  background: transparent;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.posta-composer__signature .gmail-reply-signature:focus {
  outline: none;
  color: var(--color-gray-700);
}

.posta-composer__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border-alt);
}

@media (max-width: 1200px) {
  .posta-mail {
    grid-template-columns: 170px minmax(240px, 300px) minmax(0, 1fr);
  }
}

@media (max-width: 992px) {
  .posta-mail {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(100vh - 320px);
  }

  .posta-mail__rail {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-right: none;
    border-bottom: 1px solid var(--color-border-alt);
  }

  .posta-compose-btn {
    width: auto;
  }

  .posta-folders {
    flex-direction: row;
    overflow-x: auto;
  }

  .posta-folder-tab {
    width: auto;
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .posta-account-bar {
    flex-direction: column;
    align-items: stretch;
  }

  /* In a column, the desktop flex-basis (12rem) would become a 12rem-tall gap. */
  .posta-account-bar__identity {
    flex: 0 0 auto;
  }

  .posta-account-bar__actions {
    justify-content: flex-start;
  }

  .posta-account-bar__actions .btn,
  .posta-account-bar__actions .dropdown {
    flex: 1 1 auto;
  }

  .posta-mail {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  .posta-mail__rail {
    flex-wrap: wrap;
  }

  .posta-inbox-page .message-list {
    max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid var(--color-border-alt);
  }

  .posta-inbox-page .message-viewer {
    min-height: 50vh;
    padding: 1rem;
  }

  .message-header__top,
  .message-sender {
    flex-wrap: wrap;
  }

  .message-sender__date {
    flex-basis: 100%;
    padding-left: 3.5rem;
  }
}

/* --------------------------------------------------------------------------
   Informazioni — 3-card CBT / LMS-style module dashboard
   -------------------------------------------------------------------------- */

.account-info-page .info-modules-progress {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-alt);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.info-modules-progress__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.info-modules-progress__label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-emphasis);
}

.info-modules-progress-track {
  height: 6px;
  background: var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.info-modules-progress-fill {
  width: var(--pct, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--brand-green) 0%, var(--brand-green-hover) 100%);
  border-radius: var(--radius-pill);
  transition: width 0.35s ease;
}

.day-studio-selector.is-placeholder {
  color: var(--brand-green);
  font-style: italic;
}

.day-studio-selector.is-placeholder option {
  color: var(--brand-green);
}

.info-modules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 992px) {
  .info-modules-grid {
    grid-template-columns: 1fr;
  }
}

/* Brand — sezione separata sotto i 3 moduli profilo */
.info-brand-section {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 2px solid var(--color-border);
}

.info-brand-section__header {
  margin-bottom: 1rem;
}

.info-brand-section__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-ink-slate);
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-brand-section__title i {
  color: var(--brand-green);
}

.info-brand-section__subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.info-module-card--brand {
  border-left-color: var(--brand-green);
  max-width: 100%;
}

.info-module-card--brand.is-complete {
  border-left-color: var(--brand-green-hover);
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--media-step-violet-soft) 100%);
}

.info-module-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  padding: 1.25rem 1.35rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-alt);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-border-muted);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.info-module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-popover);
  border-color: var(--brand-green-200);
}

.info-module-card:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 2px;
}

.info-module-card.is-complete {
  border-left-color: var(--brand-green);
}

.info-module-card__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 0.75rem;
}

.info-module-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--brand-green-surface);
  color: var(--brand-green);
  font-size: var(--font-size-xl);
  flex-shrink: 0;
}

.info-module-card.is-complete .info-module-card__icon {
  background: var(--brand-green);
  color: var(--color-surface);
}

.info-module-badge {
  margin-left: auto;
  font-weight: 600;
  white-space: nowrap;
}

.info-module-badge--complete {
  background: var(--brand-green-100);
  color: var(--brand-green-ink);
}

.info-module-badge--complete i {
  margin-right: 0.15rem;
}

.info-module-badge--pending {
  background: var(--color-surface-3);
  color: var(--color-text-muted);
}

.info-module-card__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-ink-slate);
  margin: 0 0 0.35rem;
}

.info-module-card__desc {
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
  margin: 0 0 0.65rem;
  line-height: 1.45;
}

.info-module-card__preview {
  font-size: var(--font-size-caption);
  color: var(--color-text-secondary);
  margin: 0 0 0.85rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.25rem;
}

.info-module-card__cta {
  font-size: var(--font-size-caption);
  font-weight: 600;
  color: var(--brand-green);
  margin-top: auto;
}

.info-page-save-row {
  padding-top: 0.5rem;
}

/* Self-contained full-viewport dimming; html zoom 0.9 clips Bootstrap backdrop */
.account-info-modal.modal.show {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 1060 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  background: rgba(var(--rgb-black), 0.35) !important;
}

body.modal-open:has(.account-info-modal.show) > .modal-backdrop {
  display: none !important;
}

/* Section modals */
.info-section-modal .modal-header.info-section-modal__header {
  background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
  border-bottom: 2px solid var(--brand-green);
}

.info-section-modal .modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand-green-ink);
  font-weight: 600;
}

.info-section-modal .modal-footer.info-section-modal__footer {
  border-top: 1px solid var(--color-border-alt);
  background: var(--color-surface-2);
  gap: 0.5rem;
}

/* Dati personali modal — wider dialog; schedule step uses single-column grid */
.modal-dati-personali-dialog {
  max-width: min(1140px, 96vw);
}

#modalDatiPersonali.is-schedule-step .modal-dati-personali-dialog {
  max-width: min(960px, 96vw);
}

#modalDatiPersonali .info-schedule-editor-wrap {
  overflow-x: visible;
}

#modalDatiPersonali #scheduleContainer {
  grid-template-columns: 1fr;
  gap: 10px;
}

.info-brand-kit-reminder {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: linear-gradient(135deg, var(--color-ai-surface) 0%, var(--media-step-violet-soft) 100%);
}

.info-brand-kit-reminder.is-complete {
  border-color: var(--brand-green-200);
  background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--media-step-violet-soft) 100%);
}

.info-brand-kit-reminder__title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-ink-slate);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-brand-kit-reminder__title i {
  color: var(--brand-green);
}

.account-brand-wizard-textarea {
  min-height: 7rem;
  resize: vertical;
}

.account-brand-wizard-error {
  font-size: var(--font-size-sm);
}

.profile-source-readonly {
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: linear-gradient(145deg, var(--color-surface-muted) 0%, var(--color-surface) 55%);
}

.profile-source-readonly-title {
  font-weight: 700;
  font-size: var(--font-size-sm);
  color: var(--color-ink-slate);
  margin-bottom: 0.35rem;
}

.profile-source-readonly-hint {
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.profile-source-readonly-list {
  margin: 0;
  padding: 0;
}

.profile-source-readonly-row {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr;
  gap: 0.35rem 1rem;
  margin-bottom: 0.5rem;
  font-size: var(--font-size-sm);
}

.profile-source-readonly-row dt {
  margin: 0;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.profile-source-readonly-row dd {
  margin: 0;
  color: var(--color-ink-slate);
}

.profile-source-readonly-link {
  color: var(--brand-green);
  text-decoration: none;
  font-weight: 600;
}

.profile-source-readonly-link:hover {
  text-decoration: underline;
}

.brand-wizard-textarea {
  min-height: 7rem;
  resize: vertical;
}

.brand-wizard-error {
  font-size: var(--font-size-sm);
}

/* Dati personali wizard inside modal */
.info-wizard-stepper-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.info-wizard-stepper-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
  background: var(--color-surface-3);
  transition: background 0.2s, color 0.2s;
}

.info-wizard-stepper-item.is-active {
  background: var(--brand-green);
  color: var(--color-surface);
  font-weight: 600;
}

.info-wizard-stepper-num {
  font-weight: 700;
  font-size: var(--font-size-xs);
}

.info-wizard-stepper-chevron {
  color: var(--color-gray-300);
  font-size: var(--font-size-xs);
}

.info-wizard-step-label {
  font-weight: 500;
}

.info-wizard-step {
  padding-top: 0.25rem;
}

@media (max-width: 576px) {
  .info-wizard-stepper-text {
    display: none;
  }

  .info-module-card {
    padding: 1rem;
  }
}

/* Posta / Gmail connect landing */
.posta-connect-hero-icon {
  font-size: var(--font-size-6xl);
  color: var(--brand-green);
}

.posta-connect-card-icon {
  font-size: var(--font-size-5xl);
}

#posta-config {
  display: none;
}

/* Customer edit form */
.customer-edit-page .form-select.customer-phone-prefix {
  max-width: 120px;
}

.customer-edit-page hr.customer-edit-divider {
  border-color: rgba(var(--brand-green-rgb), 0.2);
}

/* Lead webhook platform accordion icons */
.lead-webhook-platform-icon--meta {
  color: var(--color-facebook);
}

.lead-webhook-platform-icon--zapier {
  color: var(--brand-green);
}

.lead-webhook-platform-icon--make {
  color: var(--color-ai);
}

#accountData,
#dashboard-config {
  display: none;
}

.integration-tile-desc {
  line-height: 1.35;
}

.integration-tile-icon--lead {
  font-size: var(--font-size-2xl);
  color: var(--brand-green);
}

.gmail-reply-signature {
  min-height: 60px;
  background: var(--color-surface-2);
}

.clipboard-offscreen {
  position: fixed;
  top: -9999px;
  opacity: 0;
}

.settings-flash-toast {
  z-index: 9999;
  animation: settings-toast-slide 0.3s ease;
}

@keyframes settings-toast-slide {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#connectionTestResult {
  font-size: var(--font-size-sm);
}

#connectionTestResult.d-none {
  display: none !important;
}

/* CSP hardening: inline style="" attributes moved to classes (see app.py CSP). */
.account-narrow-form {
  max-width: 420px;
}

/* Treatwell dialog: chips, then a left-aligned numbered stepper */
.treatwell-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.treatwell-account {
  margin-top: 0.4rem;
  overflow-wrap: anywhere;
}

.treatwell-steps {
  list-style: none;
  counter-reset: treatwell-step;
  margin: 1.1rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.treatwell-step {
  counter-increment: treatwell-step;
  position: relative;
  padding-left: 2.1rem;
  min-width: 0;
}

.treatwell-step::before {
  content: counter(treatwell-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.treatwell-step.is-done::before {
  content: "\2713";
  color: var(--color-surface);
  background: var(--brand-green);
  border-color: var(--brand-green);
}

.treatwell-step-title {
  font-weight: 600;
}

.treatwell-step-text {
  margin-top: 0.15rem;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  color: var(--bs-secondary-color);
  overflow-wrap: anywhere;
}

.treatwell-step-action {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
}
