/* Carnet de parcelles et registre — démo Forge Labs. S'appuie sur ../_shared/demo.css et vigne.css. */

.carnet { max-width: 1320px; margin: 0 auto; padding: 24px var(--gutter) 40px; display: grid; gap: 20px; }
.carnet > * { min-width: 0; }
.carnet h1 { font-size: clamp(1.45rem, 2.6vw, 2.05rem); margin: 0 0 4px; }
.carnet h2 { font-size: clamp(1.08rem, 1.5vw, 1.24rem); margin: 0 0 4px; letter-spacing: -.01em; }
.carnet p { margin: 0; }
.card { padding: clamp(16px, 2vw, 24px); border-radius: 16px; min-width: 0; box-shadow: 0 1px 2px rgba(30, 13, 18, .05), 0 8px 24px -14px rgba(30, 13, 18, .2); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 20px; margin-bottom: 14px; }
.card-head .small { max-width: 62ch; }

/* En-tête */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.head-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.head-stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.head-stats li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: grid; gap: 1px; min-width: 92px; }
.head-stats b { font: 700 1.05rem/1.15 var(--font-display); color: var(--wine-800); font-variant-numeric: tabular-nums; white-space: nowrap; }
.head-stats span { font-size: .74rem; color: var(--muted); }
@media (max-width: 520px) {
  .head-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .head-stats li { min-width: 0; padding: 8px 10px; }
  .head-stats b { font-size: .95rem; }
}

