/* ResolveDesk Global Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --rd-green: #48bb78;
    --rd-green-dark: #38a169;
    --rd-dark: #1a1d23;
    --rd-gray-50: #f8f9fa;
    --rd-gray-100: #f1f3f5;
    --rd-gray-200: #e5e7eb;
    --rd-gray-400: #9ca3af;
    --rd-gray-600: #6b7280;
    --rd-gray-800: #374151;
    --rd-red: #e53e3e;
    --rd-orange: #ed8936;
    --rd-blue: #4299e1;
    --rd-radius: 6px;
}

/* A hard 1024px floor here made the whole application desktop-only: below it the document
   stayed 1024px wide while the viewport showed only its left edge, so everything right-aligned
   — the user menu above all — sat off-screen and could not be clicked. The shell now reflows
   (see MainLayout.razor.css) and wide tables scroll inside their own card, so the floor is only
   needed to stop the layout collapsing absurdly. */
body {
    margin: 0;
    min-width: 320px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--rd-gray-800);
    background: var(--rd-gray-50);
}

h1, h2, h3 {
    margin: 0 0 0.75rem;
    font-weight: 600;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }

a { color: var(--rd-green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Cards */
.rd-card {
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.rd-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Buttons */
.rd-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--rd-radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.rd-btn-primary {
    background: var(--rd-green);
    color: #fff;
}
.rd-btn-primary:hover { background: var(--rd-green-dark); }

.rd-btn-secondary {
    background: #fff;
    border-color: var(--rd-gray-200);
    color: var(--rd-gray-800);
}
.rd-btn-secondary:hover { background: var(--rd-gray-100); }

.rd-btn-danger {
    background: var(--rd-red);
    color: #fff;
}
.rd-btn-danger:hover { background: #c53030; }

.rd-btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* Forms */
.rd-form-group {
    margin-bottom: 1rem;
}

.rd-label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--rd-gray-600);
}

.rd-input, .rd-select, .rd-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    font-size: 0.9rem;
    transition: border-color 0.15s;
}

.rd-input:focus, .rd-select:focus, .rd-textarea:focus {
    outline: none;
    border-color: var(--rd-green);
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.15);
}

.rd-textarea { min-height: 100px; resize: vertical; }

/* Tables */
.rd-table {
    width: 100%;
    border-collapse: collapse;
}

.rd-table th, .rd-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--rd-gray-200);
}

.rd-table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rd-gray-600);
    background: var(--rd-gray-50);
}

.rd-table tr:hover { background: var(--rd-gray-50); }

/* Badges */
.rd-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.rd-badge-new { background: #ebf8ff; color: #2b6cb0; }
.rd-badge-triaged { background: #fefcbf; color: #975a16; }
.rd-badge-inprogress { background: #c6f6d5; color: #276749; }
.rd-badge-awaiting { background: #fed7d7; color: #9b2c2c; }
.rd-badge-escalated { background: #fed7e2; color: #97266d; }
.rd-badge-resolved { background: #c6f6d5; color: #22543d; }
.rd-badge-closed { background: var(--rd-gray-100); color: var(--rd-gray-600); }

/* ─── Status History ─── */

.rd-status-created {
    background: rgba(72, 187, 120, 0.04);
}

.rd-status-created td {
    border-bottom-color: rgba(72, 187, 120, 0.12);
}

.rd-status-created-icon {
    color: var(--rd-green);
    font-size: 0.8rem;
    margin-right: 0.35rem;
}

.rd-status-transition-icon {
    color: var(--rd-gray-400);
    font-size: 0.8rem;
    margin-right: 0.35rem;
}

.rd-badge-ai-log {
    background: #dbeafe;
    color: #1e40af;
}

.rd-badge-low { background: #ebf8ff; color: #2b6cb0; }
.rd-badge-medium { background: #fefcbf; color: #975a16; }
.rd-badge-high { background: #fed7d7; color: #9b2c2c; }
.rd-badge-critical { background: #fff5f5; color: #c53030; border: 1px solid #feb2b2; }

/* Stats Grid */
.rd-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.rd-stat-card {
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    padding: 1rem 1.25rem;
}

.rd-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--rd-gray-800);
}

.rd-stat-label {
    font-size: 0.8rem;
    color: var(--rd-gray-600);
    margin-top: 0.15rem;
}

/* Utilities */
.rd-flex { display: flex; }
.rd-flex-between { display: flex; justify-content: space-between; align-items: center; }
.rd-gap-1 { gap: 0.5rem; }
.rd-gap-2 { gap: 1rem; }
.rd-mt-1 { margin-top: 0.5rem; }
.rd-mt-2 { margin-top: 1rem; }
.rd-mb-1 { margin-bottom: 0.5rem; }
.rd-mb-2 { margin-bottom: 1rem; }
.rd-text-muted { color: var(--rd-gray-600); }
.rd-text-sm { font-size: 0.8rem; }

/* ─── Ticket Header Breadcrumb ─── */

.rd-ticket-header-back {
    margin-bottom: 0.25rem;
}

.rd-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--rd-green-dark);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

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

.rd-ticket-header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
}

.rd-breadcrumb-link {
    color: var(--rd-gray-500);
    text-decoration: none;
    font-weight: 500;
}

.rd-breadcrumb-link:hover {
    color: var(--rd-green-dark);
    text-decoration: underline;
}

.rd-breadcrumb-sep {
    color: var(--rd-gray-400);
    font-weight: 600;
}

.rd-breadcrumb-current {
    color: var(--rd-gray-800);
    font-weight: 600;
}

/* ─── Details Card ─── */

.rd-details-card {
    padding: 1rem 1.1rem;
}

.rd-details-heading {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #0A0F1D;
}

.rd-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 0.5rem;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    overflow: hidden;
}

.rd-detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--rd-gray-200);
    border-right: 1px solid var(--rd-gray-200);
    font-size: 0.8rem;
}

.rd-detail-field:nth-child(even) {
    border-right: none;
}

.rd-detail-field:nth-last-child(-n+2) {
    border-bottom: none;
}

.rd-detail-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748B;
}

.rd-detail-value {
    font-size: 0.78rem;
    font-weight: 500;
    color: #0A0F1D;
}

/* ─── Refined Pills ─── */

.rd-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.4;
}

.rd-pill--new {
    background: #EFF6FF;
    color: #1D4ED8;
}

.rd-pill--critical {
    background: #FEF2F2;
    color: #DC2626;
}

.rd-pill--unassigned {
    background: #F1F5F9;
    color: #64748B;
    font-weight: 500;
}

/* ─── SLA Block ─── */

.rd-sla-block {
    background: #F8FAFC;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    padding: 0.7rem 0.85rem;
    margin-top: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rd-sla-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
}

.rd-sla-icon {
    flex-shrink: 0;
    color: #64748B;
}

.rd-sla-row-label {
    font-weight: 600;
    color: #0A0F1D;
    min-width: 6.5rem;
}

.rd-sla-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
}

.rd-sla-badge--breached {
    background: #FEF2F2;
    color: #DC2626;
}

.rd-sla-badge--met {
    background: #F0FDF4;
    color: #16A34A;
}

.rd-sla-badge--due {
    background: #FFF7ED;
    color: #EA580C;
}

.rd-sla-badge--overdue {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
    animation: rd-sla-overdue-pulse 2s ease-in-out infinite;
}

@keyframes rd-sla-overdue-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
    50% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12); }
}

