
/* ===== Fixed tabs toolbar ===== */
body.newpatient-page
{
    --np-tabs-toolbar-top: calc(var(--nvx-nav-total-height) + 18px);
    --np-tabs-toolbar-height: 64px;
}

body.newpatient-page #tabsToolbar
{
    position: fixed;
    top: var(--np-tabs-toolbar-top);
    left: 0;
    right: 0;
    z-index: 900;
    width: 100%;
    margin: 0px;
    padding-top: 14px;
    padding-bottom: 4px;
    background: #ffffff;
    }

body.newpatient-page #tabsToolbar .toolbar-center
{
    width: 100%;
    display: flex;
    justify-content: center;
}

body.newpatient-page #tabsToolbar .analysis-toolbar.analysis-toolbar--stack
{
    gap: 0;
}

body.newpatient-page #tabsToolbar .analysis-row.analysis-row--tabs
{
    margin: 0;
}

body.newpatient-page #tabsToolbar .tabs-bar
{
    margin-top: 0;
    margin-bottom: 0;
}



body.newpatient-page .tab-section
{
    scroll-margin-top: calc(var(--nvx-nav-total-height) + var(--np-tabs-toolbar-height) + 10px);
}

@media (max-width: 768px)
{
    body.newpatient-page
    {
        --np-tabs-toolbar-top: calc(var(--nvx-nav-total-height) + 18px);
    }
}



body.newpatient-page .app-page-shell
{
    width: 100%;
    box-sizing: border-box;
    margin-top: calc(var(--nvx-nav-total-height) + var(--nvx-nav-content-gap));
    background: #ffffff !important;

}

body.newpatient-page .app-page-content
{
     width: 100%;
    box-sizing: border-box;
    padding-top: calc(var(--np-tabs-toolbar-height) + 2px);


}


/* Diagnosis: disabled state for AI analysis buttons while an analysis is running */
.dx-disabled
{
  opacity: 0.55;
  cursor: not-allowed !important;
}

  /* Ensure JS-hidden rows stay hidden even against mobile overrides */
  .analysis-row[hidden],
  .analysis-row--top[hidden],
  .analysis-row--bottom[hidden] { display: none !important; }

  /* Slim toolbar when AI rows are hidden */
  .toolbar.toolbar--slim {
    padding-top: 6px;
    padding-bottom: 6px;
    margin-bottom: 8px;
  }

  /* Also slim on small phones even if older CSS forces a big margin-bottom */
  @media (max-width: 480px) {
    .toolbar.toolbar--slim { margin-bottom: 8px !important; }
  }

  /* Optional: reduce the top margin of the first Patient Info heading when slim */
  .toolbar.toolbar--slim + .tab-section h3.pi-title:first-child { margin-top: 6px; }

/* Trial lock message line-break fix (v1.27) */
.action-launcher
{
    flex-wrap: wrap;
}

#dxTrialLockMsg
{
    flex-basis: 100%;
    width: 100%;
    margin-top: 8px;
}

/* Labs: interpret selection */
.lab-interpret-row
            {
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                gap: 6px;
            }

.lab-interpret-selected-name
{
    margin-top: 6px;
    font-size: 12px;
    color: #5a6b80;
    text-align: left;
}


/* Images tab layout alignment with Labs tab */
#section-images > .images-outer-wrapper
{
    background: #eaf4ff !important;
    border: 1px solid #d7e6f6;
    border-radius: 10px;
    padding: 20px;
}

#section-images .images-inner-wrapper
{
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
}

#images-section,
#image-results-section
{
    background: #dfeefa;
    border: 1px solid #c9dced !important;
}

