@font-face {
  font-family: Roboto;
  src: url(assets/Roboto-Regular.ttf) format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Roboto;
  src: url(assets/Roboto-Bold.ttf) format("truetype");
  font-weight: 600 900;
  font-display: swap;
}

@font-face {
  font-family: "Material Icons";
  src: url(assets/MaterialIcons-Regular.otf) format("opentype");
  font-display: block;
}

:root {
  color-scheme: dark;
  font-family: Roboto,Arial,sans-serif;
  color: #f4f7fa;
  background: #0d1118;
  --muted: #a5b1c4;
  --border: #293343;
  --blue: #91c9ff;
  --panel: #131b27;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,select,input {
  font: inherit;
}

button,select {
  cursor: pointer;
}

button {
  color: inherit;
}

button:focus-visible,select:focus-visible,summary:focus-visible,input:focus-visible,[tabindex]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

[hidden] {
  display: none!important;
}

p,h1,h2,h3,figure {
  margin: 0;
}

.masthead {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px,calc((100vw - 1376px)/2));
  border-bottom: 1px solid #253040;
}

.identity {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  white-space: nowrap;
}

.identity img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.masthead nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.masthead nav button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: none;
  padding: 0 14px;
  font-size: 14px;
  color: var(--muted);
}

.masthead nav button[aria-pressed=true] {
  background: #202d3f;
  color: #e1eeff;
}

main {
  max-width: 1424px;
  margin: auto;
  padding: 35px 24px 48px;
}

.intro {
  margin-bottom: 27px;
}

h1 {
  font-size: clamp(30px,4vw,50px);
  letter-spacing: -.035em;
  line-height: 1.08;
}

.intro p {
  color: var(--muted);
  font-size: 15px;
  margin-top: 10px;
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  align-items: stretch;
  gap: 20px;
}

.viewer,aside,.notes,.evidence {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.viewer {
  min-width: 0;
  padding: 18px;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.group-label {
  color: var(--blue);
  font-size: 12px;
  margin-bottom: 4px;
}

.viewer h2 {
  font-size: 21px;
  letter-spacing: -.015em;
}

.view-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.view-controls label {
  font-size: 12px;
  color: var(--muted);
}

.view-controls select,.view-controls button,.viewer-caption button {
  min-height: 38px;
  background: #202a39;
  border: 1px solid #354358;
  border-radius: 7px;
  color: #edf3fc;
  padding: 0 10px;
  font-size: 13px;
}

.view-controls button[aria-pressed=true] {
  background: #284766;
  color: #e7f4ff;
}

.view-controls button:disabled {
  cursor: default;
  color: #9ba9bd;
  opacity: .56;
}

.stage {
  position: relative;
  width: 100%;
  margin-inline: auto;
  aspect-ratio: 800/480;
  container-type: inline-size;
  background: #030506;
  border: 1px solid #344052;
  border-radius: 10px;
  overflow: hidden;
}

#stage {
  max-width: 800px;
}

#stage[data-size="640"] {
  max-width: 640px;
  aspect-ratio: 640/360;
}

#stage[data-size="480"] {
  max-width: 480px;
  aspect-ratio: 480/320;
}

.dashboard,.baseline,.scrim,.settings-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.dashboard {
  object-fit: fill;
}

.dashboard-speed-plate {
  position: absolute;
  inset: 3.96% 0;
  width: 100%;
  height: 92.08%;
  object-fit: fill;
  clip-path: inset(30% 4% 55% 71%);
}

.dashboard-speed {
  position: absolute;
  top: 31.6%;
  left: 71.6%;
  width: 22%;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .9cqw;
  transform: skewX(-8deg);
  color: #f4f7fa;
  line-height: 1;
}

.dashboard-speed strong {
  font-size: 7.85cqw;
  font-weight: 400;
}

.dashboard-speed span {
  font-size: 2.75cqw;
}

.baseline {
  object-fit: contain;
}