/* ─── AI Panel ─── */
.rd-ai-panel {
    background: linear-gradient(135deg, #f0fff4, #ebf8ff);
    border: 1px solid #c6f6d5;
    border-radius: var(--rd-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    transition: all 0.3s ease;
}

.rd-ai-panel--loading {
    border-color: #9ae6b4;
    box-shadow: 0 0 20px rgba(72, 187, 120, 0.15);
}

.rd-ai-panel h4 {
    font-size: 0.85rem;
    color: var(--rd-green-dark);
    margin: 0 0 0.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rd-badge-latest {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--rd-green);
    color: #fff;
    line-height: 1.4;
}

.rd-ai-panel p, .rd-ai-panel pre {
    margin: 0;
    font-size: 0.85rem;
    white-space: pre-wrap;
}

/* ─── Magical AI Loader ─── */

.rd-ai-btn {
    position: relative;
}

.rd-ai-loader {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.rd-ai-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--rd-green);
    display: inline-block;
    animation: rd-ai-bounce 1.2s ease-in-out infinite;
}

.rd-ai-dot--1 { animation-delay: 0s; }
.rd-ai-dot--2 { animation-delay: 0.2s; }
.rd-ai-dot--3 { animation-delay: 0.4s; }

@keyframes rd-ai-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.rd-ai-thinking {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 0.5rem;
}

.rd-ai-pulse {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rd-green), #4299e1);
    flex-shrink: 0;
    animation: rd-ai-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(72, 187, 120, 0.35);
}

@keyframes rd-ai-pulse {
    0% {
        transform: scale(0.85);
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.5);
    }
    50% {
        transform: scale(1);
        box-shadow: 0 0 20px 4px rgba(72, 187, 120, 0.2);
    }
    100% {
        transform: scale(0.85);
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0);
    }
}

.rd-ai-thinking-text {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-top: 2px;
}

.rd-ai-thinking-line {
    font-size: 0.8rem;
    color: var(--rd-gray-600);
    animation: rd-ai-fade-slide 0.6s ease-out forwards;
    opacity: 0;
}

.rd-ai-thinking-line:nth-child(1) { animation-delay: 0s; }
.rd-ai-thinking-line:nth-child(2) { animation-delay: 1.2s; }
.rd-ai-thinking-line:nth-child(3) { animation-delay: 2.4s; }

@keyframes rd-ai-fade-slide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SLA indicator (legacy) */
.rd-sla-ok { color: var(--rd-green-dark); }
.rd-sla-warning { color: var(--rd-orange); }
.rd-sla-breached { color: var(--rd-red); font-weight: 600; }

/* Validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
    font-size: 0.8rem;
}

/* ─── @mention Autocomplete Dropdown ─── */

.rd-mention-dropdown {
    position: absolute;
    z-index: 200;
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 180px;
    max-width: 280px;
    max-height: 240px;
    overflow-y: auto;
    padding: 0.25rem;
    display: none;
}

.rd-mention-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 0.1s ease;
}

.rd-mention-item:hover,
.rd-mention-item--active {
    background: rgba(72, 187, 120, 0.1);
}

.rd-mention-item-avatar {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: var(--rd-green-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.rd-mention-item-name {
    font-weight: 600;
    color: var(--rd-gray-800);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-mention-item-name strong {
    color: var(--rd-green-dark);
}

.rd-mention-item-email {
    font-size: 0.72rem;
    color: var(--rd-gray-400);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: var(--rd-radius);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.rd-institution-logo {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid var(--rd-gray-200);
}

.rd-institution-logo-large {
    width: 3rem;
    height: 3rem;
}

.rd-context-menu {
    position: relative;
}

.rd-context-menu summary {
    list-style: none;
}

.rd-context-menu summary::-webkit-details-marker {
    display: none;
}

.rd-context-menu-list {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: 10.5rem;
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    z-index: 20;
}

.rd-context-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: var(--rd-radius);
    color: var(--rd-gray-800);
    font-size: 0.82rem;
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    text-decoration: none;
}

.rd-context-menu-item:hover {
    background: var(--rd-gray-100);
}

.rd-context-menu-item-danger {
    color: var(--rd-red);
}

.rd-table-row-clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.rd-table-row-clickable:hover {
    background: rgba(72, 187, 120, 0.06);
}

.rd-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 0.5rem;
}

.rd-detail-readonly-grid > div {
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    background: #fff;
    padding: 0.65rem 0.75rem;
}

.rd-detail-readonly-grid > div strong {
    display: block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rd-gray-500);
    margin-bottom: 0.18rem;
}

@media (max-width: 860px) {
    .rd-detail-grid {
        grid-template-columns: 1fr;
    }
}

.rd-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: rd-fade-in 180ms ease;
}

.rd-modal-panel {
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    width: min(92vw, 34rem);
    max-height: 88vh;
    overflow: auto;
    padding: 1rem 1.1rem;
    animation: rd-modal-in 220ms ease;
}

.rd-modal-panel-lg {
    width: min(92vw, 42rem);
}

.rd-wizard-modal {
    width: min(96vw, 68rem);
}

.rd-wizard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.rd-wizard-span-2 {
    grid-column: span 2;
}

.rd-wizard-progress {
    height: 6px;
    background: var(--rd-gray-100);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.rd-wizard-progress-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--rd-green), var(--rd-green-dark));
    transition: width 220ms ease;
}

.rd-wizard-step-animate {
    animation: rd-wizard-step-in 180ms ease;
}

.rd-wizard-input-invalid {
    border-color: var(--rd-red) !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.12);
    animation: rd-field-pulse 220ms ease;
}

.rd-wizard-error {
    color: var(--rd-red);
    margin-top: 0.75rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(229, 62, 62, 0.3);
    border-radius: var(--rd-radius);
    background: rgba(229, 62, 62, 0.06);
    animation: rd-field-pulse 220ms ease;
}

.rd-wizard-shake {
    animation: rd-wizard-shake 260ms ease;
}

.rd-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.rd-tabs {
    display: flex;
    gap: 0.45rem;
    border-bottom: 1px solid var(--rd-gray-200);
    padding-bottom: 0.5rem;
}

.rd-tab {
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    color: var(--rd-gray-600);
    border-radius: var(--rd-radius);
    padding: 0.4rem 0.7rem;
    font-size: 0.83rem;
    cursor: pointer;
}

.rd-tab.active {
    border-color: var(--rd-green);
    color: var(--rd-green-dark);
    background: rgba(72, 187, 120, 0.08);
}

@keyframes rd-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rd-modal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes rd-wizard-step-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rd-field-pulse {
    0% { transform: scale(1); }
    35% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

@keyframes rd-wizard-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
}

@media (max-width: 860px) {
    .rd-wizard-grid {
        grid-template-columns: 1fr;
    }

    .rd-wizard-span-2 {
        grid-column: span 1;
    }
}

/* Billing Plans Grid */
.rd-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.rd-plan-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.rd-plan-card > *:not(.rd-plan-header) {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.rd-plan-card > *:last-child {
    padding-bottom: 1.25rem;
}

.rd-plan-header {
    padding: 0.85rem 1.25rem;
    text-align: center;
    background: var(--rd-gray-50);
    border-bottom: 1px solid var(--rd-gray-200);
}

.rd-plan-header-current {
    background: var(--rd-green);
    color: #fff;
    border-bottom-color: var(--rd-green-dark);
}

.rd-plan-header-current h3 {
    color: #fff;
}

.rd-plan-card-current {
    border-color: var(--rd-green);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.15);
}

.rd-plan-price {
    text-align: center;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

.rd-plan-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--rd-gray-800);
}

.rd-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    flex-grow: 1;
}

.rd-plan-features li {
    padding: 0.25rem 0;
    font-size: 0.85rem;
    color: var(--rd-gray-600);
}

.rd-plan-features li::before {
    content: "✓ ";
    color: var(--rd-green);
    font-weight: 600;
}

/* ─── Custom File Input ─── */

.rd-file-btn {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.rd-file-btn-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
    width: 100%;
    height: 100%;
}

.rd-badge-neutral {
    background: var(--rd-gray-100);
    color: var(--rd-gray-600);
}

/* ──────────── Landing Page ──────────── */

/* --- Shared --- */

