:root { font-family: Inter, system-ui, sans-serif; color: #1f2937; background: #f6f7f9; }
body { margin: 0; }
.portal-header { display:flex; justify-content:space-between; align-items:center; padding:1rem 1.4rem; background:#111827; color:white; }
.portal-header .muted { margin-left:.6rem; color:#cbd5e1; font-size:.9rem; }
.header-user { display:flex; gap:1rem; align-items:center; }
.portal-nav { display:flex; flex-wrap:wrap; gap:.25rem; padding:.65rem 1.2rem; background:white; border-bottom:1px solid #e5e7eb; }
.portal-nav a { color:#374151; text-decoration:none; padding:.5rem .65rem; border-radius:.35rem; }
.portal-nav a:hover { background:#f3f4f6; }
.portal-main { max-width:1180px; margin:0 auto; padding:1.4rem; }
.card { background:white; border:1px solid #e5e7eb; border-radius:.6rem; padding:1rem; margin-bottom:1rem; }
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:1rem; }
.metric strong { display:block; font-size:1.55rem; margin-top:.3rem; }
.muted { color:#6b7280; }
.badge { display:inline-block; padding:.2rem .45rem; border-radius:999px; background:#eef2ff; font-size:.8rem; }
.badge.published { background:#dcfce7; }
.badge.draft { background:#fef3c7; }
table { width:100%; border-collapse:collapse; background:white; }
th, td { padding:.65rem; border-bottom:1px solid #e5e7eb; text-align:left; vertical-align:top; }
th { font-size:.85rem; color:#4b5563; }
input, select, textarea { width:100%; box-sizing:border-box; padding:.6rem; border:1px solid #cbd5e1; border-radius:.4rem; background:white; }
textarea { min-height:150px; }
label { display:block; font-weight:600; margin-bottom:.3rem; }
.field { margin-bottom:1rem; }
.actions { display:flex; gap:.6rem; flex-wrap:wrap; align-items:center; }
button, .button { border:0; border-radius:.4rem; padding:.6rem .9rem; background:#2563eb; color:white; text-decoration:none; cursor:pointer; }
.button.secondary, button.secondary { background:#4b5563; }
.button.danger, button.danger { background:#b91c1c; }
.link-button { background:none; padding:0; color:#dbeafe; text-decoration:underline; }
.validation-summary-errors { color:#b91c1c; margin-bottom:1rem; }
.tenant-picker { display:flex; align-items:center; gap:.6rem; max-width:520px; margin-bottom:1rem; }
.tenant-picker label { margin:0; white-space:nowrap; }
.login-card { max-width:430px; margin:5rem auto; }
.preview-image { max-width:420px; max-height:420px; border-radius:.5rem; border:1px solid #e5e7eb; }
.notice { padding:.75rem; border-radius:.4rem; background:#eff6ff; margin-bottom:1rem; }
.error { background:#fef2f2; color:#991b1b; }
.success { background:#f0fdf4; color:#166534; }

/* M19.5A - Admin tenant list */
.page-heading { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; margin-bottom:1rem; }
.page-heading h1 { margin-top:0; margin-bottom:.35rem; }
.admin-filter-card .field { margin-bottom:0; }
.admin-filter-grid { margin-bottom:1rem; }
.tenant-list-summary { margin:.5rem 0 1rem; color:#4b5563; }
.tenant-table-card { padding:0; overflow:hidden; }
.table-scroll { overflow-x:auto; }
.tenant-admin-table { min-width:1040px; }
.tenant-admin-table td { min-width:110px; }
.tenant-admin-table td:first-child { min-width:210px; }
.tenant-id { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:.72rem; margin-top:.25rem; word-break:break-all; }
.status-pill { display:inline-flex; align-items:center; border-radius:999px; padding:.25rem .55rem; font-size:.78rem; font-weight:600; white-space:nowrap; }
.status-pill.compact { margin-top:.35rem; padding:.15rem .45rem; font-size:.72rem; }
.status-active { background:#dcfce7; color:#166534; }
.status-ready { background:#dbeafe; color:#1d4ed8; }
.status-warning { background:#fef3c7; color:#92400e; }
.status-danger { background:#fee2e2; color:#991b1b; }
.status-neutral { background:#f3f4f6; color:#4b5563; }
.status-detail { margin-top:.35rem; font-size:.76rem; }
.warning-text { color:#92400e; }
.channel-line { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; margin-bottom:.35rem; }
.empty-state { padding:2rem 1rem; text-align:center; }
.empty-state .muted { margin-top:.35rem; }
.pagination { display:flex; justify-content:center; align-items:center; gap:.75rem; margin:1rem 0 2rem; }
@media (max-width: 720px) {
    .page-heading { flex-direction:column; }
    .page-heading .button { width:100%; box-sizing:border-box; text-align:center; }
}


/* M19.5B - Admin tenant edit */
.compact-action { display:inline-block; padding:.4rem .65rem; font-size:.82rem; }
.back-link { display:inline-block; margin-bottom:.65rem; color:#2563eb; text-decoration:none; }
.back-link:hover { text-decoration:underline; }
.status-stack { display:flex; flex-direction:column; align-items:flex-end; gap:.4rem; }
.admin-edit-grid { display:grid; grid-template-columns:minmax(0, 2fr) minmax(300px, 1fr); gap:1rem; align-items:start; }
.admin-edit-main h2, .admin-edit-sidebar h2 { margin-top:0; }
.field-hint { margin-top:.35rem; color:#6b7280; font-size:.82rem; }
.checklist-line { display:grid; grid-template-columns:26px 1fr; gap:.6rem; padding:.7rem 0; border-bottom:1px solid #f3f4f6; }
.checklist-line > span:first-child { display:flex; align-items:center; justify-content:center; width:24px; height:24px; border-radius:999px; font-weight:700; }
.check-ok > span:first-child { background:#dcfce7; color:#166534; }
.check-warning > span:first-child { background:#fef3c7; color:#92400e; }
.check-neutral > span:first-child { background:#f3f4f6; color:#6b7280; }
.readiness-summary { margin-top:1rem; padding-top:.85rem; border-top:1px solid #e5e7eb; }
.channel-summary-row { display:flex; justify-content:space-between; gap:.75rem; align-items:center; padding:.65rem 0; border-bottom:1px solid #f3f4f6; }
.channel-summary-row:last-child { border-bottom:0; }
.channel-summary-row > div { display:flex; gap:.45rem; align-items:center; flex-wrap:wrap; }
.detail-list { margin:0; }
.detail-list > div { padding:.55rem 0; border-bottom:1px solid #f3f4f6; }
.detail-list > div:last-child { border-bottom:0; }
.detail-list dt { font-size:.78rem; font-weight:600; color:#6b7280; }
.detail-list dd { margin:.2rem 0 0; }
@media (max-width: 900px) {
    .admin-edit-grid { grid-template-columns:1fr; }
    .status-stack { align-items:flex-start; }
}

/* M19.5C - explicit tenant lifecycle controls */
.status-suspended { background:#fee2e2; color:#991b1b; }
.lifecycle-card form { margin-top:1rem; }
.lifecycle-state { display:flex; flex-direction:column; gap:.25rem; padding:.8rem; border-radius:.5rem; margin-bottom:1rem; }
.lifecycle-state strong { font-size:.9rem; letter-spacing:.04em; }
.lifecycle-active { background:#f0fdf4; color:#166534; }
.lifecycle-onboarding { background:#eff6ff; color:#1d4ed8; }
.lifecycle-suspended { background:#fef2f2; color:#991b1b; }
.activation-blockers, .activation-warnings { padding:.75rem; border-radius:.45rem; margin:.75rem 0; }
.activation-blockers { background:#fef2f2; color:#991b1b; }
.activation-warnings { background:#fffbeb; color:#92400e; }
.activation-blockers ul, .activation-warnings ul { margin:.45rem 0 0; padding-left:1.2rem; }
.confirmation-check { display:flex; align-items:flex-start; gap:.55rem; font-weight:500; margin:.75rem 0; }
.confirmation-check input { width:auto; margin-top:.2rem; }
.danger-zone { border-top:1px solid #fecaca; margin-top:1rem; padding-top:1rem; }
button:disabled { background:#9ca3af; cursor:not-allowed; }

/* F04.1 - checkbox alignment for long consent/recovery labels. */
.checkbox-line,
.checkbox-field > label {
    display:flex;
    align-items:flex-start;
    gap:.55rem;
    font-weight:500;
    line-height:1.45;
}
.checkbox-line input[type="checkbox"],
.checkbox-field > label input[type="checkbox"] {
    width:auto;
    flex:0 0 auto;
    margin:.22rem 0 0;
}
.checkbox-line > span,
.checkbox-field > label > span {
    flex:1 1 auto;
    min-width:0;
}
.qra-pending-cancel-form { margin:0; }
.qra-pending-cancel-form .button { width:100%; }

/* M19.7 Portal access administration */
.portal-access-grant-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:1rem; }
.portal-access-table-heading { padding:1rem 1rem 0; }
.portal-access-table-heading h2 { margin:0; }
.portal-access-table { min-width:980px; }
.portal-access-actions { display:flex; flex-direction:column; gap:.55rem; min-width:190px; }
.portal-access-actions form { display:flex; gap:.45rem; align-items:center; margin:0; }
.portal-access-actions select { min-width:92px; }
.empty-state { padding:1rem; color:#4b5563; }
@media (max-width: 760px) {
    .portal-access-grant-grid { grid-template-columns:1fr; }
}

/* M19.8B - tenant audit history */
.audit-filter-card h2 { margin-top:0; }
.audit-filter-grid { display:grid; grid-template-columns:1.15fr 1.6fr 1fr 1fr; gap:1rem; }
.audit-filter-grid .field { margin-bottom:0; }
.audit-timeline { display:flex; flex-direction:column; gap:.8rem; }
.audit-event-card { margin-bottom:0; }
.audit-event-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; }
.audit-event-heading > div { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.audit-event-heading time { color:#6b7280; font-size:.8rem; white-space:nowrap; }
.audit-summary { font-size:.95rem; }
.audit-meta-list { display:grid; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); gap:.65rem 1rem; margin:.85rem 0 0; padding-top:.75rem; border-top:1px solid #f3f4f6; }
.audit-meta-list > div { min-width:0; }
.audit-meta-list dt { font-size:.75rem; font-weight:600; color:#6b7280; }
.audit-meta-list dd { margin:.2rem 0 0; word-break:break-word; }
.audit-meta-list .tenant-id { display:block; margin-top:.2rem; }
.audit-detail-list { margin:.75rem 0 0; padding:.7rem .7rem .7rem 1.8rem; border-radius:.45rem; background:#f9fafb; color:#374151; }
.audit-detail-list li + li { margin-top:.3rem; }
@media (max-width: 900px) {
    .audit-filter-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
    .audit-event-heading { flex-direction:column; }
}
@media (max-width: 620px) {
    .audit-filter-grid { grid-template-columns:1fr; }
}

/* M19.8C - Admin onboarding polish */
.onboarding-progress { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:.75rem; margin:1rem 0; }
.onboarding-progress-step { display:flex; gap:.7rem; align-items:flex-start; background:white; border:1px solid #e5e7eb; border-radius:.6rem; padding:.85rem; }
.onboarding-progress-step > span { display:flex; align-items:center; justify-content:center; flex:0 0 28px; width:28px; height:28px; border-radius:999px; background:#dbeafe; color:#1d4ed8; font-weight:700; }
.onboarding-progress-step strong { display:block; margin-bottom:.2rem; }
.onboarding-progress-step small { color:#6b7280; line-height:1.35; }
.onboarding-snapshot-heading { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; }
.onboarding-snapshot-heading h2 { margin:0 0 .25rem; }
.onboarding-metrics { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:.75rem; margin-top:.9rem; }
.onboarding-metric { padding:.8rem; border:1px solid #e5e7eb; border-radius:.5rem; background:#f9fafb; }
.onboarding-metric span { display:block; color:#6b7280; font-size:.8rem; }
.onboarding-metric strong { display:block; margin-top:.25rem; font-size:1.35rem; }
.provisioning-diagnostic > strong { display:block; margin-bottom:.45rem; }
.diagnostic-next-step { margin-top:.4rem; padding:.65rem; border-radius:.4rem; background:rgba(255,255,255,.55); }
.diagnostic-next-step span { display:block; font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.diagnostic-next-step p { margin:.25rem 0 0; }
.diagnostic-code { margin-top:.45rem; font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:.72rem; opacity:.8; }
.submission-status { font-size:.8rem; }
.next-step-callout { margin-top:.85rem; padding:.75rem; border-left:4px solid #2563eb; background:#eff6ff; border-radius:.35rem; color:#1e3a8a; }
.technical-details { margin-top:.85rem; border-top:1px solid #e5e7eb; padding-top:.75rem; }
.technical-details summary { cursor:pointer; font-weight:600; color:#374151; }
.technical-details .detail-list { margin-top:.5rem; }
@media (max-width: 760px) {
    .onboarding-progress, .onboarding-metrics { grid-template-columns:1fr; }
    .onboarding-snapshot-heading { flex-direction:column; }
}

/* M19.8C.2 - tenant management and lifecycle polish */
.notice.warning { background:#fffbeb; color:#92400e; }
.lifecycle-timeline { margin-bottom:1rem; }
.readiness-action-list li { margin-bottom:.55rem; }
.readiness-action-list li:last-child { margin-bottom:0; }
.readiness-action-list li > span { display:block; }
.readiness-action-list a, .readiness-inline-action { display:inline-block; margin-top:.25rem; color:#1d4ed8; font-size:.82rem; font-weight:600; text-decoration:none; }
.readiness-action-list a:hover, .readiness-inline-action:hover { text-decoration:underline; }
.destructive-action-notice { border-left:4px solid #d97706; }

/* M19.9B - Portal Telegram bot visibility */
.telegram-management-grid { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:1rem; align-items:start; }
.telegram-card-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; margin-bottom:.75rem; }
.telegram-card-heading h2 { margin:.55rem 0 0; }
.telegram-health-card p { line-height:1.5; }
.telegram-recommended-action { margin:.85rem 0; padding:.75rem; border-left:4px solid #2563eb; border-radius:.35rem; background:#eff6ff; }
.telegram-recommended-action p { margin:.3rem 0 0; }
.telegram-health-details { margin-top:.8rem; }
.telegram-error-message { display:block; margin-top:.25rem; color:#991b1b; }
.telegram-empty-state { text-align:center; padding:2rem 1rem; }
.telegram-empty-state h2 { margin:.8rem 0 .4rem; }
@media (max-width: 820px) {
    .telegram-management-grid { grid-template-columns:1fr; }
}

/* M19.9C - Telegram profile management */
.telegram-profile-card { margin-top:1rem; }
.telegram-profile-card .stacked-form { max-width:760px; }
.telegram-profile-card .form-field { margin-bottom:1rem; }
.telegram-profile-card textarea { min-height:90px; }
.telegram-profile-card .validation-message { display:block; margin-top:.3rem; color:#b91c1c; font-size:.82rem; }
.telegram-profile-card .section-divider { border:0; border-top:1px solid #e5e7eb; margin:1.25rem 0; }
.telegram-profile-card input[readonly] { background:#f3f4f6; color:#4b5563; }
.telegram-live-check-note { margin-top:-.35rem; }
.telegram-profile-availability strong { display:block; margin-bottom:.25rem; }

/* M20.4 - Tenant Lead Inbox */
.lead-filter-card { margin-bottom:1rem; }
.lead-filter-grid { display:grid; grid-template-columns:2fr repeat(3, minmax(150px, 1fr)); gap:1rem; }
.lead-filter-grid .field { margin-bottom:0; }
.lead-table-card { padding:0; overflow:hidden; }
.table-scroll { overflow-x:auto; }
.lead-inbox-table { min-width:1120px; }
.lead-inbox-table td strong { display:block; }
.lead-identity-hint, .lead-message-breakdown { display:block; margin-top:.2rem; color:#6b7280; font-size:.78rem; }
.lead-channel-badges, .lead-attention-stack { display:flex; gap:.35rem; flex-wrap:wrap; align-items:center; }
.badge.lead-channel { background:#f3f4f6; color:#374151; }
.badge.lead-status-new { background:#dbeafe; color:#1d4ed8; }
.badge.lead-status-engaged { background:#e0e7ff; color:#4338ca; }
.badge.lead-status-followup { background:#fef3c7; color:#92400e; }
.badge.lead-status-converted { background:#dcfce7; color:#166534; }
.badge.lead-status-closed { background:#e5e7eb; color:#374151; }
.badge.lead-status-not-interested { background:#fee2e2; color:#991b1b; }
.badge.lead-attention-unanswered { background:#ffedd5; color:#9a3412; }
.badge.lead-attention-inactive { background:#fef3c7; color:#92400e; }
.lead-detail-metrics .card { margin-bottom:0; }
.lead-metric-time { font-size:1rem !important; }
.lead-attention-card h2 { margin-top:0; }
.lead-attention-card p:last-child { margin-bottom:0; }
.lead-detail-grid { display:grid; grid-template-columns:minmax(260px, .75fr) minmax(0, 2fr); gap:1rem; align-items:start; }
.lead-detail-grid h2 { margin-top:0; }
.lead-identity-card { padding:.8rem 0; border-bottom:1px solid #e5e7eb; }
.lead-identity-card:last-child { border-bottom:0; padding-bottom:0; }
.lead-identity-heading { display:flex; justify-content:space-between; gap:.75rem; align-items:flex-start; margin-bottom:.45rem; }
.lead-identity-heading .muted { font-size:.78rem; }
.lead-transcript-heading { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; }
.lead-transcript-heading h2 { margin-bottom:.2rem; }
.lead-transcript-heading p { margin-top:0; }
.lead-transcript { display:flex; flex-direction:column; gap:.65rem; }
.lead-message { border:1px solid #e5e7eb; border-radius:.55rem; padding:.8rem; background:#f9fafb; }
.lead-message-outbound { background:#eff6ff; border-color:#dbeafe; }
.lead-message-meta { display:flex; justify-content:space-between; gap:.75rem; align-items:flex-start; margin-bottom:.55rem; color:#4b5563; font-size:.78rem; }
.lead-message-meta > div { display:flex; gap:.4rem; align-items:center; flex-wrap:wrap; }
.lead-message-content { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.45; }
@media (max-width: 900px) {
    .lead-filter-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
    .lead-detail-grid { grid-template-columns:1fr; }
}
@media (max-width: 620px) {
    .lead-filter-grid { grid-template-columns:1fr; }
    .lead-message-meta, .lead-identity-heading { flex-direction:column; }
}

/* M20.5 lead actions */
.lead-action-grid { display:grid; grid-template-columns:minmax(240px,.75fr) minmax(0,1.5fr); gap:1rem; align-items:start; margin:1rem 0; }
.lead-status-actions { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.9rem; }
.inline-form { display:inline; margin:0; }
.lead-followup-card { border-top:1px solid #e5e7eb; padding:1rem 0; }
.lead-followup-card:first-of-type { border-top:0; padding-top:.25rem; }
.lead-followup-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:.75rem; margin-bottom:.75rem; }
.lead-followup-heading > div { display:flex; flex-direction:column; gap:.2rem; }
.lead-followup-form { display:grid; gap:.7rem; }
.lead-followup-form label { display:grid; gap:.35rem; font-weight:600; }
.lead-followup-form textarea, .lead-followup-form input { width:100%; box-sizing:border-box; }
.lead-followup-warning { margin:.5rem 0; }
.lead-template-panel { margin-top:.8rem; border:1px solid #e5e7eb; border-radius:.6rem; padding:.75rem; }
.lead-template-panel summary { cursor:pointer; font-weight:700; }
.lead-template-grid { display:grid; grid-template-columns:1.5fr .75fr; gap:.75rem; }
@media (max-width: 900px) {
    .lead-action-grid { grid-template-columns:1fr; }
}
@media (max-width: 640px) {
    .lead-template-grid { grid-template-columns:1fr; }
    .lead-followup-heading { flex-direction:column; }
}

/* M20.6 follow-up reminders */
.badge.lead-followup-overdue { background:#fee2e2; color:#991b1b; }
.lead-reminder-panel { margin-top:1.1rem; padding-top:1rem; border-top:1px solid #e5e7eb; }
.lead-reminder-panel h3 { margin:.1rem 0 .45rem; }
.lead-reminder-form { display:grid; gap:.65rem; margin-top:.7rem; }
.lead-reminder-form label { display:grid; gap:.35rem; font-weight:600; }
.lead-reminder-form input { width:100%; box-sizing:border-box; }
.lead-reminder-clear { margin-top:.55rem; }

/* M20.7 - AI lead intelligence */
.lead-ai-card {
    margin-bottom: 1rem;
}

.lead-ai-heading,
.lead-ai-score-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.lead-ai-score-row {
    margin: 1rem 0;
}

.lead-ai-score-row > div {
    display: grid;
    gap: 0.2rem;
}

.lead-ai-copy {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.lead-ai-copy h3 {
    margin-bottom: 0.35rem;
}

.lead-ai-meta,
.lead-ai-refresh {
    margin-top: 1rem;
}

.lead-ai-intent-high {
    font-weight: 700;
}

.lead-ai-intent-interested,
.lead-ai-intent-low {
    font-weight: 600;
}

/* M20.8B - AI-assisted follow-up review UI */
.lead-ai-followup-review-card { margin-bottom:1rem; }
.lead-ai-followup-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; flex-wrap:wrap; }
.lead-ai-followup-heading h2 { margin-top:0; margin-bottom:.3rem; }
.lead-ai-language-badge { background:#e0f2fe; color:#075985; }
.lead-ai-followup-generate { margin-top:.8rem; }
.lead-ai-followup-cost-note { margin:.55rem 0 0; }
.lead-ai-followup-review-form { display:grid; gap:.75rem; margin-top:.8rem; }
.lead-ai-followup-review-form label { font-weight:700; }
.lead-ai-followup-review-form textarea { width:100%; box-sizing:border-box; min-height:150px; resize:vertical; }
.lead-ai-followup-meta { display:flex; flex-wrap:wrap; gap:.45rem 1rem; color:#4b5563; font-size:.82rem; }
.lead-ai-followup-review-note { margin:0; }
.lead-ai-followup-actions { display:flex; align-items:center; gap:.65rem; flex-wrap:wrap; }
.lead-ai-followup-send-panel { display:grid; gap:.65rem; padding-top:.75rem; border-top:1px solid #e5e7eb; }
.lead-ai-followup-send-panel h3 { margin:0; }
.lead-ai-followup-send-panel p { margin:0; }
.lead-ai-followup-route { display:flex; justify-content:space-between; align-items:center; gap:.75rem; flex-wrap:wrap; padding:.7rem .8rem; border:1px solid #e5e7eb; border-radius:.65rem; background:#fafafa; }
.lead-ai-followup-route > div { display:grid; gap:.15rem; }

/* M20.9A lead privacy and append-only contact audit */
.lead-heading-badges,
.lead-privacy-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.lead-optout-badge {
    border-color: rgba(181, 77, 77, .35);
    background: rgba(181, 77, 77, .12);
}
.lead-optout-form {
    display: grid;
    gap: .75rem;
    max-width: 48rem;
}
.lead-contact-audit-card {
    margin-top: 1rem;
}
.lead-audit-list {
    display: grid;
    gap: .65rem;
}
.lead-audit-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--portal-border, #e5e7eb);
    flex-wrap: wrap;
}
.lead-audit-row:last-child {
    border-bottom: 0;
}
.lead-attention-opted-out {
    border-color: rgba(181, 77, 77, .35);
    background: rgba(181, 77, 77, .12);
}

.retention-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.retention-preview-grid > div {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color, #d8dee6);
    border-radius: 0.5rem;
}

.retention-danger-zone {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgba(181, 77, 77, .35);
    border-radius: .5rem;
    background: rgba(181, 77, 77, .06);
}

.retention-danger-zone h4 {
    margin-top: 0;
}


/* M21.2 - Tenant Catalogue Portal */
.catalog-page-heading .actions { justify-content:flex-end; }
.catalog-filter-card { margin-bottom:1rem; }
.catalog-filter-grid { display:grid; grid-template-columns:minmax(220px,2fr) minmax(150px,1fr) minmax(180px,1fr) auto; gap:1rem; align-items:end; }
.catalog-filter-grid .field { margin-bottom:0; }
.catalog-filter-actions { padding-bottom:.05rem; }
.catalog-table-card { padding:0; overflow:hidden; }
.catalog-table { min-width:1080px; }
.catalog-item-cell { display:flex; gap:.75rem; align-items:flex-start; min-width:280px; }
.catalog-item-cell > div { min-width:0; }
.catalog-item-cell strong, .catalog-item-cell span { display:block; }
.catalog-item-cell .muted { margin-top:.25rem; font-size:.8rem; line-height:1.35; max-width:360px; }
.catalog-thumb { width:58px; height:58px; object-fit:cover; flex:0 0 auto; border-radius:.45rem; border:1px solid #e5e7eb; background:#f9fafb; }
.catalog-row-actions { min-width:180px; }
.link-action { background:none; color:#2563eb; padding:0; border:0; text-decoration:underline; font:inherit; }
.link-action.danger-link, .danger-link { color:#b91c1c; }
.catalog-edit-card { max-width:980px; }
.catalog-edit-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(300px,.85fr); gap:1.25rem; align-items:start; }
.catalog-short-description { min-height:95px; }
.catalog-price-grid { grid-template-columns:minmax(0,2fr) minmax(110px,1fr); }
.catalog-selected-image { margin:-.35rem 0 1rem; }
.catalog-selected-image .preview-image { width:100%; max-width:300px; height:auto; max-height:240px; object-fit:contain; }
.catalog-image-slots { display:grid; gap:.75rem; margin-top:.65rem; }
.catalog-image-slot { display:grid; grid-template-columns:minmax(0,1fr) 88px; gap:.75rem; align-items:end; padding:.7rem; border:1px solid #e5e7eb; border-radius:.55rem; background:#f9fafb; }
.catalog-image-slot .field { margin-bottom:0; }
.catalog-gallery-preview { width:88px; height:72px; border:1px solid #d1d5db; border-radius:.45rem; overflow:hidden; background:#fff; display:grid; place-items:center; }
.catalog-gallery-preview .preview-image { width:100%; height:100%; object-fit:contain; display:block; }
.catalog-category-create-card h2 { margin-top:0; }
.catalog-category-create-form { display:grid; grid-template-columns:minmax(220px,2fr) minmax(120px,.75fr) auto; gap:1rem; align-items:end; }
.catalog-category-create-form .field { margin-bottom:0; }
.catalog-category-create-action { padding-bottom:.05rem; }
.catalog-category-list { display:grid; gap:.75rem; }
.catalog-category-row { margin-bottom:0; display:flex; gap:1rem; align-items:flex-end; justify-content:space-between; }
.catalog-category-edit-form { flex:1; display:grid; grid-template-columns:minmax(220px,2fr) minmax(100px,.6fr) auto auto; gap:1rem; align-items:end; }
.catalog-category-edit-form .field { margin-bottom:0; }
.catalog-category-order-field { max-width:140px; }
.catalog-category-state { padding-bottom:.55rem; }
.catalog-category-actions { padding-bottom:.05rem; }
.catalog-category-toggle-form { flex:0 0 auto; }
@media (max-width: 900px) {
    .catalog-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .catalog-edit-grid { grid-template-columns:1fr; }
    .catalog-category-create-form { grid-template-columns:1fr 140px; }
    .catalog-category-create-action { grid-column:1 / -1; }
    .catalog-category-edit-form { grid-template-columns:1fr 120px; }
    .catalog-category-state, .catalog-category-actions { padding-bottom:0; }
}
@media (max-width: 620px) {
    .catalog-filter-grid, .catalog-category-create-form, .catalog-category-edit-form { grid-template-columns:1fr; }
    .catalog-image-slot { grid-template-columns:1fr; align-items:stretch; }
    .catalog-gallery-preview { width:100%; height:150px; }
    .catalog-category-row { align-items:stretch; flex-direction:column; }
    .catalog-category-order-field { max-width:none; }
    .catalog-category-toggle-form button { width:100%; }
}

/* M21.3 - Catalogue Preview */
.catalog-preview-heading .actions { justify-content:flex-end; }
.catalog-preview-toolbar { display:flex; justify-content:space-between; gap:1rem; align-items:center; margin-bottom:1rem; }
.catalog-preview-toolbar p { margin:.25rem 0 0; }
.catalog-preview-scope-actions { display:flex; flex-wrap:wrap; gap:.55rem; }
.catalog-preview-layout { display:grid; grid-template-columns:minmax(320px,460px) minmax(280px,1fr); gap:1.25rem; align-items:start; }
.catalog-phone-wrap { display:flex; justify-content:center; }
.catalog-phone { width:100%; max-width:430px; border:1px solid #d1d5db; border-radius:1.4rem; overflow:hidden; background:#f7f8fa; box-shadow:0 14px 34px rgba(15,23,42,.10); }
.catalog-phone-topbar { display:flex; justify-content:space-between; gap:1rem; align-items:center; padding:1rem; background:#fff; border-bottom:1px solid #e5e7eb; }
.catalog-phone-topbar > div { display:grid; gap:.12rem; }
.catalog-phone-eyebrow { color:#6b7280; font-size:.74rem; }
.catalog-phone-demo-label { padding:.22rem .5rem; border-radius:999px; background:#f3f4f6; color:#4b5563; font-size:.72rem; font-weight:700; }
.catalog-phone-summary { display:flex; justify-content:space-between; align-items:center; gap:.75rem; padding:.85rem 1rem .25rem; color:#4b5563; font-size:.82rem; }
.catalog-preview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; padding:1rem; }
.catalog-preview-card { min-width:0; overflow:hidden; border:1px solid #e5e7eb; border-radius:.85rem; background:#fff; color:inherit; text-decoration:none; }
.catalog-preview-card:hover { border-color:#cbd5e1; text-decoration:none; }
.catalog-preview-card-image, .catalog-preview-image-placeholder { width:100%; aspect-ratio:1 / 1; object-fit:cover; display:flex; align-items:center; justify-content:center; background:#eef1f4; color:#6b7280; font-size:.8rem; }
.catalog-preview-card-copy { display:grid; gap:.35rem; padding:.7rem; }
.catalog-preview-card-heading { display:flex; align-items:center; justify-content:space-between; gap:.4rem; min-width:0; }
.catalog-preview-category { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#6b7280; font-size:.7rem; }
.catalog-preview-draft-badge { flex:0 0 auto; padding:.12rem .36rem; border-radius:999px; background:#fff7ed; color:#9a3412; border:1px solid #fed7aa; font-size:.64rem; font-weight:700; }
.catalog-preview-card-copy > strong { line-height:1.25; overflow-wrap:anywhere; }
.catalog-preview-card-description { color:#6b7280; font-size:.74rem; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.catalog-preview-price { color:#111827; font-size:.95rem; font-weight:800; }
.catalog-preview-availability { width:max-content; max-width:100%; padding:.18rem .4rem; border-radius:999px; font-size:.68rem; font-weight:700; }
.catalog-availability-ok { background:#ecfdf5; color:#047857; }
.catalog-availability-no { background:#fef2f2; color:#b91c1c; }
.catalog-availability-contact { background:#fffbeb; color:#92400e; }
.catalog-phone-detail { background:#fff; min-height:460px; }
.catalog-phone-back { display:inline-block; margin:.85rem 1rem; font-size:.8rem; }
.catalog-preview-detail-image, .catalog-preview-image-placeholder-large { width:100%; aspect-ratio:4 / 3; object-fit:cover; border-top:1px solid #e5e7eb; border-bottom:1px solid #e5e7eb; }
.catalog-preview-detail-copy { display:grid; gap:.7rem; padding:1rem; }
.catalog-preview-detail-copy h2 { margin:0; font-size:1.35rem; line-height:1.25; }
.catalog-preview-meta-row { display:flex; justify-content:space-between; gap:.65rem; align-items:center; color:#6b7280; font-size:.76rem; }
.catalog-preview-detail-copy p { margin:0; line-height:1.45; }
.catalog-preview-description { white-space:pre-wrap; line-height:1.5; color:#374151; padding-top:.2rem; }
.catalog-preview-future-action { margin-top:.25rem; padding:.7rem .8rem; border:1px dashed #cbd5e1; border-radius:.7rem; text-align:center; color:#4b5563; background:#f8fafc; font-size:.82rem; font-weight:700; }
.catalog-phone-empty { min-height:360px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:2rem; }
.catalog-phone-empty p { max-width:280px; color:#6b7280; }
.catalog-preview-side { display:grid; gap:1rem; }
.catalog-preview-side .card { margin-bottom:0; }
.catalog-preview-side h2 { margin-top:0; }
.catalog-preview-stats { display:flex; gap:.75rem; margin:.8rem 0 1rem; }
.catalog-preview-stats > div { min-width:105px; display:grid; gap:.1rem; padding:.75rem; border:1px solid #e5e7eb; border-radius:.65rem; }
.catalog-preview-stats strong { font-size:1.35rem; }
.catalog-preview-stats span { color:#6b7280; font-size:.78rem; }
.catalog-preview-readiness-heading { display:flex; justify-content:space-between; gap:.75rem; align-items:flex-start; }
.catalog-preview-readiness-heading p { margin:.25rem 0 0; }
.catalog-preview-check-list { display:grid; gap:.65rem; margin-top:1rem; }
.catalog-preview-check { display:flex; gap:.65rem; align-items:flex-start; padding:.7rem; border:1px solid #e5e7eb; border-radius:.65rem; }
.catalog-preview-check-icon { flex:0 0 1.45rem; height:1.45rem; display:flex; align-items:center; justify-content:center; border-radius:999px; font-weight:800; }
.catalog-preview-check.complete .catalog-preview-check-icon { background:#ecfdf5; color:#047857; }
.catalog-preview-check.incomplete .catalog-preview-check-icon { background:#fffbeb; color:#92400e; }
.catalog-preview-check > div { min-width:0; display:grid; gap:.15rem; }
.catalog-preview-check span:last-child { color:#6b7280; font-size:.78rem; line-height:1.35; }
.catalog-preview-item-actions { margin-top:1rem; }
.catalog-preview-note p { margin-bottom:0; }
@media (max-width: 900px) {
    .catalog-preview-layout { grid-template-columns:1fr; }
    .catalog-preview-side { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .catalog-preview-readiness-card { grid-column:1 / -1; }
}
@media (max-width: 620px) {
    .catalog-preview-toolbar { align-items:stretch; flex-direction:column; }
    .catalog-preview-scope-actions { display:grid; grid-template-columns:1fr 1fr; }
    .catalog-preview-layout { grid-template-columns:minmax(0,1fr); }
    .catalog-preview-side { grid-template-columns:1fr; }
    .catalog-preview-grid { gap:.55rem; padding:.75rem; }
    .catalog-preview-card-copy { padding:.6rem; }
    .catalog-preview-stats { flex-wrap:wrap; }
}

/* M21.8 catalogue-to-lead integration */
.lead-catalog-interest-heading,
.lead-catalog-interest-title-row,
.lead-catalog-interest-facts,
.lead-catalog-interest-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.lead-catalog-interest-heading {
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.lead-catalog-interest-heading h2 {
    margin-bottom: 0.25rem;
}

.lead-catalog-interest-list {
    display: grid;
    gap: 0.8rem;
}

.lead-catalog-interest-item {
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.9rem;
    border: 1px solid var(--border-color, #d8dee8);
    border-radius: 0.75rem;
}

.lead-catalog-interest-copy {
    min-width: 0;
}

.lead-catalog-interest-title-row,
.lead-catalog-interest-facts {
    flex-wrap: wrap;
}

.lead-catalog-interest-facts {
    margin: 0.4rem 0 0.25rem;
    color: var(--muted-color, #5f6b7a);
    font-size: 0.92rem;
}

.lead-catalog-interest-muted {
    opacity: 0.72;
}

@media (max-width: 720px) {
    .lead-catalog-interest-item {
        flex-direction: column;
    }
}

/* M15.8 - Tenant subscription & billing */
.billing-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1rem; margin-bottom:1rem; }
.billing-summary-card { display:grid; gap:.35rem; margin-bottom:0; }
.billing-summary-card strong { font-size:1.25rem; }
.billing-summary-label { color:#6b7280; font-size:.78rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.billing-status-notice { display:flex; flex-direction:column; gap:.25rem; }
.billing-content-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(280px,.65fr); gap:1rem; align-items:start; }
.billing-content-grid .card { margin-bottom:1rem; }
.billing-details-card h2, .billing-help-card h2, .billing-history-card h2, .billing-danger-card h2, .billing-empty-state h2 { margin-top:0; }
.billing-help-card p { line-height:1.5; }
.billing-section-heading { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; margin-bottom:.75rem; }
.billing-section-heading h2 { margin-bottom:.2rem; }
.billing-section-heading p { margin:0; }
.billing-history-card { padding:0; overflow:hidden; }
.billing-history-card .billing-section-heading { padding:1rem 1rem 0; }
.billing-history-table { min-width:860px; }
.billing-history-table td:first-child { white-space:nowrap; }
.billing-history-table td:last-child { max-width:240px; overflow-wrap:anywhere; }
.billing-danger-card { border-color:#fecaca; background:#fffafa; }
.billing-cancel-form { margin-top:1rem; max-width:760px; }
.billing-empty-state { text-align:center; padding:2rem; }
.billing-empty-state .status-pill { margin-bottom:.75rem; }
@media (max-width:900px) {
    .billing-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .billing-content-grid { grid-template-columns:1fr; }
}
@media (max-width:620px) {
    .billing-summary-grid { grid-template-columns:1fr; }
    .billing-section-heading { flex-direction:column; }
}

/* F03.6 - tenant catalogue allowance */
.billing-catalog-allowance-card { margin-bottom:1rem; }
.billing-catalog-allowance-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem; }
.billing-catalog-stat { display:grid; gap:.3rem; padding:.85rem; border:1px solid #e5e7eb; border-radius:.65rem; background:#fafafa; }
.billing-catalog-stat span { color:#6b7280; font-size:.82rem; font-weight:600; }
.billing-catalog-stat strong { font-size:1.1rem; }
.billing-catalog-meter { height:.65rem; margin-top:1rem; overflow:hidden; border-radius:999px; background:#e5e7eb; }
.billing-catalog-meter > span { display:block; height:100%; border-radius:inherit; background:currentColor; }
.billing-catalog-note { margin:.75rem 0 0; }
@media (max-width:620px) {
    .billing-catalog-allowance-grid { grid-template-columns:1fr; }
}

/* M15.9 subscription fair-use meter */
.billing-fair-use-card {
    margin-bottom: 1.25rem;
}

.fair-use-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.fair-use-stat {
    display: grid;
    gap: 0.25rem;
}

.fair-use-stat span {
    color: var(--muted, #667085);
    font-size: 0.875rem;
}

.fair-use-stat strong {
    font-size: 1.05rem;
}

.fair-use-meter {
    width: 100%;
    height: 0.65rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(127, 127, 127, 0.16);
}

.fair-use-meter > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: currentColor;
}

.fair-use-message {
    margin: 0.9rem 0 0.35rem;
    font-weight: 600;
}

@media (max-width: 720px) {
    .fair-use-grid {
        grid-template-columns: 1fr;
    }
}

/* F02 - reusable operational data grid */
.qra-grid-controls { padding-bottom:.9rem; }
.qra-grid-toolbar { display:flex; align-items:end; gap:1rem; justify-content:space-between; margin-bottom:1rem; }
.qra-grid-toolbar .field { margin-bottom:0; }
.qra-grid-search { flex:1 1 420px; max-width:720px; }
.qra-grid-page-size { flex:0 0 110px; }
.qra-grid-filter-row { margin-bottom:.85rem; }
.qra-grid-filter-row .field { margin-bottom:0; }
.qra-grid-filter-actions { margin-top:.25rem; }
.qra-grid-summary { display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; margin:.5rem 0 .8rem; color:#4b5563; }
[data-qra-grid] { position:relative; }
.qra-grid-card { position:relative; }
.qra-data-table thead th { background:#f9fafb; position:sticky; top:0; z-index:1; }
.qra-data-table tbody tr { transition:background-color .12s ease; }
.qra-data-table tbody tr:hover { background:#f9fafb; }
.qra-data-table tbody tr.qra-row-selected { background:#eff6ff; }
.qra-data-table tbody tr.qra-row-selected:hover { background:#dbeafe; }
.qra-data-table th, .qra-data-table td { padding:.6rem .65rem; }
.qra-data-table th[aria-sort="ascending"] .qra-sort-link,
.qra-data-table th[aria-sort="descending"] .qra-sort-link { color:#1d4ed8; font-weight:700; }
.qra-table-scroll {
    --qra-scroll-left-shadow: inset 0 0 0 transparent;
    --qra-scroll-right-shadow: inset 0 0 0 transparent;
    box-shadow:var(--qra-scroll-left-shadow), var(--qra-scroll-right-shadow);
    overscroll-behavior-inline:contain;
    scrollbar-gutter:stable;
    -webkit-overflow-scrolling:touch;
}
.qra-table-scroll.qra-can-scroll-left { --qra-scroll-left-shadow:inset 16px 0 14px -16px rgba(17,24,39,.35); }
.qra-table-scroll.qra-can-scroll-right { --qra-scroll-right-shadow:inset -16px 0 14px -16px rgba(17,24,39,.35); }
.qra-table-scroll:focus-visible { outline:3px solid #93c5fd; outline-offset:-3px; }
[data-qra-grid][aria-busy="true"] .qra-data-table { opacity:.58; }
[data-qra-grid][aria-busy="true"]::after {
    content:"Loading…";
    position:absolute;
    top:.75rem;
    right:.75rem;
    z-index:5;
    padding:.4rem .65rem;
    border:1px solid #bfdbfe;
    border-radius:.45rem;
    background:#eff6ff;
    color:#1d4ed8;
    font-size:.82rem;
    font-weight:700;
    box-shadow:0 4px 12px rgba(17,24,39,.08);
}
.qra-grid-empty-state[role="status"] { min-height:96px; display:grid; place-content:center; }
.qra-sort-link { display:inline-flex; align-items:center; gap:.35rem; color:#4b5563; text-decoration:none; white-space:nowrap; }
.qra-sort-link:hover, .qra-sort-link.active { color:#1d4ed8; }
.qra-sort-link.active { font-weight:700; }
.qra-page-numbers { display:flex; align-items:center; gap:.3rem; }
.qra-page-number { display:inline-flex; min-width:2.75rem; height:2.75rem; align-items:center; justify-content:center; border:1px solid #d1d5db; border-radius:.4rem; color:#374151; text-decoration:none; background:white; }
.qra-page-number:hover { background:#f3f4f6; }
.qra-page-number.current { background:#2563eb; color:white; border-color:#2563eb; font-weight:700; }
.qra-page-button { min-height:2.75rem; box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; }
.qra-page-button.disabled { pointer-events:none; opacity:.45; }
.qra-table-row-link { background:none; color:#1d4ed8; padding:0; font:inherit; font-weight:700; text-align:left; }
.qra-table-row-link:hover { text-decoration:underline; }
.qra-details-column { width:82px; min-width:82px !important; }

/* Optional selection/bulk-action contract. Checkboxes appear only when a page enables a bulk action. */
.qra-select-column { width:42px; min-width:42px !important; text-align:center; }
.qra-select-column input { width:auto; }
.qra-bulk-toolbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.7rem .85rem; margin-bottom:.75rem; border:1px solid #bfdbfe; border-radius:.5rem; background:#eff6ff; }
.qra-bulk-toolbar[hidden] { display:none; }

/* Azure-style master/detail blade used by subscription operations. */
.qra-master-detail { position:relative; }
.qra-subscription-table { min-width:900px; }
.qra-detail-blade { position:fixed; top:0; right:0; bottom:0; width:min(470px, 92vw); background:white; border-left:1px solid #d1d5db; box-shadow:-12px 0 34px rgba(17,24,39,.16); z-index:1100; transform:translateX(102%); visibility:hidden; transition:transform .18s ease, visibility 0s linear .18s; display:flex; flex-direction:column; }
.qra-detail-blade.open { transform:translateX(0); visibility:visible; transition:transform .18s ease; }
.qra-detail-blade-header { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; padding:1.1rem 1.2rem; border-bottom:1px solid #e5e7eb; }
.qra-detail-blade-header h2 { margin:.15rem 0 0; }
.qra-detail-eyebrow { font-size:.78rem; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
.qra-blade-close { flex:0 0 auto; width:2.25rem; height:2.25rem; padding:0; border-radius:999px; background:#f3f4f6; color:#374151; font-size:1.4rem; line-height:1; }
.qra-detail-blade-body { overflow-y:auto; padding:1.1rem 1.2rem 2rem; }
.qra-blade-status-row { display:flex; flex-wrap:wrap; gap:.5rem; margin-bottom:1rem; }
.qra-blade-notice { margin-bottom:1rem; }
.qra-blade-details { margin:0; }
.qra-blade-details > div { display:grid; grid-template-columns:140px minmax(0,1fr); gap:.8rem; padding:.65rem 0; border-bottom:1px solid #f3f4f6; }
.qra-blade-details dt { color:#6b7280; font-size:.8rem; font-weight:600; }
.qra-blade-details dd { margin:0; min-width:0; word-break:break-word; }
.qra-blade-actions { display:flex; flex-direction:column; align-items:stretch; gap:.55rem; margin-top:1.2rem; padding-top:1rem; border-top:1px solid #e5e7eb; }
.qra-blade-actions .button, .qra-blade-actions button { text-align:center; }
.qra-blade-backdrop { position:fixed; inset:0; z-index:1090; border:0; border-radius:0; padding:0; background:rgba(17,24,39,.28); }
.qra-blade-backdrop[hidden] { display:none; }
body.qra-blade-open { overflow:hidden; }

/* Reusable destructive-action confirmation dialog for future grid bulk actions. */
.qra-confirm-dialog { border:0; border-radius:.7rem; padding:0; width:min(430px, calc(100vw - 2rem)); box-shadow:0 18px 50px rgba(17,24,39,.24); }
.qra-confirm-dialog::backdrop { background:rgba(17,24,39,.42); }
.qra-confirm-card { padding:1.2rem; }
.qra-confirm-card h2 { margin-top:0; }
.qra-confirm-actions { justify-content:flex-end; margin-top:1.2rem; }

@media (prefers-reduced-motion: reduce) {
    .qra-detail-blade, .qra-data-table tbody tr { transition:none; }
}

@media (max-width: 720px) {
    .qra-grid-toolbar { align-items:stretch; flex-direction:column; }
    .qra-grid-search, .qra-grid-page-size { max-width:none; width:100%; flex-basis:auto; }
    .qra-grid-summary { align-items:flex-start; flex-direction:column; gap:.25rem; }
    .qra-grid-pagination { flex-wrap:wrap; }
    .qra-page-numbers { order:3; width:100%; justify-content:center; }
    .qra-page-number { flex:0 0 2.75rem; }
    .qra-page-button { min-width:5.75rem; }
    .qra-data-table th, .qra-data-table td { padding:.58rem .6rem; }
    .qra-detail-blade { width:100vw; max-width:none; border-left:0; }
    .qra-blade-details > div { grid-template-columns:1fr; gap:.25rem; }
}

/* F03.3 - manual catalogue subscription package configurator */
.manual-catalog-package-field { grid-column:span 2; }
.manual-catalog-package { display:grid; gap:1rem; padding:1rem; border:1px solid #e5e7eb; border-radius:.6rem; background:#f9fafb; }
.manual-catalog-mode-options { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:.75rem; }
.manual-catalog-mode-option { display:flex; align-items:flex-start; gap:.65rem; padding:.85rem; margin:0; border:1px solid #d1d5db; border-radius:.55rem; background:white; cursor:pointer; }
.manual-catalog-mode-option input { width:auto; margin-top:.2rem; }
.manual-catalog-mode-option span { display:grid; gap:.2rem; }
.manual-catalog-mode-option small { color:#6b7280; font-weight:400; line-height:1.35; }
.manual-catalog-capacity { display:grid; gap:.55rem; }
.manual-catalog-capacity-label { font-weight:600; }
.manual-catalog-stepper { display:flex; align-items:center; gap:.65rem; }
.manual-catalog-stepper button { min-width:44px; min-height:44px; font-size:1.15rem; }
.manual-catalog-capacity-value { display:flex; align-items:center; justify-content:center; gap:.45rem; min-height:44px; padding:.35rem .75rem; border:1px solid #d1d5db; border-radius:.5rem; background:white; }
.manual-catalog-capacity-value input { width:76px; padding:.35rem .4rem; text-align:center; font-weight:700; }
.manual-catalog-capacity.is-disabled { opacity:.55; }
.manual-catalog-commercial-summary { display:grid; gap:.55rem; padding:.85rem; border-left:4px solid #2563eb; border-radius:.4rem; background:white; }
.manual-catalog-summary-row { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; }
.manual-catalog-summary-row strong { text-align:right; }
.manual-catalog-commercial-summary small { margin-top:.3rem; line-height:1.4; }
@media (max-width: 760px) {
    .manual-catalog-package-field { grid-column:auto; }
    .manual-catalog-mode-options { grid-template-columns:1fr; }
    .manual-catalog-stepper { align-items:stretch; }
    .manual-catalog-capacity-value { flex:1; }
}
