/* ============================================================================
   forest-plot.css -- widget #24 (confidence-interval / meta-analysis plot)

   library theme tokens for structure. an estimate whose CI clears the
   reference line (.is-sig) is drawn in --cw-accent; one that crosses it stays
   muted -- the color encodes statistical significance. the reference line is a
   muted vertical rule the rows share.
   ============================================================================ */

.cw-forest-plot {
    padding: 16px;
    border-radius: var(--cw-radius, 14px);
    background: var(--cw-surface);
    border: 1px solid var(--cw-border);
}

.cw-fp-head {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--cw-border);
}
.cw-fp-reflabel {
    font-size: 0.66rem;
    text-transform: none;
    letter-spacing: 0.06em;
    color: var(--cw-muted);
    font-weight: 700;
}

.cw-fp-rows {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: grid;
    gap: 6px;
}

.cw-fp-row {
    display: grid;
    grid-template-columns: 160px 1fr 150px;
    gap: 12px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--cw-bg);
    border: 1px solid var(--cw-border);
    font-size: 0.84rem;
}
.cw-fp-row--primary {
    background: var(--cw-accent-soft);
    border-color: var(--cw-accent);
}

.cw-fp-name { color: var(--cw-text); font-weight: 600; }

.cw-fp-line { position: relative; height: 18px; }
.cw-fp-ref {
    position: absolute;
    top: -2px; bottom: -2px;
    width: 1px;
    background: var(--cw-muted);
    opacity: 0.6;
}
.cw-fp-ci {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    border-radius: 2px;
    background: var(--cw-muted);
    opacity: 0.7;
}
.cw-fp-point {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--cw-muted);
    border: 1px solid var(--cw-surface);
}
.cw-fp-row.is-sig .cw-fp-ci { background: var(--cw-accent); opacity: 0.85; }
.cw-fp-row.is-sig .cw-fp-point { background: var(--cw-accent); }

.cw-fp-hr {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.78rem;
    color: var(--cw-muted);
    text-align: right;
}
.cw-fp-hr em { color: var(--cw-accent); font-style: normal; font-size: 0.72rem; }

.cw-fp-ends {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.66rem;
    text-transform: none;
    letter-spacing: 0.05em;
    color: var(--cw-muted);
}

/* --- the required "how to read this" explanation ------------------------ */

.cw-fp-explain {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--cw-bg);
    border: 1px solid var(--cw-border);
    border-left: 3px solid var(--cw-accent);
}
.cw-fp-explain-tag {
    display: inline-block;
    margin-bottom: 5px;
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.06em;
    color: var(--cw-accent);
}
.cw-fp-explain p {
    margin: 0;
    font-size: 0.83rem;
    line-height: 1.6;
    color: var(--cw-muted);
}

@media (max-width: 640px) {
    .cw-fp-row { grid-template-columns: 1fr; gap: 6px; }
    .cw-fp-hr { text-align: left; }
}
