/* Component-specific styles */

/* Progress Steps */
.progress-wrapper {
    background-color: var(--wtp-bg-light);
    border-bottom: 1px solid var(--wtp-border);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--wtp-border-light);
    z-index: 0;
}

.progress-step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    border: 2px solid var(--wtp-border-light);
    color: var(--wtp-text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    transition: all var(--wtp-transition-base);
}

.step-label {
    display: block;
    font-size: 0.875rem;
    color: var(--wtp-text-secondary);
    font-weight: 500;
    transition: color var(--wtp-transition-base);
}

.progress-step.active .step-number {
    background-color: var(--wtp-primary);
    border-color: var(--wtp-primary);
    color: white;
    transform: scale(1.1);
}

.progress-step.active .step-label {
    color: var(--wtp-primary);
    font-weight: 600;
}

.progress-step.completed .step-number {
    background-color: var(--wtp-success);
    border-color: var(--wtp-success);
    color: white;
}

.progress-step.completed .step-label {
    color: var(--wtp-success);
}

/* Welcome Screen */
.welcome-hero {
    text-align: center;
    padding: 3rem 0;
}

.welcome-hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--wtp-primary), var(--wtp-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-hero .lead {
    font-size: 1.25rem;
    color: var(--wtp-text-secondary);
    margin-bottom: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 3rem 0;
}

.feature-card {
    padding: 1.5rem;
    background-color: white;
    border-radius: var(--wtp-radius-lg);
    border: 1px solid var(--wtp-border);
    text-align: center;
    transition: all var(--wtp-transition-base);
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--wtp-shadow-md);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--wtp-primary-bg);
    border-radius: var(--wtp-radius-lg);
    color: var(--wtp-primary);
    font-size: 1.5rem;
}

/* Address Search */
.address-search-container {
    max-width: 600px;
    margin: 0 auto;
}

/* Use higher specificity to beat the Mapbox CDN stylesheet that loads later */
.address-search-container .mapboxgl-ctrl-geocoder {
    max-width: none !important;
    width: 100% !important;
    font-size: 1rem;
    box-shadow: none;
    border: 1px solid var(--wtp-border-light);
    border-radius: var(--wtp-radius-md);
}

.address-search-container .mapboxgl-ctrl-geocoder--input {
    font-family: inherit;
    padding: 0.75rem 1rem;
    padding-left: 3rem;
    /* Increase left padding to add space after icon */
    font-size: 1rem;
}

.address-search-container .mapboxgl-ctrl-geocoder--input:focus {
    outline: none;
    border-color: var(--wtp-primary);
    box-shadow: 0 0 0 3px var(--wtp-primary-bg);
}

.map-preview {
    height: 300px;
    border-radius: var(--wtp-radius-lg);
    overflow: hidden;
    margin-top: 1.5rem;
    border: 1px solid var(--wtp-border);
}

/* MP Card */
.mp-card {
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
}

.mp-header {
    background: linear-gradient(135deg, var(--wtp-primary), var(--wtp-primary-light));
    color: white;
    padding: 2rem;
    position: relative;
}

.mp-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: var(--wtp-shadow-md);
    object-fit: cover;
    margin-bottom: 1rem;
}

.mp-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.mp-party-badge {
    display: inline-block;
    padding: 0.25rem 1rem;
    border-radius: var(--wtp-radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.mp-details {
    padding: 2rem;
}

.mp-detail-item {
    display: flex;
    align-items: start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--wtp-bg-light);
}

.mp-detail-item:last-child {
    border-bottom: none;
}

.mp-detail-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--wtp-bg-light);
    border-radius: var(--wtp-radius-md);
    color: var(--wtp-text-secondary);
}

.mp-positions {
    border-bottom: 1px solid var(--wtp-border);
}

.mp-positions .badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
}

.mp-synopsis {
    border-bottom: 1px solid var(--wtp-border);
}

.mp-synopsis .small {
    line-height: 1.6;
}

.mp-history {
    background-color: var(--wtp-bg-light);
}

.mp-history details summary {
    cursor: pointer;
    user-select: none;
    padding: 0.25rem 0;
}

.mp-history details summary:hover {
    color: var(--wtp-primary);
}

.mp-history details[open] summary {
    margin-bottom: 0.5rem;
}

/* MP Avatar in Compose Wizard */
.wtp-mp-avatar {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    position: relative;
}

