/* ── Page container ─────────────────────────────────────── */
#contentTCRviz {
    margin: 28px auto;
    padding: 32px 36px;
    background: #fff;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    width: 88%;
    max-width: 860px;
    border-radius: 10px;
}

#MixTCRviz h1 {
    font-size: 22px;
    font-weight: 600;
    color: #222;
    margin: 0 0 24px 0;
}

/* ── Steps ───────────────────────────────────────────────── */
.step {
    margin-bottom: 24px;
}

.step-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: hsl(197, 53%, 32%);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-label-note {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    color: #888;
}

/* ── Upload zone ─────────────────────────────────────────── */
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 160px;
    border: 2px dashed hsl(197, 53%, 60%);
    border-radius: 10px;
    background: hsl(197, 53%, 97%);
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.upload-zone:hover,
.upload-zone.dragover {
    background: hsl(197, 53%, 93%);
    border-color: hsl(197, 53%, 35%);
}

.upload-zone.has-file {
    border-style: solid;
    border-color: hsl(197, 53%, 40%);
    background: hsl(197, 53%, 95%);
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 38px;
    line-height: 1;
    color: hsl(197, 53%, 45%);
}

.upload-primary {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.upload-secondary {
    font-size: 13px;
    color: #777;
}

.browse-link {
    color: hsl(197, 53%, 35%);
    text-decoration: underline;
    cursor: pointer;
}

.upload-formats {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

.upload-maxsize {
    font-size: 11px;
    color: #bbb;
    margin-top: 2px;
}

/* ── Or divider ──────────────────────────────────────────── */
.or-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    color: #bbb;
    font-size: 13px;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

/* ── Test data row ───────────────────────────────────────── */
.test-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-test {
    padding: 8px 18px;
    font-size: 14px;
    background: #fff;
    color: hsl(197, 53%, 32%);
    border: 1.5px solid hsl(197, 53%, 50%);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-test:hover {
    background: hsl(197, 53%, 95%);
}

.btn-test.active-test-data {
    background: hsl(197, 53%, 35%);
    color: #fff;
    border-color: hsl(197, 53%, 35%);
}

.data-indicator {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* ── Result name input ───────────────────────────────────── */
.result-name-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.18s, box-shadow 0.18s;
    outline: none;
}

.result-name-input:focus {
    border-color: hsl(197, 53%, 45%);
    box-shadow: 0 0 0 3px hsl(197, 53%, 92%);
}

.input-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ── Options grid ────────────────────────────────────────── */
.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.option-card {
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    padding: 14px 16px;
    background: #fafafa;
}

.option-card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: hsl(197, 53%, 32%);
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e8e8e8;
}

.option-label {
    display: flex;
    justify-content: flex-start; /* override global justify-content:center in styles.css */
    align-items: flex-start;
    gap: 8px;
    font-size: 13.5px;
    color: #444;
    margin-bottom: 8px;
    cursor: pointer;
    line-height: 1.35;
}

.option-label:last-child {
    margin-bottom: 0;
}

.option-label input[type="checkbox"] {
    display: inline-block; /* override global display:none in styles.css */
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: hsl(197, 53%, 35%);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* ── Action buttons ──────────────────────────────────────── */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-primary {
    flex: 1;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    background: hsl(197, 53%, 35%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.btn-primary:hover {
    background: hsl(197, 53%, 28%);
}

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

.btn-secondary {
    padding: 12px 20px;
    font-size: 15px;
    background: #f0f0f0;
    color: #444;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-secondary:hover {
    background: #e3e3e3;
}

/* ── Loading indicator ───────────────────────────────────── */
.loading-box {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    padding: 16px 20px;
    background: hsl(197, 53%, 97%);
    border: 1px solid hsl(197, 53%, 78%);
    border-radius: 8px;
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid hsl(197, 53%, 80%);
    border-top-color: hsl(197, 53%, 35%);
    border-radius: 50%;
    flex-shrink: 0;
    animation: spin 0.75s linear infinite;
}

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

.loading-text {
    font-size: 15px;
    color: hsl(197, 53%, 28%);
    font-weight: 500;
}

/* ── Results box ─────────────────────────────────────────── */
.results-box {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    background: #fafafa;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.results-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.btn-download {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    background: hsl(197, 53%, 35%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-download:hover {
    background: hsl(197, 53%, 28%);
}

#modelNamesList {
    list-style: none;
    padding: 0;
    margin: 0;
}

#modelNamesList li {
    padding: 7px 0;
    border-bottom: 1px solid #ececec;
    font-size: 14px;
}

#modelNamesList li:last-child {
    border-bottom: none;
}

#modelNamesList a {
    color: hsl(197, 53%, 30%);
    text-decoration: none;
}

#modelNamesList a:hover {
    text-decoration: underline;
}