.image-study-action-row
{
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.image-study-action-buttons
{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}


.image-interpret-hints-wrap
{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.image-interpret-hints-row
{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.image-interpret-hints-row .admin-select
{
    min-width: 260px;
    max-width: 100%;
}

#imageFocusHint
{
    width: 260px;
  height: 36px;
    max-width: 100%;
    height: 36px;
    box-sizing: border-box;
}


.image-study-top-row
{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.image-study-meta
{
    margin: 0 auto;
    width: fit-content;
    max-width: 100%;
    grid-template-columns: max-content max-content;
    column-gap: 12px;
    row-gap: 6px;
}

.image-study-meta .k
{
    text-align: center;
}

.image-preview-column
{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.image-study-nav-row
{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

@media (max-width: 900px)
{
    .image-study-meta
    {
        grid-template-columns: max-content max-content;
        column-gap: 10px;
    }
}



/* Images tab outer wrapper to mimic Labs layout */
.images-outer-wrapper
{
    background:#ffffff;
    border:2px solid #c6d6ea;
    border-radius:10px;
    padding:20px;
    margin-top:20px;
}


.image-meta-center
{
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    margin-top: 10px;
    text-align: center;
}

.image-study-meta.dx-kv,
.image-study-meta
{
    display: inline-grid !important;
    grid-template-columns: max-content max-content !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 auto !important;
    justify-content: center !important;
    justify-items: start;
    column-gap: 12px !important;
    row-gap: 6px !important;
}

.image-study-meta .k
{
    text-align: right !important;
    justify-self: end;
}

.image-study-meta > div:not(.k)
{
    text-align: left !important;
    justify-self: start;
}

@media (max-width: 900px)
{
    .image-study-meta.dx-kv,
    .image-study-meta
    {
        grid-template-columns: max-content max-content !important;
        width: auto !important;
        max-width: none !important;
    }
}



.image-study-scroll-shell
{
    background: #ffffff !important;
    overflow-x: visible;
    overflow-y: visible;
    width: 100%;
}

.image-study-card-inner
{
    background: #ffffff;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.image-study-top-fixed
{
    background: #ffffff;
    width: 100%;
}

.image-study-scroll-shell .dx-table
{
    table-layout: fixed;
    width: 100%;
}

.image-study-scroll-shell .dx-table td:first-child
{
    width: 190px;
    white-space: nowrap;
}

.image-study-scroll-shell .dx-table td:nth-child(2)
{
    width: auto;
}

.image-study-scroll-shell .dx-table td:nth-child(2) input,
.image-study-scroll-shell .dx-table td:nth-child(2) textarea,
.image-study-scroll-shell .dx-table td:nth-child(2) select
{
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.image-study-scroll-shell .dx-table td:nth-child(2) textarea
{
    resize: vertical;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

@media (max-width: 700px)
{
    .image-study-scroll-shell .dx-table td:first-child
    {
        width: 150px;
    }
}



/* --- Image interpretation table label formatting --- */
.dx-table td:first-child
{
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
    padding-right: 10px;
}

.dx-table td:first-child::after
{
    content: ":";
    padding-left: 2px;
}

.dx-table td:nth-child(2)
{
    padding-left: 8px;
}


.dx-workflow-title
{
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  color: #173f7a;
  margin: 22px 0 18px 0;
}


.dx-results-arrow-wrap
{
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0 8px 0;
}

.dx-results-arrow
{
  position: relative;
  width: 26px;
  height: 34px;
}

.dx-results-arrow::before
{
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 10px;
  height: 18px;
  background: #173f7a;
  border-radius: 0;
}

.dx-results-arrow::after
{
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 14px solid #173f7a;
}


.dx-results-arrow-right
{
  transform: rotate(-90deg);
}








/* ===== Dashboard converted styles ===== */
#admin-nav-link
{
    display: none;
}


body.newpatient-page .toolbar
{
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

body.newpatient-page main
{
    padding: 0.3rem;
    text-align: center;
}

.dbi-001
{
    margin-right: 0;
    font-weight: 700;
    color: #000;
    font-size: 1.1rem;
    vertical-align: middle;
}

.dbi-002
{
    width: 170px;
    height: 35px;
    border-radius: 4px;
    border: 1px solid #ccc;
    padding-left: 8px;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}

.dbi-003
{
    padding: 0.3rem;
    text-align: center;
}

.dbi-004
{
    margin-top: 10px;
    font-size: 14px;
}

.dbi-005
{
    display: inline-block;
    margin-top: 8px;
    color: #b00020;
    font-weight: bold;
}

.dbi-006
{
    width: 100%;
    border-collapse: collapse;
}

.dbi-007
{
    vertical-align: middle;
}

.dbi-008
{
    width: 100%;
}

.dbi-009
{
    display: inline-block;
    margin: 0;
}

.dbi-010
{
    background-color: #003366;
    color: white;
    width: 150px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    line-height: 14px;
}

.dbi-011
{
    border: none;
    height: 2px;
    background-color: black;
    margin: 10px 0;
}

.dbi-012
{
    width: 30%;
    text-align: right;
    padding-right: 10px;
}

.dbi-013
{
    width: 70%;
    text-align: left;
}

.dbi-014
{
    width: 50%;
}

.dbi-015
{
    text-align: right;
    padding-right: 10px;
}

.dbi-016
{
    text-align: left;
}

.dbi-017
{
    border: none;
    height: 2px;
    background-color: black;
    margin: 30px 0;
}

.dbi-018
{
    display: inline-block;
    margin-left: 10px;
}

.dbi-019
{
    text-align: center;
}

.dbi-020
{
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.dbi-021
{
    margin: 0;
}

.dbi-022
{
    margin-top: 10px;
    text-align: center;
    display: none;
}

.dbi-023
{
    margin-top: 8px;
    font-style: italic;
    text-align: center;
}

.dbi-024
{
    margin-top: 10px;
    text-align: center;
}

.dbi-025
{
    margin-bottom: 8px;
}

.dbi-026
{
    margin-left: 8px;
}

.dbi-027
{
    margin-top: 12px;
}

.dbi-028
{
    margin-top: 8px;
    font-style: italic;
}

body.newpatient-page .dx-nav-footer
{
    gap: 12px;
}

/* ===== Dashboard toolbar centering + shared nav-pill visual alignment ===== */
body.newpatient-page .toolbar-center
{
    width: 100%;
    display: flex;
    justify-content: center;
}

body.newpatient-page .analysis-toolbar.analysis-toolbar--stack
{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

body.newpatient-page .analysis-row.analysis-row--top
{
    display: flex;
    justify-content: center;
    width: 100%;
}

body.newpatient-page .patient-picker
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

body.newpatient-page #addPatientRow
{
    width: 100%;
    display: flex;
    justify-content: center !important;
    margin-top: 16px !important;
}

body.newpatient-page .add-patient-btn
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    width: auto;
    max-width: calc(100vw - 40px);
    height: 34px;
    padding: 5px 12px;
    margin: 0;
    border-radius: 4px;
    background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
    color: #ffffff !important;
    font-size: 0.88rem !important;
    line-height: 1.1 !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.2),
        0 6px 14px rgba(23, 37, 84, 0.25);
    border: 1px solid rgba(15, 23, 42, 0.8);
    white-space: nowrap;
    text-shadow: 0 1px 0 rgba(0,0,0,0.25);
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

body.newpatient-page .add-patient-btn:hover
{
    background: linear-gradient(180deg, #2563eb 0%, #1e3a8a 100%);
    color: #ffffff !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.25),
        0 10px 20px rgba(23, 37, 84, 0.35);
}

body.newpatient-page .dbi-002
{
    display: inline-block;
    vertical-align: middle;
    width: 170px;
    max-width: calc(100vw - 40px);
    height: 34px;
    padding: 5px 36px 5px 12px;
    margin: 0;
    border-radius: 4px;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 1px solid rgba(15, 23, 42, 0.8);
    color: #ffffff !important;
    font-size: 0.88rem !important;
    line-height: 1.1 !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    font-family: inherit;
    text-shadow: 0 1px 0 rgba(0,0,0,0.25);
    cursor: pointer;
    background-color: #1e3a8a;
    background-image:
        linear-gradient(180deg, #1e3a8a 0%, #172554 100%),
        linear-gradient(45deg, transparent 50%, #ffffff 50%),
        linear-gradient(135deg, #ffffff 50%, transparent 50%);
    background-position:
        0 0,
        calc(100% - 18px) 14px,
        calc(100% - 12px) 14px;
    background-size:
        100% 100%,
        6px 6px,
        6px 6px;
    background-repeat: no-repeat;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.2),
        0 6px 14px rgba(23, 37, 84, 0.25);
}

body.newpatient-page .dbi-002:hover
{
    background-color: #2563eb;
    background-image:
        linear-gradient(180deg, #2563eb 0%, #1e3a8a 100%),
        linear-gradient(45deg, transparent 50%, #ffffff 50%),
        linear-gradient(135deg, #ffffff 50%, transparent 50%);
    background-position:
        0 0,
        calc(100% - 18px) 14px,
        calc(100% - 12px) 14px;
    background-size:
        100% 100%,
        6px 6px,
        6px 6px;
    background-repeat: no-repeat;
    color: #ffffff !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.25),
        0 10px 20px rgba(23, 37, 84, 0.35);
}

body.newpatient-page .dbi-002::-ms-expand
{
    display: none;
}

body.newpatient-page .dbi-002 option
{
    color: #0f172a;
    background: #ffffff;
    text-shadow: none;
}

body.newpatient-page .dbi-002:focus-visible,
body.newpatient-page .add-patient-btn:focus-visible
{
    outline: 3px solid rgba(22, 101, 52, 0.18);
    outline-offset: 3px;
}

@media (max-width: 768px)
{
    body.newpatient-page .patient-picker
    {
        gap: 10px;
    }
}

/* Patch to cover the gap */
.toolbar .tabs-bar .tab-btn.active::after {
  content: "";
  position: absolute;
  left: -1px;                  /* overlap left corner */
  right: -1px;                 /* overlap right corner */
  bottom: -1px;
  height: 2px;                 /* covers the rail fully */
  background: #fff;            /* exact tab background */
  z-index: 3;                  /* sits above rail */
}

/* Small phones */
@media (max-width:480px){
  .toolbar .tabs-bar{ gap:0; }
  .toolbar .tabs-bar .tab-btn{ padding:6px 10px; height:30px; }
}


/* When tabs live inside the toolbar, drop their outside margins and hide the old rule line */
.toolbar .tabs-bar { margin: 0; }
.toolbar .tabs-rule { display: none; }

/* Mask the baseline under the active tab so NO line peeks through */
.toolbar .tabs-bar .tab-btn.active::after{
  content:"";
  position:absolute;
  left:-1px;
  right:-1px;
  bottom:-1px;
  height:2px;               /* covers the 1px rail comfortably */
  background:#FFFFFF;       /* EXACT match to .toolbar bg */
  z-index:-1;               /* sits behind the tab face, above the rail */
}

/* ===== Restored page-local layout from original newpatient/all-styles ===== */

/* Keep toolbar content centered with the same cap used by the original page */
body.newpatient-page .toolbar-center
{
    max-width: 1100px;
    margin: 0 auto;
}

/* Tabs row inside the gray toolbar */
.analysis-row--tabs
{
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0 0 10px 0;
}

.toolbar .tabs-bar
{
    position: relative;
    display: flex;
    gap: 2px;
    margin: 0;
    padding: 0;
    border-bottom: none;
}

.toolbar .tabs-bar::after
{
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -1px;
    width: 100vw;
    border-bottom: 1px solid #9aa3b0;
    pointer-events: none;
    z-index: 0;
}

.toolbar .tabs-bar .tab-btn
{
    appearance: none;
    background: #d8dbe2;
    color: #475569;
    font-weight: 600;
    padding: 6px 12px;
    height: 32px;
    line-height: 20px;
    border: 1px solid #9aa3b0;
    border-bottom-color: #9aa3b0;
    border-radius: 4px 4px 0 0;
    margin: 0;
    position: relative;
    top: 1px;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 #ffffff,
        inset -1px -1px 0 #cfd3d9;
}

.toolbar .tabs-bar .tab-btn:hover
{
    background: #cfd3da;
}

.toolbar .tabs-bar .tab-btn.active
{
    background: #ffffff;
    color: #0f172a;
    border-color: #000000;
    border-bottom: none;
    position: relative;
    z-index: 2;
}

/* already present earlier too, but kept here last so the active tab fully masks the rail */
.toolbar .tabs-bar .tab-btn.active::after
{
    content: "";
    position: absolute;
    left: -1px;
    right: -1px;
    bottom: -1px;
    height: 2px;
    background: #ffffff;
    z-index: 3;
}

/* Tab panels */
.tab-section
{
    display: none;
    background: #ffffff;
    border: none;
    border-radius: 0;
    padding: 12px;
    max-width: 1100px;
    margin: 0 auto 6px auto;
}

.tab-section.active
{
    display: block;
}

[hidden]
{
    display: none !important;
}

/* Make the stacked diagnosis sections meet tightly like the original */
#section-diagnosis3
{
    padding-bottom: 1px;
}

#section-diagnosis2
{
    padding-top: 1px;
}

/* Diagnosis launcher/buttons */
.action-launcher
{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.blue-button
{
    background-color: #003366;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
}

.blue-button:hover
{
    opacity: 0.9;
}

.pill-btn
{
    background: #003366;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
    cursor: pointer;
    height: 36px;
}

.pill-btn:hover
{
    opacity: 0.92;
}

/* Patient panel centering / grid */
.container
{
    max-width: 1100px;
    margin: 0 auto;
    background-color: transparent !important;
}

#patient-form-grid
{
    display: grid;
    grid-template-columns: 260px 1fr;
    column-gap: 14px;
    row-gap: 10px;
    align-items: center;
    border: none !important;
}

#patient-form-grid .span-2
{
    grid-column: 1 / -1;
}

#patient-form-grid .form-label
{
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

#patient-form-grid .form-label label
{
    display: inline-block;
    white-space: nowrap;
}

#patient-form-grid .form-field > input,
#patient-form-grid .form-field > select,
#patient-form-grid .form-field > textarea
{
    width: 100%;
    box-sizing: border-box;
}

#patient-form-grid .form-field > input,
#patient-form-grid .form-field > select
{
    height: 32px;
}

#patient-form-grid .form-field > textarea
{
    min-height: 90px;
    resize: vertical;
}

.patient-header
{
    text-align: center;
    margin-bottom: 1px;
}

.patient-header h3
{
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.patient-buttons
{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
    width: 100%;
    margin: 0 auto;
    background-color: transparent;
}

.patient-buttons .blue-button
{
    min-width: 160px;
    height: 36px;
    margin: 0;
}

@media (max-width: 900px)
{
    #patient-form-grid
    {
        grid-template-columns: 1fr;
    }

    #patient-form-grid .form-label
    {
        text-align: left;
        justify-self: start;
    }

    #patient-form-grid .form-field
    {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px)
{
    .toolbar .tabs-bar
    {
        gap: 0;
    }

    .toolbar .tabs-bar .tab-btn
    {
        padding: 6px 10px;
        height: 30px;
    }
}

/* ===== Restored exact old layout engine from all-styles.css ===== */

#physician-query-group
{
  max-width: 680px;
  width: 100%;
}

/* Stack the toolbar into centered rows exactly like the old page */
.analysis-toolbar--stack
{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* Ensure the inner toolbar container spans the full gray bar */
.toolbar-center
{
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* The toolbar itself must contain the rows and provide the old spacing */
.toolbar
{
  background-color: #ffffff;
  padding: 12px 12px;
  box-sizing: border-box;
  position: relative;
  margin-bottom: 18px;
}

/* Generic centered row engine from the old page */
.analysis-row
{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  margin: 0;
}

/* Keep the top row compact */
.analysis-row--top
{
  margin-bottom: 0;
}

/* Bottom row: input group grows but stays centered and contained */
.analysis-row--bottom #physician-query-group
{
  flex: 1 1 520px;
  max-width: 720px;
  min-width: 240px;
  display: flex;
}

.analysis-row--bottom #physicianQuery
{
  width: auto;
  height: 36px;
  padding: 6px 8px;
  box-sizing: border-box;
  line-height: 1.2;
  resize: vertical;
  margin-bottom: 4px;
}

/* Original submit-button sizing behavior */
.analysis-row--bottom .analysis-submit
{
  background-color: #FFFFFF;
  color: #fff;
  width: 120px;
  height: 36px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  flex: 0 0 auto;
}

/* Keep lower strips clearly below the toolbar block */
.account-strip
{
  position: relative;
  z-index: 1;
  margin-top: 6px;
}

/* Very small phone behavior from the old page */
@media (max-width: 480px)
{
  .analysis-row--bottom #physician-query-group
  {
    flex-basis: 100%;
    max-width: 100%;
  }

  .analysis-row--bottom .analysis-submit
  {
    width: 100%;
    max-width: 320px;
  }
}


/* ===== Dashboard-style button visual override for patient/labs/images/analyze ===== */
body.newpatient-page .blue-button,
body.newpatient-page .pill-btn,
body.newpatient-page #btnUploadLabs,
body.newpatient-page #btnUploadImages
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    width: auto;
    max-width: calc(100vw - 40px);
    height: 34px;
    padding: 5px 12px;
    margin: 0;
    border-radius: 4px;
    background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
    color: #ffffff !important;
    font-size: 0.88rem !important;
    line-height: 1.1 !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.2),
        0 6px 14px rgba(23, 37, 84, 0.25);
    border: 1px solid rgba(15, 23, 42, 0.8);
    white-space: nowrap;
    text-shadow: 0 1px 0 rgba(0,0,0,0.25);
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    text-decoration: none;
}

body.newpatient-page .blue-button:hover,
body.newpatient-page .pill-btn:hover,
body.newpatient-page #btnUploadLabs:hover,
body.newpatient-page #btnUploadImages:hover
{
    background: linear-gradient(180deg, #2563eb 0%, #1e3a8a 100%);
    color: #ffffff !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.25),
        0 10px 20px rgba(23, 37, 84, 0.35);
    opacity: 1;
}

body.newpatient-page .pill-btn
{
    border-radius: 4px;
}

/* Keep inline-sized patient tab buttons matching the same visual style */
body.newpatient-page .patient-buttons .blue-button
{
    min-width: 120px;
    height: 34px;
    padding: 5px 12px;
}

/* Disabled buttons should keep the same family while clearly disabled */
body.newpatient-page .blue-button:disabled,
body.newpatient-page .pill-btn:disabled,
body.newpatient-page #btnUploadLabs:disabled,
body.newpatient-page #btnUploadImages:disabled
{
    opacity: 0.55;
    cursor: not-allowed !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.12),
        0 4px 10px rgba(23, 37, 84, 0.12);
}


/* ===== Images tab: remove extra blue wrapper layers ===== */
#section-images > .images-outer-wrapper
{
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 0 !important;
}

#section-images .images-inner-wrapper
{
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

#images-section,
#image-results-section
{
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
}


/* ===== Images Tab – Blue Styled Select Dropdowns ===== */

#section-images select
{
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    height: 36px;
    padding: 0 36px 0 12px;

    border: 1px solid #3b82f6;           /* blue border */
    border-radius: 8px;

    background-color: #eff6ff;           /* very light blue */
    color: #1e3a8a;                      /* deep blue text */

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
    transition: all 0.15s ease-in-out;

    /* BLUE caret */
    background-image: url("data:image/svg+xml;utf8,<svg fill='%233b82f6' height='12' viewBox='0 0 20 20' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

/* Hover */
#section-images select:hover
{
    background-color: #dbeafe;           /* slightly stronger blue */
    border-color: #2563eb;               /* darker blue */
}

/* Focus */
#section-images select:focus
{
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
    background-color: #dbeafe;
}

/* Active (click) */
#section-images select:active
{
    background-color: #bfdbfe;
}

/* Disabled */
#section-images select:disabled
{
    background-color: #e2e8f0;
    border-color: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
}



/* ===== Labs Tab – Blue Styled Select Dropdown ===== */

#section-labs select
{
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    height: 36px;
    padding: 0 36px 0 12px;

    border: 1px solid #3b82f6;
    border-radius: 8px;

    background-color: #eff6ff;
    color: #1e3a8a;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
    transition: all 0.15s ease-in-out;

    /* Blue caret */
    background-image: url("data:image/svg+xml;utf8,<svg fill='%233b82f6' height='12' viewBox='0 0 20 20' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

/* Hover */
#section-labs select:hover
{
    background-color: #dbeafe;
    border-color: #2563eb;
}

/* Focus */
#section-labs select:focus
{
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
    background-color: #dbeafe;
}

/* Active */
#section-labs select:active
{
    background-color: #bfdbfe;
}

/* Disabled */
#section-labs select:disabled
{
    background-color: #e2e8f0;
    border-color: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
}




/* ===== Analyze Tab – Add Condition Dropdown ===== */

#section-diagnosis select,
#conditionFocusSelect
{
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    height: 36px;
    padding: 0 36px 0 12px;

    border: 1px solid #3b82f6;
    border-radius: 8px;

    background-color: #eff6ff;
    color: #1e3a8a;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
    transition: all 0.15s ease-in-out;

    /* Blue caret */
    background-image: url("data:image/svg+xml;utf8,<svg fill='%233b82f6' height='12' viewBox='0 0 20 20' width='12' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
}

/* Hover */
#section-diagnosis select:hover,
#conditionFocusSelect:hover
{
    background-color: #dbeafe;
    border-color: #2563eb;
}

/* Focus */
#section-diagnosis select:focus,
#conditionFocusSelect:focus
{
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
    background-color: #dbeafe;
}

/* Active */
#section-diagnosis select:active,
#conditionFocusSelect:active
{
    background-color: #bfdbfe;
}

/* Disabled */
#section-diagnosis select:disabled,
#conditionFocusSelect:disabled
{
    background-color: #e2e8f0;
    border-color: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
}


/* ===== Patient Name Row (Labs / Images / Analyze) ===== */

.patient-name-row-wrapper
{
    width: 100%;
    text-align: center;
}

.patient-name-row
{
    display: inline-block;
    margin: 10px auto 16px auto;
    font-size: 22px;
    font-weight: 700;
    color: #173f7a;
    border-bottom: 2px solid #000;
    padding-bottom: 6px;
    text-align: center;
}

.patient-name-row span
{
    font-weight: 800;
}

/* Center uploaded-image block as one unit */
#images-section .images-upload-group
{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

#images-section .images-upload-actions
{
    justify-content: center;
}

#images-section .image-uploads-scroll
{
    width: auto;
    max-width: 100%;
}

#images-section #imageUploadsList table
{
    width: auto !important;
    margin: 0 auto;
}

#images-section #imageUploadsList th,
#images-section #imageUploadsList td
{
    text-align: left;
}


/* Images uploads list boxed section */
.images-list-box
{
    border: 2px solid #000;
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    display: inline-block;
    max-width: 100%;
}


/* Images tab: centered arrow above Interpreted Image Findings */
.image-findings-arrow-wrap
{
    margin: 0 0 8px 0;
}

.image-hint-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.image-hint-wrapper input {
  width: 260px;
}

.image-hint-example {
  margin-top: 6px;
  font-style: italic;
  color: #334155;
  text-align: center;
}


/* Diagnosis tab: patient banner centered to match Start Analysis block */
.nvx-patient-name-banner-wrapper
{
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 0 12px 0;
    text-align: center;
}

.nvx-patient-name-banner
{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 6px;
    margin: 0 auto;
}

.nvx-patient-name-label
{
    font-size: 1.35rem;
    font-weight: 700;
    color: #173f7a;
}

.nvx-patient-name-value
{
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}


.print-analysis-above-title
{
    display: flex;
    justify-content: center;
    margin: 0 0 12px 0;
}


.print-analysis-below-nav-row
{
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 12px 0 18px 0;
}


.print-analysis-arrow-wrap
{
    margin: 18px 0 8px 0;
}


/* Image interpretation display-only fields */
.image-study-display-table td:nth-child(2)
{
    padding-left: 8px !important;
}

.image-study-display-box
{
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    background: #ffffff;
    padding: 12px 14px;
    min-height: 44px;
    line-height: 1.5;
    color: #0f172a;
    white-space: normal;
    overflow-wrap: anywhere;
}

.image-study-display-box--single
{
    padding-top: 10px;
    padding-bottom: 10px;
}

.image-study-display-paragraph
{
    margin: 0 0 12px 0;
}

.image-study-display-paragraph:last-child
{
    margin-bottom: 0;
}

.image-study-display-list
{
    margin: 0;
    padding-left: 1.4em;
    list-style-position: outside;
}

.image-study-display-list li
{
    margin: 0 0 12px 0;
    padding-left: 0.35em;
    white-space: normal;
}

.image-study-display-list li:last-child
{
    margin-bottom: 0;
}


/* Read-only image study display */
.image-study-display-table td:nth-child(2)
{
    padding-top: 10px;
    padding-bottom: 10px;
}

.image-study-display-box
{
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    line-height: 1.55;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: left;
}

.image-study-display-box--single
{
    min-height: 0;
}

.image-study-display-paragraph
{
    margin: 0 0 12px 0;
}

.image-study-display-paragraph:last-child
{
    margin-bottom: 0;
}

.image-study-display-list
{
    margin: 0;
    padding: 0;
    list-style: none;
}

.image-study-display-list li
{
    position: relative;
    margin: 0 0 14px 0;
    padding-left: 22px;
    line-height: 1.6;
}

.image-study-display-list li:last-child
{
    margin-bottom: 0;
}

.image-study-display-list li::before
{
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
}


/* Unified image selection and preview */
.unified-image-selection-row
{
    width: 100%;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.group-image-checklist-wrap
{
    flex: 1 1 46%;
    max-width: 560px;
    border: 1px solid #c9dced;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-sizing: border-box;
    min-height: 220px;
}

.unified-selected-preview-panel
{
    flex: 1 1 54%;
    min-width: 0;
    border: 1px solid #c9dced;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.unified-selected-preview-title,
.image-study-preview-title
{
    font-weight: 700;
    color: #173f7a;
    text-align: center;
    margin-bottom: 10px;
}

.unified-selected-preview-scroller
{
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.unified-selected-preview-box
{
    min-width: 100%;
}

.unified-selected-preview-track
{
    display: inline-flex;
    align-items: stretch;
    gap: 12px;
    min-width: min-content;
    padding-bottom: 6px;
}

.unified-selected-preview-card
{
    width: 190px;
    min-width: 190px;
    border: 1px solid #d7e6f6;
    border-radius: 10px;
    background: #f8fbff;
    padding: 10px;
    box-sizing: border-box;
}

.unified-selected-preview-name
{
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    margin-bottom: 8px;
    word-break: break-word;
}

.unified-selected-preview-thumb-wrap
{
    width: 100%;
    height: 140px;
    border: 1px solid #d7e6f6;
    border-radius: 8px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.unified-selected-preview-img
{
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.unified-selected-preview-link-row
{
    margin-top: 8px;
    text-align: center;
    font-size: 12px;
}

.unified-selected-preview-empty,
.unified-selected-preview-loading,
.unified-selected-preview-missing
{
    font-size: 13px;
    color: #64748b;
    text-align: center;
}

.unified-image-check-row
{
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 4px;
    border-bottom: 1px solid #e2e8f0;
}

.unified-image-check-row:last-child
{
    border-bottom: none;
}

.unified-image-action-row
{
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

@media (max-width: 980px)
{
    .unified-image-selection-row
    {
        flex-wrap: wrap;
    }

    .group-image-checklist-wrap,
    .unified-selected-preview-panel
    {
        flex: 1 1 100%;
        max-width: 100%;
    }
}


.image-study-richtext-paragraph
{
    margin: 0 0 10px 0;
    white-space: pre-wrap;
    line-height: 1.5;
}

.image-study-richtext-list
{
    margin: 0;
    padding-left: 22px;
    list-style-position: outside;
}

.image-study-richtext-list li
{
    margin: 0 0 10px 0;
    padding-left: 6px;
    line-height: 1.5;
}

.image-study-richtext-list li:last-child
{
    margin-bottom: 0;
}


/* Layout tweak: preview below file list */
.unified-image-selection-row
{
    width: 100%;
    display: flex;
    justify-content: center;
}

.group-image-checklist-wrap
{
    width: 100%;
    max-width: 1080px;
}

.unified-selected-preview-panel--below
{
    width: 100%;
    max-width: 1080px;
    margin-top: 14px;
}

.unified-image-action-row--below-arrow
{
    margin-top: 4px;
    margin-bottom: 2px;
}

.image-findings-divider
{
    width: 100%;
    max-width: 1080px;
    height: 20px;
    background: #d9dde3;
    border-radius: 2px;
    margin: 16px auto 0 auto;
}

.image-findings-heading-line
{
    width: 100%;
    max-width: 1080px;
    height: 2px;
    background: #9aa3af;
    margin: 12px auto 0 auto;
}

.image-hints-arrow-wrap
{
    margin-top: 4px;
    margin-bottom: 4px;
}


.image-study-action-row--below-preview-title
{
    margin-top: 0;
    margin-bottom: 12px;
}

.image-study-edit-input,
.image-study-edit-textarea
{
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #b8c8da;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
}

.image-study-edit-textarea
{
    resize: vertical;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.image-study-edit-textarea--small
{
    min-height: 64px;
}

.image-study-edit-textarea--medium
{
    min-height: 96px;
}

.image-study-edit-textarea--large
{
    min-height: 150px;
}

.image-study-edit-textarea--bullets
{
    padding-left: 16px;
}


.image-interpret-hints-row--prompt
{
    margin-top: 4px;
    margin-bottom: 2px;
}

.image-study-edit-textarea
{
    resize: none;
    overflow-y: hidden;
}

.image-study-edit-textarea--small
{
    min-height: 96px;
}

.image-study-edit-textarea--medium
{
    min-height: 160px;
}

.image-study-edit-textarea--large
{
    min-height: 260px;
}


.image-findings-divider--below-counter
{
    margin-top: 12px;
}

.unified-selected-preview-scroller--centered
{
    display: flex;
    justify-content: center;
}

.unified-selected-preview-box--centered
{
    display: flex;
    justify-content: center;
    width: 100%;
}

.unified-selected-preview-box--centered .unified-selected-preview-track
{
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 900px)
{
    .unified-selected-preview-scroller--centered
    {
        justify-content: flex-start;
    }

    .unified-selected-preview-box--centered
    {
        justify-content: flex-start;
    }

    .unified-selected-preview-box--centered .unified-selected-preview-track
    {
        justify-content: flex-start;
        margin-left: 0;
        margin-right: 0;
    }
}


.image-study-action-row--above-form
{
    margin-top: 18px;
    margin-bottom: 22px;
}

.image-study-action-row--above-form .image-study-action-buttons
{
    gap: 18px;
}



.unified-selected-preview-scroller--lower
{
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    display: block;
    padding-bottom: 6px;
}

.unified-selected-preview-box--lower
{
    width: max-content;
    min-width: 100%;
    display: block;
}

.unified-selected-preview-track--lower
{
    display: inline-flex;
    align-items: stretch;
    gap: 12px;
    min-width: max-content;
    flex-wrap: nowrap !important;
}

.unified-selected-preview-track--lower .unified-selected-preview-card
{
    flex: 0 0 190px;
    width: 190px;
    min-width: 190px;
}

@media (max-width: 700px)
{
    .unified-selected-preview-track--lower .unified-selected-preview-card
    {
        flex: 0 0 170px;
        width: 170px;
        min-width: 170px;
    }

    .unified-selected-preview-track--lower .unified-selected-preview-thumb-wrap
    {
        height: 120px;
    }
}

/* ===== Shared elapsed-time progress panels: Analyze, Labs, Images ===== */
body.newpatient-page .np-elapsed-progress-panel
{
    display: block;
    width: min(760px, calc(100% - 32px));
    margin: 18px auto 24px;
    padding: 22px 24px 18px;
    box-sizing: border-box;
    text-align: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
}

body.newpatient-page .np-elapsed-progress-wrap
{
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

body.newpatient-page .np-elapsed-progress-title
{
    margin-bottom: 8px;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 700;
}

body.newpatient-page .np-elapsed-progress-track
{
    position: relative;
    width: 100%;
    height: 18px;
    overflow: hidden;
    box-sizing: border-box;
    background: #e2e8f0;
    border: 1px solid #94a3b8;
    border-radius: 999px;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.16);
}

body.newpatient-page .np-elapsed-progress-fill
{
    position: relative;
    width: 0;
    height: 100%;
    min-width: 0;
    background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 72%, #22c55e 100%);
    border-radius: inherit;
    transition: width 1s linear;
}

body.newpatient-page .np-elapsed-progress-fill::after
{
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 8px;
    height: 8px;
    transform: translate(0, -50%);
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.25);
}

body.newpatient-page .np-elapsed-progress-scale
{
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 7px;
    color: #475569;
    font-size: 0.78rem;
    line-height: 1;
}

body.newpatient-page .np-elapsed-progress-message
{
    margin: 18px auto 0;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
}

body.newpatient-page .np-elapsed-progress-spinner
{
    display: block;
    margin: 14px auto 0;
}

body.newpatient-page .np-legacy-spinner-hook,
body.newpatient-page .np-legacy-busy-spinner
{
    display: none !important;
}

/* Analyze progress is always visible below the Start Now controls. */
body.newpatient-page .np-diagnosis-progress-placement
{
    width: 100%;
    margin-top: 24px;
}

body.newpatient-page #diagnosis-progress-panel
{
    margin-bottom: 8px;
}

/* Dynamic analysis title with contextual Print button. */
body.newpatient-page .np-analysis-title-row
{
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    width: 100%;
    max-width: 980px;
    margin: 0 auto 2px;
    padding: 2px;
    box-sizing: border-box;
    text-align: left;
}

body.newpatient-page .np-analysis-title-row #analysisTitle
{
    flex: 0 1 auto;
}

body.newpatient-page .np-analysis-inline-print
{
    min-width: 72px;
    width: auto;
    height: 32px;
    padding: 4px 12px;
    flex: 0 0 auto;
}

/* Labs progress is always visible directly below Selected file. */
body.newpatient-page .np-labs-progress-placement
{
    width: 100%;
    margin-top: 4px;
}

body.newpatient-page #labs-progress-panel
{
    margin-top: 10px;
    margin-bottom: 4px;
}

/* Images progress is always visible directly below Interpret Selected Image(s). */
body.newpatient-page .np-images-progress-placement
{
    width: 100%;
    margin-top: 2px;
}

body.newpatient-page #images-progress-panel
{
    margin-top: 14px;
    margin-bottom: 22px;
}

@media (max-width: 600px)
{
    body.newpatient-page .np-elapsed-progress-panel
    {
        width: calc(100% - 16px);
        padding: 18px 12px 16px;
    }

    body.newpatient-page .np-elapsed-progress-scale
    {
        font-size: 0.68rem;
    }

    body.newpatient-page .np-elapsed-progress-message
    {
        font-size: 0.88rem;
        line-height: 1.4;
    }

    body.newpatient-page .np-analysis-title-row
    {
        gap: 10px;
        padding-left: 8px;
        padding-right: 8px;
    }

    body.newpatient-page .np-analysis-title-row #analysisTitle
    {
        font-size: 1.35rem;
    }
}


/* ===== Permanent Stop controls for client-side polling ===== */
body.newpatient-page .np-elapsed-progress-actions
{
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 14px;
}

body.newpatient-page .np-stop-processing-button
{
    min-width: 94px;
    height: 34px;
    padding: 0 16px;
    border: 1px solid #991b1b;
    border-radius: 6px;
    background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 12px rgba(127, 29, 29, 0.22);
}

body.newpatient-page .np-stop-processing-button:hover:not(:disabled)
{
    background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
}

body.newpatient-page .np-stop-processing-button:disabled
{
    opacity: 0.42;
    cursor: not-allowed;
    box-shadow: none;
}


/* ===== Inline required-field validation for Patient Info ===== */
body.newpatient-page .np-required-field-invalid
{
    border-color: #dc4c3f !important;
    background: #fff7f6 !important;
    color: #b42318 !important;
    box-shadow: 0 0 0 3px rgba(220, 76, 63, 0.16) !important;
}

body.newpatient-page .np-required-field-invalid::placeholder
{
    color: #c9372c !important;
    opacity: 1;
}

body.newpatient-page .np-required-field-message
{
    margin-top: 6px;
    color: #c9372c;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    text-align: left;
}

body.newpatient-page .np-patient-validation-status
{
    min-height: 22px;
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
}

body.newpatient-page .np-patient-validation-status.is-error
{
    color: #166534;
}

body.newpatient-page .np-patient-validation-status.is-success
{
    color: #166534;
}

body.newpatient-page #btnSavePatientMain.np-save-required
{
    box-shadow: 0 0 0 4px rgba(220, 76, 63, 0.22), 0 6px 14px rgba(23, 37, 84, 0.25) !important;
}

/* Required patient-field validation: account for fixed shared header and tabs. */
body.newpatient-page .np-required-field-invalid,
body.newpatient-page .np-required-field-message,
body.newpatient-page #btnSavePatientMain.np-save-required
{
    scroll-margin-top: calc(var(--nvx-nav-total-height, 150px) + var(--np-tabs-toolbar-height, 64px) + 24px);
}

/* ===== Patient intake quick-entry dropdowns ===== */
.np-quick-dropdown
{
    position: relative;
    width: 50%;
    max-width: 100%;
    min-width: 260px;
    margin-top: 6px;
    box-sizing: border-box;
}

.np-quick-dropdown-summary
{
    display: flex;
    align-items: center;
    width: 100%;
    height: 32px;
    padding: 5px 36px 5px 10px;
    box-sizing: border-box;
    border: 1px solid #aeb7c4;
    border-radius: 4px;
    background:
        linear-gradient(45deg, transparent 50%, #ffffff 50%) calc(100% - 18px) 13px / 6px 6px no-repeat,
        linear-gradient(135deg, #ffffff 50%, transparent 50%) calc(100% - 12px) 13px / 6px 6px no-repeat,
        linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: left;
    cursor: pointer;
    list-style: none;
    user-select: none;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.2),
        0 3px 8px rgba(23,37,84,0.2);
}

.np-quick-dropdown-summary::-webkit-details-marker
{
    display: none;
}

.np-quick-dropdown-summary:hover,
.np-quick-dropdown[open] > .np-quick-dropdown-summary
{
    background:
        linear-gradient(45deg, transparent 50%, #ffffff 50%) calc(100% - 18px) 13px / 6px 6px no-repeat,
        linear-gradient(135deg, #ffffff 50%, transparent 50%) calc(100% - 12px) 13px / 6px 6px no-repeat,
        linear-gradient(180deg, #2563eb 0%, #1e3a8a 100%);
}

.np-quick-dropdown-summary:focus-visible
{
    outline: 3px solid rgba(22,101,52,0.2);
    outline-offset: 2px;
}

.np-quick-dropdown-menu
{
    position: absolute;
    z-index: 1200;
    left: 0;
    right: 0;
    top: calc(100% + 3px);
    max-height: 260px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    background: #ffffff;
    box-sizing: border-box;
    box-shadow: 0 10px 24px rgba(15,23,42,0.22);
}

.np-quick-dropdown-option
{
    position: relative;
    display: block;
    min-height: 31px;
    padding: 7px 34px 7px 10px;
    box-sizing: border-box;
    border-radius: 3px;
    color: #0f172a;
    background: #ffffff;
    font-size: 0.9rem;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.np-quick-dropdown-option:hover,
.np-quick-dropdown-option:focus-visible
{
    background: #e8eef9;
    outline: none;
}

.np-quick-dropdown-option.is-selected
{
    background: #dbeafe;
    color: #172554;
    font-weight: 700;
}

.np-quick-dropdown-option.is-selected::after
{
    content: "✓";
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 800;
}

@media (max-width: 700px)
{
    .np-quick-dropdown
    {
        width: 100%;
        min-width: 0;
    }

    .np-quick-dropdown-menu
    {
        max-height: 220px;
    }
}

/* ===== General analysis report header and report-section navigation ===== */
.np-analysis-title-row
{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
}

#analysisTitle
{
    margin: 0 !important;
    color: #173f7a !important;
    font-size: 28px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    text-align: center !important;
}

#diagnosisResult .dx-general-report-meta
{
    margin: 0 0 14px 0;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.45;
}

#diagnosisResult .dx-general-report-meta strong
{
    font-weight: 800;
}

#diagnosisResult .dx-general-report-sections
{
    margin: 0 0 24px 0;
    padding: 16px 18px;
    border: 1px solid #c7d7ec;
    border-radius: 8px;
    background: #f2f6fc;
    box-sizing: border-box;
}

#diagnosisResult .dx-general-report-sections-title
{
    margin: 0 0 10px 0;
    color: #173f7a;
    font-size: 18px;
    font-weight: 800;
}

#diagnosisResult .dx-general-report-sections-columns
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 48px;
    align-items: start;
}

#diagnosisResult .dx-general-report-sections-list
{
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    min-width: 0;
}

#diagnosisResult .dx-general-report-sections-list > li
{
    min-width: 0;
}

#diagnosisResult .dx-general-report-sections-list a
{
    display: block;
    color: #17498e;
    font-weight: 650;
    text-decoration: none;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

#diagnosisResult .dx-general-report-diagnosis-links
{
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 6px 0 2px 0;
    padding: 0 0 0 18px;
    list-style: none;
}

#diagnosisResult .dx-general-report-diagnosis-links li
{
    min-width: 0;
}

#diagnosisResult .dx-general-report-diagnosis-links a
{
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 600;
    font-size: 0.95em;
}

#diagnosisResult .dx-general-report-sections-list a:hover,
#diagnosisResult .dx-general-report-sections-list a:focus
{
    text-decoration: underline;
}

#diagnosisResult .dx-general-report-anchor
{
    scroll-margin-top: calc(var(--nvx-nav-total-height) + var(--np-tabs-toolbar-height) + 18px);
}

@media (max-width: 760px)
{
    #analysisTitle
    {
        font-size: 24px !important;
    }

    #diagnosisResult .dx-general-report-sections-columns
    {
        grid-template-columns: 1fr;
        row-gap: 8px;
    }
}

@media print
{
    #diagnosisResult .dx-general-report-sections a
    {
        color: #173f7a !important;
        text-decoration: none !important;
    }
}

/* ===== Report sections: centered single-column navigation ===== */
.np-analysis-title-row
{
    width: fit-content !important;
    max-width: calc(100% - 24px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
    text-align: center !important;
}

#diagnosisResult .dx-general-report-sections-title
{
    text-align: center !important;
}

#diagnosisResult .dx-general-report-sections-columns
{
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    row-gap: 8px !important;
}

#diagnosisResult .dx-general-report-sections-list
{
    width: fit-content !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    align-items: stretch !important;
}

#diagnosisResult .dx-general-report-sections-list > li
{
    width: 100% !important;
}

#diagnosisResult .dx-general-report-sections-list a
{
    text-align: left !important;
}

/* ===== Table of contents: compact centered single-column box ===== */
#diagnosisResult .dx-general-report-sections
{
    display: table !important;
    width: auto !important;
    max-width: calc(100% - 36px) !important;
    margin: 0 auto 24px auto !important;
    padding: 16px 24px 18px !important;
}

#diagnosisResult .dx-general-report-sections-title
{
    display: table !important;
    width: auto !important;
    margin: 0 auto 12px auto !important;
    padding: 0 8px 5px !important;
    border-bottom: 1px solid #111827 !important;
    text-align: center !important;
}

#diagnosisResult .dx-general-report-sections-columns
{
    display: block !important;
    width: auto !important;
}

#diagnosisResult .dx-general-report-sections-list
{
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: fit-content !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

#diagnosisResult .dx-general-report-sections-list > li
{
    width: auto !important;
}

#diagnosisResult .dx-general-report-sections-list a
{
    width: auto !important;
    text-align: left !important;
}

/* Keep the analysis title and Print button centered as one visual unit. */
body.newpatient-page .np-analysis-title-row
{
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}


/* ===== Report metadata and return-to-TOC controls ===== */
#diagnosisResult .dx-general-report-meta
{
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

#diagnosisResult .dx-general-back-to-toc
{
    width: 100%;
    margin: 18px 0 8px;
    text-align: right;
}

#diagnosisResult .dx-general-back-to-toc a
{
    color: #173f7a;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#diagnosisResult .dx-general-back-to-toc a:hover,
#diagnosisResult .dx-general-back-to-toc a:focus-visible
{
    color: #0f2f63;
}

@media print
{
    #diagnosisResult .dx-general-back-to-toc
    {
        display: none !important;
    }
}


/* ===== TOC return positioning and compact diagnosis shortcuts ===== */
#diagnosisResult .dx-general-report-sections,
#diagnosisResult #dx-general-report-toc
{
    scroll-margin-top: calc(var(--nvx-nav-total-height, 0px) + var(--np-tabs-toolbar-height, 64px) + 18px) !important;
}

#diagnosisResult .dx-general-report-diagnosis-links
{
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    margin: 8px 0 0 18px !important;
    padding: 0 !important;
    list-style: none !important;
}

#diagnosisResult .dx-general-report-diagnosis-links li
{
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

#diagnosisResult .dx-general-report-diagnosis-links li:not(:last-child)::after
{
    content: " | ";
    display: inline-block;
    margin: 0 8px;
    color: #173f7a;
    font-weight: 700;
}

#diagnosisResult .dx-general-report-diagnosis-links a
{
    display: inline !important;
    width: auto !important;
    max-width: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

#diagnosisResult .dx-general-back-to-toc
{
    text-align: center !important;
}


/* ===== General analysis diagnosis title callouts ===== */
#diagnosisResult .dx-general-diagnosis-title
{
    display: grid !important;
    grid-template-columns: max-content minmax(0, max-content) !important;
    align-items: start !important;
    column-gap: 0.38em !important;
    width: fit-content !important;
    max-width: calc(100% - 32px) !important;
    box-sizing: border-box !important;
    margin: 24px auto 14px auto !important;
    padding: 11px 16px !important;
    border: 1px solid #c7d7ec !important;
    border-radius: 10px !important;
    background: #f2f6fc !important;
    color: #173f7a !important;
    font-size: 18px !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    text-align: left !important;
    overflow-wrap: normal !important;
}

#diagnosisResult .dx-general-diagnosis-title-prefix
{
    grid-column: 1 !important;
    white-space: nowrap !important;
}

#diagnosisResult .dx-general-diagnosis-title-description
{
    grid-column: 2 !important;
    min-width: 0 !important;
    white-space: normal !important;
}

@media (max-width: 760px)
{
    #diagnosisResult .dx-general-diagnosis-title
    {
        max-width: calc(100% - 20px) !important;
        padding: 10px 13px !important;
        font-size: 17px !important;
    }
}


/* ==========================================================
   General-analysis recommendation: Medication Review modal
   ========================================================== */

body.np-medication-review-modal-open
{
    overflow: hidden;
}

.np-medication-review-modal[hidden]
{
    display: none;
}

.np-medication-review-modal
{
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.np-medication-review-modal-backdrop
{
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
}

.np-medication-review-dialog
{
    position: relative;
    z-index: 1;
    width: min(560px, calc(100vw - 36px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-sizing: border-box;
    border: 1px solid #b9c9dc;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    padding: 30px 30px 26px;
    text-align: center;
}

.np-medication-review-dialog h2
{
    margin: 8px 0 12px;
    color: #173f7a;
    font-size: 26px;
    line-height: 1.2;
}

.np-medication-review-dialog p
{
    margin: 0 auto;
    max-width: 470px;
    color: #26384d;
    font-size: 16px;
    line-height: 1.55;
}

.np-medication-review-icon
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #e9f7ee;
    color: #16733a;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -1px;
}

.np-medication-review-close
{
    position: absolute;
    top: 10px;
    right: 13px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #53657a;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.np-medication-review-close:hover,
.np-medication-review-close:focus-visible
{
    color: #173f7a;
}

.np-medication-review-actions
{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.np-medication-review-start,
.np-medication-review-later
{
    min-width: 180px;
}

@media (max-width: 600px)
{
    .np-medication-review-modal
    {
        padding: 16px;
    }

    .np-medication-review-dialog
    {
        width: calc(100vw - 24px);
        padding: 28px 18px 22px;
    }

    .np-medication-review-dialog h2
    {
        font-size: 22px;
    }

    .np-medication-review-actions
    {
        flex-direction: column;
    }

    .np-medication-review-start,
    .np-medication-review-later
    {
        width: 100%;
    }
}


/* Hidden machine-readable metadata emitted by the diagnosis model. */
.nvx-medication-review-recommendation-flag
{
    display: none !important;
}

/* Polite action/status messages: consistent bold emphasis. */
.condition-focus-validation-status,
.np-tab-validation-status,
.np-patient-validation-status,
.nvx-unified-action-status,
.nvx-persistent-status-unified-flash
{
    font-weight: 700 !important;
}
