:root {
  --ink: #0b1220;
  --plate: #ffffff;
  --foam: #f6f7f9;
  --steel: #637083;
  --sear: #d9480f;
  --leaf: #16a34a;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--plate);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
}

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

a:hover,
a:focus {
  text-decoration: underline;
}

a:focus {
  outline: 3px solid rgba(217, 72, 15, 0.35);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  background: var(--plate);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

.main-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-weight: 600;
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.header-search input[type="search"] {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  min-width: 180px;
}

.progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: transparent;
}

.reading-progress {
  display: block;
  width: 0;
  height: 100%;
  background: var(--sear);
}

main {
  padding: 32px 0 80px;
}

.layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.toc {
  position: sticky;
  top: 120px;
}

.toc details {
  background: var(--foam);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.toc summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.toc a {
  color: var(--steel);
  font-size: 0.95rem;
}

.toc a.is-active {
  color: var(--sear);
  font-weight: 600;
}

.article-body section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

.article-body section:last-of-type,
.article-body details:last-of-type {
  border-bottom: none;
}

.hero {
  padding-top: 0;
}

.hero .intent {
  color: var(--leaf);
  font-weight: 600;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: 2.4rem;
  margin: 0 0 12px;
}

.hero .sub {
  font-size: 1.1rem;
  margin: 0 0 20px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 16px;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.btn-primary {
  background: var(--sear);
  color: var(--plate);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover,
.btn-primary:focus {
  transform: translateY(-2px);
}

.btn-secondary {
  color: var(--sear);
  border: 2px solid var(--sear);
  background: var(--plate);
}

.hero-media {
  margin: 32px 0 0;
}

.hero-media figcaption {
  color: var(--steel);
  font-size: 0.95rem;
  margin-top: 8px;
}

.page-meta {
  background: var(--foam);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin: 32px 0 0;
}

.page-meta p {
  margin: 0 0 8px;
}

.card {
  background: var(--plate);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 24px;
}

.card-grid {
  display: grid;
  gap: 24px;
}

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

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

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table caption {
  caption-side: top;
  text-align: left;
  color: var(--steel);
  margin-bottom: 12px;
}

.table th,
.table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table thead th {
  background: var(--foam);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table tbody tr:nth-child(even) {
  background: var(--foam);
}

.care-steps {
  margin: 16px 0 0;
  padding-left: 20px;
}

.care-steps li {
  margin-bottom: 8px;
}

.faq-list details {
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: var(--plate);
  box-shadow: var(--shadow-sm);
}

.faq-list summary {
  font-weight: 600;
  cursor: pointer;
}

.related-grid article {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.next-steps .cta-row {
  margin-top: 20px;
}

.changelog {
  margin: 40px 0 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--foam);
}

.disclosure {
  background: var(--foam);
  border-left: 4px solid var(--leaf);
  padding: 18px 24px;
  border-radius: 16px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}

.disclosure p {
  margin: 0;
}

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

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.footer-meta {
  color: var(--steel);
  font-size: 0.9rem;
  margin-top: 16px;
}

.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;
}

@media (min-width: 720px) {
  .layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .toc {
    flex: 0 0 240px;
  }

  .article-body {
    flex: 1;
  }

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

  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .header-search {
    width: 100%;
    margin-left: 0;
  }

  .header-search input[type="search"] {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .article-body section {
    padding: 40px 0;
  }

  .toc {
    position: static;
  }

  .toc details {
    width: 100%;
  }
}
