/* Patient Records — digital archive (stacked folder tabs) */
#patientRecordsArchive {
  color: #ffecd1;
}

.pa-crt {
  background: rgba(0, 0, 0, 0.18);
}
.pa-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.35rem 0.65rem 0.4rem;
  background: #0a0908;
  border-bottom: 3px double rgba(255, 159, 28, 0.45);
  position: relative;
  z-index: 6;
}
.pa-header-vintage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pa-header-rule {
  height: 0;
  border: none;
  border-top: 2px solid rgba(255, 159, 28, 0.55);
  border-bottom: 1px solid rgba(255, 159, 28, 0.2);
  margin: 0;
  opacity: 0.95;
}
.pa-header-rule--top {
  margin-bottom: 0.2rem;
}
.pa-header-rule--bottom {
  margin-top: 0.2rem;
}
.pa-header-block {
  padding: 0.1rem 0.3rem 0.05rem;
  border-left: 2px solid rgba(255, 159, 28, 0.35);
  border-right: 2px solid rgba(255, 159, 28, 0.35);
  background: rgba(0, 0, 0, 0.35);
}
.pa-header-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 159, 28, 0.65);
  margin-bottom: 0.12rem;
  line-height: 1.15;
}
.pa-headline {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.2rem;
  font-weight: normal;
  color: #ff9f1c;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.15;
}
.pa-breadcrumb {
  font-size: 0.78rem;
  color: rgba(255, 236, 209, 0.5);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.15rem;
  line-height: 1.25;
}
.pa-header-meta {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 159, 28, 0.5);
  margin-top: 0.18rem;
  padding-top: 0.18rem;
  border-top: 1px dashed rgba(255, 159, 28, 0.22);
  line-height: 1.25;
}
.pa-toolbar {
  flex-shrink: 0;
  align-self: flex-start;
  padding-top: 0.1rem;
}
.pa-toolbar button {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1rem;
  color: #ff9f1c;
  background: transparent;
  border: 1px solid rgba(255, 159, 28, 0.5);
  padding: 0.25rem 0.5rem;
  cursor: var(--cursor-pointer);
}
.pa-toolbar button:hover {
  background: rgba(255, 159, 28, 0.15);
}
.pa-toolbar button:focus {
  outline: none;
}
.pa-toolbar button:focus-visible {
  box-shadow: 0 0 0 2px #0a0a0a, 0 0 0 4px rgba(255, 159, 28, 0.55);
}
.pa-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 6;
  padding: 0.45rem 0.65rem 0.85rem;
}
.pa-subtitle {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 159, 28, 0.72);
  margin-bottom: 0.45rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid rgba(255, 159, 28, 0.22);
  background: rgba(0, 0, 0, 0.4);
}
.pa-subtitle-catalog {
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  color: #ffb84d;
  text-shadow: 0 0 8px rgba(255, 159, 28, 0.2);
}
.pa-subtitle-window {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: rgba(255, 159, 28, 0.55);
}
/* Fake damaged / secured file cards (manifest + per-chart attachments) */
.pa-file-vault {
  margin-bottom: 0.55rem;
  padding: 0.35rem 0.4rem 0.45rem;
  border: 1px dashed rgba(255, 159, 28, 0.22);
  background: rgba(0, 0, 0, 0.35);
}
.pa-file-vault[hidden] {
  display: none !important;
}
.pa-file-vault-title {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 159, 28, 0.55);
  margin-bottom: 0.35rem;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid rgba(255, 159, 28, 0.12);
}
.pa-file-vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.4rem;
}
.pa-file-card {
  font-family: 'VT323', 'Courier New', monospace;
  padding: 0.4rem 0.45rem 0.45rem;
  border-width: 2px;
  border-style: solid;
  border-radius: 2px;
  min-height: 6.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.pa-file-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}
