/* vis.css */

body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f5;
    color: #333;
    padding: 16px;
}

.job-summary-banner {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 13px;
}

#summary-main {
    font-weight: 600;
}

#summary-artifacts {
    color: #4b5563;
    font-size: 12px;
}

.load-error-banner {
    background: #fff1f2;
    color: #9f1239;
    border: 1px solid #fda4af;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 10px;
    font-size: 13px;
}

.viz-stage {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 14px;
}

.viz-stage.viz-stage-pinned {
    position: sticky;
    top: 0;
    z-index: 980;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.viz-stage-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.pin-toggle {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-size: 13px;
    color: #374151;
}

.viz-workspace {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.viz-container {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    position: relative;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    min-height: 220px;
}

.point-details-panel {
    width: 320px;
    min-width: 280px;
    max-width: 340px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 12px;
}

.point-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 12px;
}

.point-details-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.panel-close-btn {
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #4b5563;
}

.point-details-content {
    padding: 12px;
    font-size: 13px;
    color: #374151;
}

.point-meta-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.point-annotation {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f8fafc;
    padding: 8px;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.point-remove-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.position-display-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 8px;
}

.container {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 80%;
    margin: 20px auto;
}

.step {
    padding: 10px;
    border-bottom: 1px solid #eee;
    position: relative;
    margin: 10px 0;
}

.status-icon {
    height: 20px;
    width: 20px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    margin-right: 10px;
}

.waiting .status-icon {
    background-image: url('../images/waiting.png'); /* Placeholder for an actual image */
}

.loading .status-icon {
    background-image: url('../images/loading.gif'); /* Some loading GIF or CSS animation */
}

.success .status-icon {
    background-image: url('../images/check.png'); /* Green check icon */
}

.failure .status-icon {
    background-image: url('../images/cross.png'); /* Red cross icon */
}
#viz svg {
    filter: url(#glow);  /* 应用发光效果 */
}

#zoom-controls button {
    width: 30px;
    height: 30px;
    font-size: 16px;
}

.toolbar-button {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.toolbar-button:hover {
    background: #e9ecef;
}

#position-display {
    background: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 4px;
}

#position-display, #position-display-tail {
    margin: 10px; /* Add margin for better visibility */
}

.genbank-annotation-bar {
    margin: 8px 10px 14px 10px;
    padding: 10px 12px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #f8fbff;
}

.genbank-summary {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.genbank-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.genbank-controls input[type="text"],
.genbank-controls select {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 12px;
    color: #1f2937;
    background: #ffffff;
}

.genbank-controls input[type="text"] {
    min-width: 240px;
}

.orf-label-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #374151;
    margin: 0;
}

#orf-clear-filters-btn {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    padding: 5px 9px;
    font-size: 12px;
    cursor: pointer;
}

#orf-clear-filters-btn:hover {
    background: #eef2f7;
}

.genbank-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #475569;
}

.active-filter-chip {
    border-radius: 999px;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1e3a8a;
    padding: 3px 8px;
}

.genbank-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: #374151;
    background: #ffffff;
    cursor: pointer;
}

.legend-chip-muted {
    opacity: 0.45;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
}

.orf-detail-card {
    margin: 0 10px 14px 10px;
    border: 1px solid #d1d5db;
    border-left: 4px solid #2563eb;
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.orf-detail-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.orf-detail-title h4 {
    margin: 0;
    font-size: 15px;
    color: #111827;
}

.orf-detail-close {
    border: 1px solid #d1d5db;
    background: #f9fafb;
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 12px;
}

.orf-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    font-size: 12px;
}

.orf-detail-grid div {
    color: #374151;
}

.orf-detail-note {
    margin-top: 8px;
    font-size: 12px;
    color: #4b5563;
    line-height: 1.4;
}

.orf-tooltip {
    position: fixed;
    z-index: 2005;
    max-width: 320px;
    background: rgba(17, 24, 39, 0.95);
    color: #f9fafb;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.4;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.orf-focus-line {
    stroke: #ef4444;
    stroke-width: 1.5;
    stroke-dasharray: 4, 3;
    opacity: 0.85;
    pointer-events: none;
}