.scrim {
  background: linear-gradient(180deg,transparent 35%,#02050b32 62%,#02050b66);
  pointer-events: none;
}

.scrim[data-blur="true"] {
  background: #0509114d;
  -webkit-backdrop-filter: blur(.9cqw);
  backdrop-filter: blur(.9cqw);
}

.viewer-caption {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 1px 0;
}

.viewer-caption p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.speed-controls {
  display: grid;
  grid-template-columns: auto minmax(48px, 1fr) minmax(52px, auto);
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #d0d9e8;
  font-size: 13px;
}

.speed-controls input {
  width: 100%;
  margin: 0;
  accent-color: var(--blue);
}

.speed-controls output {
  color: #f4f7fa;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.outcomes {
  display: flex;
  gap: 6px;
}

.outcomes:empty {
  display: none;
}

aside {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.index-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 17px 14px;
  border-bottom: 1px solid var(--border);
}

.index-header h2 {
  font-size: 16px;
}

.index-header span {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#screen-index {
  padding: 5px 10px 10px;
  overflow: auto;
  max-height: 540px;
  scrollbar-color: #465771 transparent;
  scroll-padding: 12px;
}

#screen-index details {
  padding: 6px 0;
  border-bottom: 1px solid #273242;
}

#screen-index details:last-child {
  border-bottom: 0;
}

#screen-index summary {
  min-height: 41px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 7px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  list-style: none;
}

#screen-index summary::-webkit-details-marker {
  display: none;
}

#screen-index summary .icon {
  font-size: 18px;
  color: var(--muted);
}

#screen-index details[open] summary .icon {
  transform: rotate(90deg);
}

#screen-index summary span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.screen-link {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  background: none;
  border-radius: 6px;
  min-height: 38px;
  padding: 7px 10px 7px 33px;
  color: #d0d9e8;
  font-size: 13px;
  line-height: 1.3;
}

.screen-link:hover,#screen-index summary:hover {
  background: #1e2a3c;
}

.screen-link[aria-current=true] {
  background: #233b55;
  color: #ecf5ff;
  box-shadow: inset 3px 0 #6fb7ff;
}

.notes {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  padding: 22px;
}

.notes h2,.evidence h2 {
  font-size: 19px;
  margin-bottom: 9px;
}

.notes h3 {
  font-size: 14px;
  margin-bottom: 6px;
}

.notes p,.evidence p,.evidence li,.evidence figcaption {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.notes a {
  display: inline-block;
  margin-top: 7px;
  color: var(--blue);
  text-underline-offset: 3px;
}

.principles {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 18px;
}

.principles article {
  padding-left: 18px;
  border-left: 1px solid var(--border);
}

.evidence {
  margin-top: 20px;
}

.evidence summary {
  padding: 16px 20px;
  cursor: pointer;
}

.evidence-content {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 22px;
  padding: 4px 20px 22px;
}

.evidence img {
  width: 100%;
  display: block;
  border-radius: 7px;
  margin-bottom: 7px;
}

.evidence ul {
  padding-inline-start: 18px;
  margin: 0 0 10px;
}

.evidence li,.evidence p {
  margin-bottom: 7px;
}

.gallery-section {
  margin-bottom: 28px;
}

.gallery-section h2 {
  font-size: 22px;
  margin-bottom: 12px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 14px;
}

.gallery-item {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--panel);
  padding: 8px;
  text-align: left;
  overflow: hidden;
}

.gallery-item:hover {
  border-color: #6d9bc9;
}

.gallery-item .gallery-label {
  display: block;
  padding: 10px 5px 4px;
  font-size: 14px;
  font-weight: 700;
}

.gallery-item .stage {
  border-radius: 6px;
  pointer-events: none;
}

.gallery-item .setup-sheet {
  max-height: 88%;
}

.icon {
  font-family: "Material Icons";
  font-feature-settings: "liga";
  font-style: normal;
  font-weight: 400;
  letter-spacing: normal;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
}

