
:root {
  --bg: #f7f5ef;
  --panel: #ffffff;
  --text: #22201b;
  --muted: #6f6a5f;
  --line: #d8d2c5;
  --link: #136f63;
  --link-strong: #0b4d45;
  --missing: #9a3412;
  --code: #f0ebe2;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-strong); }
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--text);
  color: white;
  padding: .5rem .75rem;
  z-index: 10;
}
.skip-link:focus { top: 1rem; }
.site-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 1.25rem;
  border-right: 1px solid var(--line);
  background: #ede8dc;
}
.brand a {
  display: inline-block;
  color: var(--text);
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  margin-bottom: .25rem;
}
.brand p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.35;
}
.search-label {
  display: block;
  margin-bottom: .35rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .65rem .75rem;
  font: inherit;
  background: white;
}
.search-results {
  margin: .5rem 0 1rem;
  display: grid;
  gap: .35rem;
}
.nav-section-title {
  margin: .25rem 0 .45rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}
.search-result {
  display: block;
  padding: .55rem .6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .65);
  text-decoration: none;
}
.search-result .search-result-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.search-result strong,
.search-result span {
  display: block;
}
.search-result span {
  color: var(--muted);
  font-size: .78rem;
}
.search-result .search-result-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 1.2rem;
  padding: .12rem .4rem;
  border: 1px solid #c8ded6;
  border-radius: 999px;
  background: #edf8f4;
  color: var(--link-strong);
  font-size: .66rem;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}
.quick-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: .4rem;
  margin-bottom: 1rem;
}
.quick-links a {
  display: block;
  padding: .6rem .65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .55);
  text-decoration: none;
  font-size: .86rem;
}
.quick-links strong,
.quick-links span {
  display: block;
}
.quick-links strong {
  color: var(--text);
  font-size: .92rem;
}
.quick-links span {
  color: var(--muted);
  margin-top: .1rem;
}
.all-folders {
  border-top: 1px solid var(--line);
  padding-top: .75rem;
}
.all-folders > summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}
.all-folders > summary span {
  color: var(--muted);
  font-weight: 500;
}
.folder-nav details {
  border-top: 1px solid var(--line);
  padding: .45rem 0;
}
.folder-nav summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  font-size: .9rem;
}
.folder-nav summary span {
  color: var(--muted);
  font-weight: 500;
}
.folder-nav ul {
  list-style: none;
  margin: .4rem 0 .2rem;
  padding: 0 0 0 .6rem;
  display: grid;
  gap: .25rem;
}
.folder-nav li a {
  font-size: .84rem;
  text-decoration: none;
}
.muted { color: var(--muted); font-size: .84rem; }
.content {
  min-width: 0;
  padding: 1.5rem clamp(1rem, 4vw, 3rem) 3rem;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  max-width: 1040px;
  margin: 0 auto 1rem;
}
.orientation {
  max-width: 1040px;
  margin: 0 auto 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
  padding: 1rem;
}
.orientation h2 {
  margin: 0 0 .35rem;
  font-size: 1.1rem;
}
.orientation p {
  margin: 0;
  color: var(--muted);
}
.home-orientation {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 1rem;
  align-items: start;
}
.orientation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.orientation-actions a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: .7rem .75rem;
  text-decoration: none;
}
.orientation-actions strong,
.orientation-actions span {
  display: block;
}
.orientation-actions span {
  color: var(--muted);
  margin-top: .15rem;
  font-size: .86rem;
}
.compact-orientation {
  display: flex;
  gap: .5rem;
  align-items: baseline;
  color: var(--muted);
}
.compact-orientation strong {
  color: var(--text);
  white-space: nowrap;
}
.eyebrow {
  color: var(--muted);
  font-size: .76rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0;
}
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  color: var(--muted);
  font-size: .9rem;
}
.breadcrumbs a,
.breadcrumbs strong {
  color: inherit;
}
.breadcrumbs .sep { color: #aaa294; }
.report-link {
  white-space: nowrap;
  font-size: .86rem;
}
.note,
.backlinks {
  max-width: 1040px;
  margin: 0 auto 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 2rem);
}
.note-header h1 {
  margin: 0 0 .35rem;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}
