/* PairXCare — Capture Bridge + Glass Box (diafrox wireframe) */

.pxc-shell--wide {
  max-width: var(--pxc-container-wide, 97.5rem);
}

/* --- Screen 1: Capture Bridge --- */
.pxc-capture {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pxc-capture-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--pxc-bg-elevated);
  border: 1px solid var(--pxc-border);
  border-radius: 12px;
}

.pxc-capture-bar label {
  font-size: 0.75rem;
  color: var(--pxc-muted);
  display: block;
  margin-bottom: 0.2rem;
}

.pxc-capture-bar input[type="text"] {
  min-width: 140px;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--pxc-border);
  background: var(--pxc-surface);
  color: var(--pxc-text);
  font-size: 0.95rem;
}

.pxc-capture-date {
  font-size: 0.95rem;
  color: var(--pxc-text);
  font-weight: 600;
}

.pxc-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--pxc-bg-elevated);
  border: 1px solid var(--pxc-border);
  border-radius: var(--pxc-radius);
}

.pxc-qr-host {
  padding: 1rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--pxc-shadow);
}

.pxc-qr-host table {
  margin: 0 auto;
}

.pxc-capture-hint {
  max-width: 520px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--pxc-muted);
  margin: 1rem 0 0;
  line-height: 1.5;
}

.pxc-capture-demo {
  padding: 1rem;
  border: 1px dashed var(--pxc-border);
  border-radius: 12px;
}

.pxc-capture-demo p {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--pxc-muted);
}

/* Dual-foot capture (≤3 slots per side) */
.pxc-feet-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 760px) {
  .pxc-feet-two-col {
    grid-template-columns: 1fr;
  }
}

.pxc-feet-col h4 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  color: var(--pxc-accent);
}

.pxc-feet-col-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.pxc-feet-col-head h4 {
  margin: 0;
  flex: 0 1 auto;
}

/** Scan-friendly ~4×4 cm; module size set in JS (~151 px @ 96 dpi). */
.pxc-qr-host--inline {
  width: 4cm;
  height: 4cm;
  min-width: 4cm;
  min-height: 4cm;
  padding: 0.15rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--pxc-shadow);
}

.pxc-qr-host--inline canvas,
.pxc-qr-host--inline img {
  display: block;
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
}

.pxc-qr-host--inline table {
  margin: 0 !important;
}

/* Phone guest capture (QR relay — no login) */
body.pxc-capture-guest .pxc-nav {
  display: none !important;
}

.pxc-capture-guest .pxc-capture-guest-pid {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--pxc-muted);
}

.pxc-capture-guest-slots {
  max-width: 420px;
  margin: 0 auto;
}

.pxc-capture-guest-slot {
  max-width: 420px;
  margin: 0 auto 1rem;
}

.pxc-slot-preview--guest {
  min-height: 180px;
  margin-bottom: 1rem;
}

.pxc-capture-guest-upload {
  display: block;
  text-align: center;
  cursor: pointer;
}

.pxc-capture-guest-upload input[type="file"] {
  display: none;
}

.pxc-capture-guest-status {
  text-align: center;
  font-size: 0.92rem;
  color: var(--pxc-accent);
  margin: 0.5rem 0 0;
}

.pxc-capture-guest-status--error {
  color: #b91c1c;
}

.pxc-capture-hint--after-feet {
  margin: 0;
  max-width: none;
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.45;
}

.pxc-capture-target-banner {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--pxc-accent);
  background: var(--pxc-info-bg);
  border: 1px solid var(--pxc-info-border);
  border-radius: 8px;
}

.pxc-capture-target-banner[hidden] {
  display: none !important;
}

.pxc-foot-slot--target {
  outline: 2px solid var(--pxc-brand);
  outline-offset: 3px;
  box-shadow:
    0 0 0 4px rgba(56, 189, 248, 0.18),
    0 4px 18px rgba(15, 23, 42, 0.12);
}

.pxc-foot-slot {
  margin-bottom: 0.85rem;
  padding: 0.5rem 0.65rem;
  background: var(--pxc-bg-elevated);
  border: 1px solid var(--pxc-border);
  border-radius: 8px;
}

.pxc-foot-slot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.45rem;
}

.pxc-foot-slot-head label {
  font-size: 0.74rem;
  color: var(--pxc-accent);
  font-weight: 600;
}

.pxc-slot-clear {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
}

.pxc-slot-clear:disabled {
  opacity: 0.38;
  pointer-events: none;
}

.pxc-slot-preview {
  position: relative;
  min-height: 3rem;
  margin-bottom: 0.35rem;
  border-radius: 6px;
  border: 1px dashed var(--pxc-border-strong);
  background: var(--pxc-inset);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pxc-slot-preview-empty {
  font-size: 0.72rem;
  color: var(--pxc-muted);
}

.pxc-slot-preview-img {
  display: none;
  max-height: 4.25rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  vertical-align: middle;
}

.pxc-foot-slot input[type="file"] {
  font-size: 0.74rem;
  max-width: 100%;
}

.pxc-qr-target-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--pxc-bg-elevated);
  border: 1px solid var(--pxc-border);
  border-radius: 10px;
}

.pxc-qr-target-row label {
  font-size: 0.75rem;
  color: var(--pxc-muted);
}

/* --- Screen 2: Glass Box --- */
.pxc-glass {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.2fr) minmax(280px, 420px);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .pxc-glass {
    grid-template-columns: 1fr;
  }
}

.pxc-glass-pane {
  background: var(--pxc-card);
  border: 1px solid var(--pxc-border);
  border-radius: var(--pxc-radius);
  padding: 1rem 1.125rem;
  box-shadow: var(--pxc-shadow-md);
  transition: border-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.pxc-glass-pane h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--pxc-text);
  letter-spacing: -0.01em;
  text-rendering: optimizeLegibility;
}

.pxc-glass-pane--left h3 {
  color: var(--pxc-teal-light);
}

.pxc-pane-sub {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--pxc-teal-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pxc-feet-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.5rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--pxc-border);
  border-radius: var(--pxc-radius-lg, 0.75rem);
  background: var(--pxc-panel);
}