.interactive-link {
    margin-left: 10px;
    font-size: 12px;
    padding: 2px 8px;
    border: 1px solid hsl(197, 53%, 50%);
    border-radius: 4px;
    color: hsl(197, 53%, 32%);
    background: hsl(197, 53%, 97%);
    white-space: nowrap;
}

.interactive-link:hover {
    background: hsl(197, 53%, 88%);
}

/* ── Two-input row ───────────────────────────────────────── */
.inputs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group-label {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.optional-tag {
    font-size: 11px;
    font-weight: 400;
    color: #aaa;
    font-style: italic;
}

/* ── Species selector ────────────────────────────────────── */
.species-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.species-label {
    font-size: 13.5px;
    color: #444;
    font-weight: 500;
}

.species-toggle {
    display: flex;
    border: 1.5px solid hsl(197, 53%, 50%);
    border-radius: 6px;
    overflow: hidden;
}

.species-btn {
    padding: 6px 16px;
    font-size: 13.5px;
    background: #fff;
    color: hsl(197, 53%, 32%);
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}

.species-btn:not(:last-child) {
    border-right: 1.5px solid hsl(197, 53%, 50%);
}

.species-btn:hover {
    background: hsl(197, 53%, 93%);
}

.species-btn.active {
    background: hsl(197, 53%, 35%);
    color: #fff;
}

/* ── Option sub-rows (Chain, Title) ──────────────────────── */
.option-subrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.option-subrow:last-child {
    margin-bottom: 0;
}

.suboption-label {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    min-width: 36px;
}

.option-select {
    flex: 1;
    padding: 4px 6px;
    font-size: 13px;
    border: 1.5px solid #ccc;
    border-radius: 5px;
    background: #fff;
    color: #333;
    outline: none;
    cursor: pointer;
}

.option-select:focus {
    border-color: hsl(197, 53%, 45%);
}

.option-text-input {
    flex: 1;
    padding: 4px 6px;
    font-size: 13px;
    border: 1.5px solid #ccc;
    border-radius: 5px;
    outline: none;
    min-width: 0;
}

.option-text-input:focus {
    border-color: hsl(197, 53%, 45%);
    box-shadow: 0 0 0 2px hsl(197, 53%, 92%);
}

/* ── Clear input button ──────────────────────────────────── */
.data-indicator-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.clear-input-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}

.clear-input-btn:hover {
    color: #c00;
}

/* ── Input 2 mode toggle ─────────────────────────────────── */
.input2-mode-btn {
    padding: 6px 16px;
    font-size: 13.5px;
    background: #fff;
    color: hsl(197, 53%, 32%);
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}

.input2-mode-btn:not(:last-child) {
    border-right: 1.5px solid hsl(197, 53%, 50%);
}

.input2-mode-btn:hover {
    background: hsl(197, 53%, 93%);
}

.input2-mode-btn.active {
    background: hsl(197, 53%, 35%);
    color: #fff;
}

/* ── Input 2 mode row ────────────────────────────────────── */
.renorm-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Info tooltip ────────────────────────────────────────── */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6c757d;
    color: #fff;
    font-size: 11px;
    font-style: italic;
    font-weight: bold;
    text-transform: none;
    letter-spacing: normal;
    cursor: default;
    flex-shrink: 0;
}

.info-tooltip .info-tooltip-text {
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
    visibility: hidden;
    opacity: 0;
    width: 260px;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-style: normal;
    font-weight: normal;
    text-align: left;
    border-radius: 6px;
    padding: 8px 10px;
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    transition: opacity 0.15s;
    pointer-events: none;
}

.info-tooltip:hover .info-tooltip-text,
.info-tooltip:focus .info-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 620px) {
    #contentTCRviz {
        width: 95%;
        padding: 20px 18px;
    }

    .inputs-row {
        grid-template-columns: 1fr;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary {
        flex: none;
    }
}
