/* ReturnShield shared SaaS UI — aligned with Settings design system */

@keyframes rs-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-main {
    flex: 1;
    overflow-y: auto;
}

.app-main-inner {
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 1.5rem;
}

@media (min-width: 1024px) {
    .app-main-inner {
        padding: 2.5rem 2.5rem;
    }
}

.app-sidebar {
    width: 16rem;
    flex-shrink: 0;
    background: #1f2937;
    border-right: 1px solid #374151;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
    max-height: 100vh;
    overflow-y: auto;
}

.app-brand {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 2rem;
    text-decoration: none;
    transition: color 0.15s ease;
}

.app-brand:hover,
.app-brand:focus {
    color: #60a5fa;
    text-decoration: none;
}

.app-nav-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-nav-link:hover {
    background: #111827;
    color: #e5e7eb;
}

.app-nav-link.active,
.app-nav-link[aria-current="page"] {
    background: rgba(37, 99, 235, 0.15);
    color: #93c5fd;
    font-weight: 600;
}

.app-page-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #60a5fa;
    margin-bottom: 0.5rem;
}

.app-page-title {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 0.5rem;
}

.app-page-desc {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #9ca3af;
    max-width: 42rem;
}

.app-page-meta {
    font-size: 0.8125rem;
    color: #6b7280;
}

.app-section-eyebrow {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 0.375rem;
}

.app-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #f9fafb;
}

.app-section-desc {
    font-size: 0.8125rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.app-card {
    background: rgba(31, 41, 55, 0.85);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    overflow: hidden;
}

.app-card-padded {
    padding: 1.25rem 1.5rem;
}

.app-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #374151;
}

.app-card-body {
    padding: 1.25rem 1.5rem;
}

.app-stat-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 0.375rem;
}

.app-stat-label.mb-0 {
    margin-bottom: 0;
}

.app-stat-value {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 700;
    color: #f9fafb;
}

.app-stat-sub {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.app-input,
.app-select {
    width: 100%;
    background-color: #111827;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    color: #f9fafb;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.app-input:-webkit-autofill,
.app-input:-webkit-autofill:hover,
.app-input:-webkit-autofill:focus,
.app-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #111827 inset !important;
    box-shadow: 0 0 0 1000px #111827 inset !important;
    -webkit-text-fill-color: #f9fafb !important;
    caret-color: #f9fafb;
    border: 1px solid #374151;
    transition: background-color 99999s ease-in-out 0s;
}

.app-input:disabled {
    opacity: 0.72;
    cursor: wait;
    background-color: #111827 !important;
    color: #f9fafb !important;
    -webkit-text-fill-color: #f9fafb !important;
}

.app-select {
    width: auto;
}

.app-input:focus,
.app-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.app-input::placeholder {
    color: #6b7280;
}

.app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.app-btn:hover,
.app-btn:focus {
    text-decoration: none;
}

.app-btn-primary {
    background: #2563eb;
    color: #fff;
}

.app-btn-primary:hover {
    background: #1d4ed8;
}

.app-btn-secondary {
    background: #374151;
    color: #f9fafb;
}

.app-btn-secondary:hover {
    background: #4b5563;
}

.app-btn-ghost {
    background: transparent;
    border: 1px solid #374151;
    color: #e5e7eb;
}

.app-btn-ghost:hover {
    background: #1f2937;
}

.app-btn-danger {
    background: #dc2626;
    color: #fff;
}

.app-btn-danger:hover {
    background: #b91c1c;
}

.app-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.app-table-wrap {
    background: rgba(31, 41, 55, 0.85);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    overflow: hidden;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.app-table thead {
    background: #111827;
}

.app-table th {
    padding: 0.875rem 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
    border-bottom: 1px solid #374151;
}

.app-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: #e5e7eb;
    border-bottom: 1px solid #1f2937;
}

.app-table tbody tr:last-child td {
    border-bottom: none;
}

.app-table tbody tr:hover {
    background: rgba(17, 24, 39, 0.45);
}

.app-link {
    color: #93c5fd;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: color 0.15s ease;
}

.app-link:hover {
    color: #bfdbfe;
}

.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    border: 1px solid transparent;
}

.app-badge-neutral {
    color: #9ca3af;
    background: #1f2937;
    border-color: #374151;
}

.app-badge-success {
    color: #4ade80;
    background: rgba(22, 101, 52, 0.25);
    border-color: rgba(34, 197, 94, 0.35);
}

.app-badge-warning {
    color: #fbbf24;
    background: rgba(120, 53, 15, 0.25);
    border-color: rgba(245, 158, 11, 0.35);
}

.app-badge-danger {
    color: #f87171;
    background: rgba(127, 29, 29, 0.25);
    border-color: rgba(239, 68, 68, 0.35);
}

.app-badge-info {
    color: #93c5fd;
    background: rgba(30, 58, 138, 0.25);
    border-color: rgba(59, 130, 246, 0.35);
}

.app-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.app-toast {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.625rem;
    z-index: 50;
    min-width: 220px;
    padding: 0.625rem 0.875rem;
    border-radius: 0.625rem;
    background: #1f2937;
    border: 1px solid #374151;
    color: #f9fafb;
    font-size: 0.8125rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    animation: rs-fade-in 0.25s ease-out;
}

.app-toast.is-status {
    border-color: #3b82f6;
    color: #93c5fd;
}

.app-toast.is-error {
    border-color: #ef4444;
    color: #fca5a5;
}

.app-profile-block {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    position: relative;
}

.app-profile-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.app-profile-summary:hover,
.app-profile-block.is-open .app-profile-summary {
    background: #111827;
}

.app-profile-summary:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.55);
    outline-offset: 2px;
}

.app-profile-actions {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.25rem 0.25rem;
}

.app-profile-block.is-open .app-profile-actions {
    display: flex;
}