/* Bottom-right floating window */
.results-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 600px;
    min-width: 400px;
    max-width: 90vw;
    height: 600px;
    min-height: 300px;
    max-height: 90vh;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1002;
    overflow: hidden;
    resize: both;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.results-window.minimized {
    height: 40px;
    max-height: 40px;
    min-height: 40px;
    resize: none;
}

.results-header {
    background: #007bff;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.results-title {
    font-weight: bold;
    font-size: 14px;
}

.window-controls {
    display: flex;
    gap: 10px;
}

.window-control-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window-control-btn:hover {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.results-content {
    padding: 15px;
    height: calc(100% - 50px);
    overflow-y: auto;
}

.primer-result-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.primer-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.primer-name {
    font-weight: bold;
    color: #333;
}

.primer-name-clickable {
    font-weight: bold;
    color: #007bff;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.primer-name-clickable:hover {
    color: #0056b3;
}

.add-to-pool-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.add-to-pool-btn:hover {
    background: #218838;
}

.add-to-pool-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.primer-details {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Primer pool management */
.primer-pool-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #007bff;
}

.pool-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.pool-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.pool-btn:hover {
    background: #138496;
}

.pool-section {
    margin-bottom: 20px;
}

.pool-section:last-child {
    margin-bottom: 0;
}

.pool-section-header {
    font-size: 12px;
    font-weight: bold;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #dee2e6;
}

.pool-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.pool-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.pool-item-current {
    background: #f0f8ff;
    border-color: #007bff;
}

.pool-item-name-edit {
    font-weight: bold;
    font-size: 12px;
    border: 1px solid transparent;
    padding: 2px 6px;
    border-radius: 3px;
    background: transparent;
    min-width: 120px;
    transition: all 0.2s ease;
}

.pool-item-name-edit:hover {
    background: white;
    border-color: #dee2e6;
}

.pool-item-name-edit:focus {
    outline: none;
    background: white;
    border-color: #007bff;
}

.pool-item-time {
    font-size: 10px;
    color: #6c757d;
    white-space: nowrap;
}

.pool-item-name {
    font-weight: bold;
    font-size: 12px;
}

.pool-item-name-edit {
    font-weight: bold;
    font-size: 12px;
    border: 1px solid transparent;
    background: transparent;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s;
    max-width: 150px;
}

.pool-item-name-edit:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.pool-item-name-edit:focus {
    outline: none;
    border-color: #007bff;
    background: white;
}

.pool-item-time {
    font-size: 10px;
    color: #999;
}

.pool-item-current {
    background: #e8f4fd !important;
    border-color: #b8daff !important;
}

.pool-section {
    margin-bottom: 15px;
}

.pool-section-header {
    font-size: 11px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.remove-from-pool-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
}

.remove-from-pool-btn:hover {
    background: #c82333;
}

/* Primer info popup */
.primer-info-popup {
    position: fixed;
    background: white;
    border: 2px solid #007bff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1003;
    min-width: 300px;
    max-width: 400px;
    display: none;
}

/* Ensure primer details popup (the one that shows when clicking Details button) appears on top */
#primer-info-popup {
    z-index: 1005;
    min-width: 600px;
    max-width: 90vw;
    min-height: 400px;
    max-height: 90vh;
    width: 800px;
    height: 600px;
    resize: both;
    overflow: hidden;
}

.primer-info-header {
    background: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.primer-info-content {
    padding: 15px;
    height: calc(100% - 100px);
    overflow-y: auto;
    overflow-x: hidden;
}

.primer-info-detail {
    margin-bottom: 8px;
    font-size: 13px;
}

.primer-info-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* CSV import/export styles */
.csv-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.file-input {
    display: none;
}

.file-input-label {
    background: #6f42c1;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.file-input-label:hover {
    background: #5a32a3;
}

/* Show Saved Primers Button */
.show-saved-primers-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: linear-gradient(135deg, #030712, #1f2937 62%, #6b7280);
    color: white;
    padding: 12px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.18);
    z-index: 1004;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.show-saved-primers-btn:hover {
    background: linear-gradient(135deg, #000000, #111827 62%, #4b5563);
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(17, 24, 39, 0.22);
}

#saved-count-badge {
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Saved Primer List */
.saved-primer-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 10px;
}

.saved-primer-controls {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.saved-primer-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.saved-primer-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.1);
}