.pa-file-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}
.pa-file-card--damage {
  border-color: #c9a000;
  background: #1f1a0c;
  color: #f8e8a0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.pa-file-card--damage .pa-file-icon {
  color: #f5d030;
}
.pa-file-card--damage .pa-file-caution {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #1a1508;
  background: #e8c020;
  padding: 0.1rem 0.25rem;
  margin-top: 0.15rem;
  align-self: flex-start;
}
.pa-file-card--damage .pa-file-name {
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  word-break: break-word;
}
.pa-file-card--damage .pa-file-meta {
  font-size: 0.8rem;
  line-height: 1.3;
  color: rgba(248, 232, 160, 0.75);
  margin-top: 0.1rem;
}
.pa-file-card--damage .pa-file-id {
  font-size: 0.72rem;
  color: rgba(248, 232, 160, 0.45);
}
.pa-file-fake-metric {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 184, 77, 0.85);
  margin: 0.2rem 0 0.1rem;
  padding: 0.15rem 0.2rem;
  border: 1px solid rgba(255, 159, 28, 0.22);
  background: rgba(0, 0, 0, 0.35);
}
.pa-file-fake-metric--secured {
  color: rgba(220, 160, 160, 0.75);
  border-color: rgba(120, 50, 50, 0.35);
  background: rgba(0, 0, 0, 0.35);
}
.pa-file-card--compact .pa-file-fake-metric {
  font-size: 0.62rem;
  margin: 0.12rem 0 0.08rem;
  padding: 0.1rem 0.15rem;
}
.pa-file-bars {
  display: block;
  width: 100%;
  height: 1.1rem;
  margin: 0.08rem 0;
  opacity: 0.88;
}
.pa-file-card--compact .pa-file-bars {
  height: 0.85rem;
  margin: 0.05rem 0;
}
.pa-file-spark {
  display: block;
  width: 100%;
  height: 1.75rem;
  margin: 0.2rem 0 0.1rem;
  opacity: 0.92;
}
.pa-file-card--compact .pa-file-spark {
  height: 1.35rem;
  margin: 0.1rem 0;
}
.pa-file-more {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.25rem;
  padding: 0.25rem 0.4rem;
  width: 100%;
  border: 1px solid rgba(80, 80, 80, 0.6);
  border-style: dashed;
  cursor: not-allowed;
  opacity: 0.55;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.pa-file-more--locked {
  color: rgba(180, 180, 180, 0.45);
  background: #0a0a0a;
}
.pa-file-more--locked:disabled {
  opacity: 0.5;
}
.pa-file-more .pa-file-more-icon {
  width: 0.95rem;
  height: 0.95rem;
  opacity: 0.6;
}
.pa-file-card--damage .pa-file-more--locked {
  border-color: rgba(201, 160, 0, 0.25);
  color: rgba(248, 232, 160, 0.35);
  background: #121008;
}
.pa-file-card--secured .pa-file-more--locked {
  border-color: rgba(100, 40, 40, 0.35);
  color: rgba(180, 150, 150, 0.35);
  background: #080606;
}
.pa-file-card--secured {
  border-color: #6b1a1a;
  background: #0c0a0a;
  color: #c9b8b8;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.85);
}
.pa-file-card--secured .pa-file-icon {
  color: #c44;
}
.pa-file-card--secured .pa-file-ribbon {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ebb;
  background: #2a1010;
  border: 1px solid #5c2020;
  padding: 0.08rem 0.3rem;
  align-self: flex-start;
}
.pa-file-card--secured .pa-file-name {
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: #dcc;
}
.pa-file-card--secured .pa-file-redacted {
  font-size: 0.78rem;
  line-height: 1.35;
  color: #8a7a7a;
  letter-spacing: 0.12em;
  margin-top: 0.15rem;
  padding: 0.2rem 0.25rem;
  background: #050505;
  border: 1px solid #222;
}
.pa-file-card--secured .pa-file-id {
  font-size: 0.72rem;
  color: rgba(200, 180, 180, 0.4);
}
.pa-file-card--compact {
  min-height: 0;
  padding: 0.3rem 0.35rem;
}
.pa-attached-files {
  margin-top: 0.65rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(255, 236, 209, 0.2);
}
.pa-attached-files-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 159, 28, 0.55);
  margin-bottom: 0.35rem;
}
.pa-attached-files-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.pa-stack-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.25rem;
  padding-bottom: 0.35rem;
}
/* One physical folder: tab rail + connected pocket (same outline) */
.pa-folder-card {
  position: relative;
  margin-bottom: 0;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.5)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}
