:root {
  --bg: #ffffff; --bg-soft: #f5f7fb; --text: #1b2433; --muted: #5a6678;
  --border: #dfe4ee; --code-bg: #f1f3f8; --card: #ffffff;
  --ink: #0e1a3a; --ink-2: #1c2f6e;
  --red: #c62d2d; --red-soft: #fdecec; --orange: #b85a08; --orange-soft: #fff0e0;
  --amber: #8f6a00; --amber-soft: #fff6d6; --green: #1b7a43; --green-soft: #e4f6ea;
  --topbar-h: 56px; --sidebar-w: 300px;
  color-scheme: light;
}
/* Every element that sets --h (the page body, a sidebar section, a card) gets its own accent colours. */
body, .nav li, .card {
  --accent: hsl(var(--h, 215) 70% 32%);
  --accent-bright: hsl(var(--h, 215) 72% 46%);
  --accent-soft: hsl(var(--h, 215) 85% 95%);
  --accent-tint: hsl(var(--h, 215) 75% 97.5%);
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar-h) + 12px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.emblem-gcc { display: inline-block; background: url("gcc-emblem.png") center / contain no-repeat; }

.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 20px; color: #fff;
  background: linear-gradient(90deg, var(--ink), var(--ink-2) 55%, hsl(var(--h, 215) 62% 36%));
  box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #fff; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .icon { width: 22px; height: 22px; }
.repo-link { font-size: 14px; white-space: nowrap; color: #fff; opacity: .9; }
.menu-btn {
  display: none; font-size: 20px; line-height: 1; padding: 6px 10px; cursor: pointer;
  background: none; color: #fff; border: 1px solid rgba(255, 255, 255, .4); border-radius: 6px;
}
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%; padding: 8px 12px; font: inherit; font-size: 14px;
  color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); border-radius: 8px;
}
.search input::placeholder { color: rgba(255, 255, 255, .78); }
.search input:focus { outline: 2px solid #fff; outline-offset: 1px; background: rgba(255, 255, 255, .22); }
#search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  max-height: 70vh; overflow-y: auto; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
#search-results[hidden] { display: none; }
#search-results a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); }
#search-results a:hover, #search-results a.active { background: var(--accent-soft); text-decoration: none; }
#search-results .r-title { font-weight: 600; }
#search-results .r-section { font-size: 12px; color: var(--muted); }
#search-results .r-snippet { font-size: 13px; color: var(--muted); }
#search-results mark { background: none; color: var(--accent); font-weight: 600; }
#search-results .empty { padding: 8px 10px; color: var(--muted); font-size: 14px; }

.layout { display: flex; align-items: flex-start; }
.sidebar {
  position: sticky; top: var(--topbar-h); flex: 0 0 var(--sidebar-w); width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 16px 12px 32px;
  background: var(--bg-soft); border-right: 1px solid var(--border); font-size: 14px;
}
.nav, .nav ul { list-style: none; margin: 0; padding: 0; }
.nav ul { margin: 2px 0 6px 14px; border-left: 2px solid var(--accent-soft); }
.nav a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--text); }
.nav a:hover { background: var(--accent-soft); text-decoration: none; }
.nav a.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav summary { cursor: pointer; list-style: none; display: flex; align-items: center; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::before { content: "\25B8"; width: 14px; color: var(--muted); flex: none; }
.nav details[open] > summary::before { content: "\25BE"; }
.nav summary a, .nav-group { flex: 1; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.nav-group { padding: 5px 10px; }
.nav summary .icon { color: var(--accent-bright); }

main { flex: 1; min-width: 0; max-width: 1020px; padding: 28px 40px 64px; }
.crumbs { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.crumbs span { color: var(--accent); font-weight: 600; }
article h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 24px; }
article h1 .icon { width: 1.05em; height: 1.05em; margin-right: .35em; vertical-align: -0.16em; }
article h1::after {
  content: ""; display: block; width: 72px; height: 5px; margin-top: 12px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-bright), hsl(calc(var(--h, 215) + 40) 72% 55%));
}
article h2 {
  font-size: 1.4rem; margin: 40px 0 12px; padding: 2px 0 2px 12px;
  border-left: 5px solid var(--accent-bright); border-radius: 2px;
}
article h3 { font-size: 1.1rem; margin: 28px 0 8px; color: var(--accent); }
article h4 { font-size: 1rem; margin: 26px 0 8px; }
article blockquote {
  margin: 12px 0; padding: 10px 16px; background: var(--accent-tint);
  border-left: 4px solid var(--accent-bright); border-radius: 0 8px 8px 0;
}
article blockquote p { margin: 0; }
article blockquote.caution { background: var(--amber-soft); border-left-color: var(--amber); }
article blockquote.caution strong:first-child { color: var(--amber); }
article blockquote.danger { background: var(--red-soft); border-left-color: var(--red); }
article blockquote.danger strong:first-child { color: var(--red); }
article blockquote.note strong:first-child { color: var(--accent); }
article code {
  font: 0.875em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--code-bg); padding: 2px 5px; border-radius: 4px;
}
article pre {
  background: var(--code-bg); padding: 14px 16px; border-radius: 10px; overflow-x: auto; line-height: 1.45;
  border: 1px solid var(--border); border-top: 3px solid var(--accent-bright);
}
article pre code { background: none; padding: 0; }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { background: var(--accent-soft); color: var(--accent); font-weight: 700; white-space: nowrap; border-bottom: 2px solid var(--accent-bright); }
tbody tr:nth-child(even) td { background: var(--bg-soft); }
tbody tr:hover td { background: var(--accent-tint); }
tr:last-child td { border-bottom: none; }

