.legacy-compat-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  padding: 10px 16px;
  background: #e8f4fc;
  border-bottom: 1px solid #b6d9f0;
  font-size: 0.875rem;
  color: #1e3a5f;
}
.legacy-compat-banner.hidden { display: none; }
.legacy-compat-links a { color: #1a5fb4; font-weight: 600; }

.cl-box-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px 0;
}
.cl-box-preview.hidden { display: none; }
.cl-box-preview img {
  max-height: 64px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.cl-box-preview #cl-box-caption {
  font-size: 0.9rem;
  color: #555;
}

/* Inline image inside brand/model dropdown options */
.simple-dropdown.model-dropdown .dropdown-option,
.simple-dropdown.brand-dropdown .dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cl-mini-box {
  flex: 0 0 auto;
  height: 18px;
  width: 28px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.cl-brand-logo {
  flex: 0 0 auto;
  height: 18px;
  width: auto;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  object-fit: cover;
}
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background: #0f172a;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-weight: 400;
}

body.ocr-busy {
    overflow: hidden;
    touch-action: none;
}

/* Modal overlay (verify nudges) */
.modal-overlay{
    position: fixed;
    inset: 0;
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(2, 6, 23, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.modal-card{
    width: min(520px, 94vw);
    border-radius: 18px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 20px 60px rgba(0,0,0,0.55);
}
.modal-title{
    font-size: 16px;
    font-weight: 850;
    letter-spacing: -0.02em;
    color: #fff;
}
.modal-body{
    margin-top: 8px;
    color: rgba(226,232,240,0.85);
    font-size: 13px;
    line-height: 1.5;
}
.modal-check{
    margin-top: 12px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148,163,184,0.14);
    background: rgba(2,6,23,0.25);
}
.modal-check input{
    margin-top: 2px;
}
.modal-actions{
    margin-top: 14px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Info buttons (terminology help) */
.section-title{
    position: relative;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    padding-right: 26px; /* reserve space so icon never wraps */
}
.section-title .info-btn{
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-52%);
}
.info-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.14);
    background: rgba(2,6,23,0.10);
    color: rgba(148,163,184,0.95);
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, opacity 160ms ease;
}
.info-btn:hover{
    opacity: 1;
    border-color: rgba(148,163,184,0.28);
    background: rgba(2,6,23,0.18);
}
.info-btn:active{
    transform: translateY(1px);
}
.info-btn-inline{
    width: 16px;
    height: 16px;
    font-size: 11px;
    margin-left: 6px;
    vertical-align: middle;
}

/* Inline icons inside labels/eye-label cells should never force a new line */
.form-group label .info-btn,
.eye-label .info-btn{
    display: inline-flex;
    position: static;
    transform: none;
    padding: 0;
}
.btn.btn-ghost{
    background: rgba(2,6,23,0.12);
    border: 1px solid rgba(148,163,184,0.18);
    color: rgba(226,232,240,0.92);
}
.btn.btn-ghost:hover{
    border-color: rgba(99,102,241,0.5);
}
.btn[disabled]{
    opacity: 0.55;
    cursor: not-allowed;
}

/* Verified badge/icon on prescription cards */
.rx-verified-badge{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(34,197,94,0.25);
    background: rgba(34,197,94,0.10);
    color: rgba(226,232,240,0.95);
    font-size: 12px;
    font-weight: 800;
    margin-left: auto;
}
.rx-verified-badge svg{
    width: 14px;
    height: 14px;
    color: rgba(34,197,94,0.95);
}
.rx-unverified-dot{
    margin-left: auto;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(251,191,36,0.95);
    box-shadow: 0 0 0 3px rgba(251,191,36,0.15);
}

/* Verify UX helpers */
.rx-verify-details{
    margin: 10px 0 6px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(148, 163, 184, 0.14);
}
.rx-verify-meta{
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: rgba(226, 232, 240, 0.92);
    font-size: 13px;
    margin-bottom: 10px;
}
.rx-verify-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.rx-verify-col{
    padding: 10px;
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: rgba(226, 232, 240, 0.92);
    font-size: 13px;
    line-height: 1.35;
}
.rx-verify-eye{
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    margin-bottom: 6px;
}
.prescription-card.rx-highlight{
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.38), 0 12px 35px rgba(0,0,0,0.35);
    transform: translateY(-1px);
}

.rx-verify-image-wrap{
    margin: 8px 0 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.25);
}
.rx-verify-image{
    display: block;
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    background: rgba(2, 6, 23, 0.45);
}
.rx-verify-image-placeholder{
    padding: 18px 12px;
    text-align: center;
    color: rgba(226, 232, 240, 0.72);
    font-size: 13px;
}

.ocr-busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 20px;
}

.ocr-busy-card {
    width: min(520px, 92vw);
    border-radius: 16px;
    padding: 18px 18px 16px 18px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
    text-align: center;
}

.ocr-busy-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(226, 232, 240, 0.25);
    border-top: 3px solid rgba(99, 102, 241, 0.95);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 4px auto 12px auto;
}

.ocr-busy-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #e2e8f0;
}

.ocr-busy-sub {
    margin-top: 6px;
    font-size: 13px;
    color: rgba(226, 232, 240, 0.78);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: #ffffff;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* "More" expandable panel (glasses-only) */
.more-toggle{
    width: 100%;
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 14px;
    margin-top: 10px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.25);
    color: rgba(226,232,240,0.92);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.more-toggle:hover{
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(2, 6, 23, 0.34);
}

.more-toggle:active{
    transform: translateY(1px);
}

.more-toggle-label{
    font-weight: 800;
    letter-spacing: -0.02em;
}

.more-toggle-sub{
    font-size: 12px;
    font-weight: 650;
    color: rgba(148,163,184,0.9);
}

.more-toggle-caret{
    margin-left: auto;
    font-size: 14px;
    color: rgba(148,163,184,0.95);
    transition: transform 160ms ease;
}

.more-toggle[aria-expanded="true"] .more-toggle-caret{
    transform: rotate(180deg);
}

.more-panel{
    margin-top: 10px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.55);
    overflow: visible;
}

.more-panel-inner{
    padding: 14px;
}

.more-section-title{
    font-weight: 850;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 10px;
}

.prism-grid{
    display: grid;
    grid-template-columns: 140px 1fr 1fr;
    gap: 10px 12px;
    align-items: center;
    overflow: visible;
}

.prism-head{
    font-size: 12px;
    font-weight: 800;
    color: rgba(148,163,184,0.9);
}
.prism-eye{
    text-align: left;
}