.obu-popup {
  --popup-scale: 1;
  --base-u: .125cqw;
  --base-target: 5.5cqw;
  --base-width: calc(438 * var(--base-u));
  --base-max-height: 46%;
  --u: calc(var(--base-u) * var(--popup-scale));
  --target: calc(var(--base-target) * var(--popup-scale));
  --tone: #8ac9ff;
  --tint: #17334b;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(96%, calc(var(--base-width) * var(--popup-scale)));
  max-height: calc(var(--base-max-height) * var(--popup-scale));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #415168;
  border-left: calc(4 * var(--u)) solid var(--tone);
  border-radius: calc(13 * var(--u));
  background: #181e2c;
  box-shadow: 0 calc(9 * var(--u)) calc(27 * var(--u)) #0009;
  color: #f4f7fa;
  font-size: calc(18 * var(--u));
  line-height: 1.24;
}

.stage[data-size="640"] .obu-popup,.stage[data-size="480"] .obu-popup {
  --base-width: 72%;
  --base-u: .145cqw;
}

.stage[data-size="640"] .obu-popup {
  --base-max-height: 47%;
  --base-target: 6.875cqw;
}

.stage[data-size="480"] .obu-popup {
  --base-max-height: 50%;
  --base-width: 82%;
  --base-target: 9.1667cqw;
}

.obu-popup[data-popup-size="Medium"] {
  --popup-scale: 1.15;
}

.obu-popup[data-popup-size="Large"] {
  --popup-scale: 1.3;
}

.obu-popup[data-tone=amber] {
  --tone: #ffc45c;
  --tint: #3d3020;
}

.obu-popup[data-tone=green] {
  --tone: #8ce6b0;
  --tint: #1c372e;
}

.obu-popup[data-tone=red] {
  --tone: #ffaba8;
  --tint: #482a32;
}

.popup-top {
  position: relative;
  display: flex;
  gap: calc(13 * var(--u));
  align-items: flex-start;
  padding: calc(16 * var(--u));
  padding-right: calc(var(--target) + 12 * var(--u));
  min-height: 0;
}

.popup-top.has-value {
  padding-right: calc(var(--target) + 6 * var(--u));
  align-items: center;
}

.popup-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: calc(44 * var(--u));
  height: calc(44 * var(--u));
  border-radius: calc(9 * var(--u));
  background: var(--tint);
  color: var(--tone);
  font-size: calc(26 * var(--u));
}

.popup-pictogram {
  width: calc(68 * var(--u));
  height: calc(68 * var(--u));
  flex: none;
  align-self: center;
  object-fit: contain;
}