/* Severity and method badges, and chips for control, risk and test case IDs. */
.badge {
  display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--bg-soft); color: var(--muted); border: 1px solid var(--border);
}
.sev-critical { background: var(--red-soft); color: var(--red); border-color: transparent; }
.sev-high { background: var(--orange-soft); color: var(--orange); border-color: transparent; }
.sev-medium-high, .sev-medium { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.sev-low { background: var(--green-soft); color: var(--green); border-color: transparent; }
a.chip {
  --c: 165; display: inline-block; padding: 0 7px; border-radius: 6px; white-space: nowrap;
  font: 600 0.82em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.7;
  color: hsl(var(--c) 70% 27%); background: hsl(var(--c) 70% 93%);
}
a.chip[href*="tc-"] { --c: 215; }
a.chip[href*="Risk_Register"] { --c: 8; }
a.chip:hover { text-decoration: none; filter: brightness(.95); }

/* Home page banner and link cards. */
.hero {
  margin: 0 0 28px; padding: 36px 36px 30px; border-radius: 18px; color: #fff;
  background:
    radial-gradient(900px 300px at 100% 0%, rgba(64, 224, 208, .35), transparent 60%),
    radial-gradient(700px 300px at 0% 100%, rgba(170, 90, 255, .35), transparent 60%),
    linear-gradient(135deg, var(--ink), var(--ink-2) 60%, #2a4bb0);
}
.hero h1 { margin: 0 0 10px; font-size: 2.4rem; line-height: 1.15; }
.hero-kicker { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.hero-kicker a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.hero-lead { margin: 0; max-width: 62ch; font-size: 1.08rem; opacity: .95; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 26px; }
.stat { padding: 14px 16px; border-radius: 12px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); }
.stat b { display: block; font-size: 1.9rem; line-height: 1.1; }
.stat span { font-size: 13px; opacity: .9; }
.hero-details { margin: 0 0 28px; }
.hero-details blockquote { margin: 0; }
.hero-sections { font-size: 1.4rem; margin: 0 0 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 16px 0 8px; }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 12px; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-top: 4px solid var(--accent-bright);
  transition: transform .15s, box-shadow .15s;
}
.card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(20, 30, 60, .14); }
.card-icon {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
}
.card-icon .icon { width: 22px; height: 22px; }
.card-title { font-weight: 700; font-size: 1.02rem; color: var(--accent); }
.card-text { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.card-count { margin-top: auto; padding-top: 6px; font-size: 12px; font-weight: 700; color: var(--accent); }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 14px; }
.pager a { padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); font-weight: 600; }
.pager a:hover { text-decoration: none; background: var(--accent-soft); border-color: var(--accent-bright); }
.pager .next { margin-left: auto; text-align: right; }
.profile-head { display: flex; align-items: center; gap: 16px; margin: 0 0 14px; }
.profile-head p { margin: 0; }
article img.figure { display: block; max-width: 100%; height: auto; margin: 16px 0 20px; border: 1px solid var(--border); border-radius: 8px; }
.profile-photo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--border); }
.site-footer { margin-top: 32px; font-size: 13px; color: var(--muted); }
.site-notice { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; line-height: 1.55; }
.site-notice p { margin: 0 0 6px; }
.cc-icon { width: 1.25em; height: 1.25em; margin-right: 3px; vertical-align: -.25em; fill: currentColor; }
.notfound { max-width: 560px; margin: 15vh auto; padding: 0 20px; }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .repo-link { display: none; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 15; height: auto;
    width: min(var(--sidebar-w), 86vw); transform: translateX(-100%); transition: transform .2s;
  }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  main { padding: 20px 16px 48px; }
  article h1 { font-size: 1.6rem; }
  .hero { padding: 24px 20px; border-radius: 14px; }
  .hero h1 { font-size: 1.8rem; }
  .brand { font-size: 15px; }
  .pager { flex-direction: column; }
  .pager .next { margin-left: 0; text-align: left; }
}
@media print {
  .topbar, .sidebar, .pager { display: none; }
  .site-footer > a { display: none; }
  main { max-width: none; padding: 0; }
  .hero { color: #000; background: none; border: 1px solid #999; }
}