.pxc-feet-gallery-side-head {
  font-size: 0.71rem;
  color: var(--pxc-muted);
  margin-bottom: 0.3rem;
}

.pxc-feet-gallery-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.pxc-doc-thumb {
  aspect-ratio: 1;
  padding: 0;
  margin: 0;
  border: 1px solid var(--pxc-border);
  border-radius: var(--pxc-radius-md, 0.5rem);
  background: var(--pxc-inset);
  cursor: pointer;
  overflow: hidden;
  font-size: 0.68rem;
  color: var(--pxc-muted-soft);
  line-height: 1.2;
  transition: border-color 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.pxc-doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pxc-doc-thumb--empty {
  border-style: dashed;
}

.pxc-doc-thumb--empty span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0.35rem;
  text-align: center;
}

.pxc-doc-thumb--active {
  outline: 2px solid var(--pxc-brand);
  outline-offset: 1px;
}

/* Compact wound gallery toolbar: foot tabs + slot stepper */
.pxc-wound-gallery-nav {
  margin-bottom: 0.45rem;
}

.pxc-gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.65rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--pxc-border);
  border-radius: var(--pxc-radius-md, 0.5rem);
  background: var(--pxc-panel);
}

.pxc-foot-tabs {
  display: flex;
  gap: 0.3rem;
}

.pxc-foot-tab {
  margin: 0;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--pxc-border);
  border-radius: var(--pxc-radius-md, 0.5rem);
  background: var(--pxc-inset);
  color: var(--pxc-muted);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}

.pxc-foot-tab--active {
  border-color: var(--pxc-brand);
  color: var(--pxc-text);
  background: var(--pxc-info-bg);
}

.pxc-gallery-stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.pxc-gallery-nav-btn {
  width: 1.65rem;
  height: 1.65rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--pxc-border);
  border-radius: var(--pxc-radius-md, 0.5rem);
  background: var(--pxc-input-bg);
  color: var(--pxc-muted);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}

.pxc-gallery-nav-btn:hover {
  border-color: var(--pxc-brand);
  color: var(--pxc-text);
}

.pxc-gallery-counter {
  min-width: 3.25rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--pxc-inset);
  border: 1px solid var(--pxc-border-strong);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--pxc-text);
  letter-spacing: 0.04em;
  text-align: center;
}

/* Image + marking/scoring side-by-side */
.pxc-mark-score-workspace {
  --pxc-mark-panel-h: calc((100vh - 12rem) * 0.72);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: 0.75rem;
  align-items: start;
  min-height: 0;
}

.pxc-mark-score-image-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pxc-mark-score-image-col .pxc-stage-wrap {
  flex: 0 0 var(--pxc-mark-panel-h);
  height: var(--pxc-mark-panel-h);
  min-height: var(--pxc-mark-panel-h);
  max-height: var(--pxc-mark-panel-h);
}

.pxc-mark-score-side-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  overflow: visible;
  align-self: start;
}

.pxc-mark-score-image-col > .pxc-glass-hint,
.pxc-mark-score-image-col > .pxc-mark-controls {
  flex: 0 0 auto;
}

.pxc-mark-below-hint {
  margin: 0.45rem 0 0.2rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--pxc-text-secondary);
}

.pxc-mark-score-image-col > .pxc-mark-controls {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

.pxc-mark-score-side-col .pxc-score-section {
  flex: 0 0 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
  padding-right: 0.35rem;
}

.pxc-ml-status-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
}

.pxc-score-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.pxc-glass-pane--mark-score h3 {
  color: var(--pxc-teal-light);
}

.pxc-mark-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
  align-items: center;
}

.pxc-mark-score-image-col .pxc-btn-ghost {
  min-height: 2.25rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
}

.pxc-lesion-dot-tools #pxcConnectDots:not(:disabled) {
  background: linear-gradient(160deg, #14b8a6 0%, #0f766e 100%);
  color: #f8fffc;
  border-color: transparent;
  box-shadow: 0 6px 16px -6px rgba(13, 148, 136, 0.7);
}

.pxc-lesion-dot-tools #pxcConnectDots:not(:disabled):hover {
  filter: brightness(1.06);
  color: #fff;
}

.pxc-lesion-dot-tools #pxcShowDots:not(:disabled) {
  border-color: rgba(45, 212, 191, 0.55);
  color: #ecfeff;
  background: rgba(13, 148, 136, 0.16);
}

.pxc-wound-download-row {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--pxc-border);
  flex-direction: column;
  align-items: flex-start;
}

.pxc-wound-download-row .pxc-glass-hint {
  margin: 0;
}

.pxc-stage-empty {
  padding: 1.75rem 1rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--pxc-muted);
  line-height: 1.5;
}

/* Clinical review: fixed top strip + workflow columns */
.pxc-review-shell {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
}

.pxc-review-shell > .pxc-glass {
  margin-top: 0;
}

/* Review: 2-column layout — marking/scoring + CDSS; right height synced via JS */
.pxc-review-shell .pxc-glass,
.pxc-review-shell .pxc-glass--review-two {
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  flex: 1 1 auto;
  min-height: calc(100vh - 10rem);
}

.pxc-review-shell .pxc-glass-pane {
  min-height: 0;
}

.pxc-review-shell .pxc-glass-pane--right {
  overflow-x: hidden;
  overscroll-behavior: contain;
}

@media (min-width: 1101px) {
  /* Right pane height follows marking/scoring pane via --pxc-review-sync-h */
  .pxc-review-shell .pxc-glass-pane--right {
    align-self: stretch;
    height: var(--pxc-review-sync-h, auto);
    max-height: var(--pxc-review-sync-h, none);
    min-height: calc(100vh - 10rem);
    overflow-y: auto;
  }

  .pxc-review-shell .pxc-glass-pane--mark-score {
    min-height: calc(100vh - 10rem);
  }
}