.rd-landing-shell {
    min-height: 100vh;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.rd-landing-shell main {
    flex: 1;
}

.rd-landing-container {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- Landing Buttons --- */

.rd-btn-landing {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    padding: 0.65rem 1.5rem;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
    line-height: 1.4;
}

.rd-btn-landing--primary {
    background: var(--rd-green);
    color: #fff;
}

.rd-btn-landing--primary:hover {
    background: var(--rd-green-dark);
    text-decoration: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(72, 187, 120, 0.35);
}

.rd-btn-landing--ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.rd-btn-landing--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.rd-btn-landing--outline {
    background: transparent;
    color: var(--rd-gray-800);
    border: 1px solid var(--rd-gray-200);
}

.rd-btn-landing--outline:hover {
    background: var(--rd-gray-50);
    border-color: var(--rd-gray-400);
    text-decoration: none;
}

.rd-btn-landing--outline-green {
    background: transparent;
    color: var(--rd-green);
    border: 1px solid var(--rd-green);
}

.rd-btn-landing--outline-green:hover {
    background: rgba(72, 187, 120, 0.08);
    color: var(--rd-green-dark);
    border-color: var(--rd-green-dark);
    text-decoration: none;
}

.rd-btn-landing--sm {
    padding: 0.4rem 1rem;
    font-size: 0.82rem;
}

.rd-btn-landing--lg {
    padding: 0.85rem 2.25rem;
    font-size: 1rem;
}

/* --- Section Header --- */

.rd-section-header {
    text-align: center;
    max-width: 40rem;
    margin: 0 auto 3.5rem;
}

.rd-section-header__label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--rd-green);
    margin-bottom: 0.75rem;
}

.rd-section-header__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    line-height: 1.25;
    color: var(--rd-gray-800);
    margin: 0 0 0.75rem;
}

.rd-section-header__desc {
    font-size: 1rem;
    color: var(--rd-gray-600);
    margin: 0;
    line-height: 1.6;
}

/* --- Navigation --- */

.rd-landing-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rd-gray-200);
    padding: 0 1.5rem;
    height: 3.5rem;
}

.rd-landing-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.rd-landing-nav__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1.1rem;
    color: var(--rd-gray-800);
}

.rd-landing-nav__brand strong {
    font-weight: 700;
}

.rd-landing-nav__brand:hover {
    text-decoration: none;
}

.rd-landing-nav__links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.rd-landing-nav__links > a:not(.rd-btn-landing) {
    font-size: 0.85rem;
    color: var(--rd-gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.rd-landing-nav__links > a:not(.rd-btn-landing):hover {
    color: var(--rd-green-dark);
    text-decoration: none;
}

/* --- Hero --- */

.rd-hero {
    position: relative;
    overflow: hidden;
    padding: 7rem 1.5rem 5.5rem;
    text-align: center;
    background-color: #1a1d23; /* Fallback background color */
}

.rd-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.rd-hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.65;
}

.rd-hero__gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(72, 187, 120, 0.15) 0%, transparent 70%),
        linear-gradient(180deg, rgba(15, 17, 23, 0.15) 0%, rgba(26, 29, 35, 0.25) 50%, rgba(37, 42, 51, 0.35) 100%);
}

.rd-hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 40%, black 20%, transparent 80%);
}

.rd-hero__content {
    position: relative;
    z-index: 1;
}

.rd-hero__badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rd-green);
    border: 1px solid rgba(72, 187, 120, 0.3);
    border-radius: 100px;
    padding: 0.35rem 1rem;
    margin-bottom: 2rem;
    background: rgba(72, 187, 120, 0.06);
}

.rd-hero__title {
    font-size: clamp(2.2rem, 5.5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.12;
    color: #fff;
    margin: 0 0 1.25rem;
    letter-spacing: -0.02em;
}

.rd-hero__title em {
    font-style: normal;
    color: var(--rd-green);
}

.rd-hero__subtitle {
    font-size: 1.1rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.6);
    max-width: 38rem;
    margin: 0 auto 2.5rem;
}

.rd-hero__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.rd-hero__note {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 1.5rem;
}

/* --- Social Proof --- */

.rd-proof {
    background: var(--rd-gray-50);
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--rd-gray-200);
}

.rd-proof__row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.rd-proof__stat {
    text-align: center;
}

.rd-proof__stat strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--rd-gray-800);
    line-height: 1.2;
}

.rd-proof__stat span {
    font-size: 0.78rem;
    color: var(--rd-gray-600);
}

.rd-proof__divider {
    width: 1px;
    height: 2.5rem;
    background: var(--rd-gray-200);
    flex-shrink: 0;
}

/* --- Features --- */

.rd-features {
    padding: 5rem 1.5rem;
}

.rd-features__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.rd-feature-card {
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: 12px;
    padding: 2rem 1.75rem;
    transition: box-shadow 0.25s, transform 0.25s;
}

.rd-feature-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.rd-feature-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(72, 187, 120, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--rd-green-dark);
}

.rd-feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--rd-gray-800);
}

.rd-feature-card p {
    font-size: 0.88rem;
    color: var(--rd-gray-600);
    line-height: 1.6;
    margin: 0;
}

/* --- How It Works --- */

.rd-how {
    padding: 5rem 1.5rem;
    background: var(--rd-gray-50);
}

.rd-how__steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    max-width: 56rem;
    margin: 0 auto;
}

.rd-how__step {
    flex: 1;
    text-align: center;
    padding: 0 1.5rem;
}

.rd-how__number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--rd-green);
    opacity: 0.6;
    margin-bottom: 1rem;
    line-height: 1;
}

.rd-how__step h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--rd-gray-800);
    margin: 0 0 0.5rem;
}

.rd-how__step p {
    font-size: 0.88rem;
    color: var(--rd-gray-600);
    line-height: 1.6;
    margin: 0;
}

.rd-how__connector {
    width: 48px;
    min-width: 48px;
    height: 2px;
    background: var(--rd-gray-200);
    margin-top: 1.25rem;
    flex-shrink: 0;
}

/* --- Pricing --- */

.rd-pricing {
    padding: 5rem 1.5rem;
}

/* Four tiers, one row once there is room for it. The previous 64rem cap could not fit four
   250px cards plus gaps, so the grid wrapped to 2x2 at every width — the tiers never lined up
   however wide the window was. */
.rd-pricing__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.25rem;
    max-width: 84rem;
    margin: 0 auto;
    align-items: start;
}

/* Pin to four columns rather than relying on auto-fit, so the row stays level even when the
   copy lengths differ. */
@media (min-width: 1080px) {
    .rd-pricing__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.rd-pricing-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    border-radius: 12px;
    padding: 2.25rem 1.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.25s;
}

.rd-pricing-card--featured {
    border-color: var(--rd-green);
    box-shadow: 0 0 0 1px var(--rd-green), 0 8px 30px rgba(72, 187, 120, 0.10);
}

.rd-pricing-card__badge {
    position: absolute;
    top: -0.7rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--rd-green);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.85rem;
    border-radius: 100px;
    white-space: nowrap;
}

.rd-pricing-card__name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--rd-gray-800);
    margin: 0 0 1rem;
}

.rd-pricing-card__price {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
}

.rd-pricing-card__amount {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--rd-gray-800);
    line-height: 1;
}

.rd-pricing-card__interval {
    font-size: 0.9rem;
    color: var(--rd-gray-400);
    font-weight: 500;
}

.rd-pricing-card__desc {
    font-size: 0.85rem;
    color: var(--rd-gray-600);
    line-height: 1.5;
    margin: 0 0 1.25rem;
}

.rd-pricing-card__list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem;
    flex: 1;
}

.rd-pricing-card__list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--rd-gray-800);
    padding: 0.35rem 0;
}

.rd-pricing-card__list li svg {
    flex-shrink: 0;
}

.rd-pricing-card .rd-btn-landing {
    width: 100%;
    justify-content: center;
    text-align: center;
}

/* --- Final CTA --- */

.rd-final-cta {
    text-align: center;
    padding: 5.5rem 1.5rem;
    background: var(--rd-dark);
    color: #fff;
}

.rd-final-cta__title {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 700;
    color: #fff;
    max-width: 36rem;
    margin: 0 auto 1rem;
    line-height: 1.3;
}

.rd-final-cta__desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.55);
    max-width: 30rem;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* --- Footer --- */

