.wine-number-marker{background:transparent!important;border:0!important}
.wine-number-marker span{box-sizing:border-box;width:42px;height:42px;display:grid;grid-template-rows:16px 1fr;place-items:center;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 7px #18342955;font-weight:850;text-shadow:none}
.wine-number-marker .wine-marker-letter{align-self:end;font-size:11px;line-height:1;letter-spacing:.04em}
.wine-number-marker .wine-marker-digits{align-self:start;font-size:15px;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:.02em}
.wine-number-marker.wine-marker-red span{background:#7d2638;color:#fff}
.wine-number-marker.wine-marker-white span{background:#e4d29b;color:#30291d}
.wine-number-marker.wine-marker-rose span{background:#e9a6aa;color:#4e2530}
.wine-number-marker.wine-marker-orange span{background:#d98547;color:#2d1c12}
.wine-number-marker.wine-marker-default span{background:#2c5b49;color:#fff}

.wine-detail-dialog>article{overflow:hidden!important}
.wine-detail-dialog .detail-scroll>.wine-card-nav{position:sticky;top:0;z-index:8;margin:0 -1px 8px;padding:10px 1px;background:#faf9f6;border-bottom:1px solid #e4e8e4}
.wine-detail-dialog .detail-terroir-map{height:180px;overflow:hidden;border-radius:19px;background:#e8eee9}
.wine-detail-dialog .detail-map-caption{display:grid;gap:3px;padding:10px 4px 0}
.wine-detail-dialog .detail-map-caption small{color:#557166;font-size:10px;font-weight:850;letter-spacing:.13em}
.wine-detail-dialog .detail-map-caption b{color:#1f4033;font-size:15px}
.ios-wine-wizard :is(input,textarea,select,button):focus,.ios-wine-wizard :is(input,textarea,select,button):focus-visible{outline:none!important;box-shadow:none!important}
.ios-wine-wizard,.ios-wine-wizard:focus,.ios-wine-wizard:focus-visible{outline:none!important;-webkit-tap-highlight-color:transparent!important}

/* A wine card grows with its content; it no longer reserves space when Safari changes chrome height. */
.wine-detail-dialog{height:auto!important;max-height:calc(100svh - 16px)!important}
.wine-detail-dialog>article{height:auto!important;max-height:calc(100svh - 16px)!important}
.wine-detail-dialog .detail-scroll{flex:0 1 auto!important;max-height:calc(100svh - 140px)!important;overflow-y:auto!important}
.wine-detail-loading-card{position:relative;min-height:min(510px,calc(100svh - 16px));background:#f7f7f9}
.wine-detail-loading{display:grid;align-content:start;gap:18px;min-height:0;padding:22px!important;background:#f7f7f9}
.wine-loading-identity{display:block;padding:6px 2px 4px}.wine-loading-copy{display:grid;gap:10px}.wine-loading-copy i,.wine-loading-copy b,.wine-loading-copy em,.wine-loading-section i,.wine-loading-section b{display:block;border-radius:999px;background:linear-gradient(100deg,#e7ebe7 20%,#f4f6f4 42%,#e7ebe7 64%);background-size:220% 100%;animation:wine-loading-shimmer 1.15s linear infinite}.wine-loading-copy i{width:92px;height:10px}.wine-loading-copy b{width:88%;height:29px;border-radius:10px}.wine-loading-copy em{width:60%;height:17px}.wine-loading-map{height:180px;border-radius:19px;background:linear-gradient(135deg,#dfe9dc,#f0e8d1 48%,#d8e3d6);opacity:.9}.wine-loading-section{display:grid;gap:13px;padding:19px;border-radius:18px;background:#fff}.wine-loading-section i{width:108px;height:11px}.wine-loading-section b{height:14px}.wine-loading-section b:last-child{width:72%}@keyframes wine-loading-shimmer{to{background-position:-220% 0}}
.wine-archive-area{margin-top:16px;padding:3px 1px 12px}.wine-archive-toggle{padding:4px 0;border:0;border-bottom:1px dashed #8b918d;background:transparent;color:#6f7771;font:600 12px/1.4 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;cursor:pointer}.wine-archive-list{display:grid;gap:10px;margin-top:12px}.wine-archive-list[hidden]{display:none!important}.wine-archive-list .wine-v4-row{border:1px solid #e1e4e1;border-radius:17px;background:#fafafa}.wine-archived-row .wine-card-rail,.wine-archived-row .wine-card-badges,.wine-archived-row .wine-personal-meta{opacity:.74}.wine-archived-row .wine-card-copy,.wine-archived-row .wine-card-copy :is(strong,b,span,small){color:#7d827e!important}.wine-archive-button{flex:0 0 auto!important;background:#f7eded!important;color:#8a3240!important}
.wine-restore-button{flex:0 0 auto!important;background:#eaf3ed!important;color:#315b49!important}
.ios-wine-wizard,.ios-picker-sheet{width:min(620px,calc(100vw - 24px))!important;height:min(680px,calc(100svh - 28px))!important;max-height:calc(100svh - 28px)!important;margin:auto!important;border-radius:28px!important}.ios-wine-wizard main,.ios-picker-sheet main{min-height:0!important;overflow-y:auto!important}.ios-picker-sheet .ios-search,.ios-picker-sheet main,.ios-picker-sheet footer{padding-left:20px!important;padding-right:20px!important}.ios-picker-sheet main{padding-top:8px!important}.ios-picker-sheet main p{margin-left:0!important}
.wine-detail-dialog [data-card-section]:focus,.wine-detail-dialog [data-card-section]:focus-visible{outline:none!important;box-shadow:none!important}
.wine-wizard-loading-card{display:grid!important;grid-template-rows:auto 3px 1fr auto!important;min-height:560px;background:#fff}.wine-wizard-loading-card header{display:flex!important;justify-content:space-between!important;padding:25px 28px 18px!important;background:#fff}.wine-wizard-loading-card header div{display:grid;gap:12px;width:70%}.wine-wizard-loading-card header i,.wine-wizard-loading-card header b,.wine-wizard-loading-card main i,.wine-wizard-loading-card main b,.wine-wizard-loading-card footer b{display:block;border-radius:999px;background:linear-gradient(100deg,#e7ebe7 20%,#f4f6f4 42%,#e7ebe7 64%);background-size:220% 100%;animation:wine-loading-shimmer 1.15s linear infinite}.wine-wizard-loading-card header i{width:94px;height:10px}.wine-wizard-loading-card header b{width:100%;height:32px;border-radius:10px}.wine-wizard-loading-card header>span{width:48px;height:48px;border-radius:50%;background:#315b49}.wine-wizard-loading-card .ios-stepbar em{display:block;width:28%;height:100%;background:#315b49}.ios-wine-wizard .wine-wizard-loading{display:grid;align-content:start;gap:20px;padding:26px 28px!important;background:#fff}.wine-wizard-loading i,.wine-wizard-loading b{display:block;height:16px;border-radius:999px;background:linear-gradient(100deg,#e7ebe7 20%,#f4f6f4 42%,#e7ebe7 64%);background-size:220% 100%;animation:wine-loading-shimmer 1.15s linear infinite}.wine-wizard-loading i{width:105px;height:10px}.wine-wizard-loading b{width:100%;height:62px;border-radius:18px}.wine-wizard-loading b:last-child{width:72%}.wine-wizard-loading-card footer{padding:18px 28px 24px!important;background:#fff}.wine-wizard-loading-card footer b{height:54px;width:100%;background:#315b49}
.ios-wine-wizard{--wizard-accent:#315b49!important}.ios-wine-wizard header>button,.ios-wine-wizard footer [data-next]{background:#315b49!important}.ios-wine-wizard .wine-wizard-kicker,.ios-wine-wizard .companion-question>span{color:#315b49!important}
.wine-detail-loading-card .detail-loading-close{display:none!important}.leaflet-popup-content{position:relative;padding-right:27px}.leaflet-container .leaflet-popup-close-button{z-index:3;top:7px;right:7px;width:24px;height:24px;border-radius:50%;background:#fff;color:#315b49!important;font:24px/21px Arial;text-align:center;box-shadow:0 1px 5px #0003}.wine-detail-dialog .leaflet-popup-content-wrapper{border-radius:14px}.wine-detail-dialog .terroir-popup b{font-size:14px}.wine-detail-dialog .terroir-popup span{display:block;color:#666;font-size:12px}.wine-detail-dialog .terroir-popup small{display:block;color:#777;font-size:11px;margin-top:3px}

/* Keep one stable, native scroll surface. The previous content-sized dialog created
   a second scroll boundary after Safari reached the bottom of a wine card. */
.wine-detail-dialog{height:calc(100svh - 16px)!important;max-height:calc(100svh - 16px)!important;overscroll-behavior:contain}
.wine-detail-dialog>article{height:100%!important;max-height:none!important;min-height:0!important;overflow:hidden!important}
.wine-detail-dialog .detail-scroll{flex:1 1 auto!important;height:0;min-height:0!important;max-height:none!important;overflow-y:scroll!important;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
.wine-detail-dialog .leaflet-container .leaflet-popup-close-button{top:0;right:0;width:24px;height:24px;border-radius:0;background:transparent;color:#757575!important;font:16px/24px Tahoma,Verdana,sans-serif;box-shadow:none}
#wine-library-map .leaflet-popup-close-button{top:0;right:0;width:24px;height:24px;border-radius:0;background:transparent;color:#757575!important;font:16px/24px Tahoma,Verdana,sans-serif;box-shadow:none}
.wine-detail-dialog .detail-archived{display:inline-flex;align-items:center;margin-left:5px;padding:3px 7px;border-radius:999px;background:#8a3240;color:#fff!important;font-size:10px;font-weight:800;letter-spacing:.05em;line-height:1.3;vertical-align:3px}
.wine-archived-row .wine-verified-dot{display:none}.wine-archived-row .wine-title-tail::after{content:'Удалено';display:inline-flex;align-items:center;margin-left:4px;padding:2px 6px;border-radius:999px;background:#8a3240;color:#fff!important;font-size:9px;font-weight:800;letter-spacing:.04em;line-height:1.35;vertical-align:2px}

/* The close control is not actionable while the wine wizard is loading. */
.wine-wizard-loading-card header>span{display:none!important}

.detail-map-caption [data-detail-map-note]{font-size:12px;line-height:1.4;color:#61726a}
.detail-map-caption [data-detail-map-note][hidden]{display:none}
/* One bounded scroll surface, including incomplete AI cards in mobile Safari. */
.wine-detail-dialog>article{display:grid!important;grid-template-rows:auto minmax(0,1fr)!important}
.wine-detail-dialog>article.wine-detail-loading-card{grid-template-rows:minmax(0,1fr)!important}
.wine-detail-dialog>article>.detail-scroll{height:auto!important;overflow-y:auto!important;overflow-x:hidden;min-height:0!important}
.wine-detail-dialog .detail-terroir-map{touch-action:none!important}
.wine-sort-caption{display:flex;align-items:center;gap:4px}
.wine-sort-caption .wine-reset{margin-left:auto;padding:4px 0 4px 12px;background:transparent;color:#8b8b91;font-size:12px;font-weight:400;border:0;border-radius:0}
.wine-sort-dialog{max-height:calc(100svh - 28px);overflow:hidden}
.wine-sort-dialog[open]{display:flex;flex-direction:column}
.wine-sort-dialog .wine-picker-head{flex:none}
.wine-sort-scroll{overflow-y:auto;min-height:0;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.wine-filter-form{margin:0 16px 18px;padding:10px 16px;border:1px solid #405148;border-radius:18px;background:#ffffff05}
.wine-filter-form h3{font-size:12px;color:#a8b4ad;margin:12px 0 5px;font-weight:600}
.wine-filter-options{display:flex;flex-wrap:wrap;gap:0 16px}
.wine-filter-check{display:inline-flex;align-items:center;gap:7px;min-height:36px;font-size:14px;cursor:pointer;white-space:nowrap}
.wine-filter-check input{width:18px;height:18px;flex:none;padding:0;accent-color:#8cab96;cursor:pointer}
.wine-sort-dialog .wine-picker-title,.wine-lock-dialog .wine-picker-title{align-items:flex-start;gap:16px}
.wine-sort-dialog .wine-picker-title h2,.wine-lock-dialog .wine-picker-title h2{min-width:0;margin:7px 0;line-height:1.2}
.wine-picker-title .wine-picker-close{flex:none}

.wine-detail-dialog{position:fixed!important;inset-inline:0!important;top:calc(var(--wine-viewport-top,0px) + 8px)!important;bottom:auto!important;margin:0 auto!important;height:calc(var(--wine-viewport-height,100dvh) - 16px - env(safe-area-inset-bottom,0px))!important;max-height:calc(var(--wine-viewport-height,100dvh) - 16px - env(safe-area-inset-bottom,0px))!important}
.wine-detail-dialog .detail-edit.wine-edit-locked{background:#ededf0!important;color:#999!important;opacity:.65}
.wine-collected-tools{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.wine-collected-tools details{min-width:0;flex:1}.wine-collected-tools details>summary{box-sizing:border-box;display:flex;align-items:center;min-height:28px}
.wine-collected-empty{flex:1;min-width:0}
.wine-collected-tools [data-wine-magic]{box-sizing:border-box;display:grid;place-items:center;flex:0 0 28px;width:28px;height:44px;min-height:44px;margin:0;padding:0;border:0;background:transparent;color:#8b8b91!important;border-radius:14px;opacity:.68;cursor:pointer;position:relative;transform:none}
.wine-collected-tools [data-wine-magic] svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.wine-collected-tools [data-wine-magic]:hover{opacity:.9;background:#f1f2f2}.wine-collected-tools [data-wine-magic]:focus-visible{outline:0;box-shadow:0 0 0 2px #d9dedb}.wine-collected-tools [data-wine-magic][data-magic-busy="true"]{opacity:.4}
.wine-collected-tools [data-wine-magic]:disabled{opacity:.35;cursor:default}
[data-magic-status]{font-size:12px;color:#777!important}
[data-magic-status]:empty{display:none}
.wine-lock-body{padding:0 22px 24px;line-height:1.5}
.wine-lock-archive{background:transparent;color:#aeb6b1;font-size:13px;border:1px solid #405148}
.wine-detail-dialog .detail-terroir-map:focus,.wine-detail-dialog .detail-terroir-map:focus-visible,.wine-detail-dialog .detail-terroir-map canvas:focus{outline:none!important;box-shadow:none!important}
.wine-detail-dialog .leaflet-popup-content{font-size:12px;line-height:1.35;margin:12px 20px 12px 12px}
.wine-detail-dialog .leaflet-popup-scrolled{border:0}

.wine-lock-body .wine-permanent-delete{display:block;min-height:30px;margin-top:22px;padding:4px 0;border:0;border-bottom:1px dashed currentColor;border-radius:0;background:transparent;color:#9a777c;font-size:12px;font-weight:400;cursor:pointer}.wine-permanent-delete:disabled{opacity:.5;cursor:not-allowed}.wine-delete-note{display:block;margin-top:10px;color:#999;font-size:11px}.wine-delete-confirm-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}.wine-delete-confirm-actions [data-confirm]{background:#8a3240;color:#fff}.wine-delete-confirm-actions [data-cancel]{background:#e8ebe8;color:#315b49}

.wine-personal-meta .wine-status-icon{order:2;flex:0 0 32px;display:inline-grid;place-items:center;width:32px;height:32px;min-height:32px;padding:5px;border:0;border-radius:10px;background:#f3e7ea;color:#84364b}.wine-personal-meta .wine-status-cellar{background:#e5eee8;color:#315b49}.wine-personal-meta .wine-status-wanted{background:#f3ead8;color:#95733c}.wine-status-tooltip{position:fixed;z-index:2147483647;max-width:220px;padding:7px 10px;border-radius:9px;background:#243a30;color:#fff;font-size:12px;line-height:1.3;box-shadow:0 3px 12px #0002;pointer-events:none}.wine-archived-row .wine-status-icon,.collection-used-row .wine-status-icon{opacity:.74}

/* A quiet mini circle touching the marker rim, clear of the wine code. */
.wine-number-marker .wine-marker-overlap-count{position:absolute;left:calc(100% - 15px);top:-3px;box-sizing:border-box;min-width:18px;height:18px;padding:0 1px;display:grid;place-items:center;border:1px solid #fff;border-radius:999px;background:#edf1eb;color:#43564b;font:650 10px/1 system-ui,sans-serif;font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none;text-shadow:none;box-shadow:0 1px 3px #263c3026}

@media(max-width:360px){.wine-collected-tools [data-wine-magic]{transform:translateY(7px)}}
/* release-gate: 320px magic alignment verified separately from the default layout */
