/* EagleIV — Live Syringe Vision (USB webcam bench) */

.lv-intro-sub {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    max-width: 900px;
}

/* ---------------- Control bar ---------------- */

.lv-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    padding: 14px 18px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 10px;
}

.lv-ctl-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lv-ctl-spacer { flex: 1 1 auto; }

.lv-ctl-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a94a0;
}

.lv-select {
    min-width: 230px;
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    color: #333;
    background: #fff;
    border: 1px solid #d8dee5;
    border-radius: 6px;
}

.lv-select-sm { min-width: 128px; }

.lv-select:focus {
    outline: none;
    border-color: #00bfa5;
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.15);
}

.lv-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #445;
    background: #f2f5f7;
    border: 1px solid #d8dee5;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.lv-btn:hover:not(:disabled) { background: #e8edf1; color: #222; }

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

.lv-btn-primary {
    color: #fff;
    background: #00bfa5;
    border-color: #00bfa5;
}

.lv-btn-primary:hover:not(:disabled) { background: #00a892; border-color: #00a892; }

.lv-btn-outline {
    color: #00806e;
    background: #fff;
    border-color: #00bfa5;
}

.lv-btn-outline:hover:not(:disabled) { background: #e8f5f3; }

/* ---------------- Toggle strip ---------------- */

.lv-toggles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 10px 18px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 14px;
}

/* Feedback line for the Capture Frame button. The [hidden] rule has to be
   explicit: the UA stylesheet's `[hidden] { display: none }` loses to any
   class that sets `display`, so without it the bar shows up empty on load. */
.lv-capture-bar[hidden] { display: none; }

.lv-capture-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 18px;
    background: #f7f9fb;
    border: 1px solid #e0e0e0;
    border-left: 3px solid #00bfa5;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 12px;
}

