:root {
  --color-bg: #f7f3ea;
  --color-surface: #fbfaf5;
  --color-surface-2: #f0ead9;
  --color-text: #2b2a1e;
  --color-text-muted: #6b6858;
  --color-text-faint: #9a9682;
  --color-primary: #556b2f;
  --color-primary-soft: #7c8f5a;
  --color-accent: #8c6a3b;
  --color-border: #e6dfc9;
  --color-divider: #ece5cf;
  --color-danger: #a4402e;
  --color-success-tint: #dfe6ce;

  --font-display: 'Fraunces', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(43, 42, 30, 0.05);
  --shadow-md: 0 4px 14px rgba(43, 42, 30, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a15;
    --color-surface: #232219;
    --color-surface-2: #2b2a20;
    --color-text: #e8e4d0;
    --color-text-muted: #a8a48f;
    --color-text-faint: #6f6b58;
    --color-primary: #a8bd7c;
    --color-primary-soft: #7f9557;
    --color-accent: #c99a5c;
    --color-border: #3a3828;
    --color-divider: #322f21;
    --color-success-tint: #2a3418;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* HEADER */
.app-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(8px);
}

.app-header__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
}

.brand__logo { width: 40px; height: 40px; object-fit: contain; }
.brand__logo--wide { width: auto; height: 44px; }

.brand__wordmark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand__wordmark small {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--color-text-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 4px;
}

.header__meta {
  display: flex; align-items: center; gap: 14px;
}

.app-tabs {
  display: flex;
  gap: 4px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px;
}
.tab {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: 0;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab:hover { color: var(--color-text); }
.tab.is-active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 640px) {
  .app-tabs { order: 3; width: 100%; justify-content: center; }
  .app-header__inner { flex-wrap: wrap; }
}
.badge {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--color-primary) 15%, transparent);
  color: var(--color-primary);
}
.header__hint {
  font-size: 12px;
  color: var(--color-text-faint);
}
@media (max-width: 640px) {
  .header__hint { display: none; }
}

/* LAYOUT */
.workspace {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 22px 80px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* The [hidden] attribute must beat display:flex on main.workspace */
.workspace[hidden] { display: none !important; }

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.panel__head {
  margin-bottom: 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel__head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.015em;
}

.panel__hint {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* FIELDS */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.field__label {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-text-muted);
}

.field input,
.field select,
.field textarea,
.vt-row input {
  font-family: inherit;
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.field textarea { resize: vertical; min-height: 76px; }

.field input:focus,
.field select:focus,
.field textarea:focus,
.vt-row input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 22%, transparent);
}

/* VELOCITY TABLE */
.velocity-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg);
}

.vt-head, .vt-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}