.rd-landing-footer {
    padding: 3rem 1.5rem 2rem;
    background: var(--rd-gray-50);
    border-top: 1px solid var(--rd-gray-200);
}

.rd-landing-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}

.rd-landing-footer__brand p {
    font-size: 0.85rem;
    color: var(--rd-gray-600);
    max-width: 22rem;
    margin: 0.75rem 0 0;
    line-height: 1.5;
}

.rd-landing-footer h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rd-gray-800);
    margin: 0 0 0.6rem;
}

.rd-landing-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rd-landing-footer ul li {
    margin-bottom: 0.35rem;
}

.rd-landing-footer ul a {
    font-size: 0.85rem;
    color: var(--rd-gray-600);
    text-decoration: none;
    transition: color 0.15s;
}

.rd-landing-footer ul a:hover {
    color: var(--rd-green-dark);
    text-decoration: none;
}

.rd-landing-footer__bottom {
    border-top: 1px solid var(--rd-gray-200);
    margin-top: 2rem;
    padding-top: 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--rd-gray-400);
}

/* --- Landing Responsive --- */

@media (max-width: 960px) {
    .rd-features__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .rd-hero {
        padding: 5rem 1.5rem 3.5rem;
    }

    .rd-hero__subtitle {
        font-size: 1rem;
    }

    .rd-features__grid {
        grid-template-columns: 1fr;
    }

    .rd-how__steps {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .rd-how__connector {
        width: 2px;
        height: 32px;
        margin: 0;
    }

    .rd-proof__row {
        gap: 1.25rem;
    }

    .rd-proof__divider {
        display: none;
    }

    .rd-proof__row {
        flex-direction: column;
    }

    .rd-landing-footer__grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .rd-landing-nav__links {
        gap: 0.75rem;
    }

    .rd-landing-nav__links > a:not(.rd-btn-landing) {
        display: none;
    }

    /* One action in the header on a phone: Sign In. */
    .rd-landing-nav__register {
        display: none;
    }

    .rd-pricing__grid {
        grid-template-columns: 1fr;
        max-width: 24rem;
    }
}

/* ============================================================
   AUTH — Split-screen register / login
   ============================================================ */

.rd-auth-shell {
    display: grid;
    grid-template-columns: 5fr 7fr;
    height: 100vh;
    overflow: hidden;
}

/* --- Brand panel (left) --- */

.rd-auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    height: 100vh;
    min-height: 600px;
}

.rd-auth-brand__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.rd-auth-brand__gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 50% 20%, rgba(72, 187, 120, 0.12) 0%, transparent 70%),
        linear-gradient(180deg, #0f1117 0%, #1a1d23 50%, #252a33 100%);
}

.rd-auth-brand__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 80%);
}

.rd-auth-brand__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 22rem;
}

.rd-auth-brand__logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.rd-auth-brand__logo strong {
    font-weight: 700;
}

.rd-auth-brand__logo:hover {
    text-decoration: none;
    color: #fff;
}

.rd-auth-brand__copy h1 {
    font-size: 1.65rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.rd-auth-brand__copy p {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    margin: 0;
}

.rd-auth-brand__proof {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.rd-auth-proof-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* --- Form panel (right) --- */

.rd-auth-form-panel {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: #fff;
    height: 100vh;
    overflow-y: auto;
}

.rd-auth-form-wrap {
    width: 100%;
    max-width: 400px;
}

.rd-auth-form-header {
    margin-bottom: 2rem;
}

.rd-auth-form-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rd-gray-800);
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.rd-auth-form-header p {
    font-size: 0.9rem;
    color: var(--rd-gray-400);
    margin: 0;
}

/* Alerts */

.rd-auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 0.75rem 1rem;
    border-radius: var(--rd-radius);
    margin-bottom: 1.5rem;
}

.rd-auth-alert svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.rd-auth-alert--error {
    color: #c53030;
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

.rd-auth-alert--success {
    color: #276749;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
}

/* Form */

.rd-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

/* Sign-up decoy field: present in the markup for bots, never perceivable by a person. */
.rd-auth-decoy {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.rd-auth-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--rd-gray-600);
    margin-bottom: 0.3rem;
}

.rd-auth-field input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    font-size: 0.9rem;
    color: var(--rd-gray-800);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rd-auth-field input::placeholder {
    color: var(--rd-gray-400);
    font-weight: 400;
}

.rd-auth-field input:focus {
    outline: none;
    border-color: var(--rd-green);
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.15);
}

/* Field hint text */

.rd-auth-field-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--rd-gray-400);
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* Inline domain warning */

.rd-auth-field-warn {
    display: block;
    font-size: 0.78rem;
    color: #c05621;
    margin-top: 0.35rem;
    line-height: 1.4;
}

/* ── Login password field with toggle ── */

.rd-pw-field {
    position: relative;
    display: flex;
    align-items: center;
}

.rd-pw-field input {
    width: 100%;
    padding: 0.5rem 2.25rem 0.5rem 0.75rem;
}

.rd-pw-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: none;
    color: var(--rd-gray-400);
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.rd-pw-toggle:hover {
    color: var(--rd-gray-600);
    background: var(--rd-gray-100);
}

.rd-pw-toggle svg {
    display: block;
}

/* Addon fields (input + inline suffix) */

.rd-auth-field-addon {
    display: flex;
    align-items: stretch;
}

.rd-auth-field-addon input {
    border-radius: var(--rd-radius) 0 0 var(--rd-radius);
    border-right: none;
    flex: 1;
    min-width: 0;
}

.rd-auth-field-addon input:focus {
    outline: none;
    border-color: var(--rd-green);
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.15);
    z-index: 1;
    position: relative;
}

.rd-auth-field-suffix {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    background: var(--rd-gray-50);
    border: 1px solid var(--rd-gray-200);
    border-radius: 0 var(--rd-radius) var(--rd-radius) 0;
    font-size: 0.82rem;
    color: var(--rd-gray-500);
    white-space: nowrap;
    user-select: none;
}

/* Subdomain live-validation status */

.rd-subdomain-status {
    font-size: 0.78rem;
    margin-top: 0.35rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.rd-subdomain-ok {
    color: var(--rd-green-dark, #276749);
}

.rd-subdomain-ok::before {
    content: '\2713';
    font-weight: 700;
}

.rd-subdomain-err {
    color: #c53030;
}

.rd-subdomain-err::before {
    content: '\2717';
    font-weight: 700;
}

.rd-subdomain-loading {
    color: var(--rd-gray-500);
}

.rd-subdomain-loading::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--rd-gray-300);
    border-top-color: var(--rd-green);
    border-radius: 50%;
    animation: rd-spin 0.6s linear infinite;
    flex-shrink: 0;
}

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

/* Submit */

.rd-auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: var(--rd-green);
    border: none;
    border-radius: var(--rd-radius);
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    margin-top: 0.35rem;
}

.rd-auth-submit:hover {
    background: var(--rd-green-dark);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.25);
}

.rd-auth-submit:active {
    transform: scale(0.985);
}

/* Alt link */

.rd-auth-alt {
    text-align: center;
    font-size: 0.85rem;
    color: var(--rd-gray-400);
    margin-top: 1.75rem;
}

.rd-auth-alt a {
    color: var(--rd-green-dark);
    font-weight: 600;
    text-decoration: none;
}

.rd-auth-alt a:hover {
    text-decoration: underline;
}

/* Status icons (verify-email / denied) */

.rd-auth-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
}

.rd-auth-status-icon--success {
    color: #276749;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
}

.rd-auth-status-icon--error {
    color: #c53030;
    background: #fff5f5;
    border: 1px solid #fed7d7;
}

.rd-auth-status-icon--warn {
    color: #975a16;
    background: #fffff0;
    border: 1px solid #fefcbf;
}

.rd-auth-status-icon--info {
    color: #2b6cb0;
    background: #ebf8ff;
    border: 1px solid #bee3f8;
}

/* --- Auth Responsive --- */

