/* =========================================================================
   OASIS TC Operations Handbook (internal) design system
   Faithful to the public TC Handbook editorial treatment: standards-body
   reference, OASIS blue as a restrained accent on cloud. Single-page build.
   No left-side coloured accent bars anywhere.
   ========================================================================= */

:root {
  --accent:        #2248e5;
  --accent-2:      #1a38c0;
  --ink:           #0a2540;
  --ink-2:         #313131;
  --bg:            #edf3f9;
  --surface:       #fafcfe;
  --surface-alt:   #f2f6fb;
  --muted:         #6b7380;
  --border:        #d5dae0;
  --border-strong: #aeb7c4;
  --rust:          #b94a0d;
  --good:          #15803d;
  --navy-3:        #0a4a8f;

  --serif: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --sans:  "Poppins", "Helvetica Neue", Arial, sans-serif;
  --mono:  "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --max: 1320px;
  --measure: 82ch;
  --radius: 2px;
  --shadow-sm: 0 1px 2px rgba(10,37,64,0.04);
  --shadow:    0 2px 8px rgba(10,37,64,0.06);
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
:target { scroll-margin-top: 128px; }
[id] { scroll-margin-top: 128px; }

.skip-link {
  position: absolute; left: 12px; top: -48px;
  background: var(--accent); color: #fff; padding: 8px 14px;
  border-radius: 0 0 6px 6px; z-index: 60; text-decoration: none; font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.62;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.masthead__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand__pipe { width: 1px; height: 26px; background: var(--border-strong); }
.brand__title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.chip {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
}

/* ---------- Internal-use notice bar ---------- */
.notice-bar {
  position: sticky;
  top: 55px;
  z-index: 29;
  background: #fdf4ee;
  border-bottom: 1px solid #ecd7c5;
  color: var(--rust);
}
.notice-bar__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 7px 24px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.notice-bar__inner::before {
  content: "";
  width: 9px; height: 9px; border-radius: 2px;
  background: currentColor; flex: none;
}

/* ---------- Layout shell ---------- */
.shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* ---------- Sidebar nav ---------- */
.sidebar {
  position: sticky;
  top: 128px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  padding-bottom: 18px;
  max-height: calc(100vh - 148px);
  overflow-y: auto;
}
.sidebar__label {
  font-size: 11px;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 4px 12px 8px;
}
.sidebar__group { margin: 2px 0; }
.sidebar__chapter {
  display: block;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-radius: 5px;
}
.sidebar__chapter:hover { background: var(--bg); color: var(--accent); }
.sidebar__chapter.is-active {
  background: var(--bg);
  color: var(--accent);
}
.sidebar__sub { margin: 1px 0 8px; }
.sidebar__sub a {
  display: block;
  padding: 5px 12px 5px 22px;
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 5px;
  line-height: 1.4;
}
.sidebar__sub a:hover { background: var(--bg); color: var(--accent); }
.sidebar__sub a.is-active {
  background: var(--bg);
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Content ---------- */
.content { min-width: 0; }

.doc-masthead {
  margin: 0 0 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-strong);
}
.doc-masthead h1 {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 12px;
  max-width: 22ch;
}
.doc-masthead__status {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 16px;
}
.doc-masthead__scope {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 72ch;
  margin: 0;
}

.chapter { padding-top: 8px; }
.chapter + .chapter {
  margin-top: 40px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.content h2 {
  position: relative;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin: 6px 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.005em;
}
.content h3 {
  position: relative;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 28px 0 9px;
}
.content p { margin: 0 0 14px; max-width: var(--measure); }
.content ul, .content ol { margin: 0 0 14px; padding-left: 22px; max-width: var(--measure); }
.content li { margin: 5px 0; }
.content a { color: var(--accent); text-underline-offset: 2px; text-decoration-color: rgba(34,72,229,0.35); }
.content a:hover { text-decoration-color: var(--accent); }
.content strong { color: var(--ink); font-weight: 600; }

/* Hover anchor on headings */
.anchor {
  position: absolute;
  left: -20px;
  top: 0;
  width: 20px;
  text-align: center;
  color: var(--border-strong);
  text-decoration: none;
  opacity: 0;
  font-weight: 500;
  transition: opacity .12s ease;
}
.content h2:hover .anchor,
.content h3:hover .anchor,
.anchor:focus { opacity: 1; }
.anchor:hover { color: var(--accent); }
@media (max-width: 980px) { .anchor { display: none; } }

/* ---------- Ops cards (definition blocks; NO left accent bar) ---------- */
.ops-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 4px 16px;
  margin: 18px 0;
  max-width: var(--measure);
  box-shadow: var(--shadow-sm);
}
.ops-card dl { margin: 0; }
.ops-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.ops-row:last-child { border-bottom: 0; }
.ops-row dt {
  font-size: 11px;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding-top: 1px;
}
.ops-row dd {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
}
@media (max-width: 560px) {
  .ops-row { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Tables ---------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 18px 0;
  max-width: var(--measure);
}
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data thead th {
  background: var(--surface-alt);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 9px 14px;
  border-bottom: 2px solid var(--border-strong);
  border-right: 1px solid var(--border);
}
table.data tbody th,
table.data td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
  background: var(--surface);
  text-align: left;
}
table.data thead th:last-child,
table.data tbody th:last-child,
table.data td:last-child { border-right: 0; }
table.data tbody th {
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-alt);
}
table.data tbody tr:last-child th,
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover th,
table.data tbody tr:hover td { background: var(--bg); }

/* ---------- Figures ---------- */
.figure {
  margin: 26px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 2px;
}
.figure--narrow img { max-width: 600px; }
.figure--shot img {
  border: 1px solid var(--border-strong);
  border-radius: 3px;
}
.figure figcaption {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  margin: 14px auto 0;
  max-width: 66ch;
  line-height: 1.5;
}
.figure figcaption b {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--navy-3);
  letter-spacing: 0.02em;
}

