/**
 * Ophthalmology visual workstation — presentation layer.
 */

.pf-oph-workflow {
    --pf-oph-accent: #0d9488;
    --pf-oph-radius: 12px;
    --pf-oph-good: #059669;
    --pf-oph-warn: #d97706;
    --pf-oph-danger: #dc2626;
}

.pf-oph-hero {
    background: linear-gradient(135deg, #f0fdfa 0%, #fff 48%, #eff6ff 100%);
    border: 1px solid #e2e8f0;
    border-radius: var(--pf-oph-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.pf-oph-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pf-oph-hero-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.pf-oph-hero-zones {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .pf-oph-hero-zones {
        grid-template-columns: repeat(6, 1fr);
    }
}

.pf-oph-hero-zone {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.35rem 0.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.pf-oph-hero-zone:hover,
.pf-oph-hero-zone.is-active {
    border-color: var(--pf-oph-accent);
    background: #f0fdfa;
    color: #0f766e;
}

.pf-oph-timeline {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    margin-bottom: 0.75rem;
}

.pf-oph-timeline-card {
    flex: 0 0 auto;
    min-width: 140px;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.72rem;
}

.pf-oph-timeline-card strong {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.pf-oph-visual-block {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--pf-oph-radius);
    padding: 0.75rem;
    margin-bottom: 0.65rem;
}

.pf-oph-visual-block h6 {
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.5rem;
}

.pf-oph-acuity-layout {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 992px) {
    .pf-oph-acuity-layout {
        grid-template-columns: 1fr 1.2fr;
        align-items: start;
    }
}

.pf-oph-art-face-wrap {
    max-width: 320px;
    margin: 0 auto;
}

.pf-oph-art {
    width: 100%;
    height: auto;
    display: block;
}

.pf-oph-svg-label,
.pf-oph-svg-caption {
    font-size: 11px;
    fill: #475569;
    font-family: system-ui, sans-serif;
    font-weight: 600;
}

.pf-oph-va-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.pf-oph-va-eye-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.5rem;
    background: #fafafa;
}

.pf-oph-va-eye-card .pf-oph-va-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--pf-oph-accent);
    margin-bottom: 0.25rem;
}

.pf-oph-va-current {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 0.35rem;
}

.pf-oph-va-trend {
    font-size: 0.65rem;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.pf-oph-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.pf-oph-chip {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.28rem 0.45rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    min-height: 36px;
    min-width: 44px;
}

.pf-oph-chip:hover {
    border-color: var(--pf-oph-accent);
}

.pf-oph-chip.is-selected {
    background: #0d9488;
    border-color: #0d9488;
    color: #fff;
}

.pf-oph-iop-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.pf-oph-iop-card {
    text-align: center;
    padding: 0.65rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.pf-oph-iop-gauge {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    margin: 0.35rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    border: 4px solid var(--pf-oph-good);
    background: #fff;
}

.pf-oph-iop-card.is-warn .pf-oph-iop-gauge {
    border-color: var(--pf-oph-warn);
}

.pf-oph-iop-card.is-high .pf-oph-iop-gauge {
    border-color: var(--pf-oph-danger);
    color: var(--pf-oph-danger);
}

.pf-oph-iop-meta {
    font-size: 0.68rem;
    color: #64748b;
}

.pf-oph-refraction-wrap {
    display: grid;
    gap: 0.75rem;
}

.pf-oph-rx-hero-glasses {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .pf-oph-refraction-wrap {
        grid-template-columns: 1fr 1fr;
    }
}

.pf-oph-rx-lens-panel {
    position: relative;
    padding: 0.5rem;
}

.pf-oph-rx-overlay {
    position: absolute;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #0f172a;
    pointer-events: none;
    line-height: 1.25;
}

.pf-oph-rx-overlay.od {
    left: 8%;
    top: 38%;
    width: 42%;
}

.pf-oph-rx-overlay.os {
    right: 8%;
    top: 38%;
    width: 42%;
}

.pf-oph-rx-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.pf-oph-rx-inputs label {
    font-size: 0.62rem;
    color: #64748b;
    margin-bottom: 0.1rem;
}

.pf-oph-rx-inputs input {
    font-size: 0.8rem;
    padding: 0.2rem 0.35rem;
    min-height: 32px;
}

.pf-oph-zone,
.pf-oph-fundus-zone {
    cursor: pointer;
    transition: opacity 0.15s, filter 0.15s;
}

.pf-oph-zone.is-marked,
.pf-oph-fundus-zone.is-marked {
    filter: drop-shadow(0 0 4px rgba(220, 38, 38, 0.6));
}

.pf-oph-zone.is-selected,
.pf-oph-fundus-zone.is-selected {
    stroke-width: 3;
    filter: drop-shadow(0 0 6px rgba(13, 148, 136, 0.8));
}

.pf-oph-status-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.pf-oph-cataract-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 576px) {
    .pf-oph-cataract-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.pf-oph-cataract-opt {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.35rem;
    cursor: pointer;
    text-align: center;
    background: #fff;
}

.pf-oph-cataract-opt.is-selected {
    border-color: var(--pf-oph-accent);
    background: #f0fdfa;
}

.pf-oph-cataract-opt svg {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.25rem;
}

.pf-oph-cataract-opt span {
    font-size: 0.65rem;
    font-weight: 600;
    color: #334155;
}

.pf-oph-dr-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
}

@media (min-width: 768px) {
    .pf-oph-dr-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

.pf-oph-dr-opt {
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    padding: 0.4rem;
    cursor: pointer;
    min-height: 72px;
    background: linear-gradient(180deg, #fecaca 0%, #991b1b 100%);
    opacity: 0.35;
    font-size: 0.62rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.pf-oph-dr-opt:nth-child(1) { opacity: 0.2; background: linear-gradient(180deg, #fecaca, #f87171); }
.pf-oph-dr-opt:nth-child(2) { opacity: 0.45; }
.pf-oph-dr-opt:nth-child(3) { opacity: 0.6; }
.pf-oph-dr-opt:nth-child(4) { opacity: 0.8; }
.pf-oph-dr-opt:nth-child(5) { opacity: 1; }

.pf-oph-dr-opt.is-selected {
    border-color: #0f172a;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pf-oph-accent);
}

.pf-oph-cdr-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.pf-oph-disc-wrap {
    text-align: center;
}

.pf-oph-disc-wrap svg {
    max-width: 120px;
    margin: 0 auto;
}

.pf-oph-cdr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 0.35rem;
}

.pf-oph-glaucoma-dash {
    display: grid;
    gap: 0.5rem;
}

@media (min-width: 992px) {
    .pf-oph-glaucoma-dash {
        grid-template-columns: 1fr 1fr;
    }
}

.pf-oph-glaucoma-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
}

.pf-oph-metric-pill {
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    background: #f1f5f9;
    font-size: 0.72rem;
}

.pf-oph-metric-pill strong {
    display: block;
    font-size: 0.95rem;
    color: #0f172a;
}

.pf-oph-field-shelf {
    margin-top: 0.5rem;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
}

.pf-oph-field-shelf summary {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
}

.pf-oph-legacy-fields {
    padding-top: 0.5rem;
}

.pf-oph-vf-mark {
    fill: rgba(220, 38, 38, 0.55);
    cursor: pointer;
}

.pf-oph-ed-modal .pf-oph-ed-slide {
    text-align: center;
    padding: 1rem;
}

.pf-oph-ed-modal .pf-oph-ed-slide svg {
    max-width: 200px;
    margin: 0 auto 0.75rem;
}

.pf-oph-ed-modal h6 {
    font-weight: 700;
    color: #0f172a;
}

.pf-oph-ed-modal p {
    font-size: 0.85rem;
    color: #475569;
}