.popup-copy {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.popup-copy h3 {
  font-size: calc(23 * var(--u));
  line-height: 1.12;
  letter-spacing: -.02em;
}

.popup-copy p {
  font-size: calc(16 * var(--u));
  line-height: 1.27;
  color: #ccd7e6;
  margin-top: calc(5 * var(--u));
}

.popup-copy .eyebrow {
  color: var(--tone);
  font-size: calc(12 * var(--u));
  font-weight: 700;
  letter-spacing: .065em;
  margin: 0 0 calc(5 * var(--u));
}

.popup-copy .instruction {
  color: #f4f7fa;
  font-weight: 700;
}

.popup-value {
  display: flex;
  flex: none;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  min-width: calc(84 * var(--u));
  text-align: right;
  padding-left: calc(10 * var(--u));
  border-left: 1px solid #46536a;
  font-variant-numeric: tabular-nums;
}

.popup-value strong {
  font-size: calc(36 * var(--u));
  line-height: 1;
  letter-spacing: -.055em;
  white-space: nowrap;
}

.popup-value span {
  font-size: calc(13 * var(--u));
  line-height: 1.15;
  color: #cbd6e4;
  margin-top: calc(5 * var(--u));
}

.popup-value.current-speed {
  min-width: calc(94 * var(--u));
}

.current-speed .speed-label {
  margin: 0 0 calc(5 * var(--u));
  white-space: nowrap;
}

.speed-measurement {
  display: flex;
  align-items: baseline;
  gap: calc(4 * var(--u));
}

.speed-measurement span {
  white-space: nowrap;
}

.obu-popup[data-speed-alert="over"] .speed-measurement strong {
  color: var(--tone);
}

.popup-penalty {
  flex: none;
  margin: 0 calc(16 * var(--u));
  padding: calc(9 * var(--u)) 0 calc(11 * var(--u));
  border-top: 1px solid #46536a;
  color: #ccd7e6;
  font-size: calc(13 * var(--u));
  line-height: 1.3;
}

.stage[data-size="480"] .popup-penalty {
  font-size: max(calc(2.5cqw * var(--popup-scale)), calc(13 * var(--u)));
}

.stage[data-size="480"] .current-speed .speed-label {
  font-size: calc(2.2917cqw * var(--popup-scale));
}

.popup-close {
  position: absolute;
  top: calc(7 * var(--u));
  right: calc(6 * var(--u));
  display: grid;
  place-items: center;
  width: var(--target);
  height: var(--target);
  border: 0;
  border-radius: calc(7 * var(--u));
  color: #dce6f4;
  background: none;
  font-size: calc(21 * var(--u));
}

button.popup-close:hover {
  background: #2c384a;
}

.popup-close:focus-visible {
  outline-offset: -3px;
}

.obu-popup[data-kind=list] .popup-top {
  align-items: center;
  padding-block: calc(8 * var(--u));
}

.obu-popup[data-kind=list] .popup-icon {
  width: calc(35 * var(--u));
  height: calc(35 * var(--u));
  font-size: calc(22 * var(--u));
}

.list-scroll,.popup-details,.setup-scroll {
  overflow: auto;
  scrollbar-color: #6a7f9d transparent;
  min-height: 0;
}

.list-scroll {
  margin: 0 calc(16 * var(--u)) calc(10 * var(--u));
  max-height: calc(121 * var(--u));
  scrollbar-gutter: stable;
}

.list-scroll:focus-visible,.popup-details:focus-visible,.setup-scroll:focus-visible {
  outline-offset: -2px;
}

.popup-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  text-align: left;
}

.popup-table th,.popup-table td {
  padding: calc(5 * var(--u)) calc(8 * var(--u));
  border-top: 1px solid #344156;
}

.popup-table th {
  font-size: calc(12 * var(--u));
  font-weight: 400;
  color: #c5d1e1;
  background: #1f2939;
  position: sticky;
  top: 0;
}

.popup-table td {
  height: calc(31 * var(--u));
  font-size: calc(17 * var(--u));
}

.popup-table td:first-child {
  overflow-wrap: anywhere;
}

.route-label {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
}

.route-pictogram {
  width: calc(23 * var(--u));
  height: calc(23 * var(--u));
  flex: none;
  object-fit: contain;
}

.popup-table :is(th,td):last-child {
  text-align: right;
  width: 31%;
  font-variant-numeric: tabular-nums;
}

.popup-table td:last-child {
  font-weight: 700;
}

.popup-table .full {
  color: #c5d1e1;
  font-weight: 400!important;
}

.popup-details {
  margin: 0;
  padding: 0 calc(16 * var(--u)) calc(12 * var(--u));
  font-size: calc(15 * var(--u));
}

.popup-details div {
  display: flex;
  justify-content: space-between;
  gap: calc(16 * var(--u));
  border-top: 1px solid #344156;
  padding: calc(5 * var(--u)) 0;
}

.popup-details dt {
  color: #c5d1e1;
}

.popup-details dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.settings-preview {
  --u: .125cqw;
  --target: 5.5cqw;
  display: flex;
  flex-direction: column;
  background: #0b131e url(assets/settings-background.png) center / cover;
  color: #f4f7fa;
}