/* ---------- Callouts (engagement pass; NO left accent bar) ---------- */
.callout {
  border: 1px solid #e6d288;
  background: #fdf8e3;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0;
  max-width: var(--measure);
  box-shadow: var(--shadow-sm);
}
.callout__title {
  font-size: 11.5px;
  font-weight: 700;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.05em;
  color: #8a5d0a;
  margin: 0 0 5px;
}
.callout__body { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.callout__body p { margin: 0 0 8px; max-width: none; }
.callout__body p:last-child { margin-bottom: 0; }

/* ---------- Fenced code block (verbatim template text) ---------- */
pre.code-block {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 20px 0;
  max-width: var(--measure);
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

/* ---------- Stat strip (big number + label) ---------- */
.statstrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr));
  gap: 12px;
  margin: 20px 0;
  max-width: var(--measure);
}
.stat {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stat__num {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--accent-2);
}
.stat__label {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- Back to top ---------- */
.backtotop {
  display: inline-block;
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 12px;
}
.backtotop:hover { background: var(--surface); border-color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 48px;
}
.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 24px 40px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.site-footer a { color: var(--navy-3); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer__legal { font-size: 11px; margin-top: 10px; color: var(--border-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; gap: 22px; }
  .sidebar { position: static; max-height: none; top: auto; }
  .doc-masthead h1 { font-size: 28px; }
  .content h2 { font-size: 21px; }
  .notice-bar { position: static; top: auto; }
}

@media print {
  .masthead, .notice-bar, .sidebar, .backtotop, .site-footer__legal { display: none; }
  body { background: #fff; }
  .shell { display: block; max-width: none; padding: 0; }
  .content a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 10px; color: #555; }
}

/* ---- multi-page navigation (draft 0.3) ------------------------------------ */
.crumbs { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 44px 0 8px; }
.pager__link { display: flex; flex-direction: column; gap: 3px; max-width: 48%; padding: 12px 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm); text-decoration: none; }
.pager__link:hover { border-color: var(--accent); }
.pager__next { margin-left: auto; text-align: right; }
.pager__dir { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pager__title { font-size: 14px; font-weight: 600; color: var(--ink); }
.home-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px; margin: 24px 0 8px; }
.home-card { display: flex; gap: 12px; align-items: baseline; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm); text-decoration: none; }
.home-card:hover { border-color: var(--accent); }
.home-card__num { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--accent); min-width: 2.6ch; }
.home-card__title { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; }

/* keep the masthead version chip from overflowing narrow screens */
@media (max-width: 720px) { .chip { display: none; } }
