:root {
  --color-bg: #f7f5ef;
  --color-surface: #ffffff;
  --color-surface-muted: #f0ede5;
  --color-text: #1f2933;
  --color-text-muted: #5f6b76;
  --color-border: #d8d3c8;
  --color-primary: #25636f;
  --color-primary-hover: #1e515c;
  --color-accent: #8b5e34;
  --color-success: #287a4d;
  --color-warning: #946200;
  --color-error: #b42318;
  --color-focus: #2f80ed;
  --shadow-panel: 0 10px 30px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, "Helvetica Neue", "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, rgba(37, 99, 111, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(37, 99, 111, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #fbfaf6 0%, var(--color-bg) 420px);
  background-size: 24px 24px, 24px 24px, auto;
  color: var(--color-text);
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  min-height: 100vh;
}

.site-header,
.site-footer,
.container {
  width: min(100% - 32px, 1062px);
  margin-inline: auto;
}

.site-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(216, 211, 200, 0.75);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--color-text);
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--color-primary), #2f7f74);
  color: white;
  font-size: 13px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.25), 0 6px 14px rgba(37, 99, 111, 0.18);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 16px;
  font-size: 14px;
}

.site-nav a {
  color: var(--color-text-muted);
}

.page-main {
  padding-bottom: 56px;
}

.hero {
  padding: 25px 0 29px;
}

.hero-copy {
  max-width: 702px;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 13px;
  margin: 0 0 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  font-size: 36px;
  line-height: 1.12;
  margin: 0 0 11px;
}

h2 {
  font-size: 23px;
  line-height: 1.2;
  margin: 0 0 13px;
}

h3 {
  font-size: 16px;
  line-height: 1.25;
  margin: 0 0 8px;
}

p {
  line-height: 1.62;
}

.lede {
  color: var(--color-text-muted);
  font-size: 16px;
  margin: 0;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(216, 211, 200, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 5px 14px rgba(31, 41, 51, 0.04);
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.panel,
.content-card,
.notice {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-panel);
}

.panel {
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), #4a8f76, var(--color-accent));
}

.panel > * {
  position: relative;
}

.result-panel {
  position: sticky;
  top: 14px;
}

.tabs {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-surface-muted);
  margin-bottom: 16px;
}

.tab-button {
  min-height: 38px;
  border: 0;
  background: transparent;
  padding: 0 14px;
  cursor: pointer;
  color: var(--color-text-muted);
}

.tab-button.active {
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(31, 41, 51, 0.08);
}

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

.field,
.full-field {
  display: grid;
  gap: 6px;
}

.full-field {
  grid-column: 1 / -1;
}

label {
  font-weight: 700;
  font-size: 13px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: white;
  color: var(--color-text);
  min-height: 40px;
  padding: 9px 11px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

textarea {
  resize: vertical;
}

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

input:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 111, 0.11);
}

.help-text {
  color: var(--color-text-muted);
  font-size: 13px;
  margin: 5px 0 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.button,
.secondary-button,
.copy-button {
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

.button {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 8px 18px rgba(37, 99, 111, 0.2);
}

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

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

.secondary-button:hover,
.copy-button:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.manual-section {
  margin-top: 22px;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.result-state {
  min-height: 103px;
  background:
    linear-gradient(135deg, rgba(37, 99, 111, 0.08), transparent 46%),
    var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}

.citation-output {
  display: grid;
  gap: 13px;
}

.citation-box {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 13px;
  background: #fffdf8;
  box-shadow: inset 3px 0 0 rgba(37, 99, 111, 0.25);
}

.citation-box p {
  font-family: Georgia, serif;
  margin: 6px 0 12px;
}

.state-banner {
  border-radius: 8px;
  padding: 11px;
  margin-bottom: 13px;
  border: 1px solid var(--color-border);
}

.state-banner.warning {
  border-color: #e3c06a;
  background: #fff6d8;
}

.state-banner.error {
  border-color: #eba8a0;
  background: #fff0ee;
}

.sections {
  display: grid;
  gap: 25px;
  padding: 22px 0 0;
}

.section {
  padding: 32px 0;
}

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

.content-card {
  padding: 16px;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.content-card:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 111, 0.35);
  box-shadow: 0 12px 26px rgba(31, 41, 51, 0.09);
}

.link-grid a {
  color: var(--color-text);
}

.link-grid a:hover {
  text-decoration: none;
}

.link-grid a:hover h3 {
  color: var(--color-primary);
}

.related-list {
  margin: 8px 0 0;
  padding-left: 20px;
  line-height: 1.8;
}

.notice {
  padding: 16px;
  background: #fffaf0;
  border-color: #e4c990;
}

.bottom-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(37, 99, 111, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(37, 99, 111, 0.1), transparent 52%),
    var(--color-surface);
  box-shadow: var(--shadow-panel);
}

.bottom-cta h2 {
  margin-bottom: 8px;
}

.bottom-cta p {
  margin: 0;
  color: var(--color-text-muted);
}

.faq-list {
  display: grid;
  gap: 9px;
}

details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 13px 14px;
}

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

.article-page,
.legal-page {
  width: min(100% - 32px, 900px);
  margin: 0 auto;
  padding: 32px 0 65px;
}

.legal-page {
  max-width: 760px;
}

.article-page .content-card,
.legal-page .content-card {
  margin: 16px 0;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 22px 0 32px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--color-text-muted);
}

.site-footer p {
  margin: 6px 0 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hidden {
  display: none !important;
}

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

  .site-nav {
    justify-content: flex-start;
  }

  h1 {
    font-size: 27px;
  }

  .tool-grid,
  .section-grid,
  .cards-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .result-panel {
    position: static;
  }

  .button,
  .secondary-button,
  .copy-button {
    width: 100%;
  }

  .bottom-cta {
    align-items: stretch;
    flex-direction: column;
  }
}
