:root {
  color-scheme: light;
  --page: #f4f6f4;
  --surface: #ffffff;
  --panel: #edf1ee;
  --panel-strong: #e2e8e4;
  --ink: #202522;
  --ink-soft: #48524d;
  --muted: #59655f;
  --line: #d5ddd8;
  --line-strong: #aebbb4;
  --teal: #0b675b;
  --teal-soft: #d8ece7;
  --rust: #9f462f;
  --rust-soft: #f3dfd8;
  --amber: #9b6810;
  --amber-soft: #f5e9cc;
  --blue: #375f7b;
  --blue-soft: #dfeaf1;
  --plum: #75506c;
  --plum-soft: #eee2eb;
  --danger: #a13232;
  --shadow: 0 10px 30px rgba(28, 40, 34, 0.12);
  --topbar-height: 64px;
  --left-width: 284px;
  --right-width: 306px;
  --content-width: 820px;
  font-family: Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #171b19;
  --surface: #202522;
  --panel: #1b211e;
  --panel-strong: #29312d;
  --ink: #f0f3f1;
  --ink-soft: #c4cdc8;
  --muted: #9eaaa4;
  --line: #37413c;
  --line-strong: #596760;
  --teal: #6dc7b8;
  --teal-soft: #183e37;
  --rust: #ef9a7f;
  --rust-soft: #492b24;
  --amber: #e9bd63;
  --amber-soft: #443719;
  --blue: #8eb8d3;
  --blue-soft: #263b48;
  --plum: #d0a7c6;
  --plum-soft: #422f3e;
  --danger: #f18888;
  --shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--page);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--teal);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--surface);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: fixed;
  z-index: 40;
  inset: 0 0 auto 0;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: var(--left-width) minmax(360px, 1fr) var(--right-width);
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}

.brand-block {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 22px;
  border-right: 1px solid var(--line);
}

.brand-mark {
  color: var(--teal);
  font-size: 1.02rem;
  font-weight: 800;
}

.edition-mark {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
}

.view-tabs {
  justify-self: center;
  display: flex;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.view-tab {
  min-width: 92px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.view-tab:hover {
  color: var(--ink);
}

.view-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(20, 35, 28, 0.1);
}

.topbar-actions {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding: 0 16px;
  border-left: 1px solid var(--line);
}

.reading-progress-label {
  min-width: 52px;
  padding-right: 12px;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.72rem;
  text-align: right;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--panel);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--left-width) minmax(0, 1fr) var(--right-width);
  padding-top: var(--topbar-height);
}

.library-panel,
.outline-panel {
  position: fixed;
  z-index: 20;
  top: var(--topbar-height);
  bottom: 0;
  overflow-y: auto;
  background: var(--panel);
  scrollbar-width: thin;
}

.library-panel {
  left: 0;
  width: var(--left-width);
  border-right: 1px solid var(--line);
}

.outline-panel {
  right: 0;
  width: var(--right-width);
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.panel-heading {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 20px 20px 16px;
}

.panel-heading strong {
  font-size: 0.94rem;
}

.panel-kicker,
.section-kicker {
  color: var(--rust);
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-block {
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--line);
}

.search-block > label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.search-field {
  height: 40px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 28px;
  align-items: center;
  padding: 0 7px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
}

.search-field > span {
  color: var(--muted);
  font-size: 1.05rem;
}

.search-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.78rem;
}

.search-field input::placeholder {
  color: var(--muted);
}

.search-field button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.mini-segmented,
.document-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  border-radius: 5px;
  background: var(--panel-strong);
}

.mini-segmented {
  margin-top: 8px;
}

.mini-segmented button,
.document-switch button {
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
}

.mini-segmented button.is-active,
.document-switch button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(24, 38, 31, 0.1);
}

.document-switch {
  margin: 14px 16px 9px;
}

.subject-list {
  padding: 0 8px;
}

.subject-button {
  position: relative;
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}

.subject-button:hover {
  background: color-mix(in srgb, var(--surface) 58%, transparent);
}

.subject-button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--teal);
}

.subject-number {
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.64rem;
}

.subject-copy {
  min-width: 0;
}

.subject-copy strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  line-height: 1.25;
}

.subject-copy span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.65rem;
}

.subject-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-strong);
}

.subject-button.is-active .subject-indicator {
  background: var(--teal);
}

.corpus-totals {
  margin: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.6;
}

