/* REQUIRED: Body hidden until auth completes (prevents FOUC) */
body {
    display: none;
    max-width: 100%;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.hidden-by-default {
    display: none;
}

.auth-copy {
    margin-top: 12px;
}

.auth-copy-muted {
    color: #6b7280;
}

.page-contract,
.access-summary,
.source-freshness {
    margin: 16px 20px;
    border: 1px solid #dbe3ee;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.05);
}

.page-contract {
    padding: 18px 20px;
    border-left: 4px solid #16a34a;
}

.page-contract h2 {
    margin: 0 0 8px 0;
    color: #111827;
    font-size: 18px;
}

.page-contract p,
.source-freshness p {
    margin: 0;
    color: #374151;
    line-height: 1.6;
}

.access-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
}

.access-summary > div {
    padding: 14px 16px;
    border-right: 1px solid #e5e7eb;
}

.access-summary > div:last-child {
    border-right: 0;
}

.access-label,
.source-label {
    display: block;
    margin-bottom: 6px;
    color: #1E3A8A;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.source-freshness {
    padding: 14px 16px;
    border-left: 4px solid #f59e0b;
}

.footer-note {
    margin-top: 8px;
}

.comments-empty-help {
    color: #6b7280;
}

/* ========== PIPELINE TRACKER STYLES ========== */
.pipeline-wrapper {
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 200px);
}

/* Page Header Bar */
.page-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px 24px;
    background-color: #1E3A8A;
    border-radius: 8px;
    flex-shrink: 0;
}

.page-header-bar h1 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px 0;
}

.header-subtitle {
    font-size: 11px;
    color: #b8c5d9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pipeline-btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    font-family: inherit;
}

.pipeline-btn-primary {
    background-color: #2c5aa0;
    color: #ffffff;
}

.pipeline-btn-primary:hover {
    background-color: #1e4278;
}

.pipeline-btn-secondary {
    background-color: rgba(255,255,255,0.15);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.3);
}

.pipeline-btn-secondary:hover {
    background-color: rgba(255,255,255,0.25);
}

.pipeline-btn-danger {
    background-color: #dc2626;
    color: #ffffff;
}

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

.stats-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.stat-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 20px;
    min-width: 120px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1E3A8A;
}

.stat-label {
    font-size: 10px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pipeline-container {
    display: flex;
    gap: 16px;
    flex: 1;
    overflow: auto;
    padding: 4px;
    min-height: 0;
    /* Always show scrollbars on macOS */
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* WebKit browsers - always visible scrollbar */
.pipeline-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.pipeline-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.pipeline-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 6px;
    border: 2px solid #f1f1f1;
}

.pipeline-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.pipeline-container::-webkit-scrollbar-corner {
    background: #f1f1f1;
}

.pipeline-stage {
    min-width: 260px;
    width: 260px;
    flex-shrink: 0;
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.stage-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #1E3A8A;
    border-radius: 8px 8px 0 0;
}

.stage-title {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stage-count {
    background-color: rgba(255,255,255,0.2);
    color: #ffffff;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.stage-description {
    font-size: 11px;
    color: #b8c5d9;
    margin-top: 6px;
    line-height: 1.4;
}

.stage-duration {
    font-size: 10px;
    color: #93a3b8;
    margin-top: 4px;
}

.stage-cards {
    padding: 10px;
    min-height: 300px;
    background-color: #f9fafb;
    border-radius: 0 0 8px 8px;
}

.company-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: grab;
    transition: all 0.2s;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.company-card:hover {
    border-color: #2c5aa0;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.15);
    transform: translateY(-2px);
}

.company-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.company-card.priority-high {
    border-left: 4px solid #27ae60;
}

.company-card.priority-medium {
    border-left: 4px solid #f59e0b;
}

.company-card.priority-low {
    border-left: 4px solid #6b7280;
}

.company-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}

.company-type {
    display: inline-block;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.type-strategic {
    background-color: #e8f0f8;
    color: #1E3A8A;
}

.type-publisher {
    background-color: #dbeafe;
    color: #1e40af;
}

.type-financial {
    background-color: #dcfce7;
    color: #166534;
}

.type-hybrid {
    background-color: #fef3c7;
    color: #92400e;
}

.company-country {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.company-notes {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.company-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.company-date {
    font-size: 11px;
    color: #6b7280;
}

.company-check {
    font-size: 11px;
    color: #1E3A8A;
    font-weight: 600;
}

.card-top-right {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.key-target {
    font-size: 16px;
}

.priority-rank {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    background-color: #1E3A8A;
    padding: 2px 6px;
    border-radius: 4px;
}

.drop-indicator {
    height: 4px;
    background-color: #2c5aa0;
    border-radius: 2px;
    margin: 8px 0;
    display: none;
}

.pipeline-stage.drag-over .drop-indicator {
    display: block;
}

.legend {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    flex-shrink: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color-high {
    background-color: #27ae60;
}

.legend-color-medium {
    background-color: #f59e0b;
}

.legend-color-low {
    background-color: #6b7280;
}

.legend-icon {
    min-width: 16px;
    text-align: center;
}

.last-saved {
    font-size: 11px;
    color: #b8c5d9;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal h2 {
    margin-bottom: 16px;
    color: #111827;
    font-size: 18px;
}

.modal-field-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-score-field {
    flex: 0 0 120px;
}

.modal-check-field {
    flex: 1;
}

.modal-label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.modal-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #111827;
    font-family: inherit;
    font-size: 14px;
}

.modal-input:focus {
    outline: none;
    border-color: #2c5aa0;
}

.modal-input-large {
    width: 80px;
}

.modal-notes {
    width: 100%;
    min-height: 150px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    color: #111827;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 16px;
}

.modal-notes:focus {
    outline: none;
    border-color: #2c5aa0;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-actions .pipeline-btn-secondary {
    background-color: #f9fafb;
    color: #111827;
    border: 1px solid #e5e7eb;
}

.modal-actions .pipeline-btn-secondary:hover {
    background-color: #e5e7eb;
}

.modal-actions-left {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
}

.removed-section {
    margin-top: 12px;
    padding: 12px 16px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    flex-shrink: 0;
}

.removed-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.removed-header:hover {
    color: #1E3A8A;
}

.removed-toggle {
    font-size: 12px;
    transition: transform 0.2s;
}

.removed-toggle.expanded {
    transform: rotate(90deg);
}

.removed-title {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}

.removed-count {
    font-size: 11px;
    color: #9ca3af;
}

.removed-list {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
}

.removed-list.expanded {
    display: block;
}

.removed-names {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.6;
}

.removed-name {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px 4px 2px 0;
    background-color: #f3f4f6;
    border-radius: 4px;
    font-size: 11px;
}

@media (max-width: 768px) {
    .page-contract,
    .access-summary,
    .source-freshness {
        margin: 12px;
    }

    .access-summary {
        grid-template-columns: 1fr;
    }

    .access-summary > div {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .access-summary > div:last-child {
        border-bottom: 0;
    }

    .pipeline-wrapper {
        padding: 12px;
    }

    .pipeline-container {
        flex-direction: column;
        overflow: visible;
    }

    .pipeline-stage {
        min-width: 100%;
        max-width: 100%;
    }

    .page-header-bar {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .header-actions,
    .stats-bar,
    .legend,
    .modal-field-row {
        flex-direction: column;
        align-items: stretch;
    }

    .pipeline-btn {
        width: 100%;
    }

    .modal-actions-left,
    .modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #commentsToggle.comments-toggle {
        right: 16px;
        bottom: 16px;
    }
}
