/* ============================================================================
   course-widgets/sequence-derivation.css -- widget #09

   static "fragment inside the parent" diagram: a parent residue row with a kept
   region highlighted (accent) and the trimmed region dimmed + struck, then the
   derived child fragment below. theme-token styled; the kept/trim distinction is
   the one place color encodes meaning, so it leans on the library accent vs the
   muted token.
   ============================================================================ */

.cw-sd { display: block; }

.cw-sd-caption {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cw-muted);
    margin-bottom: 8px;
}

.cw-sd-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cw-sd-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 34px;
    padding: 7px 4px 5px;
    border-radius: 8px;
    border: 1px solid var(--cw-border);
    background: var(--cw-surface);
}
.cw-sd-code {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}
.cw-sd-pos { font-size: 0.58rem; color: var(--cw-muted); }

/* trimmed residues: dimmed + struck so they read as "removed" */
.cw-sd-tile--trim { opacity: 0.42; }
.cw-sd-tile--trim .cw-sd-code {
    color: var(--cw-muted);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
}

/* kept residues: accent fill (the surviving fragment) */
.cw-sd-tile--kept {
    border-color: var(--cw-accent);
    background: var(--cw-accent-soft);
}
.cw-sd-tile--kept .cw-sd-code { color: var(--cw-accent); }
.cw-sd-tile--kstart { box-shadow: inset 3px 0 0 var(--cw-accent); }
.cw-sd-tile--kend { box-shadow: inset -3px 0 0 var(--cw-accent); }
.cw-sd-tile--kstart.cw-sd-tile--kend {
    box-shadow: inset 3px 0 0 var(--cw-accent), inset -3px 0 0 var(--cw-accent);
}

.cw-sd-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
}
.cw-sd-arrow {
    font-size: 1.1rem;
    color: var(--cw-accent);
    line-height: 1;
}
.cw-sd-child {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border: 1px solid var(--cw-accent);
    border-radius: 999px;
    background: var(--cw-accent-soft);
}
.cw-sd-child-label {
    font-weight: 700;
    color: var(--cw-accent);
    font-size: 0.95rem;
}
.cw-sd-child-seq {
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--cw-text);
}

.cw-sd-note {
    margin: 12px 0 0;
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--cw-muted);
    text-align: center;
}