.obu-settings-header {
  display: grid;
  place-items: center;
  flex: none;
  height: calc(60 * var(--u));
  background: #181e2c80;
}

.obu-settings-header h3 {
  font-size: calc(24 * var(--u));
}

.obu-settings-scroll {
  overflow: auto;
  min-height: 0;
  padding: calc(16 * var(--u));
  scrollbar-color: #68788e transparent;
}

.obu-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(16 * var(--u));
}

.obu-setting-tile {
  display: flex;
  align-items: center;
  gap: calc(8 * var(--u));
  min-height: calc(70 * var(--u));
  padding: calc(12 * var(--u)) calc(16 * var(--u));
  border: 0;
  border-radius: calc(8 * var(--u));
  background: #181e2cbb;
  color: inherit;
  text-align: left;
  font-size: calc(20 * var(--u));
  line-height: 1.2;
}

.obu-setting-tile > span:first-child {
  flex: 1;
  min-width: 0;
}

.obu-setting-tile > .icon {
  flex: none;
  color: #a5b1c4;
}

.obu-setting-value {
  color: #ccd7e6;
}

.obu-setting-wide {
  grid-column: 1 / -1;
}

.obu-feature-tile,
.obu-setting-tile.display-option {
  min-height: max(var(--target), calc(88 * var(--u)));
}

button.obu-setting-tile:hover,
label.obu-setting-tile:hover {
  background: #283347;
}

.settings-preview.is-dimmed::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #04080d8c;
}

.setup-sheet {
  max-height: 89%;
  width: 63%;
  border-left: 1px solid #415168;
}

.stage[data-size] .setup-sheet {
  width: min(79%,510px);
  max-height: 89%;
}

.setup-sheet .popup-top {
  flex: none;
  align-items: center;
  padding: calc(12 * var(--u)) calc(var(--target) + 8 * var(--u)) calc(12 * var(--u)) calc(14 * var(--u));
}

.setup-sheet .popup-copy h3 {
  font-size: calc(23 * var(--u));
}

.setup-scroll {
  padding: 0 calc(15 * var(--u)) calc(9 * var(--u));
}

.setup-scroll:empty {
  display: none;
}

.setup-scroll ol {
  margin: 0;
  padding-left: calc(24 * var(--u));
}

.setup-scroll li {
  padding: calc(7 * var(--u)) calc(4 * var(--u));
  color: #e4ecf9;
}

.setup-scroll .popup-details {
  padding: 0;
}

.popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: calc(8 * var(--u));
  padding: calc(9 * var(--u)) calc(15 * var(--u)) calc(12 * var(--u));
  flex: none;
  border-top: 1px solid #354256;
}

.popup-actions button,.popup-actions span {
  border: 1px solid #445670;
  border-radius: calc(7 * var(--u));
  background: #233044;
  color: #eaf2ff;
  min-height: var(--target);
  padding: 0 calc(14 * var(--u));
  display: grid;
  place-items: center;
  font-size: calc(15 * var(--u));
  font-weight: 700;
}

.popup-actions .primary {
  background: #90caff;
  color: #10253a;
  border-color: #90caff;
}

.popup-actions .danger {
  background: #ffaba8;
  color: #3b141a;
  border-color: #ffaba8;
}

.setup-choice {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(10 * var(--u));
  min-height: var(--target);
  text-align: left;
  border: 0;
  border-top: 1px solid #364257;
  background: transparent;
  padding: calc(4 * var(--u)) 0;
  font-size: calc(16 * var(--u));
  color: #edf3fc;
}

.setup-choice .icon {
  color: #a1ceff;
  font-size: calc(22 * var(--u));
}

.setup-choice small {
  font-size: calc(13 * var(--u));
  color: #c5d1e1;
}