.pxc-review-shell .pxc-glass-pane--left,
.pxc-review-shell .pxc-glass-pane--mark-score {
  align-self: start;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.pxc-review-shell .pxc-glass-pane--left .pxc-wound-gallery-nav,
.pxc-review-shell .pxc-glass-pane--mark-score .pxc-wound-gallery-nav {
  flex-shrink: 0;
}

.pxc-review-shell .pxc-glass-pane--mark-score .pxc-stage-wrap {
  flex: 0 0 var(--pxc-mark-panel-h, calc((100vh - 12rem) * 0.72));
  height: var(--pxc-mark-panel-h, calc((100vh - 12rem) * 0.72));
  min-height: var(--pxc-mark-panel-h, calc((100vh - 12rem) * 0.72));
  max-height: var(--pxc-mark-panel-h, calc((100vh - 12rem) * 0.72));
  overflow: auto;
  overscroll-behavior: contain;
  display: block;
  -webkit-overflow-scrolling: touch;
}

.pxc-review-shell .pxc-glass-pane--mark-score .pxc-mark-score-workspace {
  flex: 1 1 auto;
  min-height: 0;
}

.pxc-review-shell .pxc-glass-pane--mark-score .pxc-mark-controls {
  margin-bottom: 0.35rem;
}

.pxc-review-shell .pxc-glass-pane--mark-score .pxc-stage img {
  max-width: 100%;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.pxc-review-shell .pxc-glass-pane--left .pxc-stage {
  min-height: 200px;
  width: 100%;
  max-width: none;
  max-height: none;
}

.pxc-review-shell .pxc-glass-pane--left .pxc-stage img {
  max-width: 100%;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

@media (max-width: 1100px) {
  .pxc-review-shell .pxc-glass {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: auto;
    align-items: stretch;
    flex: 0 1 auto;
    min-height: 0;
    --pxc-review-sync-h: unset;
  }
  .pxc-mark-score-workspace {
    grid-template-columns: 1fr;
    --pxc-mark-panel-h: min(74vh, 40rem);
  }
  .pxc-mark-score-image-col,
  .pxc-mark-score-side-col {
    min-height: 0;
  }
  .pxc-mark-score-side-col .pxc-score-section {
    height: auto !important;
    max-height: min(74vh, 40rem);
    min-height: min(50vh, 28rem);
  }
  .pxc-review-shell .pxc-glass-pane--right {
    height: auto;
    max-height: min(88vh, 52rem);
    overflow-y: auto;
  }
  .pxc-review-shell .pxc-glass-pane--left,
  .pxc-review-shell .pxc-glass-pane--mark-score {
    overflow-y: auto;
    max-height: min(88vh, 52rem);
  }
}

.pxc-review-strip {
  flex: 0 0 auto;
  padding: 1.125rem 1.375rem 1.25rem;
  border-radius: calc(var(--pxc-radius) + 2px);
  border: 1px solid var(--pxc-border);
  background: var(--pxc-strip-bg);
  box-shadow: var(--pxc-shadow-md);
}

.pxc-review-strip__intro {
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--pxc-border);
}

.pxc-review-strip__title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--pxc-text);
  text-rendering: optimizeLegibility;
}

.pxc-review-strip__lead {
  margin: 0 0 0.45rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--pxc-muted);
  max-width: 52rem;
}

.pxc-review-strip__meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--pxc-muted);
}

.pxc-review-strip__meta strong {
  color: var(--pxc-text);
  font-weight: 600;
}

.pxc-review-pe__title {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pxc-accent);
}

.pxc-review-pe__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem 2rem;
  align-items: start;
}

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

.pxc-review-pe--patient .pxc-review-pe__block {
  max-width: 52rem;
  padding: 0.55rem 0.75rem;
}

.pxc-capture-patient {
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--pxc-border);
}

.pxc-clinical-patient-compact {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pxc-clinical-patient-compact__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.85rem;
  align-items: end;
}

.pxc-clinical-patient-compact--one-line .pxc-clinical-patient-compact__row--one-line {
  display: grid;
  grid-template-columns: minmax(4.5rem, 1fr) minmax(5.5rem, 2fr) minmax(2.75rem, 0.55fr) minmax(3.75rem, 0.85fr);
  gap: 0.4rem 0.55rem;
  align-items: end;
}

@media (max-width: 720px) {
  .pxc-clinical-patient-compact--one-line .pxc-clinical-patient-compact__row--one-line {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .pxc-clinical-patient-compact__row {
    grid-template-columns: 1fr;
  }
}

.pxc-field--compact label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--pxc-muted);
  margin-bottom: 0.12rem;
}

.pxc-field--compact input,
.pxc-field--compact select {
  width: 100%;
  padding: 0.32rem 0.45rem;
  font-size: 0.86rem;
  line-height: 1.25;
  box-sizing: border-box;
}

.pxc-encounter-acc-row {
  margin-top: 1rem;
}

/* Encounter: body measurements, vitals, labs — one accordion per row */
.pxc-encounter .pxc-review-acc-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  grid-template-columns: unset;
}

/* Open panel: fields flow in a row and wrap when width is exceeded */
.pxc-encounter .pxc-review-acc__body .pxc-clinical-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.85rem;
}

.pxc-encounter .pxc-review-acc__body .pxc-clinical-grid .pxc-field {
  flex: 0 1 auto;
  min-width: 9.5rem;
  max-width: 100%;
}

.pxc-encounter #pxcClinicalLabsOuter {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pxc-encounter .pxc-clinical-custom-labs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.85rem;
}

.pxc-encounter .pxc-clinical-custom-labs .pxc-field--lab-custom {
  flex: 0 1 auto;
  min-width: 9.5rem;
  max-width: 100%;
  margin-top: 0;
}