.corpus-totals strong {
  color: var(--ink-soft);
}

.search-results {
  padding: 10px 8px 18px;
}

.search-results-header {
  padding: 6px 9px 9px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.search-result {
  width: 100%;
  display: block;
  padding: 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.search-result:hover {
  background: var(--surface);
}

.search-result strong,
.search-result span {
  display: block;
}

.search-result strong {
  margin-bottom: 4px;
  font-size: 0.72rem;
}

.search-result span {
  color: var(--muted);
  font-family: Charter, Georgia, serif;
  font-size: 0.72rem;
  line-height: 1.42;
}

.search-result mark,
.source-document mark {
  padding: 0 2px;
  background: var(--amber-soft);
  color: var(--ink);
}

.workspace {
  grid-column: 2;
  min-width: 0;
  background: var(--surface);
}

.workspace-view {
  min-height: calc(100vh - var(--topbar-height));
}

.workspace-view[hidden] {
  display: none;
}

.document-header {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 34px 0 20px;
  border-bottom: 1px solid var(--line);
}

.document-context {
  display: flex;
  gap: 7px;
  color: var(--rust);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.document-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.document-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.67rem;
}

.download-button {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 15px;
  border: 1px solid var(--teal);
  border-radius: 7px;
  background: var(--teal-soft);
  color: var(--teal);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.download-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.download-button-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.download-button-copy strong {
  font-size: 0.78rem;
  font-weight: 700;
}

.download-button-copy small {
  font-size: 0.64rem;
  font-weight: 500;
  color: inherit;
  opacity: 0.78;
}

.download-button span {
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.download-button:hover,
.download-button:focus-visible {
  background: var(--teal);
  color: var(--surface);
}

.download-button--compact {
  margin-top: 0;
  padding: 6px 11px;
  border-radius: 6px;
  gap: 7px;
}

.download-button--compact svg {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}

.download-button--compact span {
  font-size: 0.66rem;
}

.metric-item strong {
  color: var(--ink-soft);
  font-weight: 700;
}

.integrity-line,
.lens-source-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.7rem;
}

.integrity-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.text-button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-size: inherit;
}

.source-document {
  width: min(var(--content-width), calc(100% - 64px));
  margin: 0 auto;
  padding: 46px 0 110px;
  font-family: Charter, "Iowan Old Style", Georgia, serif;
  font-size: 1rem;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.source-document > section:first-child > h1,
.source-document > h1 {
  margin: 0 0 1.4rem;
  color: var(--ink);
  font-family: Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 2.25rem;
  line-height: 1.12;
  font-weight: 760;
}

.source-document section {
  scroll-margin-top: calc(var(--topbar-height) + 24px);
}

.source-document h2,
.source-document h3,
.source-document h4,
.source-document h5,
.source-document h6 {
  position: relative;
  color: var(--ink);
  font-family: Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  scroll-margin-top: calc(var(--topbar-height) + 24px);
}

.source-document h2 {
  margin: 4.5rem 0 1.3rem;
  padding-top: 1.1rem;
  border-top: 2px solid var(--ink);
  font-size: 1.62rem;
  line-height: 1.2;
}

.source-document h3 {
  margin: 3.2rem 0 1.05rem;
  color: var(--teal);
  font-size: 1.3rem;
  line-height: 1.25;
}

.source-document h4 {
  margin: 2.4rem 0 0.85rem;
  font-size: 1.08rem;
  line-height: 1.3;
}

.source-document h5,
.source-document h6 {
  margin: 1.8rem 0 0.65rem;
  color: var(--ink-soft);
  font-size: 0.96rem;
  line-height: 1.35;
}

.source-document p {
  margin: 0.85rem 0;
}

.source-document strong {
  color: var(--ink);
  font-weight: 700;
}

.source-document ul,
.source-document ol {
  margin: 1rem 0;
  padding-left: 1.45rem;
}

.source-document li {
  margin: 0.43rem 0;
  padding-left: 0.22rem;
}

.source-document li::marker {
  color: var(--rust);
  font-family: Avenir, "Segoe UI", sans-serif;
  font-size: 0.82em;
  font-weight: 700;
}

.source-document blockquote {
  margin: 1.8rem 0;
  padding: 15px 20px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
  color: var(--ink-soft);
}

.source-document code {
  padding: 0.08em 0.25em;
  border-radius: 3px;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.82em;
  white-space: normal;
}

.table-scroll {
  width: 100%;
  margin: 1.8rem 0 2.2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.source-document table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-family: Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.76rem;
  line-height: 1.45;
}

.source-document caption {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
}

.source-document th,
.source-document td {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.source-document th:last-child,
.source-document td:last-child {
  border-right: 0;
}

.source-document tr:last-child td {
  border-bottom: 0;
}

.source-document th {
  background: var(--panel);
  color: var(--ink);
  font-weight: 760;
}

.source-document tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--panel) 45%, transparent);
}

.citation-link {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--teal-soft);
  color: var(--teal);
  font-family: Avenir, "Segoe UI", sans-serif;
  font-size: 0.76em;
  font-weight: 700;
  text-decoration: none;
}

