/* Кабинет фермера */
body.page-cabinet { overflow-x: hidden; overflow-y: auto; height: auto; min-height: 100%; position: relative; }

.bg-shapes { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-shapes span { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .5; animation: drift 22s ease-in-out infinite alternate; }
.bg-shapes span:nth-child(1) { width: 420px; height: 420px; background: #FBD27A; left: -120px; top: -80px; }
.bg-shapes span:nth-child(2) { width: 360px; height: 360px; background: #BFE0B4; right: -100px; top: 30%; animation-delay: -6s; }
.bg-shapes span:nth-child(3) { width: 300px; height: 300px; background: #F6D5C4; left: 30%; bottom: -120px; animation-delay: -12s; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(60px, 40px) scale(1.15); } }
.bg-leaves { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.cab-header, .cab-hero, .cab-grid, .page-cabinet .signature { position: relative; z-index: 1; }
.cab-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 1240px; margin: 0 auto; }
.brand--link { text-decoration: none; }
.cab-hero { max-width: 1240px; margin: 0 auto; padding: 8px 16px 18px; animation: fadeUp .6s var(--ease); }
.cab-hero h1 { font-size: clamp(26px, 5vw, 40px); line-height: 1.1; color: var(--green); margin: 6px 0 8px; font-weight: 900; letter-spacing: -.01em; }
.cab-hero p { max-width: 640px; margin: 0; font-size: 16px; color: #3D4C43; }
.cab-hero__steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cab-hero__steps span { background: var(--paper); box-shadow: inset 0 0 0 2px var(--line); padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--green); }

.cab-grid { max-width: 1240px; margin: 0 auto; padding: 0 16px 40px; display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 980px) {
  .cab-grid { grid-template-columns: minmax(0, 1fr) 420px; align-items: start; }
  .cab-side { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
  .fab-preview { display: none !important; }
}

.cab-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fs {
  border: 0; margin: 0; padding: 18px 16px; background: rgba(255, 253, 248, .92); border-radius: var(--r);
  box-shadow: var(--shadow-s); display: flex; flex-direction: column; gap: 12px; min-width: 0;
  animation: fadeUp .5s var(--ease) both;
}
.fs:nth-child(2) { animation-delay: .05s; } .fs:nth-child(3) { animation-delay: .1s; } .fs:nth-child(4) { animation-delay: .15s; }
.fs legend { float: left; width: 100%; padding: 0; font-size: 18px; font-weight: 900; color: var(--green); display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.fs legend b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--honey); color: #3A2600; font-size: 15px; }
.fs legend + * { clear: both; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; min-width: 0; position: relative; }
.field input, .field select, .field textarea, .row > input:not([type=range]) {
  width: 100%; border: 0; border-radius: 14px; padding: 12px 14px; background: var(--cream); font-weight: 600; font-size: 16px;
  box-shadow: inset 0 0 0 2px var(--line); transition: box-shadow .2s; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .row > input:not([type=range]):focus { box-shadow: inset 0 0 0 2px var(--honey), 0 0 0 4px rgba(232, 163, 61, .18); }
.field textarea { resize: vertical; min-height: 84px; }
.field.is-error input { box-shadow: inset 0 0 0 2px #C8372D; animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.counter { position: absolute; right: 10px; bottom: 8px; font-weight: 600; font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1; min-width: 160px; }
.row--2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 620px) { .row--2 { grid-template-columns: 1fr 1fr; align-items: end; } }
.row--center { justify-content: center; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; font-size: 15px; cursor: pointer; padding: 10px 12px; border-radius: 14px; background: var(--cream); box-shadow: inset 0 0 0 2px var(--line); }
.check input { width: 20px; height: 20px; accent-color: var(--green); flex: none; margin: 1px 0 0; }
.check--inline { align-self: end; }
.chips--wrap { flex-wrap: wrap; overflow: visible; }
.chips--sugg .chip { height: 32px; font-size: 13px; background: var(--cream); }
.chips--sugg .chip::before { content: "+"; font-weight: 900; color: var(--green-3); }
.chips--sugg .chip.is-added { opacity: .45; }

.tags-edit { display: flex; flex-wrap: wrap; gap: 8px; min-height: 8px; }
.tag-x { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; border-radius: 999px; background: var(--green); color: #fff; font-weight: 800; font-size: 14px; animation: pop .35s var(--spring); }
.tag-x button { border: 0; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, .22); color: #fff; cursor: pointer; font-weight: 900; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.crop-modes { display: inline-flex; align-self: flex-start; background: var(--cream); border-radius: 999px; padding: 4px; box-shadow: inset 0 0 0 2px var(--line); flex-wrap: wrap; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  padding: 26px 16px; border-radius: var(--r); border: 3px dashed rgba(31, 77, 58, .25); background: var(--cream); cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s var(--spring);
}
.dropzone[hidden] { display: none; }
.dropzone:hover, .dropzone.is-over { background: #FFF3D6; border-color: var(--honey); transform: scale(1.01); }
.dropzone__icon { font-size: 36px; animation: bob 3s ease-in-out infinite; }
.cropper { display: flex; flex-direction: column; gap: 10px; animation: fadeUp .4s var(--ease); }
.cropper[hidden] { display: none; }
.cropper__stage { position: relative; align-self: center; width: min(100%, 340px); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); cursor: grab; touch-action: none; background: #222; }
.cropper__stage.is-cover { width: min(100%, 520px); }
.cropper__stage canvas { display: block; width: 100%; height: auto; }
.cropper__hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; pointer-events: none; white-space: nowrap; }
.cropper input[type=range] { flex: 1; max-width: 260px; accent-color: var(--green); }

.mini-map { height: 280px; border-radius: var(--r); overflow: hidden; box-shadow: inset 0 0 0 2px var(--line); position: relative; background: #EAE3D2; z-index: 0; }
.mini-map .leaflet-tile-pane { filter: saturate(.82) sepia(.14) brightness(1.03); }
.mini-map__fallback { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--muted); font-weight: 700; }
.mini-map.leaflet-container .mini-map__fallback { display: none; }
.mini-map__tip { position: absolute; z-index: 500; left: 58px; right: 10px; width: max-content; max-width: calc(100% - 68px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; top: 10px; background: var(--paper); padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; box-shadow: var(--shadow-s); pointer-events: none; }
.coords input { font-variant-numeric: tabular-nums; }

.price-rows { display: flex; flex-direction: column; gap: 8px; }
.price-row { display: grid; grid-template-columns: 1fr 120px 40px; gap: 8px; animation: fadeUp .3s var(--ease); }
.price-row input { border: 0; border-radius: 12px; padding: 10px 12px; background: var(--cream); box-shadow: inset 0 0 0 2px var(--line); font-weight: 600; min-width: 0; font-size: 15px; }
.price-row button { border: 0; border-radius: 12px; background: var(--cream-2); cursor: pointer; font-weight: 900; }

.btn--big { min-height: 52px; padding: 12px 22px; font-size: 16px; }
.fs--submit { background: linear-gradient(135deg, #FFF8E8, #FFFDF8); }
.form-msg { margin: 0; padding: 12px 14px; border-radius: 14px; font-weight: 700; animation: fadeUp .35s var(--ease); }
.form-msg.is-err { background: #FBE3E0; color: #8A2018; }
.form-msg.is-ok { background: #E2F0DE; color: #1E4A16; }
.form-msg a { color: inherit; font-weight: 900; }

/* Серверная версия: ошибки полей, отправка, редактирование */
.field.is-error select, .field.is-error textarea { box-shadow: inset 0 0 0 2px #C8372D; animation: shake .4s; }
.field.is-error .chips { border-radius: 16px; box-shadow: 0 0 0 2px #C8372D; animation: shake .4s; }
.fs.fs--error { box-shadow: var(--shadow-s), inset 0 0 0 2px #C8372D; }
.consent { display: flex; flex-direction: column; gap: 6px; }
.consent__note { margin: 0 4px; }
.consent.is-error .check { box-shadow: inset 0 0 0 2px #C8372D; animation: shake .4s; }
.field-err { display: block; color: #A12A20; font-size: 13px; font-weight: 800; line-height: 1.35; }
.btn.is-loading { cursor: progress; opacity: .85; }
#submitBtn { white-space: normal; text-align: center; max-width: 100%; }
.spinner { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; vertical-align: -3px; }
.edit-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r); background: #FFF3D6; color: #7A4B00; font-weight: 800; box-shadow: var(--shadow-s); animation: fadeUp .35s var(--ease); }
.edit-banner[hidden] { display: none; }
.edit-banner .btn { min-height: 38px; padding: 6px 14px; font-size: 14px; }

/* Правая колонка */
.cab-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.side-card { background: rgba(255, 253, 248, .94); border-radius: var(--r); box-shadow: var(--shadow-s); padding: 16px; animation: fadeUp .5s var(--ease) both; }
.side-card p { margin: 6px 0 12px; }
.side-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.side-card__head h2 { font-size: 17px; font-weight: 900; color: var(--green); }
.live-dot { font-size: 12px; font-weight: 800; color: #C8372D; display: inline-flex; align-items: center; gap: 6px; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #C8372D; animation: blink 1.2s ease-in-out infinite; }
.phone { position: relative; border-radius: 34px; padding: 10px; background: #1E2A23; box-shadow: var(--shadow); max-width: 380px; margin: 0 auto; }
.phone__notch { position: absolute; z-index: 3; left: 50%; top: 10px; transform: translateX(-50%); width: 110px; height: 20px; border-radius: 0 0 14px 14px; background: #1E2A23; }
.phone__screen { border-radius: 26px; overflow: hidden; background: var(--cream); max-height: 560px; overflow-y: auto; scrollbar-width: none; }
.phone__screen::-webkit-scrollbar { display: none; }
.detail-preview .detail__visual { height: 180px; }
.detail-preview .detail__body { padding: 36px 16px 20px; }
.detail-preview .detail__name { font-size: 21px; }
.detail-preview .detail__visual, .detail-preview .avatar { transition: opacity .3s; }
.preview-pin { display: flex; align-items: center; justify-content: center; gap: 14px; height: 96px; margin-bottom: 4px; padding-bottom: 14px; }
.preview-pin .fr-pin { transform: scale(1.1); }
.preview-pin small { font-weight: 800; color: var(--muted); }

.my-farms { display: flex; flex-direction: column; gap: 8px; }
.my-farm { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 8px; border-radius: 14px; background: var(--cream); }
.my-farm b { display: block; line-height: 1.2; }
.my-farm__act { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.my-farm__act a, .my-farm__act button { font-size: 13px; font-weight: 800; border: 0; background: var(--paper); border-radius: 999px; padding: 6px 10px; cursor: pointer; text-decoration: none; color: var(--green); box-shadow: inset 0 0 0 2px var(--line); }
.my-farm__act button[data-del] { color: #8A2018; }
.my-farm__act button[data-withdraw] { color: #8A2018; }
.my-farm .my-status { display: inline-block; margin-top: 4px; }
.my-status--approved { background: #E2F0DE; color: #24581A; }
.my-status--rejected, .my-status--missing { background: #FBE3E0; color: #8A2018; }
.my-status--unpublished, .my-status--unknown, .my-status--loading, .my-status--draft { background: #F3EEE6; color: #6B5B45; }
.my-farm__note { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); line-height: 1.35; }
.my-farm.is-editing { box-shadow: inset 0 0 0 2px var(--honey); }
.my-refresh { margin-top: 10px; width: 100%; min-height: 40px; font-size: 14px; }
.my-refresh[hidden] { display: none; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--cream); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; }
.stat__n { font-size: 30px; font-weight: 900; color: var(--green); font-variant-numeric: tabular-nums; }
.stat__l { font-size: 13px; color: var(--muted); font-weight: 700; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 70px; margin: 12px 0 26px; }
.bars span { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--honey), var(--amber)); transform-origin: bottom; animation: grow .9s var(--spring) both; position: relative; }
.bars span::after { content: attr(data-d); position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); font-weight: 700; }
@keyframes grow { from { transform: scaleY(0); } }
.side-card--top { background: linear-gradient(135deg, #1F4D3A, #2E6B4F); color: #fff; }
.side-card--top h2 { color: #fff !important; }
.price-tag { display: inline-block; background: rgba(255, 255, 255, .14); padding: 8px 12px; border-radius: 12px; margin-bottom: 12px; font-size: 16px; }
.sticker-wrap { display: grid; place-items: center; margin: 4px 0 12px; }
.sticker-wrap canvas { width: min(100%, 260px); height: auto; border-radius: 50%; box-shadow: var(--shadow); animation: wobble 6s ease-in-out infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) scale(1.02); } }

.fab-preview {
  position: fixed; z-index: 50; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  background: var(--green); color: #fff; text-decoration: none; font-weight: 900; padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow-l);
  animation: fadeUp .5s var(--ease) 1s both;
}
.page-cabinet .signature { padding-bottom: 80px; }
.hide-s { display: none; }
@media (min-width: 560px) { .hide-s { display: inline; } }

@media (prefers-reduced-motion: reduce) {
  .bg-shapes span, .sticker-wrap canvas, .spinner { animation: none !important; }
}

#sellerLoginForm { display: flex; align-items: end; justify-content: center; flex-wrap: wrap; gap: 12px; }
#sellerLoginForm .field { text-align: left; }
#sellerAccess [hidden], #registration[hidden] { display: none; }

#sellerWorkspace[hidden], #registrationIntro[hidden], #sellerLoginForm[hidden], #accessTabs[hidden] { display: none; }
#accessTabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0 1rem; }
#accessTabs a { border: 1px solid #587662; color: #214a37; background: #fff; }
#accessTabs a[aria-current] { background: #214a37; color: white; }