.pxc-encounter-notes {
  width: 100%;
  min-height: calc(0.85rem + 0.85rem + 3 * 1.45 * 0.95rem);
  padding: 0.75rem 1rem;
  border-radius: var(--pxc-radius);
  border: 1px solid var(--pxc-border);
  background: var(--pxc-input-bg);
  color: inherit;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.pxc-encounter-notes:focus-visible {
  outline: none;
  border-color: rgba(13, 148, 136, 0.6);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.pxc-encounter-hint {
  font-size: 0.82rem;
  color: var(--pxc-muted);
  margin: 0;
}

.pxc-review-pe__block {
  padding: 0.85rem 1rem;
  border-radius: var(--pxc-radius);
  border: 1px solid var(--pxc-border);
  background: var(--pxc-surface-muted);
}

.pxc-review-pe__kicker {
  margin: 0 0 0.65rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pxc-muted);
}

.pxc-review-pe__encounter .pxc-field {
  margin-bottom: 0.65rem;
}

.pxc-review-pe__encounter .pxc-field:last-child {
  margin-bottom: 0;
}

.pxc-review-pe textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--pxc-border-strong);
  background: var(--pxc-input-bg);
  color: var(--pxc-text);
  font-family: inherit;
  font-size: 0.82rem;
  line-height: 1.4;
}

.pxc-review-pe textarea:focus {
  outline: none;
  border-color: var(--pxc-brand);
  box-shadow: 0 0 0 2px var(--pxc-brand-muted);
}

.pxc-review-acc-row {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 900px) {
  .pxc-review-acc-row {
    grid-template-columns: 1fr;
  }
}

.pxc-review-acc {
  border: 1px solid var(--pxc-border);
  border-radius: var(--pxc-radius-lg, 0.75rem);
  background: var(--pxc-surface-muted);
  overflow: hidden;
  transition: border-color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.pxc-review-acc:hover {
  border-color: var(--pxc-border-strong);
}

.pxc-review-acc[open] {
  border-color: var(--pxc-brand-ring);
  box-shadow: var(--pxc-shadow-sm);
}

.pxc-review-acc__summary {
  list-style: none;
  cursor: pointer;
  padding: 0.625rem 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pxc-brand);
  user-select: none;
  transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.pxc-review-acc__summary::-webkit-details-marker {
  display: none;
}

.pxc-review-acc__summary:hover {
  background: var(--pxc-surface-hover);
}

.pxc-review-acc__chev {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--pxc-surface-hover);
  color: var(--pxc-muted);
  font-size: 0.6rem;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.pxc-review-acc__chev::before {
  content: "\25BC";
  line-height: 1;
}

.pxc-review-acc[open] > .pxc-review-acc__summary .pxc-review-acc__chev {
  transform: rotate(-180deg);
  background: var(--pxc-brand-muted);
  color: var(--pxc-teal-light);
}

.pxc-review-acc__body {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid var(--pxc-border);
}

.pxc-review-acc__body .pxc-clinical-grid {
  margin-top: 0.55rem;
}

.pxc-glass-pane--mid h3,
.pxc-score-section h3 {
  color: var(--pxc-teal-light);
}

.pxc-glass-pane--mid .pxc-sinbad-heading,
.pxc-score-section .pxc-sinbad-heading {
  margin: 0.85rem 0 0.55rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--pxc-teal-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pxc-glass-pane--right h3 {
  color: var(--pxc-accent);
}

/* Review score section: SINBAD total row compact */
.pxc-glass-pane--mid .pxc-score--review-total,
.pxc-score-section .pxc-score--review-total {
  margin-top: 0.4rem;
  margin-bottom: 0;
  padding: 0.15rem 0.4rem;
  line-height: 1.35;
  font-size: 0.88rem;
  border-radius: 8px;
}

.pxc-glass-pane--mid .pxc-score--review-total .pxc-domain,
.pxc-score-section .pxc-score--review-total .pxc-domain {
  font-size: 1em;
  font-weight: 600;
}

.pxc-glass-pane--mid .pxc-score--review-total strong,
.pxc-score-section .pxc-score--review-total strong {
  font-size: 1.08em;
  line-height: inherit;
  vertical-align: baseline;
}

.pxc-glass-pane--mid .pxc-sinbad-interpret--after-total,
.pxc-score-section .pxc-sinbad-interpret--after-total {
  margin-top: 0.28rem;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  line-height: 1.35;
}

.pxc-stage-wrap {
  position: relative;
  width: 100%;
  max-height: 420px;
  overflow: auto;
  border-radius: 10px;
  background: var(--pxc-stage-bg);
  border: 1px solid var(--pxc-border-strong);
}

.pxc-stage {
  position: relative;
  display: inline-block;
  vertical-align: top;
  min-height: 200px;
  width: 100%;
}

.pxc-stage img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.pxc-stage--placing-dots,
.pxc-stage--placing-dots img {
  cursor: crosshair;
}

.pxc-mask-canvas {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.pxc-mask-ovals-host,
.pxc-mask-polygons-host {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.pxc-mask-polygons-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pxc-mask-polygons-host .pxc-mask-polygon {
  pointer-events: auto;
  cursor: pointer;
  fill: rgba(59, 130, 246, 0.38);
  stroke: rgba(15, 23, 42, 0.92);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.pxc-mask-polygon--secondary {
  fill: rgba(59, 130, 246, 0.24);
  stroke: rgba(30, 41, 59, 0.9);
  stroke-dasharray: 6 6;
  opacity: 0.62;
}

.pxc-mask-polygon--active {
  fill: rgba(59, 130, 246, 0.38);
  stroke: rgba(15, 23, 42, 0.98);
  opacity: 1;
}

.pxc-mask-polyline {
  fill: none;
  stroke: rgba(37, 99, 235, 0.9);
  stroke-width: 2;
  stroke-dasharray: 5 4;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.pxc-mask-dot {
  fill: #fbbf24;
  stroke: rgba(15, 23, 42, 0.95);
  stroke-width: 2;
  pointer-events: auto;
  cursor: pointer;
}

.pxc-mark-score-image-col--overlay-view .pxc-mask-polygon {
  fill: rgba(59, 130, 246, 0.1);
  stroke: rgba(37, 99, 235, 0.95);
  stroke-width: 2.5;
}

.pxc-mark-score-image-col--overlay-view .pxc-mask-polygon--view-only {
  fill: none;
}

.pxc-mark-score-image-col--overlay-hidden .pxc-mask-canvas {
  visibility: hidden;
}

.pxc-vertex-pins-host {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}

.pxc-vertex-pins-host .pxc-pin--vertex {
  pointer-events: auto;
}

.pxc-mask-ovals-host .pxc-mask-oval {
  pointer-events: auto;
  cursor: pointer;
}

.pxc-mask-oval {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.38);
  border: 2px solid rgba(15, 23, 42, 0.92);
  box-sizing: border-box;
  z-index: 3;
}

.pxc-mask-oval--secondary {
  opacity: 0.62;
  border-style: dashed;
  border-color: rgba(30, 41, 59, 0.9);
  background: rgba(59, 130, 246, 0.24);
}

.pxc-mask-oval--active {
  opacity: 1;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.98);
}

.pxc-lesion-mark-row {
  align-items: flex-end;
}

.pxc-field--lesion-site label {
  display: block;
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
  color: var(--pxc-muted);
}

.pxc-field--lesion-site select {
  min-width: 7rem;
  font: inherit;
  padding: 0.25rem 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--pxc-border);
  background: var(--pxc-card);
  color: inherit;
}

.pxc-pin {
  position: absolute;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--pxc-accent);
  border: 2px solid rgba(15, 23, 42, 0.95);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 2px 8px rgba(0, 0, 0, 0.45);
  cursor: grab;
  z-index: 5;
}

.pxc-pin:active {
  cursor: grabbing;
}

.pxc-pin--move {
  background: var(--pxc-brand);
  width: 16px;
  height: 16px;
  margin-left: -8px;
  margin-top: -8px;
  border-color: rgba(15, 23, 42, 0.95);
  z-index: 5;
}

.pxc-pin--vertex {
  background: #fbbf24;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  margin-top: -10px;
  border-color: rgba(15, 23, 42, 0.95);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #1e293b;
  user-select: none;
}

.pxc-pin--selected {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.55);
}

.pxc-glass-hint {
  font-size: 0.86rem;
  color: var(--pxc-muted);
  margin-top: 0.5rem;
  line-height: 1.45;
}

.pxc-ai-line {
  font-size: 0.72rem;
  color: var(--pxc-info);
  margin: 0.15rem 0 0.35rem;
  line-height: 1.35;
}

.pxc-sinbad-block {
  border-bottom: 1px solid var(--pxc-border);
  padding-bottom: 0.65rem;
  margin-bottom: 0.65rem;
}

.pxc-sinbad-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pxc-sinbad-label-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
}