.vt-head {
  background: var(--color-surface-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.vt-head .vt-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.vt-head .vt-num small {
  font-weight: 500;
  color: var(--color-text-faint);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  margin-top: 2px;
}

.vt-side-label {
  padding: 10px 16px 4px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--color-primary);
  background: color-mix(in oklab, var(--color-primary) 6%, transparent);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.vt-side-label:first-of-type { border-top: 0; }

.vt-row {
  border-bottom: 1px solid var(--color-divider);
}
.vt-row:last-child { border-bottom: 0; }

.vt-label {
  font-weight: 500;
}
.vt-abbr {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  text-transform: uppercase;
  margin-top: 2px;
}

.vt-row input {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 8px 10px;
}

/* Hide number spinners */
.vt-row input::-webkit-outer-spin-button,
.vt-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.vt-row input[type=number] { -moz-appearance: textfield; }

.vt-ratio {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  color: var(--color-text);
  padding: 8px 10px;
  border-radius: var(--radius);
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.vt-ratio--na {
  color: var(--color-text-faint);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.vt-ratio.is-calculated {
  background: color-mix(in oklab, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  animation: pop 0.25s ease;
}

.vt-ratio.is-elevated {
  background: color-mix(in oklab, var(--color-accent) 18%, transparent);
  color: var(--color-accent);
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@media (max-width: 640px) {
  .vt-head, .vt-row {
    grid-template-columns: 1.1fr 0.9fr 0.9fr 0.7fr;
    gap: 8px;
    padding: 10px 12px;
    font-size: 13px;
  }
  .vt-row input { padding: 7px 6px; font-size: 14px; }
  .vt-ratio { font-size: 14px; padding: 6px 4px; }
  .vt-head .vt-num small { display: none; }
}

/* VERTEBRAL ROW */
.vertebral-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* STENOSIS */
.stenosis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 640px) {
  .stenosis-grid { grid-template-columns: 1fr; }
}

.stenosis-side h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  margin: 0 0 10px;
  color: var(--color-text);
}

.suggestion {
  background: var(--color-surface-2);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.suggestion__label {
  color: var(--color-text-faint);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.suggestion__value {
  color: var(--color-primary);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 13px;
}

.suggestion.is-active {
  background: color-mix(in oklab, var(--color-primary) 10%, transparent);
  border-style: solid;
  border-color: color-mix(in oklab, var(--color-primary) 30%, transparent);
}

/* ACTIONS & BUTTONS */
.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn--primary {
  background: var(--color-primary);
  color: #fbfaf5;
}
.btn--primary:hover {
  background: color-mix(in oklab, var(--color-primary) 88%, black);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn--ghost:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

/* PREVIEW */
.preview-body {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  padding: 18px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  margin: 0;
}

/* INVOICE */
.invoice-counts {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .invoice-counts { grid-template-columns: 1fr; }
}

.count-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.count-card__label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}
.count-card__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.count-card__row input {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  padding: 10px 8px;
}
.count-card__row input::-webkit-outer-spin-button,
.count-card__row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.count-card__row input[type=number] { -moz-appearance: textfield; }

.count-btn {
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.count-btn:hover { background: color-mix(in oklab, var(--color-primary) 10%, var(--color-surface)); }
.count-btn:active { transform: scale(0.94); }

.count-card__meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}
.count-card__meta span { color: var(--color-text); font-weight: 500; }

.invoice-total {
  margin-top: 22px;
  padding: 18px 22px;
  background: color-mix(in oklab, var(--color-primary) 10%, var(--color-surface));
  border: 1px solid color-mix(in oklab, var(--color-primary) 25%, var(--color-border));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.invoice-total__label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text);
}
.invoice-total__value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

/* INVOICE DOCUMENT (matches the Word template) */
.invoice-doc {
  background: #fff;
  color: #1a1a1a;
  padding: 60px 60px 50px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  max-width: 820px;
  margin: 0 auto;
  font-family: 'Aptos', Aptos, 'Segoe UI', Arial, sans-serif;
  font-size: 12pt;
  line-height: 1.55;
}
@media (prefers-color-scheme: dark) {
  .invoice-doc { background: #fbfaf5; }
}

.inv-payee {
  margin-bottom: 30px;
  font-size: 12pt;
  line-height: 1.55;
}
.inv-payee > div { margin-bottom: 2px; }

.inv-title {
  font-size: 13pt;
  font-weight: 700;
  margin: 24px 0 18px;
}

.inv-billto-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 40px;
  margin-bottom: 8px;
  font-size: 12pt;
}
.inv-billto-row strong { font-weight: 700; }

.inv-date-row {
  margin-bottom: 22px;
  font-size: 12pt;
}
.inv-date-row strong { font-weight: 700; margin-right: 14px; }

.inv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 22px;
  font-size: 11pt;
}
.inv-table th, .inv-table td {
  border: 1px solid #1a1a1a;
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}
.inv-table th {
  font-weight: 700;
  background: #fafafa;
}
.inv-table td.num, .inv-table th.num { text-align: left; }
.inv-table td.subtotal-label {
  text-decoration: underline;
  font-weight: 500;
}

.inv-total {
  font-size: 12pt;
  font-weight: 700;
  margin: 8px 0 30px;
}

.inv-payable {
  font-size: 12pt;
  margin-top: 30px;
}
.inv-payable u { text-decoration: underline; }

/* CAROTID REPORT DOCUMENT */
.carotid-doc {
  background: #fff;
  color: #1a1a1a;
  padding: 40px 44px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  max-width: 820px;
  margin: 0 auto;
  font-family: 'Times New Roman', Georgia, serif;
  font-size: 12pt;
  line-height: 1.4;
}
@media (prefers-color-scheme: dark) {
  .carotid-doc { background: #fbfaf5; }
}

.cd-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 12px;
  margin-bottom: 4px;
}
.cd-header__logo {
  flex-shrink: 0;
}
.cd-header__logo svg { display: block; }
.cd-header__brand {
  font-family: 'Times New Roman', Georgia, serif;
}
.cd-header__brand-main {
  font-size: 18pt;
  font-weight: 700;
  color: #1a4d8f;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.cd-header__brand-sub {
  font-size: 10pt;
  color: #3a6ea5;
  letter-spacing: 0.15em;
  margin-top: 3px;
  font-style: italic;
}

.cd-title {
  text-align: center;
  font-size: 16pt;
  font-weight: 700;
  text-decoration: underline;
  margin: 8px 0 4px;
  letter-spacing: 0.02em;
}
.cd-address {
  text-align: center;
  font-size: 11pt;
  margin-bottom: 18px;
}

.cd-patient {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px 20px;
  margin-bottom: 16px;
  font-size: 11pt;
}
.cd-patient__cell strong { font-weight: 700; }

.cd-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 10.5pt;
}
.cd-table th, .cd-table td {
  border: 1px solid #1a1a1a;
  padding: 5px 8px;
  text-align: center;
  vertical-align: middle;
}
.cd-table th {
  background: #f0f0f0;
  font-weight: 700;
}
.cd-table th small { display: block; font-weight: 400; font-size: 9pt; }
.cd-table td.cd-artery { text-align: left; font-weight: 500; }
.cd-table td.cd-artery small { display: block; color: #444; font-weight: 400; font-size: 9.5pt; }
.cd-table td.cd-na { color: #666; }

.cd-quality {
  font-size: 11pt;
  font-style: italic;
  margin: 14px 0 8px;
}

.cd-section-head {
  font-size: 12pt;
  font-weight: 700;
  text-decoration: underline;
  margin: 16px 0 6px;
}

.cd-side-head {
  font-size: 11pt;
  font-weight: 700;
  margin: 12px 0 4px;
  text-decoration: underline;
}

.cd-findings {
  font-size: 11pt;
  padding-left: 22px;
  margin: 6px 0 8px;
}
.cd-findings li { margin-bottom: 3px; line-height: 1.35; }

.cd-impression {
  font-size: 11pt;
  margin: 10px 0 4px 22px;
  font-weight: 500;
}

.cd-signature {
  margin-top: 36px;
  text-align: right;
  font-size: 11pt;
  font-weight: 500;
}

/* PRINT — tuned so the carotid report fits on ONE letter page */
@media print {
  body { background: #fff; }
  .app-header, .app-footer, .actions, .panel__head, .panel:not(#preview):not(#invoice-preview):not(#echo-preview) { display: none !important; }
  main[data-panel="invoice"] { padding: 0 !important; }
  main[data-panel="carotid"] { padding: 0 !important; }
  .panel { border: 0; box-shadow: none; padding: 0; background: transparent; }
  #invoice-preview, #preview { padding: 0 !important; }
  #invoice-preview [hidden], #preview [hidden] { display: block !important; }
  .invoice-doc { border: 0; padding: 24px 40px; max-width: 100%; }
  .carotid-doc { border: 0; padding: 0; max-width: 100%; font-size: 10.5pt; line-height: 1.25; }
  .cd-header--logo-only { padding: 0 !important; margin-bottom: 4px; }
  .cd-header__logo-img  { max-height: 46px !important; }
  .cd-title    { font-size: 13pt; margin: 2px 0 2px; }
  .cd-address  { font-size: 9.5pt; margin-bottom: 8px; }
  .cd-patient  { font-size: 9.5pt; gap: 3px 18px; margin-bottom: 8px; }
  .cd-table    { font-size: 9pt; margin-bottom: 8px; width: calc(100% - 1.5in); margin-left: 0.75in; margin-right: 0.75in; }
  .cd-table th, .cd-table td { padding: 2.5px 6px; }
  .cd-quality  { font-size: 9.5pt; margin: 6px 0 4px; }
  .cd-section-head { font-size: 10.5pt; margin: 8px 0 3px; }
  .cd-side-head    { font-size: 10pt; margin: 6px 0 2px; }
  .cd-findings     { font-size: 9.5pt; margin: 2px 0 4px; padding-left: 20px; }
  .cd-findings li  { margin-bottom: 1px; line-height: 1.25; }
  .cd-impression   { font-size: 9.5pt; margin: 4px 0 2px 20px; line-height: 1.3; }
  .cd-signature    { margin-top: 20px; font-size: 10pt; }
  /* Prevent orphan/widow splits inside these sections */
  .cd-side-block, .cd-impression-block { break-inside: avoid; page-break-inside: avoid; }
  @page { size: Letter; margin: 0.4in 0.75in; }
}

/* FOOTER */
.app-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 22px 32px;
  color: var(--color-text-faint);
  font-size: 12px;
  text-align: center;
}

/* ---------- Scan controls ---------- */
.scan-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.scan-controls .btn--primary {
  background: #14523f;
  color: #fff;
  border: 1px solid #0f3d2f;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.scan-controls .btn--primary:hover { background: #0f3d2f; }
.scan-controls .btn--primary:disabled { opacity: 0.6; cursor: wait; }
.scan-status {
  font-size: 13px;
  color: var(--color-text-faint);
  flex: 1;
  min-width: 200px;
}
.scan-status[data-tone="ok"]    { color: #14523f; font-weight: 500; }
.scan-status[data-tone="error"] { color: #b91c1c; font-weight: 500; }
.scan-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-text-faint);
}
.scan-hint strong { color: #b91c1c; }

/* Real HCNJ logo on the printed carotid report */
.cd-header--logo-only { display: flex; justify-content: center; padding: 4px 0 6px; }
.cd-header__logo-img  { max-height: 70px; width: auto; object-fit: contain; }

/* Table subheader row (Flow Direction band above vertebrals) */
.cd-table tr.cd-subhead td { background: #f0f0f0; }

/* Preview panel: keep header + print button on one row, wrap on mobile */
.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.preview-print-btn { flex-shrink: 0; }
@media print {
  .preview-head { display: none !important; }
}

/* Echo dimensions table: left-align labels, keep values/normals centered */
.echo-dim thead th:first-child { text-align: left; }
.echo-dim td.echo-dim__label   { text-align: left; font-weight: 500; }
.echo-dim td.echo-dim__value   { text-align: center; }
.echo-dim td.echo-dim__normal  { text-align: center; color: #444; }

/* Echo interpretation paragraphs — same rhythm as the carotid findings */
.echo-section {
  font-size: 11pt;
  margin: 4px 0 4px 4px;
  line-height: 1.35;
  font-family: 'Times New Roman', Georgia, serif;
}
.echo-section strong { font-weight: 700; text-decoration: underline; }

.echo-impression {
  margin: 4px 0 4px 22px;
  padding: 0;
  font-size: 11pt;
  font-family: 'Times New Roman', Georgia, serif;
}
.echo-impression li { margin-bottom: 3px; line-height: 1.35; }

/* When printing the echo, echo panel needs the same shrinks as the carotid one */
@media print {
  main[data-panel="echo"] { padding: 0 !important; }
  main[data-panel="echo"] .panel { border: 0; box-shadow: none; padding: 0; background: transparent; }
  #echo-preview .panel__head { display: none !important; }
  #echo-doc.carotid-doc { padding: 0; }

  .echo-section  { font-size: 9.5pt; margin: 3px 0 3px 4px; line-height: 1.28; }
  .echo-impression { font-size: 9.5pt; margin: 3px 0 2px 20px; }
  .echo-impression li { margin-bottom: 1px; line-height: 1.28; }

  /* Repeating print header (used only when the echo report spans multiple pages).
     The header sits inside <thead> of a single wrapping table so every browser
     re-renders it at the top of every printed page. */
  .echo-print-table { width: 100%; border-collapse: collapse; }
  .echo-print-table thead { display: table-header-group; }
  .echo-print-table tfoot { display: table-footer-group; }
  .echo-print-table td, .echo-print-table th { padding: 0; border: 0; }
  .echo-repeat-head { padding-bottom: 6px !important; }
  .echo-repeat-head .cd-header--logo-only { padding: 0 !important; margin-bottom: 2px; }
  .echo-repeat-head .cd-header__logo-img { max-height: 42px !important; }
  .echo-repeat-head .cd-title   { font-size: 12pt; margin: 2px 0 2px; }
  .echo-repeat-head .cd-address { font-size: 9pt; margin-bottom: 6px; }
  .echo-repeat-head .cd-patient { font-size: 9pt; gap: 3px 16px; margin-bottom: 4px; }
  /* Thin divider under the repeated header */
  .echo-repeat-head { border-bottom: 0.5pt solid #999; }
}

/* On-screen, hide the print-only repeating-header wrapper decoration but still
   show its inner content in normal document flow. */
@media screen {
  .echo-print-table, .echo-print-table tbody, .echo-print-table thead,
  .echo-print-table tr, .echo-print-table td { display: block; }
  .echo-print-table td { padding: 0; }
}
