/* somaCURA adapter over shared native components. The existing NE layout,
   clinical meaning, source targets, and action delegates remain authoritative. */
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] {
    --nev2-body-size: 16px;
    --nev2-ink: var(--drc-ink);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev2-section {
    background: var(--drc-base);
    border-color: var(--drc-border);
    border-radius: 9px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev2-section-title {
    color: var(--drc-ink);
    font: 600 16px/1.45 var(--drc-font);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev2-section .nev-bn-problem {
    color: var(--drc-body);
    background: var(--drc-base);
    border-color: var(--drc-border);
    font-family: var(--drc-font);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev-problem-band-decision.drc-native-review {
    padding: 12px;
    border-color: var(--drc-border);
    border-inline-start-color: var(--drc-review-accent);
    background: var(--drc-base);
    font-family: var(--drc-font);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .drc-native-state {
    margin-block-end: 6px;
    padding: 2px 6px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev-problem-band-decision-copy {
    gap: 4px;
    margin-bottom: 0;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-preview {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .drc-native-hunk {
    margin-block: 6px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .drc-native-previous {
    margin-block: 4px 0;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .drc-native-previous > summary {
    min-height: 30px;
    padding-block: 3px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-line {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    margin: 0;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-line pre {
    color: var(--drc-ink);
    font: 400 16px/1.65 var(--drc-font);
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-line-label {
    color: var(--drc-muted);
    font: 12px/1.65 var(--drc-font);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    margin: 0;
    color: var(--drc-muted);
    font: 12px/1.6 var(--drc-font);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review :is(.nev2-decision-detail,.nev2-patch-context) {
    margin-block: 0;
    border-color: var(--drc-border);
    color: var(--drc-muted);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review :is(.nev2-decision-detail,.nev2-patch-context) > summary {
    margin: 0;
    min-height: 28px;
    padding-block: 5px;
    font: 500 12px/1.5 var(--drc-font);
    color: var(--drc-blue);
    cursor: pointer;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-context pre {
    margin: 4px 0 10px;
    font: 400 16px/1.65 var(--drc-font);
    color: var(--drc-ink);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-sources {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--drc-muted);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-source {
    color: var(--drc-teal);
    border: 1px solid color-mix(in srgb, var(--drc-teal) 30%, var(--drc-border));
    background: color-mix(in srgb, var(--drc-teal) 6%, var(--drc-base));
    border-radius: 5px;
    font: 12px/1.5 var(--drc-font);
    padding: 5px 8px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .drc-native-actions {
    margin-block-start: 6px;
    padding-block-start: 8px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-actions .nev-bn-ab-btn {
    min-height: 36px;
    border-radius: 6px;
    font: 500 13px/1.4 var(--drc-font);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-actions [data-nev-ab="accept"] {
    background: color-mix(in srgb, var(--drc-teal) 10%, var(--drc-base));
    color: var(--drc-teal);
    border-color: color-mix(in srgb, var(--drc-teal) 35%, var(--drc-border));
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-actions [data-nev-ab="reject"] {
    color: var(--drc-negative);
    border-color: color-mix(in srgb, var(--drc-negative) 30%, var(--drc-border));
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev-entry-composer {
    background: var(--drc-raised);
    border: 1px solid var(--drc-strong-border);
    border-radius: 10px;
    color: var(--drc-body);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev-entry-composer:focus-within {
    border-color: var(--drc-amber);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev-entry-textarea {
    background: var(--drc-canvas);
    color: var(--drc-ink);
    border-color: var(--drc-border);
    font: 400 16px/1.65 var(--drc-font);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev-entry-textarea::placeholder {
    color: var(--drc-muted);
    opacity: 1;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] :is(.nev-entry-source,.nev-entry-time) {
    color: var(--drc-muted);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] :is(.drc-native-previous,.nev2-decision-detail,.nev2-patch-context) summary:focus-visible {
    outline: 2px solid var(--drc-blue);
    outline-offset: 3px;
}
@media (any-pointer: coarse) {
    #noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review :is(.drc-native-previous,.nev2-decision-detail,.nev2-patch-context) > summary,
    #noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-actions .nev-bn-ab-btn,
    #noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-source {
        min-height: 44px;
    }
}
/* Source metadata must reflow inside the existing journal grid rather than
   intruding into the physician's source text. */
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev-entry-meta {
    min-width: 0;
    flex-wrap: wrap;
    align-content: start;
    gap: 4px 6px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev-entry-meta > span {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev-entry-meta .nev-entry-status {
    margin-left: 0;
}

/* Slice 2 (2026-09-05): one rendering. While a proposal is pending the signed
   block rests in dim ink under it; added lines carry a change bar. Never a
   strikethrough anywhere on this card. */
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev-problem-band-note-projection:has(.nev-problem-band-decision[data-status="proposed"]) > .nev-bn-problem {
    color: var(--drc-muted, #aab7c9);
    opacity: 0.82;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-line.drc-native-added {
    border-inline-start: 3px solid var(--dr-harvest, #C98A2E);
    padding-inline-start: 8px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-line,
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-line pre {
    text-decoration: none;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev2-value-deltas {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 4px 0 6px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev2-value-delta {
    font: 500 14px/1.4 var(--drc-mono, ui-monospace, monospace);
    color: var(--drc-body, #d2dae5);
    padding: 1px 8px;
    border: 1px solid var(--drc-border, #313b49);
    border-radius: 6px;
    background: var(--drc-raised, #1a2029);
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev2-value-delta[data-dir="up"] { border-color: var(--drc-amber, #d9a441); }
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev2-value-delta[data-dir="down"] { border-color: var(--drc-blue, #6ea8fe); }
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev2-value-delta[data-dir="new"] { border-style: dashed; color: var(--drc-muted, #aab7c9); }

/* Slice 2 height budget (measured 2026-09-05 on a six-line block: 2.26× before
   this rule set). The copy wrapper dissolves (display: contents) so the card is
   a two-column grid: proposal text | state caption, then Fed-by | actions. The
   text keeps the full width; chrome shares rows with it instead of stacking. */
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev-problem-band-decision.drc-native-review {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "copy state" "sources actions";
    column-gap: 14px;
    row-gap: 4px;
    align-items: start;
    padding: 6px 10px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review > .nev-problem-band-decision-copy {
    display: contents;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev-problem-band-decision-copy > .nev2-patch-preview {
    grid-area: copy;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev-problem-band-decision-copy > .nev2-patch-sources {
    grid-area: sources;
    align-self: center;
    margin: 0;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev-problem-band-decision-copy > :not(.nev2-patch-preview):not(.nev2-patch-sources),
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review > :is(.nev2-inline-edit, .nev2-refine, .nev-target-picker, .nev-finalize-conflict, .nev-finalize-assembly-failure) {
    grid-column: 1 / -1;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review > .drc-native-state {
    grid-area: state;
    justify-self: end;
    margin: 0;
    white-space: nowrap;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review > .nev-bn-ab-row {
    grid-area: actions;
    align-self: center;
    justify-self: end;
    margin: 0;
    padding: 0;
}
/* The change bar names the added line; the "After" label and the enlarged
   preview type were a second announcement. Proposal text reads at body size. */
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-line-label {
    display: none;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-line pre {
    font: 400 var(--nev2-body-size, 16px)/1.5 var(--drc-font);
    padding: 2px 0;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-line.drc-native-added {
    padding: 2px 0 2px 10px;
    margin: 0;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .drc-native-previous > summary {
    min-height: 24px;
    padding-block: 1px;
}
@media (max-width: 900px) {
    #noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev-problem-band-decision.drc-native-review {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "state" "copy" "sources" "actions";
    }
    #noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review > .nev-bn-ab-row { justify-self: start; }
}
/* With the label hidden the line is a single column; the base sheet's
   label|text grid would otherwise squeeze the text into the label track. */
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-line {
    display: block;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review .nev2-patch-line pre {
    white-space: pre-wrap;
    margin: 0;
}
/* Resolved (accepted / rejected / edited): one quiet row — Fed-by, state,
   Evidence. The replaced text lives in the block above; nothing repeats it. */
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .nev-problem-band-decision.drc-native-review:not([data-companion-review-state="proposed"]) {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "copy copy copy" "sources state actions";
    align-items: center;
    padding: 4px 10px;
}

/* A resolved strip retains its clinical copy inside the review card. */
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"] .drc-native-review > .nea-block {
    grid-area: copy;
    min-width: 0;
    width: 100%;
}

/* The clinical desk uses the same review components inside a narrower dated
   note. Copy keeps the full card width; source and action rows wrap below it. */
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"][data-nev-clinical="on"] { --nev2-body-size: 13px; }
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"][data-nev-clinical="on"] .nev-problem-band-decision.drc-native-review {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "state" "copy" "sources" "actions";
    gap: 4px;
    padding: 7px 8px;
    border-radius: 3px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"][data-nev-clinical="on"] .drc-native-review > .drc-native-state {
    justify-self: start;
    padding: 1px 4px;
    font-size: 9px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"][data-nev-clinical="on"] .drc-native-review > .nev-bn-ab-row {
    justify-self: start;
    flex-wrap: wrap;
    gap: 4px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"][data-nev-clinical="on"] .drc-native-review .nev2-patch-source {
    max-width: 100%;
    padding: 1px 5px;
    border-radius: 2px;
    font: 9px/1.5 var(--drc-mono, var(--dr-font-mono));
    overflow-wrap: anywhere;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"][data-nev-clinical="on"] .drc-native-review .nev2-patch-sources { gap: 3px; font-size: 9px; }
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"][data-nev-clinical="on"] .drc-native-actions .nev-bn-ab-btn {
    min-height: 26px;
    padding: 3px 7px;
    border-radius: 3px;
    font-size: 11px;
}
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"][data-nev-clinical="on"] .drc-native-review .nev2-patch-line.drc-native-added { border-inline-start-color: var(--drc-teal); }
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"][data-nev-clinical="on"] .drc-native-review .nev2-patch-context pre { font: 400 13px/1.45 var(--drc-font); }
#noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"][data-nev-clinical="on"] .nev2-value-delta { padding: 1px 5px; border-radius: 3px; font-size: 11px; }
@media (any-pointer: coarse) {
    #noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"][data-nev-clinical="on"] .drc-native-actions .nev-bn-ab-btn,
    #noteEvolutionTakeover[data-nev-v2][data-nev-companion="on"][data-nev-clinical="on"] .drc-native-review .nev2-patch-source { min-height: 44px; }
}
