.wg-root { --wg-ink: #122d3a; --wg-green: #245746; --wg-rule: #dcdace; --wg-muted: #4f605e; color: var(--wg-ink); }
.wg-root [hidden] { display: none !important; }
.wg-root button, .wg-root select, .wg-root input, .wg-root textarea { font-family: inherit; }
.wg-root :is(button,a,input,textarea,select):focus-visible { outline: 3px solid #976b27; outline-offset: 3px; }
.wg-trigger {
  position: fixed; z-index: 8;
  right: max(clamp(6px,calc((100vw - 1376px)/2 + 3px),20px),env(safe-area-inset-right));
  bottom: max(20px,env(safe-area-inset-bottom));
  display: grid; width: 46px; height: 46px; padding: 0; place-items: center;
  border: 1px solid #ffffff90; border-radius: 50%; color: #fff; background: var(--wg-green);
  box-shadow: 0 3px 16px #132c3640;
}
.wg-trigger:hover, .wg-main-btn:hover { background: #153d30; }
.wg-trigger img { display: block; width: 28px; height: 28px; }
.wg-dialog {
  position: fixed; inset: auto 0 0 auto; margin: 0 max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) 0;
  width: min(450px,calc(100vw - 32px)); max-width: none;
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain;
  padding: 0; border: 1px solid #d1d4c8; border-radius: 22px 22px 22px 6px;
  background: #fffefb; color: var(--wg-ink); box-shadow: 0 20px 85px #09202c38;
  font: 400 16px/1.48 var(--sans,Arial,sans-serif);
}
.wg-dialog::backdrop { background: #122d3a64; }
.wg-mast {
  display: grid; grid-template-columns: 62px minmax(0,1fr) 40px; align-items: center; gap: 13px; padding: 21px 24px;
  background-color: #173b39; color: #fffdf7;
}
.wg-mast img { display: block; width: 62px; height: 62px; border: 2px solid #d9bd7c; border-radius: 50%; object-fit: cover; object-position: 50% 18%; }
.wg-mast h2 { margin: 0 0 3px; color: inherit; font: 500 29px/1.08 var(--serif,Georgia,serif); letter-spacing: -.04em; }
.wg-mast p { margin: 0; color: #dce7df; font-size: 13px; }
.wg-close {
  align-self: start; width: 40px; height: 40px; display: grid; place-items: center;
  color: #fff; background: transparent; border: 1px solid #98aca1; border-radius: 50%;
}
.wg-close:hover { background: #ffffff18; }
.wg-close svg { width: 19px; height: 19px; }
.wg-content { padding: 8px 24px 17px; }
.wg-progress ol { list-style: none; display: grid; grid-template-columns: 1fr 1fr 1.3fr 1fr; margin: 0 0 19px; padding: 0; }
.wg-progress li { margin: 0; padding: 0; min-width: 0; }
.wg-progress button {
  display: block; width: 100%; min-height: 39px; padding: 5px 1px; font-size: 12px; font-weight: 500;
  border: 0; border-bottom: 2px solid var(--wg-rule); border-radius: 0; color: var(--wg-ink); background: transparent;
}
.wg-progress button[aria-current=step] { border-color: #a27b37; color: #6f501e; font-weight: 700; }
.wg-progress button:disabled { color: #626b67; cursor: default; opacity: 1; }
.wg-step { margin: 0; padding: 0; border: 0; }
.wg-step h3 { color: var(--wg-ink); margin: 0 0 7px; font: 500 clamp(25px,2.25vw,30px)/1.13 var(--serif,Georgia,serif); letter-spacing: -.035em; }
.wg-step > p,.wg-conflict p { margin: 5px 0 14px; color: var(--wg-muted); font-size: 14px; line-height: 1.45; }
.wg-step > .wg-reply {
  width:fit-content; max-width:100%; margin:0 0 12px auto; padding:6px 10px;
  border-radius:12px 12px 2px 12px; background:#e7eee3; color:#315246; font-size:13px;
}
.wg-step > .wg-reply:empty { display:none; }
.wg-dialog :is(h2,h3)[tabindex]:focus-visible { outline:0; text-decoration:underline; text-decoration-color:#c2a56b; text-decoration-thickness:1px; text-underline-offset:4px; }
.wg-choices { display: grid; gap: 6px; min-width: 0; border: 0; margin: 12px 0 0; padding: 0; }
.wg-choices legend,.wg-field { color: var(--wg-ink); font-weight: 600; font-size: 14px; }
.wg-choices legend { margin: 0 0 9px; padding: 0; }
.wg-option {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 42px;
  border: 1px solid #c9cec2; border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1.33;
}
.wg-option:hover { background: #f3f5ed; }
.wg-option:has(input:checked) { background: #e8efe5; border-color: #527865; color: #174332; }
.wg-option input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; accent-color: var(--wg-green); }
.wg-field { display: block; margin: 13px 0 4px; }
.wg-field small { color: var(--wg-muted); font-size: 13px; font-weight: 400; }
.wg-step :is(select,input[type=text],input[type=date],textarea) {
  display: block; width: 100%; min-width: 0; min-height: 42px; padding: 8px 10px;
  color: var(--wg-ink); background: #fff; border: 1px solid #84968e; border-radius: 5px;
  font-size: 16px; line-height: 1.4;
}
.wg-step textarea { resize: vertical; min-height: 150px; }
.wg-step .wg-transfer { margin: 7px 0; font-size: 13px; }
.wg-conflict,.wg-error { margin: 10px 0; padding: 10px; border-left: 3px solid #ab7d34; background: #f8f1df; font-size: 14px; }
.wg-conflict p { margin: 0; }
.wg-conflict button { display: block; }
.wg-error { border-color: #9e3e3b; color: #832324; background: #fbede8; }
.wg-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 17px; }
.wg-main-btn {
  display: inline-flex; margin-left: auto; align-items: center; justify-content: center; gap: 9px;
  padding: 10px 17px; min-height: 45px; color: #fff; background: var(--wg-green); border: 0; border-radius: 7px; font-weight: 600;
}
.wg-main-btn svg { width: 17px; height: 17px; }
.wg-text-btn, .wg-tools > a {
  appearance: none; padding: 4px 0; background: transparent; border: 0; color: #385349; font-size: 14px;
  font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
}
.wg-text-btn { min-height: 36px; }
.wg-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--wg-rule); }
.wg-tools > a { margin-left: auto; }
.wg-tools > * { font-size: 13px; }
.wg-sr { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media(max-width: 980px) {
  .wg-trigger { right: calc(12px + env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); width: 50px; height: 50px; }
  .wg-dialog { inset: 0; margin: auto; width: min(440px,calc(100vw - 22px)); max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); border-radius: 18px; text-align:center; }
  .wg-mast { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 40px; }
  .wg-mast img { width: 48px; height: 48px; }
  .wg-mast h2 { font-size: 26px; }
  .wg-close { position: absolute; top: 10px; right: 10px; }
  .wg-content { padding-inline: clamp(13px,4vw,23px); }
  .wg-choices legend { width: 100%; }
  .wg-step > .wg-reply { margin-inline:auto; }
  .wg-option { position:relative; justify-content:center; padding-inline:30px; }
  .wg-option input { position:absolute; left:10px; }
  .wg-step :is(select,input[type=text],input[type=date],textarea) { text-align:center; text-align-last:center; }
  .wg-actions,.wg-tools { justify-content:center; }
  .wg-actions .wg-main-btn,.wg-tools>a { margin-inline:0; }
  .wg-actions { gap:16px; }
  .wg-conflict button { margin-inline:auto; }
}
@media(max-height: 540px) {
  .wg-dialog { max-height: calc(100dvh - 12px); margin-block: 6px; }
  .wg-mast { display: block; position: relative; padding: 9px 54px; text-align:center; }
  .wg-mast img { display: none; }
  .wg-close { position: absolute; top: 6px; right: 8px; }
  .wg-mast h2 { font-size: 22px; }
  .wg-content { padding-bottom: 10px; }
  .wg-progress ol { margin-bottom: 9px; }
}
@media(prefers-reduced-motion: reduce) {
  .wg-root * { animation: none!important; transition:none!important; scroll-behavior:auto!important; }
}
