:root {
  color-scheme: light;
  --page: #fbfaf6;
  --surface: #fffefa;
  --surface-soft: #f7faf7;
  --ink: #101827;
  --muted: #5f6877;
  --line: #d7d4cc;
  --line-strong: #bbb7ac;
  --blue: #184f9f;
  --blue-dark: #113b7b;
  --green: #0c7a3a;
  --green-dark: #075c2b;
  --amber: #d38119;
  --red: #bf4b2f;
  --shadow: 0 16px 42px rgba(29, 35, 45, 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, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  letter-spacing: 0;
}

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

button,
input,
select,
textarea {
  border-radius: 6px;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
.slogan-row-button:focus-visible {
  outline: 3px solid rgba(24, 79, 159, 0.28);
  outline-offset: 2px;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  min-height: 78px;
  padding: 18px 46px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.96);
  backdrop-filter: blur(12px);
}

.brand,
.main-nav,
.hero-line,
.result-actions,
.control-actions,
.table-heading,
.table-meta,
.panel-topline,
.overall-score {
  display: flex;
  align-items: center;
}

.brand {
  gap: 18px;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 700;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: var(--line-strong);
}

.brand-tool {
  color: #2a3342;
  font-weight: 600;
}

.main-nav {
  gap: 34px;
  color: #111827;
  font-weight: 700;
}

.main-nav a:hover {
  color: var(--blue);
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 40px 54px;
}

.hero-line {
  justify-content: space-between;
  gap: 28px;
  margin: 6px 0 22px;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.6rem, 4.8vw, 4.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2,
h3,
p {
  overflow-wrap: anywhere;
}

.hero-line p {
  margin: 12px 0 0;
  color: #3e4858;
  font-size: 1.08rem;
}

.saved-indicator {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  min-width: 170px;
  color: #273142;
}

.saved-indicator .icon-label {
  grid-row: span 2;
  color: var(--blue);
  font-size: 1.3rem;
}

.saved-indicator span:last-child {
  color: var(--muted);
}

.lab-panel,
.slogan-table-card,
.selected-card,
.evaluation-card,
.support-section,
.examples-section,
.tips-section,
.faq-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.lab-panel {
  padding: 22px;
  box-shadow: var(--shadow);
}

.control-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.5fr 1.02fr 1.8fr;
  gap: 18px 30px;
  align-items: end;
}

.field,
.tone-field,
.quantity-field {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

label,
legend {
  color: #172033;
  font-size: 0.88rem;
  font-weight: 800;
}

input,
textarea,
select {
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
  padding: 12px 13px;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

.offer-field {
  position: relative;
}

.field-meter {
  position: absolute;
  right: 12px;
  bottom: 8px;
  color: #8a9099;
  font-size: 0.76rem;
}

.segmented,
.quantity-options {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
}

.segmented {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.segmented button,
.quantity-options button {
  min-height: 42px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: #1e293b;
  padding: 0 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.segmented button {
  padding: 0 4px;
  font-size: 0.78rem;
}

.segmented button:first-child,
.quantity-options button:first-child {
  border-left: 0;
}

.segmented button.is-active,
.quantity-options button.is-active {
  background: var(--blue);
  color: #ffffff;
}

.control-actions {
  grid-column: 2 / -1;
  gap: 18px;
  justify-content: flex-end;
}

.primary-action,
.tool-button,
.icon-button,
.copy-row,
.save-row {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: #172033;
  font-weight: 800;
}

.primary-action {
  min-width: 180px;
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.primary-action:hover {
  background: var(--green-dark);
}

.tool-button {
  min-width: 104px;
  padding: 0 16px;
}

.tool-button:hover,
.icon-button:hover,
.copy-row:hover,
.save-row:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.reset-button {
  color: var(--red);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(300px, 0.83fr) minmax(280px, 0.76fr);
  gap: 12px;
  margin-top: 14px;
}

.slogan-table-card,
.selected-card,
.evaluation-card {
  min-width: 0;
  overflow: hidden;
}

.table-heading,
.panel-topline {
  justify-content: space-between;
  min-height: 54px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.table-heading h2,
.panel-topline h2 {
  margin: 0;
  font-size: 1rem;
}

.table-meta {
  gap: 18px;
  color: var(--muted);
  font-weight: 700;
}

.saved-meta {
  color: var(--green);
}

.slogan-table {
  display: grid;
}

.slogan-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 150px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.slogan-head {
  min-height: 38px;
  color: #273142;
  font-size: 0.86rem;
  font-weight: 800;
}

.slogan-row > span,
.slogan-row-button {
  padding: 0 20px;
}

.slogan-row-button {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #253044;
  text-align: left;
}

.slogan-row.is-selected {
  background: #eef6ff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.result-actions {
  gap: 16px;
  justify-content: center;
}

.copy-row,
.save-row,
.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
}

.save-row.is-saved,
.icon-button.is-saved {
  border-color: var(--green);
  background: #e9f7ee;
  color: var(--green);
}

.table-tip {
  margin: 0;
  padding: 14px 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.selected-preview {
  padding: 24px 20px 20px;
}

.selected-preview h3 {
  margin: 0 0 28px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 2.15vw, 2.35rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.usage-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.usage-preview strong,
.notes-block strong {
  display: block;
  margin-bottom: 12px;
}

.usage-preview dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.usage-preview dt {
  color: #4b5563;
  font-size: 0.82rem;
  font-weight: 800;
}

.usage-preview dd {
  margin: 0 0 4px;
  color: #2f3b4f;
}

.copy-selected {
  margin-top: 20px;
}

.info-dot {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
}

.score-list {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 18px 20px 22px;
  list-style: none;
}

.score-list li,
.overall-score {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.pass {
  color: var(--green);
}

.warn {
  color: var(--amber);
}

.notes-block {
  margin: 0 20px;
  border-top: 1px solid var(--line);
  padding: 20px 0;
}

.notes-block p {
  margin: 0;
  color: #3c4657;
}

.overall-score {
  margin: 0 20px;
  border-top: 1px solid var(--line);
  padding: 20px 0 24px;
  font-size: 1.1rem;
}

.overall-score span {
  color: var(--green);
}

.trust-banner,
.privacy-note {
  border-left: 4px solid var(--amber);
  background: #fff7eb;
  color: #4b3720;
}

.trust-banner {
  margin: 18px 0 0;
  padding: 16px 18px;
}

.support-grid,
.tips-grid {
  display: grid;
  gap: 14px;
}

.support-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.support-section,
.examples-section,
.tips-section,
.faq-section {
  padding: 24px;
}

.support-section h2,
.examples-section h2,
.tips-section h2,
.faq-section h2 {
  margin: 0 0 14px;
  font-size: 1.45rem;
}

.support-section p,
.tips-section p,
.faq-section p {
  color: #3f4958;
}

.section-heading span {
  display: block;
  margin-bottom: 7px;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.examples-section,
.tips-section,
.faq-section {
  margin-top: 18px;
}

.example-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.example-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr;
  border-top: 1px solid var(--line);
}

.example-row:first-child {
  border-top: 0;
}

.example-row span {
  padding: 13px 14px;
  border-left: 1px solid var(--line);
}

.example-row span:first-child {
  border-left: 0;
}

.example-head {
  background: #eaf5ef;
  color: var(--green-dark);
  font-weight: 850;
}

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

.tips-grid article {
  border-top: 3px solid var(--green);
  padding-top: 12px;
}

.tips-grid h3 {
  margin: 0 0 8px;
}

.privacy-note {
  margin: 18px 0 0;
  padding: 12px 14px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.faq-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.faq-item button {
  display: flex;
  inline-size: -webkit-fill-available;
  inline-size: stretch;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--ink);
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  text-align: left;
  font-weight: 800;
}

.faq-item p {
  margin: 10px 0 0;
}

.faq-item p[hidden] {
  display: none;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 40px));
  border-radius: 7px;
  padding: 12px 14px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

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

@media (max-width: 1180px) {
  main {
    padding: 24px;
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tone-field {
    grid-column: 1 / -1;
  }

  .control-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .support-grid,
  .tips-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .brand {
    gap: 10px;
  }

  .brand-name {
    font-size: 1.25rem;
  }

  .main-nav {
    flex-wrap: wrap;
    gap: 16px;
  }

  main {
    padding: 16px;
  }

  .hero-line {
    display: grid;
  }

  h1 {
    font-size: clamp(3rem, 14vw, 4rem);
  }

  .control-grid,
  .support-grid,
  .tips-grid,
  .example-row {
    grid-template-columns: 1fr;
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .segmented button,
  .quantity-options button {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .segmented button:first-child,
  .quantity-options button:first-child {
    border-top: 0;
  }

  .control-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tool-button,
  .primary-action {
    inline-size: -webkit-fill-available;
    inline-size: stretch;
  }

  .slogan-row {
    grid-template-columns: 44px minmax(0, 1fr) 86px;
  }

  .slogan-row > span,
  .slogan-row-button {
    padding: 0 10px;
  }

  .result-actions {
    gap: 8px;
  }

  .example-row span {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .example-row span:first-child {
    border-top: 0;
  }
}
