/* ===== Directive 8020 Guide — Deep-space horror theme ===== */
:root {
  --void: #05080f;        /* deep space void */
  --hull: #0a1220;        /* ship hull */
  --panel: #101b2e;       /* panel surface */
  --steel: #1b2a45;       /* metal accents */
  --ice: #7fb4e8;         /* cold blue light */
  --cyan-warn: #4dc9ff;   /* status blue */
  --alert: #e8433a;       /* alarm red */
  --amber: #f5b942;       /* caution amber */
  --bone: #dfe6ee;        /* text */
  --ink-soft: #9fb2c8;    /* secondary text */
  --ink-faint: #5d7188;   /* muted */
  --line: rgba(127, 180, 232, .22);
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, var(--void), var(--hull) 45%, #081120);
  color: var(--bone);
  line-height: 1.65;
  min-height: 100vh;
}

/* ===== Header ===== */
.site-header { background: rgba(5, 8, 15, .94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px); }
.nav-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--bone); font-weight: 700; font-size: 1.02rem; white-space: nowrap; }
.brand .sigil { width: 26px; height: 26px; border-radius: 4px; background: radial-gradient(circle at 30% 30%, #aac8e8, var(--ice) 55%, var(--hull)); box-shadow: 0 0 10px rgba(127,180,232,.5); display: inline-block; transform: rotate(45deg); }
.brand em { color: var(--ice); font-style: normal; }
.nav-links { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav-links a { color: rgba(223,230,238,.85); padding: 6px 9px; border-radius: 8px; font-size: .86rem; transition: all .2s; white-space: nowrap; font-weight: 500; text-decoration: none; }
.nav-links a:hover, .nav-links a.active { background: rgba(79,201,255,.14); color: var(--cyan-warn); }
.nav-links a.hub-btn {
  color: var(--amber); border: 1px solid var(--amber); background: rgba(245,185,66,.08);
  padding: 5px 11px; border-radius: 16px; font-weight: 600; font-size: .78rem;
  margin-right: 2px; white-space: nowrap;
}
.nav-links a.hub-btn:hover { background: var(--amber); color: #14110a; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--bone); font-size: 1.2rem; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.search-box { position: relative; }
.search-box input {
  background: rgba(8, 14, 24, .9); border: 1px solid var(--line); color: var(--bone);
  border-radius: 20px; padding: 7px 14px; width: 190px; font-size: .85rem; outline: none;
}
.search-box input:focus { border-color: var(--ice); box-shadow: 0 0 8px rgba(127,180,232,.3); }
#searchResults {
  position: absolute; right: 0; top: calc(100% + 6px); width: 320px; max-height: 360px; overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.6); z-index: 99; display: none;
}
#searchResults .sr-item { display: block; padding: 8px 12px; color: var(--ink-soft); text-decoration: none; font-size: .85rem; border-bottom: 1px solid rgba(127,180,232,.12); }
#searchResults .sr-item:hover { background: rgba(79,201,255,.1); color: var(--cyan-warn); }

/* ===== Hero ===== */
.hero { text-align: center; padding: 64px 20px 48px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background:
    radial-gradient(ellipse at 20% 70%, rgba(79,201,255,.16), transparent 50%),
    radial-gradient(ellipse at 85% 25%, rgba(232,67,58,.12), transparent 50%);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); color: var(--bone); text-shadow: 0 0 22px rgba(127,180,232,.4); position: relative; }
.hero h1 span { color: var(--alert); text-shadow: 0 0 22px rgba(232,67,58,.5); }
.hero .sub { max-width: 760px; margin: 14px auto 0; color: var(--ink-soft); font-size: 1.04rem; position: relative; }
.hero .meta { margin-top: 18px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; position: relative; }
.badge { background: rgba(127,180,232,.1); border: 1px solid rgba(127,180,232,.35); color: var(--ice); font-size: .8rem; padding: 5px 12px; border-radius: 20px; }
.badge.hot { background: rgba(232,67,58,.12); border-color: rgba(232,67,58,.45); color: #ff8a83; }

/* ===== Layout ===== */
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px 40px; }
.section-title { font-size: 1.45rem; margin: 40px 0 16px; color: var(--ice); display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.t-icon { font-size: 1.1rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-decoration: none; color: var(--bone); transition: all .25s; display: block;
}
.card:hover { border-color: var(--ice); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(127,180,232,.12); }
.c-icon { font-size: 1.6rem; margin-bottom: 8px; }
.c-title { font-weight: 700; font-size: 1.05rem; color: var(--ice); }
.c-desc { font-size: .88rem; color: var(--ink-soft); margin-top: 6px; }
.c-meta { font-size: .75rem; color: var(--ink-faint); margin-top: 10px; text-transform: uppercase; letter-spacing: .5px; }

/* ===== Panels / Tables ===== */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 14px 0; }
.panel.alert { border-left: 4px solid var(--alert); background: linear-gradient(90deg, rgba(232,67,58,.08), transparent); }
.panel.blue { border-left: 4px solid var(--ice); background: linear-gradient(90deg, rgba(127,180,232,.08), transparent); }
.panel.amber { border-left: 4px solid var(--amber); background: linear-gradient(90deg, rgba(245,185,66,.08), transparent); }
.panel .p-title { font-weight: 700; font-size: .96rem; margin-bottom: 6px; color: var(--ice); }
.panel p { font-size: .92rem; color: var(--ink-soft); }

.shot { margin: 18px 0 6px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.shot img { width: 100%; height: auto; display: block; }
.shot .cap { padding: 8px 12px; font-size: .82rem; color: var(--ink-faint); background: var(--panel); border-top: 1px solid var(--line); }
.shot .cap .src { opacity: .7; font-size: .72rem; }
.hero-shot { margin: 0 0 28px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.hero-shot img { width: 100%; height: auto; display: block; }
.hero-shot .cap { padding: 10px 14px; font-size: .85rem; color: var(--ink-faint); background: var(--panel); border-top: 1px solid var(--line); }

.table-wrap { overflow-x: auto; margin: 14px 0; border-radius: 10px; border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; background: var(--panel); font-size: .87rem; min-width: 560px; }
table.data th { background: #0e1c31; color: var(--ice); text-align: left; padding: 10px 14px; font-weight: 600; white-space: nowrap; }
table.data td { padding: 9px 14px; border-top: 1px solid rgba(127,180,232,.14); color: var(--ink-soft); vertical-align: top; }
table.data tr:hover td { background: rgba(79,201,255,.05); }

/* ===== Sidebar ===== */
.with-sidebar { display: grid; grid-template-columns: 220px 1fr; gap: 26px; align-items: start; }
.toc { position: sticky; top: 78px; background: rgba(7, 12, 22, .88); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; font-size: .85rem; max-height: 70vh; overflow: auto; }
.toc h4 { color: var(--ice); margin-bottom: 8px; font-size: .82rem; text-transform: uppercase; letter-spacing: .6px; }
.toc a { display: block; color: var(--ink-soft); text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.toc a:hover { color: var(--cyan-warn); background: rgba(79,201,255,.08); }
#content h2 { margin-top: 36px; color: var(--ice); font-size: 1.35rem; }
#content h3 { margin-top: 22px; color: var(--cyan-warn); font-size: 1.08rem; }
#content p, #content li { color: var(--ink-soft); font-size: .95rem; }
#content ul, #content ol { padding-left: 22px; margin: 8px 0; }
#content b { color: var(--bone); }
.version-note { display: inline-block; font-size: .78rem; color: var(--ink-faint); background: rgba(127,180,232,.07); border: 1px solid rgba(127,180,232,.2); border-radius: 20px; padding: 4px 12px; margin-bottom: 14px; }
.breadcrumb { font-size: .82rem; color: var(--ink-faint); margin-bottom: 10px; }
.breadcrumb a { color: var(--ice); text-decoration: none; }

/* ===== FAQ ===== */
.faq-item { margin-bottom: 12px; }
.faq-item details { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.faq-item summary { cursor: pointer; font-weight: 600; color: var(--ice); }
.faq-item p { margin-top: 8px; font-size: .92rem; color: var(--ink-soft); }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); background: rgba(4, 7, 13, .92); margin-top: 40px; }
.site-footer .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; padding-top: 28px; padding-bottom: 20px; }
.f-title { color: var(--ice); font-weight: 700; margin-bottom: 8px; font-size: .92rem; }
.site-footer ul { list-style: none; }
.site-footer li a { color: var(--ink-soft); text-decoration: none; font-size: .86rem; }
.site-footer li a:hover { color: var(--cyan-warn); }
.site-footer .copyright { grid-column: 1 / -1; font-size: .78rem; color: var(--ink-faint); border-top: 1px solid rgba(127,180,232,.14); padding-top: 14px; margin-top: 8px; }
.site-footer .copyright a { color: var(--ice); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .with-sidebar { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .with-sidebar > * { min-width: 0; }
  .table-wrap { max-width: 100%; }
  .toc { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .nav-toggle { display: inline-block; }
  .nav-links { display: none; width: 100%; flex-direction: column; }
  .nav-links.open { display: flex; }
  .search-box input { width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 16px 32px; }
}
/* heading hierarchy fix 2026-09-15: TOC label is navigation, not a heading */
.toc .toc-label { color: var(--ice); margin-bottom: 8px; font-size: .82rem; text-transform: uppercase; letter-spacing: .6px; }
