/* ---------- Language switcher ---------- */
.wvt-switcher{position:relative;display:inline-block;max-width:100%;font-size:clamp(12px,3.6vw,14px);line-height:1.3;z-index:99998}
.wvt-switcher,.wvt-switcher *{box-sizing:border-box}
.wvt-switcher summary{list-style:none;display:grid;grid-template-columns:minmax(0,1fr);align-items:center;position:relative;margin:0;padding:7px 28px 7px 10px;border:1px solid #d7dce2;border-radius:7px;background:#fff;color:#172033;cursor:pointer;user-select:none}
.wvt-label,.wvt-sizer{grid-area:1/1;min-width:0}
.wvt-label{display:flex;align-items:center;gap:8px}
.wvt-sizer{display:flex;flex-direction:column;height:0;overflow:hidden;visibility:hidden;pointer-events:none}
.wvt-sz{display:flex;align-items:center;gap:8px;white-space:nowrap}
.wvt-flag-sp{display:inline-block;width:20px;flex:none}
.wvt-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wvt-switcher summary::-webkit-details-marker{display:none}
.wvt-switcher summary::marker{content:""}
.wvt-switcher summary::after{content:"";position:absolute;right:11px;top:50%;width:6px;height:6px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:translateY(-70%) rotate(45deg)}
.wvt-switcher[open] summary::after{transform:translateY(-30%) rotate(-135deg)}
.wvt-list{position:absolute;left:0;right:0;top:calc(100% + 4px);margin:0;padding:4px;list-style:none;background:#fff;border:1px solid #d7dce2;border-radius:8px;box-shadow:0 8px 24px #0002;z-index:99999;max-height:60vh;overflow-y:auto;overflow-x:hidden}
.wvt-list li{margin:0;padding:0;list-style:none;display:block}
.wvt-list a{display:flex;align-items:center;gap:8px;min-width:0;padding:7px 10px;border-radius:5px;color:#172033;text-decoration:none;white-space:nowrap;font-weight:400}
.wvt-list a:hover,.wvt-list li.is-current a{background:#eef2ff;color:#172033}
.wvt-flag{width:20px;height:15px;object-fit:cover;border-radius:2px;box-shadow:0 0 0 1px rgba(0,0,0,.15);flex:none;display:inline-block}
/* Floating: never wider than the screen minus its own offset, dropdown always the same width and scrollable. */
.wvt-switcher-floating{position:fixed;z-index:99998;max-width:calc(100vw - var(--wvt-x,18px) - 8px)}
.wvt-switcher-floating .wvt-switcher{display:block}
.wvt-switcher-floating.wvt-v-bottom .wvt-list{top:auto;bottom:calc(100% + 4px);max-height:calc(100vh - var(--wvt-y,18px) - 70px);max-height:calc(100dvh - var(--wvt-y,18px) - 70px)}
.wvt-switcher-floating.wvt-v-top .wvt-list{top:calc(100% + 4px);bottom:auto;max-height:calc(100vh - var(--wvt-y,18px) - 70px);max-height:calc(100dvh - var(--wvt-y,18px) - 70px)}
.menu-item-wvt-switcher{display:flex;align-items:center;list-style:none}
.menu-item-wvt-switcher .wvt-switcher{margin:0 8px}

/* ---------- Editor ---------- */
.wvt-toggle{position:fixed;right:18px;bottom:18px;z-index:999999;background:#1d4ed8;color:#fff;border:0;border-radius:9px;padding:12px 16px;font-weight:700;box-shadow:0 5px 20px #0002;cursor:pointer}
.wvt-toggle.active{background:#15803d}
.wvt-editing .wvt-hover{outline:2px dashed #2563eb!important;outline-offset:2px;cursor:crosshair!important}
.wvt-editing img{outline:2px dashed #93c5fd;outline-offset:-2px;cursor:crosshair}
.wvt-editing [data-wvt-ui] img{outline:none;cursor:auto}
.wvt-media-open .wvt-toggle,.wvt-media-open .wvt-panel{display:none!important}

.wvt-panel{display:none;position:fixed;right:18px;bottom:76px;width:min(400px,calc(100vw - 36px));max-height:78vh;overflow:auto;background:#fff;color:#172033;z-index:1000000;border:1px solid #d8dee8;border-radius:12px;box-shadow:0 12px 45px #0003;font:14px/1.5 system-ui,sans-serif;text-align:left}
.wvt-panel.is-open{display:block}
.wvt-panel *{box-sizing:border-box}
.wvt-panel-head{display:flex;gap:10px;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #e5e7eb}
.wvt-head-lang{display:flex;align-items:center;gap:4px;font-size:12px;color:#475569;margin-left:auto}
.wvt-lang-select{padding:4px 6px;border:1px solid #cbd5e1;border-radius:6px;font:inherit;background:#fff;color:#172033}
.wvt-close{font-size:24px;line-height:1;background:none;border:0;cursor:pointer;color:#172033}
.wvt-panel-body{padding:16px;display:grid;gap:9px}
.wvt-panel-body h3{margin:0 0 4px;font-size:18px;color:#172033}
.wvt-panel-body label{font-weight:650;margin-top:4px;color:#172033}
.wvt-panel-body .wvt-check{font-weight:400;display:flex;gap:6px;align-items:flex-start}
.wvt-original{padding:10px;background:#f3f4f6;border-radius:7px;max-height:110px;overflow:auto;overflow-wrap:anywhere}
.wvt-panel-body textarea,.wvt-panel-body input[type=text],.wvt-panel-body input[type=url]{width:100%;padding:10px;border:1px solid #cbd5e1;border-radius:7px;font:inherit;color:#172033;background:#fff}
.wvt-panel-body textarea{min-height:115px}
.wvt-preview{max-width:100%;max-height:140px;object-fit:contain}
.wvt-actions{display:flex;gap:8px;margin-top:8px}
.wvt-actions button,.wvt-media{padding:10px 14px;border:0;border-radius:7px;cursor:pointer;font-weight:650;font-family:inherit}
.wvt-actions button:disabled{opacity:.6;cursor:wait}
.wvt-save{background:#1d4ed8;color:#fff}
.wvt-reset{background:#fee2e2;color:#991b1b}
.wvt-cancel,.wvt-media{background:#e5e7eb;color:#111827}
.wvt-suggest{padding:8px 10px;background:#eff6ff;border:1px solid #bfdbfe;border-radius:7px;font-size:13px;color:#172033;overflow-wrap:anywhere}
.wvt-use{display:block;margin-top:6px;padding:6px 10px;border:0;border-radius:6px;background:#1d4ed8;color:#fff;font:inherit;font-weight:650;cursor:pointer}
.wvt-view{font-size:13px;color:#1d4ed8;text-decoration:none}
.wvt-toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%) translateY(10px);opacity:0;pointer-events:none;background:#172033;color:#fff;padding:10px 16px;border-radius:8px;z-index:1000001;font:14px/1.4 system-ui,sans-serif;transition:.2s}
.wvt-toast.is-visible{opacity:1;transform:translateX(-50%)}
.wvt-toast.is-error{background:#b91c1c}

@media(max-width:600px){
  .wvt-toggle{right:10px;bottom:10px}
  .wvt-panel{right:10px;bottom:65px;width:calc(100vw - 20px)}
}