.pxc-sinbad-row .pxc-domain {
  font-weight: 600;
  color: var(--pxc-text);
  font-size: 0.95rem;
}

.pxc-sinbad-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  margin-left: auto;
}

.pxc-sinbad-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--pxc-border);
  background: var(--pxc-input-bg);
  color: var(--pxc-info);
  font-size: 0.72rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: pan-y;
  transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.pxc-sinbad-info:hover {
  background: var(--pxc-info-bg);
  border-color: var(--pxc-info-border);
}

.pxc-sinbad-info.pxc-active {
  background: var(--pxc-brand-muted);
  border-color: var(--pxc-brand);
  color: var(--pxc-teal-light);
}

.pxc-sinbad-clue {
  margin-top: 0.45rem;
}

.pxc-sinbad-block:last-of-type {
  border-bottom: none;
}

.pxc-area-input {
  margin-top: 0.5rem;
}

.pxc-area-input label {
  font-size: 0.78rem;
  color: var(--pxc-muted);
}

.pxc-area-input input {
  width: 100%;
  max-width: 120px;
  margin-top: 0.25rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--pxc-border);
  background: var(--pxc-bg-elevated);
  color: var(--pxc-text);
}

.pxc-bill-cpt {
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--pxc-accent);
  margin: 0.25rem 0;
  letter-spacing: -0.01em;
}

.pxc-cpt-lines {
  list-style: none;
  margin: 0.35rem 0 0.85rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  counter-reset: pxc-cpt-i;
}

.pxc-cpt-line-li {
  border: 1px solid var(--pxc-border);
  border-radius: var(--pxc-radius-md, 0.5rem);
  padding: 0.45rem 0.625rem 0.5rem;
  background: var(--pxc-surface-muted);
  counter-increment: pxc-cpt-i;
  transition: border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.pxc-cpt-line-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: flex-start;
}

.pxc-cpt-line-code {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--pxc-accent);
  min-width: 3.75rem;
}

.pxc-cpt-line-desc {
  flex: 1 1 10rem;
  font-size: 0.73rem;
  line-height: 1.42;
}

.pxc-cpt-line-moves {
  display: inline-flex;
  gap: 0.2rem;
  flex-shrink: 0;
}

.pxc-cpt-line-moves .pxc-btn-ghost {
  font-size: 0.72rem;
  padding: 0.12rem 0.42rem;
  min-height: unset;
}

.pxc-cpt-line-why {
  margin: 0.38rem 0 0;
  font-size: 0.7rem;
  color: var(--pxc-muted);
  line-height: 1.4;
}

.pxc-cpt-line-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pxc-accent);
  border: 1px solid rgba(13, 107, 92, 0.35);
  border-radius: 4px;
  vertical-align: middle;
}

.pxc-cpt-line-moves .pxc-cpt-remove {
  color: #b42318;
  font-weight: 700;
}

.pxc-cpt-add {
  margin: 0.5rem 0 0.75rem;
  padding: 0.55rem 0.6rem;
  border: 1px dashed var(--pxc-border);
  border-radius: 8px;
  background: var(--pxc-bg);
}

.pxc-cpt-add-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  margin: 0.35rem 0 0.5rem;
}

@media (min-width: 520px) {
  .pxc-cpt-add-grid {
    grid-template-columns: 5.5rem 1fr;
  }

  .pxc-cpt-add-why {
    grid-column: 1 / -1;
  }
}

.pxc-cpt-add-code {
  font-weight: 600;
  text-transform: uppercase;
}