@media (max-width: 768px) {
    /* Both panels are sized at a full viewport height, and the shell clips at 100vh with
       `overflow: hidden`. Stacked into a single column that made the shell 1688px tall inside an
       844px box that could not scroll: the brand panel filled the screen, and the sign-in form sat
       about 310px below the fold with no way to reach it. A phone user could not log in at all.
       Height now comes from the content, and the page scrolls normally. */
    .rd-auth-shell {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .rd-auth-brand {
        height: auto;
        min-height: 0;
        padding: 2.5rem 1.5rem 2rem;
    }

    .rd-auth-brand__content {
        max-width: 100%;
        gap: 1.5rem;
    }

    .rd-auth-brand__copy h1 {
        font-size: 1.35rem;
    }

    .rd-auth-form-panel {
        height: auto;
        overflow-y: visible;
        padding: 2rem 1.5rem 3rem;
    }
}

@media (max-width: 480px) {
    .rd-auth-brand__proof {
        display: none;
    }

    .rd-auth-brand {
        padding: 2rem 1.25rem 1.5rem;
    }

    .rd-auth-form-panel {
        padding: 1.5rem 1.25rem 2.5rem;
    }
}

/* ══════════════════════════════════════════
   Markdown Content Rendering  (rd-md-content)
   ══════════════════════════════════════════ */

.rd-md-content {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--rd-gray-800);
    word-break: break-word;
}

/* Paragraphs */
.rd-md-content p {
    margin: 0 0 0.7em;
}
.rd-md-content p:last-child { margin-bottom: 0; }

/* Headings */
.rd-md-content h1,
.rd-md-content h2,
.rd-md-content h3,
.rd-md-content h4 {
    margin: 0.9em 0 0.35em;
    font-weight: 600;
    line-height: 1.3;
    color: #0A0F1D;
}
.rd-md-content h1 { font-size: 1.15rem; }
.rd-md-content h2 { font-size: 1.05rem; }
.rd-md-content h3 { font-size: 0.95rem; }
.rd-md-content h4 { font-size: 0.88rem; }

/* Bold / Italic */
.rd-md-content strong { font-weight: 700; }
.rd-md-content em     { font-style: italic; }

/* Lists */
.rd-md-content ul,
.rd-md-content ol {
    margin: 0.4em 0 0.7em 1.4em;
    padding: 0;
}
.rd-md-content li { margin: 0.2em 0; }

/* Task-list checkboxes */
.rd-md-content input[type="checkbox"] {
    margin-right: 0.4em;
    vertical-align: middle;
}

/* Blockquote */
.rd-md-content blockquote {
    margin: 0.5em 0 0.7em;
    padding: 0.4em 0.9em;
    border-left: 3px solid var(--rd-green);
    background: rgba(72, 187, 120, 0.06);
    border-radius: 0 var(--rd-radius) var(--rd-radius) 0;
    color: var(--rd-gray-600);
    font-size: 0.88rem;
}
.rd-md-content blockquote p { margin: 0; }

/* Inline code */
.rd-md-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.82em;
    background: #F1F5F9;
    color: #0369A1;
    padding: 0.1em 0.38em;
    border-radius: 3px;
    border: 1px solid #E2E8F0;
}

/* Code block */
.rd-md-content pre {
    background: #0F172A;
    color: #CBD5E1;
    border-radius: var(--rd-radius);
    padding: 0.85em 1em;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.55;
    margin: 0.5em 0 0.8em;
}
.rd-md-content pre code {
    background: none;
    color: inherit;
    font-size: inherit;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* Tables */
.rd-md-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5em 0 0.8em;
    font-size: 0.85rem;
}
.rd-md-content th,
.rd-md-content td {
    padding: 0.4em 0.65em;
    border: 1px solid var(--rd-gray-200);
    text-align: left;
}
.rd-md-content th {
    background: var(--rd-gray-50);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--rd-gray-600);
}
.rd-md-content tr:hover td { background: var(--rd-gray-50); }

/* Horizontal rule */
.rd-md-content hr {
    border: none;
    border-top: 1px solid var(--rd-gray-200);
    margin: 0.8em 0;
}

/* Links */
.rd-md-content a {
    color: var(--rd-green-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.rd-md-content a:hover { color: var(--rd-green); }


/* ══════════════════════════════════════════
   Markdown Editor (composer)
   ══════════════════════════════════════════ */

.rd-md-editor {
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rd-md-editor:focus-within {
    border-color: var(--rd-green);
    box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.15);
}

/* Tab bar */
.rd-md-editor-tabs {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.35rem 0.5rem 0;
    background: var(--rd-gray-50);
    border-bottom: 1px solid var(--rd-gray-200);
}

.rd-md-tab {
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--rd-radius) var(--rd-radius) 0 0;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--rd-gray-600);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    line-height: 1.4;
    position: relative;
    bottom: -1px;
}
.rd-md-tab:hover { color: var(--rd-gray-800); background: var(--rd-gray-100); }

.rd-md-tab--active {
    background: #fff;
    border-color: var(--rd-gray-200);
    color: var(--rd-gray-800);
    font-weight: 600;
}

.rd-md-tab-hint {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--rd-gray-400);
    padding-right: 0.25rem;
    padding-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.rd-md-tab-hint::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cline x1='16' y1='13' x2='8' y2='13'/%3E%3Cline x1='16' y1='17' x2='8' y2='17'/%3E%3Cpolyline points='10 9 9 9 8 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.7;
}

/* Toolbar */
.rd-md-toolbar {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    padding: 0.3rem 0.5rem;
    background: #fff;
    border-bottom: 1px solid var(--rd-gray-200);
    flex-wrap: wrap;
}

.rd-md-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 26px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--rd-gray-600);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    flex-shrink: 0;
}
.rd-md-tool:hover {
    background: var(--rd-gray-100);
    border-color: var(--rd-gray-200);
    color: var(--rd-gray-800);
}
.rd-md-tool:active {
    background: rgba(72, 187, 120, 0.12);
    border-color: var(--rd-green);
    color: var(--rd-green-dark);
}

.rd-md-tool-sep {
    width: 1px;
    height: 18px;
    background: var(--rd-gray-200);
    margin: 0 0.2rem;
    flex-shrink: 0;
}

/* Textarea inside editor (removes default styling since border is on wrapper) */
.rd-md-textarea {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: 110px;
    resize: vertical;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.55;
}
.rd-md-textarea:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Preview pane */
.rd-md-preview {
    min-height: 110px;
    padding: 0.65rem 0.85rem;
    background: #fff;
}

.rd-md-preview--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rd-gray-400);
}

/* ═══════════════════════════════════════════════════════
   Ticket Detail — Header Action Bar
   ═══════════════════════════════════════════════════════ */

.rd-ticket-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rd-ticket-header-title {
    flex: 1 1 auto;
    min-width: 0;
}

.rd-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.rd-header-btn {
    /* slightly tighter than default for header density */
    padding: 0.42rem 0.85rem;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* Outlined danger variant — Escalate button */
.rd-btn-outline-danger {
    background: #fff;
    border-color: var(--rd-red);
    color: var(--rd-red);
}
.rd-btn-outline-danger:hover {
    background: #fff5f5;
}

/* Solid green resolve variant */
.rd-btn-resolve {
    background: var(--rd-green);
    color: #fff;
    border-color: transparent;
}
.rd-btn-resolve:hover {
    background: var(--rd-green-dark);
}
.rd-btn-resolve:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════
   Modal — shared enhancements
   ═══════════════════════════════════════════════════════ */

/* Upgrade existing .rd-modal-panel with a slightly larger padding */
.rd-modal-panel {
    padding: 1.25rem 1.35rem;
}

.rd-modal-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Coloured icon badge beside the modal title */
.rd-modal-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rd-modal-icon--success {
    background: rgba(72, 187, 120, 0.12);
    color: var(--rd-green-dark);
}

.rd-modal-icon--danger {
    background: rgba(229, 62, 62, 0.1);
    color: var(--rd-red);
}

.rd-modal-icon--neutral {
    background: var(--rd-gray-100);
    color: var(--rd-gray-600);
}

/* Close (×) button */
.rd-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--rd-gray-600);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.rd-modal-close:hover {
    background: var(--rd-gray-100);
    color: var(--rd-gray-800);
}