.saved-primer-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.saved-primer-item-name {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.saved-primer-item-details {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.saved-primer-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.view-primer-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.view-primer-btn:hover {
    background: #138496;
}

.view-primer-btn:disabled,
.pool-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pool-btn-accent {
    background: #0d6efd;
}

.pool-btn-accent:hover {
    background: #0b5ed7;
}

.pool-section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.primer-pool-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pool-summary-note {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
}

.pool-inline-summary-card {
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    background: #f8fafc;
    padding: 12px;
}

.pool-inline-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.pool-inline-summary-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.pool-inline-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.pool-inline-summary-note {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
}

.pool-batch-toolbar {
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    background: #f8fafc;
    padding: 12px;
    margin-bottom: 12px;
}

.pool-batch-toolbar-inner {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pool-batch-count {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
}

#saved-primer-popup {
    width: min(960px, 92vw);
    max-width: 92vw;
    min-width: 720px;
    max-height: 88vh;
}

.pool-target-modal {
    width: min(420px, 92vw);
    min-width: 320px;
    height: auto !important;
    min-height: auto !important;
}

.pool-import-preview-modal {
    width: min(820px, 92vw);
    max-width: 92vw;
}

.pool-create-form {
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    background: #f8fafc;
    padding: 12px;
    margin-bottom: 12px;
}

.pool-create-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.pool-create-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pool-create-input {
    flex: 1;
    min-width: 220px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: #1f2937;
    background: #fff;
}

.pool-create-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.pool-create-input-error {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.pool-field-error {
    min-height: 18px;
    margin-top: 6px;
    font-size: 11px;
    color: #b91c1c;
}

.pool-batch-select,
.pool-search-input {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: #1f2937;
    background: #fff;
}

.pool-batch-select {
    min-width: 180px;
}

.pool-search-input {
    width: 100%;
    min-width: 220px;
}

.pool-manual-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.pool-manual-help {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 10px;
}

.pool-blast-config {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
}

.pool-blast-config[hidden] {
    display: none !important;
}

.pool-blast-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pool-blast-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pool-blast-span-2 {
    grid-column: span 2;
}

.pool-host-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pool-host-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.pool-host-preset-btn {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    padding: 6px 12px;
    transition: all 0.15s ease;
}

.pool-host-preset-btn:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.pool-host-preset-btn-active {
    border-color: #60a5fa;
    background: #dbeafe;
    color: #1e3a8a;
}

.pool-host-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
    margin-top: 8px;
}

.pool-host-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e3a8a;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
}

.pool-host-chip-remove {
    border: none;
    background: transparent;
    color: #1d4ed8;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
}

.pool-host-chip-remove:hover {
    color: #1e40af;
}

.pool-host-chip-empty {
    font-size: 12px;
    color: #64748b;
    padding: 6px 2px;
}

.pool-blast-preview-card {
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    padding: 10px 12px;
}

.pool-blast-mode-note {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 6px;
}

.pool-blast-preview-text {
    font-size: 12px;
    color: #0f172a;
    line-height: 1.5;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.primer-pool-card {
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    background: #fff;
    padding: 12px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.primer-pool-card-active {
    border-color: #3b82f6;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.14);
}

.primer-pool-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.primer-pool-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.primer-pool-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pool-chip-btn {
    border: none;
    border-radius: 999px;
    background: #e9eef5;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
}

.pool-chip-btn-active {
    background: #dbeafe;
    color: #1d4ed8;
}

.pool-name-input {
    min-width: 0;
    width: 100%;
    border: 1px solid #d7dee7;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    background: #fff;
}

.pool-name-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.pool-freshness-chip {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.pool-freshness-chip-empty {
    background: #e2e8f0;
    color: #475569;
}

.pool-freshness-chip-stale {
    background: #fef3c7;
    color: #92400e;
}

.pool-freshness-chip-fresh {
    background: #dcfce7;
    color: #166534;
}

.pool-freshness-chip-checking {
    background: #dbeafe;
    color: #1d4ed8;
}

.pool-freshness-chip-pending {
    background: #e0f2fe;
    color: #075985;
}

.primer-pool-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.pool-card-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.pool-card-tools-meta {
    font-size: 12px;
    color: #64748b;
}

.primer-pool-dropzone {
    min-height: 48px;
}

.primer-pool-card-drag-source {
    border-color: #94a3b8;
}

.primer-pool-card-drag-target {
    border-color: #2563eb;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.16);
}

.primer-pool-dropzone-active {
    border-radius: 10px;
    outline: 2px dashed #60a5fa;
    outline-offset: 4px;
    background: rgba(219, 234, 254, 0.28);
}

.pool-check-panels {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.pool-check-card {
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    background: #f8fafc;
    padding: 12px;
}

.pool-check-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.pool-check-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.pool-check-card-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.pool-panel-toggle {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    cursor: pointer;
    white-space: nowrap;
}

.pool-panel-collapsed-note {
    font-size: 12px;
    color: #64748b;
}

.pool-check-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pool-check-pill {
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
}

.pool-check-pill-warning {
    background: #fff7ed;
    color: #c2410c;
}

.pool-result-placeholder {
    border: 1px dashed #c7d2de;
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
    margin-top: 14px;
    font-size: 12px;
    color: #64748b;
}

.pool-result-stale {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.pool-result-clean {
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #f0fdf4;
    padding: 12px;
    font-size: 12px;
    color: #166534;
}

.pool-conflict-matrix-wrap,
.pool-conflict-table-wrap {
    overflow: auto;
}

.pool-conflict-matrix-note {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
}

.pool-conflict-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 520px;
}

.pool-conflict-matrix th,
.pool-conflict-matrix td {
    border: 1px solid #dbe3ec;
    padding: 8px 10px;
    text-align: center;
    font-size: 12px;
}

.pool-conflict-matrix-corner,
.pool-conflict-matrix-label {
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 700;
}

.pool-conflict-matrix-corner,
.pool-conflict-matrix tbody .pool-conflict-matrix-label {
    position: sticky;
    left: 0;
    z-index: 1;
}

.pool-conflict-matrix thead .pool-conflict-matrix-label,
.pool-conflict-matrix thead .pool-conflict-matrix-corner {
    top: 0;
    z-index: 2;
}

.pool-conflict-matrix-cell {
    font-weight: 700;
    padding: 0 !important;
}

.pool-conflict-matrix-cell-safe {
    background: #f8fafc;
    color: #475569;
}

.pool-conflict-matrix-cell-conflict {
    background: #fef2f2;
    color: #b91c1c;
}

.pool-conflict-matrix-cell-selected {
    box-shadow: inset 0 0 0 2px #2563eb;
}

.pool-conflict-matrix-cell-diagonal {
    background: #e2e8f0;
    color: #64748b;
}

.pool-conflict-matrix-button {
    width: 100%;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    padding: 8px 10px;
    cursor: pointer;
}

.pool-conflict-matrix-button:hover {
    filter: brightness(0.97);
}

.pool-conflict-matrix-button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.pool-conflict-table {
    width: 100%;
    border-collapse: collapse;
}

.pool-conflict-table th,
.pool-conflict-table td {
    border-bottom: 1px solid #dbe3ec;
    padding: 9px 8px;
    font-size: 12px;
    text-align: left;
    vertical-align: top;
}

.pool-conflict-table th {
    color: #475569;
    font-weight: 700;
    background: #f8fafc;
    position: sticky;
    top: 0;
}

.pool-conflict-name {
    font-weight: 600;
    color: #0f172a;
}

.pool-conflict-role {
    margin-top: 2px;
    font-size: 11px;
    color: #64748b;
    text-transform: capitalize;
}

.pool-conflict-filter-banner {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
}

.pool-inline-link {
    border: none;
    background: transparent;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.pool-empty-state {
    border: 1px dashed #c7d2de;
    border-radius: 8px;
    padding: 14px;
    color: #64748b;
    font-size: 12px;
    text-align: center;
    background: #f8fafc;
}

.pool-item {
    align-items: stretch;
    gap: 10px;
    border-radius: 8px;
    padding: 10px;
    transition: box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.pool-item-dragging {
    opacity: 0.45;
    background: #f8fafc;
}

.pool-item-drop-before {
    box-shadow: inset 0 3px 0 #2563eb;
}

.pool-item-grab {
    color: #94a3b8;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    padding-top: 4px;
    cursor: grab;
    user-select: none;
}

.pool-item-body {
    flex: 1;
    min-width: 0;
}

.pool-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.pool-item-select {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #475569;
    user-select: none;
}

.pool-item-select input {
    margin: 0;
}

.pool-item-seq {
    font-size: 11px;
    color: #475569;
    font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    word-break: break-all;
}

.pool-item-meta {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 6px;
}

.pool-item-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.pool-order-group {
    display: inline-flex;
    gap: 4px;
}

.pool-order-btn {
    min-width: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 6px;
    cursor: pointer;
}

.pool-order-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pool-order-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.pool-status-badge {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.pool-status-pending {
    background: #fff7ed;
    color: #c2410c;
}

.pool-status-pass {
    background: #ecfdf5;
    color: #047857;
}

.pool-status-conflict {
    background: #fef2f2;
    color: #b91c1c;
}

.pool-import-preview-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.pool-import-preview-table-wrap {
    overflow: auto;
}

.pool-import-preview-note {
    margin-top: 12px;
    font-size: 12px;
    color: #475569;
}

.pool-import-preview-note ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.primer-conserve-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.primer-conserve-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
}

.primer-conserve-pill-ok {
    background: #ecfdf5;
    color: #047857;
}

.primer-conserve-pill-warning {
    background: #fff7ed;
    color: #c2410c;
}

.primer-conserve-details {
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
}

.primer-conserve-details summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
    user-select: none;
}

.primer-conserve-details-body {
    margin-top: 12px;
}

.primer-pool-action-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.primer-pool-action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.primer-pool-action-meta {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

.primer-add-primary-btn,
.primer-add-secondary-btn {
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.primer-add-primary-btn {
    background: #0f766e;
    color: #fff;
}

.primer-add-primary-btn:hover {
    background: #115e59;
}

.primer-add-primary-btn:disabled {
    background: #dbeafe;
    color: #1d4ed8;
    cursor: not-allowed;
}

.primer-add-secondary-btn {
    background: #e2e8f0;
    color: #334155;
}

.primer-add-secondary-btn:hover {
    background: #cbd5e1;
}

.primer-add-primary-btn:focus-visible,
.primer-add-secondary-btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.app-notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 32px));
}

.app-notification {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    padding: 12px 16px;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-notification-visible {
    opacity: 1;
    transform: translateY(0);
}

.app-notification-success {
    background: #15803d;
}

.app-notification-info {
    background: #2563eb;
}

.app-notification-warning {
    background: #b45309;
}

.app-notification-error {
    background: #b91c1c;
}

/* Unified pool and progress UI */
.job-result-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid #dbe3ec;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    text-align: center;
}

.job-result-id {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.job-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.job-result-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.job-result-link:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.08);
}

.job-result-link-primary {
    border-color: transparent;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
    box-shadow: 0 14px 24px rgba(37, 99, 235, 0.24);
}

.job-result-link-primary:hover {
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
}

.primer-site-results-card {
    position: relative;
    min-height: 320px;
}

.primer-site-results-card.primer-site-results-card-loading > :not(#primer-site-loading) {
    opacity: 0.32;
    pointer-events: none;
    user-select: none;
}

.primer-site-loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px 24px;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92), rgba(255, 255, 255, 0.96));
    backdrop-filter: blur(2px);
    text-align: center;
}

.primer-site-loading-spinner,
.primer-site-inline-loading-spinner {
    border-radius: 999px;
    animation: primer-site-spin 0.85s linear infinite;
}

.primer-site-loading-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(37, 99, 235, 0.16);
    border-top-color: #2563eb;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}

.primer-site-loading-copy {
    display: grid;
    gap: 8px;
    max-width: 440px;
}

.primer-site-loading-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.primer-site-loading-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

.primer-site-inline-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    color: #64748b;
}