.prism-subtitle{
    font-size: 12px;
    font-weight: 900;
    letter-spacing: -0.01em;
    color: rgba(226,232,240,0.92);
    padding-top: 6px;
}
.prism-subtitle-spacer{
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.prism-label{
    font-size: 13px;
    font-weight: 750;
    color: rgba(226,232,240,0.85);
}

@media (max-width: 768px){
    .prism-grid{
        grid-template-columns: 1fr 1fr;
    }
    .prism-grid .prism-head:first-child{ display:none; }
    .prism-label{
        grid-column: 1 / -1;
        margin-top: 6px;
        color: rgba(148,163,184,0.9);
    }
}

/* PD (Pupillary Distance) controls */
.pd-inline{
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.pd-input{
    min-width: 0;
}

.pd-mode-toggle {
    display: inline-flex;
    gap: 0;
    margin: 0;
    padding: 4px;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.pd-mode-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    color: rgba(226, 232, 240, 0.82);
    font-size: 13px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.form-group .pd-mode-option{
    /* Override .form-group label default block styling */
    display: inline-flex;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.pd-mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pd-mode-option.is-active {
    background: rgba(99, 102, 241, 0.22);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}

.pd-select {
    width: 100%;
    min-width: 0;
}

.pd-inline .enhanced-select select.pd-select {
    /* Match app input theme (like Vertex Distance) */
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.pd-inline .enhanced-select select.pd-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.pd-dual-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pd-dual-inline{
    display: flex;
    align-items: center;
    gap: 10px;
}

.pd-dual-label {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.7);
    margin: 0;
    min-width: 26px;
    text-align: left;
    font-weight: 700;
    letter-spacing: -0.01em;
}

@media (max-width: 768px) {
    .pd-inline{
        grid-template-columns: 1fr;
    }
    .pd-mode-toggle{
        justify-self: start;
    }
}

/* Auth Container - GatherSet Style */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #0f172a; /* Dark blue background like GatherSet */
    position: relative;
    overflow: hidden;
}

/* Grid lines removed for cleaner look */

/* Main title section at the top like GatherSet */
.main-title-section {
    text-align: center;
    margin-bottom: 32px;
    max-width: 480px;
}

.main-title {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
    text-transform: none; /* Changed from uppercase to normal case */
}

.secure-portal-title {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    margin: 0;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Grid lines completely removed for clean background */

.auth-card {
    background: rgba(30, 41, 59, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
}

.auth-header {
    margin-bottom: 24px;
    text-align: center;
}

.auth-form {
    text-align: center;
}

.auth-form h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #ffffff;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #e2e8f0;
    font-size: 14px;
}

.form-group label .info-btn-inline{
    margin-left: 6px;
    transform: translateY(-1px);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    font-weight: 400;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: #f8fafc;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    color: #94a3b8;
}

.auth-switch a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-switch a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.registration-disabled-message {
    margin: 0 0 8px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.08);
    color: #fde68a;
    font-size: 15px;
    line-height: 1.55;
    text-align: left;
}

/* Security Statement - GatherSet Style */
.security-statement {
    margin-top: 24px;
    padding: 16px;
    background: transparent;
    border: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.secure-connection {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #10b981;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pulse-circle {
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Main App - Modern Clean Theme */
.main-app {
    min-height: 100vh;
    background: #0f172a;
    color: #ffffff;
}

.app-header {
    background: rgba(30, 41, 59, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    font-weight: 500;
    color: #e2e8f0;
    padding: 8px 16px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.app-nav {
    background: rgba(30, 41, 59, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 16px 0;
    /* Desktop: make this bar feel integrated, not "boxed" */
}

/* Inner nav container: keeps content aligned while bar spans full width */
.app-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    gap: 8px;
}

@media (min-width: 769px) {
    .app-nav {
        border-bottom-left-radius: 22px;
        border-bottom-right-radius: 22px;
        margin-left: 18px;
        margin-right: 18px;
        /* Helps rounding show on very wide screens */
        overflow: hidden;
    }
}

.nav-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.nav-btn:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
}

.nav-btn.active {
    background: rgba(148, 163, 184, 0.2);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.2);
}

.app-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 32px;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

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

.view-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dashboard - Modern Dark Theme */
.dashboard-header {
    text-align: center;
    margin-bottom: 60px;
}

.dashboard-header h2 {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
    letter-spacing: -0.025em;
}

.dashboard-header p {
    color: #94a3b8;
    font-size: 18px;
    font-weight: 400;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

.stat-card {
    background: rgba(30, 41, 59, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(148, 163, 184, 0.3);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(148, 163, 184, 0.4);
}

.stat-icon {
    font-size: 32px;
    width: 64px;
    height: 64px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    box-shadow: 0 8px 20px rgba(148, 163, 184, 0.2);
}

.stat-content h3 {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
}

.stat-content p {
    color: #94a3b8;
    font-size: 16px;
    font-weight: 500;
}

.quick-actions {
    background: rgba(30, 41, 59, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.quick-actions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(148, 163, 184, 0.3);
}

/* Dashboard v2: single hero block */
.dashboard-hero {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 22px;
    padding: 26px;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    overflow: hidden;
    position: relative;
}
.dashboard-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(800px 320px at 12% 0%, rgba(139, 92, 246, 0.16), transparent 55%),
        radial-gradient(700px 280px at 88% 10%, rgba(59, 130, 246, 0.14), transparent 60%);
    pointer-events: none;
}
.dashboard-hero > * { position: relative; }

.dashboard-kicker {
    color: rgba(148, 163, 184, 0.95);
    font-size: 12px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.dashboard-hero-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.dashboard-hero-top h2 {
    font-size: 34px;
    font-weight: 850;
    color: #ffffff;
    margin: 0 0 8px 0;
    letter-spacing: -0.03em;
}
.dashboard-hero-top p {
    margin: 0;
    color: #94a3b8;
    font-size: 15px;
}
.dashboard-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.dashboard-hero-actions .btn {
    min-width: auto;
    padding: 10px 14px;
    border-radius: 12px;
}

.dashboard-hero-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}
.dash-metric {
    background: rgba(2, 6, 23, 0.40);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    padding: 16px;
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
}
.dash-icon {
    grid-row: 1 / span 2;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(148,163,184,0.14);
    font-size: 20px;
}
.dash-num {
    font-size: 30px;
    font-weight: 900;
    line-height: 1.0;
    color: #ffffff;
}
.dash-label {
    color: rgba(148,163,184,0.95);
    font-size: 13px;
    font-weight: 650;
}
.dash-sub {
    color: rgba(148,163,184,0.9);
    font-size: 12px;
    margin-top: 2px;
}
.dash-metric-total .dash-icon {
    background: rgba(59,130,246,0.12);
    border-color: rgba(59,130,246,0.18);
}

.dashboard-hero-bar {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.dash-bar {
    flex: 1 1 420px;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(148,163,184,0.12);
    display: flex;
}
.dash-bar-seg {
    height: 100%;
}
.dash-bar-seg.seg-glasses {
    background: linear-gradient(135deg, rgba(59,130,246,0.95), rgba(99,102,241,0.85));
}
.dash-bar-seg.seg-contacts {
    background: linear-gradient(135deg, rgba(139,92,246,0.92), rgba(168,85,247,0.82));
}
.dash-legend {
    display: flex;
    gap: 14px;
    color: rgba(226,232,240,0.85);
    font-size: 12px;
    font-weight: 650;
}
.dash-legend .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    margin-right: 6px;
}
.dash-legend .dot-glasses { background: rgba(59,130,246,0.95); }
.dash-legend .dot-contacts { background: rgba(139,92,246,0.92); }

@media (max-width: 768px) {
    .dashboard-hero {
        padding: 18px 16px;
        border-radius: 18px;
    }
    .dashboard-hero-top h2 {
        font-size: 22px;
    }
    .dashboard-hero-actions {
        width: 100%;
    }
    .dashboard-hero-actions .btn {
        flex: 1;
        min-width: 0;
    }
    .dashboard-hero-metrics {
        grid-template-columns: 1fr 1fr;
    }
    .dash-metric-total {
        grid-column: 1 / -1;
    }
}

/* Welcome dashboard (inspired by "2 card" layout) */
.welcome {
    max-width: 1100px;
    margin: 0 auto;
}
.welcome-head h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 850;
    letter-spacing: -0.03em;
    color: #fff;
}
.welcome-head p {
    margin: 10px 0 0 0;
    color: rgba(148, 163, 184, 0.9);
    font-size: 14px;
}
.welcome-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 18px;
}
.welcome-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    padding: 18px;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    position: relative;
    overflow: hidden;
}
.welcome-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(900px 360px at 15% 10%, rgba(59, 130, 246, 0.10), transparent 55%),
        radial-gradient(700px 300px at 85% 30%, rgba(139, 92, 246, 0.10), transparent 60%);
    pointer-events: none;
}
.welcome-card > * { position: relative; }
.welcome-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.welcome-title {
    font-size: 12px;
    letter-spacing: 0.12em;
    color: rgba(148, 163, 184, 0.95);
    text-transform: uppercase;
    font-weight: 750;
}
.welcome-pill {
    font-size: 12px;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(2, 6, 23, 0.35);
    color: rgba(226, 232, 240, 0.92);
    white-space: nowrap;
}
.welcome-pill.pill-good {
    border-color: rgba(34,197,94,0.25);
    color: rgba(187, 247, 208, 0.95);
    background: rgba(34,197,94,0.10);
}
.welcome-pill.pill-bad {
    border-color: rgba(239,68,68,0.24);
    color: rgba(254, 202, 202, 0.95);
    background: rgba(239,68,68,0.10);
}
.welcome-card-mid {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}
.welcome-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}
.welcome-key {
    color: rgba(148, 163, 184, 0.9);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}
.welcome-val {
    color: rgba(226, 232, 240, 0.92);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.welcome-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.welcome-actions .btn {
    padding: 10px 14px;
    border-radius: 12px;
    min-width: 0;
}
.welcome-link {
    color: rgba(148, 163, 184, 0.95);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}
.welcome-link:hover { text-decoration: underline; }

.welcome-foot {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: rgba(148, 163, 184, 0.9);
    font-size: 12px;
}
.welcome-foot-link {
    color: rgba(148, 163, 184, 0.95);
    font-weight: 700;
    text-decoration: none;
}
.welcome-foot-link:hover { text-decoration: underline; }
.welcome-foot-meta { color: rgba(148, 163, 184, 0.9); }

@media (max-width: 768px) {
    .welcome-head h2 { font-size: 20px; }
    .welcome-grid { grid-template-columns: 1fr; }
    .welcome-actions { flex-wrap: wrap; }
    .welcome-actions .btn { width: 100%; }
}

/* Site footer (App + Auth) */
.site-footer {
    margin-top: 28px;
    padding: 18px 0;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    color: rgba(148, 163, 184, 0.92);
    font-size: 12px;
}
.site-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px 18px;
    flex-wrap: wrap;
}
.site-footer-copy {
    font-weight: 650;
    color: rgba(148, 163, 184, 0.95);
}
.site-footer-links {
    display: flex;
    gap: 10px 16px;
    flex-wrap: wrap;
    align-items: center;
}
.site-footer-links a {
    color: rgba(148, 163, 184, 0.92);
    text-decoration: none;
    font-weight: 650;
}
.site-footer-links a:hover {
    color: rgba(226, 232, 240, 0.92);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 16px 0 calc(16px + env(safe-area-inset-bottom));
    }
    .site-footer-inner {
        padding: 0 16px;
    }
    /* On mobile, footer is inside app-content which already has bottom padding for the fixed tab bar. */
}

.quick-actions h3 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 24px;
}

