/*
  OceanWoundsWayfinder proprietary software.
  Copyright (c) 2026 James Isenberg. All rights reserved.
  Unauthorized copying, redistribution, reverse engineering, or derivative works are prohibited.
*/

:root {
  --bg: #e7f0f5;
  --paper: #ffffff;
  --paper-soft: #f4f8fb;
  --ink: #0f2430;
  --ink-soft: #56707d;
  --accent: #0f6d98;
  --accent-deep: #0a3e5a;
  --line: rgba(15, 109, 152, 0.16);
  --danger: #a52e28;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 8% 7%, rgba(15, 109, 152, 0.08), transparent 40%),
    radial-gradient(ellipse at 94% 3%, rgba(90, 213, 205, 0.08), transparent 32%),
    linear-gradient(180deg, #f9fcfe, var(--bg) 54%, #e3edf3 100%);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

h1,
h2,
h3 {
  font-family: "Fraunces", "Georgia", serif;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 34px;
}

header {
  margin-bottom: 12px;
}

.brand {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  border-radius: 20px;
  padding: 18px 22px 16px;
  background:
    radial-gradient(circle at 12% 18%, rgba(83, 214, 208, 0.12), transparent 24%),
    linear-gradient(135deg, #051521 0%, #0a3046 52%, #0d425f 100%);
  color: #ecfeff;
  border: 1px solid rgba(128, 220, 228, 0.15);
  box-shadow: 0 16px 30px rgba(6, 26, 38, 0.18);
}

.brand-lockup {
  min-width: 0;
}

.brand-logo {
  width: 100%;
  max-width: 520px;
  height: auto;
  display: block;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.brand-subtitle {
  margin: 10px 0 0;
  color: rgba(222, 245, 248, 0.82);
  font-size: 0.96rem;
  line-height: 1.35;
}

.brand-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.source-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  color: #ecfeff;
  border: 1px solid rgba(156, 230, 235, 0.24);
  border-radius: 8px;
  padding: 9px 14px;
  font-weight: 700;
  min-height: 40px;
  letter-spacing: 0.02em;
  transition: background 90ms ease;
}

.brand-actions .source-button {
  margin-right: 0;
}

.source-button:hover {
  background: rgba(83, 214, 208, 0.18);
}

.source-button:active {
  background: rgba(83, 214, 208, 0.1);
}

.hint {
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.4;
}

.runtime-notice {
  margin-top: 8px;
  color: #ecfeff;
  background: rgba(4, 20, 29, 0.58);
  border: 1px solid rgba(156, 230, 235, 0.28);
  border-radius: 10px;
  padding: 8px 10px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 10px 24px rgba(15, 42, 58, 0.06);
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 1.3rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.between {
  justify-content: space-between;
  align-items: center;
}

.field-label {
  min-width: 290px;
  font-weight: 600;
  color: var(--ink-soft);
}

input:not([type="checkbox"]):not([type="radio"]),
select,
button {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus {
  outline: 2px solid rgba(13, 111, 159, 0.45);
  outline-offset: 1px;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  background: #fff;
  color: var(--ink);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234d6f7c' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

input:not([type="checkbox"]):not([type="radio"]) {
  min-width: 290px;
}

button {
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-height: 40px;
  border-radius: 8px;
  box-shadow: 0 3px 0 var(--accent-deep), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: background 90ms ease, transform 70ms ease, box-shadow 70ms ease;
}

button:hover {
  background: #1381ad;
}

button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--accent-deep), inset 0 1px 0 rgba(0, 0, 0, 0.06);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  box-shadow: none;
  transform: none;
}

.hidden,
[hidden] {
  display: none !important;
}

.download-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.download-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: #eef7fb;
  border: 1px solid rgba(13, 111, 159, 0.2);
  color: var(--accent-deep);
  font-weight: 700;
  border-radius: 8px;
  padding: 8px 11px;
  min-height: 38px;
  box-shadow: 0 2px 0 rgba(13, 111, 159, 0.25);
  transition: background 90ms ease, transform 70ms ease, box-shadow 70ms ease;
  letter-spacing: 0.01em;
}

.download-link:hover {
  background: #f9e8e3;
}

.download-link:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 rgba(107, 31, 42, 0.25);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #fff;
}

th,
td {
  padding: 9px;
  border: 1px solid var(--line);
  text-align: left;
  font-size: 0.87rem;
  vertical-align: top;
}

th {
  background: var(--paper-soft);
  color: #5a1e28;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.73rem;
}

.multiline-cell {
  white-space: normal;
}

.debridement-line {
  color: #b42318;
  font-weight: 700;
}

.safety-line {
  color: #7e1114;
  font-weight: 700;
}

.data-quality-line {
  display: inline-block;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #8b3a04;
  background: #fff3e8;
  border: 1px solid #f2c7a5;
}

.confidence-line {
  display: inline-block;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #5a1e28;
  background: #f5e8e4;
  border: 1px solid #e8d0cb;
}

.response-line {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.response-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.response-pill.improving {
  color: #2a5a30;
  background: #d8f4ea;
  border-color: #9ad9c2;
}

.response-pill.worsening {
  color: #8b1d18;
  background: #fde7e5;
  border-color: #f3bbb4;
}

.response-pill.mixed {
  color: #6b4b00;
  background: #fff4d8;
  border-color: #f1db9d;
}

.response-pill.indeterminate {
  color: #375166;
  background: #f5e4df;
  border-color: #c4d9ea;
}

.response-metric {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  background: #f1f8fd;
  border: 1px solid #ead8d3;
  color: #23465e;
}

.qa-box {
  border: 1px solid #e8d0cb;
  border-radius: 9px;
  background: #fdf9f7;
  padding: 7px 8px;
}

.qa-title {
  margin: 0 0 5px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #5a1e28;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.qa-grid {
  display: grid;
  gap: 4px;
}

.qa-line {
  display: grid;
  grid-template-columns: minmax(118px, 160px) minmax(0, 1fr);
  gap: 8px;
  font-size: 0.78rem;
}

.qa-label {
  font-weight: 700;
  color: #6b2030;
}

.qa-value {
  color: #5a2030;
}

.qa-value.qa-muted {
  color: #547088;
}

.qa-drawer summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.qa-drawer summary::-webkit-details-marker {
  display: none;
}

.qa-drawer summary::before,
.qa-drawer summary::after {
  color: #5a1e28;
  font-size: 0.78rem;
  line-height: 1;
}

.qa-drawer summary::before {
  content: "\25B8";
}

.qa-drawer summary::after {
  content: "\25C2";
}

.qa-drawer[open] summary::before,
.qa-drawer[open] summary::after {
  content: "\25BE";
}

.qa-drawer .qa-box {
  margin-top: 8px;
}

.qa-drawer .qa-title {
  text-align: center;
}

.qa-drawer .qa-line {
  grid-template-columns: 1fr;
  gap: 2px;
  text-align: center;
  justify-items: center;
}

.why-drawer-wrap {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.why-drawer {
  border: 1px dashed #b8d4e4;
  border-radius: 8px;
  padding: 6px 8px;
  background: #fdfaf8;
}

.why-drawer summary {
  cursor: pointer;
  font-weight: 700;
  color: #5a1e28;
}

.why-drawer ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.why-drawer li {
  margin-bottom: 5px;
}

.step-spacer {
  display: inline-block;
  height: 10px;
  width: 100%;
}

.manual-field {
  display: grid;
  gap: 5px;
  color: #245b75;
  font-weight: 700;
  font-size: 0.84rem;
}

.manual-field input,
.manual-field select,
.manual-field textarea {
  width: 100%;
  min-width: 0;
}

.manual-field textarea {
  min-height: 72px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

/* Tunneling / undermining detail inputs (depth + clock position) */
.manual-subfields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 4px;
}
.manual-subfields[hidden] { display: none; }

.manual-wound-list {
  display: grid;
  gap: 10px;
}

.manual-wound-card {
  border: 1px solid rgba(107, 31, 42, 0.18);
  border-radius: 10px;
  background: #fdf9f7;
  padding: 10px;
}

.manual-wound-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.manual-wound-title {
  margin: 0;
  font-size: 1.05rem;
}

.manual-remove-btn,
.manual-secondary-btn {
  background: #f0f8fd;
  color: #5a1e28;
  border: 1px solid rgba(107, 31, 42, 0.2);
  box-shadow: 0 2px 0 rgba(107, 31, 42, 0.25);
}

.manual-remove-btn:hover,
.manual-secondary-btn:hover {
  background: #e2f0f9;
}

.manual-remove-btn {
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 0.82rem;
}

.manual-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.manual-wide {
  grid-column: 1 / -1;
}

.manual-measure-grid,
.manual-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.manual-measure-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.manual-check-section {
  border: 1px dashed #dcc7c2;
  border-radius: 10px;
  padding: 8px;
  background: #fdfbf9;
}

/* Patient Clinical Profile sub-section headings */
.manual-subhead {
  margin: 12px 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
}
.manual-subhead:first-of-type { margin-top: 4px; }

.manual-field.manual-field-wide {
  grid-column: 1 / -1;
}

.manual-check-section h4 {
  margin: 0 0 7px;
  font-size: 0.82rem;
  color: #5a1e28;
}

.manual-check-grid label {
  display: grid;
  grid-template-columns: 15px 1fr;
  gap: 6px;
  align-items: start;
  color: #5a1e28;
  font-size: 0.8rem;
  font-weight: 600;
}

.manual-check-grid input {
  min-width: 0;
  margin: 3px 0 0;
}

.manual-field.is-disabled,
.manual-check-section.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.manual-field.is-disabled input,
.manual-field.is-disabled select,
.manual-field.is-disabled textarea {
  background: #f0ece9;
  color: #9b8a85;
  border-color: #d4cac6;
}

.field-type-hint {
  display: none;
}

.manual-prior {
  margin-top: 10px;
  border-top: 1px solid rgba(107, 31, 42, 0.14);
  padding-top: 10px;
}

.manual-prior summary {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-weight: 800;
  color: #5a1e28;
  list-style: none;
}

.manual-prior summary::-webkit-details-marker {
  display: none;
}

.manual-prior summary::before {
  content: "";
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #5a1e28;
  transition: transform 160ms ease;
}

.manual-prior[open] > summary::before {
  transform: rotate(90deg);
}

.manual-clinical-details > summary {
  align-items: baseline;
  gap: 6px;
}

.manual-details-hint {
  font-size: 0.78rem;
  font-weight: 500;
  color: #8a6060;
  font-style: italic;
}

.manual-clinical-details[open] .manual-details-hint {
  display: none;
}

.manual-actions {
  display: flex;
  justify-content: stretch;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.manual-actions button {
  flex: 1 1 160px;
}

.manual-empty {
  margin: 0;
  padding: 10px;
  border: 1px dashed #dcc7c2;
  border-radius: 10px;
  color: var(--ink-soft);
  background: #fdfaf8;
}

.jump-target {
  animation: jumpFlash 2100ms ease;
}

.panel,
.brand {
  animation: liftIn 540ms ease both;
}

@keyframes liftIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes jumpFlash {
  0% {
    background: #fff8de;
    outline: 2px solid #f2b200;
    outline-offset: -2px;
  }
  100% {
    background: transparent;
    outline: 0 solid transparent;
    outline-offset: 0;
  }
}

@media (max-width: 800px) {
  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .brand-logo {
    max-width: 360px;
  }

  .field-label {
    min-width: 100%;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select {
    min-width: 100%;
    width: 100%;
  }

  .manual-grid {
    grid-template-columns: 1fr;
  }

  .manual-actions button {
    width: 100%;
  }

  .settings-danger-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .narrative-controls {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .narrative-controls select {
    min-width: 0;
    flex: 1 1 160px;
  }

  .hipaa-actions {
    flex-wrap: wrap;
  }

  .hipaa-actions button {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .settings-item-actions {
    flex-wrap: wrap;
  }

  .settings-item-actions input {
    min-width: 0;
    flex: 1 1 auto;
  }

  .download-group {
    gap: 6px;
  }
}

/* ── Small phones (≤ 480 px) ─────────────────────────────── */
@media (max-width: 480px) {
  .app {
    padding: 14px 10px 44px;
  }

  .brand {
    padding: 14px 12px;
    border-radius: 18px;
    gap: 8px;
  }

  .brand-logo {
    max-width: 260px;
  }

  .brand-subtitle {
    font-size: 0.84rem;
  }

  .brand-actions {
    gap: 7px;
    width: 100%;
    justify-content: flex-start;
  }

  .source-button {
    padding: 10px 12px;
    font-size: 0.86rem;
    min-height: 44px;
  }

  .panel {
    padding: 12px 10px;
    border-radius: 14px;
    margin-bottom: 10px;
  }

  .panel h2 {
    font-size: 1.12rem;
  }

  button {
    min-height: 44px;
    padding: 11px 12px;
    font-size: 0.9rem;
  }

  .download-link {
    min-height: 44px;
    font-size: 0.88rem;
    padding: 10px 10px;
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    text-align: center;
  }

  .download-group {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .hipaa-actions button {
    flex: 1 1 100%;
  }

  .manual-wound-head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .manual-measure-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .manual-check-grid {
    grid-template-columns: 1fr;
  }

  .qa-line {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .qa-label {
    margin-bottom: 1px;
  }

  .supplies-grid {
    grid-template-columns: 1fr;
  }

  .audit-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .narrative-view {
    min-height: 180px;
    font-size: 0.9rem;
  }

  th {
    font-size: 0.68rem;
    padding: 7px 6px;
  }

  td {
    font-size: 0.82rem;
    padding: 7px 6px;
  }

  .response-pill {
    font-size: 0.72rem;
    padding: 2px 7px;
  }

  .row.between {
    align-items: flex-start;
  }
}

/* ── Safe area for notched/dynamic-island phones ─────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 800px) {
    .app {
      padding-bottom: max(34px, env(safe-area-inset-bottom));
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel,
  .brand {
    animation: none;
  }

  .jump-target {
    animation: none;
  }
}


.sources-list {
  margin: 0;
  padding-left: 20px;
}

.sources-list li {
  margin-bottom: 6px;
}

#sourcesPanel h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.narrative-view {
  width: 100%;
  min-height: 220px;
  max-height: 640px;
  overflow: auto;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.narrative-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.narrative-controls label {
  font-weight: 700;
  color: #5a1e28;
  font-size: 0.84rem;
}

.narrative-controls select {
  min-width: 180px;
  padding: 7px 9px;
  font-size: 0.84rem;
}

.narrative-empty {
  margin: 0;
  color: var(--ink-soft);
}

.narrative-patient {
  padding: 10px 0 12px;
  border-bottom: 1px solid #ead8d3;
}

.narrative-patient:last-child {
  border-bottom: 0;
}

.narrative-patient-header {
  font-size: 1.08rem;
  font-weight: 800;
  color: #4a1520;
  margin-bottom: 8px;
  line-height: 1.35;
}

.narrative-patient-header strong {
  font-size: 1.13rem;
  font-weight: 800;
}

.narrative-wound {
  margin: 0 0 9px;
  line-height: 1.48;
}

.narrative-wound:last-child {
  margin-bottom: 0;
}

.narrative-summary {
  margin: 0;
  line-height: 1.52;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.settings-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fdf9f7;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.settings-item h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.settings-build-info,
.settings-account-info {
  background: #fbf8f6;
}

.build-info-line {
  margin: 0;
  color: #7a5242;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.settings-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.settings-item-actions button {
  padding: 8px 11px;
  font-size: 0.84rem;
  border-radius: 9px;
}

.settings-item-actions input {
  min-width: 0;
}

.settings-danger {
  border-color: rgba(165, 46, 40, 0.38);
  background: #fff5f4;
}

.settings-danger h3 {
  color: var(--danger);
}

.settings-danger-actions {
  display: grid;
  grid-template-columns: 1fr auto;
}

.settings-danger-actions input {
  width: 100%;
  min-width: 220px;
}

.settings-danger-actions button {
  background: #8f2318;
  box-shadow: 0 3px 0 #5c1410, inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.settings-danger-actions button:hover {
  background: #a12920;
}


.hipaa-policy-grid {
  display: grid;
  gap: 8px;
}

.hipaa-field {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  color: #5a1e28;
}

.hipaa-field input[type="number"],
.hipaa-field input[type="password"] {
  width: 100%;
}

.hipaa-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #5a1e28;
}

.hipaa-actions button {
  min-width: 120px;
}

.audit-log-meta {
  margin: 8px 0 6px;
  font-size: 0.82rem;
  color: #6b2030;
}

.supplies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.audit-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 8px 0 4px;
}

.audit-summary-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fdf9f7;
}

.audit-summary-card .label {
  display: block;
  font-size: 0.74rem;
  color: #7a4048;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.audit-summary-card .value {
  display: block;
  margin-top: 2px;
  font-size: 1.03rem;
  font-weight: 800;
  color: #103e56;
}

.audit-warning-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #7e1114;
}

.audit-warning-list li {
  margin-bottom: 4px;
}

.print-packet-content {
  display: none;
}

.print-patient {
  background: #fff;
  border: 1px solid #ead8d3;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 0 0 14px;
  break-after: page;
  page-break-after: always;
}

.print-patient:last-child {
  break-after: auto;
  page-break-after: auto;
}

.print-patient-header {
  margin-bottom: 8px;
  border-bottom: 1px solid #e8d5d0;
  padding-bottom: 7px;
}

.print-patient-name {
  margin: 0;
  font-size: 1.1rem;
  color: #4a1520;
}

.print-patient-meta {
  margin: 3px 0 0;
  color: #7a4048;
  font-size: 0.8rem;
}

.print-wound {
  margin: 0 0 10px;
  padding: 8px 9px;
  border: 1px dashed #e5cec9;
  border-radius: 8px;
  background: #fbfdff;
}

.print-wound:last-child {
  margin-bottom: 0;
}

.print-wound h4 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: #5a1e28;
}

.print-wound p {
  margin: 3px 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

body.print-packet-mode main > section,
body.print-packet-mode main > header {
  display: none !important;
}

body.print-packet-mode #printPacketPanel {
  display: block !important;
}

body.print-packet-mode #printPacketContent {
  display: block !important;
}

@media print {
  body {
    background: #fff !important;
  }

  .app {
    max-width: none;
    padding: 0;
  }
}

.tissue-pct-alert {
  display: none;
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #fff3f2;
  border: 1px solid #f5b8b5;
  color: #8f2318;
}

.tissue-pct-alert.is-visible {
  display: block;
}

.tissue-pct-total {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.76rem;
  color: #7a4048;
  font-weight: 600;
}

.phrase-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.phrase-field {
  border: 1px solid #e8d5d0;
  border-radius: 10px;
  padding: 8px;
  background: #fdfaf8;
  display: grid;
  gap: 5px;
}

.phrase-field label {
  font-size: 0.8rem;
  font-weight: 800;
  color: #5a1e28;
}

.phrase-field textarea {
  width: 100%;
  min-height: 64px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.83rem;
  line-height: 1.35;
  resize: vertical;
}

.phrase-field .phrase-help {
  margin: 0;
  color: #4f6a7d;
  font-size: 0.75rem;
  line-height: 1.35;
}

.supply-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fdf9f8;
}

.supply-group h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.supply-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 7px;
  align-items: start;
  margin-bottom: 6px;
}

.supply-option input {
  min-width: 0;
  margin-top: 2px;
}

.wound-type-cell {
  min-width: 370px;
}



    
/* ── Name Gate & Terms Dialog ─────────────────────────── */
body.name-gate-active {
  overflow: hidden;
}

.name-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: safe center;
  padding: 24px 16px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(42, 15, 22, 0.52);
  backdrop-filter: blur(8px);
}

.name-gate-overlay[hidden] {
  display: none !important;
}

.name-gate-card {
  width: min(100%, 560px);
  display: grid;
  gap: 14px;
  border: 1px solid rgba(107, 31, 42, 0.2);
  border-radius: 18px;
  padding: 22px;
  background: linear-gradient(180deg, #fffdfc, #fdf6f3);
  box-shadow: 0 28px 70px rgba(42, 15, 22, 0.32);
}

.name-gate-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.name-gate-mark {
  width: 132px;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.name-gate-kicker {
  display: block;
  color: #0d6f9f;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.name-gate-card h2 {
  margin: 2px 0 0;
  color: #4a1520;
  font-size: 1.45rem;
  line-height: 1.15;
}

.name-gate-copy {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.name-gate-field {
  display: grid;
  gap: 6px;
  color: #5a1e28;
  font-weight: 800;
}

.name-gate-field input {
  width: 100%;
  min-width: 0;
}

.name-gate-acks {
  display: grid;
  gap: 9px;
}

.name-gate-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(107, 31, 42, 0.16);
  border-radius: 10px;
  background: #fffaf8;
  color: #5a1e28;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.38;
}

.name-gate-check input {
  min-width: 0;
  margin: 3px 0 0;
}

.name-gate-terms {
  margin: -3px 0 0;
  font-size: 0.84rem;
}

.name-gate-terms a {
  color: #6b1f2a;
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.name-gate-card button {
  width: 100%;
}

.name-gate-error {
  min-height: 1.2em;
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 800;
}

/* ── Auth views (login / register / forgot) ───────────────── */
.auth-card {
  gap: 12px;
}

.auth-view {
  display: grid;
  gap: 14px;
}

.auth-view.hidden {
  display: none !important;
}

.auth-links {
  margin: 2px 0 0;
  text-align: center;
  font-size: 0.86rem;
}

.auth-links a {
  color: #6b1f2a;
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.auth-sep {
  margin: 0 8px;
  color: #b89aa0;
}

.auth-optional {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.auth-success {
  min-height: 1.2em;
  margin: -4px 0 0;
  color: #1f7a4d;
  font-size: 0.82rem;
  font-weight: 800;
}

/* ── Admin user management (audit page) ───────────────────── */
.user-admin {
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid rgba(107, 31, 42, 0.18);
  border-radius: 12px;
  background: #fdf9f7;
}

.user-admin.hidden {
  display: none !important;
}

.user-admin h3 {
  margin: 0;
  color: #4a1520;
}

.user-admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.user-admin-toolbar button {
  padding: 8px 10px;
  font-size: 0.8rem;
}

#userAdminTable th,
#userAdminTable td {
  font-size: 0.82rem;
  vertical-align: middle;
}

.user-flagged {
  background: #fff4e5;
}

.user-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #e6f4ec;
  color: #1f7a4d;
  white-space: nowrap;
}

.user-badge-warn {
  background: #fde6c8;
  color: #9a5a12;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-actions button {
  padding: 5px 9px;
  font-size: 0.76rem;
  border-radius: 8px;
  background: #f0f8fd;
  color: #5a1e28;
  border: 1px solid rgba(107, 31, 42, 0.2);
  box-shadow: 0 2px 0 rgba(107, 31, 42, 0.18);
}

.user-actions button:hover {
  background: #e2f0f9;
}

.user-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  box-shadow: none;
}

.user-actions button.user-danger {
  background: #fbeaea;
  color: #a12626;
  border-color: rgba(161, 38, 38, 0.3);
}

.field-reports {
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid rgba(16, 62, 86, 0.2);
  border-radius: 12px;
  background: #fffdfc;
}

.field-reports.hidden {
  display: none !important;
}

.field-reports h3 {
  margin: 0;
  color: #4a1520;
}

.field-reports-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.field-reports-toolbar button {
  padding: 8px 10px;
  font-size: 0.8rem;
}

.field-reports-unread-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid rgba(16, 62, 86, 0.2);
  border-radius: 999px;
  background: #eaf5f8;
  color: #103e56;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.field-reports-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.field-report-card,
.field-report-empty {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fdf9f7;
  padding: 10px 12px;
}

.field-report-card {
  border-left-width: 4px;
}

.field-report-unread {
  border-left-color: #1d7ea4;
  background: #f8fcfd;
}

.field-report-read {
  border-left-color: #d9c6bf;
}

.field-report-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.field-report-titleline {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.field-report-status-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 999px;
  background: #b8aaa6;
  box-shadow: inset 0 0 0 1px rgba(42, 15, 22, 0.12);
}

.field-report-unread .field-report-status-dot {
  background: #1d7ea4;
  box-shadow: 0 0 0 3px rgba(29, 126, 164, 0.12);
}

.field-report-type {
  display: inline-block;
  margin-bottom: 3px;
  color: #7a5242;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-report-card h4 {
  margin: 0;
  color: #103e56;
  font-size: 0.98rem;
}

.field-report-side {
  display: grid;
  justify-items: end;
  gap: 4px;
  flex: 0 0 auto;
  max-width: 210px;
}

.field-report-state {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0eee9;
  color: #6d4c45;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field-report-unread .field-report-state {
  background: #eaf5f8;
  color: #103e56;
}

.field-report-actor {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #5a1e28;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: right;
}

.field-report-message {
  margin: 8px 0 0;
  color: #2f2826;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.field-report-meta,
.field-report-empty {
  color: #6d4c45;
  font-size: 0.8rem;
  line-height: 1.35;
}

.field-report-meta {
  margin: 8px 0 0;
}

.field-report-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.field-report-actions button {
  padding: 6px 9px;
  font-size: 0.76rem;
}

.field-report-actions .user-danger {
  background: #fbeaea;
  color: #a12626;
  border-color: rgba(161, 38, 38, 0.3);
}

.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 2050;
  display: grid;
  place-items: center;
  padding: 20px 16px;
  background: rgba(42, 15, 22, 0.62);
}

.confirm-dialog[hidden] {
  display: none !important;
}

.confirm-card {
  width: min(100%, 460px);
  display: grid;
  gap: 14px;
  border: 1px solid rgba(107, 31, 42, 0.22);
  border-radius: 18px;
  padding: 18px;
  background: #fffdfc;
  box-shadow: 0 28px 70px rgba(42, 15, 22, 0.35);
}

.confirm-header {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
}

.confirm-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(42, 15, 22, 0.18);
}

.confirm-kicker {
  display: block;
  margin-bottom: 2px;
  color: #7a5242;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.confirm-card h2 {
  margin: 0;
  color: #4a1520;
  font-size: 1.35rem;
}

.confirm-copy {
  margin: 0;
  color: #4b3835;
  line-height: 1.48;
  white-space: pre-wrap;
}

.admin-action-field {
  display: grid;
  gap: 6px;
  color: #5a1e28;
  font-size: 0.84rem;
  font-weight: 800;
}

.admin-action-field input {
  width: 100%;
  min-width: 0;
  font-weight: 600;
}

.issue-report-card {
  width: min(100%, 560px);
}

.issue-report-fields {
  display: grid;
  gap: 10px;
}

.issue-report-fields label {
  display: grid;
  gap: 5px;
  color: #5a1e28;
  font-size: 0.84rem;
  font-weight: 800;
}

.issue-report-fields input,
.issue-report-fields select,
.issue-report-fields textarea {
  width: 100%;
  min-width: 0;
  font-weight: 600;
}

.issue-report-fields textarea {
  resize: vertical;
  min-height: 112px;
  line-height: 1.42;
}

.admin-action-error {
  min-height: 1.2em;
  margin: -2px 0 0;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 800;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.confirm-actions button {
  min-width: 124px;
}

.confirm-secondary {
  background: #fdf3ef;
  color: #6b1f2a;
  border: 1px solid rgba(107, 31, 42, 0.2);
  box-shadow: 0 2px 0 rgba(107, 31, 42, 0.25);
}

.confirm-secondary:hover {
  background: #f9e8e3;
}

.confirm-actions button.confirm-danger {
  background: #a52e28;
  box-shadow: 0 3px 0 #7c1d1a, inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.confirm-actions button.confirm-danger:hover {
  background: #bd3931;
}

.terms-dialog {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 20px 16px;
  background: rgba(42, 15, 22, 0.62);
}

.terms-dialog[hidden] {
  display: none !important;
}

.terms-card {
  width: min(100%, 760px);
  max-height: min(760px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid rgba(107, 31, 42, 0.22);
  border-radius: 18px;
  padding: 18px;
  background: #fffdfc;
  box-shadow: 0 28px 70px rgba(42, 15, 22, 0.35);
}

.terms-card h2 {
  margin: 0;
  color: #4a1520;
  font-size: 1.35rem;
}

.terms-content {
  overflow: auto;
  padding-right: 6px;
  color: #3a2b2b;
  line-height: 1.5;
}

.terms-content h3 {
  margin: 18px 0 5px;
  color: #5a1e28;
  font-size: 1rem;
}

.terms-content h3:first-child { margin-top: 0; }

.terms-content p { margin: 0 0 10px; }

.terms-content ul {
  margin: 0 0 10px 20px;
  padding: 0;
}

.terms-content li { margin-bottom: 5px; }

.terms-card button {
  justify-self: end;
  min-width: 120px;
}

@media (max-width: 480px) {
  .name-gate-overlay {
    align-items: start;
    padding: 18px 12px;
  }
  .name-gate-card {
    padding: 18px 14px;
    border-radius: 16px;
  }
  .name-gate-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
}
/* ── Coding Block (ICD-10 + CPT) ─────────────────────────── */
.coding-section {
  margin-top: 10px;
  border: 1px solid rgba(107, 31, 42, 0.18);
  border-radius: 10px;
  overflow: hidden;
}

.coding-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #fdf9f7;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}

.coding-toggle::-webkit-details-marker { display: none; }

.coding-toggle::after {
  content: "▸";
  color: #7a4048;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: transform 180ms ease;
}

.coding-section[open] > .coding-toggle::after {
  transform: rotate(90deg);
}

.coding-toggle:hover {
  background: #f9f0ed;
}

.coding-toggle-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #5a1e28;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.coding-toggle-meta {
  font-size: 0.75rem;
  color: #7a5242;
  font-weight: 600;
  text-align: right;
  line-height: 1.3;
}

.code-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.code-type-header {
  padding: 5px 10px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #7a4048;
  background: #f5ede8;
  border-top: 1px solid rgba(107, 31, 42, 0.1);
}

.code-row td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(107, 31, 42, 0.07);
  vertical-align: top;
}

.code-row:last-child td {
  border-bottom: none;
}

.code-row td:first-child {
  width: 110px;
  white-space: nowrap;
  vertical-align: middle;
}

.code-chip {
  display: inline-block;
  border-radius: 5px;
  padding: 2px 7px;
  font-weight: 800;
  font-family: monospace;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chip-icd10 {
  background: #6b1f2a;
  color: #fff;
}

.chip-cpt {
  background: #1a4a6b;
  color: #fff;
}

.code-desc {
  color: #3a2b2b;
  line-height: 1.45;
}

.code-note {
  color: #7a5242;
  font-style: italic;
  font-size: 0.76rem;
}

@media (max-width: 480px) {
  .coding-toggle { padding: 7px 10px; flex-wrap: wrap; }
  .code-chip { font-size: 0.75rem; }
  .code-row td:first-child { width: 90px; }
  .code-type-header { padding: 4px 8px; }
}
/* ── PUSH Score Block ──────────────────────────────────────── */
.push-block {
  margin: 10px 0;
  border: 1px solid rgba(107, 31, 42, 0.18);
  border-radius: 10px;
  overflow: hidden;
  background: #fdf9f7;
}

.push-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f5ede8;
  border-bottom: 1px solid rgba(107, 31, 42, 0.12);
}

.push-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #7a4048;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.push-total-row {
  font-size: 0.95rem;
}

.push-total {
  font-size: 1.3rem;
  font-weight: 900;
  color: #4a1520;
}

.push-total.push-partial {
  color: #9ea3a7;
}

.push-max {
  color: #7a5242;
  font-size: 0.78rem;
  font-weight: 600;
}

.push-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.push-row td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(107, 31, 42, 0.07);
  vertical-align: middle;
}

.push-row:last-child td { border-bottom: none; }

.push-label {
  font-weight: 700;
  color: #5a1e28;
  width: 130px;
}

.push-detail {
  color: #4a3a3a;
  font-size: 0.8rem;
}

.push-score-cell {
  text-align: right;
  width: 110px;
}

.push-chip {
  display: inline-block;
  background: #6b1f2a;
  color: #fff;
  border-radius: 5px;
  padding: 2px 7px;
  font-weight: 800;
  font-size: 0.8rem;
  font-family: monospace;
  margin-bottom: 3px;
}

.push-bar-bg {
  height: 4px;
  background: rgba(107, 31, 42, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.push-bar-fill {
  height: 100%;
  background: #6b1f2a;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.push-interpretation {
  margin: 0;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4a1520;
  border-top: 1px solid rgba(107, 31, 42, 0.1);
}

.push-note {
  margin: 0;
  padding: 5px 12px 7px;
  font-size: 0.72rem;
  color: #9ea3a7;
  font-style: italic;
}

/* ── Copy Narrative Button ─────────────────────────────────── */
.narrative-patient-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.copy-narrative-btn {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 6px;
  background: #6b1f2a;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 0 #4a1520;
  transition: background 80ms;
}

.copy-narrative-btn:hover { background: #4a1520; }
.copy-narrative-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 #4a1520; }
.copy-narrative-btn:disabled { opacity: 0.7; cursor: default; transform: none; }

@media (max-width: 480px) {
  .push-label { width: 100px; }
  .push-score-cell { width: 80px; }
  .copy-narrative-btn { font-size: 0.72rem; padding: 3px 9px; }
}

/* ── CMS Coverage Guide ─────────────────────────────────────────────────── */

.cms-guide-panel { margin: 0 0 12px; }
.cms-guide-panel .cms-guide-section:first-child { margin-top: 0; }

/* Wound Scores & Classifications */
.scores-section {
  margin-top: 14px;
  border: 1.5px solid #c4b5d0;
  border-radius: 10px;
  overflow: hidden;
  background: #faf8fc;
}
.scores-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  background: #ece4f3;
  list-style: none;
  user-select: none;
}
.scores-toggle::-webkit-details-marker { display: none; }
.scores-label { font-weight: 700; font-size: 0.92rem; color: #3d2a52; flex-shrink: 0; }
.scores-meta { font-size: 0.78rem; color: #6a5a7c; flex: 1; }
.scores-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 12px; }

.ws-block {
  border: 1px solid #e2d8ec;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}
.ws-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ws-name { font-weight: 700; font-size: 0.88rem; color: #2a1c38; }
.ws-score { font-weight: 800; font-size: 0.9rem; color: #6b1f2a; }
.ws-interp { margin: 6px 0 0; font-size: 0.82rem; color: var(--ink); line-height: 1.5; }
.ws-note { margin: 7px 0 0; font-size: 0.8rem; color: #6b1f2a; font-weight: 600; line-height: 1.45; }

.ws-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.ws-table td { padding: 3px 4px; font-size: 0.82rem; vertical-align: top; }
.ws-item { color: var(--ink); }
.ws-val { text-align: right; color: var(--ink-soft); white-space: nowrap; }
.ws-met .ws-item { color: #2a5a30; font-weight: 600; }
.ws-unmet .ws-item { color: var(--ink-soft); }
.ws-sub .ws-item { font-weight: 700; color: #3d2a52; padding-top: 8px; }
.ws-sub .ws-val { font-weight: 700; color: #3d2a52; padding-top: 8px; }
.ws-disclaimer {
  font-size: 0.74rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0;
  line-height: 1.5;
}

.cms-guide-section {
  margin-top: 14px;
  border: 1.5px solid #b5c4d0;
  border-radius: 10px;
  overflow: hidden;
  background: #f7fafb;
}

.cms-guide-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  background: #e4eff5;
  list-style: none;
  user-select: none;
}
.cms-guide-toggle::-webkit-details-marker { display: none; }

.cms-guide-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: #1b3a4b;
  flex-shrink: 0;
}

.cms-guide-meta {
  font-size: 0.78rem;
  color: #4a6878;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cms-guide-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cms-section-head {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b1f2a;
  border-bottom: 1.5px solid #d0dde5;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

/* Chart table */
.cms-chart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.cms-row {
  border-bottom: 1px solid #e4edf2;
}
.cms-row:last-child { border-bottom: none; }

.cms-row td {
  padding: 6px 8px;
  vertical-align: top;
  line-height: 1.4;
}

.cms-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  vertical-align: middle;
}

.cms-req  { background: #fde8e8; color: #7a1f1f; }
.cms-opt  { background: #e8f4fd; color: #1a4a6e; }

.cms-item {
  font-weight: 600;
  color: #1b3a4b;
}

.cms-detail {
  color: #44637a;
  font-size: 0.8rem;
}

.cms-onfile {
  margin-top: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #2a5a30;
}
.cms-row-done .cms-item { background: #f1f8f0; }

/* Dressing blocks */
.cms-block {
  border: 1px solid #d0dde5;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  background: #fff;
}
.cms-block:last-child { margin-bottom: 0; }

.cms-block-name {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #eef4f8;
  font-weight: 700;
  font-size: 0.86rem;
  color: #1b3a4b;
}

.cms-hcpcs {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b1f2a;
  background: #fde8e8;
  padding: 1px 6px;
  border-radius: 4px;
}

.cms-block-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.cms-block-table tr td {
  padding: 5px 12px;
  border-top: 1px solid #e8eef3;
  vertical-align: top;
  line-height: 1.4;
  color: #2c4d5e;
}

/* label cell */
.cms-bl {
  font-weight: 600;
  color: #1b3a4b;
  width: 110px;
  white-space: nowrap;
}

/* Advanced therapy block */
.cms-block-advanced {
  border: 1px solid #c9d8c0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  background: #fff;
}
.cms-block-advanced:last-child { margin-bottom: 0; }

.cms-block-advanced .cms-block-name {
  background: #eef4ea;
  color: #1e3a1a;
}

.cms-list {
  margin: 0;
  padding: 6px 12px 8px 28px;
  font-size: 0.8rem;
  color: #2c4d5e;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .cms-guide-meta { display: none; }
  .cms-bl td:first-child { width: 90px; font-size: 0.77rem; }
}

/* ── Wound Photo Analyzer ───────────────────────────────────────────────── */

/* Header action group on wound card */
.manual-wound-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.az-analyze-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1.5px solid var(--accent);
  background: #fdf3ef;
  color: var(--accent);
  cursor: pointer;
  transition: background 90ms ease, color 90ms ease;
  white-space: nowrap;
  box-shadow: none;
}
.az-analyze-btn:hover { background: var(--accent); color: #fff; }
.az-analyze-btn:active { transform: translateY(1px); }

/* Retained-photo thumbnail on the wound card */
.az-thumb-slot:empty { display: none; }
.az-thumb-slot {
  display: inline-flex;
  cursor: pointer;
}
.az-thumb {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.5px solid var(--accent);
  display: block;
  transition: transform 90ms ease;
}
.az-thumb:hover { transform: scale(1.06); }

/* Modal overlay */
.wound-analyzer-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: safe center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(42, 15, 22, 0.55);
  backdrop-filter: blur(7px);
}
.wound-analyzer-overlay[hidden] { display: none !important; }

.wound-analyzer-card {
  width: min(100%, 760px);
  max-height: calc(100dvh - 32px);
  background: linear-gradient(180deg, #fffdfc, var(--paper-soft));
  border-radius: 18px;
  border: 1px solid rgba(107, 31, 42, 0.2);
  box-shadow: 0 28px 70px rgba(42, 15, 22, 0.34);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Scrollable middle — header, step dots, and nav stay pinned */
.az-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Header */
.az-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}

.az-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
}

.az-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  box-shadow: none;
}
.az-close:hover { color: #fff; background: rgba(255, 255, 255, 0.18); }

/* Step indicator */
.az-steps {
  display: flex;
  gap: 0;
  background: #fdf3ef;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.az-step-dot {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #b08a7e;
  border-right: 1px solid var(--line);
  transition: background 120ms, color 120ms;
}
.az-step-dot:last-child { border-right: none; }
.az-step-dot.az-step-done   { color: #2a5a30; background: #eef6ea; }
.az-step-dot.az-step-active { color: var(--accent); background: #f9e8e3; font-weight: 800; }
.az-step-dot.az-step-clickable { cursor: pointer; }
.az-step-dot.az-step-clickable:hover { background: #f3e0da; color: var(--accent); }
.az-step-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Section content areas */
.az-section {
  padding: 16px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.az-instruction {
  font-size: 0.88rem;
  color: var(--ink);
  margin: 0;
  line-height: 1.5;
}

.az-hint {
  font-size: 0.84rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0;
  background: #f9e8e3;
  border-radius: 6px;
  padding: 7px 12px;
}

.az-tip {
  font-size: 0.76rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0;
}

/* Photo input */
.az-photo-label { cursor: pointer; }
.az-photo-label input[type="file"] { display: none; }

.az-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 90ms;
  box-shadow: 0 3px 0 var(--accent-deep);
}
.az-photo-btn:hover { background: #8b2535; }

/* Canvas */
.az-canvas-wrap {
  padding: 0 18px;
  display: flex;
  justify-content: center;
  position: relative; /* needed for loupe absolute positioning */
}
.az-canvas-wrap[hidden] { display: none !important; }

.az-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  cursor: crosshair;
  display: block;
  touch-action: none;
}

/* Calibration row */
.az-calib-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.az-cm-input {
  flex: 1;
  min-width: 120px;
  padding: 7px 10px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 0.86rem;
  color: var(--ink);
}
.az-cm-input:focus { outline: none; border-color: var(--accent); }

.az-small-btn {
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1.5px solid var(--line);
  background: #fdf3ef;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}
.az-small-btn:hover { background: #f9e8e3; }
.az-small-btn.az-btn-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Loupe magnifier */
.az-loupe {
  position: fixed;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.45), 0 0 0 2px rgba(0,229,255,0.3);
}

.az-skip-btn {
  font-size: 0.78rem;
  padding: 5px 0;
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: underline;
  text-align: left;
  box-shadow: none;
}
.az-skip-btn:hover { color: var(--accent); }

/* Results */
.az-results { padding: 0 0 4px; }

.az-results-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.az-result-size {
  font-size: 0.92rem;
  color: var(--ink);
  padding: 10px 14px;
  background: #fdf3ef;
  border-radius: 8px;
  line-height: 1.5;
}
.az-result-size a { color: var(--accent); }

.az-result-row {
  display: grid;
  grid-template-columns: 14px 140px 44px 1fr;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
}

.az-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.az-rlabel {
  font-size: 0.84rem;
  color: var(--ink);
  font-weight: 600;
}

.az-rval {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}

.az-rbar {
  background: #efe2db;
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}

.az-rbar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 400ms ease;
}

.az-disclaimer {
  font-size: 0.74rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 10px 0 0;
  padding: 8px 10px;
  background: #fdf3ef;
  border-radius: 6px;
  line-height: 1.5;
}

/* Nav bar */
.az-nav {
  display: flex;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--paper-soft);
  flex-shrink: 0;
}

.az-btn-secondary, .az-btn-primary, .az-btn-apply {
  padding: 9px 20px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 90ms;
}

.az-btn-secondary {
  background: #efe2db;
  color: var(--accent);
  box-shadow: none;
}
.az-btn-secondary:hover { background: #e6d3cb; }
.az-btn-secondary[hidden] { display: none !important; }

.az-btn-primary {
  background: var(--accent);
  color: #fff;
  margin-left: auto;
  box-shadow: 0 3px 0 var(--accent-deep);
}
.az-btn-primary:hover:not(:disabled) { background: #8b2535; }
.az-btn-primary:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.az-btn-primary[hidden] { display: none !important; }

.az-btn-apply {
  background: #2a5a30;
  color: #fff;
  margin-left: auto;
  box-shadow: 0 3px 0 #1c3d20;
}
.az-btn-apply:hover { background: #357039; }
.az-btn-apply[hidden] { display: none !important; }

@media (max-width: 500px) {
  .az-result-row { grid-template-columns: 14px 1fr 40px; }
  .az-rbar { display: none; }
  .az-step-dot { font-size: 0.72rem; padding: 11px 2px; min-height: 44px; display: flex; align-items: center; justify-content: center; }

  /* Larger, easier-to-tap bottom buttons on phones */
  .az-nav { padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .az-btn-secondary, .az-btn-primary, .az-btn-apply {
    padding: 14px 16px;
    font-size: 0.95rem;
    min-height: 48px;
    border-radius: 11px;
  }
}


/* ── Referral Triggers Block ─────────────────────────────────────────────── */
.ref-section {
  margin-top: 10px;
  border: 1.5px solid #e0c87a;
  border-radius: 10px;
  overflow: hidden;
  background: #fdfbf2;
}
.ref-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  background: #f5edcc;
  list-style: none;
  user-select: none;
}
.ref-toggle::-webkit-details-marker { display: none; }
.ref-toggle::after {
  content: "›";
  margin-left: auto;
  font-size: 1.1rem;
  color: #7a5c00;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.ref-section[open] > .ref-toggle::after { transform: rotate(90deg); }
.ref-label { font-weight: 700; font-size: 0.92rem; color: #4a3800; flex-shrink: 0; }
.ref-meta { font-size: 0.78rem; color: #7a5c00; flex: 1; }
.ref-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.ref-trigger {
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.ref-trigger-urgent { border: 1.5px solid #d4735a; }
.ref-trigger-routine { border: 1px solid #d4bb6a; }
.ref-trigger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.ref-specialty { font-weight: 700; font-size: 0.87rem; color: #2a1c10; }
.ref-urgency-badge {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ref-urgent { background: #f8e4df; color: #8a2a10; }
.ref-routine { background: #fdf5da; color: #7a5c00; }
.ref-reason { font-size: 0.84rem; color: var(--ink); line-height: 1.5; margin: 0 0 4px; }
.ref-detail { font-size: 0.80rem; color: var(--ink-soft); line-height: 1.45; margin: 0; }
.ref-disclaimer { font-size: 0.74rem; color: var(--ink-soft); font-style: italic; margin: 0; line-height: 1.5; }

/* ── Wayfinder Palette Refresh ─────────────────────────────────────────── */
.download-link:hover {
  background: #e3f0f7;
}

.download-link:active {
  box-shadow: 0 0 0 rgba(15, 109, 152, 0.18);
}

th,
.qa-title,
.qa-label,
.qa-value,
.qa-drawer summary::before,
.qa-drawer summary::after,
.why-drawer summary,
.manual-remove-btn,
.manual-check-section h4,
.manual-check-grid label,
.manual-prior summary,
.hipaa-field,
.hipaa-checkbox,
.audit-log-meta,
.print-patient-name,
.print-wound h4,
.phrase-field label,
.name-gate-field,
.name-gate-check,
.auth-links a,
.user-admin h3,
.user-actions button,
.field-reports h3,
.field-report-actor,
.confirm-kicker,
.admin-action-field,
.issue-report-fields label,
.confirm-secondary,
.terms-content h3,
.coding-toggle-label,
.push-label,
.push-total,
.push-interpretation,
.code-type-header,
.ws-score,
.ws-note,
.cms-section-head,
.cms-hcpcs {
  color: var(--accent-deep);
}

.confidence-line {
  color: #0a3e5a;
  background: #e8f2f7;
  border-color: #c8dde8;
}

.qa-box,
.manual-wound-card,
.settings-item,
.settings-build-info,
.settings-account-info,
.audit-summary-card,
.user-admin,
.field-report-card,
.field-report-empty,
.print-patient,
.phrase-field,
.supply-group,
.coding-section,
.push-block {
  background: linear-gradient(180deg, #ffffff, #f5f9fb);
  border-color: rgba(15, 109, 152, 0.14);
}

.why-drawer,
.manual-check-section,
.manual-empty {
  background: #f8fbfd;
  border-color: #cfe0e8;
}

.manual-remove-btn,
.manual-secondary-btn,
.user-actions button,
.confirm-secondary {
  background: #eef6fa;
  color: var(--accent-deep);
  border-color: rgba(15, 109, 152, 0.18);
  box-shadow: 0 2px 0 rgba(15, 109, 152, 0.16);
}

.manual-remove-btn:hover,
.manual-secondary-btn:hover,
.user-actions button:hover,
.confirm-secondary:hover {
  background: #e1edf4;
}

.manual-prior,
.code-type-header,
.push-header,
.push-interpretation,
.cms-guide-toggle,
.cms-block-name,
.scores-toggle,
.coding-toggle,
.az-steps {
  border-color: rgba(15, 109, 152, 0.1);
}

.manual-details-hint,
.build-info-line,
.audit-summary-card .label,
.field-report-type,
.confirm-kicker,
.coding-toggle-meta,
.code-note,
.push-title,
.push-max,
.name-gate-kicker,
.auth-sep {
  color: #64808d;
}

.name-gate-overlay,
.confirm-dialog,
.terms-dialog,
.wound-analyzer-overlay {
  background: rgba(6, 24, 37, 0.58);
}

.name-gate-card,
.confirm-card,
.terms-card,
.wound-analyzer-card {
  border-color: rgba(15, 109, 152, 0.16);
  background: linear-gradient(180deg, #ffffff, #f3f8fb);
  box-shadow: 0 24px 64px rgba(8, 29, 43, 0.22);
}

.name-gate-card h2,
.confirm-card h2,
.terms-card h2,
.field-reports h3,
.user-admin h3 {
  color: var(--accent-deep);
}

.name-gate-terms a,
.auth-links a {
  color: var(--accent);
}

.field-report-read {
  border-left-color: #c9d8e0;
}

.field-report-state {
  background: #edf4f8;
  color: #56707d;
}

.field-report-message,
.code-desc,
.confirm-copy,
.terms-content,
.push-detail {
  color: #283843;
}

.code-row td,
.push-row td {
  border-bottom-color: rgba(15, 109, 152, 0.07);
}

.chip-icd10,
.push-chip,
.copy-narrative-btn {
  background: var(--accent);
  box-shadow: 0 2px 0 var(--accent-deep);
}

.copy-narrative-btn:hover {
  background: #1381ad;
}

.copy-narrative-btn:active {
  box-shadow: 0 1px 0 var(--accent-deep);
}

.push-bar-bg {
  background: rgba(15, 109, 152, 0.12);
}

.push-bar-fill {
  background: var(--accent);
}

.scores-section {
  border-color: #c7d6e6;
  background: #f7fafd;
}

.scores-toggle {
  background: #e9f0f7;
}

.scores-label,
.ws-sub .ws-item,
.ws-sub .ws-val {
  color: #284659;
}

.cms-guide-section,
.cms-block,
.coding-section {
  border-color: #cddbe4;
  background: #f8fbfd;
}

.cms-guide-label,
.cms-item,
.cms-block-name,
.cms-bl {
  color: #24485c;
}

.cms-hcpcs {
  background: #e8f2f7;
}

.cms-req {
  background: #fde8e8;
  color: #8a2a10;
}

.cms-opt {
  background: #e6f4fc;
  color: #17547a;
}

.az-analyze-btn,
.az-small-btn,
.az-result-size,
.az-hint,
.az-btn-secondary,
.az-rbar {
  background: #edf6fa;
}

.az-analyze-btn,
.az-small-btn,
.az-result-size a,
.az-rval,
.az-skip-btn:hover,
.az-step-dot.az-step-active,
.az-step-dot.az-step-clickable:hover {
  color: var(--accent-deep);
}

.az-analyze-btn:hover,
.az-small-btn:hover,
.az-step-dot.az-step-active,
.az-step-dot.az-step-clickable:hover {
  background: #ddebf3;
}

.az-photo-btn:hover,
.az-btn-primary:hover:not(:disabled) {
  background: #1381ad;
}

.az-btn-secondary:hover {
  background: #ddebf3;
}

.az-rbar-fill {
  background: linear-gradient(90deg, #0f6d98, #58cfc6);
}
.manual-secondary-btn,
.download-link,
.field-report-actions button,
.field-reports-toolbar button,
.settings-item-actions button {
  background: #eef6fa;
  color: var(--accent-deep);
  border-color: rgba(15, 109, 152, 0.18);
  box-shadow: 0 2px 0 rgba(15, 109, 152, 0.16);
}

.manual-secondary-btn:hover,
.download-link:hover,
.field-report-actions button:hover,
.field-reports-toolbar button:hover,
.settings-item-actions button:hover {
  background: #e3f0f7;
}

.manual-secondary-btn:active,
.download-link:active,
.field-report-actions button:active,
.field-reports-toolbar button:active,
.settings-item-actions button:active {
  box-shadow: 0 1px 0 rgba(15, 109, 152, 0.16);
}

.settings-item,
.audit-summary-card,
.field-report-card,
.field-report-empty {
  border-color: rgba(15, 109, 152, 0.14);
  background: linear-gradient(180deg, #ffffff, #f6fafc);
}

.audit-summary-card .label,
.field-report-type,
.field-report-meta,
.field-report-empty,
.name-gate-kicker {
  color: #5b7381;
}

.audit-summary-card .value,
.field-report-card h4,
.field-report-state,
.confirm-card h2,
.issue-report-card h2,
.terms-card h2,
.name-gate-card h2,
.ws-score,
.ws-note {
  color: var(--accent-deep);
}

.name-gate-overlay,
.confirm-dialog,
.issue-report-dialog,
.terms-dialog {
  background: rgba(5, 21, 33, 0.56);
}

.name-gate-card,
.confirm-card,
.issue-report-card,
.terms-card {
  border-color: rgba(15, 109, 152, 0.18);
  background: linear-gradient(180deg, #ffffff, #f3f8fb);
  box-shadow: 0 24px 64px rgba(8, 30, 42, 0.22);
}

.name-gate-field input,
.issue-report-fields input,
.issue-report-fields select,
.issue-report-fields textarea {
  border-color: rgba(15, 109, 152, 0.18);
  background: #fbfdfe;
}

.copy-narrative-btn,
.az-photo-btn,
.az-btn-primary {
  background: var(--accent);
  box-shadow: 0 3px 0 var(--accent-deep);
}

.copy-narrative-btn:hover,
.az-photo-btn:hover,
.az-btn-primary:hover:not(:disabled) {
  background: #1381ad;
}

.copy-narrative-btn:active,
.az-btn-primary:active {
  box-shadow: 0 1px 0 var(--accent-deep);
}

.az-btn-secondary {
  background: #e8f1f6;
  color: var(--accent-deep);
}

.az-btn-secondary:hover {
  background: #dcebf3;
}

.az-disclaimer {
  background: #edf6fa;
}