/* Mise en page plan + fiche */
.layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.pick { display: grid; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.pick select { font: inherit; font-size: .92rem; font-weight: 500; color: var(--ink); min-height: 44px; padding: 0 34px 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--stone-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235f5558' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; -webkit-appearance: none; max-width: 100%; }

.map-wrap { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #efe9dd; }
.map { width: 100%; height: auto; display: block; touch-action: manipulation; }
.map .lbl { font: 600 15px/1 var(--font-body); fill: #6d5f4b; letter-spacing: .02em; }
.map .lbl-bois { fill: #56653f; font-style: italic; }
.prog { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.prog-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.prog-list li { display: grid; grid-template-columns: 11.5em minmax(0, 1fr) 11em; gap: 10px; align-items: center; font-size: .84rem; }
.pl { font-weight: 600; }
.pb { display: flex; height: 10px; border-radius: 99px; background: var(--stone-100); overflow: hidden; }
.pb i { display: block; height: 100%; }
.pb-d { background: var(--leaf-600); }
.pb-c { background: repeating-linear-gradient(135deg, #e0a24a 0 4px, #f3c98a 4px 8px); }
.pv { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; }
@media (max-width: 560px) { .prog-list li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; } .pb { grid-column: 1 / -1; grid-row: 2; } }
.map .lbl-n { font-size: 13px; font-weight: 700; fill: #3d1724; }
.parcel { cursor: pointer; outline: none; }
.parcel .pp { stroke: #fff; stroke-width: 3; stroke-linejoin: round; transition: stroke .15s, stroke-width .15s, filter .15s; }
.parcel:hover .pp { stroke: var(--wine-600); stroke-width: 4; }
.parcel:focus-visible .pp { stroke: var(--focus); stroke-width: 6; }
.parcel.on .pp { stroke: var(--wine-900); stroke-width: 6; filter: drop-shadow(0 6px 10px rgba(42, 18, 25, .35)); }
.parcel .badge { fill: #fff; stroke: rgba(42, 18, 25, .25); stroke-width: 1.5; }
.parcel.on .badge { fill: var(--wine-700); stroke: #fff; stroke-width: 2.5; }
.parcel .badge-t { font: 700 20px/1 var(--font-body); fill: var(--wine-900); pointer-events: none; }
.parcel.on .badge-t { fill: #fff; }
.parcel .warn-dot { display: none; fill: #e07a1f; stroke: #fff; stroke-width: 2.5; }
.parcel.watch .warn-dot { display: block; }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.legend .lg-warn { border-radius: 50%; background: #e07a1f; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, .12); width: 11px; height: 11px; }

/* Fiche */
.c-fiche { outline: none; display: grid; gap: 14px; }
.c-fiche:focus-visible { outline: 3px solid var(--focus); }
.f-top { display: flex; gap: 14px; align-items: flex-start; }
.f-num { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--cep, var(--wine-700)); color: #fff; display: grid; place-items: center; font: 700 1.2rem/1 var(--font-display); }
.f-kick { font-size: .74rem !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.c-fiche h2 { font-size: clamp(1.3rem, 2vw, 1.6rem) !important; margin: 2px 0 2px !important; color: var(--wine-900); }
.f-app { font-size: .9rem; color: var(--wine-700); font-weight: 600; }
.etat { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; font-size: .9rem; line-height: 1.4; }
.etat b { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }
.etat-ok { background: var(--leaf-100); color: #2f4723; }
.etat-watch { background: var(--warn-100); color: #6b3205; box-shadow: inset 3px 0 0 #e07a1f; }
.f-grid { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.f-grid > div { background: #fff; padding: 9px 12px; min-width: 0; }
.f-grid .wide { grid-column: 1 / -1; }
.f-grid dt { font-size: .74rem; color: var(--muted); font-weight: 600; }
.f-grid dd { margin: 1px 0 0; font-weight: 600; font-size: .94rem; color: var(--ink); }
.f-h { font-size: .95rem !important; margin: 4px 0 0 !important; }
.travaux { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 420px) { .travaux { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tv { border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; font-size: .8rem; line-height: 1.25; border: 1px solid var(--line); }
.tv-n { font-weight: 700; }
.tv.fait { background: var(--leaf-100); border-color: transparent; color: #2f4723; }
.tv.cours { background: #fbeed9; border-color: transparent; color: #6b4205; }
.tv.afaire { background: var(--stone-50); color: var(--muted); }
.ivs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.iv { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .86rem; line-height: 1.4; }
.iv:last-child { border-bottom: 0; }
.iv time { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.iv b { color: var(--ink); }
.iv-reg b { color: var(--wine-700); }
.iv.fresh { background: linear-gradient(90deg, rgba(255, 177, 92, .22), transparent 80%); border-radius: 8px; padding-left: 8px; margin-left: -8px; }
.f-foot { border-top: 1px dashed var(--line); padding-top: 10px; }

.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.chip-miss { background: var(--warn-100); color: #8a3c04; box-shadow: inset 0 0 0 1px rgba(224, 122, 31, .5); }
.chip-ok { background: var(--leaf-100); color: #2f4723; }

/* Dictée */
.c-dictee { background: var(--wine-900); color: var(--stone-100); border-color: transparent; }
.dictee-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr); gap: clamp(18px, 3vw, 36px); }
@media (max-width: 1000px) { .dictee-grid { grid-template-columns: minmax(0, 1fr); } }
.dictee-left { display: flex; flex-direction: column; gap: 14px; }
.c-dictee h2 { color: #fff; font-size: clamp(1.2rem, 2vw, 1.5rem) !important; }
.ai-eyebrow { display: flex; align-items: center; gap: 6px; font-size: .74rem !important; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ember); }
.dictee-lead { color: rgba(243, 239, 232, .8); font-size: .95rem; }
.notes { display: grid; gap: 8px; }
.note { position: relative; display: block; cursor: pointer; }
.note input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.note span { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(243, 239, 232, .2); background: rgba(255, 255, 255, .04); font-size: .92rem; line-height: 1.3; }
.note span::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(243, 239, 232, .6); }
.note input:checked + span { border-color: var(--ember); background: rgba(255, 177, 92, .1); }
.note input:checked + span::before { border-color: var(--ember); background: radial-gradient(circle, var(--ember) 0 4px, transparent 5px); }
.note input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn-dictate { background: var(--ember); color: #2a1704; min-height: 54px; font-size: 1.05rem; align-self: flex-start; padding: .8em 1.5em; }
.btn-dictate:hover { background: #ffc27d; }
.btn-dictate.listening { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 177, 92, .55); } 50% { box-shadow: 0 0 0 12px rgba(255, 177, 92, 0); } }
.c-dictee > .guard { margin-top: 18px; }
.guard { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(243, 239, 232, .22); color: rgba(243, 239, 232, .86); font-size: .88rem; line-height: 1.45; }
.guard svg { color: var(--ember); margin-top: 2px; }
.guard strong { color: #fff; }

.dictee-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.transcript { background: rgba(255, 255, 255, .06); border: 1px solid rgba(243, 239, 232, .14); border-radius: 12px; padding: 14px 16px; min-height: 92px; }
.tr-empty { color: rgba(243, 239, 232, .55); font-style: italic; }
.tr-meta { font-size: .76rem; color: rgba(243, 239, 232, .6); margin-bottom: 6px !important; }
.tr-text { font-size: 1.02rem; line-height: 1.55; color: #fff; font-family: var(--font-display); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.4; color: rgba(243, 239, 232, .9); }
.steps li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: #7f9455 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.2l2.6 2.5L13 6.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.steps li.st-warn::before { background: #e07a1f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M9 4.5v5.5' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='9' cy='13.2' r='1.3' fill='%23fff'/%3E%3C/svg%3E") center/contain no-repeat; }
.steps li { animation: appear .3s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.res { display: grid; gap: 12px; animation: appear .3s ease both; }
.res-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 700px) { .res-cards { grid-template-columns: minmax(0, 1fr); } }
.res-cards li { background: var(--stone-50); color: var(--ink); border-radius: 12px; padding: 10px 12px; display: grid; gap: 3px; align-content: start; font-size: .86rem; line-height: 1.4; }
.rc-k { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wine-700); }
.rc-x { color: var(--muted); font-size: .8rem; }
.res-none { padding: 10px 12px; border-radius: 12px; border: 1px dashed rgba(243, 239, 232, .35); font-size: .9rem; color: rgba(243, 239, 232, .86); }
.ask { background: var(--stone-50); color: var(--ink); border-radius: 12px; padding: 14px; display: grid; gap: 10px; box-shadow: inset 4px 0 0 #e07a1f; }
.ask p { font-size: .92rem; line-height: 1.45; }
.ask-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 460px) { .ask-btns { grid-template-columns: minmax(0, 1fr); } }
.btn-choice { flex-direction: column; align-items: flex-start; gap: 3px; border-radius: 12px; background: #fff; border-color: var(--line); color: var(--wine-900); text-align: left; min-height: 56px; padding: 10px 12px; line-height: 1.2; }
.btn-choice small { font-weight: 500; color: var(--muted); font-size: .78rem; }
.btn-choice:hover { border-color: var(--wine-700); }

.entry { background: #fff; color: var(--ink); border-radius: 14px; padding: clamp(14px, 2vw, 18px); display: grid; gap: 10px; }
.entry-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 14px; }
.entry h3 { font-size: 1.02rem; margin: 0; color: var(--wine-900); }
.entry-c { font-size: .84rem; font-weight: 700; }
.entry-c.is-miss { color: #9a4304; }
.entry-c.is-ok { color: var(--leaf-600); }
.entry-dicte { font-size: .86rem; color: var(--muted); }
.entry-dicte b { color: var(--ink); }
.flds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .flds { grid-template-columns: minmax(0, 1fr); } }
.fld { border-radius: 10px; padding: 9px 11px; display: grid; gap: 5px; align-content: start; border: 1px solid var(--line); min-width: 0; }
.fl-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fl-h label, .fl-l { font-size: .78rem; font-weight: 700; color: var(--ink); }
.fl-b { font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.fv { font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
.fl-n { font-size: .76rem; color: var(--muted); line-height: 1.35; }
.fld-ok { background: #f6f9f2; border-color: rgba(79, 107, 58, .25); }
.fld-ok .fl-b { background: var(--leaf-100); color: #2f4723; }
.fld-miss { background: var(--warn-100); border-color: #e9a25c; box-shadow: inset 3px 0 0 #e07a1f; }
.fld-miss .fl-b { background: #e07a1f; color: #fff; }
.fld-miss .fl-n { color: #7a3a06; }
.fld-cond, .fld-opt { background: var(--stone-50); }
.fld-cond .fl-b, .fld-opt .fl-b { background: var(--stone-200); color: var(--muted); }
.fld-cond .fv { font-weight: 500; color: var(--muted); font-size: .84rem; }
.fld input { font: inherit; font-size: .92rem; padding: 9px 11px; border-radius: 8px; border: 1px solid #d9a46e; background: #fff; color: var(--ink); width: 100%; min-height: 42px; }
.fld-ok input { border-color: rgba(79, 107, 58, .45); }
.fld input:disabled { background: var(--stone-50); color: var(--muted); }
.btn-mini { justify-self: start; font: 600 .78rem/1.2 var(--font-body); padding: 7px 10px; min-height: 34px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--wine-800); cursor: pointer; }
.btn-mini:hover { border-color: var(--wine-700); }
.entry-a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 4px; }
.entry-a .small { max-width: 46ch; }
.entry .btn-primary:disabled { opacity: .6; cursor: default; }

/* Registre */
.reg-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.btn-export { min-height: 44px; padding: .6em 1.1em; font-size: .92rem; background: #fff; color: var(--wine-900); border-color: var(--line); }
.btn-export:hover { border-color: var(--wine-700); }
.reg-status { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--muted); margin-bottom: 10px !important; }
.scroller { overflow: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.tscroll { border: 1px solid var(--line); border-radius: 12px; max-height: 440px; }
table.reg { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; font-size: .86rem; }
.reg th, .reg td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.reg thead th { position: sticky; top: 0; background: var(--stone-50); font-size: .74rem; font-weight: 700; color: var(--muted); white-space: nowrap; z-index: 1; }
.reg .r { text-align: right; }
.reg .nw { white-space: nowrap; }
.reg td:nth-child(2) { min-width: 170px; }
.cn { display: block; font-weight: 600; color: var(--wine-900); }
.cs { display: block; font-size: .74rem; color: var(--muted); }
.td-miss { background: var(--warn-100); color: #8a3c04; font-weight: 700; }
.td-miss small { display: block; font-weight: 500; color: #7a3a06; font-size: .74rem; }
.reg tr.fresh td { box-shadow: inset 0 2px 0 rgba(255, 177, 92, .9), inset 0 -2px 0 rgba(255, 177, 92, .9); }
.reg tr.fresh td:first-child { box-shadow: inset 4px 0 0 var(--ember), inset 0 2px 0 rgba(255, 177, 92, .9), inset 0 -2px 0 rgba(255, 177, 92, .9); }
.empty { text-align: center; color: var(--muted); padding: 24px !important; }
.scroll-hint { display: none; color: var(--muted); margin: 0 0 6px !important; }
@media (max-width: 640px) {
  .c-reg .tscroll { border: 0; max-height: 560px; padding: 2px; }
  table.reg, .reg tbody, .reg tr, .reg td { display: block; min-width: 0; }
  table.reg { min-width: 0; }
  .reg thead { display: none; }
  .reg tbody { display: grid; gap: 8px; }
  .reg tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
  .reg tr.inc { box-shadow: inset 4px 0 0 #e07a1f; }
  .reg td { padding: 0; border: 0; text-align: left !important; font-size: .84rem; white-space: normal !important; }
  .reg td[data-l]::before { content: attr(data-l); display: block; font-size: .68rem; font-weight: 700; color: var(--muted); }
  .reg .td-date { grid-column: 1; grid-row: 1; font-weight: 700; }
  .reg .td-state { grid-column: 2; grid-row: 1; justify-self: end; }
  .reg .td-parc, .reg .td-prod { grid-column: 1 / -1; }
  .reg .td-cult { display: none; }
  .reg .td-miss { padding: 4px 6px; border-radius: 6px; }
  .reg tr.fresh td, .reg tr.fresh td:first-child { box-shadow: none; }
  .reg tr.fresh { outline: 2px solid var(--ember); }
  .reg .empty { grid-column: 1 / -1; }
}
.rules { margin-top: 14px; font-size: .88rem; }
.rules summary { cursor: pointer; font-weight: 700; color: var(--wine-700); padding: 6px 0; }
.rules-body { display: grid; gap: 8px; padding: 6px 0 0; line-height: 1.5; max-width: 80ch; }
.rules-body a { color: var(--wine-700); }

@media (prefers-reduced-motion: reduce) {
  .btn-dictate.listening, .steps li, .res { animation: none !important; }
}

/* Imprimer / PDF : seul le registre des traitements (avec la mention « fictif » de la démo). */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff !important; }
  .topbar, .head, .c-map, .c-fiche, .c-dictee, .guard, .cta-end, .foot, .reg-actions, .skip { display: none !important; }
  .c-reg { box-shadow: none !important; border: 0 !important; }
  .scroller, .tscroll, .c-reg .tscroll { overflow: visible !important; max-height: none !important; border: 0 !important; }
  .rules { display: none !important; }
  .reg tr { break-inside: avoid; }
  .demo-banner { background: none !important; border: 1px solid #999; }
}
