.clinical-disclaimer {
    background: rgba(255, 107, 53, 0.15);
    border-bottom: 1px solid var(--neon-orange);
    color: var(--neon-orange);
    font-size: 0.85rem;
    padding: 8px 24px;
    text-align: center;
}

.upload-zone {
    align-items: center;
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 160px;
    padding: 48px 24px;
    position: relative;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    width: 100%;
}

.upload-zone-text,
.upload-zone-filename {
    display: block;
    margin: 0;
    pointer-events: none;
    width: 100%;
}

.upload-zone-filename {
    color: var(--neon-orange);
    margin-top: 8px;
    min-height: 1.2em;
}

.upload-zone:hover,
.upload-zone.dragover {
    background: rgba(255, 107, 53, 0.08);
    border-color: var(--neon-orange);
}

/* Hide native OS file control (button + filename) — keeps label clickable */
.upload-zone input[type="file"],
.upload-zone .upload-zone-input,
.upload-zone .file-upload {
    border: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    white-space: nowrap !important;
    width: 1px !important;
}

.study-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.study-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.2s;
}

.study-card-top {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.study-card-link {
    color: inherit;
    flex: 1;
    min-width: 0;
    text-decoration: none;
}

.study-card:hover {
    border-color: var(--neon-orange);
}

.study-card a {
    color: inherit;
    text-decoration: none;
}

.study-delete-form {
    display: inline;
    margin: 0;
}

.study-delete-btn {
    align-items: center;
    background: transparent;
    border: 1px solid rgba(255, 80, 80, 0.35);
    border-radius: 8px;
    color: #ff6b6b;
    cursor: pointer;
    display: inline-flex;
    flex-shrink: 0;
    justify-content: center;
    padding: 8px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.study-delete-btn:hover {
    background: rgba(255, 80, 80, 0.15);
    border-color: #ff6b6b;
    color: #ff8a8a;
}

.study-delete-btn-detail {
    align-items: center;
    background: rgba(255, 80, 80, 0.12) !important;
    border-color: rgba(255, 80, 80, 0.45) !important;
    color: #ff6b6b !important;
    display: inline-flex;
    gap: 8px;
}

.study-delete-btn-detail:hover {
    background: rgba(255, 80, 80, 0.22) !important;
    border-color: #ff6b6b !important;
    color: #ff8a8a !important;
}

.status-badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    text-transform: uppercase;
}

.status-pending { background: rgba(69, 183, 209, 0.2); color: var(--neon-blue); }
.status-processing { background: rgba(255, 107, 53, 0.2); color: var(--neon-orange); }
.status-done { background: rgba(150, 206, 180, 0.2); color: var(--neon-green); }
.status-error { background: rgba(255, 80, 80, 0.2); color: #ff6b6b; }

.study-detail-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
    .study-detail-grid { grid-template-columns: 1fr; }
}

.image-viewer-wrap {
    position: relative;
    width: 100%;
}

.image-viewer-wrap img {
    display: block;
    max-width: 100%;
    width: 100%;
}

.image-viewer-overlay {
    height: 100%;
    left: 0;
    pointer-events: none;
    position: absolute;
    top: 0;
    width: 100%;
}

.finding-box {
    border: 2px solid #FF6B35;
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.6);
    position: absolute;
}

.finding-label {
    background: #FF6B35;
    color: #0A0A0F;
    font-size: 0.7rem;
    font-weight: 700;
    left: 0;
    padding: 2px 6px;
    position: absolute;
    top: -22px;
    white-space: nowrap;
}

.findings-table {
    width: 100%;
}

.findings-table th,
.findings-table td {
    border-bottom: 1px solid var(--glass-border);
    padding: 8px 12px;
    text-align: left;
}

.processing-steps {
    list-style: none;
    margin: 16px 0;
    padding: 0;
}

.processing-steps li {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
    padding: 8px 0;
    transition: color 0.35s ease, opacity 0.4s ease, transform 0.4s ease;
}

.processing-steps .step-marker {
    border: 2px solid currentColor;
    border-radius: 50%;
    flex-shrink: 0;
    height: 14px;
    opacity: 0.45;
    position: relative;
    transition: opacity 0.35s ease, border-color 0.35s ease, background 0.35s ease;
    width: 14px;
}

.processing-steps li.active {
    color: var(--neon-orange);
}