button.setup-choice:hover {
  background: #2c384a;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(10 * var(--u));
  padding: calc(7 * var(--u)) 0;
  border-top: 1px solid #364257;
  font-size: calc(16 * var(--u));
}

.control-row input {
  width: 37%;
  accent-color: #91c9ff;
}

.control-row input[type=checkbox] {
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
}

.display-option {
  gap: calc(14 * var(--u));
}

label.display-option {
  cursor: pointer;
}

.display-option-copy {
  display: flex;
  flex-direction: column;
  gap: calc(4 * var(--u));
}

.display-option-copy strong {
  font-size: calc(20 * var(--u));
  font-weight: 400;
}

.display-option-copy > span {
  color: #ccd7e6;
  font-size: calc(16 * var(--u));
  line-height: 1.3;
}

.display-switch {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: none;
  width: calc(44 * var(--u));
  height: calc(25 * var(--u));
  margin: 0;
  padding: calc(3 * var(--u));
  border: 1px solid #68788e;
  border-radius: calc(16 * var(--u));
  background: #253143;
  cursor: pointer;
}

.display-switch::before {
  content: "";
  width: calc(17 * var(--u));
  height: calc(17 * var(--u));
  border-radius: 50%;
  background: #d5e1ef;
}

.display-switch:is(:checked,[data-enabled="true"]) {
  justify-content: flex-end;
  border-color: #90caff;
  background: #90caff;
}

.display-switch:is(:checked,[data-enabled="true"])::before {
  background: #132942;
}

.busy-line {
  height: calc(4 * var(--u));
  margin: 0 calc(15 * var(--u)) calc(15 * var(--u));
  background: linear-gradient(90deg,#8ac9ff 35%,#37445a 35%);
  border-radius: 4px;
}

@media(max-width:1100px) {
  .workspace {
    grid-template-columns: minmax(0,1fr) 254px;
  }
  .viewer-bar {
    align-items: flex-start;
  }
  .view-controls label {
    display: none;
  }
}

@media(max-width:800px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  #screen-index {
    max-height: 350px;
  }
  .notes {
    grid-template-columns: 1fr;
  }
  .gallery-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media(max-width:520px) {
  .masthead {
    padding: 0 12px;
    height: 57px;
  }
  .identity {
    font-size: 11px;
    gap: 5px;
  }
  .identity img {
    width: 19px;
    height: 19px;
  }
  .masthead nav button {
    font-size: 12px;
    padding: 0 7px;
  }
  main {
    padding: 21px 10px 28px;
  }
  .viewer {
    padding: 10px;
  }
  .viewer-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .viewer h2 {
    font-size: 18px;
  }
  .viewer-caption {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .principles,.evidence-content {
    grid-template-columns: 1fr;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

@media(max-width:350px) {
  .identity span {
    display: none;
  }
  .masthead nav button {
    padding: 0 6px;
  }
  .view-controls {
    gap: 4px;
  }
  .view-controls select,.view-controls button {
    padding: 0 5px;
  }
  .speed-controls {
    gap: 6px;
    padding-inline: 7px;
    font-size: 11px;
  }
}

.embedded .intro {
  display: none;
}

.embedded main {
  padding: 16px;
}

.embedded .masthead {
  padding-inline: 16px;
}

.message-readout {
  display: none;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #182331;
  color: #e5edf8;
  font-size: 14px;
}

.message-readout summary {
  padding: 10px 12px;
  cursor: pointer;
}

.message-readout p {
  padding: 0 12px 12px;
  line-height: 1.5;
  white-space: pre-line;
}

.preview-source {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.preview-source a {
  color: var(--blue);
}

@media (max-width: 650px) {
  .embedded main {
    padding: 10px;
  }
  .embedded .masthead .identity {
    display: none;
  }
  .embedded .masthead {
    justify-content: center;
    padding-inline: 8px;
  }
  .masthead nav button {
    min-height: 44px;
  }
  .message-readout:not([hidden]) {
    display: block;
  }
}
