/* WIGGINS / AI toolkit tool styles. Tokens include fallbacks so the tool
   still looks right if the host page has not defined the variables. */
.wai-tool {
  --navy: #192737;
  --lime: #CEF34A;
  --white: #FAFAF6;
  --sage: #E7EEE5;
  --green: #7DA18E;
  --slate: #64717A;
  --green-text: #1d4d3c;
  --green-bg: #dce8e3;
  --amber-text: #5c3b00;
  --amber-bg: #f3e2b8;
  --red-text: #7a1c1c;
  --red-bg: #f3d6d6;
  box-sizing: border-box;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 0.75rem 2rem;
  color: var(--navy, #192737);
  background: var(--white, #FAFAF6);
  font-family: inherit, Inter, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  overflow-x: hidden;
}

.wai-tool *,
.wai-tool *::before,
.wai-tool *::after {
  box-sizing: border-box;
}

.wai-tool :focus-visible {
  outline: 3px solid var(--navy, #192737);
  outline-offset: 2px;
}

.wai-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wai-title {
  margin: 0 0 0.5rem;
  font-family: inherit, Manrope, Inter, system-ui, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy, #192737);
  overflow-wrap: break-word;
}

.wai-question {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy, #192737);
}

.wai-lede,
.wai-help,
.wai-deeper p,
.wai-note {
  margin: 0 0 0.85rem;
  color: var(--navy, #192737);
}

.wai-help {
  color: var(--navy, #192737);
}

.wai-tool[data-depth="simple"] .wai-d-practical,
.wai-tool[data-depth="simple"] .wai-d-nerd,
.wai-tool[data-depth="practical"] .wai-d-nerd {
  display: none;
}

.wai-deeper {
  margin: 1.5rem 0 0;
  padding: 1rem;
  background: var(--sage, #E7EEE5);
  border-radius: 12px;
}

.wai-deeper h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.wai-tool[data-depth="simple"] .wai-deeper {
  display: none;
}

.wai-form {
  display: grid;
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.wai-dim {
  padding: 1rem 0.85rem;
  border: 1px solid #cfd6d3;
  border-radius: 12px;
  background: #fff;
}

.wai-dim h3,
.wai-card-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--navy, #192737);
}

.wai-fieldset {
  margin: 0 0 0.9rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.wai-fieldset:last-child {
  margin-bottom: 0;
}

.wai-legend {
  display: block;
  float: none;
  width: 100%;
  margin: 0 0 0.5rem;
  padding: 0;
  font-weight: 600;
  color: var(--navy, #192737);
  overflow-wrap: break-word;
}

.wai-scale {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

.wai-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border: 2px solid #c5cdca;
  border-radius: 10px;
  background: var(--white, #FAFAF6);
  color: var(--navy, #192737);
  cursor: pointer;
  font-weight: 500;
}

.wai-option input {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--navy, #192737);
}

.wai-option:has(input:checked) {
  background: var(--sage, #E7EEE5);
  border-color: var(--navy, #192737);
  font-weight: 700;
}

.wai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.25rem 0 0;
}

.wai-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 2px solid var(--navy, #192737);
  font: inherit;
  font-weight: 700;
  color: var(--navy, #192737);
  background: var(--white, #FAFAF6);
  cursor: pointer;
  text-decoration: none;
}

.wai-btn-primary {
  background: var(--lime, #CEF34A);
}

.wai-btn-primary:hover,
.wai-btn:hover {
  filter: brightness(0.97);
}

.wai-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: none;
}

.wai-error {
  margin: 0.5rem 0 0;
  color: var(--red-text, #7a1c1c);
  font-weight: 600;
}

.wai-result {
  margin: 1.5rem 0 0;
  padding: 1rem 0.85rem;
  border-radius: 12px;
  border: 2px solid var(--navy, #192737);
  background: #fff;
}

.wai-result[hidden],
.wai-preview[hidden] {
  display: none;
}

.wai-result h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.wai-light {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.wai-light-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.wai-light-green {
  background: var(--green-bg, #dce8e3);
  color: var(--green-text, #1d4d3c);
}

.wai-light-amber {
  background: var(--amber-bg, #f3e2b8);
  color: var(--amber-text, #5c3b00);
}

.wai-light-red {
  background: var(--red-bg, #f3d6d6);
  color: var(--red-text, #7a1c1c);
}

.wai-scores {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.wai-scores li,
.wai-rank li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #e2e7e4;
  overflow-wrap: break-word;
}

.wai-recs {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.wai-recs li {
  margin: 0 0 0.65rem;
}

.wai-label,
.wai-field label {
  display: block;
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: var(--navy, #192737);
}

.wai-hint {
  display: block;
  margin: -0.15rem 0 0.4rem;
  color: var(--navy, #192737);
  font-size: 0.95rem;
}

.wai-field {
  min-width: 0;
}

.wai-field input,
.wai-field textarea,
.wai-report {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 2px solid #c5cdca;
  border-radius: 10px;
  background: var(--white, #FAFAF6);
  color: var(--navy, #192737);
  font: inherit;
  overflow-x: hidden;
}

.wai-field textarea,
.wai-report {
  min-height: 8rem;
  resize: vertical;
  line-height: 1.45;
}

.wai-report {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.wai-notice {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: var(--sage, #E7EEE5);
  border-left: 4px solid var(--navy, #192737);
  border-radius: 0 10px 10px 0;
  color: var(--navy, #192737);
  font-weight: 700;
}

.wai-notice p {
  margin: 0.4rem 0 0;
  font-weight: 400;
}

.wai-status {
  min-height: 1.4em;
  margin: 0.35rem 0 0;
  font-weight: 600;
  color: var(--navy, #192737);
}

.wai-muted {
  color: var(--navy, #192737);
}

@media (min-width: 640px) {
  .wai-tool {
    padding: 1.25rem 1rem 2.25rem;
  }

  .wai-scale {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .wai-title {
    font-size: 1.75rem;
  }
}

.wai-tool--neutrality .wai-card {
  padding: 1rem 0.85rem;
  border: 1px solid #cfd6d3;
  border-radius: 12px;
  background: #fff;
  min-width: 0;
}

.wai-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.wai-split {
  display: grid;
  gap: 0.85rem;
}

.wai-observed {
  background: var(--sage, #E7EEE5);
  border-radius: 10px;
  padding: 0.75rem;
}

.wai-speculation {
  background: #f3f1ea;
  border-radius: 10px;
  padding: 0.75rem;
  border: 1px dashed var(--slate, #64717A);
}

.wai-speculation .wai-label {
  font-weight: 700;
}

.wai-rank {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.wai-scale-stack .wai-scale {
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 640px) {
  .wai-scale-stack .wai-scale {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