.app-profile-logout-btn {
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #f87171;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.28);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.app-profile-logout-btn:hover {
    background: rgba(127, 29, 29, 0.22);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

.app-profile-logout-btn:focus-visible {
    outline: 2px solid rgba(239, 68, 68, 0.55);
    outline-offset: 2px;
}

.app-divider {
    border-top: 1px solid #374151;
}

.app-card.is-loading {
    opacity: 0.7;
}

.app-card-accent-danger {
    border-color: rgba(239, 68, 68, 0.35);
}

.app-card-accent-success {
    border-color: rgba(34, 197, 94, 0.35);
}

.app-card-accent-info {
    border-color: rgba(59, 130, 246, 0.35);
}

.analytics-metric-card {
    background: rgba(31, 41, 55, 0.85);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    transition: border-color 0.15s ease, opacity 0.15s ease;
}

.analytics-metric-card.is-loading {
    opacity: 0.65;
}

.analytics-metric-card.is-error {
    border-color: rgba(239, 68, 68, 0.45);
}

.metric-info-wrap {
    position: relative;
    display: inline-flex;
}

.metric-info-btn {
    width: 16px;
    height: 16px;
    border-radius: 9999px;
    border: 1px solid #4b5563;
    color: #9ca3af;
    font-size: 10px;
    line-height: 14px;
    text-align: center;
    background: #111827;
    cursor: help;
}

.metric-info-btn:hover,
.metric-info-btn:focus {
    color: #93c5fd;
    border-color: #3b82f6;
    outline: none;
}

.metric-info-tooltip {
    pointer-events: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    width: 240px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #030712;
    border: 1px solid #374151;
    color: #d1d5db;
    font-size: 11px;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 30;
}

.metric-info-wrap:hover .metric-info-tooltip,
.metric-info-wrap:focus-within .metric-info-tooltip {
    opacity: 1;
    visibility: visible;
}

.metric-delta {
    font-size: 11px;
    margin-top: 6px;
}

.metric-delta.positive {
    color: #4ade80;
}

.metric-delta.negative {
    color: #f87171;
}

.metric-delta.neutral {
    color: #9ca3af;
}

.metric-subtext {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.app-profile-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.app-profile-avatar {
    width: 3.5rem;
    height: 3.5rem;
    flex-shrink: 0;
    border-radius: 9999px;
    background: #2563eb;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
}

.app-profile-name {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 700;
    color: #f9fafb;
}

.app-profile-meta {
    font-size: 0.8125rem;
    color: #9ca3af;
    margin-top: 0.125rem;
}

.app-profile-plan {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #60a5fa;
    margin-top: 0.375rem;
}

.app-detail-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 0.375rem;
}

.app-detail-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #f9fafb;
}

.app-detail-value-lg {
    font-size: 1.125rem;
    line-height: 1.5rem;
    font-weight: 700;
    color: #f9fafb;
}

.app-detail-sub {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #9ca3af;
}

.app-report-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.app-report-stat-tile {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 1rem 1.125rem;
    min-height: 5.5rem;
}

.app-report-stat-value {
    font-size: 1.375rem;
    line-height: 1.75rem;
    font-weight: 700;
    color: #f9fafb;
}

.app-report-stat-value.is-danger {
    color: #f87171;
}

.app-report-stat-value.is-success {
    color: #4ade80;
}

.app-report-delta {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.375rem;
}

.app-report-delta.positive {
    color: #4ade80;
}

.app-report-delta.negative {
    color: #f87171;
}

.app-report-delta.neutral {
    color: #9ca3af;
}

.app-status-banner {
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #374151;
    background: rgba(31, 41, 55, 0.6);
    color: #9ca3af;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
}

.app-status-banner.is-error {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(127, 29, 29, 0.2);
    color: #fca5a5;
}

.app-status-banner.is-resolved {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(6, 78, 59, 0.25);
    color: #6ee7b7;
}

.app-status-banner.is-dispute {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(120, 53, 15, 0.25);
    color: #fcd34d;
}

.app-status-banner.is-success {
    border-color: rgba(16, 185, 129, 0.55);
    background: rgba(6, 78, 59, 0.35);
    color: #a7f3d0;
}

.app-action-panel.is-resolved {
    border-color: rgba(55, 65, 81, 0.9);
    background: rgba(17, 24, 39, 0.85);
}

.app-action-note.is-resolved-note {
    color: #d1d5db;
}

.app-action-stack.is-closed,
.app-btn.is-action-closed {
    display: none !important;
    pointer-events: none !important;
}

.app-timeline {
    position: relative;
    border-left: 1px solid #374151;
    margin-left: 0.5rem;
    padding-left: 1.25rem;
}

.app-timeline-item {
    position: relative;
    padding-bottom: 1.25rem;
}

.app-timeline-item:last-child {
    padding-bottom: 0;
}

.app-timeline-dot {
    position: absolute;
    left: -1.375rem;
    top: 0.25rem;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
    border: 2px solid #111827;
}

.app-timeline-dot.info {
    background: #3b82f6;
}

.app-timeline-dot.danger {
    background: #ef4444;
}

.app-timeline-dot.warning {
    background: #f59e0b;
}

.app-timeline-dot.muted {
    background: #6b7280;
}

.app-evidence-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

@media (min-width: 768px) {
    .app-evidence-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.app-evidence-card,
.app-evidence-hit,
.app-evidence-drop,
.app-evidence-upload,
.app-evidence-file-actions button,
.app-evidence-link {
    box-sizing: border-box;
}

.app-evidence-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    height: 100%;
}

.app-evidence-hit {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    cursor: pointer;
}

.app-evidence-title {
    margin: 0;
    color: #e5e7eb;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
}

.app-evidence-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 9.5rem;
    padding: 1rem;
    border: 1px dashed #4b5563;
    border-radius: 0.75rem;
    background: #111827;
    color: #9ca3af;
    text-align: center;
    overflow: hidden;
}

.app-evidence-hit:hover .app-evidence-drop,
.app-evidence-hit:focus-within .app-evidence-drop {
    border-color: #60a5fa;
    color: #d1d5db;
}

.app-evidence-card.is-evidence-locked .app-evidence-hit:hover .app-evidence-drop,
.app-evidence-card.is-evidence-locked .app-evidence-hit:focus-within .app-evidence-drop {
    border-color: #4b5563;
    color: #9ca3af;
}

.app-evidence-card.is-evidence-locked .app-evidence-upload,
.app-evidence-card.is-evidence-locked [data-evidence-remove] {
    opacity: 0.55;
    cursor: not-allowed;
}