.reference-backlinks {
  display: inline-flex;
  gap: 3px;
  margin-left: 5px;
  font-family: Avenir, "Segoe UI", sans-serif;
  font-size: 0.72em;
}

.reference-backlinks a {
  text-decoration: none;
}

.source-document .section-flash {
  animation: section-flash 1.7s ease-out;
}

@keyframes section-flash {
  0% { box-shadow: inset 4px 0 0 var(--amber); background: var(--amber-soft); }
  100% { box-shadow: inset 4px 0 0 transparent; background: transparent; }
}

.outline-document-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 18px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.outline-stat {
  padding: 11px 4px;
  text-align: center;
}

.outline-stat + .outline-stat {
  border-left: 1px solid var(--line);
}

.outline-stat strong,
.outline-stat span {
  display: block;
}

.outline-stat strong {
  font-family: Menlo, Consolas, monospace;
  font-size: 0.76rem;
}

.outline-stat span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.57rem;
  text-transform: uppercase;
}

.outline-list {
  padding: 0 12px 32px;
}

.outline-link {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 4px;
  padding: 7px 8px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  font-size: 0.69rem;
  line-height: 1.33;
}

.outline-link[data-level="3"] {
  padding-left: 16px;
}

.outline-link[data-level="4"],
.outline-link[data-level="5"] {
  padding-left: 25px;
  font-size: 0.64rem;
}

.outline-link:hover,
.outline-link.is-active {
  border-left-color: var(--teal);
  background: var(--panel);
  color: var(--ink);
}

.outline-index {
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.58rem;
}

.reference-preview {
  position: sticky;
  bottom: 12px;
  margin: 12px;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-family: Charter, Georgia, serif;
  font-size: 0.72rem;
  line-height: 1.45;
}

.reference-preview strong {
  display: block;
  margin-bottom: 6px;
  color: var(--rust);
  font-family: Avenir, "Segoe UI", sans-serif;
  font-size: 0.66rem;
  text-transform: uppercase;
}

.lens-view,
.portfolio-view {
  padding: 54px clamp(32px, 5vw, 88px) 100px;
  background: var(--page);
}

.lens-header,
.portfolio-header {
  max-width: 1020px;
  margin: 0 auto;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line-strong);
}

.lens-header h1,
.portfolio-header h1 {
  max-width: 780px;
  margin: 8px 0 10px;
  font-size: 2rem;
  line-height: 1.15;
}

.lens-header p {
  max-width: 720px;
  margin: 0;
  color: var(--ink-soft);
  font-family: Charter, Georgia, serif;
  font-size: 1rem;
  line-height: 1.55;
}

.lens-stage {
  max-width: 1020px;
  min-height: 480px;
  margin: 30px auto 0;
  padding: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.lens-detail {
  max-width: 1020px;
  min-height: 88px;
  margin: 0 auto;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panel);
}

.lens-detail:empty::before {
  content: "Sélectionnez un repère pour ouvrir son ancrage documentaire.";
  color: var(--muted);
  font-size: 0.76rem;
}

.lens-detail strong,
.lens-detail span {
  display: block;
}

.lens-detail small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.66rem;
}

.lens-detail strong {
  margin-bottom: 6px;
  font-size: 0.86rem;
}

.lens-detail span {
  color: var(--muted);
  font-size: 0.72rem;
}

.lens-detail button {
  margin-top: 12px;
}

.lens-map {
  position: relative;
  width: 100%;
  min-height: 410px;
}

