:root {
  --shwt-blue: #087fc9;
  --shwt-blue-dark: #075b91;
  --shwt-ink: #183044;
  --shwt-muted: #5d6c78;
  --shwt-line: #d7e0e7;
  --shwt-cream: #fffaf0;
  --shwt-green: #2f6f5e;
  --shwt-green-soft: #eaf5f1;
  --shwt-warning: #805b10;
  --shwt-warning-soft: #fff5d9;
}

.shwt-resource {
  color: var(--shwt-ink);
  font-size: 17px;
  line-height: 1.6;
  margin: 2rem auto;
  max-width: 1040px;
}

.shwt-resource *,
.shwt-resource *::before,
.shwt-resource *::after {
  box-sizing: border-box;
}

.shwt-tool-heading {
  margin-bottom: 1.5rem;
  max-width: 760px;
}

.shwt-tool-heading h2 {
  color: var(--shwt-ink);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0.15rem 0 0.65rem;
}

.shwt-eyebrow {
  color: var(--shwt-blue-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  margin: 0;
  text-transform: uppercase;
}

.shwt-rebus-maker,
.shwt-hunt-builder {
  background: #fff;
  border: 1px solid var(--shwt-line);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(24, 48, 68, 0.08);
  padding: clamp(1.1rem, 3vw, 2rem);
}

.shwt-rebus-form,
.shwt-builder-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.shwt-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 160px;
}

.shwt-field-grow {
  flex: 1 1 360px;
}

.shwt-field label {
  color: var(--shwt-ink);
  font-size: 0.95rem;
  font-weight: 750;
}

.shwt-field small,
.shwt-fieldset-help {
  color: var(--shwt-muted);
  font-size: 0.88rem;
}

.shwt-resource input,
.shwt-resource select,
.shwt-resource textarea {
  background: #fff;
  border: 1px solid #aebdc8;
  border-radius: 8px;
  color: var(--shwt-ink);
  font: inherit;
  line-height: 1.4;
  min-height: 46px;
  padding: 0.68rem 0.78rem;
  width: 100%;
}

.shwt-resource textarea {
  resize: vertical;
}

.shwt-resource input:focus,
.shwt-resource select:focus,
.shwt-resource textarea:focus,
.shwt-button:focus-visible {
  outline: 3px solid rgba(8, 127, 201, 0.28);
  outline-offset: 2px;
}

.shwt-button {
  align-items: center;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.98rem;
  font-weight: 750;
  justify-content: center;
  min-height: 46px;
  padding: 0.65rem 1rem;
  text-decoration: none;
}

.shwt-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.shwt-button-primary {
  background: var(--shwt-blue);
  color: #fff;
}

.shwt-button-primary:hover {
  background: var(--shwt-blue-dark);
}

.shwt-button-secondary {
  background: #fff;
  border-color: var(--shwt-blue);
  color: var(--shwt-blue-dark);
}

.shwt-button-secondary:hover {
  background: #eef8fe;
}

.shwt-button-link {
  background: transparent;
  color: #8a2b2b;
  padding-inline: 0.25rem;
}

.shwt-tool-status {
  color: var(--shwt-muted);
  margin-top: 1rem;
  min-height: 1.5rem;
}

.shwt-tool-status.is-error {
  color: #9a2525;
}

