:root {
  --ink: #241f1b;
  --muted: #6d6257;
  --paper: #f7f2ea;
  --paper-strong: #fffaf2;
  --line: #ded2c2;
  --wine: #7d2436;
  --wine-deep: #511724;
  --moss: #506749;
  --blue: #31566d;
  --gold: #b9822f;
  --shadow: 0 20px 48px rgba(36, 31, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(185, 130, 47, 0.16), transparent 28rem),
    linear-gradient(135deg, rgba(49, 86, 109, 0.12), transparent 34rem),
    var(--paper);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(36, 31, 27, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 31, 27, 0.025) 1px, transparent 1px);
  background-size: 100% 34px, 34px 100%;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

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

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 52px;
}

.hero {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(500px, 1fr) minmax(420px, 1fr);
  align-items: end;
  min-height: 300px;
  padding: 34px;
  border: 1px solid rgba(125, 36, 54, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(255, 250, 242, 0.96), rgba(255, 250, 242, 0.78)),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(80, 103, 73, 0.05) 22px 23px);
  box-shadow: var(--shadow);
}

.brand-row {
  display: flex;
  gap: 18px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(125, 36, 54, 0.34);
  border-radius: 8px;
  color: var(--wine);
  font-size: 44px;
  line-height: 1;
  background: linear-gradient(145deg, #fffdf8, #eadcca);
  box-shadow: inset 0 -10px 22px rgba(125, 36, 54, 0.08);
}

.brand-name,
.eyebrow {
  margin: 0 0 6px;
  color: var(--wine);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(42px, 4.5vw, 64px);
  font-weight: 500;
  line-height: 0.98;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

h1 span {
  display: block;
  white-space: nowrap;
}

.search-panel,
.summary-card,
.extend-panel,
.group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.88);
}

.search-panel {
  position: relative;
  z-index: 1;
  padding: 22px;
}

.search-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.search-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdbfab;
  border-radius: 8px;
  color: var(--ink);
  background: #fffdf8;
}

input,
select {
  min-height: 48px;
  padding: 0 14px;
}

textarea {
  resize: vertical;
  padding: 14px;
}

button {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--wine-deep);
  border-radius: 8px;
  color: #fffaf2;
  cursor: pointer;
  background: var(--wine);
}

button:hover {
  background: var(--wine-deep);
}

button.ghost {
  color: var(--wine);
  background: transparent;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin-top: 16px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.controls label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.controls input[type="checkbox"] {
  width: 17px;
  min-height: 17px;
}

.controls select {
  width: auto;
  min-height: 36px;
  padding: 0 32px 0 10px;
}

.rhyme-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 16px;
  font-family: Arial, Helvetica, sans-serif;
}

.mode-button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
}

.accent-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.accent-suggestions[hidden] {
  display: none;
}

.accent-option {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(125, 36, 54, 0.32);
  border-radius: 8px;
  color: var(--wine);
  background: #fffdf8;
}

.accent-option:hover,
.accent-option.active {
  color: #fffaf2;
  background: var(--wine);
}

.mode-button:hover,
.mode-button.active {
  color: var(--wine);
  background: transparent;
}

.results-zone {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.summary-card {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 20px 24px;
}

.count {
  margin: 0;
  color: var(--blue);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 28px;
  font-weight: 800;
}

.empty-state {
  padding: 28px;
  border: 1px dashed #cdbfab;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 250, 242, 0.58);
}

.empty-state p {
  margin: 0;
}

.rhyme-list {
  padding: 26px 30px 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.78);
}

.rhyme-list h2 {
  margin: 0 0 24px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 500;
  line-height: 1.15;
}

.word-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  align-items: baseline;
}

.rhyme-word {
  display: inline-block;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #39342f;
  font-size: 25px;
  line-height: 1.25;
  background: transparent;
}

.rhyme-word:hover {
  color: var(--wine);
  background: transparent;
}

.rhyme-word span {
  white-space: nowrap;
}

.stressed-vowel {
  position: relative;
  display: inline-block;
  color: inherit;
  white-space: nowrap;
}

.stressed-vowel::after {
  position: absolute;
  top: -0.34em;
  left: 50%;
  content: "´";
  color: #22833a;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.5em;
  font-weight: 700;
  line-height: 1;
  transform: translateX(-42%);
  pointer-events: none;
}

.accent-option .stressed-vowel::after {
  color: currentColor;
}

.rhyme-word .stressed-vowel {
  color: #22833a;
  font-weight: 700;
}

.extend-panel {
  margin-top: 22px;
  overflow: hidden;
}

.extend-toggle {
  width: 100%;
  border: 0;
  border-radius: 0;
  color: var(--wine);
  text-align: left;
  background: rgba(255, 250, 242, 0.92);
}

.extend-toggle:hover {
  color: #fffaf2;
}

.extend-body {
  padding: 0 22px 22px;
}

.extend-body h2 {
  margin: 8px 0 8px;
  font-size: 26px;
  font-weight: 500;
}

.extend-body p {
  margin: 0 0 14px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.extend-body span {
  color: var(--wine);
}

.extend-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 1060px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 22px, 680px);
    padding-top: 18px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 22px;
  }

  .search-line,
  .summary-card {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(38px, 12vw, 58px);
  }
}

@media (max-width: 520px) {
  .brand-row {
    align-items: flex-start;
    gap: 12px;
  }

  .brand-mark {
    width: 56px;
    height: 56px;
    font-size: 34px;
  }

  h1 {
    font-size: clamp(30px, 10vw, 42px);
  }
}