.lens-node {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.lens-node:hover,
.lens-node:focus-visible,
.lens-node.is-selected {
  border-color: var(--teal);
  box-shadow: inset 0 -3px 0 var(--teal);
}

.lens-node-index {
  color: var(--rust);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 700;
}

.lens-node-title {
  overflow-wrap: anywhere;
  font-size: 0.77rem;
  line-height: 1.32;
  font-weight: 760;
}

.lens-node-meta {
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.58rem;
}

.lens-map.type-cycle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(98px, auto));
  gap: 20px;
}

.type-cycle::before {
  content: "BOUCLE\A D’AJUSTEMENT";
  white-space: pre;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: center;
  color: var(--teal);
  font-size: 0.72rem;
  line-height: 1.5;
  font-weight: 800;
  text-align: center;
}

.type-cycle .lens-node:nth-child(1) { grid-column: 1; grid-row: 1; }
.type-cycle .lens-node:nth-child(2) { grid-column: 2; grid-row: 1; }
.type-cycle .lens-node:nth-child(3) { grid-column: 3; grid-row: 2; }
.type-cycle .lens-node:nth-child(4) { grid-column: 2; grid-row: 3; }
.type-cycle .lens-node:nth-child(5) { grid-column: 1; grid-row: 2; }

.type-cycle .lens-node::after {
  content: "→";
  position: absolute;
  color: var(--amber);
  font-size: 1.25rem;
}

.type-cycle .lens-node:nth-child(1)::after { top: 50%; right: -18px; transform: translateY(-50%); }
.type-cycle .lens-node:nth-child(2)::after { right: -18px; bottom: -19px; transform: rotate(45deg); }
.type-cycle .lens-node:nth-child(3)::after { bottom: -21px; left: 50%; transform: rotate(90deg); }
.type-cycle .lens-node:nth-child(4)::after { top: 50%; left: -18px; transform: translateY(-50%) rotate(180deg); }
.type-cycle .lens-node:nth-child(5)::after { top: -21px; left: 50%; transform: rotate(270deg); }

.lens-map.type-circuit,
.lens-map.type-balance {
  min-height: 300px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 18px;
}

.type-circuit .lens-node,
.type-balance .lens-node {
  min-height: 180px;
}

.type-circuit .lens-node:not(:last-child)::after,
.type-balance .lens-node:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -18px;
  color: var(--amber);
  font-size: 1.25rem;
  transform: translate(50%, -50%);
}

.lens-map.type-matrix {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 112px;
}

.type-matrix::before {
  content: "NIVEAU\A D’ATTRIBUTION";
  white-space: pre;
  position: absolute;
  top: 50%;
  left: 8px;
  color: var(--muted);
  font-size: 0.6rem;
  line-height: 1.5;
  font-weight: 800;
  transform: translateY(-50%);
}

.type-matrix .lens-node {
  min-height: 54px;
  flex-direction: row;
  align-items: center;
}

.type-matrix .lens-node::after {
  content: "ACTE  ·  POUVOIR  ·  CONDITION  ·  RÉSULTAT";
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.55rem;
}

.lens-map.type-evidence {
  min-height: 410px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.type-evidence::before {
  content: "OBJECTIF\A EXPLICITE";
  white-space: pre;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: center;
  color: var(--blue);
  font-size: 0.72rem;
  line-height: 1.5;
  font-weight: 800;
  text-align: center;
}

.type-evidence .lens-node:nth-child(1) { grid-column: 1; grid-row: 1; }
.type-evidence .lens-node:nth-child(2) { grid-column: 2; grid-row: 1; }
.type-evidence .lens-node:nth-child(3) { grid-column: 3; grid-row: 1; }
.type-evidence .lens-node:nth-child(4) { grid-column: 3; grid-row: 2; }
.type-evidence .lens-node:nth-child(5) { grid-column: 2; grid-row: 3; }
.type-evidence .lens-node:nth-child(6) { grid-column: 1; grid-row: 2; }
.type-evidence .lens-node:nth-child(7) { grid-column: 3; grid-row: 3; }

.lens-map.type-console {
  min-height: 430px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: 18px minmax(150px, auto) 18px minmax(108px, auto);
  gap: 9px 14px;
  align-content: center;
}

.type-console::before {
  content: "CIBLES COMBINABLES";
  grid-column: 1 / -1;
  grid-row: 1;
  color: var(--rust);
  font-size: 0.61rem;
  font-weight: 800;
}

.type-console::after {
  content: "GARDE-FOUS COMMUNS";
  grid-column: 1 / -1;
  grid-row: 3;
  color: var(--blue);
  font-size: 0.61rem;
  font-weight: 800;
}

.type-console .lens-node:nth-child(-n+4) {
  grid-row: 2;
  border-top: 4px solid var(--rust);
}

.type-console .lens-node:nth-child(5) { grid-column: 1 / 2; grid-row: 4; border-top: 4px solid var(--blue); }
.type-console .lens-node:nth-child(6) { grid-column: 2 / 4; grid-row: 4; border-top: 4px solid var(--blue); }
.type-console .lens-node:nth-child(7) { grid-column: 4 / 5; grid-row: 4; border-top: 4px solid var(--blue); }

.lens-map.type-timeline {
  min-height: 350px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  align-items: center;
}

.lens-map.type-horizons {
  min-height: 350px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}

.type-horizons .lens-node {
  min-height: 170px;
  border-top: 4px solid var(--rust);
}

.type-horizons .lens-node:nth-child(even) {
  border-top-color: var(--blue);
}

.type-timeline::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 2px;
  background: var(--line-strong);
}

