.farm-help-mobile { display: none; }
.farm-sheet { box-sizing: border-box; width: min(540px, calc(100% - 24px)); max-width: none; max-height: 90dvh; padding: 0; border: 1px solid #d9e4df; border-radius: 8px; background: #fff; color: #18352e; box-shadow: 0 12px 48px #152c3333; overflow: hidden; }
.farm-sheet[open] { display: flex; flex-direction: column; }
.farm-sheet::backdrop { background: #172e375e; }
.farm-sheet * { box-sizing: border-box; min-width: 0; letter-spacing: 0; }
.farm-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid #e4ebe7; flex: none; }
.farm-sheet-head h2 { font-size: 19px; margin: 0; overflow-wrap: anywhere; }
.farm-sheet-head button { width: 40px; height: 40px; flex: 0 0 40px; padding: 8px; border: 0; background: #eff4f1; border-radius: 6px; }
.farm-sheet-body { padding: 20px; overflow: auto; overscroll-behavior: contain; }
.farm-sheet label { display: block; font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.farm-sheet textarea, .farm-sheet input, .farm-sheet select { display: block; width: 100%; max-width: 100%; padding: 12px; border: 1px solid #b9cdc4; border-radius: 6px; background: #fff; color: #18352e; font: inherit; font-size: 16px; }
.farm-sheet textarea { resize: vertical; }
.farm-sheet input:focus, .farm-sheet textarea:focus, .farm-sheet select:focus { outline: 2px solid #188057; outline-offset: 2px; }
.farm-sheet h3 { font-size: 19px; margin: 10px 0; overflow-wrap: anywhere; }
.farm-sheet p, .farm-sheet li, .farm-sheet dd { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.farm-sheet-actions { padding: 14px 20px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid #e4ebe7; display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.farm-sheet-actions button, .farm-sheet-actions a { flex: 1 1 auto; max-width: 100%; min-height: 44px; border: 1px solid #cbdad3; border-radius: 6px; padding: 10px 14px; background: #f4f7f5; color: #18533e; font: inherit; font-size: 14px; font-weight: 600; text-align: center; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.farm-sheet-actions .farm-primary { background: #137647; color: white; border-color: #137647; }
.farm-sheet-actions .farm-micro { display: flex; flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; align-items: center; justify-content: center; }
.farm-sheet-actions .farm-micro svg { width: 22px; height: 22px; flex: none; }
.farm-sheet-actions button:disabled { opacity: .5; cursor: wait; }
.farm-kind, .farm-progress { color: #526c65; margin-top: 0; }
.farm-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 18px 0; border-bottom: 1px solid #e4ebe7; }
.farm-total strong { font-size: 26px; overflow-wrap: anywhere; text-align: right; }
.farm-recap { display: grid; grid-template-columns: minmax(70px, 1fr) minmax(0, 2fr); gap: 10px; font-size: 14px; }
.farm-recap dd { margin: 0; text-align: right; }
.farm-warning { padding: 10px 12px; border-left: 3px solid #bd7d15; background: #fff9e8; color: #6a491c; }
.farm-next-action { margin: 16px 0 0; padding: 11px 12px; border-left: 3px solid #137647; background: #eef8f1; color: #18533e; font-weight: 600; }
.farm-sheet [role=alert] { color: #b32835; }
.farm-phrase-summary { color: #596e66; border-top: 1px solid #e4ebe7; padding-top: 12px; }
.farm-help-topic + .farm-help-topic { border-top: 1px solid #e4ebe7; margin-top: 16px; padding-top: 8px; }
.farm-partner { border-top: 1px solid #e4ebe7; padding: 12px 0; margin: 12px 0; }
.farm-partner summary { cursor: pointer; font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.farm-sheet .farm-checkbox { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font-size: 14px; font-weight: 400; line-height: 1.4; }
.farm-sheet .farm-checkbox input { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; padding: 0; accent-color: #137647; }
.farm-purchase { border-top: 1px solid #e4ebe7; padding: 12px 0; }
.farm-purchase h3 { font-size: 16px; }
.farm-purchase-fields { display: grid; gap: 12px; }
.farm-purchase [hidden] { display: none; }
.farm-purchase label { margin-bottom: 6px; }
#modal-choix-ferme .menu-fermes { position: static; width: 100%; max-height: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; overflow: visible; animation: none; }
#modal-choix-ferme .item-ferme { display: grid; grid-template-columns: minmax(0, 1fr) 22px; gap: 6px 10px; min-height: 66px; padding: 12px; margin-bottom: 4px; }
#modal-choix-ferme .if-nom { grid-column: 1; white-space: normal; overflow-wrap: anywhere; font-size: 15px; }
#modal-choix-ferme .if-role { grid-column: 1; white-space: normal; }
#modal-choix-ferme .if-coche { grid-column: 2; grid-row: 1 / 3; }
#modal-choix-ferme .item-ferme.ajouter { display: flex; }
#modal-choix-ferme [aria-busy="true"] { opacity: .6; }
@media (max-width: 720px) {
  .farm-help-mobile { display: flex; justify-content: flex-end; margin-top: 6px; }
  .farm-help-mobile button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: #47675a; padding: 8px 0 8px 12px; min-height: 40px; font: inherit; font-size: 13px; }
  #farm-help-permanent { position: fixed; right: 0; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 24; display: inline-flex; width: 54px; height: 48px; min-height: 48px; align-items: center; justify-content: flex-start; gap: 9px; overflow: hidden; padding: 5px 7px; border: 1px solid #d9f3e2; border-right: 0; border-radius: 24px 0 0 24px; background: #fff; color: #075f3d; box-shadow: 0 5px 18px #142a2230; cursor: grab; touch-action: pan-y; transform: translateX(34px); transition: width .34s ease, transform .34s ease, box-shadow .22s ease; white-space: nowrap; }
  #farm-help-permanent:active { transform: translateX(31px) scale(.98); }
  #farm-help-permanent.is-dragging { cursor: grabbing; transition: width .18s ease, box-shadow .18s ease; }
  #farm-help-permanent.is-open { width: min(230px, calc(100vw - 24px)); transform: translateX(0); box-shadow: 0 8px 26px #142a2240; }
  #farm-help-permanent .farm-help-logo { display: inline-flex; flex: 0 0 36px; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%; background: #25d366; box-shadow: inset 0 -1px 0 #0f8f46, 0 2px 8px #25d36652; }
  #farm-help-permanent .farm-help-logo svg { width: 28px; height: 28px; display: block; }
  #farm-help-permanent .farm-help-logo-bg { fill: #25d366; }
  #farm-help-permanent .farm-help-logo-phone { fill: #fff; }
  #farm-help-permanent .farm-help-label { flex: 0 0 0; width: 0; max-width: 0; font-size: 13px; font-weight: 700; line-height: 1.18; text-align: left; white-space: normal; opacity: 0; transform: translateX(6px); transition: opacity .22s ease, transform .22s ease, max-width .22s ease; }
  #farm-help-permanent.is-open .farm-help-label { flex-basis: 162px; width: 162px; max-width: 162px; opacity: 1; transform: translateX(0); }
  body:has(dialog[open]) #farm-help-permanent, body:has(#ecran-auth:not([hidden])) #farm-help-permanent { display: none; }
  .farm-sheet { width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 8px 8px 0 0; }
  .farm-sheet-head, .farm-sheet-body { padding: 16px; }
  .farm-sheet-actions { padding-left: 16px; padding-right: 16px; }
}
