:root {
  --ui-ink: #0f2a43;
  --ui-line: #b7c8da;
  --ui-focus: #1d6fe8;
  --ui-bg: #fff;
  --ui-placeholder: #8aa0b5;
}

.ui-btn {
  --btn-default-bg: #a8ff00;
  --btn-padding: 15px 20px;
  --btn-hover-bg: #0b1400;
  --btn-transition: .3s;
  --btn-letter-spacing: .1rem;
  --btn-animation-duration: 1.2s;
  --btn-shadow: none;
  --btn-hover-shadow: none;
  --hover-btn-color: #a8ff00;
  --default-btn-color: #0b1400;
  --font-size: 16px;
  --font-weight: 700;
  --font-family: WD,sans-serif;
}

.ui-btn {
  box-sizing: border-box;
  padding: var(--btn-padding);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--default-btn-color);
  font: var(--font-weight) var(--font-size) var(--font-family);
  background: var(--btn-default-bg);
  border: none;
  cursor: pointer;
  transition: var(--btn-transition);
  overflow: hidden;
  box-shadow: var(--btn-shadow);
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.ui-btn span {
  letter-spacing: var(--btn-letter-spacing);
  transition: var(--btn-transition);
  box-sizing: border-box;
  position: relative;
  background: inherit;
}

.ui-btn span::before {
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  right: auto;
  height: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  content: "";
  background: inherit;
}

.ui-btn:hover, .ui-btn:focus {
  background: var(--btn-hover-bg);
  box-shadow: var(--btn-hover-shadow);
}

.ui-btn:hover span, .ui-btn:focus span {
  color: var(--hover-btn-color);
}

.ui-btn:hover span::before, .ui-btn:focus span::before, .ui-btn.is-play span::before {
  animation: chitchat linear both var(--btn-animation-duration);
}

.ui-btn:focus-visible {
  outline: 3px solid var(--ui-focus);
  outline-offset: 3px;
}

.ui-btn:disabled {
  opacity: .7;
  cursor: progress;
}

.ui-btn--block {
  width: 100%;
}

.ui-btn--sm {
  --btn-padding: 10px 16px;
  --font-size: 14px;
}

.ui-btn--ghost {
  --btn-default-bg: #fff;
  --btn-hover-bg: #eef5fd;
  --default-btn-color: #0f2a43;
  --hover-btn-color: #0f2a43;
  --btn-shadow: none;
  --btn-hover-shadow: none;
  border: 1px solid #c9dbec;
}

@keyframes chitchat {
  0% { content: "0"; }
  5% { content: "-@"; }
  10% { content: "1.^>"; }
  15% { content: "={+,.%"; }
  20% { content: "$.^}}^_^="; }
  25% { content: "}.>,{_11,.,,"; }
  30% { content: "@._.='-:}-={,:="; }
  35% { content: ">]!{,,1$+{=|^,.;$4"; }
  40% { content: "]=}[0?,?+:_<!|[_^,:%4"; }
  45% { content: "20f?:;^{%}![0-4}.]^[=,<2"; }
  50% { content: ">00|+;4,<?^>^№4|]^.f|:1,"; }
  55% { content: "]>?:|@2]+#?+!;{4.$[:-f_@"; }
  60% { content: "@'4^!?@=№2->}'=№|}+]2@_-"; left: auto; right: 0; }
  65% { content: "^!-_]_#4>,!№:#-}=+;,"; left: auto; right: 0; }
  70% { content: "0-|'%;1]f.?2'[']"; left: auto; right: 0; }
  75% { content: "<=@@@@{41@.$"; left: auto; right: 0; }
  80% { content: "^$?!{0;.{"; left: auto; right: 0; }
  85% { content: "#,-={+"; left: auto; right: 0; }
  90% { content: ";#^'"; left: auto; right: 0; }
  95% { content: "$;"; left: auto; right: 0; }
  100% { content: ""; left: auto; right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ui-btn:hover span::before, .ui-btn:focus span::before, .ui-btn.is-play span::before { animation: none; }
}

input[type=text],
input[type=password],
input[type=email],
input[type=search],
input[type=url],
input[type=tel],
input[type=number],
input[type=datetime-local],
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 12px 0 10px;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ui-ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--ui-line);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s, box-shadow .2s;
}

textarea {
  resize: none;
  overflow: hidden;
  min-height: 48px;
}

input[type=text]:focus,
input[type=password]:focus,
input[type=email]:focus,
input[type=search]:focus,
input[type=url]:focus,
input[type=tel]:focus,
input[type=number]:focus,
input[type=datetime-local]:focus,
textarea:focus {
  outline: 0;
  border-bottom-color: var(--ui-focus);
  box-shadow: 0 1px 0 0 var(--ui-focus);
}