.type-timeline .lens-node {
  z-index: 1;
  min-height: 150px;
  margin: 0 6px;
  border-top: 4px solid var(--rust);
}

.lens-map.type-network {
  min-height: 440px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(100px, auto));
  gap: 18px;
}

.type-network::before {
  content: "QUALIFIER\A LA SITUATION";
  white-space: pre;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  justify-self: center;
  width: 120px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 2px solid var(--rust);
  border-radius: 50%;
  color: var(--rust);
  font-size: 0.65rem;
  line-height: 1.45;
  font-weight: 800;
  text-align: center;
}

.type-network .lens-node:nth-child(1) { grid-column: 1; grid-row: 1; }
.type-network .lens-node:nth-child(2) { grid-column: 2; grid-row: 1; }
.type-network .lens-node:nth-child(3) { grid-column: 3; grid-row: 1; }
.type-network .lens-node:nth-child(4) { grid-column: 3; grid-row: 2; }
.type-network .lens-node:nth-child(5) { grid-column: 2; grid-row: 3; }
.type-network .lens-node:nth-child(6) { grid-column: 1; grid-row: 2; }

.lens-map.type-routing {
  min-height: 470px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(115px, auto));
  gap: 18px;
}

.type-routing::before {
  content: "VOIES NON LINÉAIRES";
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--line-strong);
  font-size: 0.58rem;
  font-weight: 800;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.type-routing .lens-node:nth-child(1) {
  grid-column: 2;
  grid-row: 2;
  border: 2px solid var(--rust);
}

.type-routing .lens-node:nth-child(2) { grid-column: 1; grid-row: 1; }
.type-routing .lens-node:nth-child(3) { grid-column: 2; grid-row: 1; }
.type-routing .lens-node:nth-child(4) { grid-column: 3; grid-row: 1; }
.type-routing .lens-node:nth-child(5) { grid-column: 3; grid-row: 2; border-color: var(--danger); }
.type-routing .lens-node:nth-child(6) { grid-column: 1 / 2; grid-row: 3; border-top: 4px solid var(--blue); }
.type-routing .lens-node:nth-child(7) { grid-column: 2 / 4; grid-row: 3; border-top: 4px solid var(--blue); }

.lens-map.type-safety {
  min-height: 380px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  padding-bottom: 58px;
  border-bottom: 9px solid var(--blue-soft);
}

.type-safety::after {
  content: "PILOTAGE TRANSVERSAL : exposition · réponse · santé · récidive · mise en œuvre";
  position: absolute;
  right: 12px;
  bottom: 18px;
  left: 12px;
  color: var(--blue);
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
}

.type-safety .lens-node {
  min-height: 138px;
  border-top: 5px solid var(--danger);
}

.lens-map.type-fit,
.lens-map.type-adjustment {
  min-height: 440px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(140px, 155px));
  gap: 70px 18px;
  align-content: center;
}

.type-fit::before,
.type-adjustment::before {
  content: "SITUATION\A OBSERVABLE";
  white-space: pre;
  position: absolute;
  inset: 50% auto auto 50%;
  width: 118px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: var(--surface);
  color: var(--teal);
  font-size: 0.65rem;
  line-height: 1.4;
  font-weight: 800;
  text-align: center;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.type-fit .lens-node:nth-child(-n+3),
.type-adjustment .lens-node:nth-child(-n+3) {
  border-top: 4px solid var(--teal);
}

.type-fit .lens-node:nth-child(n+4),
.type-adjustment .lens-node:nth-child(n+4) {
  border-bottom: 4px solid var(--amber);
}

.lens-map.type-trajectory {
  min-height: 420px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(145px, auto));
  gap: 28px 54px;
  align-items: center;
}