.wtp-mp-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--wtp-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.wtp-mp-photo-fallback {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--wtp-primary), var(--wtp-primary-light));
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* MP Thumbnail in Search Results */
.wtp-mp-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--wtp-border-light);
    flex-shrink: 0;
}

.wtp-mp-thumb-fallback {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--wtp-primary), var(--wtp-primary-light));
    color: white;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* Email Composer */
.email-composer {
    max-width: 800px;
    margin: 0 auto;
}

.composer-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--wtp-border);
}

.composer-header h3 {
    margin: 0;
}

.topic-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.topic-card {
    padding: 1rem;
    border: 2px solid var(--wtp-border);
    border-radius: var(--wtp-radius-md);
    cursor: pointer;
    transition: all var(--wtp-transition-fast);
    background-color: white;
}

.topic-card:hover {
    border-color: var(--wtp-primary-light);
    background-color: var(--wtp-primary-bg);
}

.topic-card.selected {
    border-color: var(--wtp-primary);
    background-color: var(--wtp-primary-bg);
}

.reference-input {
    background-color: var(--wtp-bg-light);
    border-radius: var(--wtp-radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.email-preview {
    background-color: white;
    border: 1px solid var(--wtp-border);
    border-radius: var(--wtp-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    min-height: 300px;
}

.ai-generating {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--wtp-text-secondary);
}

.ai-generating .spinner-border {
    margin-right: 1rem;
}

/* Email Content Rendering */
.email-content-html {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--wtp-text-heading);
}

.email-content-html h1,
.email-content-html h2,
.email-content-html h3 {
    color: var(--wtp-text-heading);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.email-content-html h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.email-content-html h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.email-content-html h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.email-content-html p {
    margin-bottom: 1rem;
}

.email-content-html strong {
    font-weight: 600;
    color: var(--wtp-text-heading);
}

.email-content-html em {
    font-style: italic;
}

.email-content-html ol,
.email-content-html ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.email-content-html li {
    margin-bottom: 0.25rem;
}

/* Email Edit Mode */
#email-edit-textarea {
    resize: vertical;
    min-height: 300px;
}

.email-content-display {
    border: 1px solid var(--wtp-border);
    border-radius: var(--wtp-radius-md);
    padding: 1.5rem;
    background-color: var(--wtp-bg-light);
}

/* Quill Rich Text Editor — shared styles for all instances */
#email-rich-editor,
#quill-editor,
#quillEditor {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#email-rich-editor .ql-toolbar,
#quill-editor .ql-toolbar,
#quillEditor .ql-toolbar {
    border-top: 1px solid var(--wtp-border-light);
    border-left: 1px solid var(--wtp-border-light);
    border-right: 1px solid var(--wtp-border-light);
    border-bottom: none;
    border-radius: var(--wtp-radius-md) var(--wtp-radius-md) 0 0;
    background-color: var(--wtp-bg-light);
    padding: 0.5rem 1rem;
}

#email-rich-editor .ql-container,
#quill-editor .ql-container,
#quillEditor .ql-container {
    border-bottom: 1px solid var(--wtp-border-light);
    border-left: 1px solid var(--wtp-border-light);
    border-right: 1px solid var(--wtp-border-light);
    border-top: none;
    border-radius: 0 0 var(--wtp-radius-md) var(--wtp-radius-md);
    font-size: 14px;
    line-height: 1.6;
}

#email-rich-editor .ql-editor,
#quill-editor .ql-editor,
#quillEditor .ql-editor {
    padding: 1rem;
    min-height: 300px;
}

#email-rich-editor .ql-editor.ql-blank::before,
#quill-editor .ql-editor.ql-blank::before,
#quillEditor .ql-editor.ql-blank::before {
    color: var(--wtp-text-secondary);
    font-style: normal;
}

/* Quill toolbar button styling */
#email-rich-editor .ql-toolbar .ql-formats,
#quill-editor .ql-toolbar .ql-formats,
#quillEditor .ql-toolbar .ql-formats {
    margin-right: 1rem;
}

#email-rich-editor .ql-toolbar button,
#quill-editor .ql-toolbar button,
#quillEditor .ql-toolbar button {
    border-radius: var(--wtp-radius-sm);
    transition: all var(--wtp-transition-fast);
}

