/* Outils publics (générateur de note de droits d'auteur) : mobile d'abord (360 px), variables de css/app.css (clair et sombre).
   La note elle-même est une feuille de papier : fond clair dans les deux thèmes, comme à l'impression. */
:root { --papier: #ffffff; --papier-texte: #17160f; --papier-texte-2: #55534b; --papier-ligne: #dddbd2; --papier-accent: #1f5f4a; }

.outil .chapo { font-size: 1.08rem; }
.outil-verifie { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--accent); background: var(--accent-doux); border-radius: 999px; padding: .2em .8em; }
.outil-confidentiel { font-size: .88rem; }

.nd-outil { display: grid; gap: 18px; margin: 1.6rem 0 2.4rem; }
.nd-carte { background: var(--surface); border: 1px solid var(--ligne); border-radius: 16px; padding: 18px 16px; box-shadow: var(--ombre); min-width: 0; }
.nd-form fieldset { border: 0; margin: 0 0 1.4rem; padding: 0; min-width: 0; }
.nd-form fieldset:last-of-type { margin-bottom: 0; }
.nd-form legend { font-size: 1rem; font-weight: 650; color: var(--texte); padding: 0; margin-bottom: .7rem; }
.nd-form legend small { font-weight: 400; color: var(--texte-3); font-size: .8rem; }
.nd-champs { display: grid; gap: 12px; }
.nd-champs > div { min-width: 0; }
.nd-form label { margin-bottom: .25em; }
.nd-form label .facultatif { font-weight: 400; color: var(--texte-3); }
.nd-form textarea { min-height: 62px; }
.nd-euro { position: relative; }
.nd-euro input { padding-right: 2em; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.nd-euro::after { content: "€"; position: absolute; right: .8em; top: 50%; transform: translateY(-50%); color: var(--texte-3); pointer-events: none; }
.nd-choix { display: grid; gap: 8px; }
.nd-choix label { display: flex; gap: .6em; align-items: flex-start; margin: 0; padding: .65em .8em; border: 1px solid var(--ligne); border-radius: 10px; cursor: pointer; color: var(--texte); font-weight: 500; font-size: .92rem; }
.nd-choix label:has(input:checked) { border-color: var(--accent); background: var(--accent-doux); }
.nd-choix input { margin-top: .2em; flex: none; }
.nd-choix small, .nd-case small { display: block; color: var(--texte-3); font-size: .8rem; font-weight: 400; }
.nd-case { display: flex; gap: .6em; align-items: flex-start; margin: .2rem 0 0; color: var(--texte); font-size: .92rem; font-weight: 400; }
.nd-case input { margin-top: .25em; flex: none; }
.nd-sous { margin-top: 10px; padding-left: 1.6em; }
.nd-sous[hidden] { display: none; }

.nd-apercu-bloc { min-width: 0; }
.nd-resume { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-doux); color: var(--texte); font-weight: 600; font-variant-numeric: tabular-nums; }
.nd-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
.nd-actions .bouton, .nd-actions button { justify-content: center; }
.nd-aide-pdf { font-size: .82rem; color: var(--texte-3); margin: 8px 0 0; }

