.emb-lab { --emb-ink: #1e2442; --emb-muted: #656c82; --emb-border: #dddfe7; color: var(--emb-ink); max-width: 1400px; margin: 0 auto; padding-bottom: 2rem; font-size: .9rem; }
.emb-lab [hidden] { display: none !important; }
.emb-lab h1, .emb-lab h2, .emb-lab h3 { font-family: 'DM Sans', sans-serif; letter-spacing: -.02em; }
.emb-lab h1 { font-size: 1.8rem; margin: 0 0 .35rem; }
.emb-lab h2 { font-size: 1.3rem; margin: 0 0 .3rem; }
.emb-lab h3 { font-size: 1rem; margin: 0 0 1rem; }
.emb-lab p { line-height: 1.55; }
.emb-lab button, .emb-lab input, .emb-lab select, .emb-lab textarea { font: inherit; }
.emb-lab input, .emb-lab select, .emb-lab textarea { width: 100%; min-width: 0; border: 1px solid #a8adbf; border-radius: 8px; background: #fff; color: var(--emb-ink); padding: .65rem .7rem; min-height: 42px; caret-color: #b84a24; font-variant-numeric: tabular-nums; }
.emb-lab button { cursor: pointer; }
.emb-lab :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid #56619a; outline-offset: 3px; }
.emb-lab ::selection { background: #dbe2f8; color: #1e2442; }
.emb-demo { display: flex; gap: 1rem; padding: .65rem 1rem; background: #fff5de; color: #745019; border-radius: 8px; font-size: .8rem; }
.emb-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1.4rem 0; }
.emb-heading p { color: var(--emb-muted); margin: 0; }
.emb-heading p > span { padding: 0 .5rem; }
.emb-status { border-radius: 6px; padding: .45rem .75rem; background: #edeffc; color: #46517e; font-weight: 600; white-space: nowrap; }
.emb-designs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--emb-border); gap: .5rem; }
.emb-designs a { display: flex; align-items: center; gap: .7rem; padding: 1rem; color: var(--emb-muted); border-radius: 10px 10px 0 0; text-decoration: none; border-bottom: 2px solid transparent; }
@media (hover: hover) and (pointer: fine) {
  .emb-designs a:hover { background: #e8ebf3; color: var(--emb-ink); }
}
.emb-designs a[aria-current] { background: #fff; color: var(--emb-ink); border-bottom-color: #b84a24; }
.emb-designs strong, .emb-designs small { display: block; }
.emb-designs strong { font-size: .92rem; margin-bottom: .2rem; }
.emb-designs small { font-size: .75rem; }
.emb-design-number { font-size: 1.15rem; font-weight: 500; color: #56619a; }
.emb-utility { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .65rem 0; font-size: .75rem; color: var(--emb-muted); }
.emb-utility p { margin: 0; }
.emb-utility > div { display: flex; gap: .85rem; flex-shrink: 0; }
.emb-utility button, .emb-text-button { border: 0; background: transparent; padding: .6rem .1rem; color: #46517e; text-decoration: underline; text-underline-offset: 4px; }
.emb-error { padding: 1rem; color: #8d341d; background: #fdede6; border-radius: 8px; margin-bottom: 1rem; }
.emb-design-body { background: #fff; border-radius: 12px; border: 1px solid var(--emb-border); padding: 1.5rem; }
.emb-view-heading { margin-bottom: 1.5rem; }
.emb-view-heading p { color: var(--emb-muted); margin: 0; max-width: 75ch; }
.emb-sheet-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 2rem; }
.emb-sheet-index { align-self: start; position: sticky; top: 1rem; display: grid; gap: .2rem; font-size: .8rem; }
.emb-sheet-index a { display: flex; gap: .7rem; text-decoration: none; color: #46517e; padding: .65rem 0; }
@media (hover: hover) and (pointer: fine) {
  .emb-sheet-index a:hover { text-decoration: underline; }
}
.emb-sheet-index a span { color: var(--emb-muted); }
.emb-sheet-index p { margin-top: 1.2rem; color: var(--emb-muted); font-size: .75rem; }
.emb-section { padding-bottom: 2rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--emb-border); scroll-margin-top: 1rem; }
.emb-section:last-child { border: 0; margin: 0; padding: 0; }
.emb-section h3 { display: flex; gap: .75rem; align-items: center; margin-bottom: 1.2rem; }
.emb-step { color: #56619a; }
.emb-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0; }
.emb-field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; font-size: .8rem; font-weight: 500; }
.emb-field > span { min-height: 1.1rem; }
.emb-disclosure { border-top: 1px solid var(--emb-border); margin-top: 1.5rem; padding-top: .6rem; }
.emb-disclosure > summary, .emb-inline-edit > summary, .emb-comparison > summary { cursor: pointer; color: #46517e; font-weight: 600; padding: .65rem 0; }
.emb-hint { color: var(--emb-muted); font-size: .78rem; max-width: 70ch; }
.emb-table-scroll { overflow-x: auto; scrollbar-color: #a8adbf #f3f4f8; }
.emb-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.emb-table caption { text-align: left; padding: .5rem 0 1rem; color: var(--emb-muted); }
.emb-table th { font-weight: 600; text-align: left; background: #f3f4f8; }
.emb-table td, .emb-table th { padding: .65rem; border-bottom: 1px solid #e6e8ef; }
.emb-table .emb-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.emb-culture { min-width: 580px; }
.emb-culture input { min-width: 60px; }
.emb-unit-table { min-width: 940px; }
.emb-unit-table td:first-of-type { width: 80px; }
.emb-unit-table td:nth-of-type(2), .emb-unit-table td:nth-of-type(4) { width: 100px; }
.emb-actions { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem 0; }
.emb-actions > span { color: var(--emb-muted); font-size: .78rem; }
.emb-actions > div { display: flex; gap: .7rem; }
.emb-comparison { margin-top: 1rem; border-top: 1px solid var(--emb-border); }
.emb-comparison-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.emb-comparison-grid h3 { margin: .5rem 0; }
.emb-comparison-grid p { color: var(--emb-muted); font-size: .8rem; }
.emb-journal-layout { display: grid; grid-template-columns: 155px minmax(0, 1fr); gap: 1.5rem; }
.emb-days { display: flex; flex-direction: column; gap: .5rem; }
.emb-days button { text-align: left; background: transparent; border: 1px solid transparent; padding: 1rem; border-radius: 8px; color: var(--emb-muted); }
.emb-days button strong, .emb-days button span { display: block; }
.emb-days button strong { font-size: 1rem; margin-bottom: .2rem; }
.emb-days button span { font-size: .75rem; }
@media (hover: hover) and (pointer: fine) {
  .emb-days button:hover { background: #f3f4f8; }
}
.emb-days button[aria-pressed=true] { background: #1e2442; color: #fff; }
.emb-entry-heading { display: flex; gap: 1rem; align-items: center; border-bottom: 1px solid var(--emb-border); padding-bottom: 1.25rem; margin-bottom: 1.25rem; }
.emb-day-marker { font-size: 2.5rem; font-variant-numeric: tabular-nums; color: #56619a; }
.emb-entry-heading h3 { margin-bottom: .3rem; font-size: 1.15rem; }
.emb-entry-heading p { margin: 0; font-size: .78rem; color: var(--emb-muted); }
.emb-journal-editor { min-width: 0; }
.emb-journal-editor .emb-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.emb-fields-large input { font-size: 1.4rem; padding: 1rem; }
.emb-entry-footer { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; }
.emb-journal-aside { padding: 1rem; background: #f3f4f8; border-radius: 8px; align-self: start; }
.emb-journal-aside ol { list-style: none; padding: 0; }
.emb-journal-aside li { border-bottom: 1px solid var(--emb-border); padding: .8rem 0; }
.emb-journal-aside li p { margin: .3rem 0; font-size: .8rem; }
.emb-cohort-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.emb-cohort-toolbar p { max-width: 60ch; color: var(--emb-muted); font-size: .8rem; }
.emb-cohort-toolbar label { display: flex; align-items: center; gap: .75rem; font-size: .8rem; }
.emb-cohort-toolbar select { min-width: 180px; }
.emb-cohort-layout { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.4fr); gap: 2rem; }
.emb-roster { border-top: 1px solid var(--emb-border); }
.emb-roster-row { display: grid; width: 100%; grid-template-columns: 45px 65px 1fr; align-items: center; gap: .8rem; border: 0; border-bottom: 1px solid var(--emb-border); padding: .8rem; color: var(--emb-ink); background: #fff; text-align: left; min-height: 72px; }
@media (hover: hover) and (pointer: fine) {
  .emb-roster-row:hover { background: #f3f4f8; }
}
.emb-roster-row[aria-pressed=true] { background: #edeffc; outline: 1px solid #56619a; outline-offset: -1px; }
.emb-roster-row small { display: block; color: var(--emb-muted); font-size: .7rem; margin-top: .2rem; }
.emb-state-label { font-size: .78rem; justify-self: end; }
.emb-specimen { min-width: 0; padding: .6rem 0; }
.emb-specimen-heading { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--emb-border); padding-bottom: 1rem; }
.emb-specimen-heading h3 { font-size: 1.3rem; margin-bottom: .4rem; }
.emb-specimen-heading p { color: var(--emb-muted); font-size: .8rem; margin: 0; }
.emb-grade { font-family: 'Space Mono', monospace; font-size: 1.8rem; color: #56619a; }
.emb-specimen fieldset { padding: 0; margin: 1.5rem 0; border: 0; }
.emb-specimen legend { font-weight: 600; }
.emb-specimen .emb-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.emb-specimen .button { margin-top: 1rem; }
.emb-report-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 2rem; }
.emb-report-heading h3 { font-family: 'DM Serif Display', serif; font-size: 1.75rem; margin-bottom: .5rem; font-weight: 400; }
.emb-report-heading p { color: var(--emb-muted); }
.emb-progression { display: grid; grid-template-columns: repeat(4, 1fr); padding: 1.25rem 0; border-block: 1px solid var(--emb-border); gap: 1rem; }
.emb-progression strong { display: block; font-size: 1.7rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.emb-progression div > span { color: var(--emb-muted); font-size: .8rem; }
.emb-report-section { margin-top: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--emb-border); }
.emb-report-section h3 { margin-bottom: .5rem; }
.emb-report-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.emb-report-days p { font-size: .8rem; margin: .3rem 0; }
.emb-summary-units { display: grid; gap: .6rem; margin-top: 1rem; }
.emb-summary-units > div { display: grid; grid-template-columns: 45px 50px 1fr 1.2fr; padding: .5rem 0; gap: .6rem; font-size: .85rem; border-bottom: 1px solid #edeef3; }
.emb-summary-units small { color: var(--emb-muted); }
.emb-inline-edit { margin-top: .75rem; }
.emb-inline-edit[open] { background: #f7f8fb; border-radius: 8px; padding: 1rem; }
.emb-review { background: #f3f4f8; border-radius: 8px; padding: 1.25rem; align-self: start; position: sticky; top: 1rem; }
.emb-review p { font-size: .8rem; }
.emb-review dt { font-size: .75rem; color: var(--emb-muted); margin-top: 1.25rem; }
.emb-review dd { margin: .3rem 0 0; font-size: .85rem; overflow-wrap: anywhere; }
.emb-review .button { margin-top: 1rem; width: 100%; }
.emb-lab turbo-frame[busy] .emb-design-body { opacity: .6; pointer-events: none; }
@media (max-width: 1100px) {
  .emb-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .emb-journal-layout { grid-template-columns: 130px minmax(0, 1fr); }
  .emb-journal-aside { grid-column: 2; }
  .emb-report-layout { grid-template-columns: minmax(0, 1fr) 210px; gap: 1rem; }
  .emb-designs a { padding: .8rem .6rem; }
  .emb-design-number { display: none; }
}
@media (max-width: 760px) {
  .emb-demo, .emb-heading, .emb-utility, .emb-actions, .emb-cohort-toolbar { align-items: flex-start; flex-direction: column; }
  .emb-demo { gap: .25rem; }
  .emb-designs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emb-designs a { border-radius: 8px; }
  .emb-designs small { font-size: .7rem; }
  .emb-design-body { padding: 1rem; }
  .emb-sheet-layout, .emb-cohort-layout, .emb-report-layout, .emb-journal-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .emb-sheet-index { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emb-sheet-index p { display: none; }
  .emb-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emb-days { flex-direction: row; overflow-x: auto; padding-bottom: .5rem; }
  .emb-days button { flex: 0 0 95px; padding: .7rem; }
  .emb-days button span { font-size: .7rem; }
  .emb-journal-aside { grid-column: auto; }
  .emb-review { position: static; }
  .emb-roster { max-height: 245px; overflow-y: auto; }
  .emb-progression { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emb-summary-units > div { grid-template-columns: 45px 50px 1fr; }
  .emb-summary-units small { grid-column: 2 / -1; }
  .emb-report-days { grid-template-columns: 1fr; }
  .emb-actions > div { flex-direction: column; width: 100%; }
  .emb-actions .button { width: 100%; }
  .emb-comparison-grid { grid-template-columns: 1fr; gap: .5rem; }
  .emb-heading h1 { font-size: 1.5rem; }
}
/* Keep the comparison stable inside the signed-out development shell. */
.emb-lab { width: 100%; min-width: 0; }
.emb-table-scroll { position: relative; }
.emb-sheet, .emb-report { min-width: 0; }

.emb-modes { display: flex; gap: 1.75rem; border-bottom: 1px solid var(--emb-border); }
.emb-modes a { color: var(--emb-muted); text-decoration: none; font-weight: 600; padding: .85rem .15rem; border-bottom: 2px solid transparent; }
@media (hover: hover) and (pointer: fine) {
  .emb-modes a:hover { color: var(--emb-ink); }
}
.emb-modes a[aria-current] { color: var(--emb-ink); border-bottom-color: #b84a24; }
.emb-entry-options { margin: .5rem 0 1.5rem; }
.emb-entry-options > p { font-size: .8rem; color: var(--emb-muted); margin: 0 0 .5rem; }
.emb-entry-options .emb-designs, .emb-comparison-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) {
  .emb-entry-options .emb-designs { grid-template-columns: 1fr; gap: .1rem; }
  .emb-entry-options .emb-designs a { padding: .6rem .75rem; border-radius: 6px; border: 0; }
  .emb-entry-options .emb-designs a[aria-current] { background: #edeffc; }
  .emb-entry-options .emb-designs small { display: none; }
  .emb-entry-options .emb-designs strong { margin: 0; }
  .emb-entry-options .emb-design-number { display: block; font-size: .9rem; }
  .emb-comparison-grid { grid-template-columns: 1fr; }
}

.emb-cycle-disposition { margin-top: 1rem; }
.emb-cycle-disposition > summary { cursor: pointer; color: var(--emb-ink); }
.emb-cycle-disposition > summary strong { font-size: 1rem; }
.emb-cycle-disposition > summary span { display: block; margin: .4rem 0 0 1rem; color: var(--emb-muted); font-size: .8rem; }
.emb-cycle-disposition[open] > summary { margin-bottom: 1.25rem; }

.emb-treatment-entry { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.emb-treatment-entry-copy { min-width: 0; }
.emb-treatment-entry-heading { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.emb-treatment-entry h2 { margin: 0; font-size: 1.375rem; }
.emb-treatment-entry-demo { color: #745019; background: #fff5de; padding: .25rem .5rem; border-radius: 6px; font-size: .75rem; }
.emb-treatment-entry p { color: var(--muted); max-width: 60ch; margin: .5rem 0 0; }
.emb-treatment-entry-actions { display: flex; flex-wrap: wrap; gap: .75rem; flex-shrink: 0; }
.emb-treatment-entry a:focus-visible { outline: 3px solid var(--periwinkle); outline-offset: 3px; }
@media (max-width: 900px) {
  .emb-treatment-entry { align-items: flex-start; flex-direction: column; gap: 1rem; }
}
@media (max-width: 480px) {
  .emb-treatment-entry-actions { flex-direction: column; width: 100%; }
  .emb-treatment-entry-actions .button { width: 100%; }
}

.emb-clinical-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.emb-clinical-fields:disabled { opacity: .75; }

/* A chronological reading path with consistent label/value alignment. */
.emb-report-timeline .emb-progression { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1rem; }
.emb-results-timeline { list-style: none; margin: 2rem 0 0; padding: 0; }
.emb-results-day { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 1.5rem; position: relative; }
.emb-results-day:not(:last-child)::before { content: ""; position: absolute; left: 2.5rem; top: 2rem; bottom: 0; border-left: 1px solid var(--emb-border); }
.emb-results-day-marker { position: relative; align-self: start; text-align: center; padding: .5rem .25rem; background: var(--lilac-soft, #EDEFFC); color: var(--periwinkle, #56619A); border-radius: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.emb-results-day-content { min-width: 0; padding: .5rem 0 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--emb-border); }
.emb-results-day:last-child .emb-results-day-content { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.emb-results-day-content h3 { margin: 0 0 1rem; font-size: 1rem; }
.emb-results-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; row-gap: .75rem; margin: 0; }
.emb-results-metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.emb-results-metrics dt { color: var(--emb-muted); font-size: .875rem; overflow-wrap: anywhere; }
.emb-results-metrics dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.emb-results-notes { white-space: pre-wrap; overflow-wrap: anywhere; margin: 1rem 0 0; font-size: .875rem; }
@media (max-width: 600px) {
  .emb-results-day { grid-template-columns: 4rem minmax(0, 1fr); gap: 1rem; }
  .emb-results-day:not(:last-child)::before { left: 2rem; }
  .emb-results-metrics { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .emb-results-day-marker { font-size: .875rem; }
}
