/* NORUBI Prod — feuille de style. Mobile d'abord (tablette Android, Pixel), puis grand écran.
   Couleurs de la marque : bleu #2259ac, bleu clair #478ccf, rouge #bc002d, jaune #ffd93b, gris #545454. */

:root {
    --bleu: #2259ac; --bleu-clair: #478ccf; --rouge: #bc002d; --jaune: #ffd93b; --gris: #545454;
    --vert: #1f7a4d; --orange: #b25e00;
    --fond: #f5f7fb; --carte: #ffffff; --texte: #1b1f27; --trait: #d9dfea;
    --rayon: 14px;
}
@media (prefers-color-scheme: dark) {
    :root { --fond: #12161f; --carte: #1b2130; --texte: #eef1f7; --trait: #2c3548; --gris: #aab3c5; --bleu: #6ea2e8; --vert: #46c58a; --orange: #f0a23a; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--fond); color: var(--texte);
    font: 17px/1.55 "Noto Sans JP", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img, canvas { max-width: 100%; }
a { color: var(--bleu); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0.4em 0 0.3em; }
h2 { font-size: 1.2rem; margin: 0 0 0.6em; }
h3 { font-size: 1.05rem; }
small { color: var(--gris); font-weight: 400; }
.cache { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* En-tête et menu */
.entete { background: var(--bleu); color: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 8px 16px; position: sticky; top: 0; z-index: 10; }
.marque { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.marque img { background: #fff; border-radius: 8px; padding: 2px; }
.menu { display: flex; gap: 4px; flex-wrap: wrap; }
.menu a { color: #fff; text-decoration: none; padding: 10px 11px; font-size: 0.97rem; border-radius: 10px; min-height: 44px; display: inline-flex; align-items: center; }
.menu a.actif { background: rgba(255, 255, 255, 0.22); font-weight: 700; }
.menu a.discret { opacity: 0.8; }

.page { max-width: 880px; margin: 0 auto; padding: 16px; }
.pied { text-align: center; color: var(--gris); font-size: 0.8rem; padding: 24px 16px 40px; }
.fil { margin: 0; }
.meta { color: var(--gris); margin-top: 0; }

/* Cartes et listes */
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; margin: 16px 0; }
.carte.alerte { border-color: var(--rouge); }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { border-top: 1px solid var(--trait); }
.liste li:first-child { border-top: 0; }
ul.liste.carte { padding: 4px 16px; }
.liste li > a { display: block; padding: 12px 0; }
.ligne-lien { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: inherit; }
.vide { color: var(--gris); margin: 0.4em 0; }

/* Boutons */
.bouton, button.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 18px;
    border: 0; border-radius: 12px; background: var(--bleu); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.bouton:hover { filter: brightness(1.08); }
.bouton:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
.bouton.grand { width: 100%; min-height: 56px; font-size: 1.1rem; }
.bouton.vert { background: var(--vert); }
.bouton.bleu { background: var(--bleu-clair); color: #fff; }
.bouton.rouge { background: var(--rouge); }
.bouton.discret { background: transparent; color: var(--bleu); border: 1px solid var(--trait); }
.en-ligne { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; align-items: center; }
.aide { font-size: 0.9rem; color: var(--gris); margin: 4px 0 0; }

/* Formulaires */
label { display: block; font-weight: 700; margin: 14px 0 4px; }
label.en-ligne { display: inline-flex; margin: 0; font-weight: 600; }
input[type=text], input[type=password], input[type=url], input[type=datetime-local], input[type=number], input:not([type]), select, textarea {
    width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--trait); border-radius: 10px; background: var(--carte); color: var(--texte); min-height: 46px;
}
label.en-ligne input { width: auto; }
textarea { resize: vertical; }
input[type=file] { width: 100%; padding: 8px 0; font: inherit; }
fieldset { border: 1px solid var(--trait); border-radius: 12px; margin: 14px 0; padding: 8px 12px 12px; }
legend { font-weight: 700; padding: 0 6px; }
.element-liste { border-top: 1px dashed var(--trait); padding-top: 6px; margin-top: 8px; }
.element-liste:first-child { border-top: 0; margin-top: 0; }
details > summary { cursor: pointer; padding: 10px 0; font-weight: 700; min-height: 44px; }
details[open] > summary { margin-bottom: 4px; }
details.danger { margin-top: 32px; color: var(--gris); }
ol.etapes { padding-left: 1.3em; }
ol.etapes li { margin: 8px 0; }
hr { border: 0; border-top: 1px solid var(--trait); margin: 16px 0; }
.compteur-texte { display: block; text-align: right; }
.compteur-texte.trop { color: var(--rouge); font-weight: 700; }

/* Messages */
.message { padding: 12px 14px; border-radius: 12px; margin: 12px 0; border: 1px solid; white-space: pre-line; }
.message.ok { background: #e6f5ec; border-color: #9bd3b3; color: #0f4a2d; }
.message.erreur { background: #fdecee; border-color: #f0a3ad; color: #7a0019; }
.message.info { background: #eaf2fc; border-color: #a9c8ee; color: #123f7a; }
@media (prefers-color-scheme: dark) {
    .message.ok { background: #12301f; color: #a8e6c3; border-color: #226b43; }
    .message.erreur { background: #3a1019; color: #ffc2cb; border-color: #8a2237; }
    .message.info { background: #14233d; color: #b6d3f6; border-color: #2c4f80; }
}

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; white-space: nowrap; vertical-align: middle; border: 1px solid; }
.badge.orange { color: var(--orange); border-color: var(--orange); }
.badge.vert { color: var(--vert); border-color: var(--vert); }
.badge.bleu { color: var(--bleu); border-color: var(--bleu); }
.badge.rouge { color: var(--rouge); border-color: var(--rouge); }
.badge.gris { color: var(--gris); border-color: var(--gris); }

/* Tableau de bord */
.compteurs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0 6px; }
@media (min-width: 640px) { .compteurs { grid-template-columns: repeat(4, 1fr); } }
.compteur { background: var(--carte); border: 1px solid var(--trait); border-top-width: 5px; border-radius: var(--rayon); padding: 12px; text-align: center; }
.compteur strong { display: block; font-size: 2.2rem; line-height: 1.1; }
.compteur.orange { border-top-color: var(--orange); }
.compteur.vert { border-top-color: var(--vert); }
.compteur.bleu { border-top-color: var(--bleu-clair); }
.compteur.gris { border-top-color: var(--gris); }
.stock { margin: 8px 0 16px; }

/* Épisode */
.lecteur { width: 100%; margin: 8px 0; }
.contenu-tete h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.apercu { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.apercu .vignette { height: 360px; width: auto; flex: 0 0 auto; border-radius: 10px; border: 1px solid var(--trait); scroll-snap-align: start; background: #fff; }
section.contenu[data-format=story] .apercu .vignette { height: 440px; }
@media (min-width: 640px) { .apercu .vignette { height: 440px; } section.contenu[data-format=story] .apercu .vignette { height: 520px; } }
.avertissements { color: var(--orange); font-size: 0.9rem; margin: 0; }
.article-apercu { max-height: 340px; overflow: auto; border: 1px solid var(--trait); border-radius: 12px; padding: 4px 14px; background: var(--fond); font-family: "Noto Sans JP", system-ui, sans-serif; }
.article-apercu h2 { font-size: 1.1rem; margin-top: 1em; }
.titre-article { margin-bottom: 8px; }
.planif { margin-top: 8px; }

/* Connexion */
.page-connexion .page { max-width: 460px; padding-top: 6vh; }
.connexion { text-align: center; }
.connexion form { text-align: left; }
.connexion .bouton { margin-top: 18px; }

/* Message flottant « Copié ! » */
.bulle { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #1b1f27; color: #fff; padding: 12px 20px; border-radius: 999px; z-index: 50; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); font-weight: 700; }

/* Réglages / équipe */
.grille-droits { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.grille-droits label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 4px 0; }
.grille-droits input { width: auto; min-height: auto; }
.carte table { width: 100%; border-collapse: collapse; }
.carte th, .carte td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--trait); vertical-align: top; }

/* Consigne à copier (page Format d'import) */
textarea.consigne { font-family: ui-monospace, Consolas, monospace; font-size: 0.85rem; line-height: 1.4; }
