:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #162033;
  --muted: #5c6578;
  --border: #dbe1ee;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --pill: #eef2ff;
  --success: #0f766e;
  --shadow: 0 12px 40px rgba(26, 32, 51, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: rgba(246, 247, 251, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(219, 225, 238, 0.8);
}

.nav-logo,
.nav-cta {
  text-decoration: none;
  font-weight: 700;
}

.nav-cta {
  color: #fff;
  background: var(--primary);
  padding: 10px 16px;
  border-radius: 999px;
}

.hero,
.benefits,
.faq,
.footer {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  padding: 56px 0 30px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--pill);
  color: var(--primary-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0 auto 16px;
  max-width: 780px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
}

.hero-sub {
  max-width: 740px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.hero-pills span {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.tool {
  width: min(960px, calc(100% - 32px));
  margin: 0 auto 34px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.field-row,
.controls,
.action-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.field-row {
  margin-bottom: 10px;
}

label {
  font-weight: 700;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

textarea {
  min-height: 260px;
  resize: vertical;
  padding: 16px;
  margin-bottom: 16px;
}

input,
select {
  padding: 12px 14px;
}

.controls {
  align-items: end;
  margin-bottom: 16px;
}

.control {
  flex: 1;
}

.control-small {
  max-width: 140px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
}

.primary-btn,
.secondary-btn {
  padding: 12px 18px;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

.primary-btn:hover,
.nav-cta:hover {
  background: var(--primary-dark);
}

.secondary-btn,
.ghost-btn {
  background: #eef2ff;
  color: var(--primary-dark);
}

.ghost-btn {
  padding: 8px 12px;
}

.action-row {
  justify-content: flex-start;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.stats,
.share-status,
.empty-state,
.result-card,
.faq details,
.benefit-grid article {
  border: 1px solid var(--border);
  background: #fbfcff;
  border-radius: 18px;
}

.helper-text {
  margin: -2px 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.stats {
  padding: 14px 16px;
  margin-bottom: 14px;
  color: var(--success);
  font-weight: 700;
}

.share-status {
  padding: 12px 16px;
  margin-bottom: 14px;
  color: var(--primary-dark);
  font-weight: 700;
}

.empty-state {
  padding: 18px;
}

.empty-state h2,
.benefits h2,
.faq h2 {
  margin-top: 0;
}

.empty-state ol {
  margin: 10px 0 0 20px;
  color: var(--muted);
}

.results {
  display: grid;
  gap: 12px;
}

.result-card {
  padding: 16px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.result-timestamp {
  font-weight: 800;
  color: var(--primary-dark);
}

.result-copy {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
  padding: 0;
}

.result-context {
  color: var(--muted);
  white-space: pre-wrap;
}

mark {
  background: #fef3c7;
  color: inherit;
  padding: 0 2px;
}

.benefits {
  padding: 24px 0 12px;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.benefit-grid article,
.faq details {
  padding: 18px;
}

.benefit-grid p,
.faq p,
summary {
  color: var(--muted);
}

.faq {
  padding: 14px 0 40px;
}

.faq details + details {
  margin-top: 10px;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

.footer {
  padding: 20px 0 40px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 768px) {
  .controls,
  .field-row,
  .benefit-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .control-small {
    max-width: none;
  }

  .tool-card {
    padding: 16px;
  }
}

@media (max-width: 375px) {
  .hero {
    padding-top: 40px;
  }

  .tool-card {
    border-radius: 18px;
  }

  textarea {
    min-height: 220px;
  }
}
