:root {
  --ink: #111827;
  --muted: #5b6472;
  --line: #d8dee8;
  --line-strong: #b9c5d6;
  --page: #fbfcfe;
  --surface: #ffffff;
  --soft: #f6f8fb;
  --green: #087a2c;
  --green-soft: #edf9ef;
  --green-line: #aed9b5;
  --amber: #d98a00;
  --amber-soft: #fff7e8;
  --shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(8, 122, 44, 0.18);
  outline-offset: 2px;
}

.page-shell {
  width: min(100%, 1620px);
  margin: 0 auto;
  padding: 22px 40px 44px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 455px);
  gap: 32px;
  align-items: start;
  margin-bottom: 18px;
}

.intro h1 {
  margin: 0;
  font-size: clamp(40px, 4.1vw, 58px);
  line-height: 1.02;
  font-weight: 800;
}

.intro p {
  margin: 12px 0 0;
  max-width: 860px;
  font-size: 18px;
  line-height: 1.5;
}

.keyword-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.keyword-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 14px;
  border: 1px solid #8fcf9b;
  border-radius: 999px;
  background: #f8fff9;
  color: #086628;
  font-size: 14px;
  font-weight: 500;
}

.trust-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 66px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.trust-note p {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.note-mark {
  display: grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 2px solid var(--green);
  border-radius: 50%;
  color: var(--green);
  font-weight: 800;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(430px, 0.92fr) minmax(520px, 1.08fr);
  gap: 12px;
  align-items: stretch;
}

.panel,
.info-card,
.seo-copy {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel h2,
.info-card h2,
.seo-copy h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.seo-copy h3 {
  margin: 22px 0 0;
  font-size: 17px;
  line-height: 1.35;
}

.field-block {
  display: block;
  margin-top: 20px;
}

.field-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--ink);
  font-weight: 700;
}

.field-heading output,
.field-help,
label small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.field-help {
  display: block;
  margin-top: 8px;
}

textarea,
input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

textarea {
  display: block;
  min-height: 146px;
  margin-top: 8px;
  padding: 17px 15px;
  resize: vertical;
  font-size: 18px;
}

input,
select {
  min-height: 40px;
  padding: 0 12px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 40px;
  margin-top: 24px;
}

.options-grid label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.options-grid label > span {
  font-weight: 700;
}

.help-dot {
  display: inline-grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 1px solid #7b8492;
  border-radius: 50%;
  background: transparent;
  color: #475160;
  font-size: 10px;
  line-height: 1;
  vertical-align: middle;
}

.action-row,
.result-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.action-row {
  margin-top: 18px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 6px;
  font-weight: 800;
}

.primary-button {
  gap: 10px;
  min-width: 260px;
  border: 0;
  background: linear-gradient(180deg, #0a8a32, #08752b);
  color: #fff;
}

.primary-button span {
  font-size: 24px;
  line-height: 1;
}

.secondary-button {
  min-width: 156px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.secondary-button.warm {
  border-color: #e0a139;
  color: #bd7600;
}

.secondary-button.compact {
  min-width: 118px;
  min-height: 34px;
  padding: 0 14px;
  color: var(--green);
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.panel-heading,
.results-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.state-stack {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.state-card {
  padding: 18px;
  border-bottom: 1px solid #ebeff5;
}

.state-card:last-child {
  border-bottom: 0;
}

.state-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.empty-box,
.no-results-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 104px;
  gap: 24px;
  border-radius: 6px;
}

.empty-box {
  border: 1px dashed #c3cad5;
}

.empty-box p,
.no-results-box p {
  margin: 0;
  color: #2f3947;
  font-size: 14px;
  line-height: 1.55;
}

.empty-icon {
  width: 43px;
  height: 48px;
  border-left: 4px solid #9aa1aa;
  background:
    linear-gradient(#9aa1aa, #9aa1aa) 12px 7px / 32px 4px no-repeat,
    linear-gradient(#9aa1aa, #9aa1aa) 12px 22px / 32px 4px no-repeat,
    linear-gradient(#9aa1aa, #9aa1aa) 12px 37px / 32px 4px no-repeat;
}

.no-results-box {
  justify-content: flex-start;
  min-height: 86px;
  padding: 16px 22px;
  border: 1px solid #efb64f;
  background: var(--amber-soft);
}

.search-mark {
  position: relative;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 3px solid var(--amber);
  border-radius: 50%;
}

.search-mark::after {
  position: absolute;
  right: -9px;
  bottom: -7px;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--amber);
  transform: rotate(45deg);
  content: "";
}

.results-summary {
  margin-bottom: 10px;
}

.results-summary p {
  margin: 0;
  color: #2f3947;
  font-size: 14px;
}

.grouped-results {
  overflow: hidden;
  border: 1px solid var(--green-line);
  border-radius: 6px;
  background: #fbfffc;
}

.result-group {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 46px;
  padding: 8px 12px;
  border-bottom: 1px solid #cfe8d3;
}

.result-group:last-child {
  border-bottom: 0;
}

.group-label {
  color: #142012;
  font-weight: 800;
}

.group-text {
  overflow: hidden;
  color: #2f3947;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-group {
  min-width: 76px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--green);
  font-weight: 700;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.info-card {
  padding: 18px;
}

.info-card h2 {
  display: flex;
  gap: 12px;
  align-items: center;
}

.info-card h2 span {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 7px;
  color: var(--green);
  font-size: 14px;
}

.info-card:nth-child(3) h2 span {
  color: var(--amber);
}

.info-card ul,
.info-card ol {
  margin: 16px 0 0;
  padding-left: 22px;
}

.info-card li,
.info-card p,
.faq-answer {
  color: #2f3947;
  font-size: 14px;
  line-height: 1.65;
}

.info-card p {
  margin: 18px 0 0;
}

.faq-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: #2f3947;
  text-align: left;
}

.faq-answer {
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--line);
}

.seo-copy {
  margin-top: 28px;
  padding: 24px;
}

.seo-copy p {
  max-width: 1040px;
  margin: 14px 0 0;
  color: #2f3947;
  font-size: 16px;
  line-height: 1.75;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 16px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .page-shell {
    padding: 20px;
  }

  .intro,
  .tool-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 16px;
  }

  .intro h1 {
    font-size: 38px;
  }

  .options-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .input-panel {
    display: flex;
    flex-direction: column;
  }

  .input-panel .field-block {
    order: 1;
  }

  .input-panel .action-row {
    order: 2;
  }

  .input-panel .options-grid {
    order: 3;
  }

  .action-row,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .result-actions {
    width: 100%;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .group-text {
    white-space: normal;
  }
}