.primer-site-inline-loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(37, 99, 235, 0.16);
    border-top-color: #2563eb;
}

.primer-site-inline-loading[data-variant="error"] {
    color: #b91c1c;
}

.primer-site-inline-loading[data-variant="error"] .primer-site-inline-loading-spinner {
    display: none;
}

.job-progress {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 24px;
    padding: 22px;
    border: 1px solid #dbe3ec;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.job-progress-header,
.job-progress-meta,
.job-progress-step-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.job-progress-title {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.job-progress-summary,
.job-progress-counter,
.job-progress-percent {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.job-progress-badge,
.job-progress-step-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.job-progress-badge {
    background: #e2e8f0;
    color: #334155;
}

.job-progress-badge[data-state="queued"] {
    background: #e2e8f0;
    color: #334155;
}

.job-progress-badge[data-state="running"] {
    background: #dbeafe;
    color: #1d4ed8;
}

.job-progress-badge[data-state="ready"] {
    background: #dcfce7;
    color: #166534;
}

.job-progress-badge[data-state="failed"] {
    background: #fee2e2;
    color: #b91c1c;
}

.job-progress-track {
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.job-progress-track-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1d4ed8, #38bdf8);
    transition: width 0.28s ease;
}

.job-progress-steps {
    display: grid;
    gap: 12px;
}

.job-progress-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.job-progress-step[data-step-state="current"] {
    border-color: #93c5fd;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
    box-shadow: 0 16px 26px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.job-progress-step[data-step-state="complete"] {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, rgba(240, 253, 244, 0.98), rgba(255, 255, 255, 0.98));
}

.job-progress-step[data-step-state="error"] {
    border-color: #fecaca;
    background: linear-gradient(180deg, rgba(254, 242, 242, 0.98), rgba(255, 255, 255, 0.98));
}

.job-progress-marker {
    position: relative;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #f8fafc;
    border: 1px solid #dbe3ec;
    color: #475569;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.job-step-number,
.job-step-check,
.job-step-spinner {
    position: absolute;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.job-step-number {
    font-size: 14px;
    font-weight: 800;
    opacity: 1;
    transform: scale(1);
}

.job-step-check {
    font-size: 16px;
    font-weight: 900;
    opacity: 0;
    transform: scale(0.72);
}

.job-step-spinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(37, 99, 235, 0.18);
    border-top-color: #2563eb;
    opacity: 0;
    animation: job-step-spin 0.9s linear infinite;
    transition: opacity 0.18s ease;
}

.job-progress-step[data-step-state="current"] .job-progress-marker {
    border-color: #60a5fa;
    background: #eff6ff;
    color: #1d4ed8;
}

.job-progress-step[data-step-state="current"] .job-step-number {
    opacity: 0;
    transform: scale(0.72);
}

.job-progress-step[data-step-state="current"] .job-step-spinner {
    opacity: 1;
}

.job-progress-step[data-step-state="complete"] .job-progress-marker {
    border-color: #86efac;
    background: #dcfce7;
    color: #166534;
}

.job-progress-step[data-step-state="complete"] .job-step-number {
    opacity: 0;
    transform: scale(0.72);
}

.job-progress-step[data-step-state="complete"] .job-step-check {
    opacity: 1;
    transform: scale(1);
}

.job-progress-step[data-step-state="error"] .job-progress-marker {
    border-color: #fca5a5;
    background: #fee2e2;
    color: #b91c1c;
}

.job-progress-copy {
    min-width: 0;
    flex: 1;
}

.job-progress-step-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

.job-progress-step-description {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: #64748b;
}

.job-progress-step-status {
    background: #e2e8f0;
    color: #334155;
}

.job-progress-step[data-step-state="current"] .job-progress-step-status {
    background: #dbeafe;
    color: #1d4ed8;
}

.job-progress-step[data-step-state="complete"] .job-progress-step-status {
    background: #dcfce7;
    color: #166534;
}

.job-progress-step[data-step-state="error"] .job-progress-step-status {
    background: #fee2e2;
    color: #b91c1c;
}

.drop-area.upload-feedback-active {
    animation: upload-surface-feedback 0.55s ease;
}

.drop-area img.upload-feedback-active {
    animation: upload-icon-feedback 0.55s ease;
}

.results-window,
.primer-info-popup {
    border: 1px solid #dbe3ec;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.results-header,
.primer-info-header {
    background: linear-gradient(135deg, #030712, #1f2937 62%, #6b7280);
    color: #fff;
    padding: 14px 16px;
}

.results-title,
.primer-name {
    font-size: 14px;
    font-weight: 800;
}

.window-control-btn {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.window-control-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.results-content,
.primer-info-content {
    padding: 16px;
}

.primer-info-actions {
    padding: 0 16px 16px;
    margin-top: 0;
    flex-wrap: wrap;
}

.primer-pool-section {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid #dbe3ec;
    border-top: 1px solid #dbe3ec;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.pool-section-header-row {
    align-items: flex-start;
    margin-bottom: 14px;
}

.pool-section-header-row h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.pool-section-subtitle {
    margin: 6px 0 0;
    max-width: 560px;
    font-size: 12px;
    line-height: 1.6;
    color: #64748b;
}

.pool-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.pool-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 244, 246, 0.96));
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
}

.pool-stat-value {
    color: #111827;
    font-weight: 800;
}

.pool-btn,
.toolbar-button,
.view-primer-btn,
.add-to-pool-btn,
.remove-from-pool-btn,
.file-input-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(17, 24, 39, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 244, 246, 0.98));
    color: #374151;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.pool-btn:hover,
.toolbar-button:hover,
.view-primer-btn:hover,
.file-input-label:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(229, 231, 235, 0.96));
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(17, 24, 39, 0.08);
}

.pool-btn-accent,
.add-to-pool-btn,
.file-input-label,
.pool-detect-btn {
    border-color: transparent;
    background: linear-gradient(135deg, #030712, #1f2937 62%, #6b7280);
    color: #fff;
    box-shadow: 0 14px 24px rgba(17, 24, 39, 0.18);
}

.pool-btn-accent:hover,
.add-to-pool-btn:hover,
.file-input-label:hover,
.pool-detect-btn:hover {
    background: linear-gradient(135deg, #000000, #111827 62%, #4b5563);
    color: #fff;
}

.remove-from-pool-btn {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b91c1c;
}

.remove-from-pool-btn:hover {
    background: #ffe4e6;
    border-color: #fda4af;
    color: #9f1239;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(190, 24, 93, 0.08);
}

.view-primer-btn:disabled,
.pool-btn:disabled,
.toolbar-button:disabled,
.add-to-pool-btn:disabled,
.remove-from-pool-btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.csv-controls {
    gap: 8px;
    flex-wrap: wrap;
}

.saved-primer-controls {
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(241, 241, 244, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.primer-pool-toolbar {
    gap: 14px;
}

.pool-summary-note {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(243, 244, 246, 0.98));
    color: #4b5563;
}

.pool-inline-summary-card,
.pool-batch-toolbar,
.pool-create-form,
.pool-check-card,
.primer-pool-card,
.pool-result-placeholder,
.pool-empty-state,
.pool-result-clean {
    border-radius: 16px;
}

.pool-inline-summary-card,
.pool-batch-toolbar,
.pool-create-form,
.pool-check-card,
.primer-pool-card {
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: #fff;
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.06);
}

.pool-inline-summary-card,
.pool-batch-toolbar,
.pool-create-form,
.pool-check-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 241, 244, 0.98));
}

