.wmc-root {
  --wmc-bg: #ffffff;
  --wmc-text: #23302b;
  --wmc-primary: #3d5a4a;
  --wmc-primary-text: #ffffff;
  --wmc-line: color-mix(in srgb, var(--wmc-text) 15%, transparent);
  --wmc-switch-off: color-mix(in srgb, var(--wmc-text) 45%, var(--wmc-bg));
  box-sizing: border-box;
  color: var(--wmc-text);
  font-size: 15px;
  line-height: 1.5;
}
.wmc-root *,
.wmc-root *::before,
.wmc-root *::after { box-sizing: inherit; }
.wmc-root[hidden] { display: none !important; }

.wmc-root .wmc-box {
  position: relative;
  background: var(--wmc-bg);
  color: var(--wmc-text);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.18);
}

.wmc-root.wmc-banner { position: fixed; z-index: 2147483000; }
.wmc-root.wmc-banner--a { left: 16px; bottom: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: min(420px, calc(100vw - 32px)); }
.wmc-root.wmc-banner--b { left: 0; right: 0; bottom: 0; }
.wmc-root.wmc-banner--b .wmc-box {
  border-radius: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title actions" "text actions" "text link";
  align-items: center;
  column-gap: 24px;
  row-gap: 4px;
  padding: 18px 56px calc(18px + env(safe-area-inset-bottom)) 24px;
}
.wmc-root.wmc-banner--b .wmc-title { grid-area: title; margin: 0; align-self: end; }
.wmc-root.wmc-banner--b .wmc-text { grid-area: text; margin: 0; align-self: start; max-width: 80ch; }
.wmc-root.wmc-banner--b .wmc-actions { grid-area: actions; margin: 0; min-width: 320px; }
.wmc-root.wmc-banner--b .wmc-link { grid-area: link; margin: 0; justify-self: center; }
.wmc-root.wmc-banner--c {
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(20 28 24 / 0.45);
}
.wmc-root.wmc-banner .wmc-box { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
.wmc-root.wmc-banner--c .wmc-box { width: min(480px, 100%); }

.wmc-root.wmc-prefs {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(20 28 24 / 0.45);
}
.wmc-root.wmc-prefs .wmc-box { width: min(560px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; }

.wmc-root .wmc-title { margin: 0 32px 6px 0; font-size: 18px; font-weight: 600; }
.wmc-root .wmc-text { margin: 0; font-size: 14px; }
.wmc-root .wmc-text a,
.wmc-root .wmc-service a { color: var(--wmc-primary); text-decoration: underline; text-underline-offset: 3px; }

.wmc-root .wmc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.wmc-root .wmc-actions--prefs { grid-template-columns: 1fr 1fr 1fr; }
.wmc-root .wmc-btn {
  min-height: 44px;
  padding: 11px 16px;
  border: 1.5px solid var(--wmc-primary);
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  min-width: 0;
  width: auto;
  text-transform: none;
  letter-spacing: normal;
  text-decoration: none;
  box-shadow: none;
  text-shadow: none;
  cursor: pointer;
}
.wmc-root .wmc-btn--choice { background: var(--wmc-primary); color: var(--wmc-primary-text); }
.wmc-root .wmc-btn--line { background: transparent; color: var(--wmc-primary); }
.wmc-root .wmc-btn--choice:hover,
.wmc-root .wmc-btn--choice:active { background: var(--wmc-primary); color: var(--wmc-primary-text); filter: brightness(.92); }
.wmc-root .wmc-btn--line:hover,
.wmc-root .wmc-btn--line:active { background: var(--wmc-line); color: var(--wmc-primary); filter: brightness(.92); }
.wmc-root .wmc-link {
  display: block;
  margin: 6px auto 0;
  padding: 6px;
  border: 0;
  background: none;
  color: var(--wmc-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  min-width: 0;
  width: auto;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
  text-shadow: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.wmc-root .wmc-link:hover,
.wmc-root .wmc-link:active { background: none; color: var(--wmc-primary); filter: brightness(.92); text-decoration: underline; }
.wmc-root .wmc-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  padding: 0;
  margin: 0;
  min-width: 0;
  display: grid;
  place-items: center;
  box-shadow: none;
  text-shadow: none;
  cursor: pointer;
}
.wmc-root .wmc-close:hover { background: var(--wmc-line); }
.wmc-root .wmc-btn:focus-visible,
.wmc-root .wmc-link:focus-visible,
.wmc-root .wmc-close:focus-visible,
.wmc-root .wmc-switch:focus-visible { outline: 2px solid var(--wmc-primary); outline-offset: 2px; }

.wmc-root .wmc-cat { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--wmc-line); border-radius: 14px; }
.wmc-root .wmc-cat__head { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.wmc-root .wmc-cat__name,
.wmc-root .wmc-cat__head label { flex: 1; }
.wmc-root .wmc-cat__head label { cursor: pointer; }
.wmc-root .wmc-cat__always { font-size: 13px; font-weight: 400; opacity: 0.75; }
.wmc-root .wmc-cat__desc { margin: 4px 0 0; font-size: 13px; opacity: 0.8; }
.wmc-root .wmc-services { margin: 8px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--wmc-line); list-style: none; }
.wmc-root .wmc-service { display: flex; align-items: center; gap: 12px; padding: 4px 0; font-size: 14px; }
.wmc-root .wmc-service > span:first-child { flex: 1; min-width: 0; }
.wmc-root .wmc-service__name { display: block; font-weight: 600; cursor: pointer; }
.wmc-root .wmc-service__purpose { display: block; opacity: 0.8; }
.wmc-root .wmc-service a { display: inline-block; margin-top: 2px; font-size: 12px; }

.wmc-root .wmc-switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  min-width: 40px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--wmc-switch-off);
  cursor: pointer;
  transition: background 0.15s;
}
.wmc-root .wmc-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.3);
  transition: left 0.15s;
}
.wmc-root .wmc-switch:checked { background: var(--wmc-primary); }
.wmc-root .wmc-switch:checked::after { left: 21px; }
.wmc-root .wmc-switch:indeterminate { background: color-mix(in srgb, var(--wmc-primary) 50%, var(--wmc-switch-off)); }
.wmc-root .wmc-switch:indeterminate::after { left: 12px; }

