/* Page CoddyFlow : même gabarit que les pages CoddyBlock et CoddyDraw */

/* bouton d'essai sous la capture */
.cf-essai {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 0 0 22px;
}

.cf-essai-note {
    font-size: 12px;
    color: var(--text-dim);
}

/* lignes libelle vers description : les descriptions de cette page sont longues */
.section .row {
    grid-template-columns: auto minmax(0, 1fr);
}

.section .row .desc {
    white-space: normal;
    line-height: 1.5;
}

/* tableau des formes */
.cf-formes td:first-child {
    white-space: nowrap;
    width: 1%;
}

.cf-forme {
    display: block;
    font-size: 11px;
    color: var(--text-dimmer);
}

.cf-pastille {
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-right: 7px;
    border: 1px solid var(--pc, var(--border2));
    border-radius: 3px;
    background: color-mix(in srgb, var(--pc, var(--border2)) 18%, transparent);
    vertical-align: -1px;
}

.cf-pastille.is-gris {
    --pc: var(--text-dimmer);
}

.cf-pastille.is-vert {
    --pc: var(--accent2);
}

.cf-pastille.is-bleu {
    --pc: var(--accent);
}

.cf-pastille.is-orange {
    --pc: var(--accent4);
}

.cf-pastille.is-violet {
    --pc: var(--accent5);
}

.cf-pastille.is-rouge {
    --pc: var(--err);
}

.cf-formes td:nth-child(2) {
    white-space: nowrap;
}

.cf-structures td:first-child {
    white-space: nowrap;
    width: 1%;
}

.ref-table .cf-groupe th {
    padding-top: 14px;
    background: var(--surface2);
    color: var(--accent);
}

/* exemple : le code et le schéma côte à côte */
.cf-duo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    border-bottom: 1px solid var(--border);
}

.cf-duo-code,
.cf-duo-schema {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cf-duo-schema {
    border-left: 1px solid var(--border);
    background: var(--surface2);
    padding-bottom: 16px;
}

.cf-etiq {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 16px 0;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.cf-etiq .mdi {
    font-size: 14px;
    color: var(--accent);
}

/* le petit organigramme de démonstration, en HTML */
.cf-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 12px 14px 0;
    font-family: var(--font-mono);
    font-size: 11.5px;
    text-align: center;
}

.cf-n {
    display: inline-block;
    max-width: 100%;
    padding: 6px 11px;
    border: 1px solid color-mix(in srgb, var(--nc, var(--border2)) 45%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--nc, var(--surface)) 6%, var(--surface));
    color: var(--text);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.cf-debut {
    --nc: var(--text-dimmer);
    border-radius: 999px;
    padding-left: 16px;
    padding-right: 16px;
    font-weight: 600;
}

.cf-action {
    --nc: var(--border2);
}

.cf-io {
    --nc: var(--accent2);
    border-radius: 3px;
    transform: skewX(-9deg);
}

.cf-io > span,
.cf-io {
    white-space: normal;
}

.cf-appel {
    --nc: var(--accent5);
    border-left: 4px double color-mix(in srgb, var(--accent5) 70%, transparent);
    border-right: 4px double color-mix(in srgb, var(--accent5) 70%, transparent);
}

.cf-go {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent5) 14%, transparent);
    font-family: var(--font-text);
    font-size: 10px;
    font-weight: 600;
    color: var(--accent5);
}

.cf-fleche {
    display: block;
    width: 1px;
    height: 16px;
    background: var(--border2);
    position: relative;
}

.cf-fleche::after {
    content: '';
    position: absolute;
    left: -3px;
    bottom: 0;
    width: 7px;
    height: 7px;
    border-right: 1px solid var(--border2);
    border-bottom: 1px solid var(--border2);
    transform: rotate(45deg);
}

/* décision : une colonne par chemin */
.cf-dec {
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}

.cf-dec-tete {
    padding: 7px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
    color: var(--accent);
}

.cf-dec-cols {
    display: flex;
    align-items: stretch;
}

.cf-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 11px 10px 13px;
}

.cf-col + .cf-col {
    border-left: 1px dashed color-mix(in srgb, var(--accent) 32%, transparent);
}

.cf-lab {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
}

.cf-oui {
    background: color-mix(in srgb, var(--accent2) 15%, transparent);
    color: var(--accent2);
}

.cf-non {
    background: color-mix(in srgb, var(--err) 13%, transparent);
    color: var(--err);
}

/* boucle : un cadre repliable */
.cf-grp {
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--accent4) 42%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent4) 4%, var(--surface));
}

.cf-grp-tete {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--accent4) 20%, transparent);
    color: var(--accent4);
}

.cf-grp-corps {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 11px 12px 9px;
}

.cf-retour {
    width: 100%;
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px dashed color-mix(in srgb, var(--accent4) 35%, transparent);
    font-family: var(--font-text);
    font-size: 10.5px;
    color: var(--accent4);
}

@media (max-width: 760px) {
    .cf-duo {
        grid-template-columns: 1fr;
    }

    .cf-duo-schema {
        border-left: 0;
        border-top: 1px solid var(--border);
    }

    .section .row {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .section .row .desc {
        text-align: left;
    }

    .section .row code {
        white-space: normal;
        overflow-wrap: break-word;
    }

    .ref-table {
        font-size: 11px;
    }

    /* formes : une carte par ligne */
    .cf-formes thead {
        display: none;
    }

    .cf-formes tr,
    .cf-formes td {
        display: block;
        width: auto;
    }

    .cf-formes tr {
        padding: 10px 14px;
        border-bottom: 1px solid var(--border);
    }

    .cf-formes td {
        padding: 2px 0;
        border: 0;
    }

    .cf-structures td:first-child {
        white-space: normal;
    }

    .cf-dec-cols {
        flex-direction: column;
    }

    .cf-col + .cf-col {
        border-left: 0;
        border-top: 1px dashed color-mix(in srgb, var(--accent) 32%, transparent);
    }
}

.section kbd {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    border: 1px solid var(--border2);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--surface);
    color: var(--text);
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}
