.lfrg-tool {
  --lfrg-green: #1f6b45;
  --lfrg-green-dark: #164d34;
  --lfrg-border: #d9e4dd;
  --lfrg-bg-soft: #f4faf6;
  --lfrg-warn: #fff8e8;
  max-width: 760px;
  margin: 1.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--lfrg-border);
  border-radius: 8px;
  background: #fff;
  color: #1f2a24;
  box-sizing: border-box;
}

.lfrg-tool * {
  box-sizing: border-box;
}

.lfrg-title {
  margin: 0 0 .75rem;
  color: var(--lfrg-green-dark);
  line-height: 1.35;
}

.lfrg-intro,
.lfrg-notice,
.lfrg-remaining,
.lfrg-message {
  line-height: 1.75;
}

.lfrg-intro {
  margin-bottom: 1rem;
}

.lfrg-field {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.lfrg-field label,
.lfrg-purpose legend {
  display: block;
  margin-bottom: .45rem;
  font-weight: 700;
}

.lfrg-field textarea {
  width: 100%;
  min-height: 128px;
  padding: .8rem;
  border: 1px solid #b9c8bf;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
}

.lfrg-field textarea:focus,
.lfrg-submit:focus,
.lfrg-copy:focus {
  outline: 3px solid rgba(31, 107, 69, .22);
  outline-offset: 2px;
}

.lfrg-purpose label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0 1.25rem .4rem 0;
  font-weight: 600;
}

.lfrg-notice {
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border-left: 4px solid #d5a11e;
  border-radius: 6px;
  background: var(--lfrg-warn);
}

.lfrg-submit,
.lfrg-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .75rem 1.2rem;
  border: 0;
  border-radius: 6px;
  background: var(--lfrg-green);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.lfrg-submit:hover,
.lfrg-copy:hover {
  background: var(--lfrg-green-dark);
}

.lfrg-submit:disabled {
  background: #9aa9a0;
  cursor: not-allowed;
}

.lfrg-remaining {
  margin-top: 1rem;
  font-weight: 700;
}

.lfrg-message {
  margin-top: .75rem;
  min-height: 1.75em;
}

.lfrg-message-error {
  color: #9a2a20;
}

.lfrg-message-success {
  color: var(--lfrg-green-dark);
}

.lfrg-message-info {
  color: #335c47;
}

.lfrg-result {
  margin-top: 1rem;
  padding: 1.15rem;
  border: 1px solid var(--lfrg-border);
  border-radius: 8px;
  background: var(--lfrg-bg-soft);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.lfrg-result h2,
.lfrg-result h3,
.lfrg-result h4,
.lfrg-result h5 {
  margin: 1rem 0 .5rem;
  color: var(--lfrg-green-dark);
  line-height: 1.35;
}

.lfrg-result h2:first-child,
.lfrg-result h3:first-child,
.lfrg-result h4:first-child,
.lfrg-result h5:first-child {
  margin-top: 0;
}

.lfrg-result ul,
.lfrg-result ol {
  margin: .5rem 0 .75rem 1.35rem;
  padding: 0;
}

.lfrg-copy {
  margin-top: 1rem;
  background: #355b48;
}

@media (max-width: 640px) {
  .lfrg-tool {
    padding: 1rem;
    max-width: 100%;
  }

  .lfrg-purpose label,
  .lfrg-submit,
  .lfrg-copy {
    width: 100%;
  }

  .lfrg-purpose label {
    margin-right: 0;
  }
}