.action-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Filters */
.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 12px 20px;
    border: 1px solid #374151;
    border-radius: 12px;
    font-size: 14px;
    background: rgba(31, 41, 55, 0.8);
    color: #ffffff;
    min-width: 180px;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Prescriptions List */
.prescriptions-list {
    display: grid;
    gap: 24px;
}

.prescription-card {
    background: rgba(26, 26, 46, 0.8);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 20px;
    padding: 32px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.prescription-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(148, 163, 184, 0.3);
}

.prescription-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(148, 163, 184, 0.4);
}

.prescription-card.is-expired {
    opacity: 0.55;
    filter: grayscale(0.85);
    border-color: rgba(148, 163, 184, 0.18);
}

.prescription-card.is-expired:hover {
    transform: none;
    box-shadow: none;
}

.prescription-card.is-expired .btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.prescription-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.prescription-meta{
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    text-align: right;
}

.prescription-type {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prescription-type.glasses {
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}

.prescription-type.contact_lens {
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}

.prescription-expiry {
    display: none; /* shown on mobile */
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-left: 10px;
}

.prescription-expiry.is-expired {
    color: #ef4444;
    font-weight: 800;
}

.expired-text {
    color: #ef4444;
    font-weight: 800;
}

.prescription-date {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    margin-left: auto;
}

.prescription-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0; /* allow children to ellipsize in grid/flex */
}

.detail-label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    min-width: 0; /* allow ellipsis */
}

/* Rx summary: keep OD/OS to 2 single-line rows */
.rx-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
}
.rx-line {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    min-width: 0;
    padding-right: 10px; /* ensure ellipsis appears before card edge */
}

.prescription-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    min-width: auto;
    border-radius: 8px;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* Prescription Form - Modern Dark Theme */
.prescription-form {
    background: rgba(30, 41, 59, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 40px;
    position: relative;
    overflow: visible;
}

.prescription-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(148, 163, 184, 0.3);
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Desktop: avoid double dividers above form actions (doctor section is last logical section) */
#prescribing-doctor-section {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 24px;
}