.metadata {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .45rem;
  margin: 1rem 0 1.5rem;
}
.meta-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .55rem .65rem;
  background: #fbfaf6;
}
.meta-row dt {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}
.meta-row dd {
  margin: .15rem 0 0;
  overflow-wrap: anywhere;
}
.note-body {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.note-body h1,
.note-body h2,
.note-body h3 {
  line-height: 1.18;
  margin-top: 1.6em;
  letter-spacing: 0;
}
.note-body h1 { font-size: 2.15rem; }
.note-body h2 { font-size: 1.45rem; border-bottom: 1px solid var(--line); padding-bottom: .25rem; }
.note-body h3 { font-size: 1.13rem; }
.note-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .92rem;
  table-layout: auto;
  -webkit-overflow-scrolling: touch;
}
.note-body th,
.note-body td {
  border: 1px solid var(--line);
  padding: .45rem .55rem;
  vertical-align: top;
}
.note-body th {
  text-align: left;
  background: #f2eee5;
}
.note-body th:first-child,
.note-body td:first-child {
  width: 7.5rem;
  white-space: nowrap;
}
.note-body th:nth-child(2),
.note-body td:nth-child(2) {
  min-width: 22rem;
}
.note-body th:nth-child(3),
.note-body td:nth-child(3),
.note-body th:nth-child(4),
.note-body td:nth-child(4) {
  min-width: 8rem;
}
.note-body blockquote {
  margin: 1rem 0;
  padding: .75rem 1rem;
  border-left: 4px solid var(--line);
  color: #39352e;
  background: #fbfaf6;
}
.note-body blockquote p {
  margin: .4rem 0;
}
.note-body blockquote p:first-child {
  margin-top: 0;
}
.note-body blockquote p:last-child {
  margin-bottom: 0;
}
.note-body blockquote cite {
  display: block;
  margin-bottom: .15rem;
  color: var(--muted);
  font-size: .78rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}
code,
pre {
  background: var(--code);
  border-radius: 5px;
}
code { padding: .1rem .25rem; }
pre {
  padding: .9rem;
  overflow: auto;
}
.missing-link {
  color: var(--missing);
  border-bottom: 1px dotted var(--missing);
}
.placeholder-link {
  color: var(--muted);
  border-bottom: 1px dotted var(--line);
}
.backlinks h2 {
  margin-top: 0;
  font-size: 1.15rem;
}
.backlinks ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .5rem;
}
.backlinks li a,
.backlinks li span {
  display: block;
}
.backlinks li span {
  color: var(--muted);
  font-size: .8rem;
}
.status-pill {
  display: inline-block;
  padding: .35rem .65rem;
  border-radius: 999px;
  background: #def7ec;
  color: #03543f;
  font-weight: 800;
}
@media (max-width: 880px) {
  .site-shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: .75rem;
  }
  .brand {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
  }
  .brand a {
    margin: 0;
    font-size: 1rem;
  }
  .brand p {
    display: none;
  }
  .search-label,
  .nav-section-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .search-input {
    margin-top: .55rem;
    padding: .5rem .65rem;
    font-size: .95rem;
  }
  .search-results {
    margin-bottom: .55rem;
  }
  .quick-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .35rem;
    margin: .55rem 0 .65rem;
  }
  .quick-links a {
    min-height: 2.5rem;
    padding: .45rem .35rem;
    text-align: center;
    display: grid;
    place-items: center;
  }
  .quick-links strong {
    font-size: .86rem;
  }
  .quick-links span {
    display: none;
  }
  .all-folders {
    padding-top: .55rem;
  }
  .all-folders > summary {
    font-size: .9rem;
  }
  .folder-nav {
    max-height: 60vh;
    overflow: auto;
  }
  .content {
    padding: .8rem .65rem 2rem;
  }
  .eyebrow {
    display: none;
  }
  .breadcrumbs {
    font-size: .82rem;
    gap: .25rem;
  }
  .orientation {
    margin-bottom: .65rem;
    padding: .75rem;
  }
  .home-orientation {
    grid-template-columns: 1fr;
  }
  .orientation-actions {
    grid-template-columns: 1fr;
  }
  .compact-orientation {
    display: none;
  }
  .topbar {
    display: block;
    margin-bottom: .6rem;
  }
  .report-link {
    display: inline-block;
    margin-top: .25rem;
    font-size: .8rem;
  }
  .note,
  .backlinks {
    border-radius: 6px;
    padding: .9rem;
  }
  .note-header h1 {
    font-size: clamp(1.75rem, 9vw, 2.35rem);
  }
  .note-body h1 { font-size: 1.65rem; }
  .note-body h2 { font-size: 1.25rem; }
  .note-body h3 { font-size: 1.05rem; }
  .metadata {
    grid-template-columns: 1fr;
  }
  .note-body table {
    width: 100%;
    font-size: .84rem;
  }
  .note-body th,
  .note-body td {
    padding: .38rem .45rem;
  }
  .note-body th:first-child,
  .note-body td:first-child {
    width: 6.25rem;
  }
  .note-body th:nth-child(2),
  .note-body td:nth-child(2) {
    min-width: 15rem;
  }
  .note-body th:nth-child(3),
  .note-body td:nth-child(3),
  .note-body th:nth-child(4),
  .note-body td:nth-child(4) {
    min-width: 7rem;
  }
}