/* Footer row */
.rd-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--rd-gray-200);
}

/* Inline error banner */
.rd-modal-error {
    background: rgba(229, 62, 62, 0.07);
    border: 1px solid rgba(229, 62, 62, 0.25);
    border-radius: var(--rd-radius);
    color: var(--rd-red);
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
}

/* Character count helper text */
.rd-char-count {
    font-size: 0.75rem;
    color: var(--rd-gray-600);
    margin-top: 0.3rem;
    text-align: right;
}
.rd-char-count--warn {
    color: var(--rd-orange);
}

/* ═══════════════════════════════════════════════════════
   Log Time — quick-pick chips
   ═══════════════════════════════════════════════════════ */

.rd-time-quickpick {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.rd-time-chip {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--rd-gray-200);
    border-radius: 999px;
    background: #fff;
    color: var(--rd-gray-800);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.14s;
}
.rd-time-chip:hover {
    border-color: var(--rd-green);
    color: var(--rd-green-dark);
    background: rgba(72, 187, 120, 0.05);
}
.rd-time-chip--active {
    border-color: var(--rd-green);
    background: rgba(72, 187, 120, 0.1);
    color: var(--rd-green-dark);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   Inline spinner (used inside submit buttons)
   ═══════════════════════════════════════════════════════ */

.rd-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rd-spin 0.65s linear infinite;
}

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

/* ═══════════════════════════════════════════════════════
   Operations dashboard
   ═══════════════════════════════════════════════════════
   The dashboard is the first thing a prospect sees, so it carries more
   visual weight than the other screens. It is built from the same tokens
   (green accent, gray ramp) so it still reads as the rest of the product —
   the depth comes from gradients, tabular figures and restrained motion,
   not from a second design language.
*/

/* ─── Hero band ─── */

.rd-dash-hero {
    position: relative;
    overflow: hidden;
    padding: 1.6rem 1.75rem 1.4rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #14181F 0%, #1D2530 58%, #16352A 100%);
    color: #F8FAFC;
    box-shadow: 0 12px 34px -16px rgba(15, 23, 42, 0.55);
    animation: rd-rise 0.35s ease both;
}

/* Soft green bloom in the top-right, purely decorative. */
.rd-dash-hero-glow {
    position: absolute;
    top: -55%;
    right: -6%;
    width: 440px;
    height: 440px;
    pointer-events: none;
    background: radial-gradient(circle, rgba(72, 187, 120, 0.32) 0%, rgba(72, 187, 120, 0) 62%);
}

.rd-dash-hero-top {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
}

.rd-dash-hero-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.55);
}

.rd-dash-hero-title {
    margin: 0 0 0.3rem;
    font-size: 1.7rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: #fff;
}

.rd-dash-hero-dot { color: var(--rd-green); }

.rd-dash-hero-sub {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(248, 250, 252, 0.7);
}

.rd-dash-hero-alert { color: #FCA5A5; font-weight: 600; }

.rd-dash-hero-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* Headline numbers on the left, entitlement tracker tucked under the action buttons
   on the right — hence the deliberate 2:1 split. */
.rd-dash-hero-bottom {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 0.75rem;
    margin-top: 1.3rem;
    align-items: stretch;
}

.rd-dash-btn {
    background: var(--rd-green);
    color: #06210D;
    font-weight: 650;
    box-shadow: 0 5px 16px -6px rgba(72, 187, 120, 0.7);
}
.rd-dash-btn:hover { background: var(--rd-green-dark); color: #fff; }

.rd-dash-btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #F8FAFC;
}
.rd-dash-btn-ghost:hover { background: rgba(255, 255, 255, 0.17); color: #fff; }
.rd-dash-btn-ghost:disabled { opacity: 0.55; cursor: default; }

/* ─── KPI strip ─── */

.rd-kpis {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.rd-kpi {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.rd-kpi:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(72, 187, 120, 0.45);
    transform: translateY(-1px);
}

.rd-kpi-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.5);
}

.rd-kpi-value {
    font-size: 1.75rem;
    font-weight: 650;
    line-height: 1.1;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.rd-kpi-unit { margin-left: 0.1rem; font-size: 1rem; color: rgba(248, 250, 252, 0.6); }

.rd-kpi-note { font-size: 0.72rem; color: rgba(248, 250, 252, 0.55); }

/* Direction marker for the throughput delta. Drawn as an SVG rather than a ▲/▼ glyph
   so it inherits weight and colour consistently across platforms. */
.rd-kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    white-space: nowrap;
}

.rd-kpi-delta svg { flex-shrink: 0; }

.rd-kpi-warn { color: #FCD34D; font-weight: 600; }

.rd-kpi-good { color: #6EE7A8; font-weight: 600; }

/* ─── Minified plan tracker (inside the hero) ─── */

.rd-plan-mini {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.18s, border-color 0.18s;
}
.rd-plan-mini:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(72, 187, 120, 0.4); }

.rd-plan-mini-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.rd-plan-mini-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.5);
}

.rd-plan-mini-meter {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.15rem 0.5rem;
    font-size: 0.75rem;
    color: rgba(248, 250, 252, 0.62);
}

.rd-plan-mini-value {
    font-variant-numeric: tabular-nums;
    color: #fff;
    font-weight: 600;
}

.rd-plan-mini-track {
    grid-column: 1 / -1;
    display: block;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
}

.rd-plan-mini-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.rd-plan-mini-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.1rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.72rem;
}

.rd-plan-mini-status { color: rgba(248, 250, 252, 0.6); }