.type-trajectory::before,
.type-trajectory::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--line-strong);
}

.type-trajectory::before { top: 32%; transform: rotate(8deg); }
.type-trajectory::after { bottom: 32%; transform: rotate(-8deg); }

.type-trajectory .lens-node {
  z-index: 1;
  min-height: 120px;
  border-left: 4px solid var(--plum);
}

.lens-map.type-branches {
  min-height: 420px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(90px, auto));
  gap: 14px 24px;
  align-content: center;
  padding-left: 100px;
}

.type-branches::before {
  content: "SITUATION\A OBSERVÉE";
  white-space: pre;
  position: absolute;
  top: 50%;
  left: 0;
  width: 78px;
  padding: 12px 5px;
  border: 2px solid var(--plum);
  border-radius: 5px;
  color: var(--plum);
  font-size: 0.6rem;
  line-height: 1.4;
  font-weight: 800;
  text-align: center;
  transform: translateY(-50%);
}

.type-branches::after {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  left: 88px;
  width: 2px;
  background: var(--plum);
}

.type-branches .lens-node {
  min-height: 92px;
  border-left: 4px solid var(--plum);
}

.type-branches .lens-node::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -28px;
  width: 24px;
  height: 1px;
  background: var(--plum);
}

.portfolio-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 18px;
}

.portfolio-total strong,
.portfolio-total span {
  display: block;
}

.portfolio-total strong {
  font-family: Menlo, Consolas, monospace;
  font-size: 1rem;
}