#email-rich-editor .ql-toolbar button:hover,
#quill-editor .ql-toolbar button:hover,
#quillEditor .ql-toolbar button:hover {
    background-color: var(--wtp-primary-bg);
    color: var(--wtp-primary);
}

#email-rich-editor .ql-toolbar button.ql-active,
#quill-editor .ql-toolbar button.ql-active,
#quillEditor .ql-toolbar button.ql-active {
    background-color: var(--wtp-primary);
    color: white;
}

#email-rich-editor .ql-toolbar .ql-picker,
#quill-editor .ql-toolbar .ql-picker,
#quillEditor .ql-toolbar .ql-picker {
    color: var(--wtp-text-body);
}

#email-rich-editor .ql-toolbar .ql-picker:hover,
#quill-editor .ql-toolbar .ql-picker:hover,
#quillEditor .ql-toolbar .ql-picker:hover {
    color: var(--wtp-primary);
}

/* Enhanced textarea styling */
#email-edit-textarea {
    border: 2px solid var(--wtp-border);
    border-radius: var(--wtp-radius-md);
    transition: border-color var(--wtp-transition-fast);
}

#email-edit-textarea:focus {
    border-color: var(--wtp-primary);
    box-shadow: 0 0 0 3px var(--wtp-primary-bg);
    outline: none;
}

/* Markdown preview styling */
#markdown-preview .card {
    border: 1px solid var(--wtp-primary-light);
    background-color: var(--wtp-primary-bg);
}

#markdown-preview .card-header {
    background-color: var(--wtp-primary);
    color: white;
    border-bottom: 1px solid var(--wtp-primary-light);
}

#markdown-preview .card-body {
    background-color: white;
}

/* Responsive toolbar */
@media (max-width: 768px) {
    .formatting-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .formatting-toolbar .btn-group {
        justify-content: center;
    }

    .formatting-toolbar small {
        text-align: center;
        margin-top: 0.25rem;
    }
}

/* Party Colors */
.party-labour {
    background-color: var(--wtp-party-labour);
}

.party-conservative {
    background-color: var(--wtp-party-conservative);
}

.party-lib-dem {
    background-color: var(--wtp-party-libdem);
}

.party-snp {
    background-color: var(--wtp-party-snp);
    color: var(--wtp-text-heading);
}

.party-green {
    background-color: var(--wtp-party-green);
}

.party-plaid-cymru {
    background-color: var(--wtp-party-plaid);
}

.party-dup {
    background-color: var(--wtp-party-dup);
}

.party-sinn-fein {
    background-color: var(--wtp-party-sinnfein);
}

.party-alliance {
    background-color: var(--wtp-party-alliance);
    color: var(--wtp-text-heading);
}

.party-sdlp {
    background-color: var(--wtp-party-sdlp);
}

.party-independent {
    background-color: var(--wtp-text-secondary);
}

/* ── Compose Wizard Step Badges ─────────────────────────────────── */
.wtp-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--wtp-border);
    color: var(--wtp-text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--wtp-transition-base);
}

.wtp-step-badge.active {
    background-color: var(--wtp-primary);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 0 4px var(--wtp-primary-bg);
}

.wtp-step-badge.completed {
    background-color: var(--wtp-success);
    color: white;
}

.wtp-topic-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.wtp-topic-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--wtp-text-body);
}

#topicGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

/* ── Wizard Step Panels ─────────────────────────────────────────── */
.wtp-wizard-step {
    animation: fadeIn 0.3s ease-out;
}

@keyframes wtpFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* ── MP Search Results ──────────────────────────────────────────── */
.wtp-mp-search-item {
    cursor: pointer;
    transition: all var(--wtp-transition-fast);
}

.wtp-mp-search-item:hover {
    border-color: var(--wtp-primary);
    background-color: var(--wtp-primary-alpha-03);
}

/* ── Generating Overlay ─────────────────────────────────────────── */
#generatingOverlay {
    text-align: center;
    padding: 3rem;
}

/* ── MP Profile Panel ──────────────────────────────────────────── */
.wtp-profile-panel {
    border-top: 1px solid var(--wtp-border);
    padding-top: 0.75rem;
}

#profileSynopsis .small {
    line-height: 1.5;
}

#positionBadges .badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

#committeeList li {
    padding: 0.15rem 0;
}

#previousPositionsList {
    border-left: 2px solid var(--wtp-border);
    padding-left: 0.75rem;
}