.pa-stack .pa-folder-card + .pa-folder-card {
  margin-top: -0.5rem;
}
.pa-folder-tabstrip {
  display: flex;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 0;
  min-height: 2.25rem;
  padding: 0.3rem 0.45rem 0;
  background: #2e2a26;
  border: 1px solid rgba(0, 0, 0, 0.7);
  border-bottom-color: rgba(0, 0, 0, 0.88);
  border-radius: 10px 10px 0 0;
}
@supports (color: color-mix(in srgb, red, blue)) {
  .pa-folder-tabstrip {
    background: color-mix(in srgb, var(--pa-folder) 34%, #0f0e0d 66%);
  }
}
.pa-folder-strip-telemetry {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.28rem 0.4rem;
  border: 1px solid rgba(0, 0, 0, 0.45);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.pa-folder-strip-stack {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  align-self: flex-end;
  width: min(100%, 13.5rem);
}
.pa-folder-strip-chart-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
}
.pa-folder-bar-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.05rem;
  padding: 0.05rem 0;
}
.pa-folder-bar-legend-row {
  display: flex;
  align-items: baseline;
  gap: 0.22rem;
  line-height: 1.05;
}
.pa-folder-bar-legend-swatch {
  flex-shrink: 0;
  width: 0.42rem;
  height: 0.42rem;
  border: 1px solid rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.pa-folder-bar-legend-name {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 0.48rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 210, 160, 0.78);
}
.pa-folder-bar-legend-idx {
  color: rgba(255, 159, 28, 0.65);
  font-variant-numeric: tabular-nums;
}
.pa-folder-strip-chart-row .pa-folder-strip-square {
  flex: 0 0 38%;
  width: 38%;
  max-width: 4.75rem;
  min-width: 2.75rem;
  aspect-ratio: 1 / 1;
  height: auto;
  align-self: center;
}
.pa-folder-strip-metric {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  color: rgba(255, 200, 130, 0.78);
  margin-top: 0.12rem;
  padding: 0.2rem 0.1rem 0;
  border-top: 1px solid rgba(255, 159, 28, 0.18);
}
.pa-folder-strip-square {
  aspect-ratio: 1 / 1;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(0, 0, 0, 0.4);
  background: rgba(0, 0, 0, 0.25);
}
.pa-folder-strip-square .pa-folder-bars-square {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0.92;
}
.pa-folder-strip-line {
  width: 100%;
  min-width: 0;
}
.pa-folder-strip-line .pa-file-spark {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 100 / 22;
  margin: 0;
  opacity: 0.92;
}
.pa-folder-telemetry .pa-folder-strip-telemetry {
  margin-top: 0.15rem;
}
.pa-folder-telemetry {
  margin-bottom: 0;
  padding: 0.4rem 0.45rem;
  border: 1px dashed rgba(255, 159, 28, 0.22);
  background: rgba(0, 0, 0, 0.2);
}
.pa-panel-col--telemetry .pa-folder-telemetry {
  flex: 1 1 auto;
  min-height: 0;
  box-sizing: border-box;
}
.pa-folder-telemetry-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 159, 28, 0.55);
  margin-bottom: 0.25rem;
}
.pa-folder-telemetry .pa-file-more {
  margin-top: 0.35rem;
}
.pa-tab {
  flex: 0 1 auto;
  max-width: min(100%, 28rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.85rem 0.45rem;
  margin: 0 0 -1px 0;
  border: 1px solid rgba(30, 22, 18, 0.85);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: var(--pa-folder);
  color: #f8f0e4;
  /* <button> does not inherit font — match mainframe CRT face */
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  cursor: var(--cursor-pointer);
  position: relative;
  z-index: 2;
}
.pa-tab:hover {
  filter: brightness(1.08);
}
.pa-tab:focus {
  outline: none;
}
.pa-tab:focus-visible {
  filter: brightness(1.08);
  box-shadow: 0 0 0 2px #0a0a0a, 0 0 0 4px rgba(255, 159, 28, 0.55);
}
.pa-tab-open {
  filter: brightness(1.04);
}
.pa-folder-card.pa-folder--open .pa-tab-open {
  border-bottom-color: transparent;
}
.pa-folder-pocket {
  border: 1px solid rgba(0, 0, 0, 0.65);
  border-top: none;
  border-radius: 0 0 12px 12px;
  margin-top: -1px;
  background: var(--pa-folder-inner);
  position: relative;
  z-index: 1;
}
.pa-folder-card:not(.pa-folder--open) .pa-folder-pocket {
  border-top: 1px solid rgba(0, 0, 0, 0.65);
  border-radius: 0 0 12px 12px;
  min-height: 0.4rem;
}
.pa-folder-card:not(.pa-folder--open) .pa-panel {
  display: none !important;
}
.pa-folder-card.pa-folder--open .pa-folder-pocket {
  border-top: 1px solid rgba(0, 0, 0, 0.55);
  min-height: 0;
}
.pa-tab-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'VT323', 'Courier New', monospace;
}
.pa-mono {
  font-family: 'VT323', 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
}
.pa-tab-id {
  flex-shrink: 0;
  opacity: 0.92;
  font-size: 1rem;
  font-family: 'VT323', 'Courier New', monospace;
}
.pa-panel {
  font-family: 'VT323', 'Courier New', monospace;
  background: transparent;
  border: none;
  border-radius: 0 0 10px 10px;
  padding: 0.85rem 1rem 1rem;
}
.pa-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 236, 209, 0.15);
}
.pa-panel-main {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.85rem 1rem;
}
.pa-panel-col--primary {
  flex: 1;
  min-width: 0;
}
.pa-panel-col--telemetry {
  flex: 0 0 auto;
  width: min(14rem, 44%);
  max-width: 100%;
  display: flex;
  flex-direction: column;
}
@media (max-width: 32rem) {
  .pa-panel-main {
    flex-direction: column;
  }
  .pa-panel-col--telemetry {
    width: 100%;
  }
}
.pa-panel-id { color: #ffc266; font-size: 1.05rem; }
.pa-panel-date { color: rgba(255, 236, 209, 0.72); font-size: 1rem; }
.pa-receipt {
  display: inline-block;
  background: #c4b08a;
  color: #1c1810;
  padding: 0.45rem 0.85rem 0.5rem;
  margin-bottom: 0.65rem;
  max-width: 100%;
  border: 1px solid rgba(40, 32, 24, 0.45);
  box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.35);
}
.pa-receipt-title {
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  margin-bottom: 0.15rem;
  color: #2a2218;
}
.pa-receipt-val {
  font-size: 1.15rem;
}
.pa-panel-status {
  font-size: 1rem;
  color: #ffb84d;
  margin-bottom: 0.5rem;
}
.pa-panel-body {
  font-size: 1rem;
  line-height: 1.45;
  color: rgba(255, 236, 209, 0.92);
}
.pa-panel-body p {
  margin: 0.35rem 0;
}
.pa-panel-muted {
  color: rgba(255, 236, 209, 0.5);
  font-style: italic;
}
.pa-panel-artifacts {
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(255, 236, 209, 0.2);
  font-size: 0.95rem;
  color: rgba(255, 200, 140, 0.9);
}
.pa-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: rgba(255, 236, 209, 0.45);
  font-size: 1.15rem;
}