.pxc-locale-chk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.35rem 0.65rem;
  margin: 0.5rem 0 0;
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--pxc-border);
  border-radius: 8px;
  background: var(--pxc-bg-elevated);
}

.pxc-locale-chk {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.35;
  cursor: pointer;
}

.pxc-locale-chk input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.pxc-locale-preset-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
}

.pxc-owner-tenant-locales-section {
  margin: 1rem 0 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--pxc-border);
}

.pxc-ten-locale-panel {
  margin: 0.65rem 0;
  padding: 0.55rem 0.65rem;
  border: 1px dashed var(--pxc-border);
  border-radius: 8px;
  background: var(--pxc-bg);
}

.pxc-ten-locale-slug {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
}

.pxc-ten-locale-inherit {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.pxc-ten-loc-grid-wrap .pxc-locale-chk-grid {
  max-height: 10rem;
}

.pxc-bill-non-us-note {
  margin: 0.25rem 0 0;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px dashed var(--pxc-border-strong);
}

.pxc-tenant-matrix {
  width: 100%;
  border-collapse: collapse;
  margin: 0.85rem 0;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.pxc-tenant-matrix th {
  border: 1px solid var(--pxc-border);
  padding: 0.375rem 0.5rem;
  text-align: center;
  background: var(--pxc-surface-muted);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--pxc-muted);
}

.pxc-tenant-matrix td {
  border: 1px solid var(--pxc-border);
  padding: 0.375rem 0.5rem;
  text-align: center;
}

.pxc-tenant-matrix th:first-child,
.pxc-tenant-matrix td:first-child {
  text-align: left;
}

.pxc-owner-defs {
  margin: 0.6rem 0 0;
}

.pxc-owner-add {
  margin: 0.65rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.pxc-bill-why {
  font-size: 0.82rem;
  color: var(--pxc-muted);
  line-height: 1.45;
  margin: 0.5rem 0;
}

.pxc-bill-rev {
  font-size: 0.9rem;
  color: var(--pxc-success-text);
  margin: 0.5rem 0 1rem;
}

.pxc-bill-rev span {
  font-weight: 700;
}

.pxc-source-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--pxc-border);
  color: var(--pxc-text);
  font-size: 0.65rem;
  margin-left: 0.25rem;
  cursor: help;
}

.pxc-footer-doc {
  font-size: 0.72rem;
  color: var(--pxc-muted);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--pxc-border);
}

.pxc-audit-note {
  font-size: 0.72rem;
  color: var(--pxc-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

.pxc-btn-final {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.pxc-next-encounter {
  margin-top: 0.65rem;
}

.pxc-glass-pane--cdss h4 {
  margin: 1rem 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pxc-warning-text);
}

.pxc-glass-pane textarea#pxcHistory {
  width: 100%;
  min-height: 4rem;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--pxc-border);
  background: var(--pxc-bg-elevated);
  color: var(--pxc-text);
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
}

.pxc-wifi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (max-width: 500px) {
  .pxc-wifi-grid {
    grid-template-columns: 1fr;
  }
}

.pxc-tissue-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.pxc-tissue-grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.72rem;
  color: var(--pxc-muted);
  gap: 0.15rem;
}

.pxc-tissue-grid input {
  width: 100%;
  padding: 0.3rem;
  border-radius: 6px;
  border: 1px solid var(--pxc-border);
  background: var(--pxc-bg-elevated);
  color: var(--pxc-text);
}

.pxc-rec-list {
  margin: 0.25rem 0 1rem;
  padding-left: 1.15rem;
  font-size: 0.78rem;
  color: var(--pxc-muted);
  line-height: 1.45;
}

.pxc-tissue-rec-list {
  margin-top: 0.55rem;
  margin-bottom: 0.15rem;
}

/* Saint Elian — review pane matrix (0–3 per parameter row) */
.pxc-saint-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  margin: 0.5rem 0 0.65rem;
  font-variant-numeric: tabular-nums;
}

.pxc-saint-matrix th,
.pxc-saint-matrix td {
  border: 1px solid var(--pxc-border);
  text-align: center;
  padding: 0.2rem 0.25rem;
}

.pxc-saint-matrix th[scope="row"] {
  text-align: left;
  font-weight: 600;
  color: var(--pxc-muted);
  white-space: normal;
  max-width: 8.75rem;
  line-height: 1.25;
  vertical-align: middle;
}

.pxc-saint-matrix__param-label {
  display: inline;
  margin-right: 0.28rem;
}

.pxc-saint-param-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0 0.12rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  background: var(--pxc-surface-muted);
  color: var(--pxc-brand);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: 0.08em;
}

.pxc-saint-param-tip-btn:hover:not(:disabled) {
  background: var(--pxc-brand-muted);
  border-color: var(--pxc-brand-ring);
}

.pxc-saint-param-tip-btn[aria-expanded="true"] {
  background: rgba(13, 148, 136, 0.45);
  border-color: rgba(45, 212, 191, 0.55);
  color: #ffffff;
}

.pxc-saint-param-tip {
  margin: 0.35rem 0 0.2rem;
  padding: 0.42rem 0.55rem;
  border-radius: 6px;
  background: var(--pxc-surface);
  border: 1px solid rgba(94, 234, 212, 0.28);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--pxc-text);
  line-height: 1.45;
}

.pxc-saint-param-tip[hidden] {
  display: none !important;
}

