
/* ===== 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;
}


/* ===== Medication-Related Clinical Review page ===== */
body.medicationreview-page
{
    --np-tabs-toolbar-top: calc(var(--nvx-nav-total-height) + 18px);
    --np-tabs-toolbar-height: 64px;
    background: #ffffff;
}

body.medicationreview-page .app-page-shell
{
    background: #ffffff !important;
}

body.medicationreview-page .mr-main
{
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0.3rem 18px 50px 18px;
    box-sizing: border-box;
}

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

body.medicationreview-page .app-page-content
{
    padding-top: calc(var(--np-tabs-toolbar-height) + 2px);
}

body.medicationreview-page .tab-section[hidden]
{
    display: none !important;
}

body.medicationreview-page .mr-page-heading
{
    text-align: center;
    margin: 18px auto 24px auto;
    max-width: 940px;
}

body.medicationreview-page .mr-page-heading h1
{
    color: #173f7a;
    font-size: 2rem;
    margin: 0 0 10px 0;
}

body.medicationreview-page .mr-page-heading p
{
    margin: 0;
    color: #334155;
    line-height: 1.55;
}

body.medicationreview-page .mr-card
{
    max-width: 980px;
    margin: 18px auto;
    padding: 22px;
    box-sizing: border-box;
    text-align: left;
    background: #ffffff;
    border: 1px solid #c9dced;
    border-radius: 10px;
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.07);
}

body.medicationreview-page .mr-card h2
{
    margin: 0 0 18px 0;
    color: #173f7a;
    text-align: center;
}

body.medicationreview-page .mr-existing-grid
{
    display: grid;
    gap: 12px;
}

body.medicationreview-page .mr-existing-grid > div
{
    display: grid;
    grid-template-columns: minmax(170px, 230px) 1fr;
    gap: 14px;
    padding: 10px 12px;
    background: #f8fbff;
    border-radius: 6px;
}

body.medicationreview-page .mr-k
{
    font-weight: 700;
    color: #0f172a;
}

body.medicationreview-page .mr-form-grid
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

body.medicationreview-page .mr-field
{
    display: flex;
    flex-direction: column;
    gap: 7px;
}

body.medicationreview-page .mr-field-wide
{
    grid-column: 1 / -1;
}

body.medicationreview-page .mr-field > span
{
    font-weight: 700;
    color: #0f172a;
}

body.medicationreview-page .mr-field b
{
    color: #b00020;
}

body.medicationreview-page .mr-field input,
body.medicationreview-page .mr-field textarea
{
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #94a3b8;
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
    color: #0f172a;
    background: #ffffff;
}

body.medicationreview-page .mr-field textarea
{
    resize: vertical;
    min-height: 84px;
}

body.medicationreview-page .mr-field input:focus-visible,
body.medicationreview-page .mr-field textarea:focus-visible
{
    outline: 3px solid rgba(23, 63, 122, 0.18);
    outline-offset: 2px;
    border-color: #173f7a;
}

body.medicationreview-page .mr-action-row
{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 24px 0 8px 0;
}