.form-actions {
    display: flex;
    gap: 20px;
    justify-content: flex-end;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

/* OCR Upload Section */
.ocr-upload-section {
    background: rgba(30, 41, 59, 0.5);
    border: 2px dashed rgba(148, 163, 184, 0.4);
    border-radius: 20px;
    padding: 48px;
    text-align: center;
    margin-bottom: 40px;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.ocr-upload-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(148, 163, 184, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ocr-upload-section:hover::before {
    opacity: 1;
}

.ocr-upload-section:hover {
    border-color: #94a3b8;
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
}

.ocr-upload-section.dragover {
    border-color: #94a3b8;
    background: rgba(30, 41, 59, 0.8);
}

.upload-icon {
    font-size: 64px;
    color: #94a3b8;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(148, 163, 184, 0.3));
}

.upload-text h4 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.upload-text p {
    color: #a1a1aa;
    font-size: 16px;
    margin-bottom: 24px;
}

.file-input {
    /* Keep input accessible for iOS/Safari; labels won't trigger if display:none */
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    border: 0;
    padding: 0;
    margin: 0;
}

.upload-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.upload-btn-wrap {
    position: relative;
    display: inline-block;
}

/* OCR review highlighting */
.ocr-classification-banner{
    margin: 12px 0 6px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(96, 165, 250, 0.22);
    background: rgba(59, 130, 246, 0.10);
    color: rgba(219, 234, 254, 0.95);
    font-size: 13px;
    font-weight: 600;
}
.ocr-review-banner{
    margin: 12px 0 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(251, 191, 36, 0.22);
    background: rgba(251, 191, 36, 0.10);
    color: rgba(254, 243, 199, 0.95);
    font-size: 13px;
    font-weight: 650;
}
.needs-review{
    outline: 2px solid rgba(251, 191, 36, 0.55);
    outline-offset: 2px;
    border-radius: 14px;
}
.needs-review input,
.needs-review select{
    border-color: rgba(251, 191, 36, 0.6) !important;
}

.upload-btn-wrap .file-input {
    /* Ensure the input remains clickable overlay for Chrome quirks */
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.upload-btn:hover {
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

/* Prescription Type Tabs */
.prescription-type-tabs {
    display: flex;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 32px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.type-tab {
    flex: 1;
    padding: 14px 20px;
    text-align: center;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-tab.active {
    background: rgba(148, 163, 184, 0.2);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.2);
}

/* Enhanced Dropdowns - Modern Style */
.enhanced-select {
    position: relative;
    width: 100%;
}

.enhanced-select select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(30, 41, 59, 0.8);
    color: #ffffff;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.enhanced-select select:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.1);
}

.enhanced-select::after {
    content: '▼';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.enhanced-select:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.toast {
    background: rgba(30, 41, 59, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-left: 4px solid;
    min-width: 320px;
    animation: slideIn 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.info {
    border-left-color: #4f46e5;
}

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

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.toast-close:hover {
    color: #ffffff;
}

.toast-message {
    font-size: 14px;
    color: #a1a1aa;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(26, 26, 46, 0.5);
    border-radius: 20px;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.empty-state p {
    color: #a1a1aa;
    font-size: 16px;
    margin-bottom: 24px;
}

/* Prescription Table - Professional Style */
.prescription-table-container {
    background: rgba(31, 41, 55, 0.5);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(79, 70, 229, 0.2);
    margin-bottom: 32px;
    position: relative;
}

.prescription-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* ensure OD/OS columns stay identical widths */
    background: rgba(26, 26, 46, 0.8);
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.prescription-table thead {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.prescription-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prescription-table th:first-child {
    width: 200px; /* enough for "CYLINDER (CYL)" + info icon */
}

.prescription-table tbody tr {
    border-bottom: 1px solid rgba(79, 70, 229, 0.1);
    transition: background-color 0.3s ease;
}

.prescription-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.05);
}

.prescription-table tbody tr:last-child {
    border-bottom: none;
}

.prescription-table td {
    padding: 16px 12px;
    vertical-align: middle;
}

.eye-label {
    position: relative;
    font-weight: 600;
    font-size: 13px;
    color: #d1d5db;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 8px;
    padding: 8px 28px 8px 12px; /* reserve space for inline info icon */
    text-align: left;
    white-space: nowrap;
}

/* Keep info icon from stealing label text space */
.eye-label .info-btn-inline{
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
}

/* Make OD/OS dropdown menus feel equal width and avoid right-edge clipping */
.prescription-table-container .contacts-dropdown .dropdown-options,
.prescription-table-container .simple-dropdown .dropdown-options{
    left: 0;
    right: auto;
    width: 100%;
}

/* In the OS (3rd) column, open panels inward from the right edge */
.prescription-table-container .prescription-table tbody tr td:nth-child(3) .contacts-dropdown .dropdown-options,
.prescription-table-container .prescription-table tbody tr td:nth-child(3) .simple-dropdown .dropdown-options{
    left: auto;
    right: 0;
}

/* Ensure dropdown display fills the whole cell */
.side-by-side-dropdown .dropdown-display,
.contacts-dropdown .dropdown-display{
    width: 100%;
    flex: 1;
}

/* In the glasses table, keep OD/OS dropdown panels exactly cell-width (no extra min-width). */
#glasses-prescription-section .contacts-dropdown .dropdown-options{
    width: 100%;
    min-width: 0;
}
#glasses-prescription-section .cylinder-dropdown .dropdown-options{
    min-width: 0;
}

.eye-row:nth-child(odd) .eye-label {
    background: rgba(59, 130, 246, 0.1);
}

.eye-row:nth-child(even) .eye-label {
    background: rgba(139, 92, 246, 0.1);
}

.prescription-table .enhanced-select {
    margin: 0;
}

.prescription-table .enhanced-select select {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    min-width: 100px;
    transition: all 0.3s ease;
}

.prescription-table .enhanced-select select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
    background: rgba(31, 41, 55, 1);
}

.prescription-table .enhanced-select::after {
    right: 12px;
    font-size: 10px;
}

/* Contact Lens Section - Professional Style */
.contact-lens-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(26, 26, 46, 0.8);
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    margin-top: 16px;
}

.contact-lens-table thead {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.contact-lens-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-lens-table tbody tr {
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    transition: background-color 0.3s ease;
}

.contact-lens-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.contact-lens-table tbody tr:last-child {
    border-bottom: none;
}

.contact-lens-table td {
    padding: 14px 12px;
    vertical-align: middle;
}

.contact-lens-table .eye-label {
    background: rgba(139, 92, 246, 0.1);
    color: #d1d5db;
}

.contact-lens-table .enhanced-select select {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    min-width: 80px;
}

.contact-lens-table .enhanced-select select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Contact Lens Table Container */
.contact-lens-table-container {
    background: rgba(31, 41, 55, 0.5);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    margin-bottom: 32px;
    position: relative;
}

.contact-lens-table-container .contact-lens-table {
    margin-top: 0;
}

/* Responsive Table */
@media (max-width: 768px) {
    .auth-card {
        padding: 32px 24px;
        margin: 20px;
    }

    .header-content {
        padding: 0 16px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
        text-align: left;
    }
    
    .header-left h1 {
        font-size: 20px;
    }
    
    .user-name {
        max-width: 55vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 6px 12px;
        font-size: 13px;
    }

    .app-nav {
        /* Mobile-first: bottom tab bar (better ergonomics) */
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 200;
        max-width: none;
        margin: 0;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        border-bottom: none;
        border-top: 1px solid rgba(148, 163, 184, 0.2);
        border-radius: 0;
        overflow: visible;
    }

    .app-nav-inner {
        max-width: none;
        margin: 0;
        padding: 0;
        width: 100%;
        justify-content: space-between;
    }

    .nav-btn {
        flex: 1;
        min-height: 44px;
        padding: 10px 10px;
        font-size: 13px;
        text-align: center;
    }
    
    .app-content {
        padding: 20px 16px calc(96px + env(safe-area-inset-bottom));
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        margin-bottom: 18px;
    }
    
    .dashboard-header h2 {
        font-size: 22px;
        line-height: 1.2;
    }
    
    .dashboard-header p {
        font-size: 14px;
    }

    /* Dashboard: reduce vertical bulk */
    .stats-grid {
        gap: 12px;
        margin-bottom: 16px;
    }

    .stat-card {
        padding: 16px;
        border-radius: 16px;
        gap: 14px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        font-size: 22px;
    }

    .stat-content h3 {
        font-size: 26px;
        margin-bottom: 4px;
    }

    .stat-content p {
        font-size: 13px;
    }

    .quick-actions {
        display: none;
    }

    .quick-actions h3 {
        display: none;
    }

    .action-buttons {
        display: none;
    }

    .action-buttons .btn {
        display: none;
    }

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

    /* Header: shrink logout button and tighten spacing */
    .header-right {
        gap: 10px;
        width: 100%;
        justify-content: space-between;
    }

    #logout-btn {
        padding: 10px 14px;
        min-width: 0;
        font-size: 14px;
        border-radius: 10px;
    }

    /* View headers: make primary action button look good on mobile */
    .view-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 18px;
    }

    .view-header h2 {
        font-size: 22px;
    }

    .view-header .btn {
        width: 100%;
        justify-content: center;
        min-width: 0;
    }

    /* My Prescriptions: hide date line; show expiry beside type */
    .prescription-header {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        margin-bottom: 14px;
        flex-wrap: nowrap;
    }

    .prescription-date {
        display: none;
    }

    .prescription-expiry {
        display: inline-flex;
        margin-left: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 50%;
    }

    /* Make sure the Rx block can ellipsize properly in mobile cards */
    .detail-value {
        display: block;
        max-width: 100%;
    }

    .prescriptions-list {
        gap: 14px;
        padding-bottom: calc(32px + env(safe-area-inset-bottom));
    }

    .prescription-card {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .prescription-card:last-child {
        margin-bottom: 24px; /* ensures last card clears bottom nav overlay */
    }
    /* Keep prescription header inline (type + expiry) on mobile */

    .prescription-details {
        grid-template-columns: 1fr;
    }

    .prescription-actions {
        justify-content: flex-start;
    }

    .form-actions {
        flex-direction: column;
    }

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

    .filters {
        flex-direction: column;
    }

    .filter-select {
        min-width: auto;
    }

    .toast-container {
        left: 20px;
        right: 20px;
    }

    .toast {
        min-width: auto;
    }

    .prescription-table-container {
        padding: 0;
        overflow: visible;
    }

    /* Mobile: convert wide tables into stacked cards */
    .prescription-table,
    .prescription-table thead,
    .prescription-table tbody,
    .prescription-table tr,
    .prescription-table th,
    .prescription-table td {
        display: block;
        width: 100%;
    }

    .prescription-table thead {
        display: none;
    }

    .prescription-table tbody tr {
        background: rgba(30, 41, 59, 0.95);
        border: 1px solid rgba(148, 163, 184, 0.2);
        border-radius: 16px;
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    }

    .prescription-table td {
        padding: 0;
        border: none;
    }

    .prescription-table td.eye-label {
        background: transparent;
        border: none;
        font-weight: 700;
        color: #ffffff;
        margin-bottom: 10px;
        padding: 0;
    }

    .prescription-table tbody tr td:nth-child(2),
    .prescription-table tbody tr td:nth-child(3) {
        margin-top: 10px;
    }

    .prescription-table tbody tr td:nth-child(2)::before {
        content: 'OD (Right)';
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: #94a3b8;
        margin: 0 0 6px 0;
    }

    .prescription-table tbody tr td:nth-child(3)::before {
        content: 'OS (Left)';
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: #94a3b8;
        margin: 0 0 6px 0;
    }

    .contact-lens-table-container {
        padding: 0;
        border: none;
        background: transparent;
    }

    .contact-lens-table,
    .contact-lens-table thead,
    .contact-lens-table tbody,
    .contact-lens-table tr,
    .contact-lens-table th,
    .contact-lens-table td {
        display: block;
        width: 100%;
    }

    .contact-lens-table thead {
        display: none;
    }

    .contact-lens-table tbody tr {
        background: rgba(30, 41, 59, 0.95);
        border: 1px solid rgba(148, 163, 184, 0.2);
        border-radius: 16px;
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    }

    .contact-lens-table td {
        padding: 0;
        border: none;
    }

    .contact-lens-table td.eye-label {
        background: transparent;
        border: none;
        font-weight: 800;
        color: #ffffff;
        margin-bottom: 12px;
        padding: 0;
    }

    .contact-lens-table tbody tr td:not(.eye-label) {
        margin-top: 10px;
    }

    .contact-lens-table tbody tr td:nth-child(2)::before { content: 'Brand & Name'; }
    .contact-lens-table tbody tr td:nth-child(3)::before { content: 'Power (Sphere)'; }
    .contact-lens-table tbody tr td:nth-child(4)::before { content: 'Cylinder'; }
    .contact-lens-table tbody tr td:nth-child(5)::before { content: 'Axis'; }
    .contact-lens-table tbody tr td:nth-child(6)::before { content: 'Diameter'; }
    .contact-lens-table tbody tr td:nth-child(7)::before { content: 'Base Curve'; }
    .contact-lens-table tbody tr td:nth-child(8)::before { content: 'Add Power'; }

    .contact-lens-table tbody tr td:nth-child(2)::before,
    .contact-lens-table tbody tr td:nth-child(3)::before,
    .contact-lens-table tbody tr td:nth-child(4)::before,
    .contact-lens-table tbody tr td:nth-child(5)::before,
    .contact-lens-table tbody tr td:nth-child(6)::before,
    .contact-lens-table tbody tr td:nth-child(7)::before,
    .contact-lens-table tbody tr td:nth-child(8)::before {
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: #94a3b8;
        margin: 0 0 6px 0;
    }

    /* Mobile: dropdown panels should not force huge widths */
    .simple-dropdown .dropdown-options {
        max-height: 60vh;
    }

    .brand-dropdown .dropdown-options,
    .model-dropdown .dropdown-options,
    .power-dropdown .dropdown-options {
        min-width: 0;
        white-space: normal;
    }

    /* Add Prescription: prevent clipping/overflow in upload + basic info */
    .prescription-form {
        padding: 22px 16px;
        border-radius: 16px;
    }

    /* Remove decorative top rule on small screens */
    .prescription-form::before {
        display: none;
    }

    /* Prevent iOS date inputs from overflowing their container */
    .form-row {
        width: 100%;
        /* iOS/Safari grid overflow fix */
        grid-template-columns: minmax(0, 1fr);
    }

    .form-group {
        min-width: 0;
        width: 100%;
    }

    .form-group input,
    .form-group select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        display: block;
    }

    .form-group input[type="date"] {
        -webkit-appearance: none;
        appearance: none;
    }

    .form-section {
        margin-bottom: 22px;
        padding-bottom: 22px;
        border-bottom: none; /* remove divider line on mobile */
    }

    .ocr-upload-section {
        padding: 18px 14px;
        border-radius: 16px;
        margin-bottom: 22px;
        overflow: visible;
    }

    .ocr-upload-section:hover {
        transform: none;
    }

    .upload-btn-wrap {
        display: block;
        width: 100%;
        max-width: 520px;
        margin: 0 auto;
    }

    .upload-btn {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: center;
        padding: 14px 14px;
        line-height: 1.2;
        white-space: normal;
        text-align: center;
    }

    .upload-btn:hover {
        transform: none;
    }

    /* Form controls: tighten to fit small screens */
    .form-group input,
    .form-group select {
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    .app-content {
        /* Keep bottom buffer so fixed bottom nav doesn't cover actions */
        padding: 20px 16px calc(96px + env(safe-area-inset-bottom));
    }

    .prescription-form {
        padding: 24px;
    }

    .stat-card {
        padding: 24px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
} 

/* Simple dropdown styles (like 1-800 Contacts) */
.simple-dropdown {
    position: relative;
    width: 100%;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid #374151;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    overflow: visible;
}

.simple-dropdown:hover {
    border-color: #4f46e5;
}

.simple-dropdown.open {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.dropdown-display {
    padding: 14px 18px;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 400;
    position: relative;
    overflow: visible;
}

.simple-dropdown[data-selected]:not([data-selected=""]) .dropdown-display {
    color: #ffffff;
}

.dropdown-display::after {
    content: '▼';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.simple-dropdown.open .dropdown-display::after {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid #374151;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 9999;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.simple-dropdown.open .dropdown-options {
    display: block;
}

/* Wider panel for brand list to improve readability */
.brand-dropdown .dropdown-options,
.model-dropdown .dropdown-options {
    min-width: 700px;
    white-space: nowrap;
}

/* Power (sphere) width same as glasses (no extra min-width) */
.power-dropdown .dropdown-options { min-width: 380px; }

/* Cylinder dropdown can be narrower than sphere */
.cylinder-dropdown .dropdown-options { min-width: 260px; }

/* Disabled state for custom dropdowns */
.simple-dropdown.disabled,
.contacts-dropdown.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.dropdown-option {
    padding: 12px 18px;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(55, 65, 81, 0.3);
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background: rgba(79, 70, 229, 0.2);
}

.dropdown-option.selected {
    background: rgba(79, 70, 229, 0.4);
    color: #ffffff;
}

.hidden-select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Scrollbar styling */
.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.5);
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Keep old side-by-side styles for backward compatibility */
.side-by-side-dropdown {
    position: relative;
    width: 100%;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid #374151;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.side-by-side-dropdown .dropdown-display {
    padding: 14px 18px;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 400;
    position: relative;
    background: rgba(31, 41, 55, 0.8);
    border-bottom: 1px solid #374151;
    z-index: 100;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.side-by-side-dropdown[data-selected]:not([data-selected=""]) .dropdown-display {
    color: #ffffff;
}

.side-by-side-dropdown .dropdown-display::after {
    content: '▼';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.side-by-side-dropdown.open .dropdown-display::after {
    transform: translateY(-50%) rotate(180deg);
}

.side-by-side-dropdown:hover {
    border-color: #4f46e5;
}

.side-by-side-dropdown.open {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* When open, turn it into a proper 2-column panel under the display */
.side-by-side-dropdown .dropdown-divider {
    display: none;
}

.side-by-side-dropdown.open {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    grid-auto-rows: auto;
    align-items: stretch;
}

.side-by-side-dropdown.open .dropdown-display {
    grid-column: 1 / -1;
}

.side-by-side-dropdown.open .dropdown-column.negative {
    grid-column: 1;
}

.side-by-side-dropdown.open .dropdown-divider {
    grid-column: 2;
    display: block;
    height: 100%;
    margin: 0;
}

.side-by-side-dropdown.open .dropdown-column.positive {
    grid-column: 3;
}

.dropdown-column {
    flex: 1;
    display: none;
    flex-direction: column;
    position: relative;
    max-height: 200px;
    /* Debug: ensure columns don't overlay the display */
    z-index: 1;
}

.side-by-side-dropdown.open .dropdown-column {
    display: flex;
}

.column-header {
    background: #6b7280;
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    border-bottom: 1px solid #374151;
}

.dropdown-divider {
    width: 1px;
    background: #374151;
    margin: 0 4px;
}

.column-values {
    max-height: 200px;
    overflow-y: auto;
    display: none;
    scroll-behavior: smooth;
}

.side-by-side-dropdown.open .column-values {
    display: block;
}

/* Synchronized scrolling */
.side-by-side-dropdown .column-values {
    scroll-snap-type: y mandatory;
}

.side-by-side-dropdown .dropdown-option {
    scroll-snap-align: start;
}

/* Display selected value for side-by-side dropdowns - REMOVED */

/* Scrollbar styling for dropdown */
.column-values::-webkit-scrollbar {
    width: 6px;
}

.column-values::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.5);
}

.column-values::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

.column-values::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
} 

/* 1-800 Contacts style dropdown */
.contacts-dropdown {
    position: relative;
    width: 100%;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid #374151;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
}

.contacts-dropdown:hover {
    border-color: #4f46e5;
}

.contacts-dropdown.open {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.contacts-dropdown .dropdown-display {
    padding: 14px 18px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
    position: relative;
}

.contacts-dropdown[data-selected]:not([data-selected=""]) .dropdown-display {
    color: #ffffff;
}

.contacts-dropdown .dropdown-display::after {
    content: '▼';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.contacts-dropdown.open .dropdown-display::after {
    transform: translateY(-50%) rotate(180deg);
}

.contacts-dropdown .dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid #374151;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.contacts-dropdown.open .dropdown-options {
    display: flex;
}

.contacts-dropdown .dropdown-options .negative-column,
.contacts-dropdown .dropdown-options .positive-column {
    flex: 1;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}

.contacts-dropdown .dropdown-options .column-header {
    background: rgba(55, 65, 81, 0.8);
    color: #d1d5db;
    font-weight: bold;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid #374151;
    position: sticky;
    top: 0;
    z-index: 1;
}

.contacts-dropdown .dropdown-options .negative-column .column-header {
    color: #fca5a5;
}

.contacts-dropdown .dropdown-options .positive-column .column-header {
    color: #86efac;
}

.contacts-dropdown .dropdown-option {
    padding: 12px 16px;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #374151;
    text-align: center;
}

.contacts-dropdown .dropdown-option:last-child {
    border-bottom: none;
}

.contacts-dropdown .dropdown-option:hover {
    background: rgba(79, 70, 229, 0.2);
}

.contacts-dropdown .dropdown-option.selected {
    background: rgba(79, 70, 229, 0.4);
    color: #ffffff;
}

.contacts-dropdown .dropdown-options .divider {
    width: 1px;
    background: #374151;
    margin: 0;
}

/* Scrollbar styling for 1-800 Contacts style */
.contacts-dropdown .dropdown-options .negative-column::-webkit-scrollbar,
.contacts-dropdown .dropdown-options .positive-column::-webkit-scrollbar {
    width: 6px;
}

.contacts-dropdown .dropdown-options .negative-column::-webkit-scrollbar-track,
.contacts-dropdown .dropdown-options .positive-column::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.5);
}

.contacts-dropdown .dropdown-options .negative-column::-webkit-scrollbar-thumb,
.contacts-dropdown .dropdown-options .positive-column::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

.contacts-dropdown .dropdown-options .negative-column::-webkit-scrollbar-thumb:hover,
.contacts-dropdown .dropdown-options .positive-column::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ── Patient portal: dropdown portal + OCR review + Rx cards v2 ── */
.dropdown-options-portal {
    background: rgba(31, 41, 55, 0.98);
    border: 1px solid #374151;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.dropdown-options-portal .dropdown-options {
    position: static;
    display: block !important;
    max-height: none;
    border: none;
    border-radius: 0;
}

.dropdown-options-portal.synced-power-portal {
    border-radius: 12px;
    overflow: hidden;
}

.dropdown-options-portal .synced-plano-option {
    background: rgba(30, 41, 59, 0.98);
    color: #f1f5f9;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.dropdown-options-portal .synced-power-header-row {
    background: rgba(30, 41, 59, 0.98);
}

.wizard-substep-progress {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(148, 163, 184, 0.95);
    text-transform: uppercase;
}

.wizard-substep-panel {
    margin-bottom: 8px;
}

.wizard-substep-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: #f1f5f9;
}

.wizard-substep-lead {
    margin: 0 0 12px;
    font-size: 14px;
    color: rgba(203, 213, 225, 0.88);
}

.wizard-substep-card {
    margin: 0 0 12px;
    border: none;
    padding: 0;
}

.wizard-entry-step .wizard-substep-panel + .wizard-field-stash {
    display: none;
}

.wizard-action-bar-entry .wizard-action-bar-inner {
    max-width: 720px;
    margin: 0 auto;
}

.prescription-table-container,
.prescription-table,
.prescription-table td,
.prescription-table .enhanced-select {
    overflow: visible;
}

.ocr-review-layout {
    display: block;
}

.ocr-review-layout.ocr-review-active {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.2fr);
    gap: 24px;
    align-items: start;
}

.ocr-review-image-panel {
    position: sticky;
    top: 88px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.65);
    padding: 12px;
}

.ocr-review-fields-panel {
    min-width: 0;
}

.ocr-warnings-panel {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.08);
    color: #fde68a;
}

.ocr-warning-list {
    margin: 0;
    padding-left: 1.1rem;
}

.rx-image-viewer-stage {
    overflow: auto;
    max-height: min(70vh, 520px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.5);
    border-radius: 12px;
}

.rx-image-viewer-img {
    max-width: 100%;
    height: auto;
    transform-origin: center center;
    transition: transform 0.15s ease;
}

.rx-image-viewer-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.rx-image-fullscreen-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
}