.rd-plan-mini-alert { color: #FCD34D; font-weight: 600; }

.rd-plan-mini-cta {
    flex-shrink: 0;
    font-weight: 650;
    color: var(--rd-green);
    white-space: nowrap;
}
.rd-plan-mini-cta:hover { color: #6EE7A8; text-decoration: none; }

/* ─── Layout grid ─── */

.rd-dash-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    /* Cards keep their natural height. Stretching them made the shorter SLA card carry a
       large void purely to match the attention list, which reads worse than unequal edges. */
    align-items: start;
}

.rd-dash-grid .rd-card {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.rd-dash-grid .rd-card > .rd-card-header { flex-shrink: 0; }

/* Centres content in the spare height of a stretched card, rather than stretching the
   content itself — an oversized tinted panel reads as a bug, whitespace does not. */
.rd-fill {
    margin: auto 0;
}

.rd-span-2 { grid-column: span 2; }

/* ─── Dashboard responsive ───
   The shell gained a mobile nav toggle with the earlier responsive-shell work, but the dashboard's
   own grids were never addressed. At phone width that meant: the hero's action buttons overflowed a
   hero with `overflow: hidden`, so "All tickets" and "Refresh" were unreachable rather than merely
   off-screen; the KPI strip was crushed into three ~95px columns with labels broken mid-phrase; and
   the attention/SLA row was squeezed into two ~107px columns, clipping the SLA card's heading. */

@media (max-width: 860px) {
    /* Stack the greeting above its actions so neither can be clipped. */
    .rd-dash-hero-top {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .rd-dash-hero-actions {
        flex-wrap: wrap;
    }

    .rd-dash-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Nothing spans columns once there is only one. */
    .rd-span-2 {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    /* Two columns of headline numbers cannot sit beside the plan tracker on a phone, so the
       tracker drops below them instead of being clipped off the right edge. */
    .rd-dash-hero-bottom {
        grid-template-columns: minmax(0, 1fr);
    }

    /* auto-fit rather than a hard-coded 3: two comfortable columns on a phone and three when
       there is room, with no second breakpoint to keep in sync. */
    .rd-kpis {
        grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    }

    /* Counters and pills wrap beneath the heading instead of being clipped by it. */
    .rd-card-header {
        flex-wrap: wrap;
        row-gap: 0.4rem;
    }

    .rd-dash-hero-title {
        font-size: 1.4rem;
    }
}

.rd-card-sub {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--rd-gray-400);
}

/* ─── Utility odds and ends ─── */

.rd-mono {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
}

.rd-nowrap { white-space: nowrap; }

/* ─── Needs attention ─── */

.rd-attention {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rd-attention-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--rd-gray-200);
    border-left-width: 3px;
    border-radius: 8px;
    background: #fff;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.rd-attention-item:hover {
    background: var(--rd-gray-50);
    transform: translateX(2px);
    box-shadow: 0 3px 10px -5px rgba(15, 23, 42, 0.25);
}

/* Urgency is carried by the left edge so the list scans instantly. */
.rd-attention-breached { border-left-color: var(--rd-red); }
.rd-attention-duesoon { border-left-color: var(--rd-orange); }
.rd-attention-unassigned { border-left-color: var(--rd-gray-400); }

.rd-attention-flag {
    flex-shrink: 0;
    min-width: 76px;
    padding: 0.18rem 0.45rem;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: center;
    text-transform: uppercase;
}

.rd-attention-breached .rd-attention-flag { background: #FEF2F2; color: #B91C1C; }
.rd-attention-duesoon .rd-attention-flag { background: #FFF7ED; color: #B45309; }
.rd-attention-unassigned .rd-attention-flag { background: #F1F5F9; color: #475569; }

.rd-attention-body { flex: 1; min-width: 0; }

.rd-attention-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 550;
    color: var(--rd-gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rd-attention-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    color: var(--rd-gray-600);
}

.rd-attention-time {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 650;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rd-attention-breached .rd-attention-time { color: #B91C1C; }
.rd-attention-duesoon .rd-attention-time { color: #B45309; }
.rd-attention-unassigned .rd-attention-time { color: var(--rd-gray-400); font-weight: 500; }

/* AI severity chip — the one place a second accent appears, so machine-generated
   signal is visually distinct from human-assigned priority. */
.rd-ai-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.42rem;
    border: 1px solid #C7D2FE;
    border-radius: 999px;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    color: #4338CA;
    font-size: 0.66rem;
    font-weight: 650;
}

.rd-allclear {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid #BBF7D0;
    border-radius: 8px;
    background: linear-gradient(135deg, #F0FDF4, #ECFDF5);
    color: #166534;
}
.rd-allclear p { margin: 0.15rem 0 0; }

/* ─── SLA ring ─── */

.rd-ring-wrap {
    position: relative;
    width: 152px;
    height: 152px;
    margin: 0.2rem auto 0.9rem;
}

.rd-ring { display: block; width: 100%; height: 100%; }

/* Sweep the arc in once on load. */
.rd-ring circle:last-child { animation: rd-ring-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }

.rd-ring-centre {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rd-ring-centre strong {
    font-size: 1.75rem;
    font-weight: 650;
    line-height: 1;
    color: var(--rd-gray-800);
    font-variant-numeric: tabular-nums;
}

.rd-ring-centre strong span { font-size: 1rem; color: var(--rd-gray-400); }

.rd-ring-centre small {
    margin-top: 0.25rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rd-gray-400);
}

.rd-legend {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rd-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--rd-gray-600);
}

.rd-legend li strong {
    margin-left: auto;
    color: var(--rd-gray-800);
    font-variant-numeric: tabular-nums;
}

.rd-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.rd-dot-good { background: var(--rd-green); }
.rd-dot-warn { background: var(--rd-orange); }
.rd-dot-bad { background: var(--rd-red); }

/* ─── Minified throughput strip (inside the SLA card) ─── */

.rd-mini-chart {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--rd-gray-100);
}

.rd-mini-chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem 0.5rem;
    margin-bottom: 0.5rem;
}

/* Always sits on its own line: the strip is too narrow to share a row with the legend. */
.rd-mini-chart-label {
    flex: 1 0 100%;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rd-gray-400);
}

.rd-chart-mini {
    display: block;
    width: 100%;
    height: 72px;
}

.rd-chart-axis { stroke: var(--rd-gray-200); stroke-width: 1; }

.rd-bar-created { fill: #C7D2DE; }
.rd-bar-resolved { fill: var(--rd-green); }
.rd-bar-created, .rd-bar-resolved { transition: opacity 0.15s; }
.rd-bar-created:hover, .rd-bar-resolved:hover { opacity: 0.75; }

.rd-chart-legend {
    display: flex;
    gap: 0.7rem;
    font-size: 0.68rem;
    color: var(--rd-gray-600);
}

.rd-chart-legend span { display: inline-flex; align-items: center; gap: 0.3rem; }

.rd-swatch { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.rd-swatch-created { background: #C7D2DE; }
.rd-swatch-resolved { background: var(--rd-green); }

.rd-mini-chart-foot {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: var(--rd-gray-600);
}

.rd-mini-chart-foot strong {
    color: var(--rd-gray-800);
    font-variant-numeric: tabular-nums;
}

/* Meter fill colours, shared with the hero plan tracker. */
.rd-meter-good { background: var(--rd-green); }
.rd-meter-warn { background: var(--rd-orange); }
.rd-meter-bad { background: var(--rd-red); }

/* ─── Empty state ─── */

.rd-empty { padding: 2.25rem 1.5rem; text-align: center; }
.rd-empty h2 { margin-bottom: 0.4rem; }
.rd-empty p { max-width: 54ch; margin: 0 auto 1.1rem; }

.rd-empty-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* ─── Pills used by the dashboard ─── */

.rd-pill--danger { background: #FEF2F2; color: #B91C1C; }
.rd-pill--good { background: #F0FDF4; color: #15803D; }
.rd-pill--muted { background: #F1F5F9; color: #475569; font-weight: 500; }

/* ─── Motion ─── */

@keyframes rd-rise {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: none; }
}

@keyframes rd-ring-in {
    from { stroke-dashoffset: 289; }
}

@media (prefers-reduced-motion: reduce) {
    .rd-dash-hero,
    .rd-ring circle:last-child,
    .rd-kpi,
    .rd-attention-item { animation: none; transition: none; }
}

/* ═══════════════════════════════════════════════════════
   Settings
   ═══════════════════════════════════════════════════════ */

.rd-settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 0.9rem;
}

.rd-settings-head h1 { margin: 0 0 0.2rem; }

.rd-settings-note {
    max-width: 42ch;
    margin: 0;
    text-align: right;
    line-height: 1.45;
}

.rd-settings-subhead {
    margin: 1.1rem 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--rd-gray-400);
}

.rd-settings-narrow { max-width: 26rem; }

.rd-settings-warn {
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--rd-gray-200);
    border-radius: 8px;
    background: var(--rd-gray-50);
}

/* ─── Banners ─── */

.rd-alert {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--rd-gray-200);
    border-radius: 8px;
    background: #fff;
    font-size: 0.85rem;
    animation: rd-rise 0.2s ease both;
}

.rd-alert--ok { border-color: #BBF7D0; background: #F0FDF4; color: #166534; }
.rd-alert--error { border-color: #FECACA; background: #FEF2F2; color: #991B1B; }
.rd-alert--warn { border-color: #FDE68A; background: #FFFBEB; color: #92400E; }

.rd-temp-password {
    margin-top: 0.35rem;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    background: rgba(22, 101, 52, 0.10);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    user-select: all;
}

/* ─── Forms ─── */

.rd-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.rd-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--rd-gray-100);
}

.rd-inline-field {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.rd-input-num { width: 84px; }

.rd-select-sm {
    padding: 0.3rem 0.45rem;
    font-size: 0.8rem;
    width: auto;
    min-width: 9rem;
}

.rd-field-error {
    display: block;
    margin-top: 0.3rem;
    color: #B91C1C;
    font-size: 0.78rem;
}

/* ─── Team table ─── */

.rd-col-actions { width: 1%; white-space: nowrap; text-align: right; }

.rd-row-muted td { opacity: 0.6; }

.rd-member-name { font-weight: 550; }

/* ─── Plan tab ─── */

.rd-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.rd-metric { display: flex; flex-direction: column; gap: 0.3rem; }

.rd-metric-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--rd-gray-400);
}

.rd-metric-value {
    font-size: 1.15rem;
    font-weight: 650;
    color: var(--rd-gray-800);
    font-variant-numeric: tabular-nums;
}

.rd-meter-track {
    height: 6px;
    border-radius: 999px;
    background: var(--rd-gray-100);
    overflow: hidden;
}

.rd-meter-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.rd-capability-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--rd-gray-100);
}

.rd-capability {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
}

.rd-capability--on { color: var(--rd-gray-800); }
.rd-capability--off { color: var(--rd-gray-400); }

.rd-capability-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.rd-capability--on .rd-capability-mark { background: #F0FDF4; color: #15803D; }
.rd-capability--off .rd-capability-mark { background: var(--rd-gray-100); color: var(--rd-gray-400); }

/* ─── Branding ─── */

.rd-logo-preview {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-top: 0.6rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--rd-gray-200);
    border-radius: 8px;
    background: var(--rd-gray-50);
}

.rd-logo-preview img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--rd-gray-200);
    padding: 3px;
}

.rd-detail-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rd-gray-400);
    margin-bottom: 0.15rem;
}

