* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --deep-atlantic: #102b3f;
  --passport-blue: #245a78;
  --signature-teal: #087f78;
  --light-cyan: #64c9d0;
  --ink: var(--deep-atlantic);
  --muted: #526371;
  --page-bg: #e9edef;
  --paper: #fbfaf7;
  --panel: #f0f3f3;
  --line: #71828c;
  --code-bg: #edf1f3;
  --diagram-bg: #f7f8f6;
  --panel-border: #71828c;
  --accent: var(--passport-blue);
  --accent-dark: var(--deep-atlantic);
  --focus: var(--signature-teal);
  --control-bg: #f2f5f4;
  --button-ink: #ffffff;
  --security-bg: #8b3d12;
  --security-hover: #672b0b;
  --security-ink: #ffffff;
  --security-border: #8b3d12;
  font-size: 100%;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e2eaee;
  --muted: #b7c4cb;
  --page-bg: #151b1f;
  --paper: #1d262b;
  --panel: #29363d;
  --line: #71828c;
  --code-bg: #131a1e;
  --diagram-bg: #f5f7f5;
  --panel-border: #71828c;
  --accent: #a6d6ee;
  --accent-dark: #c7e7f4;
  --focus: #64c9c0;
  --control-bg: #27343b;
  --button-ink: #102b3f;
  --security-bg: #d5a16d;
  --security-hover: #e5b77f;
  --security-ink: #102b3f;
  --security-border: #d5a16d;
  --deep-atlantic: #e9f2f6;
  --passport-blue: #a6d6ee;
  --signature-teal: #67d0c5;
  --light-cyan: #8bd9df;
}
:root[data-text-size="smaller"] { font-size: 92%; }
:root[data-text-size="larger"] { font-size: 112.5%; }
:root[data-text-size="extra-large"] { font-size: 125%; }
html { scroll-behavior: smooth; }
body { background: var(--page-bg); color: var(--ink); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px; border-radius: .15rem;
}
button, select { font: inherit; }
.reader-controls { position: relative; color: var(--ink); }
.reader-controls summary { min-height: 2.75rem; display: inline-flex; align-items: center; cursor: pointer; color: var(--accent); font-weight: 600; }
.reader-controls-panel { position: absolute; z-index: 20; right: 0; display: grid; grid-template-columns: auto minmax(8rem, 1fr); align-items: center; gap: .55rem .8rem; width: min(19rem, calc(100vw - 2rem)); max-width: calc(100vw - 2rem); padding: .9rem; border: 1px solid var(--line); border-radius: .35rem; background: var(--paper); color: var(--ink); }
.reader-controls-panel label { min-width: 0; font-size: .9rem; overflow-wrap: anywhere; }
.reader-controls-panel select, .reader-controls-panel button { min-width: 0; width: 100%; min-height: 2.5rem; padding: .4rem .55rem; border: 1px solid var(--line); border-radius: .25rem; background: var(--control-bg); color: var(--ink); }
.reader-controls-panel button { grid-column: 2; cursor: pointer; }
.reader-controls-panel .reader-controls-help { grid-column: 1 / -1; max-width: 35ch; margin: 0; color: var(--muted); font-size: .82rem; }
.reader-controls-panel :disabled { opacity: .65; }
.nowrap { white-space: nowrap; }
.table-wrap--adr-index table, .table-wrap--open-questions table { table-layout: fixed; }
.table-wrap--adr-index th:first-child, .table-wrap--adr-index td:first-child { width: 8.8rem; white-space: nowrap; }
.table-wrap--adr-index th:last-child, .table-wrap--adr-index td:last-child { width: 11rem; }
.table-wrap--open-questions th:first-child, .table-wrap--open-questions td:first-child { width: 9.5rem; white-space: nowrap; }
.table-wrap--open-questions th:last-child { width: 13rem; }
.diagram-view-anchor:target, .diagram-view-anchor:focus,
a[id^="diagram-"][id$="-link"]:target { scroll-margin-block-start: 46vh; }
.compact-diagram-anchor { display: block; width: 1px; height: 1px; }
.compact-diagram-anchor:focus { outline: 3px solid var(--focus); outline-offset: 3px; scroll-margin-block-start: 1rem; }
@media print {
  :root { color-scheme: light !important; font-size: 100% !important; }
  :root, :root[data-theme="dark"], :root[data-theme="light"] {
    --ink: #173047; --muted: #526371; --page-bg: #fff; --paper: #fff;
    --panel: #edf4f5; --line: #aebec6; --code-bg: #edf1f3; --diagram-bg: #fff;
    --panel-border: #cbd5dc; --accent: #174f70; --accent-dark: #102b3f;
  }
  body { background: #fff !important; color: #111 !important; }
  .reader-controls { display: none !important; }
}