/* ── Template Selector ────────────────────────────────────────── */
.wtp-template-card {
    border: 2px solid var(--wtp-border);
    border-radius: var(--wtp-radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 100%;
    text-align: center;
}

.wtp-template-card:hover {
    border-color: var(--wtp-primary);
    background-color: var(--wtp-bg-light);
    transform: translateY(-1px);
}

.wtp-template-card.selected {
    border-color: var(--wtp-primary);
    background-color: var(--wtp-primary-alpha-05);
    box-shadow: 0 0 0 1px var(--wtp-primary);
}

.wtp-template-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--wtp-primary);
}

.wtp-template-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.wtp-template-desc {
    font-size: 0.75rem;
    line-height: 1.4;
}

#templatePreviewBody {
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    #topicGrid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .wtp-step-badge {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .wtp-template-card {
        padding: 0.75rem;
    }

    .wtp-template-icon {
        font-size: 1.25rem;
    }
}

/* ── Phase 3: Activity Tabs ──────────────────────────────────────── */

.wtp-activity-tabs {
    border-bottom: 2px solid var(--wtp-border);
    gap: 0;
}

.wtp-activity-tabs .nav-link {
    color: var(--wtp-text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    background: none;
    cursor: pointer;
}

.wtp-activity-tabs .nav-link:hover {
    color: var(--wtp-primary);
    border-bottom-color: var(--wtp-primary-alpha-30);
}

.wtp-activity-tabs .nav-link.active {
    color: var(--wtp-primary);
    border-bottom-color: var(--wtp-primary);
    font-weight: 600;
}

/* Voting Table */
.wtp-voting-table {
    font-size: 0.85rem;
}

.wtp-voting-table thead th {
    border-bottom: 2px solid var(--wtp-border);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.wtp-voting-table tbody tr:hover {
    background-color: var(--wtp-primary-alpha-04);
}

.wtp-voting-summary .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* Question Cards */
div.wtp-question-card {
    transition: box-shadow 0.15s;
    border-color: var(--wtp-border);
}

.wtp-question-card:hover {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.wtp-question-answer {
    border-left: 3px solid var(--wtp-primary);
}

/* EDM Cards */
div.wtp-edm-card {
    transition: box-shadow 0.15s;
    border-color: var(--wtp-border);
}

.wtp-edm-card:hover {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Focus Area Badges */
.wtp-focus-badge {
    background-color: var(--wtp-primary-bg);
    color: var(--wtp-primary);
    font-weight: 500;
    font-size: 0.72rem;
    padding: 0.25em 0.6em;
    border-radius: 1rem;
}

/* Tab pane transitions */
.wtp-tab-pane {
    animation: wtpFadeIn 0.2s ease-in;
}

/* Responsive: Activity tabs */
@media (max-width: 576px) {
    .wtp-activity-tabs .nav-link {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }

    .wtp-voting-table {
        font-size: 0.75rem;
    }

    .wtp-voting-table thead th {
        font-size: 0.6rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Phase 4 — Postal Mail (Postworks) Styles
   ═══════════════════════════════════════════════════════════════════ */

/* Send by Post button */
#sendPostalBtn {
    border-color: var(--wtp-warning);
    color: var(--wtp-warning-text);
    transition: all 0.2s ease;
}

#sendPostalBtn:hover {
    background: var(--wtp-warning);
    border-color: var(--wtp-warning);
    color: var(--wtp-bg-white);
}

#sendPostalBtn:hover .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Postal tracker */
.wtp-postal-tracker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 10px;
}

.wtp-postal-tracker::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 30px;
    right: 30px;
    height: 3px;
    background: var(--wtp-border);
    z-index: 0;
}

.wtp-postal-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.wtp-postal-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--wtp-border);
    color: var(--wtp-text-disabled);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all var(--wtp-transition-slow);
    border: 3px solid var(--wtp-bg-white);
    box-shadow: 0 0 0 2px var(--wtp-border);
}

.wtp-postal-step-label {
    font-size: 0.7rem;
    color: var(--wtp-text-disabled);
    margin-top: 6px;
    font-weight: 500;
    text-align: center;
}

.wtp-postal-step.completed .wtp-postal-step-icon {
    background: var(--wtp-success);
    color: var(--wtp-bg-white);
    box-shadow: 0 0 0 2px var(--wtp-success);
}