.app-evidence-icon {
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
}

.app-evidence-drop-copy {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.35;
}

.app-evidence-preview {
    width: 100%;
    height: 7.5rem;
    object-fit: cover;
    border-radius: 0.5rem;
    background: #030712;
}

.app-evidence-pdf {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.app-evidence-pdf-page {
    position: relative;
    width: 4.75rem;
    height: 6rem;
    border-radius: 0.35rem;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.app-evidence-pdf-page::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    border-style: solid;
    border-width: 0 0.9rem 0.9rem 0;
    border-color: #cbd5e1 #0f172a;
}

.app-evidence-pdf-badge {
    position: absolute;
    top: 0.45rem;
    left: 0.4rem;
    padding: 0.12rem 0.32rem;
    border-radius: 0.2rem;
    background: #dc2626;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
}

.app-evidence-pdf-lines {
    position: absolute;
    left: 0.45rem;
    right: 0.7rem;
    bottom: 0.5rem;
    height: 2.5rem;
    background:
        linear-gradient(#64748b, #64748b) 0 0 / 100% 2px no-repeat,
        linear-gradient(#94a3b8, #94a3b8) 0 0.55rem / 88% 2px no-repeat,
        linear-gradient(#94a3b8, #94a3b8) 0 1.1rem / 94% 2px no-repeat,
        linear-gradient(#94a3b8, #94a3b8) 0 1.65rem / 72% 2px no-repeat,
        linear-gradient(#94a3b8, #94a3b8) 0 2.2rem / 80% 2px no-repeat;
}

.app-evidence-pdf-name,
.app-evidence-pdf-meta {
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-evidence-pdf-name {
    color: #f9fafb;
    font-size: 0.75rem;
    font-weight: 600;
}

.app-evidence-pdf-meta {
    color: #9ca3af;
    font-size: 0.7rem;
}

.app-evidence-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    pointer-events: none;
}

.app-evidence-upload {
    width: 100%;
    max-width: 100%;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.5rem 0.75rem;
    border: 0;
    border-radius: 0.5rem;
    background: #374151;
    color: #f9fafb;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    white-space: nowrap;
    cursor: pointer;
}

.app-evidence-upload svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.app-evidence-filename {
    margin: 0;
    min-height: 1rem;
    color: #d1d5db;
    font-size: 0.75rem;
    line-height: 1.3;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-evidence-file-actions {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.app-evidence-file-actions button,
.app-evidence-link {
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #374151;
    background: transparent;
    color: #e5e7eb;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    text-decoration: none;
    cursor: pointer;
}

.app-evidence-card-error {
    margin: 0;
    min-height: 1rem;
    color: #fca5a5;
    font-size: 0.75rem;
    line-height: 1.35;
    text-align: center;
}

.app-evidence-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 9999px;
    animation: app-evidence-spin 0.7s linear infinite;
}

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

.app-evidence-card.is-uploading .app-evidence-upload {
    opacity: 0.7;
    cursor: progress;
}

.app-evidence-card.is-uploading .app-evidence-input {
    pointer-events: none;
}

.app-evidence-tile {
    aspect-ratio: 16 / 9;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    overflow: hidden;
}

.app-evidence-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6b7280;
    font-size: 0.75rem;
    text-align: center;
    padding: 0.75rem;
}

.app-action-panel {
    background: rgba(31, 41, 55, 0.85);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

.rs-order-action-btn,
.app-action-stack .app-btn[data-order-action],
.app-action-stack .app-btn[data-action] {
    pointer-events: auto !important;
    position: relative;
    z-index: 3;
    cursor: pointer;
}

.app-action-panel.is-sticky {
    height: fit-content;
}

@media (min-width: 1024px) {
    .app-action-panel.is-sticky {
        position: sticky;
        top: 1.5rem;
    }
}

.app-action-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.app-action-note {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #374151;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #9ca3af;
    text-align: center;
}

.app-btn-success {
    background: #059669;
    color: #fff;
}

.app-btn-success:hover {
    background: #047857;
}

.app-btn-success:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.app-standalone-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #111827;
}

.app-standalone-brand {
    padding: 1.5rem 1.5rem 0;
    text-align: center;
}

.app-standalone-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.app-standalone-card {
    width: 100%;
    max-width: 28rem;
    text-align: center;
}

.app-action-success-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.app-action-success-icon.is-success {
    background: rgba(22, 101, 52, 0.2);
    border-color: rgba(34, 197, 94, 0.35);
    color: #4ade80;
}

.app-action-success-icon.is-dispute {
    background: rgba(30, 58, 138, 0.2);
    border-color: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

/* Auth pages (login, signup, reset) */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: #111827;
    color: #f9fafb;
    color-scheme: dark;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.auth-shell {
    width: 100%;
    max-width: 26rem;
}

.auth-card {
    background: rgba(31, 41, 55, 0.92);
    border: 1px solid #374151;
    border-radius: 0.875rem;
    padding: 2rem 1.75rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-header .app-brand {
    margin-bottom: 0.75rem;
    font-size: 1.625rem;
}

.auth-tagline {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #9ca3af;
    max-width: 18rem;
    margin: 0 auto;
}

.auth-alert {
    margin-bottom: 1rem;
    padding: 0.75rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    border: 1px solid transparent;
}

.auth-alert.is-error {
    background: rgba(127, 29, 29, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.auth-alert.is-warning {
    background: rgba(120, 53, 15, 0.25);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

.auth-alert.is-success {
    background: rgba(22, 101, 52, 0.25);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.auth-alert.hidden,
.auth-field-error.hidden,
.auth-success.hidden {
    display: none;
}

.auth-success {
    margin-bottom: 1rem;
    padding: 0.75rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    background: rgba(30, 58, 138, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
    text-align: center;
}

.auth-page .app-btn.auth-action-btn {
    background: #2563eb;
    color: #fff;
    border: 1px solid #2563eb;
    font-weight: 600;
}

.auth-page .app-btn.auth-action-btn:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.auth-page .app-btn.auth-action-btn:disabled {
    opacity: 0.72;
}

.auth-page .app-btn.auth-action-btn.is-outline {
    background: transparent;
    color: #93c5fd;
    border-color: #3b82f6;
}

.auth-page .app-btn.auth-action-btn.is-outline:hover:not(:disabled) {
    background: rgba(37, 99, 235, 0.12);
}

.auth-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #f9fafb;
    background: #1f2937;
    border: 1px solid #4b5563;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-btn-google:hover:not(:disabled) {
    background: #374151;
    border-color: #6b7280;
}

.auth-btn-google:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: #6b7280;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #374151;
}

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

.auth-form.is-busy {
    pointer-events: none;
    opacity: 0.72;
}

.auth-form.is-busy .app-input,
.auth-form.is-busy .auth-toggle-pass {
    cursor: wait;
}

.auth-status-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(22, 101, 52, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.auth-status-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #f9fafb;
    margin: 0 0 0.5rem;
}

.auth-status-copy {
    font-size: 0.875rem;
    line-height: 1.55;
    color: #9ca3af;
    margin: 0 0 1.25rem;
}

.auth-status-email {
    color: #93c5fd;
    font-weight: 600;
    word-break: break-all;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.auth-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap .app-input {
    padding-right: 4.25rem;
}

.auth-field .app-input.is-error,
.auth-input-wrap .app-input.is-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.auth-name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 480px) {
    .auth-name-row {
        grid-template-columns: 1fr;
    }
}

.auth-password-rules {
    display: flex;
    flex-direction: column;
    gap: 0.3125rem;
    margin-top: 0.125rem;
    padding: 0.625rem 0.75rem;
    background: rgba(17, 24, 39, 0.55);
    border: 1px solid #374151;
    border-radius: 0.5rem;
}

.auth-password-rules.hidden {
    display: none;
}

.auth-password-rule {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    font-size: 0.6875rem;
    line-height: 1.35;
    color: #9ca3af;
}

.auth-password-rule.is-met {
    color: #86efac;
}

.auth-password-rule-icon {
    flex-shrink: 0;
    width: 0.875rem;
    text-align: center;
    font-size: 0.625rem;
    font-weight: 700;
}

.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #9ca3af;
    cursor: pointer;
    user-select: none;
    margin-top: 0.125rem;
}

.auth-terms input {
    width: 1rem;
    height: 1rem;
    margin-top: 0.125rem;
    accent-color: #2563eb;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-terms a {
    color: #93c5fd;
    font-weight: 600;
    text-decoration: none;
}

.auth-terms a:hover,
.auth-terms a:focus {
    color: #bfdbfe;
    text-decoration: none;
}

.auth-terms-optional {
    margin-top: 0.625rem;
    color: #6b7280;
}

.auth-toggle-pass {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

.auth-toggle-pass:hover,
.auth-toggle-pass:focus {
    color: #93c5fd;
    outline: none;
}

.auth-field-error {
    font-size: 0.75rem;
    color: #fca5a5;
    margin: 0;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #9ca3af;
    cursor: pointer;
    user-select: none;
}

.auth-checkbox input {
    width: 1rem;
    height: 1rem;
    accent-color: #2563eb;
    cursor: pointer;
}

.auth-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #93c5fd;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-link:hover,
.auth-link:focus {
    color: #bfdbfe;
    text-decoration: none;
}

.auth-submit {
    width: 100%;
    margin-top: 0.5rem;
}

.auth-footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid #374151;
    text-align: center;
}

.auth-footer-signup {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 0.875rem;
}

.auth-footer-signup a {
    color: #60a5fa;
    font-weight: 700;
    text-decoration: none;
}

.auth-footer-signup a:hover,
.auth-footer-signup a:focus {
    color: #93c5fd;
    text-decoration: none;
}

.auth-footer-note {
    font-size: 0.75rem;
    line-height: 1.45;
    color: #6b7280;
}

.auth-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 9999px;
    animation: rs-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 0.375rem;
}

.auth-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.875rem;
    padding: 1.5rem 0 0.5rem;
    text-align: center;
}

.auth-loading-state .auth-spinner {
    width: 1.75rem;
    height: 1.75rem;
    margin-right: 0;
    border-width: 2.5px;
}

.auth-account-badge {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    margin-bottom: 0.25rem;
    background: rgba(30, 58, 138, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.28);
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #d1d5db;
}

.auth-account-badge-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
    font-size: 0.875rem;
}

.auth-account-badge-email {
    color: #93c5fd;
    font-weight: 600;
    word-break: break-all;
}

.auth-strength-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.125rem;
}

.auth-strength-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.auth-strength-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #9ca3af;
}

.auth-strength-value {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.auth-strength-value.is-weak { color: #fca5a5; }
.auth-strength-value.is-fair { color: #fcd34d; }
.auth-strength-value.is-good { color: #86efac; }
.auth-strength-value.is-strong { color: #4ade80; }

.auth-strength-track {
    height: 0.375rem;
    border-radius: 9999px;
    background: rgba(17, 24, 39, 0.75);
    border: 1px solid #374151;
    overflow: hidden;
}

.auth-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 9999px;
    background: #ef4444;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.auth-strength-fill.is-fair { background: #f59e0b; }
.auth-strength-fill.is-good { background: #22c55e; }
.auth-strength-fill.is-strong { background: #16a34a; }

.auth-invalid-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 0.25rem;
}

.auth-invalid-state .auth-status-icon {
    background: rgba(127, 29, 29, 0.25);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.auth-invalid-actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: 100%;
    margin-top: 0.25rem;
}

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.auth-modal-card {
    width: 100%;
    max-width: 24rem;
    background: rgba(31, 41, 55, 0.96);
    border: 1px solid #374151;
    border-radius: 0.875rem;
    padding: 2rem 1.75rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    text-align: center;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s ease;
}

.auth-modal-overlay.is-visible .auth-modal-card {
    transform: translateY(0) scale(1);
}

.auth-modal-card .auth-status-copy {
    margin-bottom: 1.5rem;
}

.auth-security-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.125rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(17, 24, 39, 0.55);
    border: 1px solid #374151;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #6b7280;
}

.auth-security-note-icon {
    flex-shrink: 0;
    color: #60a5fa;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem 1.25rem;
    }

    .auth-header .app-brand {
        font-size: 1.5rem;
    }
}

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

/* Landing page */
.landing-page {
    min-height: 100vh;
    background: #111827;
    color: #f9fafb;
    color-scheme: dark;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.landing-page a,
.landing-page a:hover,
.landing-page a:focus,
.landing-page a:visited,
.landing-page a:active {
    text-decoration: none;
}

.landing-page .landing-headline,
.landing-page .landing-headline-accent,
.landing-page .landing-headline * {
    text-decoration: none;
}

.landing-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(55, 65, 81, 0.85);
    background: rgba(17, 24, 39, 0.88);
    backdrop-filter: blur(10px);
}

.landing-nav-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.landing-nav-links {
    display: none;
    align-items: center;
    gap: 1.75rem;
}

.landing-nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s ease;
}

.landing-nav-link:hover,
.landing-nav-link:focus {
    color: #e5e7eb;
    text-decoration: none;
}

.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.landing-hero {
    position: relative;
    overflow: hidden;
    padding: 4rem 1.5rem 5rem;
}

.landing-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 99, 235, 0.22), transparent 55%),
        radial-gradient(ellipse 50% 40% at 90% 20%, rgba(59, 130, 246, 0.08), transparent 50%);
    pointer-events: none;
}

.landing-hero-inner {
    position: relative;
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .landing-hero {
        padding: 5.5rem 2.5rem 6rem;
    }

    .landing-hero-inner {
        grid-template-columns: 1.05fr 0.95fr;
        gap: 3.5rem;
    }

    .landing-nav-links {
        display: flex;
    }
}

.landing-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    margin-bottom: 1.25rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.landing-headline {
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #f9fafb;
    margin-bottom: 1.25rem;
}

.landing-headline-accent {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.landing-subheadline {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: #9ca3af;
    max-width: 34rem;
    margin-bottom: 2rem;
}

.landing-hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.landing-hero-note {
    font-size: 0.8125rem;
    color: #6b7280;
}

.landing-hero-note strong {
    color: #9ca3af;
    font-weight: 600;
}

.landing-hero-visual {
    margin: 0;
    width: 100%;
}

.landing-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    padding: 1.25rem;
    border-radius: 1rem;
    border: 1px solid rgba(55, 65, 81, 0.85);
    background: #111827;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.15),
        0 24px 48px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    overflow: hidden;
}

.landing-preview-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
    margin: 0;
    object-fit: contain;
    object-position: center center;
    vertical-align: middle;
    background: #111827;
}

.landing-preview-chrome {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    background: rgba(17, 24, 39, 0.85);
    border-bottom: 1px solid #374151;
}

.landing-preview-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 9999px;
    background: #4b5563;
}

.landing-preview-dot.is-red { background: #ef4444; }
.landing-preview-dot.is-yellow { background: #f59e0b; }
.landing-preview-dot.is-green { background: #22c55e; }

.landing-preview-body {
    padding: 1.25rem;
    display: grid;
    gap: 0.875rem;
}

.landing-preview-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.625rem;
}

.landing-preview-stat {
    padding: 0.875rem 0.75rem;
    border-radius: 0.625rem;
    background: rgba(17, 24, 39, 0.65);
    border: 1px solid #374151;
}

.landing-preview-stat-label {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.375rem;
}

.landing-preview-stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #f9fafb;
}

.landing-preview-stat-value.is-positive { color: #4ade80; }

.landing-preview-chart {
    height: 7.5rem;
    border-radius: 0.625rem;
    background: rgba(17, 24, 39, 0.65);
    border: 1px solid #374151;
    padding: 0.875rem;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.landing-preview-bar {
    flex: 1;
    border-radius: 0.25rem 0.25rem 0 0;
    background: linear-gradient(180deg, #3b82f6 0%, rgba(37, 99, 235, 0.45) 100%);
    min-height: 1.5rem;
}

.landing-preview-rows {
    display: grid;
    gap: 0.5rem;
}

.landing-preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(17, 24, 39, 0.55);
    border: 1px solid #374151;
    font-size: 0.75rem;
}

.landing-preview-row-label {
    color: #d1d5db;
    font-weight: 500;
}

.landing-preview-row-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.landing-preview-glow {
    position: absolute;
    inset: auto -20% -30% -20%;
    height: 60%;
    background: radial-gradient(ellipse at center, rgba(37, 99, 235, 0.18), transparent 70%);
    pointer-events: none;
}

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

@media (min-width: 1024px) {
    .landing-section {
        padding: 5.5rem 2.5rem;
    }
}

.landing-section-inner {
    max-width: 72rem;
    margin: 0 auto;
}

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

.landing-section-title {
    font-size: clamp(1.625rem, 3vw, 2.125rem);
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.landing-section-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: #9ca3af;
}

.landing-features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .landing-features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.landing-feature-card {
    padding: 1.75rem 1.5rem;
    border-radius: 0.875rem;
    background: rgba(31, 41, 55, 0.72);
    border: 1px solid #374151;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.landing-feature-card:hover {
    border-color: rgba(59, 130, 246, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

.landing-feature-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    margin-bottom: 1.125rem;
    font-size: 1.25rem;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.landing-feature-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 0.5rem;
}

.landing-feature-copy {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #9ca3af;
}

.landing-feature-spotlight {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    align-items: center;
    margin-top: 4rem;
    padding: 1.75rem;
    border-radius: 1rem;
    background: rgba(31, 41, 55, 0.4);
    border: 1px solid rgba(55, 65, 81, 0.65);
}

@media (min-width: 1024px) {
    .landing-feature-spotlight {
        grid-template-columns: 0.9fr 1.1fr;
        gap: 3rem;
        padding: 2.5rem;
    }

    .landing-feature-spotlight.is-reversed {
        grid-template-columns: 1.1fr 0.9fr;
    }

    .landing-feature-spotlight.is-reversed .landing-feature-spotlight-copy {
        order: 2;
    }

    .landing-feature-spotlight.is-reversed .landing-hero-visual {
        order: 1;
    }
}

.landing-feature-spotlight + .landing-feature-spotlight {
    margin-top: 2rem;
}

.landing-feature-spotlight-copy {
    max-width: 34rem;
}

.landing-feature-spotlight-title {
    font-size: clamp(1.375rem, 2.5vw, 1.875rem);
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f9fafb;
    margin-bottom: 1rem;
}

.landing-feature-spotlight-desc {
    font-size: 1rem;
    line-height: 1.65;
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

.landing-feature-spotlight-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.landing-feature-spotlight-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: #d1d5db;
}

.landing-feature-spotlight-list li::before {
    content: "✓";
    flex-shrink: 0;
    font-weight: 700;
    color: #4ade80;
}

.landing-feature-spotlight .landing-hero-visual {
    margin: 0;
    width: 100%;
}

.landing-how-it-works-showcase {
    margin-top: 3rem;
}

.landing-how-it-works-showcase + .landing-how-it-works-showcase {
    margin-top: 2rem;
}

.landing-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    counter-reset: landing-step;
}

@media (min-width: 768px) {
    .landing-steps {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

.landing-step {
    position: relative;
    text-align: center;
    padding: 1.75rem 1.25rem;
    border-radius: 0.875rem;
    background: rgba(31, 41, 55, 0.55);
    border: 1px solid #374151;
}

.landing-step-number {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-size: 0.9375rem;
    font-weight: 800;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.landing-step-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 0.5rem;
}

.landing-step-copy {
    font-size: 0.875rem;
    line-height: 1.55;
    color: #9ca3af;
}

.landing-cta-band {
    padding: 3.5rem 1.5rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.18) 0%, rgba(17, 24, 39, 0.95) 100%);
    border-top: 1px solid #374151;
    border-bottom: 1px solid #374151;
}

.landing-cta-band-inner {
    max-width: 48rem;
    margin: 0 auto;
    text-align: center;
}

.landing-cta-band-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 0.75rem;
}

.landing-cta-band-copy {
    font-size: 1rem;
    color: #9ca3af;
    margin-bottom: 1.75rem;
    line-height: 1.6;
}

.landing-footer {
    padding: 3rem 1.5rem 2rem;
    background: rgba(17, 24, 39, 0.95);
    border-top: 1px solid #374151;
}

.landing-footer-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .landing-footer-inner {
        grid-template-columns: 1.4fr 1fr 1fr;
    }
}

.landing-footer-brand {
    font-size: 1.375rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.75rem;
    display: inline-block;
    text-decoration: none;
}

.landing-footer-brand:hover,
.landing-footer-brand:focus {
    color: #60a5fa;
    text-decoration: none;
}

.landing-footer-tagline {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #6b7280;
    max-width: 18rem;
}

.landing-footer-heading {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.landing-footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.landing-footer-link {
    font-size: 0.875rem;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s ease;
}

.landing-footer-link:hover,
.landing-footer-link:focus {
    color: #e5e7eb;
    text-decoration: none;
}

.landing-footer-bottom {
    max-width: 72rem;
    margin: 2.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid #374151;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    text-align: center;
    font-size: 0.8125rem;
    color: #6b7280;
}

@media (min-width: 640px) {
    .landing-footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }

    .landing-nav-login-desktop {
        display: inline-flex;
    }
}

.landing-nav-login-desktop {
    display: none;
}

.landing-btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.landing-cta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.landing-preview-title {
    margin-left: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
}

.landing-section-muted {
    background: rgba(31, 41, 55, 0.35);
}

.landing-pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 52rem;
    margin: 0 auto;
}

.landing-pricing-offer {
    max-width: 40rem;
    margin: 0 auto;
    padding: 2rem 1.75rem;
    border-radius: 0.875rem;
    background: rgba(31, 41, 55, 0.82);
    border: 1px solid rgba(59, 130, 246, 0.35);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
    text-align: center;
}

.landing-pricing-offer-head {
    margin-bottom: 1.5rem;
}

.landing-pricing-offer-label {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.3125rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.28);
}

.landing-pricing-offer-prices {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.landing-pricing-offer-price-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
}

.landing-pricing-offer-amount {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 800;
    line-height: 1;
    color: #f9fafb;
}

.landing-pricing-offer-period {
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
}

.landing-pricing-offer-arrow {
    font-size: 1.5rem;
    font-weight: 700;
    color: #60a5fa;
}

.landing-pricing-offer-divider {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    background: rgba(17, 24, 39, 0.65);
    border: 1px solid #374151;
}

.landing-pricing-offer-callout {
    margin: 1.25rem auto 0;
    max-width: 36rem;
    padding: 0.875rem 1rem;
    border-radius: 0.625rem;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(30, 58, 138, 0.28);
    color: #e5e7eb;
    font-size: 0.9375rem;
    line-height: 1.6;
    text-align: left;
}

.landing-pricing-offer-summary {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: #9ca3af;
    max-width: 32rem;
    margin: 1rem auto 0;
}

.landing-pricing-offer-summary-note {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.landing-pricing-offer-summary-note a {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.landing-pricing-offer-summary-note a:hover,
.landing-pricing-offer-summary-note a:focus {
    color: #93c5fd;
}

.landing-pricing-offer-features {
    text-align: left;
    margin-bottom: 1.75rem !important;
    padding: 1rem 1.125rem;
    border-radius: 0.625rem;
    background: rgba(17, 24, 39, 0.55);
    border: 1px solid #374151;
}

.landing-pricing-offer-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.landing-pricing-offer-actions .app-btn {
    width: 100%;
    max-width: 20rem;
}

.landing-pricing-offer-note {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
}

@media (min-width: 768px) {
    .landing-pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.landing-pricing-card {
    position: relative;
    padding: 2rem 1.75rem;
    border-radius: 0.875rem;
    background: rgba(31, 41, 55, 0.72);
    border: 1px solid #374151;
    display: flex;
    flex-direction: column;
}

.landing-pricing-card.is-featured {
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15), 0 20px 40px rgba(0, 0, 0, 0.25);
}

.landing-pricing-badge {
    position: absolute;
    top: -0.625rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #dbeafe;
    background: #2563eb;
    border: 1px solid rgba(147, 197, 253, 0.35);
}

.landing-pricing-plan {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 0.5rem;
}

.landing-pricing-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: #f9fafb;
    line-height: 1;
    margin-bottom: 0.375rem;
}

.landing-pricing-price span {
    font-size: 1rem;
    font-weight: 600;
    color: #9ca3af;
}

.landing-pricing-desc {
    font-size: 0.875rem;
    line-height: 1.55;
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

.landing-pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    flex: 1;
}

.landing-pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #d1d5db;
}

.landing-pricing-features li::before {
    content: "✓";
    flex-shrink: 0;
    color: #4ade80;
    font-weight: 700;
}

.landing-faq-list {
    max-width: 42rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.landing-faq-item {
    border: 1px solid #374151;
    border-radius: 0.75rem;
    background: rgba(31, 41, 55, 0.72);
    overflow: hidden;
}

.landing-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.125rem;
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #f3f4f6;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.landing-faq-question:hover {
    background: rgba(17, 24, 39, 0.45);
}

.landing-faq-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-size: 1.125rem;
    line-height: 1;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.15);
    transition: transform 0.2s ease;
}

