/* Éléments communs aux outils (champ avec boutons, listes, blocs de code, badges) */

.input-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.input-row > input,
.input-row > select {
    flex: 1 1 180px;
    min-width: 0;
}

.list-plain {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--text-2);
    font-size: 0.92rem;
    line-height: 1.55;
}

.list-plain strong {
    color: var(--text);
    font-weight: 600;
}

.code-block {
    margin: 8px 0 0;
    padding: 12px 14px;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre;
}

.tag-serveur {
    border-color: color-mix(in srgb, var(--blue) 45%, transparent);
    color: var(--blue-2);
}

.tag-externe {
    border-color: color-mix(in srgb, var(--magenta) 45%, transparent);
    color: var(--magenta);
}

/* Bloc qui signale un appel à un service extérieur */
.external-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px dashed color-mix(in srgb, var(--magenta) 55%, transparent);
    background: color-mix(in srgb, var(--magenta) 7%, transparent);
    color: var(--text-2);
    font-size: 0.86rem;
    line-height: 1.5;
}

.external-note .ui-icon {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    color: var(--magenta);
}

/* Bandeau des pages en brouillon (visibles seulement une fois connecté·e) */
.draft-flag {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid color-mix(in srgb, var(--vig-orange) 55%, transparent);
    background: color-mix(in srgb, var(--vig-orange) 10%, transparent);
    color: var(--text);
    font-size: 0.9rem;
}

.draft-flag .ui-icon {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--vig-orange);
}

.kv {
    display: grid;
    grid-template-columns: minmax(120px, max-content) 1fr;
    gap: 8px 18px;
    margin: 0;
    font-size: 0.92rem;
}

.kv dt {
    color: var(--muted);
}

.kv dd {
    margin: 0;
    min-width: 0;
    font-family: var(--mono);
    overflow-wrap: anywhere;
}

.big-value {
    margin: 0;
    font-family: var(--mono);
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.idea {
    margin: 0;
    font-size: clamp(1.2rem, 2.6vw, 1.7rem);
    line-height: 1.4;
}

.idea mark {
    padding: 0 0.15em;
    border-radius: 4px;
    background: color-mix(in srgb, var(--violet) 22%, transparent);
    color: inherit;
}

.text-out {
    max-height: 520px;
    overflow: auto;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-2);
    line-height: 1.65;
}

.text-out p {
    margin: 0 0 1em;
}

.text-out p:last-child {
    margin-bottom: 0;
}

@media (max-width: 520px) {
    .kv {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .kv dd {
        margin-bottom: 8px;
    }
}

.idea-item {
    font-family: var(--font);
    font-size: 0.95rem;
}

/* Tableaux étroits (téléphone) : les valeurs passent à la ligne plutôt que
   de pousser la dernière colonne hors de l'écran. */
.data-table td {
    overflow-wrap: anywhere;
}

@media (max-width: 520px) {
    .data-table th,
    .data-table td {
        padding: 7px 6px;
    }
}

.idea-card {
    display: grid;
    gap: 14px;
}

.idea-kv {
    grid-template-columns: minmax(90px, max-content) 1fr;
}

.idea-kv dd {
    font-family: var(--font);
}

.idea-copy {
    justify-content: flex-start;
    padding: 0;
    border: 0;
    background: none;
}

.btn-small {
    min-height: 0;
    padding: 5px 10px;
    font-size: 0.82rem;
}

.fictif-table td {
    white-space: nowrap;
    overflow-wrap: normal;
}

/* Champ piège des formulaires publics : invisible pour les personnes, rempli par les robots */
.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Accès rapide de l'espace privé */
.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
}

.quick-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: 0.88rem;
    text-decoration: none;
}

.quick-links a:hover,
.quick-links a:focus-visible {
    border-color: var(--violet);
}

.quick-links .ui-icon {
    width: 14px;
    height: 14px;
    color: var(--violet);
}

.idea-copy,
.idea-item {
    font-family: var(--font);
    word-break: normal;
    overflow-wrap: anywhere;
}

/* Un élément masqué par l'attribut hidden le reste, quel que soit son style */
[hidden] {
    display: none !important;
}

/* Lien discret vers le site parent (andryale.org), au-dessus de l'en-tête */
.parent-link {
    margin: 0 0 -6px;
    padding: 6px 2px 0;
    font-size: 0.76rem;
    letter-spacing: 0.02em;
}

.parent-link a {
    color: var(--muted);
    text-decoration: none;
}

.parent-link a:hover,
.parent-link a:focus-visible {
    color: var(--text);
    text-decoration: underline;
}

/* Fil d'Ariane */
.fil {
    margin: -8px 0 14px;
    font-size: 0.82rem;
}

.fil ol {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fil li {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
}

.fil li + li::before {
    content: "›";
    margin: 0 8px;
    color: var(--muted);
    opacity: 0.7;
}

.fil a {
    color: var(--text-2);
    text-decoration: none;
}

.fil a:hover,
.fil a:focus-visible {
    color: var(--text);
    text-decoration: underline;
}

.fil [aria-current] {
    color: var(--text);
}

/* Familles d'outils */
.famille-sommaire {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.famille-sommaire a,
.famille-autres a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--famille) 45%, var(--line));
    background: color-mix(in srgb, var(--famille) 9%, var(--surface));
    color: var(--text);
    font-size: 0.88rem;
    text-decoration: none;
}

.famille-sommaire a:hover,
.famille-autres a:hover,
.famille-sommaire a:focus-visible,
.famille-autres a:focus-visible {
    border-color: var(--famille);
}

.famille-sommaire .ui-icon,
.famille-autres .ui-icon {
    width: 16px;
    height: 16px;
    color: var(--famille);
}

.famille-section {
    display: grid;
    gap: 12px;
    margin-top: 26px;
    scroll-margin-top: 20px;
}

.famille-section .section-title h2 a {
    color: inherit;
    font-size: inherit;
    text-decoration: none;
}

.famille-section .section-title h2 a:hover,
.famille-section .section-title h2 a:focus-visible {
    color: var(--text);
    text-decoration: underline;
}

.famille-resume {
    color: var(--muted);
    font-size: 0.86rem;
    text-align: right;
}

.famille-pastille {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 9px;
    border-radius: 50%;
    background: var(--famille);
    vertical-align: 1px;
}

.famille-head h1 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.famille-icone {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--famille) 16%, transparent);
    color: var(--famille);
}

.famille-icone .ui-icon {
    width: 20px;
    height: 20px;
}

.famille-autres {
    margin-top: 30px;
}

.famille-autres ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 640px) {
    .famille-section .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .famille-resume {
        text-align: left;
    }
}