/* Tab flag — draws the eye to a tab that needs attention (e.g. seats exhausted). */
.rd-tab-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 0.35rem;
    border-radius: 50%;
    background: var(--rd-red);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    vertical-align: middle;
}

.rd-pill--warn { background: #FFFBEB; color: #92400E; font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   Brand mark
   ═══════════════════════════════════════════════════════
   The faceted logo, rendered from wwwroot/brand/mark-96.png. Defined globally because
   the sidebar (scoped CSS) and the auth pages both use it. */

.rd-brand-mark {
    display: block;
    object-fit: contain;
    flex-shrink: 0;
    user-select: none;
}

/* The auth panels and the sidebar are both dark, and the mark's darkest facets sit
   close to those backgrounds — a soft shadow keeps the silhouette readable. */
.rd-auth-brand__logo .rd-brand-mark {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}
/* ══════════════════════════════════════════════════════════════════════════════════════
   Click feedback — top progress bar and busy buttons

   Blazor Server turns every navigation into a circuit round trip, so from the user's side a
   click looks like nothing happened. The bar makes the wait visible; the busy treatment stops
   the second click that would otherwise submit twice. Both are driven by js/ui-feedback.js.
   ══════════════════════════════════════════════════════════════════════════════════════ */

.rd-nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    z-index: 3000;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease-out;
}

.rd-nav-progress.is-active {
    opacity: 1;
}

.rd-nav-progress__fill {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--rd-green, #2f855a), #63d69a);
    box-shadow: 0 0 8px rgba(99, 214, 154, .55);
}

/* An inline spinner for a button that is working. Sized in em so it tracks the button's own
   font size rather than needing a variant per size. */
.rd-btn.is-busy,
button.is-busy {
    position: relative;
    color: color-mix(in srgb, currentColor 55%, transparent);
    cursor: progress;
}

.rd-btn.is-busy::after,
button.is-busy::after {
    content: "";
    position: absolute;
    top: 50%;
    right: .6em;
    width: .85em;
    height: .85em;
    margin-top: -.425em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    opacity: .9;
    animation: rd-spin .6s linear infinite;
}

/* A busy link dims rather than spinning — links have no intrinsic place for a spinner. */
a.is-busy {
    opacity: .55;
    cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
    .rd-nav-progress__fill {
        transition: none !important;
    }

    .rd-btn.is-busy::after,
    button.is-busy::after {
        animation-duration: 1.6s;
    }
}

/* ── Cookie consent banner (RD-051) ───────────────────────────────────────────
   The markup for this banner has existed for a long time with no stylesheet at
   all, so even once it could render it would have been an unstyled, unclickable
   block. It is the consent surface for POPIA, so it needs to be presentable.
   Anchored to the bottom so it never covers the page content on first paint. */
.rd-cookie-banner {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1200;
    padding: 1rem;
    background: #fff;
    border-top: 1px solid var(--rd-gray-200);
    box-shadow: 0 -8px 24px rgba(16, 24, 40, .12);
}

.rd-cookie-banner-inner {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.rd-cookie-banner-content {
    flex: 1 1 auto;
    min-width: 0;
}

.rd-cookie-banner-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .35rem;
    font-weight: 600;
    color: var(--rd-dark);
}

.rd-cookie-banner-text {
    margin: 0 0 .85rem;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--rd-gray-600);
}

.rd-cookie-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .5rem;
}

.rd-cookie-category {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "name toggle" "desc toggle";
    align-items: center;
    gap: 0 .75rem;
    padding: .6rem .75rem;
    background: var(--rd-gray-50);
    border: 1px solid var(--rd-gray-200);
    border-radius: var(--rd-radius);
    cursor: pointer;
}

.rd-cookie-category--locked {
    cursor: default;
}

.rd-cookie-category-name {
    grid-area: name;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--rd-gray-800);
}

.rd-cookie-category-desc {
    grid-area: desc;
    font-size: .75rem;
    line-height: 1.4;
    color: var(--rd-gray-600);
}

/* The real checkbox carries the state; the sibling span is the visible control.
   Hiding it visually rather than with display:none keeps it focusable and keeps
   the label's screen-reader semantics intact. */
.rd-cookie-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.rd-cookie-toggle {
    grid-area: toggle;
    min-width: 3.25rem;
    padding: .25rem .6rem;
    background: var(--rd-gray-200);
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    text-align: center;
    color: var(--rd-gray-600);
}

.rd-cookie-toggle--on {
    background: var(--rd-green);
    color: #fff;
}

.rd-cookie-checkbox:focus-visible + .rd-cookie-toggle {
    outline: 2px solid var(--rd-blue);
    outline-offset: 2px;
}

.rd-cookie-banner-actions {
    display: flex;
    flex: 0 0 auto;
    gap: .5rem;
}

@media (max-width: 768px) {
    .rd-cookie-banner {
        max-height: 85vh;
        overflow-y: auto;
        padding: .875rem;
    }

    .rd-cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    /* Primary action sits on top when stacked, so "Accept all" is the nearest target. */
    .rd-cookie-banner-actions {
        flex-direction: column-reverse;
    }

    .rd-cookie-banner-actions .rd-btn {
        width: 100%;
    }
}

/* ── Wide tables on narrow screens ────────────────────────────────────────────
   The ticket table is about 683px wide. It used to make the whole content pane
   scroll sideways, which dragged the topbar off-screen with it. Scrolling the
   wrapper instead keeps the shell put. Note the wrapper rather than the card:
   putting overflow-x on the card itself would force overflow-y to compute to
   auto too, and clip any row menu that opens past its edge. */
.rd-table-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.rd-table-scroll > .rd-table {
    min-width: 680px;
}

@media (max-width: 640px) {
    /* Category is the least load-bearing column, and dropping it removes most of
       the scrolling that remains. */
    .rd-col-category {
        display: none;
    }

    .rd-table-scroll > .rd-table {
        min-width: 520px;
    }
}

/* Sign-up consent: part of the form, not a footnote, and never pre-ticked. */
.rd-auth-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--rd-text-muted);
}

.rd-auth-consent input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.rd-auth-consent a {
    color: var(--rd-primary);
}

/* Legal pages. Prose needs a measure and a rhythm; the landing layout supplies neither. */
.rd-legal {
    padding: 4rem 0 5rem;
}

.rd-legal__container {
    max-width: 760px;
    line-height: 1.7;
}

.rd-legal h1 {
    margin-bottom: 0.25rem;
}

.rd-legal h2 {
    margin-top: 2.25rem;
    margin-bottom: 0.6rem;
    font-size: 1.15rem;
}

.rd-legal p,
.rd-legal li {
    color: var(--rd-text-muted);
}

.rd-legal ul {
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.rd-legal-draft {
    margin: 1.5rem 0;
    padding: 1rem 1.15rem;
    border-left: 4px solid #c05621;
    background: #fffaf0;
    font-size: 0.88rem;
    line-height: 1.6;
    color: #7b341e;
}