.landing-faq-item.is-open .landing-faq-icon {
    transform: rotate(45deg);
}

.landing-faq-answer {
    display: none;
    padding: 0 1.125rem 1.125rem;
    font-size: 0.875rem;
    line-height: 1.65;
    color: #9ca3af;
}

.landing-faq-item.is-open .landing-faq-answer {
    display: block;
}

.landing-faq-answer p + p {
    margin-top: 0.75rem;
}

.landing-faq-answer a,
.landing-faq-answer a:hover,
.landing-faq-answer a:focus {
    color: #93c5fd;
    text-decoration: none;
}

.landing-footer-company {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.75rem;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .landing-footer-inner {
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
    }
}

.auth-footer-legal {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.75rem;
}

.auth-footer-legal a {
    color: #9ca3af;
    text-decoration: none;
    font-weight: 600;
}

.auth-footer-legal a:hover,
.auth-footer-legal a:focus {
    color: #93c5fd;
    text-decoration: none;
}

.legal-page {
    min-height: 100vh;
    background: #111827;
    color: #e5e7eb;
    color-scheme: dark;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.legal-page a,
.legal-page a:hover,
.legal-page a:focus,
.legal-page a:visited,
.legal-page a:active {
    text-decoration: none;
}

.legal-nav {
    border-bottom: 1px solid #374151;
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(10px);
}

.legal-nav-inner {
    max-width: 48rem;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.legal-nav-back {
    font-size: 0.875rem;
    font-weight: 600;
    color: #93c5fd;
    text-decoration: none;
}

.legal-nav-back:hover {
    color: #bfdbfe;
}

.legal-main {
    max-width: 48rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.legal-doc-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #374151;
}

.legal-doc-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    color: #f9fafb;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.legal-doc-meta {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #6b7280;
}

.legal-doc-meta strong {
    color: #9ca3af;
}

.legal-section {
    margin-bottom: 1.75rem;
}

.legal-section h2 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #f3f4f6;
    margin-bottom: 0.625rem;
}

