/* ── Reset & Base ──────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.7;
  color: #1a1a1a;
  background: #fff;
  padding: 2rem 1rem;
}

/* ── Content Container ─────────────────────────────────────── */

article {
  max-width: 720px;
  margin: 0 auto;
}

/* ── Typography ────────────────────────────────────────────── */

h1, h2, h3, h4 {
  color: #111;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2rem; margin-top: 0; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  margin-bottom: 1rem;
}

.shortdesc {
  font-size: 1.125rem;
  color: #555;
  margin-bottom: 1.5rem;
}

/* ── Links ─────────────────────────────────────────────────── */

a {
  color: #0366d6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Lists ─────────────────────────────────────────────────── */

ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.75rem;
}

li {
  margin-bottom: 0.35rem;
}

li > ul, li > ol {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

/* ── Definition Lists ──────────────────────────────────────── */

dl {
  margin-bottom: 1rem;
}

dt {
  font-weight: 600;
  margin-top: 0.75rem;
}

dd {
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ── Tables ────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

th, td {
  padding: 0.6rem 0.75rem;
  border: 1px solid #ddd;
  text-align: left;
}

th {
  background: #f6f8fa;
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background: #fafbfc;
}

/* ── Code ──────────────────────────────────────────────────── */

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  background: #f3f4f6;
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

pre > code {
  display: block;
  padding: 1rem;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 6px;
  line-height: 1.5;
  font-size: 0.875rem;
}

/* ── Callout Notes ─────────────────────────────────────────── */

.note {
  padding: 1rem 1rem 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid #0366d6;
  background: #f0f7ff;
  border-radius: 0 4px 4px 0;
}

.note-warning {
  border-left-color: #e36209;
  background: #fff8f0;
}

.note-danger {
  border-left-color: #d73a49;
  background: #fff5f5;
}

.note-tip {
  border-left-color: #28a745;
  background: #f0fff4;
}

.note-caution {
  border-left-color: #e36209;
  background: #fff8f0;
}

.note-important {
  border-left-color: #6f42c1;
  background: #f5f0ff;
}

/* ── Figures ───────────────────────────────────────────────── */

figure {
  margin: 1.5rem 0;
}

figcaption {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
}

/* ── Images ────────────────────────────────────────────────── */

.tpl-main img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
}

/* ── Steps (Task Documents) ────────────────────────────────── */

ol.steps {
  counter-reset: step-counter;
  list-style: none;
  padding-left: 0;
}

ol.steps > li.step {
  counter-increment: step-counter;
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.5rem;
}

ol.steps > li.step::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: #0366d6;
  color: #fff;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cmd {
  font-weight: 600;
}

.info {
  margin-top: 0.5rem;
  color: #444;
}

.stepresult {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f6f8fa;
  border-radius: 4px;
  font-size: 0.95rem;
}

/* ── Sections ──────────────────────────────────────────────── */

section {
  margin-top: 2rem;
}

.body {
  margin-top: 1rem;
}

/* ── Table of Contents ─────────────────────────────────────── */

nav.toc ul {
  list-style: none;
  padding-left: 0;
}

nav.toc > ul > li {
  margin-bottom: 0.5rem;
}

nav.toc ul ul {
  padding-left: 1.5rem;
  margin-top: 0.25rem;
}

nav.toc a {
  display: inline-block;
  padding: 0.2rem 0;
}

/* ── Print ─────────────────────────────────────────────────── */

@media print {
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
    padding: 0;
  }

  article {
    max-width: none;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  .note {
    border-left-width: 2px;
    background: none;
  }

  pre > code {
    border: 1px solid #ccc;
    background: none;
  }
}