.rx-image-fullscreen-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.rx-image-fullscreen-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.rx-image-fullscreen-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.rx-image-fullscreen-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
}

.needs-review,
.simple-dropdown.needs-review,
.form-group.needs-review {
    outline: 2px solid rgba(251, 191, 36, 0.75);
    outline-offset: 2px;
    border-radius: 12px;
}

.has-field-error .field-error-msg {
    color: #fca5a5;
    font-size: 13px;
    margin-top: 6px;
}

.rx-card-v2 {
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.rx-card-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.rx-card-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.rx-status-pill {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.rx-status-needs-review { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }
.rx-status-verified { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.rx-status-expired { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }

.rx-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
}

.rx-card-summary {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.rx-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rx-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.rx-detail-table th,
.rx-detail-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.rx-inline-image {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 10px;
}

.ocr-mobile-view-image {
    display: none;
    width: 100%;
    margin-top: 10px;
}

@media (max-width: 900px) {
    .ocr-review-layout.ocr-review-active {
        grid-template-columns: 1fr;
    }

    .ocr-review-image-panel {
        position: relative;
        top: auto;
    }

    .ocr-review-image-panel:not(.mobile-expanded) .rx-image-viewer {
        display: none;
    }

    .ocr-mobile-view-image {
        display: inline-flex;
    }
}

.ocr-field-disagreement {
    display: none;
}

.rx-shadow-review-slot td {
    padding: 0;
    border: none;
    background: transparent;
}

.rx-shadow-review-panel {
    margin: 8px 0 14px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.06);
}

.rx-shadow-review-stack .rx-shadow-review-panel {
    margin-top: 12px;
}

.rx-shadow-review-item + .rx-shadow-review-item {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.rx-shadow-review-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #fcd34d;
}

.rx-shadow-review-values {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 28px;
    margin-bottom: 12px;
}

.rx-shadow-review-value {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.rx-shadow-review-label {
    font-size: 12px;
    color: rgba(148, 163, 184, 0.95);
}

.rx-shadow-review-value strong {
    font-size: 15px;
    font-weight: 700;
}

.rx-shadow-review-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

.rx-shadow-btn {
    white-space: nowrap;
    min-width: 0;
}

.rx-shadow-btn:focus-visible,
.rx-shadow-btn-change:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.rx-shadow-review-item.is-complete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.rx-shadow-review-status {
    margin: 0;
    font-size: 13px;
    color: rgba(34, 197, 94, 0.95);
}

.rx-shadow-btn-change {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .rx-shadow-review-actions {
        flex-direction: column;
        flex-wrap: wrap;
    }

    .rx-shadow-btn {
        width: 100%;
    }
}

/* --- Prescription wizard (Phase 2) --- */
.prescription-wizard-root,
#prescription-wizard-root {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

#add-prescription-view.wizard-active .view-header-wizard {
    max-width: 720px;
    margin: 0 auto 8px;
    padding: 0 12px;
}

.view-header-wizard .view-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.view-header-wizard h2 {
    margin: 0;
    font-size: 1.35rem;
}

.wizard-back-list {
    appearance: none;
    border: none;
    background: transparent;
    color: rgba(148, 163, 184, 0.95);
    font-size: 13px;
    padding: 4px 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wizard-back-list:hover,
.wizard-back-list:focus-visible {
    color: #e2e8f0;
    outline: none;
}

.wizard-shell {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-bottom: 88px;
}

.wizard-content {
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
    padding: 0 12px;
}

.wizard-steps {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
    flex-wrap: wrap;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    font-size: 13px;
}

.wizard-step.is-current {
    background: rgba(59, 130, 246, 0.18);
    outline: 2px solid rgba(59, 130, 246, 0.45);
}

.wizard-step.is-done {
    opacity: 0.75;
}

.wizard-step-num {
    font-weight: 700;
}

.wizard-lead,
.wizard-page-question {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
}

.wizard-type-cards,
.wizard-method-cards {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.wizard-type-cards-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wizard-type-card,
.wizard-method-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    padding: 14px 14px 14px 12px;
    border-radius: 12px;
    border: 2px solid rgba(148, 163, 184, 0.28);
    background: rgba(30, 41, 59, 0.55);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.wizard-type-card:hover,
.wizard-method-card:hover,
.wizard-type-card:focus-visible,
.wizard-method-card:focus-visible {
    border-color: rgba(96, 165, 250, 0.75);
    background: rgba(30, 58, 95, 0.45);
    outline: 2px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}

.wizard-type-card.is-selected,
.wizard-method-card.is-selected {
    border-color: rgba(96, 165, 250, 0.95);
    background: rgba(30, 64, 120, 0.42);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.45), inset 0 0 0 1px rgba(59, 130, 246, 0.15);
}

.wizard-type-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
    background: rgba(59, 130, 246, 0.18);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
}

.wizard-type-icon-glasses {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393c5fd' stroke-width='2'%3E%3Ccircle cx='7' cy='12' r='4'/%3E%3Ccircle cx='17' cy='12' r='4'/%3E%3Cpath d='M11 12h2M3 12h0M21 12h0'/%3E%3C/svg%3E");
}

.wizard-type-icon-contacts {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393c5fd' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.wizard-type-icon-upload {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393c5fd' stroke-width='2'%3E%3Cpath d='M12 16V4M12 4l-4 4M12 4l4 4'/%3E%3Cpath d='M4 18v2h16v-2'/%3E%3C/svg%3E");
}

.wizard-type-card-body {
    flex: 1;
    min-width: 0;
}

.wizard-type-card-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
}

.wizard-type-card-check.is-visible {
    display: flex;
}

.wizard-type-card-title,
.wizard-method-title {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
    color: #f8fafc;
    font-size: 15px;
}

.wizard-type-card-desc,
.wizard-method-desc {
    display: block;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(203, 213, 225, 0.92);
}

.wizard-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 50;
    margin: 0;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.92) 24%, rgba(15, 23, 42, 0.98));
    backdrop-filter: blur(8px);
}