.processing-steps li.active .step-marker {
    animation: step-pulse 1s ease-in-out infinite;
    border-color: transparent;
    border-top-color: var(--neon-orange);
    opacity: 1;
}

.processing-steps li.done {
    color: var(--neon-green);
}

.processing-steps li.done .step-marker {
    animation: none;
    background: var(--neon-green);
    border-color: var(--neon-green);
    opacity: 1;
}

.processing-steps li.done .step-marker::after {
    color: #0A0A0F;
    content: "✓";
    font-size: 9px;
    font-weight: 700;
    left: 50%;
    line-height: 1;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -45%);
}

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

/* —— Analysis wait panel (upload) —— */
.analysis-wait {
    margin-top: 8px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.analysis-wait.visible {
    opacity: 1;
    transform: translateY(0);
}

.wait-visual {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.wait-ring {
    height: 72px;
    position: relative;
    width: 72px;
}

.wait-ring-svg {
    display: block;
    height: 72px;
    transform: rotate(-90deg);
    width: 72px;
}

.wait-ring-bg,
.wait-ring-fg {
    fill: none;
    stroke-width: 5;
}

.wait-ring-bg {
    stroke: rgba(255, 255, 255, 0.08);
}

.wait-ring-fg {
    stroke: var(--neon-orange);
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.wait-ring-pct {
    color: var(--text-primary, #fff);
    font-size: 0.85rem;
    font-weight: 600;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}

.wait-title {
    font-size: 1.15rem;
    font-weight: 650;
    margin: 0 0 6px;
    text-align: center;
}

.wait-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 16px;
    text-align: center;
}

.wait-progress {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    height: 8px;
    margin: 0 0 8px;
    overflow: hidden;
    position: relative;
}

.wait-progress-fill {
    background: linear-gradient(90deg, #e85d2a, #ff8a4c 55%, #ffb347);
    border-radius: inherit;
    height: 100%;
    position: relative;
    transition: width 0.65s ease;
    width: 0%;
}

.wait-progress-fill::after {
    animation: wait-shimmer 1.6s linear infinite;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.35),
        transparent
    );
    content: "";
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 40%;
}

@keyframes wait-shimmer {
    from { transform: translateX(-120%); }
    to { transform: translateX(280%); }
}

.wait-steps li {
    animation: wait-step-in 0.45s ease both;
    animation-delay: calc(var(--step-i, 0) * 0.07s);
}

@keyframes wait-step-in {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.wait-tip {
    border-left: 2px solid rgba(232, 93, 42, 0.55);
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.4;
    margin: 12px 0 0;
    min-height: 2.8em;
    opacity: 0;
    padding-left: 12px;
    transition: opacity 0.3s ease;
}

.wait-tip.visible {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .analysis-wait,
    .wait-progress-fill,
    .wait-ring-fg,
    .wait-tip,
    .processing-steps li {
        transition: none !important;
    }

    .analysis-wait {
        opacity: 1;
        transform: none;
    }

    .processing-steps li.active .step-marker,
    .wait-progress-fill::after,
    .wait-steps li {
        animation: none !important;
    }

    .wait-steps li {
        opacity: 1;
        transform: none;
    }
}

.form-row {
    margin-bottom: 16px;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
}

.form-row textarea {
    min-height: 100px;
    resize: vertical;
    width: 100%;
}

.checkbox-row {
    align-items: center;
    display: flex;
    gap: 8px;
}

.meta-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.meta-list li {
    border-bottom: 1px solid var(--glass-border);
    padding: 6px 0;
}

.informe-ia-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Exo 2', monospace;
    font-size: 0.88rem;
    line-height: 1.6;
    max-height: 420px;
    overflow-y: auto;
    padding: 16px;
    white-space: pre-wrap;
}

.audit-form h4 {
    color: var(--neon-aqua);
}

.audit-form small {
    font-size: 0.8rem;
}

.gpu-status-banner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.gpu-status-banner .gpu-status-message {
    line-height: 1.5;
    margin: 0;
}

.button-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.button-row .cyber-button {
    flex: 0 0 auto;
    margin: 0;
}

.button-row.center {
    justify-content: center;
}

@media (max-width: 640px) {
    .button-row {
        gap: 10px;
        width: 100%;
    }

    .button-row .cyber-button {
        min-width: 140px;
    }
}