/* La feuille */
.note-feuille { background: var(--papier); color: var(--papier-texte); border: 1px solid var(--papier-ligne); border-radius: 6px; padding: 20px 16px; box-shadow: var(--ombre); font-size: .84rem; line-height: 1.45; overflow-wrap: anywhere; }
.legal .note-feuille p, .legal .note-feuille li { color: var(--papier-texte); }
.legal .note-feuille strong { color: var(--papier-texte); }
.note-feuille p { margin: 0 0 .5em; }
.note-entete { display: grid; gap: 14px; }
.note-etiquette { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--papier-accent) !important; margin: 0 0 .3em !important; }
.note-ids { color: var(--papier-texte-2) !important; font-size: .78rem; }
.note-vide { color: #a09d92; font-style: italic; }
.note-titre { font-size: 1.15rem; margin: 1.2rem 0 .2rem !important; color: var(--papier-texte); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; align-items: baseline; }
.note-titre span { font-size: .9rem; font-weight: 600; color: var(--papier-texte-2); }
.note-date { color: var(--papier-texte-2) !important; }
.note-cession { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: .8rem 0; padding: 10px 12px; background: #f6f5f1; border-radius: 6px; }
.note-cession dt { font-weight: 600; }
.note-cession dd { margin: 0; }
.note-calcul { width: 100%; border-collapse: collapse; margin: .8rem 0; font-variant-numeric: tabular-nums; }
.note-calcul th, .note-calcul td { padding: 6px 0; border-bottom: 1px solid var(--papier-ligne); vertical-align: top; background: none; color: var(--papier-texte); text-transform: none; letter-spacing: 0; font-size: inherit; }
.note-calcul th { text-align: left; font-weight: 500; padding-right: 10px; }
.note-calcul td { text-align: right; white-space: nowrap; }
.note-detail { display: block; font-size: .74rem; color: var(--papier-texte-2); font-weight: 400; }
.note-calcul .note-brut th, .note-calcul .note-brut td { font-weight: 700; }
.note-calcul .note-sous-total th, .note-calcul .note-sous-total td { font-weight: 600; }
.note-calcul .note-net th, .note-calcul .note-net td { font-weight: 800; font-size: 1.05em; border-top: 2px solid var(--papier-texte); border-bottom: 0; padding-top: 8px; }
.note-mention { font-size: .76rem; color: var(--papier-texte-2) !important; }
.note-contrib { margin-top: .8rem; padding-top: .6rem; border-top: 1px dashed var(--papier-ligne); font-size: .78rem; }
.note-contrib ul { margin: 0 0 .4em; padding-left: 1.2em; }
.note-signature { display: flex; justify-content: space-between; gap: 12px; margin-top: 1.4rem; }
.note-signature p:last-child { min-width: 45%; min-height: 64px; border-bottom: 1px solid var(--papier-texte-2); }

/* Contenu sous l'outil */
.outil-taux { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 1rem 0; }
.outil-taux th, .outil-taux td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--ligne); vertical-align: top; }
.outil-taux td:nth-child(2), .outil-taux td:nth-child(3) { font-variant-numeric: tabular-nums; }
.outil-sources { font-size: .9rem; }
.outil-sources li { margin: .2rem 0; }

@media (min-width: 560px) {
  .nd-champs.deux { grid-template-columns: 1fr 1fr; }
  .nd-champs .large { grid-column: 1 / -1; }
  .note-entete { grid-template-columns: 1fr 1fr; }
  .note-feuille { padding: 28px 30px; }
}
@media (min-width: 1000px) {
  .outil .largeur.outil-large { max-width: 1120px; }
  .nd-outil { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); align-items: start; }
  .nd-carte { padding: 24px; }
  .nd-apercu-bloc { position: sticky; top: 80px; }
}