.wtp-postal-step.completed .wtp-postal-step-label {
    color: var(--wtp-success);
}

.wtp-postal-step.active .wtp-postal-step-icon {
    background: var(--wtp-info);
    color: var(--wtp-bg-white);
    box-shadow: 0 0 0 2px var(--wtp-info), 0 0 0 6px rgba(14, 165, 233, 0.15);
    animation: wtp-postal-pulse 2s infinite;
}

.wtp-postal-step.active .wtp-postal-step-label {
    color: var(--wtp-info);
    font-weight: 600;
}

@keyframes wtp-postal-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 2px var(--wtp-info), 0 0 0 6px rgba(14, 165, 233, 0.15);
    }

    50% {
        box-shadow: 0 0 0 2px var(--wtp-info), 0 0 0 10px rgba(14, 165, 233, 0.05);
    }
}

/* Postal confirmation card */
div#postalConfirmCard {
    border-left: 4px solid var(--wtp-warning);
}

div#postalStatusCard {
    border-left: 4px solid var(--wtp-info);
}

/* Responsive postal tracker */
@media (max-width: 576px) {
    .wtp-postal-step-label {
        font-size: 0.6rem;
    }

    .wtp-postal-step-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .wtp-postal-tracker::before {
        top: 16px;
    }
}

/* ── NewsAPI Article Suggestion Cards ─────────────────────────────── */
.wtp-article-card {
    border: 2px solid var(--wtp-border);
    border-radius: var(--wtp-radius-lg);
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--wtp-bg-white);
    height: 100%;
}
.wtp-article-card:hover {
    border-color: var(--wtp-primary);
    box-shadow: 0 2px 8px var(--wtp-primary-alpha-15);
}
.wtp-article-card.selected {
    border-color: var(--wtp-primary);
    background: var(--wtp-selected-bg);
}
.wtp-article-card .article-source {
    font-size: 0.75rem;
    color: var(--wtp-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.wtp-article-card .article-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    margin: 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wtp-article-card .article-desc {
    font-size: 0.8rem;
    color: var(--wtp-text-body);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wtp-article-card .article-date {
    font-size: 0.7rem;
    color: var(--wtp-text-disabled);
    margin-top: 6px;
}

/* ── Recipient Type Cards (Step 0) ───────────────────────────────── */
.wtp-recipient-card {
    border: 2px solid var(--wtp-border);
    border-radius: 16px;
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.wtp-recipient-card:hover {
    border-color: var(--wtp-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--wtp-primary-alpha-15);
}
.wtp-recipient-card.selected {
    border-color: var(--wtp-primary);
    background: var(--wtp-selected-bg);
}
.wtp-recipient-card.wtp-coming-soon {
    opacity: 0.5;
    cursor: not-allowed;
}
.wtp-recipient-card.wtp-coming-soon:hover {
    border-color: var(--wtp-border);
    transform: none;
    box-shadow: none;
}
.wtp-recipient-icon {
    font-size: 2rem;
    line-height: 1;
}
.wtp-recipient-label {
    font-weight: 700;
    font-size: 0.95rem;
}
.wtp-recipient-desc {
    font-size: 0.75rem;
    color: var(--wtp-text-secondary);
    line-height: 1.3;
}

/* ── Avatar Utility Classes ─────────────────────────────────────── */
.wtp-avatar-fallback-lg {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--wtp-primary), var(--wtp-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.wtp-avatar-fallback-md {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--wtp-primary), var(--wtp-primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.wtp-avatar-ghost-lg {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--wtp-primary-alpha-10), var(--wtp-primary-alpha-05));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.wtp-avatar-ghost-lg .fa {
    color: var(--wtp-primary);
}

/* ── Accessibility ──────────────────────────────────────────────── */

/* Focus-visible for interactive elements */
.wtp-template-card:focus-visible,
.wtp-article-card:focus-visible,
.wtp-recipient-card:focus-visible,
.wtp-mp-search-item:focus-visible {
    outline: 3px solid var(--wtp-primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .progress-step .step-number,
    .wtp-step-badge,
    .wtp-mp-search-item,
    .wtp-template-card,
    .wtp-article-card,
    .wtp-recipient-card,
    .wtp-postal-step-icon {
        transition: none;
    }

    @keyframes wtp-postal-pulse {
        from, to { box-shadow: none; }
    }
}