:root {
  --bg: #f5f6fa;
  --surface: #fff;
  --surface2: #f8f9fc;
  --border: #e4e7ef;
  --border2: #d1d5e0;
  --accent: #059669;
  --blue-l: #eff4ff;
  --blue-m: #dbe8ff;
  --text: #111827;
  --t2: #374151;
  --t3: #6b7280;
  --t4: #9ca3af;
  --sw: 268px;
  --hh: 56px;
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family:
    "Inter",
    -apple-system,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.5;
}
header {
  height: var(--hh);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 50;
}
.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-mark svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}
.logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.logo-text span {
  font-weight: 400;
  color: var(--t3);
  margin-left: 6px;
  font-size: 13px;
}
.bw {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.sb {
  width: var(--sw);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.sbox {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.si {
  width: 100%;
  padding: 6px 10px 6px 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 10px center;
}
.si::placeholder {
  color: var(--t4);
}
.si:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.ns {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
}
.ns::-webkit-scrollbar {
  width: 4px;
}
.ns::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px;
}
.ni {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  padding: 5px 14px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--t3);
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1.45;
}
.ni:hover {
  color: var(--t2);
  background: var(--bg);
}
.ni.h1 {
  font-weight: 600;
  font-size: 13px;
  color: var(--t2);
  padding: 7px 14px;
  margin-top: 4px;
}
.ni.h2 {
  padding-left: 26px;
  font-size: 12.5px;
}
.ni.h3 {
  padding-left: 38px;
  font-size: 12px;
  color: var(--t4);
}
.ni.h3:hover {
  color: var(--t3);
}
/* Active / selected nav item — uses role-specific variables */
.ni.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-bg, transparent);
}
.sr-header {
  display: none;
  padding: 12px 16px;
  background: var(--blue-l);
  border: 1px solid var(--blue-m);
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #1e40af;
}
.sr-header.vis {
  display: block;
}
.sr-match {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.12s;
}
.sr-match:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.12);
}
.sr-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.sr-ctx {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.5;
}
.sr-ctx mark,
.sr-title mark {
  background: #fef3c7;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.ca {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}
.ca::-webkit-scrollbar {
  width: 6px;
}
.ca::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px;
}
.ci {
  max-width: 1100px;
  width: 90%;
  margin: 0 auto;
  padding: 32px 40px 80px;
}
.sa {
  scroll-margin-top: 20px;
}
h1.h {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 36px 0 10px;
  letter-spacing: -0.02em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
h1.h:first-of-type {
  margin-top: 0;
}
h2.hh {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 8px;
}
h3.hhh {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 8px;
}
p {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--t2);
  margin-bottom: 12px;
}
ul {
  margin: 8px 0 14px;
  padding: 0;
  list-style: none;
}
ul li {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--t2);
  padding: 3px 0 3px 20px;
  position: relative;
}
ul li::before {
  content: "·";
  position: absolute;
  left: 7px;
  color: var(--accent);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}
ul li strong {
  color: var(--text);
  font-weight: 600;
}
ol {
  margin: 8px 0 14px;
  padding: 0;
  list-style: none;
  counter-reset: ol;
}
ol li {
  counter-increment: ol;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--t2);
  padding: 3px 0 3px 28px;
  position: relative;
}
ol li::before {
  content: counter(ol) ".";
  position: absolute;
  left: 0;
  top: 3px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--t2);
  min-width: 22px;
}
ol li strong {
  color: var(--text);
  font-weight: 600;
}
.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--blue-l);
  border: 1px solid var(--blue-m);
  border-radius: 8px;
  padding: 11px 14px;
  margin: 12px 0;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.6;
}
.ni2 {
  flex-shrink: 0;
  font-size: 15px;
  margin-top: 1px;
}
.note.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.b-neutral {
  background: #e5e7eb;
  color: #374151;
}
.b-low {
  background: #fef9c3;
  color: #854d0e;
}
.b-medium {
  background: #fed7aa;
  color: #9a3412;
}
.b-high {
  background: #fecaca;
  color: #991b1b;
}
.b-disq {
  background: #450a0a;
  color: #fca5a5;
}
.st {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 14px 0 20px;
  font-size: 13px;
}
.st thead {
  background: var(--surface2);
}
.st th {
  padding: 9px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--t3);
  border-bottom: 1px solid var(--border);
}
.st td {
  padding: 9px 14px;
  color: var(--t2);
  border-bottom: 1px solid var(--border);
}

figure.fig {
  margin: 18px 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

figure.fig img,
img {
  max-width: 100%;
  height: auto;
  display: block;
}

figcaption {
  font-size: 12px;
  color: var(--t3);
  margin: 0;
  padding: 12px 14px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
}

/* Inline-style replacements */
#search-panel { display: none; }
.logo-mark.logo-mark--img { background: transparent; padding: 0; }
.logo-mark.logo-mark--img img { width: 40px; height: 40px; object-fit: contain; display: block; }