/* Impression : la note seule, sur une feuille A4 */
@media print {
  @page { size: A4; margin: 16mm 15mm; }
  html, body { background: #fff !important; }
  .site-tete, .site-pied, .outil .largeur > :not(.nd-outil), .nd-outil > :not(.nd-apercu-bloc), .nd-apercu-bloc > :not(.note-feuille) { display: none !important; }
  .outil, .outil .largeur, .nd-outil, .nd-apercu-bloc { display: block !important; position: static !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .note-feuille { border: 0; box-shadow: none; border-radius: 0; padding: 0; font-size: 10.5pt; color: #000; }
  .note-feuille * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .note-vide { visibility: hidden; }
  .note-calcul tr, .note-signature, .note-contrib { break-inside: avoid; }
}

/* Certificat d'authenticité (certificat-authenticite-oeuvre.html) : même feuille de papier, trois mises en page */
.cert-alertes { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fff4d6; color: #5c4300; font-size: .85rem; }
.cert-alertes p { margin: 0; color: inherit !important; }
.cert-alertes p + p { margin-top: .4em; }
.cert-alertes[hidden] { display: none; }
.cert-feuille { box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; aspect-ratio: 210 / 297; font-size: .82rem; }
.cert-feuille .note-vide { font-style: italic; }
.cert-tete { text-align: center; }
.cert-surtitre { font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; letter-spacing: .02em; margin: 0 !important; color: var(--papier-texte) !important; }
.cert-numero { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--papier-texte-2) !important; margin: .2em 0 0 !important; }
.cert-corps { display: grid; gap: 14px; align-items: start; }
.cert-photo { margin: 0; display: flex; align-items: center; justify-content: center; background: #f6f5f1; border-radius: 4px; min-height: 120px; }
.cert-photo img { display: block; max-width: 100%; max-height: 260px; object-fit: contain; }
.cert-photo-vide span { color: #a09d92; font-style: italic; font-size: .8rem; }
.cert-artiste { font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; margin: 0 0 .4em !important; }
.cert-oeuvre { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.cert-oeuvre dt { font-weight: 600; color: var(--papier-texte-2); font-size: .76rem; padding-top: .1em; }
.cert-oeuvre dd { margin: 0; }
.cert-attestation { font-family: Georgia, "Times New Roman", serif; font-size: .95rem; line-height: 1.5; margin: .4em 0 0 !important; }
.cert-remarques, .cert-acquereur { margin: 0 !important; }
.cert-droits { font-size: .7rem; color: var(--papier-texte-2) !important; margin: 0 !important; }
.cert-pied { margin-top: auto; display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; padding-top: 10px; border-top: 1px solid var(--papier-ligne); }
.cert-coord p { margin: 0 !important; font-size: .74rem; color: var(--papier-texte-2) !important; }
.cert-coord p:first-child { color: var(--papier-texte) !important; font-weight: 600; }
.cert-signe { min-width: 46%; text-align: right; }
.cert-signe p { margin: 0 !important; }
.cert-signature { height: 60px; display: flex; justify-content: flex-end; align-items: flex-end; border-bottom: 1px solid var(--papier-texte-2); margin: 4px 0; }
.cert-signature img { max-height: 56px; max-width: 100%; }
.cert-signature-legende { font-size: .7rem; color: var(--papier-texte-2) !important; }

/* Classique : cadre à double filet, tout centré au-dessus de la description */
.cert-classique { border: 4px double var(--papier-accent); outline: 1px solid var(--papier-ligne); outline-offset: -10px; }
.cert-classique .cert-tete { padding-bottom: 8px; border-bottom: 1px solid var(--papier-ligne); }
/* Galerie : la photo en grand, le texte dessous */
.cert-galerie .cert-tete { text-align: left; display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.cert-galerie .cert-surtitre { font-family: inherit; font-weight: 700; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .1em; }
.cert-galerie .cert-photo { min-height: 180px; background: #efeee8; }
.cert-galerie .cert-photo img { max-height: 340px; }
/* Épurée : sans cadre ni fond, filets fins */
.cert-epure .cert-tete { text-align: left; border-bottom: 2px solid var(--papier-texte); padding-bottom: 6px; }
.cert-epure .cert-surtitre { font-size: 1.3rem; }
.cert-epure .cert-photo { background: none; border: 1px solid var(--papier-ligne); }

.cert-feuille { container-type: inline-size; }
@container (min-width: 600px) {
  .cert-classique .cert-corps, .cert-epure .cert-corps { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
}
@media (min-width: 560px) { .cert-feuille { padding: 30px 32px; } }

@media print {
  .cert-feuille { aspect-ratio: auto; padding: 8mm !important; font-size: 10pt; }
  .cert-classique { border: 4px double #1f5f4a !important; }
  .cert-a4 { height: 262mm; }
  .cert-a5 { height: 186mm; font-size: 8.5pt; padding: 6mm !important; }
  .cert-a5.cert-classique .cert-tete { padding-bottom: 4px; }
  .cert-feuille .cert-corps { grid-template-columns: 1fr !important; }
  .cert-a4 .cert-photo img { max-height: 92mm; }
  .cert-a4.cert-galerie .cert-photo img { max-height: 100mm; }
  .cert-a5 .cert-corps { grid-template-columns: 1fr !important; gap: 3mm; }
  .cert-a5 .cert-photo { min-height: 0; }
  .cert-a5 .cert-photo img { max-height: 42mm; }
  .cert-a5.cert-galerie .cert-photo { min-height: 0; }
  .cert-a5.cert-galerie .cert-photo img { max-height: 38mm; }
  .cert-a5 { gap: 2.2mm; }
  .cert-a5 .cert-oeuvre { gap: 1px 8px; }
  .cert-a5 .cert-attestation { font-size: 9pt; line-height: 1.35; }
  .cert-a5 .cert-signature { height: 40px; }
  .cert-a5 .cert-signature img { max-height: 38px; }
  .cert-a5 .cert-surtitre { font-size: 15pt; }
  .cert-photo-vide { display: none; }
  .cert-feuille { overflow: visible; }
}

/* Contrat d'exposition (contrat-exposition-artiste.html) : même feuille de papier, plusieurs pages à l'impression */
.expo-oeuvres-saisie { width: 100%; border-collapse: collapse; font-size: .88rem; }
.expo-oeuvres-saisie th { text-align: left; font-size: .75rem; font-weight: 600; color: var(--texte-3); padding: 0 4px 4px 0; }
.expo-oeuvres-saisie td { padding: 0 4px 6px 0; vertical-align: middle; border: 0; background: none; }
.expo-oeuvres-saisie th { border: 0; background: none; text-transform: none; letter-spacing: 0; }
.expo-oeuvres-saisie input { width: 100%; min-width: 0; padding: .45em .5em; font-size: .88rem; }
.expo-oeuvres-saisie td:last-child { width: 1%; white-space: nowrap; }
@media (max-width: 699px) {
  /* Une carte par œuvre sur téléphone : chaque champ précédé de son nom. */
  .expo-oeuvres-saisie thead { display: none; }
  .expo-oeuvres-saisie tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
  .expo-oeuvres-saisie td { display: block; padding: 0; }
  .expo-oeuvres-saisie td:first-child { grid-column: 1 / -1; }
  .expo-oeuvres-saisie td[data-col]::before { content: attr(data-col); display: block; font-size: .72rem; color: var(--texte-3); margin-bottom: 2px; }
  .expo-oeuvres-saisie td:last-child { width: auto; align-self: end; }
}
.expo-tete { text-align: center; border-bottom: 1px solid var(--papier-ligne); padding-bottom: 10px; margin-bottom: 12px; }
.expo-sous-titre { color: var(--papier-texte-2) !important; margin: .3em 0 0 !important; }
.expo-parties { display: grid; gap: 12px; margin-bottom: 10px; }
.expo-parties > div { padding: 10px 12px; background: #f6f5f1; border-radius: 6px; }
.expo-parties p { margin: 0 0 .15em; }
.expo-role { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--papier-accent) !important; }
.expo-article h3 { font-size: .92rem; margin: 1rem 0 .35rem; color: var(--papier-texte); }
.expo-table { width: 100%; border-collapse: collapse; margin: .3rem 0 .6rem; font-size: .78rem; }
.expo-table th, .expo-table td { text-align: left; padding: 4px 6px 4px 0; border-bottom: 1px solid var(--papier-ligne); vertical-align: top; background: none; color: var(--papier-texte); text-transform: none; letter-spacing: 0; font-size: inherit; }
.expo-table th { font-weight: 600; }
.expo-montants td.montant { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.expo-montants .note-total td { font-weight: 700; border-top: 2px solid var(--papier-texte); }
.expo-signatures { margin-top: 1.4rem; }
.expo-signes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: .6rem; }
.expo-signes p { margin: 0; }
.expo-signature { min-height: 70px; border-bottom: 1px solid var(--papier-texte-2); margin: 4px 0 6px; }
@media (min-width: 560px) { .expo-parties { grid-template-columns: 1fr 1fr; } }
@media print {
  .expo-article, .expo-table tr, .expo-signatures, .expo-parties { break-inside: avoid; }
  .expo-article h3 { break-after: avoid; }
}
