:root {
      --brand: #ea580c;
      --brand-dark: #c2410c;
      --brand-soft: #fff7ed;
      --teal: #0d9488;
      --teal-soft: #f0fdfa;
      --ink: #0f172a;
      --muted: #475569;
      --line: #e2e8f0;
      --surface: #f8fafc;
      --max: min(100%, 72rem);
      --content: min(100%, 42rem);
      --radius: 0.75rem;
    }
    *, *::before, *::after { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
    }
    body {
      margin: 0;
      font-family: "Quicksand", "Segoe UI", Arial, sans-serif;
      font-weight: 500;
      color: var(--ink);
      background: #fff;
      line-height: 1.65;
      font-size: 1rem;
    }
    h1, h2, h3, h4, h5, h6 {
      font-family: "Roboto Slab", Georgia, serif;
      font-weight: 800;
    }
    a { color: var(--brand-dark); }
    a:hover { text-decoration: underline; }

    .hero {
      position: relative;
      background: linear-gradient(145deg, var(--brand-soft) 0%, #fff 42%, var(--teal-soft) 100%);
      border-bottom: 1px solid var(--line);
      padding: 2.25rem 1.25rem 3rem;
      overflow: hidden;
    }
    .hero::before {
      content: "";
      position: absolute;
      inset: 0;
      background-image:
        radial-gradient(circle at 20% 30%, rgba(234, 88, 12, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(13, 148, 136, 0.07) 0%, transparent 40%);
      pointer-events: none;
    }
    .hero .inner { position: relative; max-width: var(--max); margin: 0 auto; }
    .crumb { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.85rem; }
    .crumb a { color: var(--muted); text-decoration: none; }
    .crumb a:hover { color: var(--brand-dark); text-decoration: underline; }
    h1 {
      margin: 0 0 0.85rem;
      font-size: clamp(1.85rem, 4.2vw, 2.45rem);
      font-weight: 800;
      letter-spacing: -0.035em;
      line-height: 1.15;
      max-width: 18ch;
    }
    .lede {
      margin: 0 0 1.5rem;
      font-size: 1.125rem;
      color: var(--muted);
      max-width: 38rem;
    }
    .hero-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin: 0;
      padding: 0;
      list-style: none;
    }
    .hero-badges li {
      font-size: 0.8rem;
      font-weight: 600;
      padding: 0.35rem 0.75rem;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.85);
      border: 1px solid var(--line);
      color: var(--ink);
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    .layout {
      max-width: var(--max);
      margin: 0 auto;
      padding: 0 1.25rem 4rem;
      display: grid;
      gap: 2.5rem;
    }
    @media (min-width: 960px) {
      .layout {
        grid-template-columns: 14rem 1fr;
        align-items: start;
        padding-top: 2rem;
      }
    }

    .toc {
      position: sticky;
      top: 1rem;
      align-self: start;
      padding: 1rem 0;
    }
    .toc-title {
      font-size: 0.7rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--muted);
      margin: 0 0 0.75rem;
    }
    .toc ul { margin: 0; padding: 0; list-style: none; }
    .toc a {
      display: block;
      font-size: 0.875rem;
      padding: 0.4rem 0;
      color: var(--muted);
      text-decoration: none;
      border-left: 2px solid transparent;
      padding-left: 0.75rem;
      margin-left: -2px;
      transition: color 0.15s, border-color 0.15s;
    }
    .toc a:hover { color: var(--brand-dark); border-left-color: rgba(234, 88, 12, 0.35); }
    .toc a:focus-visible {
      outline: 2px solid var(--brand);
      outline-offset: 2px;
      border-radius: 4px;
    }
    @media (max-width: 959px) {
      .toc {
        position: relative;
        top: 0;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: 1rem 1.25rem;
        background: var(--surface);
      }
      .toc ul { columns: 2; column-gap: 1.5rem; }
      .toc li { break-inside: avoid; }
    }

    .main article > section {
      padding-top: 2.75rem;
      border-top: 1px solid var(--line);
      margin-top: 0.25rem;
      scroll-margin-top: 1.25rem;
    }
    .main article > section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

    h2 {
      margin: 0 0 0.85rem;
      font-size: clamp(1.35rem, 2.5vw, 1.55rem);
      font-weight: 700;
      letter-spacing: -0.025em;
    }
    h3 {
      margin: 1.5rem 0 0.5rem;
      font-size: 1.08rem;
      font-weight: 600;
    }
    .subhead {
      font-size: 1.05rem;
      color: var(--muted);
      margin: -0.35rem 0 1.25rem;
      max-width: var(--content);
    }
    p { margin: 0 0 1rem; color: var(--muted); max-width: var(--content); }
    p strong { color: var(--ink); }
    ul.detail-list {
      margin: 0 0 1.15rem;
      padding-left: 1.2rem;
      color: var(--muted);
      max-width: var(--content);
    }
    ul.detail-list li { margin-bottom: 0.45rem; }

    .steps {
      counter-reset: s;
      list-style: none;
      padding: 0;
      margin: 0 0 1.25rem;
      max-width: var(--content);
    }
    .steps li {
      position: relative;
      padding-left: 2.65rem;
      margin-bottom: 1.15rem;
      color: var(--muted);
    }
    .steps li::before {
      counter-increment: s;
      content: counter(s);
      position: absolute;
      left: 0;
      top: 0.05rem;
      width: 1.85rem;
      height: 1.85rem;
      background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
      color: #fff;
      font-weight: 800;
      font-size: 0.82rem;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
    }
    .doc-step-figure {
      margin: 0.85rem 0 0;
      padding: 0;
      max-width: min(100%, 52rem);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      overflow: hidden;
      background: #fff;
    }
    .doc-step-figure img {
      display: block;
      width: 100%;
      height: auto;
      vertical-align: middle;
    }
    .doc-step-figure figcaption {
      font-size: 0.8rem;
      color: var(--muted);
      padding: 0.5rem 0.75rem 0.65rem;
      background: var(--surface);
      border-top: 1px solid var(--line);
      line-height: 1.4;
    }

    .panel {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 1.25rem 1.35rem;
      margin: 1.25rem 0;
      max-width: min(100%, 48rem);
    }
    .panel h4 {
      margin: 0 0 0.65rem;
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--ink);
    }
    .panel p:last-child { margin-bottom: 0; }

    .callout {
      border-left: 4px solid var(--teal);
      background: var(--teal-soft);
      padding: 1rem 1.25rem;
      border-radius: 0 var(--radius) var(--radius) 0;
      margin: 1.25rem 0;
      max-width: min(100%, 48rem);
    }
    .callout p { margin: 0; color: var(--ink); }
    .callout.muted { border-left-color: var(--brand); background: var(--brand-soft); }

    .grid-2 {
      display: grid;
      gap: 1rem;
      margin: 1.25rem 0 1.5rem;
      max-width: min(100%, 52rem);
    }
    @media (min-width: 640px) {
      .grid-2 { grid-template-columns: repeat(2, 1fr); }
    }

    .card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 1.15rem 1.25rem;
      transition: box-shadow 0.2s, border-color 0.2s;
    }
    .card:hover {
      border-color: rgba(234, 88, 12, 0.35);
      box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    }
    .card .tag {
      display: inline-block;
      font-size: 0.68rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--teal);
      background: var(--teal-soft);
      padding: 0.2rem 0.5rem;
      border-radius: 4px;
      margin-bottom: 0.5rem;
    }
    .card h3 {
      margin: 0 0 0.45rem;
      font-size: 1rem;
      color: var(--ink);
    }
    .card p { margin: 0; font-size: 0.94rem; max-width: none; }

    .sample-grid {
      display: grid;
      gap: 1rem;
      margin: 1.5rem 0;
    }
    @media (min-width: 720px) {
      .sample-grid { grid-template-columns: repeat(2, 1fr); }
    }

    .sample-card {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      overflow: hidden;
      background: #fff;
    }
    .sample-card .head {
      padding: 0.85rem 1.1rem;
      background: linear-gradient(90deg, var(--surface) 0%, #fff 100%);
      border-bottom: 1px solid var(--line);
      font-weight: 700;
      font-size: 0.95rem;
      color: var(--ink);
    }
    .sample-card .body {
      padding: 1rem 1.1rem 1.15rem;
      font-size: 0.92rem;
      color: var(--muted);
    }
    .sample-card .body p { margin: 0 0 0.65rem; max-width: none; }
    .sample-card .body p:last-child { margin-bottom: 0; }
    .sample-card code {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
      font-size: 0.82em;
      background: var(--surface);
      padding: 0.12rem 0.35rem;
      border-radius: 4px;
      color: var(--ink);
    }

    table.rules {
      width: 100%;
      max-width: min(100%, 48rem);
      border-collapse: collapse;
      font-size: 0.9rem;
      margin: 1rem 0 1.25rem;
    }
    table.rules th,
    table.rules td {
      border: 1px solid var(--line);
      padding: 0.65rem 0.85rem;
      text-align: left;
      vertical-align: top;
    }
    table.rules th {
      background: var(--surface);
      font-weight: 600;
      color: var(--ink);
    }
    table.rules td { color: var(--muted); }
    table.rules code {
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
      font-size: 0.85em;
    }

    .pill-row {
      display: flex;
      flex-wrap: wrap;
      gap: 0.4rem;
      margin: 0.75rem 0 1rem;
    }
    .pill {
      font-size: 0.78rem;
      font-weight: 600;
      padding: 0.3rem 0.65rem;
      border-radius: 6px;
      background: var(--surface);
      border: 1px solid var(--line);
      color: var(--ink);
    }

    .note {
      font-size: 0.92rem;
      padding: 1rem 1.25rem;
      background: var(--brand-soft);
      border-radius: var(--radius);
      border: 1px solid rgba(234, 88, 12, 0.22);
      color: var(--ink);
      max-width: min(100%, 48rem);
    }
    .note p { margin: 0; color: inherit; max-width: none; }

    footer {
      margin-top: 2rem;
      padding: 1.75rem 1.25rem;
      border-top: 1px solid var(--line);
      font-size: 0.85rem;
      color: var(--muted);
      text-align: center;
      background: var(--surface);
    }
