* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
textarea {
  font: inherit;
}

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

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  max-width: 100%;
  margin: 0;
  font-size: 4.25rem;
  line-height: 0.98;
  overflow-wrap: break-word;
}

.hero > p:not(.eyebrow):not(.processing-badge) {
  max-width: 740px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.tool {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgb(19 45 35 / 8%);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

button {
  display: inline-flex;
  min-height: 42px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: var(--text-inverse);
  font-weight: 800;
  cursor: pointer;
}

.secondary-button {
  border: 1px solid var(--accent);
  background: var(--panel);
  color: var(--accent-strong);
}

.secondary-button:hover {
  background: var(--accent-soft);
}

textarea {
  display: block;
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--bg-subtle);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.content-card {
  min-width: 0;
}

.content-card h2 {
  margin: 8px 0 0;
  font-size: 2.25rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

#top-words {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.status {
  min-height: 24px;
  color: var(--muted);
}

.status[data-tone="error"] {
  color: var(--danger);
}

.status[data-tone="warn"] {
  color: var(--warn);
}

.status[data-tone="ok"] {
  color: var(--accent-strong);
}

@media (max-width: 860px) {
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .shell {
    width: calc(100% - 24px);
    padding: 28px 0;
  }

  h1 {
    font-size: 2.8rem;
  }

  .hero > p:not(.eyebrow):not(.processing-badge) {
    font-size: 1rem;
  }

  .tool {
    padding: 14px;
  }

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

  .toolbar button {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  textarea {
    min-height: 240px;
  }

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