:root {
  color-scheme: light dark;
  --bg: #fbf8f1;
  --surface: #fffdf8;
  --surface-muted: #f5efe4;
  --text: #17130f;
  --muted: #665d52;
  --border: #dacdbb;
  --accent: #8f1d1d;
  --accent-strong: #701313;
  --accent-muted: #f4dfd9;
  --warning-bg: #fff4cf;
  --warning-border: #b87512;
  --shadow: 0 22px 55px rgba(65, 44, 29, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12100d;
    --surface: #1e1914;
    --surface-muted: #2b241d;
    --text: #f8f0e3;
    --muted: #c7b8a6;
    --border: #4a3d31;
    --accent: #e0786f;
    --accent-strong: #f09a91;
    --accent-muted: #3b241f;
    --warning-bg: #4a3518;
    --warning-border: #d8a248;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(143, 29, 29, 0.035) 0 1px, transparent 1px 100%),
    var(--bg);
  background-size: 72px 72px, auto;
  color: var(--text);
  font-family:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

.site-header,
.site-footer,
main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  padding: 20px 0 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-logo {
  color: var(--text);
  font-family: Georgia, "Times New Roman", ui-serif, serif;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.site-kicker {
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
  padding-left: 16px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav a,
.site-footer a {
  text-decoration: none;
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--accent);
}

.hero {
  display: grid;
  align-items: end;
  min-height: 245px;
  padding: 54px 0 28px;
}

.hero-copy {
  max-width: 900px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", ui-serif, serif;
  font-size: clamp(2.55rem, 6.8vw, 5.7rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 0.96;
}

h2 {
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", ui-serif, serif;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  line-height: 1.1;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.hero p,
.content-section > p {
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-note {
  max-width: 680px;
  border-left: 3px solid var(--accent);
  color: var(--text);
  margin-top: 18px;
  padding-left: 16px;
}

.tool-section {
  margin: 20px 0 56px;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 22px;
  align-items: start;
}

.input-panel,
.results-card,
.content-section article,
.blog-list a {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-panel,
.results-card {
  padding: 20px;
}

.results-card {
  min-height: 310px;
}

.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 0.86rem;
}

label {
  display: block;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 330px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(rgba(143, 29, 29, 0.03), rgba(143, 29, 29, 0.03)),
    var(--surface);
  color: var(--text);
  font-family: Georgia, "Times New Roman", ui-serif, serif;
  font-size: 1rem;
  line-height: 1.62;
  padding: 16px;
}

textarea:focus,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
}

.button-row,
.results-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 16px;
}

.button-primary {
  background: var(--accent);
  box-shadow: 0 3px 0 var(--accent-strong);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--accent-strong);
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.stat {
  border-right: 1px solid var(--border);
  padding: 2px 16px 4px 0;
}

.stat:last-child {
  border-right: 0;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
}

.stat strong {
  display: block;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", ui-serif, serif;
  font-size: 2.25rem;
  line-height: 1.15;
}

.status-text {
  color: var(--muted);
  font-size: 0.93rem;
}

.empty-state {
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  margin: 20px 0 0;
  padding: 28px;
  text-align: center;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 24px;
}

.trust-strip div {
  padding: 18px 22px;
}

.trust-strip div + div {
  border-left: 1px solid var(--border);
}

.trust-strip strong {
  display: block;
  color: var(--accent);
  font-size: 0.98rem;
}

.trust-strip span {
  color: var(--muted);
  display: block;
  font-size: 0.92rem;
  margin-top: 2px;
}

.table-wrap {
  max-height: 520px;
  margin-top: 18px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
}

thead {
  position: sticky;
  top: 0;
  background: var(--surface);
}

tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--surface-muted) 78%, transparent);
}

tbody tr.is-overused {
  background: var(--warning-bg);
  box-shadow: inset 4px 0 0 var(--warning-border);
}

td:last-child,
th:last-child {
  text-align: right;
}

.content-section {
  margin: 60px 0;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.content-section article {
  box-shadow: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 22px;
}

.content-section article + article {
  border-left: 1px solid var(--border);
}

.content-section article p {
  margin-bottom: 0;
  color: var(--muted);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr);
  gap: 18px;
  border-top: 1px solid var(--border);
  margin-top: 70px;
  padding: 28px 0 36px;
  color: var(--muted);
}

.site-footer div {
  display: grid;
  gap: 8px;
}

.article-page main {
  max-width: 820px;
}

.article {
  padding: 56px 0;
}

.article h1 {
  font-size: clamp(2rem, 6vw, 4rem);
}

.article p,
.article li {
  color: var(--muted);
}

.blog-list {
  display: grid;
  gap: 14px;
  padding: 0;
  list-style: none;
}

.blog-list a {
  display: block;
  padding: 16px;
  text-decoration: none;
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .site-kicker {
    border-left: 0;
    padding-left: 0;
  }

  .hero {
    min-height: auto;
    padding-top: 36px;
  }

  .tool-grid,
  .steps,
  .trust-strip,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .trust-strip div + div,
  .content-section article + article {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  textarea {
    min-height: 260px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .stat {
    border-right: 0;
  }
}