.wizard-action-bar-inner {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

.wizard-action-left,
.wizard-action-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wizard-form-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

/* Guided optional questions */
.wizard-optional-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.wizard-optional-heading {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
}

.wizard-optional-q {
    border: none;
    margin: 0 0 12px;
    padding: 0;
}

.wizard-optional-legend {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
    padding: 0;
}

.wizard-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    overflow: hidden;
    background: rgba(15, 23, 42, 0.5);
}

.wizard-segment {
    position: relative;
    display: inline-flex;
    margin: 0;
}

.wizard-segment input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.wizard-segment span {
    display: block;
    padding: 7px 14px;
    font-size: 13px;
    color: #cbd5e1;
    cursor: pointer;
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    user-select: none;
}

.wizard-segment:last-child span {
    border-right: none;
}

.wizard-segment.is-selected span,
.wizard-segment input:checked + span {
    background: rgba(59, 130, 246, 0.28);
    color: #f8fafc;
    font-weight: 600;
}

.wizard-segment input:focus-visible + span {
    outline: 2px solid rgba(59, 130, 246, 0.65);
    outline-offset: -2px;
}

.wizard-optional-hint {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(203, 213, 225, 0.88);
}

/* Synchronized two-column power picker */
.synced-power-dropdown .synced-power-options {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.synced-power-dropdown .synced-plano-option {
    width: 100%;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 10px 12px;
}

.synced-power-scroll {
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
}

.synced-power-header-row,
.synced-power-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.synced-power-header-row {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(30, 41, 59, 0.98);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.synced-power-header {
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    padding: 8px 6px;
    color: #e2e8f0;
}

.synced-power-header.minus-header {
    border-right: 1px solid rgba(148, 163, 184, 0.2);
}

.synced-power-cell {
    display: block;
    width: 100%;
    text-align: center;
    font-variant-numeric: tabular-nums;
    padding: 9px 8px;
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: transparent;
    color: #f1f5f9;
    font-size: 14px;
    cursor: pointer;
}

.synced-power-row .synced-power-cell[data-side="minus"] {
    border-right: 1px solid rgba(148, 163, 184, 0.15);
}

.synced-power-cell:hover,
.synced-power-cell.is-focused {
    background: rgba(59, 130, 246, 0.18);
}

.synced-power-cell.selected {
    background: rgba(59, 130, 246, 0.32);
    font-weight: 700;
}

.synced-plano-option.selected,
.synced-plano-option.is-focused {
    background: rgba(59, 130, 246, 0.22);
}

.synced-power-cell-empty {
    display: block;
    min-height: 38px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.wizard-compact-table .synced-power-dropdown {
    min-width: 0;
}

.wizard-compact-table .synced-power-dropdown .dropdown-display {
    font-variant-numeric: tabular-nums;
}

/* Legacy sign/magnitude control (removed from wizard; keep minimal reset) */
.rx-sign-mag {
    display: none;
}

.wizard-disclosure-toggle.is-active {
    border-color: rgba(59, 130, 246, 0.65);
}

.wizard-compact-table .prescription-table td,
.wizard-compact-table .prescription-table th {
    vertical-align: top;
}

.wizard-axis-cell.is-disabled,
.wizard-axis-cell.is-disabled .dropdown-display {
    opacity: 0.45;
}

.wizard-hidden-field,
.wizard-hidden-file,
.wizard-hidden-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.wizard-ocr-layout.ocr-review-active {
    display: grid;
    grid-template-columns: minmax(220px, 36%) 1fr;
    gap: 16px;
    align-items: start;
}

.wizard-cl-eyes {
    display: grid;
    gap: 16px;
}

.wizard-cl-pickers {
    display: grid;
    gap: 14px;
    margin-top: 12px;
}

.wizard-cl-mode-heading {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
}

.wizard-cl-search {
    width: 100%;
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.72);
    color: #f1f5f9;
    font-size: 14px;
}

.wizard-cl-search::placeholder {
    color: rgba(148, 163, 184, 0.75);
}

.wizard-cl-search:focus {
    outline: 2px solid rgba(59, 130, 246, 0.55);
    border-color: rgba(59, 130, 246, 0.65);
}

.wizard-cl-results {
    max-height: 240px;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    display: none;
    z-index: 30;
    position: relative;
    background: rgba(15, 23, 42, 0.98);
}

.wizard-cl-results.is-open {
    display: block;
}

.wizard-cl-result-row {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 56px;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    background: transparent;
    cursor: pointer;
    color: inherit;
}

.wizard-cl-result-row:hover,
.wizard-cl-result-row:focus-visible {
    background: rgba(59, 130, 246, 0.12);
    outline: none;
}

.wizard-cl-logo-wrap {
    width: 44px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(148, 163, 184, 0.08);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.wizard-cl-logo-fallback {
    display: none;
    font-size: 11px;
    font-weight: 700;
    color: rgba(148, 163, 184, 0.9);
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
}

.wizard-cl-logo.is-fallback ~ .wizard-cl-logo-fallback,
.wizard-cl-logo-wrap:not(:has(img[src])) .wizard-cl-logo-fallback {
    display: flex;
}

.wizard-cl-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.wizard-cl-product-name {
    display: block;
    font-weight: 600;
}

.wizard-cl-product-brand,
.wizard-cl-product-modality {
    display: block;
    font-size: 12px;
    color: rgba(148, 163, 184, 0.95);
}

.wizard-cl-product-card {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    margin-bottom: 12px;
}

.wizard-cl-param-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.wizard-cl-optical-table-wrap {
    margin-top: 12px;
}

.wizard-cl-optical-table .eye-label {
    font-weight: 600;
    color: #cbd5e1;
}

.wizard-cl-eye-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
}

.wizard-cl-meta-section {
    margin-top: 16px;
}

.wizard-hidden-select-host {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Keep dropdown panels below sticky action bar */
.wizard-panel .dropdown-options,
.wizard-panel .contacts-dropdown .dropdown-options {
    z-index: 35;
}

.wizard-summary-title {
    margin-top: 0;
}

.wizard-summary-warning {
    color: #fcd34d;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 768px) {
    .wizard-layout-mobile .wizard-ocr-layout.ocr-review-active {
        grid-template-columns: 1fr;
    }

    .wizard-type-cards-3 {
        grid-template-columns: 1fr;
    }

    .view-header-wizard .view-header-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .wizard-action-right .btn,
    .wizard-action-left .btn {
        flex: 1 1 auto;
        min-width: 120px;
    }

    .wizard-segmented {
        display: flex;
        width: 100%;
    }

    .wizard-segment {
        flex: 1;
    }

    .wizard-segment span {
        text-align: center;
        width: 100%;
    }
}