/* UI/UX improvements layered on top of the existing theme. */
.hero-eyebrow {
    color: var(--accent-start);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.hero-lead {
    color: var(--text-secondary);
    max-width: 740px;
    margin: 0 auto 1.5rem;
    line-height: 1.8;
}

.hero-actions,
.checker-result-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stats-grid-3 {
    max-width: 820px;
}

.stat-date {
    font-size: 2rem;
}

.enhanced-filters {
    max-width: 900px;
}

.filter-select-priority {
    border-color: hsla(35, 90%, 55%, 0.35);
}

.recent-revisions-panel,
.bulk-input-panel,
.detail-quick-summary,
.checker-selected-card,
.checker-report-summary,
.bulk-resolve-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.recent-revisions-panel {
    max-width: 960px;
    margin: 1.5rem auto 0;
    padding: 1rem;
    text-align: left;
}

.recent-revisions-header,
.bulk-input-header,
.bulk-resolve-summary,
.checker-selected-header,
.summary-header-row,
.interaction-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.recent-revisions-header span,
.bulk-input-header strong,
.bulk-resolve-summary strong,
.checker-selected-header h2,
.summary-header-row h1 {
    color: var(--text-primary);
}

.recent-revisions-header small,
.bulk-input-header span,
.bulk-resolve-summary span,
.summary-header-row p {
    color: var(--text-muted);
}

.recent-revisions-list,
.bulk-match-grid,
.selected-drug-chips,
.active-filter-chips {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.recent-revisions-list {
    margin-top: 0.9rem;
}

.recent-revision-chip,
.active-filter-chip,
.bulk-match-chip,
.unmatched-term {
    border: 1px solid var(--card-border);
    background: hsla(240, 25%, 18%, 0.72);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0.48rem 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.recent-revision-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.recent-revision-chip strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.recent-revision-chip span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.recent-revision-chip:hover,
.bulk-match-chip:hover,
.unmatched-term:hover {
    border-color: hsla(263, 90%, 65%, 0.55);
    transform: translateY(-1px);
}

.result-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1rem;
    flex-wrap: wrap;
}

.result-summary {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.active-filter-chip {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
}

.active-filter-chip-priority {
    color: #fed7aa;
    border-color: hsla(35, 90%, 55%, 0.35);
    background: hsla(35, 90%, 55%, 0.08);
}

.drug-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-card-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.detail-quick-summary {
    padding: 1.5rem;
}

.summary-header-row h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 0 0 0.25rem;
}

.summary-freshness {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.summary-freshness strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.summary-status-grid,
.checker-report-summary,
.checker-workspace-intro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.9rem;
}

.summary-status-grid {
    margin: 1.3rem 0;
}

.summary-status-card,
.report-summary-card,
.checker-step-card {
    border: 1px solid var(--card-border);
    background: hsla(240, 25%, 15%, 0.72);
    border-radius: 14px;
    padding: 0.9rem;
    text-decoration: none;
    color: var(--text-secondary);
}

.summary-status-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.summary-status-card strong,
.report-summary-card strong,
.checker-step-card strong {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.summary-status-card span,
.report-summary-card span,
.checker-step-card span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.summary-status-card.is-danger,
.report-summary-card.is-danger {
    border-color: hsla(0, 85%, 60%, 0.35);
    background: hsla(0, 85%, 60%, 0.08);
}

.summary-status-card.is-warning,
.report-summary-card.is-warning {
    border-color: hsla(35, 90%, 55%, 0.35);
    background: hsla(35, 90%, 55%, 0.08);
}

.summary-status-card.is-info {
    border-color: hsla(205, 90%, 60%, 0.35);
    background: hsla(205, 90%, 60%, 0.08);
}

.report-summary-card.is-caution {
    border-color: hsla(55, 95%, 60%, 0.28);
    background: hsla(55, 95%, 60%, 0.06);
}

.detail-find-box {
    position: relative;
    max-width: none;
}

.detail-find-box .search-input {
    border-radius: 16px;
    font-size: 0.95rem;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.detail-filter-empty {
    margin-top: 1rem;
    padding: 1rem;
}

.checker-workspace-intro {
    max-width: 860px;
    margin: 1.5rem auto 0;
}

.checker-step-card {
    text-align: left;
}

.checker-step-card span {
    display: block;
    margin-top: 0.35rem;
}

.bulk-input-panel {
    max-width: 860px;
    margin: 1.25rem auto 0;
    padding: 1rem;
    text-align: left;
}

.bulk-textarea {
    width: 100%;
    margin-top: 0.9rem;
    background: hsla(240, 25%, 10%, 0.85);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

.bulk-textarea:focus {
    border-color: hsla(263, 90%, 65%, 0.55);
    box-shadow: 0 0 18px hsla(263, 90%, 65%, 0.16);
}

.bulk-resolve-loading {
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.bulk-resolve-card {
    margin-top: 0.9rem;
    padding: 1rem;
}

.bulk-resolve-card.is-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.bulk-resolve-section {
    margin-top: 1rem;
}

.bulk-resolve-section h4 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.55rem;
}

.bulk-match-chip {
    cursor: pointer;
    text-align: left;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.bulk-match-chip span {
    color: var(--text-primary);
    font-weight: 700;
}

.bulk-match-chip small {
    color: var(--text-muted);
}

.bulk-match-chip.is-secondary {
    background: hsla(240, 25%, 14%, 0.78);
}

.bulk-ambiguous-row {
    border-top: 1px solid var(--card-border);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.bulk-term-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.45rem;
}

.unmatched-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.unmatched-term {
    color: #fecaca;
    border-color: hsla(0, 85%, 60%, 0.3);
    cursor: pointer;
}

.bulk-resolve-note {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 0.6rem;
}

.checker-selected-card {
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.checker-selected-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checker-count-badge {
    background: var(--accent-start);
    color: #ffffff;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.selected-drug-chips {
    margin-top: 1rem;
}

.selected-drug-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease;
}

.selected-drug-chip span {
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
}

.selected-drug-chip small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drawer-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.drawer-item-remove:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.checker-empty-selection,
.checker-standby-card {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.checker-standby-card {
    padding: 3rem 2rem;
    background: rgba(30, 41, 59, 0.2);
}

.checker-standby-card p {
    margin: 0;
    color: var(--text-muted);
}

.checker-report-summary {
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.report-summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.report-summary-card strong {
    font-family: var(--font-display);
    font-size: 1.8rem;
}

.interaction-report-groups,
.interaction-card-list,
.individual-warning-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.interaction-report-groups {
    margin-bottom: 3rem;
}

.interaction-group-title {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.interaction-group-title.is-danger {
    color: var(--status-red);
}

.interaction-group-title.is-warning {
    color: var(--status-orange);
}

.interaction-group-title.is-caution {
    color: #facc15;
}

.interaction-card {
    padding: 1.25rem;
    border-radius: 0 10px 10px 0;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-left: 4px solid #94a3b8;
    background: rgba(148, 163, 184, 0.05);
}

.interaction-card.severity-danger {
    border-left-color: var(--status-red);
    background: rgba(239, 68, 68, 0.05);
}

.interaction-card.severity-warning {
    border-left-color: var(--status-orange);
    background: rgba(249, 115, 22, 0.05);
}

.interaction-card.severity-caution {
    border-left-color: #facc15;
    background: rgba(250, 204, 21, 0.05);
}

.interaction-card-header h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.interaction-card-header h4 span {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.9rem;
}

.interaction-body {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.interaction-body strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.clinical-action {
    color: #ffedd5;
}

.mechanism {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.badge-caution {
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.3);
    color: #fef08a;
}

.checker-safe-card {
    padding: 2.5rem 2rem;
    border-radius: 12px;
    border: 1px solid rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.05);
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 0.4s ease;
}

.checker-safe-card svg {
    color: #22c55e;
    margin-bottom: 0.75rem;
}

.checker-safe-card h3 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.checker-safe-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.individual-warning-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    margin-top: 1rem;
}

.individual-warning-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #ffffff;
}

.individual-warning-card {
    border-radius: 10px;
    padding: 1.25rem;
}

.individual-warning-card.is-danger {
    background: rgba(239, 68, 68, 0.03);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.individual-warning-card.is-warning {
    background: rgba(249, 115, 22, 0.03);
    border: 1px solid rgba(249, 115, 22, 0.15);
}

.individual-warning-card h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.individual-warning-card h4 span {
    color: #ffffff;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: var(--status-orange);
}

.individual-warning-card.is-danger h4 span {
    background: var(--status-red);
}

.individual-warning-card div {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    text-align: left;
    max-height: 220px;
    overflow-y: auto;
}

@media (max-width: 720px) {
    .summary-header-row,
    .checker-selected-header,
    .bulk-input-header,
    .bulk-resolve-summary {
        align-items: stretch;
    }

    .summary-freshness {
        align-items: flex-start;
    }

    .hero-actions,
    .checker-result-actions {
        justify-content: stretch;
    }

    .hero-actions .btn,
    .checker-result-actions .btn,
    .bulk-input-header .btn {
        width: 100%;
        justify-content: center;
    }

    .timeline-container {
        grid-template-columns: 1fr !important;
    }

    .timeline-list {
        border-right: none !important;
        border-bottom: 1px solid var(--card-border);
        padding-right: 0 !important;
        padding-bottom: 1rem;
    }
}

@media print {
    header,
    footer,
    .ambient-glow,
    .back-link-wrapper,
    .tabs-container,
    .bulk-input-panel,
    .checker-result-actions,
    .compare-drawer {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #111827 !important;
    }

    main.container {
        max-width: none;
        padding: 0;
    }

    .detail-layout {
        display: block !important;
    }

    .side-panel,
    .main-panel,
    .detail-section,
    .detail-quick-summary,
    .checker-selected-card,
    .checker-report-summary,
    .interaction-card,
    .individual-warning-card {
        background: #ffffff !important;
        color: #111827 !important;
        border-color: #d1d5db !important;
        box-shadow: none !important;
    }
}