.legal-section p,
.legal-section li,
.legal-section address {
    font-size: 0.9375rem;
    font-style: normal;
    line-height: 1.7;
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

.legal-section ul {
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.legal-section a {
    color: #93c5fd;
    text-decoration: none;
}

.legal-section a:hover,
.legal-section a:focus {
    color: #bfdbfe;
    text-decoration: none;
}

/* Entitlement banner — fixed top strip (must NOT be a flex child of body.flex) */
:root {
    --rs-entitlement-banner-offset: 4.75rem;
}

.rs-entitlement-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 45;
    width: 100%;
    background: linear-gradient(90deg, rgba(30, 58, 138, 0.95), rgba(67, 56, 202, 0.95));
    border-bottom: 1px solid rgba(147, 197, 253, 0.25);
    padding: 0.75rem 1rem;
    box-sizing: border-box;
}

body.rs-entitlement-banner-visible .app-sidebar,
body.rs-entitlement-banner-visible .app-main {
    padding-top: var(--rs-entitlement-banner-offset, 4.75rem);
}

.rs-entitlement-banner.hidden {
    display: none;
}

.rs-entitlement-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.rs-entitlement-banner-text {
    font-size: 0.875rem;
    color: #e0e7ff;
    margin: 0;
}

.rs-entitlement-banner-cta {
    flex-shrink: 0;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    background: #fff;
    color: #1e3a8a;
    font-size: 0.8125rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

.rs-entitlement-banner-cta.hidden {
    display: none;
}

#rsPaywallModal,
#paywall-overlay,
.paywall-overlay,
.rs-paywall-modal,
[data-rs-paywall-overlay] {
    display: none !important;
}

.is-entitlement-locked {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Shared page toast (settings / order actions) */
.app-page-toast {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 70;
    min-width: 280px;
    max-width: 420px;
    padding: 0.875rem 1rem;
    border-radius: 0.625rem;
    background: #1f2937;
    border: 1px solid #374151;
    color: #f9fafb;
    font-size: 0.875rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    animation: rs-fade-in 0.25s ease-out;
}

.app-page-toast.is-status {
    border-color: #3b82f6;
    color: #93c5fd;
}

.app-page-toast.is-error {
    border-color: #ef4444;
    color: #fca5a5;
}

.app-page-toast.is-success {
    border-color: #10b981;
    color: #6ee7b7;
}

.app-page-toast.hidden {
    display: none;
}

/* Shared SaaS modal (entitlement / upgrade prompts) */
.app-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 65;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.app-modal-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

.app-modal-backdrop.hidden {
    display: none;
}

.app-modal-panel {
    width: 100%;
    max-width: 28rem;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 0.875rem;
    padding: 1.5rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
    transform: translateY(10px) scale(0.98);
    transition: transform 0.22s ease;
}

.app-modal-backdrop.is-visible .app-modal-panel {
    transform: translateY(0) scale(1);
}

.app-entitlement-modal {
    text-align: center;
}

.app-entitlement-modal-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.app-entitlement-modal-copy {
    margin: 0 0 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #9ca3af;
}

.app-entitlement-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

/* Developer testing dock */
.rs-dev-tools-dock {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: auto;
    top: auto;
    z-index: 90;
    width: min(24rem, calc(100vw - 2rem));
    max-height: min(70vh, 32rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(17, 24, 39, 0.98);
    border: 1px dashed rgba(245, 158, 11, 0.55);
    border-radius: 0.75rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.rs-dev-tools-dock.is-collapsed {
    width: auto;
    min-width: 11rem;
    max-width: min(18rem, calc(100vw - 2rem));
    max-height: none;
}

.rs-dev-tools-dock.is-dragging {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    opacity: 0.97;
}

.rs-dev-tools-dock.hidden {
    display: none;
}

.rs-dev-tools-dock-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(245, 158, 11, 0.35);
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
}

.rs-dev-tools-dock.is-dragging .rs-dev-tools-dock-header {
    cursor: grabbing;
}

.rs-dev-tools-dock-title {
    min-width: 0;
    flex: 1;
}

.rs-dev-tools-dock-title .settings-section-title {
    font-size: 0.9375rem;
    margin: 0;
}

.rs-dev-tools-dock-title .settings-section-desc {
    font-size: 0.6875rem;
    margin-top: 0.25rem;
    line-height: 1.4;
}

.rs-dev-tools-dock.is-collapsed .rs-dev-tools-dock-title .settings-section-desc {
    display: none;
}

.rs-dev-tools-dock-collapse {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.rs-dev-tools-dock-collapse:hover {
    background: rgba(245, 158, 11, 0.22);
}

.rs-dev-tools-dock-body {
    padding: 1rem 1.125rem;
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.rs-dev-tools-dock.is-collapsed .rs-dev-tools-dock-body {
    display: none;
}

.rs-dev-tools-dock .settings-card-header,
.rs-dev-tools-dock .settings-card-body {
    padding: 1rem 1.125rem;
}

.rs-dev-tools-dock [data-dev-tool] {
    pointer-events: auto;
}

.legal-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #374151;
    font-size: 0.8125rem;
    color: #6b7280;
    text-align: center;
}

/* SPA shell — exactly one route view is visible */
#app-view-root > .app-route-view {
    display: none !important;
}

#app-view-root > .app-route-view.is-active {
    display: block !important;
}

.app-route-view.hidden,
.app-route-view[hidden] {
    display: none !important;
}

.rs-app-shell {
    min-height: 100vh;
    overflow: hidden;
}

@media (max-width: 768px) {
    .rs-app-shell {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .app-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #374151;
        padding: 1rem 1.25rem;
    }

    .app-brand {
        margin-bottom: 1rem;
    }

    .app-main {
        min-height: 0;
    }

    .app-main-inner {
        padding: 1.25rem 1rem;
    }
}

/* Cookie & local storage consent (Privacy §9) */
body.rs-cookie-banner-visible {
    padding-bottom: 7.5rem;
}

body.rs-cookie-banner-visible.rs-app-shell {
    padding-bottom: 0;
}

body.rs-cookie-banner-visible.rs-app-shell .app-main {
    padding-bottom: 7.5rem;
}

.rs-cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 320;
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
    background: rgba(17, 24, 39, 0.96);
    border-top: 1px solid #374151;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    transform: translateY(110%);
    opacity: 0;
    transition: transform 0.24s ease, opacity 0.24s ease;
}

.rs-cookie-banner.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.rs-cookie-banner-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.rs-cookie-banner-copy {
    flex: 1 1 18rem;
    min-width: 0;
}

.rs-cookie-banner-title {
    margin: 0 0 0.35rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #f9fafb;
}

.rs-cookie-banner-text {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #9ca3af;
}

.rs-cookie-banner-link {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rs-cookie-banner-link:hover,
.rs-cookie-banner-link:focus {
    color: #93c5fd;
}

.rs-cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    flex-shrink: 0;
}

.rs-cookie-banner-btn {
    appearance: none;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rs-cookie-banner-btn-ghost {
    border: 1px solid #4b5563;
    background: transparent;
    color: #e5e7eb;
}

.rs-cookie-banner-btn-ghost:hover,
.rs-cookie-banner-btn-ghost:focus {
    background: #1f2937;
    border-color: #6b7280;
}

.rs-cookie-banner-btn-primary {
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.rs-cookie-banner-btn-primary:hover,
.rs-cookie-banner-btn-primary:focus {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* In-app legal policy update notice (Terms §15 / Privacy §13) */
body.rs-policy-notice-visible .app-main {
    position: relative;
}

.rs-policy-notice {
    position: sticky;
    top: 0;
    z-index: 40;
    margin: 0;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(180deg, rgba(30, 58, 138, 0.42) 0%, rgba(17, 24, 39, 0.96) 100%);
    border-bottom: 1px solid rgba(59, 130, 246, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.24s ease, opacity 0.24s ease;
}

.rs-policy-notice.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.rs-policy-notice-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.875rem 1.25rem;
}

.rs-policy-notice-copy {
    flex: 1 1 16rem;
    min-width: 0;
}

.rs-policy-notice-title {
    margin: 0 0 0.25rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #93c5fd;
}

.rs-policy-notice-text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #e5e7eb;
}

.rs-policy-notice-links {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
}

.rs-policy-notice-link {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rs-policy-notice-link:hover,
.rs-policy-notice-link:focus {
    color: #93c5fd;
}

.rs-policy-notice-link-sep {
    margin: 0 0.4rem;
    color: #6b7280;
}

.rs-policy-notice-actions {
    display: flex;
    flex-shrink: 0;
}

.rs-policy-notice-btn {
    appearance: none;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.rs-policy-notice-btn-primary {
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.rs-policy-notice-btn-primary:hover,
.rs-policy-notice-btn-primary:focus {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.rs-policy-notice-btn-primary:disabled {
    opacity: 0.65;
    cursor: wait;
}

@media (max-width: 640px) {
    .rs-policy-notice-actions {
        width: 100%;
    }

    .rs-policy-notice-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 640px) {
    body.rs-cookie-banner-visible {
        padding-bottom: 10.5rem;
    }

    body.rs-cookie-banner-visible.rs-app-shell .app-main {
        padding-bottom: 10.5rem;
    }

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

    .rs-cookie-banner-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}