.primer-pool-card {
    padding: 16px;
    margin-bottom: 16px;
}

.primer-pool-card-active {
    border-color: rgba(17, 24, 39, 0.22);
    box-shadow: 0 20px 38px rgba(17, 24, 39, 0.12);
}

.pool-chip-btn {
    background: #e5e7eb;
    color: #374151;
}

.pool-chip-btn-active {
    background: #111827;
    color: #fff;
}

.pool-name-input,
.pool-create-input,
.pool-batch-select,
.pool-search-input {
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(17, 24, 39, 0.1);
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
}

.pool-name-input,
.pool-search-input {
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pool-name-input:focus,
.pool-create-input:focus,
.pool-batch-select:focus,
.pool-search-input:focus {
    border-color: rgba(17, 24, 39, 0.28);
    box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08);
}

.pool-item {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.pool-item:hover {
    border-color: rgba(17, 24, 39, 0.18);
    box-shadow: 0 14px 24px rgba(17, 24, 39, 0.08);
}

.pool-item-current {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(229, 231, 235, 0.92)) !important;
    border-color: rgba(17, 24, 39, 0.24) !important;
    box-shadow: 0 16px 28px rgba(17, 24, 39, 0.12) !important;
}

.pool-item-grab {
    color: #94a3b8;
    letter-spacing: -1px;
}