.wmc-root .wmc-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--wmc-line);
  font-size: 12px;
  opacity: 0.75;
}

@media (max-width: 600px) {
  .wmc-root .wmc-actions--prefs { grid-template-columns: 1fr; }
  .wmc-root.wmc-banner--b .wmc-box { padding: 16px 48px calc(16px + env(safe-area-inset-bottom)) 16px; }
}
@media (max-width: 900px) {
  .wmc-root.wmc-banner--b .wmc-box { grid-template-columns: 1fr; grid-template-areas: "title" "text" "actions" "link"; row-gap: 8px; }
  .wmc-root.wmc-banner--b .wmc-actions { min-width: 0; margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .wmc-root .wmc-switch,
  .wmc-root .wmc-switch::after { transition: none; }
}
@supports not (color: color-mix(in srgb, red, blue)) {
  .wmc-root { --wmc-line: rgb(0 0 0 / .15); --wmc-switch-off: rgb(0 0 0 / .45); }
  .wmc-root .wmc-switch:indeterminate { background: var(--wmc-primary); opacity: .6; }
}

.wmc-root.wmc-embed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 160px;
  padding: 20px;
  border: 1px solid var(--wmc-line);
  border-radius: 14px;
  background: var(--wmc-bg);
  text-align: center;
  overflow: auto;
}
.wmc-root .wmc-embed__name { margin: 0; font-size: 16px; font-weight: 600; }
.wmc-root .wmc-embed__text { margin: 0; max-width: 46ch; font-size: 14px; }
.wmc-root .wmc-embed__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; margin-top: 4px; }
.wmc-root .wmc-embed__actions a { color: var(--wmc-primary); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.wmc-root .wmc-embed__actions a:focus-visible { outline: 2px solid var(--wmc-primary); outline-offset: 2px; }

.wmc-root.wmc-preview-notice {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2147483002;
  padding: 6px 14px;
  border-radius: 999px;
  background: #1d2327;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}