.shwt-rebus-result {
  background: linear-gradient(180deg, #fffdf8 0%, #f8f1e5 100%);
  border: 1px solid #e1d4bd;
  border-radius: 16px;
  margin-top: 1.25rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.shwt-rebus-cards {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.shwt-rebus-canvas-scroll {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.shwt-rebus-canvas-scroll:focus-visible {
  outline: 3px solid rgba(8, 127, 201, 0.28);
  outline-offset: 2px;
}

.shwt-rebus-canvas {
  background: #faf7f0;
  border: 1px solid #e1d4bd;
  border-radius: 14px;
  display: block;
  height: auto;
  max-width: none;
}

.shwt-rebus-cards-accessible {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.shwt-rebus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.shwt-rebus-embed-status {
  color: var(--shwt-muted);
  display: block;
  font-size: 0.85rem;
  margin-top: 0.55rem;
}

.shwt-rebus-card {
  align-items: flex-start;
  background: var(--shwt-cream);
  border: 1px solid #e8dac0;
  border-radius: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.85rem;
}

.shwt-rebus-part {
  align-items: center;
  display: flex;
  flex-direction: column;
  min-width: 68px;
}

.shwt-rebus-glyph {
  align-items: center;
  color: var(--shwt-green);
  display: flex;
  font-family: "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", system-ui, sans-serif;
  font-size: 2.4rem;
  font-weight: 750;
  justify-content: center;
  line-height: 1;
  min-height: 60px;
  min-width: 60px;
}

.shwt-rebus-rule {
  color: #5d4930;
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.25;
  min-height: 1.1rem;
  text-align: center;
}

.shwt-privacy-note,
.shwt-test-reminder {
  background: var(--shwt-green-soft);
  border-left: 4px solid var(--shwt-green);
  border-radius: 6px;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1rem;
}

.shwt-builder-form fieldset {
  border: 0;
  border-top: 1px solid var(--shwt-line);
  margin: 2rem 0 0;
  padding: 1.5rem 0 0;
}

.shwt-builder-form legend {
  color: var(--shwt-ink);
  font-size: 1.35rem;
  font-weight: 800;
  padding-right: 0.8rem;
}

.shwt-form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shwt-field-wide {
  grid-column: 1 / -1;
}

.shwt-builder-summary {
  background: #eef8fe;
  border-radius: 8px;
  color: var(--shwt-blue-dark);
  font-size: 0.92rem;
  margin: 0.75rem 0 1rem;
  padding: 0.65rem 0.8rem;
}

.shwt-stop-card {
  background: #f8fafb;
  border: 1px solid var(--shwt-line);
  border-radius: 12px;
  margin-bottom: 1rem;
  padding: 1rem;
}

.shwt-stop-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.shwt-stop-header h3 {
  font-size: 1.1rem;
  margin: 0;
}

.shwt-remove-stop {
  background: transparent;
  border: 0;
  color: #8a2b2b;
  cursor: pointer;
  font-weight: 700;
}

.shwt-export-controls {
  align-items: end;
  display: grid;
  flex: 1 1 100%;
  gap: 0.45rem 0.75rem;
  grid-template-columns: minmax(240px, 1fr) auto;
  margin-top: 0.35rem;
}

.shwt-export-controls label {
  color: var(--shwt-ink);
  font-size: 0.9rem;
  font-weight: 750;
  grid-column: 1 / -1;
}

.shwt-export-controls small {
  color: var(--shwt-muted);
  font-size: 0.8rem;
  grid-column: 1 / -1;
}

.shwt-print-document {
  display: none;
}

.shwt-guide-layout {
  align-items: start;
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  margin-left: auto;
  margin-right: auto;
  max-width: 1240px;
}

.shwt-guide-content {
  min-width: 0;
}

.shwt-guide-content h2,
.shwt-guide-content h3 {
  scroll-margin-top: 2rem;
}

.shwt-guide-content .wp-block-table {
  overflow-x: auto;
}

.shwt-guide-toc-desktop {
  align-self: start;
  background: #f7fafc;
  border: 1px solid var(--shwt-line);
  border-radius: 12px;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding: 1rem 1rem 1.1rem;
  position: sticky;
  top: 1.5rem;
}

.admin-bar .shwt-guide-toc-desktop {
  top: calc(32px + 1.5rem);
}

.shwt-guide-toc-title {
  color: var(--shwt-ink);
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

.shwt-guide-top-link {
  color: var(--shwt-blue-dark);
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 750;
  margin-bottom: 0.9rem;
  text-decoration: none;
}

.shwt-guide-top-link:hover,
.shwt-guide-top-link:focus {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.shwt-guide-toc-list {
  color: var(--shwt-muted);
  font-size: 0.91rem;
  line-height: 1.35;
  margin: 0;
  padding-left: 1.4rem;
}

.shwt-guide-toc-list li + li {
  margin-top: 0.55rem;
}

.shwt-guide-toc-row {
  align-items: flex-start;
  display: flex;
  gap: 0.35rem;
  justify-content: space-between;
}

.shwt-guide-toc-row > a {
  flex: 1 1 auto;
  min-width: 0;
}

.shwt-guide-toc-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--shwt-blue-dark);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 1.55rem;
  font: inherit;
  height: 1.55rem;
  justify-content: center;
  margin: -0.12rem -0.2rem 0 0;
  padding: 0;
}

.shwt-guide-toc-toggle:hover,
.shwt-guide-toc-toggle:focus {
  background: #e7f3fb;
}

.shwt-guide-toc-toggle:focus-visible {
  outline: 2px solid var(--shwt-blue);
  outline-offset: 2px;
}

.shwt-guide-toc-toggle span {
  display: block;
  font-size: 1.05rem;
  line-height: 1;
  transform: rotate(0);
  transition: transform 160ms ease;
}

.shwt-guide-toc-item-has-children.is-expanded .shwt-guide-toc-toggle span {
  transform: rotate(180deg);
}

.shwt-guide-toc-item-has-children.is-active-section > .shwt-guide-toc-row > a {
  color: var(--shwt-blue-dark);
  font-weight: 700;
}

.shwt-guide-toc-sublist {
  border-left: 2px solid #d6e8f3;
  font-size: 0.82rem;
  line-height: 1.28;
  list-style: none;
  margin: 0.45rem 0 0 0.15rem;
  padding: 0 0 0 0.72rem;
}

.shwt-guide-toc-sublist li + li {
  margin-top: 0.3rem;
}

.shwt-guide-toc-list a {
  color: var(--shwt-muted);
  text-decoration: none;
}

.shwt-guide-toc-list a:hover,
.shwt-guide-toc-list a:focus {
  color: var(--shwt-blue-dark);
}

.shwt-guide-toc-list a:focus-visible {
  border-radius: 2px;
  outline: 2px solid var(--shwt-blue);
  outline-offset: 3px;
}

.shwt-guide-toc-list a[aria-current="location"] {
  color: var(--shwt-blue-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.shwt-guide-toc-mobile {
  background: #f7fafc;
  border: 1px solid var(--shwt-line);
  border-radius: 10px;
  display: none;
  margin-bottom: 1.5rem;
  padding: 0.8rem 1rem;
}

.shwt-guide-toc-mobile summary {
  color: var(--shwt-ink);
  cursor: pointer;
  font-weight: 800;
}

.shwt-guide-toc-mobile .shwt-guide-toc {
  margin-top: 0.8rem;
}

.shwt-guide-toc-mobile .shwt-guide-toc-title {
  display: none;
}

.shwt-guide-faq {
  border: 1px solid var(--shwt-line);
  border-bottom: 0;
  border-radius: 10px;
  margin: 1rem 0 2rem;
  overflow: hidden;
}

.shwt-guide-faq-item {
  background: #fff;
  border-bottom: 1px solid var(--shwt-line);
}

.shwt-guide-faq-item summary {
  align-items: center;
  color: var(--shwt-ink);
  cursor: pointer;
  display: flex;
  font-size: 1.05rem;
  font-weight: 750;
  gap: 1rem;
  justify-content: space-between;
  list-style: none;
  padding: 1rem 1.1rem;
}

.shwt-guide-faq-item summary::-webkit-details-marker {
  display: none;
}

.shwt-guide-faq-item summary:hover {
  background: #f7fafc;
  color: var(--shwt-blue-dark);
}

.shwt-guide-faq-item summary:focus-visible {
  outline: 3px solid rgba(8, 127, 201, 0.28);
  outline-offset: -3px;
}

.shwt-guide-faq-icon {
  flex: 0 0 18px;
  height: 18px;
  position: relative;
  width: 18px;
}

.shwt-guide-faq-icon::before,
.shwt-guide-faq-icon::after {
  background: currentColor;
  content: "";
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.shwt-guide-faq-icon::before {
  height: 2px;
  width: 16px;
}

.shwt-guide-faq-icon::after {
  height: 16px;
  transition: transform 160ms ease;
  width: 2px;
}

.shwt-guide-faq-item[open] .shwt-guide-faq-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.shwt-guide-faq-answer {
  color: var(--shwt-muted);
  padding: 0 1.1rem 1.1rem;
}

.shwt-guide-faq-answer > :first-child {
  margin-top: 0;
}

.shwt-guide-faq-answer > :last-child {
  margin-bottom: 0;
}

.shwt-guide-checklist {
  border: 1px solid var(--shwt-line);
  border-radius: 12px;
  margin: 1rem 0 2rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.shwt-checklist-toolbar {
  align-items: center;
  background: #f7fafc;
  border-radius: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.35rem;
  padding: 0.75rem;
}

.shwt-checklist-status {
  color: var(--shwt-muted);
  flex: 1 1 180px;
  font-size: 0.85rem;
}

.shwt-checklist-content h3:first-of-type {
  margin-top: 0;
}

@media (max-width: 680px) {
  .shwt-resource {
    margin: 1.25rem auto;
  }

  .shwt-rebus-maker,
  .shwt-hunt-builder {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  .shwt-rebus-result {
    padding: 0.45rem;
  }

  .shwt-stop-card {
    padding: 0.75rem;
  }

  .shwt-export-controls {
    grid-template-columns: 1fr;
  }

  .shwt-export-controls label,
  .shwt-export-controls small {
    grid-column: auto;
  }

  .shwt-form-grid {
    grid-template-columns: 1fr;
  }

  .shwt-field-wide {
    grid-column: auto;
  }

  .shwt-button,
  .shwt-builder-actions .shwt-button {
    width: 100%;
  }

  .shwt-checklist-toolbar .shwt-button {
    width: 100%;
  }
}

@media (max-width: 959px) {
  .shwt-guide-layout {
    display: block;
  }

  .shwt-guide-toc-desktop {
    display: none;
  }

  .shwt-guide-toc-mobile {
    display: block;
  }
}

@media (max-width: 782px) {
  .admin-bar .shwt-guide-toc-desktop {
    top: calc(46px + 1rem);
  }
}

@media print {
  body.shwt-resource-printing > *:not(.shwt-print-portal) {
    display: none !important;
  }

  body.shwt-resource-printing .shwt-print-portal {
    color: #111;
    display: block !important;
    font-family: Arial, sans-serif;
    font-size: 11pt;
    line-height: 1.45;
    margin: 0;
  }

  .shwt-print-portal h1 {
    font-size: 23pt;
    margin-bottom: 0.2in;
  }

  .shwt-print-portal h2 {
    border-bottom: 1px solid #777;
    font-size: 15pt;
    margin-top: 0.28in;
    padding-bottom: 0.05in;
  }

  .shwt-print-portal .shwt-rebus-canvas-scroll {
    overflow: visible;
  }

  .shwt-print-portal .shwt-rebus-canvas {
    height: auto !important;
    max-width: 100% !important;
    width: auto !important;
  }

  .shwt-print-portal .shwt-rebus-actions,
  .shwt-print-portal .shwt-rebus-embed-status {
    display: none !important;
  }

  .shwt-checklist-print .shwt-checklist-content h3 {
    break-after: avoid;
    font-size: 13pt;
    margin-bottom: 0.08in;
  }

  .shwt-checklist-print .shwt-checklist-item {
    break-inside: avoid;
  }

  .shwt-print-stop {
    break-inside: avoid;
    margin-bottom: 0.24in;
  }

  .shwt-print-answer {
    background: #f1f1f1;
    border-left: 3px solid #333;
    padding: 0.08in 0.12in;
  }
}
