:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f9fafb;
  --accent: #111827;
  --blue: #2563eb;
  --green: #15803d;
  --red: #b91c1c;
  --radius: 14px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.header-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.top-nav a,
.site-footer a {
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
}

.top-nav a:hover,
.site-footer a:hover {
  color: #111827;
}

/* Product introduction */

.page-intro {
  padding: 56px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .13em;
}

.page-intro h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -.045em;
}

.intro-copy {
  max-width: 760px;
  margin: 16px 0 18px;
  color: #4b5563;
  font-size: 17px;
}

.trust-points {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: #4b5563;
  font-size: 13px;
}

.trust-points i {
  margin-right: 5px;
  color: var(--green);
  font-style: normal;
  font-weight: 800;
}

/* Main tool */

.tool-section {
  padding-bottom: 50px;
}

.workspace-panel,
.results-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

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

.section-heading h2,
.content-section h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -.02em;
}

.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.private-label,
.live-label {
  flex: none;
  padding: 5px 9px;
  border-radius: 20px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
}

#text-input {
  display: block;
  width: 100%;
  min-height: 260px;
  margin-top: 18px;
  padding: 15px;
  resize: vertical;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}

#text-input::placeholder {
  color: #9ca3af;
}

#text-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px #dbeafe;
}

.tool-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background .15s, border-color .15s, opacity .15s;
}

.button:focus-visible {
  outline: 3px solid #bfdbfe;
  outline-offset: 2px;
}

.button-primary {
  background: #111827;
  color: #fff;
}

.button-primary:hover {
  background: #293548;
}

.button-secondary {
  border-color: #d1d5db;
  background: #fff;
  color: #111827;
}

.button-secondary:hover,
.button-quiet:hover {
  background: #f3f4f6;
}

.button-quiet {
  border-color: var(--line);
  background: #fff;
  color: #4b5563;
}

.status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* Privacy note */

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 18px;
  padding: 14px 16px;
  border: 1px solid #dcfce7;
  border-radius: 11px;
  background: #f0fdf4;
}

.privacy-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #15803d;
}

.privacy-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.privacy-note p {
  margin: 0;
  color: #365744;
  font-size: 13px;
}

.privacy-note strong {
  color: #14532d;
}

/* Statistics */

.results-panel {
  margin-top: 18px;
}

.results-heading {
  margin-bottom: 16px;
}

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

.stat-card {
  display: flex;
  min-width: 0;
  min-height: 105px;
  flex-direction: column;
  justify-content: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--soft);
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.reading-card {
  grid-column: span 2;
}

.reading-card strong {
  font-size: 23px;
}

.estimate-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* Instructions and FAQ */

.content-section {
  padding: 10px 0 60px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.content-grid p,
.content-grid li,
.privacy-summary p,
.faq-section p {
  color: #4b5563;
  font-size: 14px;
}

.content-grid ol {
  padding-left: 20px;
}

.content-grid li {
  padding: 4px 0;
}

.privacy-summary {
  max-width: 860px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.privacy-summary p {
  margin: 9px 0 0;
}

.faq-section {
  max-width: 860px;
  padding-top: 14px;
}

.faq-section h2 {
  margin-bottom: 12px;
}

.faq-section details {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.faq-section summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
}

.faq-section p {
  margin: 8px 0 2px;
}

/* Footer */

.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #9ca3af;
  font-size: 12px;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.site-footer a {
  font-size: 12px;
}

/* Accessibility */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tablet */

@media (max-width: 800px) {
  .header-inner {
    min-height: 0;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 12px 0;
  }

  .top-nav {
    order: 3;
    width: 100%;
    margin: 0;
    gap: 18px;
  }

  .page-intro {
    padding: 40px 0 24px;
  }

  .intro-copy {
    font-size: 15px;
  }

  .trust-points {
    gap: 8px 16px;
  }

  .workspace-panel,
  .results-panel {
    padding: 16px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .footer-inner nav {
    gap: 12px 18px;
  }
}

/* Mobile */

@media (max-width: 520px) {
  .container,
  .header-inner {
    width: calc(100% - 28px);
  }

  .brand-logo {
    width: 155px;
  }

  .top-nav a {
    font-size: 12px;
  }

  .page-intro h1 {
    font-size: 34px;
  }

  .trust-points {
    gap: 7px 14px;
    font-size: 12px;
  }

  .workspace-heading,
  .results-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  #text-input {
    min-height: 230px;
  }

  .tool-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .action-buttons .button {
    width: 100%;
  }

  .action-buttons #download-button {
    grid-column: span 2;
  }

  .tool-actions > .button-quiet {
    align-self: flex-end;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stat-card {
    min-height: 94px;
    padding: 12px;
  }

  .stat-card strong {
    font-size: 24px;
  }

  .reading-card {
    grid-column: span 2;
  }

  .privacy-note {
    padding: 12px;
  }

  .footer-inner nav {
    gap: 10px 15px;
  }
}