.pool-item-meta,
.pool-card-tools-meta,
.pool-inline-summary-meta,
.pool-check-card-subtitle,
.pool-manual-help,
.pool-conflict-role,
.pool-import-preview-note,
.pool-result-placeholder,
.pool-empty-state {
    color: #64748b;
}

.pool-result-placeholder,
.pool-empty-state {
    border-style: dashed;
    background: rgba(248, 250, 252, 0.92);
}

.pool-result-clean {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, rgba(240, 253, 244, 0.98), rgba(255, 255, 255, 0.98));
}

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

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

@keyframes upload-surface-feedback {
    0% {
        transform: translateY(0);
        box-shadow: none;
    }
    45% {
        transform: translateY(-2px);
        box-shadow: 0 16px 28px rgba(37, 99, 235, 0.12);
    }
    100% {
        transform: translateY(0);
        box-shadow: none;
    }
}

@keyframes upload-icon-feedback {
    0% {
        transform: scale(1);
        opacity: 0.92;
    }
    45% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .viz-workspace {
        flex-direction: column;
    }

    .point-details-panel {
        width: 100%;
        max-width: none;
        position: static;
    }
    
    .results-window {
        right: 10px;
        bottom: 10px;
        width: 350px;
        min-width: 300px;
        height: 400px;
        min-height: 300px;
    }
    
    .show-saved-primers-btn {
        top: 10px;
        right: 10px;
        padding: 10px 14px;
        font-size: 12px;
    }

    .primer-info-popup {
        min-width: 0;
        max-width: 96vw;
    }

    #primer-info-popup {
        min-width: 0;
        width: 96vw;
        max-width: 96vw;
        height: min(78vh, 620px);
        max-height: 90vh;
        resize: none;
    }

    #saved-primer-popup {
        min-width: 0;
        width: 96vw;
        max-width: 96vw;
    }

    .primer-info-actions,
    .csv-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .primer-info-actions > button,
    .csv-controls > .pool-btn,
    .csv-controls > .file-input-label {
        width: 100%;
        text-align: center;
    }

    .primer-pool-card-header {
        flex-direction: column;
    }

    .primer-pool-card-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .pool-create-row {
        flex-direction: column;
        align-items: stretch;
    }

    .pool-manual-grid {
        grid-template-columns: 1fr;
    }

    .pool-blast-grid {
        grid-template-columns: 1fr;
    }

    .pool-blast-span-2 {
        grid-column: span 1;
    }

    .pool-batch-toolbar-inner,
    .pool-card-tools,
    .pool-conflict-filter-banner {
        flex-direction: column;
        align-items: stretch;
    }

    .pool-create-input {
        min-width: 0;
        width: 100%;
    }

    .pool-item-actions {
        flex-direction: row;
        justify-content: flex-start;
    }

    .primer-pool-action-group {
        min-width: 0;
    }

    .app-notification-container {
        left: 12px;
        right: 12px;
        max-width: none;
    }

    .job-progress-header,
    .job-progress-meta,
    .job-progress-step-row,
    .job-result-actions,
    .pool-section-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .job-progress-step {
        padding: 12px;
    }

    .job-result-link {
        width: 100%;
    }
}