body.medicationreview-page .mr-secondary-button
{
    background: linear-gradient(180deg, #475569 0%, #334155 100%);
}

body.medicationreview-page .mr-status
{
    min-height: 24px;
    margin-top: 12px;
    text-align: center;
    font-weight: 600;
    color: #166534;
}

body.medicationreview-page .mr-readiness-card
{
    text-align: center;
}

body.medicationreview-page .mr-divider
{
    width: 100%;
    max-width: 980px;
    margin: 28px auto;
    border-top: 2px solid #173f7a;
}

body.medicationreview-page .mr-results-card
{
    min-height: 180px;
}

body.medicationreview-page .np-elapsed-progress-panel
{
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 760px)
{
    body.medicationreview-page .mr-main
    {
        padding-left: 10px;
        padding-right: 10px;
    }

    body.medicationreview-page .mr-form-grid
    {
        grid-template-columns: 1fr;
    }

    body.medicationreview-page .mr-field-wide
    {
        grid-column: auto;
    }

    body.medicationreview-page .mr-existing-grid > div
    {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    body.medicationreview-page .mr-action-row .blue-button,
    body.medicationreview-page .mr-action-row .pill-btn
    {
        width: 100%;
        max-width: 340px;
    }
}


/* ===== Medication-review report history and deterministic table layout (rev2) ===== */
.medicationreview-page .mr-history-nav
{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 4px auto 12px;
}

.medicationreview-page .mr-history-counter
{
    min-width: 54px;
    text-align: center;
    font-weight: 700;
    color: #334155;
}

.medicationreview-page .mr-history-nav button:disabled
{
    opacity: 0.45;
    cursor: not-allowed;
}

.medicationreview-page .mr-delete-review
{
    margin-left: 8px;
}

.medicationreview-page #mrResults
{
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    box-sizing: border-box;
    text-align: left;
}

.medicationreview-page #mrResults .medication-review-report,
.medicationreview-page #mrResults .dx-report
{
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.medicationreview-page #mrResults .mr-report-table-wrap
{
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin: 14px 0 22px;
    box-sizing: border-box;
}

.medicationreview-page #mrResults table.dx-table,
.medicationreview-page #mrResults table.mr-report-table
{
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    table-layout: fixed !important;
    box-sizing: border-box !important;
    font-size: 0.94rem;
}

.medicationreview-page #mrResults table.dx-table th,
.medicationreview-page #mrResults table.dx-table td,
.medicationreview-page #mrResults table.mr-report-table th,
.medicationreview-page #mrResults table.mr-report-table td
{
    position: static !important;
    float: none !important;
    display: table-cell !important;
    height: auto !important;
    border: 1px solid #9aa6b8 !important;
    padding: 10px 12px !important;
    text-align: left !important;
    vertical-align: top !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    box-sizing: border-box !important;
}

.medicationreview-page #mrResults table.dx-table th::after,
.medicationreview-page #mrResults table.dx-table td::after,
.medicationreview-page #mrResults table.mr-report-table th::after,
.medicationreview-page #mrResults table.mr-report-table td::after
{
    content: none !important;
}

.medicationreview-page #mrResults table.dx-table th,
.medicationreview-page #mrResults table.mr-report-table th
{
    background: #eef3f8 !important;
    color: #172033 !important;
    font-weight: 700 !important;
}

.medicationreview-page #mrResults .mr-table-timeline th:nth-child(1) { width: 22%; }
.medicationreview-page #mrResults .mr-table-timeline th:nth-child(2) { width: 34%; }
.medicationreview-page #mrResults .mr-table-timeline th:nth-child(3) { width: 44%; }

.medicationreview-page #mrResults .mr-table-medications { font-size: 0.9rem; }
.medicationreview-page #mrResults .mr-table-medications th:nth-child(1) { width: 15%; }
.medicationreview-page #mrResults .mr-table-medications th:nth-child(2) { width: 18%; }
.medicationreview-page #mrResults .mr-table-medications th:nth-child(3) { width: 27%; }
.medicationreview-page #mrResults .mr-table-medications th:nth-child(4) { width: 27%; }
.medicationreview-page #mrResults .mr-table-medications th:nth-child(5) { width: 13%; }

.medicationreview-page #mrResults .mr-table-hypotheses { font-size: 0.9rem; }
.medicationreview-page #mrResults .mr-table-hypotheses th:nth-child(1) { width: 6%; }
.medicationreview-page #mrResults .mr-table-hypotheses th:nth-child(2) { width: 25%; }
.medicationreview-page #mrResults .mr-table-hypotheses th:nth-child(3) { width: 22%; }
.medicationreview-page #mrResults .mr-table-hypotheses th:nth-child(4) { width: 20%; }
.medicationreview-page #mrResults .mr-table-hypotheses th:nth-child(5) { width: 10%; }
.medicationreview-page #mrResults .mr-table-hypotheses th:nth-child(6) { width: 17%; }

.medicationreview-page #mrResults .mr-table-modifications th:nth-child(1) { width: 22%; }
.medicationreview-page #mrResults .mr-table-modifications th:nth-child(2) { width: 24%; }
.medicationreview-page #mrResults .mr-table-modifications th:nth-child(3) { width: 22%; }
.medicationreview-page #mrResults .mr-table-modifications th:nth-child(4) { width: 32%; }

@media (max-width: 800px)
{
    .medicationreview-page #mrResults table.dx-table,
    .medicationreview-page #mrResults table.mr-report-table
    {
        min-width: 760px !important;
    }
}


/* Medication review report table of contents */
.medicationreview-page #mrResults .mr-report-toc
{
    margin: 18px 0 24px;
    padding: 16px 18px;
    border: 1px solid #b8c8dc;
    border-radius: 8px;
    background: #f5f8fc;
    text-align: left;
}

.medicationreview-page #mrResults .mr-report-toc-title
{
    margin-bottom: 9px;
    color: #173f7a;
    font-size: 1.05rem;
    font-weight: 800;
}

.medicationreview-page #mrResults .mr-report-toc ul
{
    columns: 2;
    column-gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.medicationreview-page #mrResults .mr-report-toc li
{
    margin: 5px 0;
    padding: 0;
    break-inside: avoid;
}

.medicationreview-page #mrResults .mr-report-toc a
{
    color: #174f91;
    font-weight: 600;
    text-decoration: none;
}

.medicationreview-page #mrResults .mr-report-toc a:hover,
.medicationreview-page #mrResults .mr-report-toc a:focus-visible
{
    text-decoration: underline;
}

.medicationreview-page #mrResults .mr-report-section-heading
{
    scroll-margin-top: calc(var(--nvx-nav-total-height) + var(--np-tabs-toolbar-height) + 18px);
}

.medicationreview-page .mr-print-review
{
    min-width: 150px;
}

@media (max-width: 700px)
{
    .medicationreview-page #mrResults .mr-report-toc ul
    {
        columns: 1;
    }
}


/* Status for the currently selected or running medication review sits below history controls. */
.medicationreview-page .mr-history-status-row
{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 980px;
    margin: 0 auto 14px;
    min-height: 34px;
    text-align: center;
}

.medicationreview-page .mr-history-status-message
{
    margin: 0;
    padding: 0;
    font-weight: 600;
    color: #334155;
}

.medicationreview-page .mr-history-status-row #mrStopButton
{
    flex: 0 0 auto;
}

.medicationreview-page .mr-history-status-row #mrStopButton:disabled
{
    display: none;
}

/* Medication review timeline column correction.
   Timeline output may contain four columns. Do not force the first three
   columns to consume 100%, which collapses the fourth column to near-zero. */
.medicationreview-page #mrResults table.mr-table-timeline
{
    table-layout: auto !important;
}

.medicationreview-page #mrResults table.mr-table-timeline th,
.medicationreview-page #mrResults table.mr-table-timeline td
{
    width: auto !important;
}

/* Medication review generated-column correction.
   Sections C and I may contain more generated columns than the original
   percentage-width contracts anticipated. Automatic sizing prevents any
   extra column from collapsing to near-zero width and creating page-tall rows. */
.medicationreview-page #mrResults table.mr-table-medications,
.medicationreview-page #mrResults table.mr-table-modifications
{
    table-layout: auto !important;
}

.medicationreview-page #mrResults table.mr-table-medications th,
.medicationreview-page #mrResults table.mr-table-medications td,
.medicationreview-page #mrResults table.mr-table-modifications th,
.medicationreview-page #mrResults table.mr-table-modifications td
{
    width: auto !important;
}

/* Medication review processing status placement:
   match the general analysis page by placing status and Stop below elapsed time. */
.medicationreview-page #medication-review-progress-panel
{
    display: flex;
    flex-direction: column;
    align-items: center;
}

.medicationreview-page #medication-review-progress-panel .mr-history-status-message
{
    width: 100%;
    margin-top: 14px;
    text-align: center;
}

.medicationreview-page #medication-review-progress-panel #mrStopButton
{
    margin-top: 12px;
}

/* ==========================================================================
   Medication Interactions review: readable desktop/tablet table layout
   --------------------------------------------------------------------------
   Primary identifying columns are deliberately wider and remain visible
   while the user scrolls horizontally through the clinical detail columns.
   Screen presentation only; print-preview rules remain unchanged.
   ========================================================================== */

@media screen
{
    .medicationreview-page #mrResults .mr-report-table-wrap
    {
        overflow-x: auto !important;
        overflow-y: visible !important;
        max-width: 100% !important;
        -webkit-overflow-scrolling: touch;
    }

    /* C. Medication or product */
    .medicationreview-page #mrResults table.mr-table-medications
    {
        width: 1560px !important;
        min-width: 1560px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    .medicationreview-page #mrResults table.mr-table-medications th:nth-child(1),
    .medicationreview-page #mrResults table.mr-table-medications td:nth-child(1)
    {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
    }

    .medicationreview-page #mrResults table.mr-table-medications th:nth-child(2),
    .medicationreview-page #mrResults table.mr-table-medications td:nth-child(2)
    {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
    }

    .medicationreview-page #mrResults table.mr-table-medications th:nth-child(3),
    .medicationreview-page #mrResults table.mr-table-medications td:nth-child(3)
    {
        width: 360px !important;
        min-width: 360px !important;
        max-width: 360px !important;
    }

    .medicationreview-page #mrResults table.mr-table-medications th:nth-child(4),
    .medicationreview-page #mrResults table.mr-table-medications td:nth-child(4)
    {
        width: 360px !important;
        min-width: 360px !important;
        max-width: 360px !important;
    }

    .medicationreview-page #mrResults table.mr-table-medications th:nth-child(5),
    .medicationreview-page #mrResults table.mr-table-medications td:nth-child(5)
    {
        width: 330px !important;
        min-width: 330px !important;
        max-width: 330px !important;
    }

    /* B. Medication and symptom timeline */
    .medicationreview-page #mrResults table.mr-table-timeline
    {
        width: 1320px !important;
        min-width: 1320px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    .medicationreview-page #mrResults table.mr-table-timeline th:nth-child(1),
    .medicationreview-page #mrResults table.mr-table-timeline td:nth-child(1)
    {
        width: 190px !important;
        min-width: 190px !important;
        max-width: 190px !important;
    }

    .medicationreview-page #mrResults table.mr-table-timeline th:nth-child(2),
    .medicationreview-page #mrResults table.mr-table-timeline td:nth-child(2)
    {
        width: 400px !important;
        min-width: 400px !important;
        max-width: 400px !important;
    }

    .medicationreview-page #mrResults table.mr-table-timeline th:nth-child(3),
    .medicationreview-page #mrResults table.mr-table-timeline td:nth-child(3)
    {
        width: 500px !important;
        min-width: 500px !important;
        max-width: 500px !important;
    }

    .medicationreview-page #mrResults table.mr-table-timeline th:nth-child(4),
    .medicationreview-page #mrResults table.mr-table-timeline td:nth-child(4)
    {
        width: 230px !important;
        min-width: 230px !important;
        max-width: 230px !important;
    }

    /* I. Clinician review of potential medication modifications */
    .medicationreview-page #mrResults table.mr-table-modifications
    {
        width: 1480px !important;
        min-width: 1480px !important;
        max-width: none !important;
        table-layout: fixed !important;
    }

    .medicationreview-page #mrResults table.mr-table-modifications th:nth-child(1),
    .medicationreview-page #mrResults table.mr-table-modifications td:nth-child(1)
    {
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
    }

    .medicationreview-page #mrResults table.mr-table-modifications th:nth-child(2),
    .medicationreview-page #mrResults table.mr-table-modifications td:nth-child(2)
    {
        width: 310px !important;
        min-width: 310px !important;
        max-width: 310px !important;
    }

    .medicationreview-page #mrResults table.mr-table-modifications th:nth-child(3),
    .medicationreview-page #mrResults table.mr-table-modifications td:nth-child(3)
    {
        width: 310px !important;
        min-width: 310px !important;
        max-width: 310px !important;
    }

    .medicationreview-page #mrResults table.mr-table-modifications th:nth-child(4),
    .medicationreview-page #mrResults table.mr-table-modifications td:nth-child(4)
    {
        width: 600px !important;
        min-width: 600px !important;
        max-width: 600px !important;
    }

    /* Sticky primary-information column for all three tables */
    .medicationreview-page #mrResults table.mr-table-medications th:first-child,
    .medicationreview-page #mrResults table.mr-table-medications td:first-child,
    .medicationreview-page #mrResults table.mr-table-timeline th:first-child,
    .medicationreview-page #mrResults table.mr-table-timeline td:first-child,
    .medicationreview-page #mrResults table.mr-table-modifications th:first-child,
    .medicationreview-page #mrResults table.mr-table-modifications td:first-child
    {
        position: sticky !important;
        left: 0;
        background: #ffffff !important;
        box-shadow: inset -2px 0 0 #8f9baa, 6px 0 8px rgba(15, 23, 42, 0.16);
        overflow-wrap: normal !important;
        word-break: normal !important;
        hyphens: none !important;
    }

    .medicationreview-page #mrResults table.mr-table-medications th:first-child,
    .medicationreview-page #mrResults table.mr-table-timeline th:first-child,
    .medicationreview-page #mrResults table.mr-table-modifications th:first-child
    {
        z-index: 4;
        background: #eef3f8 !important;
    }

    .medicationreview-page #mrResults table.mr-table-medications td:first-child,
    .medicationreview-page #mrResults table.mr-table-timeline td:first-child,
    .medicationreview-page #mrResults table.mr-table-modifications td:first-child
    {
        z-index: 3;
        font-weight: 600;
    }
}

/* ==========================================================================
   Medication review synchronized top table scrollbars
   --------------------------------------------------------------------------
   JavaScript inserts one top scrollbar before each horizontally scrollable
   report table. The existing table wrapper remains the bottom scrollbar.
   ========================================================================== */

@media screen
{
    .medicationreview-page #mrResults .mr-top-scrollbar
    {
        display: block;
        width: 100%;
        max-width: 100%;
        height: 18px;
        margin: 14px 0 4px;
        overflow-x: auto;
        overflow-y: hidden;
        box-sizing: border-box;
        scrollbar-gutter: stable;
        -webkit-overflow-scrolling: touch;
    }

    .medicationreview-page #mrResults .mr-top-scrollbar[hidden]
    {
        display: none !important;
    }

    .medicationreview-page #mrResults .mr-top-scrollbar-spacer
    {
        height: 1px;
        min-height: 1px;
        pointer-events: none;
    }


    /* Larger horizontal scrollbar controls for both the synchronized top
       scrollbar and the table wrapper's native bottom scrollbar. */
    .medicationreview-page #mrResults .mr-top-scrollbar,
    .medicationreview-page #mrResults .mr-report-table-wrap
    {
        scrollbar-width: auto;
        scrollbar-color: #66717f #e3e7ec;
    }

    .medicationreview-page #mrResults .mr-top-scrollbar
    {
        height: 24px;
    }

    .medicationreview-page #mrResults .mr-top-scrollbar::-webkit-scrollbar,
    .medicationreview-page #mrResults .mr-report-table-wrap::-webkit-scrollbar
    {
        height: 20px;
    }

    .medicationreview-page #mrResults .mr-top-scrollbar::-webkit-scrollbar-track,
    .medicationreview-page #mrResults .mr-report-table-wrap::-webkit-scrollbar-track
    {
        background: #e3e7ec;
        border: 1px solid #bcc4ce;
        border-radius: 4px;
    }

    .medicationreview-page #mrResults .mr-top-scrollbar::-webkit-scrollbar-thumb,
    .medicationreview-page #mrResults .mr-report-table-wrap::-webkit-scrollbar-thumb
    {
        min-width: 48px;
        background: #66717f;
        border: 3px solid #e3e7ec;
        border-radius: 9px;
    }

    .medicationreview-page #mrResults .mr-top-scrollbar::-webkit-scrollbar-thumb:hover,
    .medicationreview-page #mrResults .mr-report-table-wrap::-webkit-scrollbar-thumb:hover
    {
        background: #4b5563;
    }

    .medicationreview-page #mrResults .mr-top-scrollbar::-webkit-scrollbar-button:horizontal,
    .medicationreview-page #mrResults .mr-report-table-wrap::-webkit-scrollbar-button:horizontal
    {
        display: block;
        width: 20px;
        height: 20px;
        background-color: #d5dae1;
        background-repeat: no-repeat;
        background-position: center;
        background-size: 9px 9px;
        border: 1px solid #aeb7c3;
    }

    .medicationreview-page #mrResults .mr-top-scrollbar::-webkit-scrollbar-button:horizontal:decrement,
    .medicationreview-page #mrResults .mr-report-table-wrap::-webkit-scrollbar-button:horizontal:decrement
    {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath fill='%23475569' d='M6.8 1.2 3 5l3.8 3.8 1.2-1.2L5.4 5 8 2.4z'/%3E%3C/svg%3E");
    }

    .medicationreview-page #mrResults .mr-top-scrollbar::-webkit-scrollbar-button:horizontal:increment,
    .medicationreview-page #mrResults .mr-report-table-wrap::-webkit-scrollbar-button:horizontal:increment
    {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath fill='%23475569' d='M3.2 1.2 7 5 3.2 8.8 2 7.6 4.6 5 2 2.4z'/%3E%3C/svg%3E");
    }

    .medicationreview-page #mrResults .mr-top-scrollbar::-webkit-scrollbar-button:horizontal:hover,
    .medicationreview-page #mrResults .mr-report-table-wrap::-webkit-scrollbar-button:horizontal:hover
    {
        background-color: #c5cbd4;
    }

    .medicationreview-page #mrResults .mr-top-scrollbar + .mr-report-table-wrap
    {
        margin-top: 0 !important;
    }

    .medicationreview-page #mrResults .mr-top-scrollbar[hidden] + .mr-report-table-wrap
    {
        margin-top: 14px !important;
    }
}

@media print
{
    .mr-top-scrollbar
    {
        display: none !important;
    }
}


/* ==========================================================================
   Medication review responsive table cards
   --------------------------------------------------------------------------
   At tablet and narrower widths, the wide comparison tables are presented as
   stacked row cards. The generated clinical HTML remains unchanged; JavaScript
   adds data-label attributes from each table header after report hydration.
   Desktop table widths, sticky first columns, and synchronized scrollbars remain
   unchanged above this breakpoint.
   ========================================================================== */

@media screen and (max-width: 1150px)
{
    .medicationreview-page #mrResults .mr-top-scrollbar
    {
        display: none !important;
    }

    .medicationreview-page #mrResults .mr-report-table-wrap
    {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: visible !important;
        margin-top: 14px !important;
        box-sizing: border-box !important;
        scrollbar-width: none;
    }

    .medicationreview-page #mrResults .mr-report-table-wrap::-webkit-scrollbar
    {
        display: none;
    }

    .medicationreview-page #mrResults table.mr-responsive-table
    {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: auto !important;
        border: 0 !important;
        background: transparent !important;
        font-size: 1rem !important;
    }

    .medicationreview-page #mrResults table.mr-responsive-table thead
    {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    .medicationreview-page #mrResults table.mr-responsive-table tbody,
    .medicationreview-page #mrResults table.mr-responsive-table tr,
    .medicationreview-page #mrResults table.mr-responsive-table td,
    .medicationreview-page #mrResults table.mr-responsive-table tbody td:nth-child(n)
    {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .medicationreview-page #mrResults table.mr-responsive-table tbody tr
    {
        margin: 0 0 18px !important;
        border: 1px solid #aeb9c7 !important;
        border-radius: 8px !important;
        background: #ffffff !important;
        box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08) !important;
        overflow: hidden !important;
    }

    .medicationreview-page #mrResults table.mr-responsive-table tbody tr:last-child
    {
        margin-bottom: 0 !important;
    }

    .medicationreview-page #mrResults table.mr-responsive-table tbody td
    {
        position: static !important;
        left: auto !important;
        z-index: auto !important;
        padding: 12px 14px 14px !important;
        border: 0 !important;
        border-bottom: 1px solid #d3dbe5 !important;
        background: #ffffff !important;
        box-shadow: none !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
        hyphens: auto !important;
        text-align: left !important;
        font-weight: 400 !important;
    }

    .medicationreview-page #mrResults table.mr-responsive-table tbody td:last-child
    {
        border-bottom: 0 !important;
    }

    .medicationreview-page #mrResults table.mr-responsive-table tbody td::before
    {
        content: attr(data-label);
        display: block;
        margin: -12px -14px 10px;
        padding: 8px 14px;
        background: #eef3f8;
        border-bottom: 1px solid #c5cfdb;
        color: #172033;
        font-size: 0.88rem;
        line-height: 1.3;
        font-weight: 750;
    }

    .medicationreview-page #mrResults table.mr-responsive-table tbody td:first-child
    {
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        background: #f8fafc !important;
    }

    .medicationreview-page #mrResults table.mr-responsive-table tbody td:first-child::before
    {
        background: #dfe8f2;
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 600px)
{
    .medicationreview-page #mrResults table.mr-responsive-table
    {
        font-size: 0.96rem !important;
    }

    .medicationreview-page #mrResults table.mr-responsive-table tbody td
    {
        padding: 11px 12px 13px !important;
    }

    .medicationreview-page #mrResults table.mr-responsive-table tbody td::before
    {
        margin: -11px -12px 9px;
        padding: 8px 12px;
    }
}

/* ===== Report sections: centered single-column navigation ===== */
.medicationreview-page #mrResults .mr-report-toc-title
{
    text-align: center !important;
}

.medicationreview-page #mrResults .mr-report-toc ul
{
    columns: auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: fit-content !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.medicationreview-page #mrResults .mr-report-toc li
{
    width: 100% !important;
    break-inside: auto !important;
}

.medicationreview-page #mrResults .mr-report-toc a
{
    display: block !important;
    text-align: left !important;
}

/* ===== Table of contents: compact centered single-column box ===== */
.medicationreview-page #mrResults .mr-report-toc
{
    display: table !important;
    width: auto !important;
    max-width: calc(100% - 36px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 16px 24px 18px !important;
}

.medicationreview-page #mrResults .mr-report-toc-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;
}

.medicationreview-page #mrResults .mr-report-toc ul
{
    width: fit-content !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}


/* ===== Report metadata and return-to-TOC controls ===== */
.medicationreview-page #mrResults .mr-normalized-report-metadata
{
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

.medicationreview-page #mrResults .mr-back-to-toc
{
    width: 100%;
    margin: 18px 0 10px;
    text-align: right;
}

.medicationreview-page #mrResults .mr-back-to-toc a
{
    color: #173f7a;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.medicationreview-page #mrResults .mr-back-to-toc a:hover,
.medicationreview-page #mrResults .mr-back-to-toc a:focus-visible
{
    color: #0f2f63;
}

@media print
{
    .medicationreview-page #mrResults .mr-back-to-toc
    {
        display: none !important;
    }
}


/* ===== TOC return positioning ===== */
.medicationreview-page #mrResults .mr-report-toc,
.medicationreview-page #mrResults #mr-report-toc
{
    scroll-margin-top: calc(var(--nvx-nav-total-height, 0px) + var(--np-tabs-toolbar-height, 64px) + 18px) !important;
}

.medicationreview-page #mrResults .mr-back-to-toc
{
    text-align: center !important;
}

/* Polite action/status messages: consistent bold emphasis. */
#mrDraftStatus,
.mr-draft-status,
.mr-status,
.nvx-unified-action-status,
.nvx-persistent-status-unified-flash
{
    font-weight: 700 !important;
}