.portfolio-total span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.portfolio-visual {
  max-width: 1020px;
  margin: 30px auto;
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.portfolio-controls {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 18px;
  padding: 2px;
  border-radius: 5px;
  background: var(--panel-strong);
}

.portfolio-controls button {
  min-height: 31px;
  padding: 4px 11px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
}

.portfolio-controls button.is-active {
  background: var(--surface);
  color: var(--ink);
}

.portfolio-row {
  display: grid;
  grid-template-columns: 180px minmax(100px, 1fr) 70px;
  align-items: center;
  gap: 14px;
  min-height: 42px;
}

.portfolio-subject-link {
  overflow-wrap: anywhere;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 700;
}

.portfolio-bar-track {
  height: 12px;
  background: var(--panel-strong);
}

.portfolio-bar {
  height: 100%;
  background: var(--teal);
}

.portfolio-row:nth-child(3n+2) .portfolio-bar { background: var(--rust); }
.portfolio-row:nth-child(3n+3) .portfolio-bar { background: var(--blue); }

.portfolio-value {
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.64rem;
  text-align: right;
}

.portfolio-table-wrap {
  max-width: 1020px;
  margin: 0 auto;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

.portfolio-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.76rem;
}

.portfolio-table caption {
  padding: 14px;
  color: var(--muted);
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
}

.portfolio-table th,
.portfolio-table td {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  text-align: right;
}

.portfolio-table th:first-child,
.portfolio-table td:first-child {
  text-align: left;
}

.portfolio-table tbody tr:hover {
  background: var(--panel);
}

.portfolio-table-link {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.integrity-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: min(720px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.integrity-dialog::backdrop {
  background: rgba(15, 20, 17, 0.52);
}

.integrity-dialog header,
.integrity-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.integrity-dialog h2 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

#integrity-dialog-content {
  padding: 22px;
}

.integrity-checks {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px 14px;
  font-size: 0.78rem;
}

.integrity-checks span:nth-child(even) {
  color: var(--teal);
  font-weight: 800;
}

.integrity-hash {
  margin-top: 20px;
  padding: 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.62rem;
  line-height: 1.6;
}

.integrity-dialog footer {
  justify-content: flex-start;
  gap: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  font-size: 0.75rem;
}

.mobile-only {
  display: none;
}

.panel-scrim {
  position: fixed;
  z-index: 45;
  inset: var(--topbar-height) 0 0;
  background: rgba(15, 20, 17, 0.48);
}

.noscript-catalog {
  max-width: 820px;
  margin: 40px auto;
  padding: 24px;
  border: 2px solid var(--rust);
  background: var(--surface);
}

.no-js .topbar,
.no-js .library-panel,
.no-js .outline-panel,
.no-js .document-header {
  display: none;
}

.no-js .app-shell,
.no-js .workspace {
  display: block;
  min-height: 0;
  padding-top: 0;
}

.standalone-page {
  background: var(--surface);
}

.standalone-header {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.72rem;
}

.standalone-header a {
  font-weight: 800;
  text-decoration: none;
}

.standalone-main {
  width: min(var(--content-width), calc(100% - 48px));
  margin: 0 auto;
}

.standalone-main .source-document {
  width: 100%;
}

.standalone-status {
  margin-top: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
}

.standalone-status code {
  overflow-wrap: anywhere;
}

.standalone-download {
  margin-top: 16px;
}

.standalone-download .download-button {
  margin-top: 0;
}

/* Source (per-DOI) pages */
.source-standalone .standalone-main {
  padding-top: 24px;
}

.source-provenance {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.source-provenance.is-notice .integrity-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.source-meta {
  margin-top: 12px;
  padding: 14px 16px;
  border-left: 3px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink-soft);
  font-family: Charter, "Iowan Old Style", Georgia, serif;
  font-size: 0.92rem;
  line-height: 1.5;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.74rem;
}

.source-links a {
  color: var(--teal);
}

.source-download {
  margin-top: 16px;
}

.source-notice {
  color: var(--muted);
  font-style: italic;
}

.source-standalone .source-document {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 26px;
}

@media (max-width: 1199px) {
  :root {
    --left-width: 248px;
    --right-width: 0px;
  }

  .topbar {
    grid-template-columns: var(--left-width) minmax(350px, 1fr) 170px;
  }

  .app-shell {
    grid-template-columns: var(--left-width) minmax(0, 1fr);
  }

  .outline-panel {
    z-index: 50;
    width: 310px;
    transform: translateX(105%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .outline-panel.is-open {
    transform: translateX(0);
  }

  .topbar-actions {
    border-left: 0;
  }

  #outline-toggle {
    display: inline-grid;
  }

  .document-header {
    width: min(var(--content-width), calc(100% - 64px));
  }

  .lens-map.type-safety {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 799px) {
  :root {
    --topbar-height: 58px;
  }

  .mobile-only {
    display: inline-grid;
  }

  .topbar {
    grid-template-columns: 44px minmax(88px, 1fr) auto;
    grid-template-rows: 52px 42px;
    gap: 4px;
    padding: 0 8px;
  }

  :root {
    --topbar-height: 94px;
  }

  #library-toggle {
    grid-column: 1;
    grid-row: 1;
  }

  .brand-block {
    grid-column: 2;
    grid-row: 1;
    padding: 0 4px;
    border: 0;
  }

  .brand-mark {
    font-size: 0.88rem;
  }

  .edition-mark {
    display: none;
  }

  .view-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    height: 36px;
  }

  .view-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px;
    font-size: 0.65rem;
  }

  .topbar-actions {
    grid-column: 3;
    grid-row: 1;
    gap: 0;
    padding: 0;
  }

  .topbar-actions #print-button,
  .reading-progress-label {
    display: none;
  }

  .icon-button {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .app-shell {
    display: block;
  }

  .workspace {
    width: 100%;
  }

  .library-panel,
  .outline-panel {
    z-index: 50;
    width: min(88vw, 320px);
    box-shadow: var(--shadow);
    transition: transform 180ms ease;
  }

  .library-panel {
    transform: translateX(-105%);
  }

  .library-panel.is-open,
  .outline-panel.is-open {
    transform: translateX(0);
  }

  .panel-close {
    position: absolute;
    top: 14px;
    right: 12px;
  }

  .document-header {
    width: calc(100% - 36px);
    padding: 24px 0 16px;
  }

  .document-metrics {
    gap: 6px 12px;
  }

  .source-document {
    width: calc(100% - 36px);
    padding: 32px 0 80px;
    font-size: 0.96rem;
    line-height: 1.66;
  }

  .source-document > section:first-child > h1,
  .source-document > h1 {
    font-size: 1.72rem;
    line-height: 1.16;
  }

  .source-document h2 {
    margin-top: 3.4rem;
    font-size: 1.38rem;
  }

  .source-document h3 {
    margin-top: 2.6rem;
    font-size: 1.17rem;
  }

  .source-document h4 {
    font-size: 1.02rem;
  }

  .source-document ul,
  .source-document ol {
    padding-left: 1.2rem;
  }

  .table-scroll {
    width: calc(100vw - 18px);
    margin-left: -9px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .lens-view,
  .portfolio-view {
    padding: 32px 18px 70px;
  }

  .lens-header h1,
  .portfolio-header h1 {
    font-size: 1.6rem;
  }

  .lens-stage {
    min-height: 0;
    padding: 16px;
  }

  .lens-map,
  .lens-map.type-cycle,
  .lens-map.type-circuit,
  .lens-map.type-balance,
  .lens-map.type-matrix,
  .lens-map.type-evidence,
  .lens-map.type-timeline,
  .lens-map.type-horizons,
  .lens-map.type-network,
  .lens-map.type-console,
  .lens-map.type-routing,
  .lens-map.type-safety,
  .lens-map.type-fit,
  .lens-map.type-adjustment,
  .lens-map.type-trajectory,
  .lens-map.type-branches {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    border-bottom: 0;
  }

  .lens-map::before,
  .lens-map::after,
  .lens-node::after {
    display: none !important;
  }

  .lens-node,
  .type-circuit .lens-node,
  .type-balance .lens-node,
  .type-safety .lens-node,
  .type-trajectory .lens-node {
    width: 100%;
    min-height: 96px;
    margin: 0;
  }

  .lens-map.type-cycle,
  .lens-map.type-evidence,
  .lens-map.type-console,
  .lens-map.type-routing,
  .lens-map.type-safety,
  .lens-map.type-adjustment,
  .lens-map.type-branches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 10px;
  }

  .type-cycle .lens-node,
  .type-evidence .lens-node,
  .type-console .lens-node,
  .type-routing .lens-node,
  .type-safety .lens-node,
  .type-adjustment .lens-node,
  .type-branches .lens-node {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .type-cycle .lens-node:last-child,
  .type-evidence .lens-node:last-child,
  .type-routing .lens-node:first-child {
    grid-column: 1 / -1 !important;
  }

  .type-console .lens-node:nth-child(5),
  .type-routing .lens-node:nth-child(6) {
    margin-top: 18px;
  }

  .type-console .lens-node:nth-child(5)::before {
    content: "GARDE-FOUS COMMUNS";
    position: absolute;
    top: -18px;
    left: 0;
    color: var(--blue);
    font-size: 0.56rem;
    font-weight: 800;
  }

  .type-routing .lens-node:nth-child(6)::before {
    content: "FONCTIONS TRANSVERSALES";
    position: absolute;
    top: -18px;
    left: 0;
    color: var(--blue);
    font-size: 0.56rem;
    font-weight: 800;
  }

  .lens-map.type-circuit {
    padding-left: 12px;
    border-left: 3px solid var(--amber);
  }

  .type-branches .lens-node::before {
    display: none;
  }

  .type-matrix .lens-node {
    flex-direction: column;
    align-items: flex-start;
  }

  .lens-map.type-matrix {
    padding-left: 0;
  }

  .portfolio-visual {
    padding: 16px;
  }

  .portfolio-row {
    grid-template-columns: 108px minmax(60px, 1fr) 54px;
    gap: 8px;
  }

  .portfolio-subject-link {
    font-size: 0.66rem;
  }

  .standalone-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
  }

  .standalone-main {
    width: calc(100% - 36px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  :root {
    color-scheme: light;
    --surface: #ffffff;
    --ink: #000000;
    --ink-soft: #222222;
    --muted: #444444;
    --line: #bbbbbb;
  }

  .topbar,
  .library-panel,
  .outline-panel,
  .document-header,
  .lens-view,
  .portfolio-view,
  .panel-scrim,
  .reference-backlinks,
  .noscript-catalog {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .reader-view {
    display: block;
    min-height: 0;
    padding: 0;
    background: #ffffff;
  }

  .reader-view {
    display: block !important;
  }

  .source-document {
    width: 100%;
    max-width: none;
    padding: 0;
    color: #000000;
    font-size: 10.5pt;
    line-height: 1.48;
  }

  .source-document h1 {
    font-size: 22pt;
  }

  .source-document h2,
  .source-document h3,
  .source-document h4 {
    break-after: avoid-page;
  }

  .source-document table {
    min-width: 0;
    font-size: 7.5pt;
  }

  .table-scroll {
    overflow: visible;
    border: 1px solid #999999;
  }

  a {
    color: #000000;
    text-decoration: none;
  }
}
