.tool-overlay-word_association {
  padding: 0;
  place-items: stretch;
}

.tool-overlay-word_association .tool-panel {
  width: min(920px, 100%);
  height: min(96dvh, 920px);
  max-height: none;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(101,116,184,.22), transparent 26%),
    radial-gradient(circle at 88% 2%, rgba(219,169,95,.20), transparent 26%),
    linear-gradient(180deg, #fff8ef, #f2e7d7 58%, #e9dcc6);
}

.tool-overlay-word_association .tool-panel-header {
  padding: 10px 14px;
  background: linear-gradient(120deg, #5a4b92, #7c67a8 56%, #b68e60);
}

.tool-overlay-word_association .tool-panel-header h2 {
  font-size: 18px;
}

.tool-overlay-word_association .tool-panel-body {
  padding: 0;
  overflow: hidden;
}

.word-association-app {
  height: 100%;
  min-height: 0;
  padding: 14px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  color: #21212d;
  position: relative;
}

.word-association-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.word-association-topbar p {
  margin: 0 0 2px;
  color: rgba(33, 33, 45, .64);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.word-association-topbar h3 {
  margin: 0;
  font: 900 20px/1.15 Georgia, "Times New Roman", serif;
}

.word-association-progress {
  display: flex;
  gap: 8px;
  align-items: center;
}

.word-association-progress span {
  width: 16px;
  height: 8px;
  border-radius: 999px;
  background: rgba(90, 75, 146, .2);
}

.word-association-progress span.is-active {
  background: #5a4b92;
}

.word-association-card,
.word-association-transition,
.word-association-final-card {
  min-height: 0;
  border: 1px solid rgba(33, 33, 45, .12);
  border-radius: 22px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 18px 60px rgba(77, 57, 23, .14);
}

.word-association-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  align-content: start;
}

.word-association-kicker {
  margin: 0;
  color: rgba(33, 33, 45, .66);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.word-association-stimulus {
  margin: 0;
  text-align: center;
  font: 900 clamp(42px, 8vw, 82px)/1.02 Georgia, "Times New Roman", serif;
  letter-spacing: -0.04em;
  color: #3d315f;
  text-wrap: balance;
}

.word-association-note {
  margin: 0;
  text-align: center;
  color: rgba(33, 33, 45, .72);
  line-height: 1.45;
}

.word-association-form {
  display: grid;
  gap: 12px;
}

.word-association-field {
  display: block;
}

.word-association-field input {
  width: 100%;
  min-height: 64px;
  padding: 16px 18px;
  border: 1px solid rgba(33, 33, 45, .18);
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  color: #1d1d26;
  font: 600 18px/1.3 "Source Sans 3", "Segoe UI", sans-serif;
}

.word-association-field input::placeholder {
  color: rgba(33, 33, 45, .38);
}

.word-association-field input:focus {
  outline: none;
  border-color: rgba(90, 75, 146, .48);
  box-shadow: 0 0 0 3px rgba(90, 75, 146, .16);
}

.word-association-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  padding: 2px 0 0;
  color: rgba(33, 33, 45, .74);
  font-size: 13px;
  line-height: 1.35;
}

.word-association-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.word-association-metrics strong {
  color: #3d315f;
  font-weight: 800;
}

.word-association-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.word-association-actions .button,
.word-association-transition .button,
.word-association-final-card .button {
  min-height: 0;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.word-association-transition {
  display: grid;
  gap: 12px;
  padding: 20px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.word-association-generation-overlay {
  position: absolute;
  inset: 14px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: rgba(255, 251, 245, .42);
  backdrop-filter: blur(3px);
  z-index: 3;
}

.word-association-generation-popup {
  width: min(260px, calc(100% - 24px));
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(33, 33, 45, .1);
  box-shadow: 0 18px 50px rgba(77, 57, 23, .18);
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.word-association-spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid rgba(90, 75, 146, .18);
  border-top-color: #5a4b92;
  animation: word-association-spin .8s linear infinite;
}

.word-association-generation-popup strong {
  color: #3d315f;
  font-size: 14px;
  line-height: 1.35;
}

.word-association-generation-popup p {
  margin: 0;
  color: rgba(33, 33, 45, .74);
  line-height: 1.45;
  font-size: 13px;
}

.word-association-transition h3,
.word-association-final-card h3 {
  margin: 0;
  font: 900 24px/1.1 Georgia, "Times New Roman", serif;
  color: #242435;
}

.word-association-transition p,
.word-association-final-card p {
  margin: 0;
  line-height: 1.55;
  color: rgba(33, 33, 45, .74);
}

.word-association-final-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  align-content: start;
  overflow: auto;
}

.word-association-final-card h4 {
  margin: 0 0 8px;
  color: #3d315f;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.word-association-final-section {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 249, 240, .8);
  border: 1px solid rgba(33, 33, 45, .08);
}

.word-association-counselor-note {
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(90, 75, 146, .08), rgba(219, 169, 95, .16));
  border: 1px solid rgba(90, 75, 146, .12);
  color: #44365f;
  font-weight: 700;
}

.word-association-final-section ul {
  margin: 0;
  padding-left: 18px;
  color: rgba(33, 33, 45, .82);
  line-height: 1.5;
}

.word-association-example-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.word-association-example-list li {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .78);
  border: 1px solid rgba(33, 33, 45, .08);
  display: grid;
  gap: 4px;
}

.word-association-example-list strong {
  color: #3d315f;
  font-size: 14px;
}

.word-association-example-list span,
.word-association-example-list small {
  line-height: 1.45;
}

.word-association-example-list span {
  color: #222235;
}

.word-association-example-list small {
  color: rgba(33, 33, 45, .72);
}

.word-association-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.word-association-stat-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(245, 238, 228, .95);
  border: 1px solid rgba(33, 33, 45, .08);
  display: grid;
  gap: 4px;
}

.word-association-stat-card span {
  color: rgba(33, 33, 45, .58);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.word-association-stat-card strong {
  color: #3d315f;
  font-size: 18px;
}

.word-association-stat-card small {
  color: rgba(33, 33, 45, .66);
  line-height: 1.4;
}

.word-association-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-association-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(90, 75, 146, .12);
  color: #3d315f;
  font-size: 13px;
  font-weight: 700;
}

.word-association-caution {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(233, 220, 198, .65);
  color: rgba(33, 33, 45, .78);
  line-height: 1.45;
}

.word-association-complete {
  height: 100%;
}

@keyframes word-association-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 700px) {
  .tool-overlay-word_association .tool-panel {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }

  .word-association-app {
    padding: 10px;
    gap: 10px;
  }

  .word-association-topbar {
    align-items: flex-start;
  }

  .word-association-topbar h3 {
    font-size: 18px;
  }

  .word-association-stimulus {
    font-size: clamp(34px, 11vw, 64px);
  }

  .word-association-metrics,
  .word-association-stat-grid {
    grid-template-columns: 1fr;
  }

  .word-association-actions {
    justify-content: stretch;
  }

  .word-association-actions .button,
  .word-association-transition .button,
  .word-association-final-card .button {
    width: 100%;
  }
}