input::placeholder,
textarea::placeholder {
  color: var(--ui-placeholder);
  opacity: 1;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ui-ink);
  -webkit-box-shadow: 0 0 0 1000px var(--ui-bg) inset;
  box-shadow: 0 0 0 1000px var(--ui-bg) inset;
  caret-color: var(--ui-ink);
  font-size: 16px;
  transition: background-color 9999s ease-out 0s;
}

input::-ms-reveal,
input::-ms-clear {
  display: none;
}

input::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
}

.wd-toasts {
  --toast-w: min(calc(100vw - 24px), 420px);
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  left: 0;
  right: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.wd-toast {
  --toast-h: 56px;
  position: relative;
  display: flex;
  align-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .55);
  color: #fff;
  pointer-events: auto;
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow: 0 16px 36px -12px var(--toast-glow), inset 0 1px 0 rgba(255, 255, 255, .6);
  opacity: 0;
  transform: translateY(-90px) scale(.85);
  transition:
    transform .55s cubic-bezier(.34, 1.56, .64, 1),
    opacity .25s ease,
    width .55s cubic-bezier(.22, 1, .36, 1),
    height .35s ease;
}

.wd-toast::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 58%);
}

.wd-toast--success {
  --toast-glow: rgba(16, 160, 92, .6);
  background: linear-gradient(135deg, rgba(18, 164, 96, .93), rgba(8, 110, 66, .9));
}

.wd-toast--error {
  --toast-glow: rgba(220, 50, 60, .6);
  background: linear-gradient(135deg, rgba(236, 74, 74, .94), rgba(165, 26, 40, .92));
}

.wd-toast--alert {
  --toast-glow: rgba(245, 158, 11, .65);
  color: #2b1700;
  background: linear-gradient(135deg, rgba(255, 200, 56, .95), rgba(240, 138, 8, .93));
}

.wd-toast.is-in {
  opacity: 1;
  transform: none;
}

.wd-toast.is-open {
  width: var(--toast-w);
  height: var(--toast-h);
}

.wd-toast.is-out {
  opacity: 0;
  transform: translateY(-70px) scale(.9);
  transition: transform .4s ease, opacity .3s ease;
}

.wd-toast__icon {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
}

.wd-toast__text {
  position: relative;
  flex: none;
  width: calc(var(--toast-w) - 104px);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  opacity: 0;
  transition: opacity .3s ease .2s;
}

.wd-toast.is-open .wd-toast__text {
  opacity: 1;
}

.wd-toast__close {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  margin: 0 8px 0 0;
  display: grid;
  place-items: center;
  padding: 0;
  color: inherit;
  background: rgba(255, 255, 255, .22);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.wd-toast--alert .wd-toast__close {
  background: rgba(43, 23, 0, .12);
}

.wd-toast__close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.wd-nojs {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  width: min(calc(100vw - 24px), 420px);
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 500;
  color: #fff;
  background: #c93030;
}

.wd-nojs--success {
  background: #0d8a4c;
}

.wd-nojs--alert {
  color: #2b1700;
  background: #f5a623;
}

.wd-dialog {
  width: calc(100% - 32px);
  max-width: 360px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  color: #0f2a43;
  background: #fff;
  box-shadow: 0 30px 70px -20px rgba(15, 42, 67, .55);
}

.wd-dialog::backdrop {
  background: rgba(11, 32, 56, .45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.wd-dialog__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 22px 22px;
  text-align: center;
}

.wd-dialog__head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.wd-dialog__icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  color: #b42318;
  line-height: 0;
}

.wd-dialog__title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: #0f2a43;
  letter-spacing: 0;
}

.wd-dialog__text {
  margin: 0 0 22px;
  color: #4d6c88;
}

.wd-dialog__actions {
  display: flex;
  width: 100%;
  gap: 10px;
}

.wd-dialog__actions .ui-btn {
  flex: 1;
}

@media (prefers-reduced-motion: reduce) {
  .wd-toast, .wd-toast__text {
    transition: none;
  }
}

body { cursor: default; }
input, textarea { cursor: text; }
button, a, label, select, summary { cursor: pointer; }
h1, h2, h3, p, .brand { -webkit-user-select: none; user-select: none; }
.wd-toast__text, code, .kv dd, .table td { -webkit-user-select: text; user-select: text; }

* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

.ui-btn--danger {
  --btn-default-bg: #b42318;
  --btn-hover-bg: #5c120c;
  --default-btn-color: #fff;
  --hover-btn-color: #fff;
}

.ui-btn[hidden]{display:none}
.btn-row{display:flex;gap:12px;align-items:stretch}
.btn-row .ui-btn{flex:1 1 0;width:auto}
.btn-row .ui-btn[hidden]{display:none}
.btn-row .ui-btn{border:1px solid transparent;justify-content:center;min-height:50px}
.btn-row .ui-btn--ghost{border-color:#c9dbec}