.lv-capture-msg { color: #4a5560; }
.lv-capture-msg.lv-capture-err { color: #991b1b; }

.lv-capture-link {
    color: #00897b;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.lv-capture-link:hover { text-decoration: underline; }

.lv-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.lv-toggle input { accent-color: #00bfa5; cursor: pointer; }

.lv-toggle-sep {
    width: 1px;
    height: 20px;
    background: #e3e8ec;
}

.lv-inline-label { margin-left: 2px; }

.lv-range { width: 110px; accent-color: #00bfa5; }

.lv-range-val {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    color: #333;
    min-width: 30px;
}

/* ---------------- Banner ---------------- */

.lv-banner {
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 14px;
    border-left: 3px solid;
}

.lv-banner-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.lv-banner-warn {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.lv-banner-info {
    background: #f0fdfa;
    border-color: #00bfa5;
    color: #0f766e;
}

/* ---------------- Main layout ---------------- */

.lv-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 16px;
    align-items: start;
}

@media (max-width: 1180px) {
    .lv-main { grid-template-columns: minmax(0, 1fr); }
}

.lv-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0b1418;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #0b1418;
}

.lv-stage video,
.lv-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.lv-stage video { object-fit: contain; background: #0b1418; }

.lv-stage canvas { pointer-events: none; }

.lv-stage-idle {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 24px;
    color: #7f929b;
    background: #0b1418;
}

.lv-stage-idle-icon { font-size: 30px; color: #2a3f47; }

.lv-stage-idle-title {
    font-size: 15px;
    font-weight: 600;
    color: #c6d4da;
}

.lv-stage-idle-text {
    font-size: 12.5px;
    line-height: 1.6;
    max-width: 420px;
}

.lv-stage-idle-text strong { color: #5eead4; }

/* HUD */

.lv-hud {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.lv-hud.on { opacity: 1; }

.lv-hud-item {
    padding: 3px 8px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 10.5px;
    color: #b8ccd4;
    background: rgba(6, 18, 23, 0.72);
    border: 1px solid rgba(94, 234, 212, 0.22);
    border-radius: 4px;
}

.lv-hud-item b { color: #5eead4; font-weight: 600; }

.lv-hud-device { text-transform: uppercase; letter-spacing: 0.06em; color: #5eead4; }

/* ---------------- Side panel ---------------- */

.lv-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lv-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 18px;
}

.lv-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #6b7680;
    margin-bottom: 12px;
}

.lv-count {
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    color: #00806e;
    background: #e8f5f3;
    border-radius: 10px;
}

.lv-card-volume { border-top: 3px solid #00bfa5; }

.lv-vol-readout {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
}

.lv-vol-value {
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    color: #1f2d33;
    font-variant-numeric: tabular-nums;
}

/* An uncalibrated read is shown, but must not look like a measurement. */
.lv-vol-value.lv-vol-uncal {
    color: #9aa4ae;
    text-decoration: underline dotted #cbd5dd 2px;
    text-underline-offset: 6px;
}

.lv-vol-unit { font-size: 16px; font-weight: 600; color: #6b7680; }

.lv-vol-cap { margin-left: auto; font-size: 12px; color: #8a94a0; }

.lv-vol-bar {
    height: 9px;
    background: #eef2f4;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 14px;
}

.lv-vol-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #00bfa5, #38e1ff);
    border-radius: 5px;
    transition: width 0.18s ease-out;
}

.lv-vol-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
}

.lv-meta-item { display: flex; flex-direction: column; gap: 3px; }

.lv-meta-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9aa4ae;
}

.lv-meta-value {
    font-size: 13.5px;
    font-weight: 600;
    color: #333;
    font-variant-numeric: tabular-nums;
}

.lv-chip {
    align-self: flex-start;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: 10px;
}

.lv-chip-high { color: #065f46; background: #d1fae5; }
.lv-chip-medium { color: #92400e; background: #fef3c7; }
.lv-chip-low { color: #7f1d1d; background: #fee2e2; }
.lv-chip-idle { color: #475569; background: #e2e8f0; }
.lv-chip-drawing { color: #075985; background: #dbeafe; }
.lv-chip-injecting { color: #7c2d12; background: #ffedd5; }

.lv-vol-note {
    margin-top: 12px;
    font-size: 11.5px;
    line-height: 1.55;
    color: #8a94a0;
    min-height: 16px;
}

.lv-precise {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eef2f4;
}

.lv-precise-hint { font-size: 11px; color: #9aa4ae; line-height: 1.5; }

.lv-precise-result {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f7f9fb;
    border-left: 3px solid #00bfa5;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.6;
    color: #445;
}

.lv-precise-result .lv-pr-value {
    font-size: 20px;
    font-weight: 700;
    color: #1f2d33;
    font-variant-numeric: tabular-nums;
}

.lv-precise-result.lv-pr-error { border-color: #ef4444; color: #991b1b; }

/* ---------------- Lists ---------------- */

.lv-track-list,
.lv-hand-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
}

.lv-track-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #fafbfc;
    font-size: 12.5px;
}

.lv-track-swatch {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    flex: 0 0 auto;
}

.lv-track-label { font-weight: 600; color: #333; }

.lv-track-id {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 11px;
    color: #8a94a0;
}

.lv-track-conf {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    font-size: 11.5px;
    color: #6b7680;
}

.lv-track-stale { color: #b45309; font-size: 10.5px; }

.lv-hand-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #fafbfc;
    font-size: 12.5px;
    color: #333;
}

.lv-hand-row b { color: #1f2d33; }

.lv-contact {
    margin-left: auto;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #075985;
    background: #dbeafe;
    border-radius: 10px;
}

.lv-empty {
    padding: 10px 2px;
    font-size: 12px;
    color: #9aa4ae;
    font-style: italic;
}


/* -- Captured labels ---------------------------------------------------- */

.lv-btn-mini {
    padding: 2px 8px;
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 5px;
    border: 1px solid #d3dade;
    background: #fff;
    color: #55636d;
    cursor: pointer;
}

.lv-btn-mini:hover { background: #f1f5f7; }

.lv-label-note {
    padding: 7px 9px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 11.5px;
    line-height: 1.45;
}

.lv-label-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
}

.lv-label-row {
    display: flex;
    gap: 9px;
    padding: 8px;
    border-radius: 7px;
    background: #fafbfc;
    border: 1px solid #eef1f3;
    border-left: 3px solid #cbd5e1;
}

.lv-label-row.lv-l-done    { border-left-color: #10b981; }
.lv-label-row.lv-l-reading { border-left-color: #38bdf8; }
.lv-label-row.lv-l-error   { border-left-color: #ef4444; }

/* Fixed box so a tall vial crop and a wide order label line up the same. */
.lv-lthumb {
    width: 74px;
    height: 74px;
    flex: 0 0 74px;
    object-fit: cover;
    border-radius: 5px;
    background: #e7ebee;
    border: 1px solid #dfe4e8;
}

.lv-lbody { flex: 1 1 auto; min-width: 0; }

.lv-lhead {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #1f2d33;
    margin-bottom: 5px;
    text-transform: capitalize;
}

.lv-lconf {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.lv-lconf-high   { background: #dcfce7; color: #166534; }
.lv-lconf-medium { background: #fef3c7; color: #92400e; }
.lv-lconf-low    { background: #fee2e2; color: #991b1b; }

.lv-lf {
    display: flex;
    gap: 8px;
    font-size: 11.5px;
    line-height: 1.5;
}

.lv-lf > span {
    flex: 0 0 84px;
    color: #7b858e;
    text-transform: capitalize;
}

.lv-lf > b {
    color: #1f2d33;
    word-break: break-word;
    font-weight: 600;
}

/* "not legible" is a real answer from the reader, not a missing value —
   styled as absence so it can never be mistaken for transcribed text. */
.lv-null {
    color: #a3adb5;
    font-weight: 400;
    font-style: italic;
}

.lv-lf-none, .lv-lnote {
    font-size: 11.5px;
    color: #8a949d;
    font-style: italic;
}

.lv-lnote { margin-top: 4px; line-height: 1.45; }

.lv-lerr {
    font-size: 11.5px;
    color: #b91c1c;
    margin-bottom: 5px;
    word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Presentation gate — whether the volume read is armed, and if not, why
   ═══════════════════════════════════════════════════════════════════════════ */

.lv-gate {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.45);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.lv-gate.is-armed,
.lv-gate.is-releasing {
    border-color: rgba(94, 234, 212, 0.6);
    background: rgba(45, 212, 191, 0.12);
}

.lv-gate.is-arming {
    border-color: rgba(250, 204, 21, 0.55);
    background: rgba(250, 204, 21, 0.1);
}

.lv-gate.is-off {
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(248, 113, 113, 0.1);
}

.lv-gate-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.lv-gate-state {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #94a3b8;
}

.lv-gate.is-armed .lv-gate-state,
.lv-gate.is-releasing .lv-gate-state { color: #5eead4; }
.lv-gate.is-arming .lv-gate-state    { color: #facc15; }
.lv-gate.is-off .lv-gate-state       { color: #f87171; }

.lv-gate-conds {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.lv-gate-cond {
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(148, 163, 184, 0.16);
    color: #94a3b8;
    white-space: nowrap;
}

.lv-gate-cond.is-met {
    background: rgba(45, 212, 191, 0.2);
    color: #5eead4;
}

.lv-gate-bar {
    height: 3px;
    margin: 7px 0 6px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.lv-gate-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    background: linear-gradient(90deg, #facc15, #5eead4);
    transition: width 0.15s linear;
}

.lv-gate-hint {
    font-size: 11px;
    line-height: 1.45;
    color: #94a3b8;
}