.pxc-saint-matrix thead th {
  background: var(--pxc-surface-muted);
  color: var(--pxc-brand);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pxc-saint-matrix__btn {
  appearance: none;
  width: 100%;
  min-width: 1.5rem;
  margin: 0;
  padding: 0.18rem 0.1rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  line-height: 1.2;
}

.pxc-saint-matrix__btn:hover:not(:disabled) {
  background: var(--pxc-brand-muted);
}

.pxc-saint-matrix__btn--active {
  background: var(--pxc-brand);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.pxc-saint-matrix__btn:disabled {
  opacity: 0.48;
  cursor: default;
}

.pxc-saint-matrix__tr--locked .pxc-saint-matrix__btn--active {
  background: var(--pxc-muted-soft);
  color: var(--pxc-text);
}

.pxc-saint-matrix-hint {
  margin: 0.35rem 0 0.45rem !important;
  font-size: 0.74rem !important;
  line-height: 1.4;
}

.pxc-saint-reset {
  margin-top: 0.25rem;
  font-size: 0.78rem;
}

.pxc-saint-summary {
  margin: 0.45rem 0 0 !important;
  font-weight: 600;
}

.pxc-details {
  margin: 0.65rem 0;
  padding: 0.4rem 0.5rem;
  border: 1px dashed var(--pxc-border);
  border-radius: 8px;
  background: var(--pxc-surface-muted);
}

.pxc-details summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--pxc-accent);
}

.pxc-icd-preview {
  font-size: 0.72rem;
  color: var(--pxc-muted);
  border: 1px solid var(--pxc-border);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  margin-bottom: 1rem;
  max-height: 10rem;
  overflow: auto;
}

.pxc-icd-row {
  margin-bottom: 0.4rem;
  line-height: 1.35;
}

.pxc-icd-hint {
  font-size: 0.72rem;
  margin: 0 0 0.65rem;
}

.pxc-icd-lines {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
  font-size: 0.72rem;
  border: 1px solid var(--pxc-border);
  border-radius: 8px;
  max-height: 12rem;
  overflow: auto;
}

.pxc-icd-line-li {
  border-bottom: 1px solid var(--pxc-border);
  padding: 0.45rem 0.5rem;
}

.pxc-icd-line-li:last-child {
  border-bottom: none;
}

.pxc-icd-line-row {
  display: flex;
  gap: 0.35rem;
  align-items: flex-start;
}

.pxc-icd-line-code {
  font-weight: 700;
  color: var(--pxc-accent);
  min-width: 4.5rem;
  flex-shrink: 0;
}

.pxc-icd-line-text {
  flex: 1;
  color: var(--pxc-muted);
  line-height: 1.35;
}

.pxc-icd-line-moves {
  flex-shrink: 0;
  display: flex;
  gap: 0.15rem;
}

.pxc-icd-add {
  margin: 0.5rem 0 1rem;
}

.pxc-icd-add-grid {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.35rem;
  margin: 0.35rem 0;
}

.pxc-abx-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.74rem;
  color: var(--pxc-muted);
}

.pxc-med-note {
  margin-bottom: 0.5rem;
}

/* ── Add-medication form (above the table) ── */
.pxc-med-add-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: var(--pxc-bg-elevated);
  border: 1px solid var(--pxc-border);
}

.pxc-mg-drug-add-inp {
  width: 100%;
  font-size: 0.8rem;
  box-sizing: border-box;
}

.pxc-med-dose-add-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.pxc-mg-dose-add-inp {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
}

.pxc-med-add-submit {
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid rgba(22, 163, 74, 0.6);
  border-radius: var(--pxc-radius-sm, 0.375rem);
  color: var(--pxc-success);
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.pxc-med-add-submit:hover {
  background: rgba(22, 163, 74, 0.12);
  color: var(--pxc-success-text);
}

.pxc-med-grid-wrap {
  overflow-x: auto;
}

.pxc-med-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  table-layout: fixed;
}

.pxc-med-grid th,
.pxc-med-grid td {
  border: 1px solid var(--pxc-border);
  padding: 0.3rem 0.375rem;
  vertical-align: middle;
}

.pxc-med-grid thead th {
  background: var(--pxc-surface-muted);
  font-weight: 600;
  font-size: 0.7rem;
  text-align: center;
  color: var(--pxc-muted);
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.pxc-mg-sno {
  width: 2.4rem;
  text-align: center;
  color: var(--pxc-muted);
  font-size: 0.7rem;
}

.pxc-mg-drug {
  text-align: left !important;
  color: var(--pxc-text) !important;
}

.pxc-mg-dose-head {
  text-align: center;
}

.pxc-mg-sub th {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--pxc-accent, #7c3aed);
  background: var(--pxc-bg-elevated);
  text-align: center;
  padding: 0.18rem 0.2rem;
}

.pxc-mg-acts {
  width: 3.6rem;
  text-align: center;
  white-space: nowrap;
}

.pxc-mg-drug-cell {
  word-break: break-word;
}

.pxc-mg-dose-cell {
  text-align: center;
  color: var(--pxc-muted);
  font-size: 0.72rem;
  width: 2rem;
}

.pxc-mg-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  line-height: 1;
  color: var(--pxc-muted);
  transition: color 0.15s, background 0.15s;
}

.pxc-mg-btn:hover {
  background: var(--pxc-bg-elevated);
  color: var(--pxc-text);
}

.pxc-mg-btn--save {
  color: #16a34a;
}

.pxc-mg-btn--save:hover {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.pxc-mg-btn--del,
.pxc-mg-btn--cancel {
  color: #dc2626;
}

.pxc-mg-btn--del:hover,
.pxc-mg-btn--cancel:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.pxc-mg-editing td {
  background: var(--pxc-bg-elevated);
}

.pxc-mg-inp {
  width: 100%;
  border: 1px solid var(--pxc-border);
  border-radius: 4px;
  padding: 0.2rem 0.3rem;
  font-size: 0.73rem;
  background: var(--pxc-bg);
  color: var(--pxc-text);
  box-sizing: border-box;
  min-width: 0;
}

.pxc-mg-inp:focus {
  outline: none;
  border-color: var(--pxc-accent, #7c3aed);
}

.pxc-mg-drug-inp {
  min-width: 4rem;
}

.pxc-mg-dose-inp {
  width: 2.4rem;
  text-align: center;
}

.pxc-med-add-btn {
  margin-top: 0.45rem;
  font-size: 0.75rem;
}

.pxc-med-print-row {
  margin-top: 0.5rem;
}

.pxc-attest-block {
  margin: 1rem 0 0.75rem;
  padding: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(124, 58, 237, 0.25);
  background: rgba(124, 58, 237, 0.06);
}

.pxc-attest-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.76rem;
  line-height: 1.35;
  color: #5b21b6;
  cursor: pointer;
}

.pxc-attest-label input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.pxc-multi-ulcer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0 0.75rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px dashed var(--pxc-border);
}

.pxc-multi-ulcer-bar .pxc-field {
  margin-bottom: 0;
  min-width: 120px;
}

.pxc-multi-ulcer-bar .pxc-btn-ghost {
  font-size: 0.72rem;
  padding: 0.35rem 0.65rem;
  margin-bottom: 0.1rem;
}

.pxc-clinical-intake {
  padding: 0.6rem 0 0.35rem;
  margin: 0 0 1rem;
  border-bottom: 1px dashed var(--pxc-border);
}

.pxc-clinical-sub {
  margin-top: 0.55rem;
}

.pxc-clinical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.55rem 0.85rem;
  align-items: end;
}

.pxc-clinical-grid .pxc-field {
  margin-bottom: 0;
}

.pxc-clinical-custom-labs .pxc-field--lab-custom {
  margin-top: 0.35rem;
}

/* Extension side panel — keep wound marking | scoring side-by-side (not stacked at 1100px) */
.pxc-rayan-foot,
.pxc-rayan-six {
  margin: 0 0 1.25rem;
}

.pxc-rayan-foot h4 {
  margin: 0 0 0.45rem;
}

.pxc-rayan-scorebar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.pxc-rayan-grade {
  border-collapse: collapse;
}

.pxc-rayan-grade th,
.pxc-rayan-grade td {
  border: 2px solid #334155;
  min-width: 3.1rem;
  padding: 0.28rem 0.4rem;
  text-align: center;
  font-weight: 700;
}

.pxc-rayan-sg {
  font-size: 1.05rem;
  font-weight: 700;
}

.pxc-rayan-sg input {
  width: 8.5rem;
  margin-left: 0.4rem;
  font-weight: 700;
  text-align: center;
}

.pxc-rayan-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.35rem 0 0.5rem;
}

.pxc-rayan-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.pxc-rayan-arrow {
  background: transparent;
  border: 0;
  font-size: 1.55rem;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
}

.pxc-rayan-arrow.is-go {
  color: #1e9907;
}

.pxc-rayan-arrow.is-stop {
  color: #df0404;
  cursor: default;
}

html:not(.pxc-theme-dark) body.pxc-app .pxc-rayan-arrow {
  border-width: 0;
}

.pxc-rayan-tiles,
.pxc-rayan-sixrow {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.35rem 0 0.6rem;
}

.pxc-rayan-tile {
  position: relative;
  flex: 0 0 11rem;
  width: 11rem;
  min-height: 11rem;
  margin: 0.2rem;
  padding: 1.35rem 0.7rem 0.7rem;
  border-radius: 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
}

.pxc-rayan-tile strong,
.pxc-rayan-tile > span {
  display: block;
}

.pxc-rayan-tick {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pxc-rayan-sub {
  display: flex;
  gap: 0.3rem;
  align-items: flex-start;
  margin-top: 0.28rem;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
}

.pxc-rayan-sixbox {
  flex: 0 0 auto;
  margin: 0.2rem;
  border: 1px solid #94a3b8;
}

.pxc-rayan-sixbox table {
  border-collapse: collapse;
  min-width: 16rem;
}

.pxc-rayan-sixbox th,
.pxc-rayan-sixbox td {
  border: 1px solid #cbd5e1;
  padding: 0.32rem 0.45rem;
  text-align: left;
}

.pxc-rayan-sixbox th {
  text-align: center;
}

.pxc-rayan-history {
  margin-top: 0.5rem;
}

body.pxc-extension-shell .pxc-shell,
body.pxc-extension-shell .pxc-shell--wide {
  max-width: 100%;
  min-height: 0;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

body.pxc-extension-shell .pxc-review-shell {
  max-width: 100%;
}

body.pxc-extension-shell .pxc-glass-pane {
  padding: 0.6rem 0.65rem;
}

body.pxc-extension-shell .pxc-mark-score-workspace {
  --pxc-mark-panel-h: 12.5rem;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 0.4rem;
}

body.pxc-extension-shell .pxc-review-shell .pxc-glass-pane--mark-score .pxc-stage-wrap {
  flex: 0 0 var(--pxc-mark-panel-h);
  height: var(--pxc-mark-panel-h);
  min-height: var(--pxc-mark-panel-h);
  max-height: var(--pxc-mark-panel-h);
}

body.pxc-extension-shell .pxc-mark-score-image-col > .pxc-mark-controls {
  gap: 0.3rem;
}

body.pxc-extension-shell .pxc-mark-controls .pxc-btn-ghost {
  font-size: 0.78rem;
  padding: 0.32rem 0.5rem;
  min-height: 1.85rem;
}

body.pxc-extension-shell .pxc-sinbad-controls {
  flex-wrap: wrap;
  gap: 0.25rem;
}

body.pxc-extension-shell .pxc-sinbad-row {
  gap: 0.35rem;
}

body.pxc-extension-shell .pxc-sinbad-row .pxc-domain {
  font-size: 0.8rem;
}

body.pxc-extension-shell .pxc-seg button {
  font-size: 0.62rem;
  padding: 0.22rem 0.35rem;
}

@media (max-width: 1100px) {
  body.pxc-extension-shell .pxc-review-shell .pxc-glass {
    min-height: 0;
  }

  body.pxc-extension-shell .pxc-mark-score-workspace {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  }

  body.pxc-extension-shell .pxc-mark-score-side-col .pxc-score-section {
    min-height: 10rem;
    max-height: none;
  }

  body.pxc-extension-shell .pxc-review-shell .pxc-glass-pane--mark-score,
  body.pxc-extension-shell .pxc-review-shell .pxc-glass-pane--left,
  body.pxc-extension-shell .pxc-review-shell .pxc-glass-pane--right {
    max-height: none;
    overflow-y: visible;
  }
}
