/* Readable source displays use the Explorer typography and theme. */
.sr-main { min-width: 0; }
@media (scripting: enabled) {
  /* The surrounding footer is behind the fixed reader after startup. Remove it
     from the initial layout so mounting the editor cannot move it. */
  body[data-edition="sernau"][data-view="reader"] #sitefoot { display: none; }
}
.sr-main [hidden] { display: none !important; }
.sr-main :is(input[type="search"], select) {
  color: var(--fg);
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: var(--bg1);
  min-width: 0;
  max-width: 100%;
  padding: 7px 10px;
  font: inherit;
}
.sr-main :is(a, button, input, select, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sr-main :is(.sr-primary, .sr-button, .vbtn) { white-space: normal; }
.sr-screen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.sr-main p { line-height: 1.55; }
.sr-main :is(h2, h3) { margin: 0; }
.sr-main h2 { color: var(--fg); }
.sr-main :is(code, .sr-mono) { font-family: var(--mono); overflow-wrap: anywhere; }

.sr-muted { color: var(--mute); }
.sr-kicker {
  margin: 0 0 0.65rem;
  color: var(--gold);
  font: 600 0.71rem/1.3 var(--sans);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sr-subhero p:not(.sr-kicker, .sr-actions) {
  margin-top: 13px;
  max-width: 63ch;
  color: var(--mute);
  font-size: 0.9rem;
}
.sr-actions { display: flex; flex-wrap: wrap; gap: 8px 11px; align-items: center; margin: 17px 0 0; }
.sr-primary, .sr-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 13px;
  white-space: normal;
  text-align: left;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 650;
}
.sr-primary { background: var(--gold); border-color: var(--gold); color: #211909; }
.sr-primary:hover { color: #211909; background: #ffd79d; }
.sr-button { color: var(--fg); background: rgba(142, 162, 255, .08); }
.sr-button:hover { background: rgba(142, 162, 255, .18); }
.sr-text-button {
  border: 0;
  color: var(--accent2);
  padding: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.sr-crumb { color: var(--dim); font-size: 0.83rem; margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.sr-subhero { padding: 4px 0 18px; }
.sr-subhero h1 { max-width: 1050px; font-size: clamp(26px, 4vw, 36px); overflow-wrap: anywhere; }

.sr-overview-notes, .sr-group-layout, .sr-route-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}
.sr-group-layout { align-items: start; }
.sr-route-cards { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 0; list-style: none; }
.sr-route-cards > li { margin: 0; }
.sr-route-cards h2 { margin: 4px 0 6px; }
.sr-route-cards .sr-kicker { overflow-wrap: anywhere; }
.sr-route-cards .sr-primary { overflow-wrap: anywhere; }
.sr-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: clamp(12px, 1.6vw, 19px);
  background: var(--glass2);
  margin-bottom: 12px;
  min-width: 0;
}
.sr-route-cards + .sr-card { margin-top: 12px; }
.sr-card > p:not(.sr-kicker) { color: var(--mute); }
.sr-card h2 + *, .sr-card h3 + * { margin-top: 9px; }
.sr-card p:last-child { margin-bottom: 0; }
.sr-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 9px; margin-bottom: 8px; }
.sr-section-head > a { font-size: 0.87rem; }
.sr-rows, .sr-edge-list, .sr-depth-list { list-style: none; padding: 0; margin: 0; }
.sr-columns { columns: 3 230px; column-gap: 25px; }
.sr-rows > li, .sr-edge-list > li {
  break-inside: avoid;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}
.sr-rows > li:last-child, .sr-edge-list > li:last-child { border-bottom: 0; }
.sr-rows > li a:first-child { font-weight: 550; }
.sr-rows small { color: var(--mute); display: block; margin-top: 2px; }
.sr-evidence { padding-left: 8px; border-left: 1px solid var(--line); }
.sr-route-chain { font: 0.87rem/1.6 var(--mono); overflow-wrap: anywhere; }
.sr-reading { overflow-wrap: anywhere; }
.sr-reading blockquote {
  margin: .75em 0;
  padding-inline-start: .9em;
  border-inline-start: 2px solid var(--line2);
}
.sr-reading pre {
  overflow: auto;
  padding: .65em .85em;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: .5em 0;
  font: .83rem/1.5 var(--mono);
}
.sr-reading pre code { overflow-wrap: normal; }
.sr-read-anchor { scroll-margin-top: 84px; }
.sr-read-link { white-space: nowrap; }
.sr-edge-list summary { overflow-wrap: anywhere; display: list-item; }
.sr-edge-list summary small { color: var(--mute); margin-left: 5px; }
.sr-edge-list details p { margin: 5px 0; }
.sr-main summary { cursor: pointer; }
.sr-list-controls.lv-ctl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 8px 10px;
}
.sr-list-controls label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--mute);
  font-size: 12px;
}
.sr-list-controls label:first-child { grid-column: 1 / -1; }
.sr-list-controls :is(input, select) { height: 38px; }
#list-query { font-size: 15px; }
.sr-list-controls select { font-size: 13px; }
#list-count { margin: 10px 1px; }
#list-rows a { scroll-margin-top: 226px; }
#list-rows .end { color: var(--mute); font-size: 11px; }
#list-rows .t { overflow-wrap: anywhere; }
#route-rings {
  display: grid;
  grid-template-columns: minmax(160px, 286px) minmax(150px, 270px);
  align-items: center;
  gap: 17px;
  margin: 12px 0;
}
#route-rings svg { width: 100%; }
.sr-depth-key { display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
.sr-depth-key i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--legend);
}
.sr-depth-key button {
  text-align: left;
  min-height: 34px;
  padding: 5px 9px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--bg0);
  font-size: 0.83rem;
}
.sr-depth-key [aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.sr-depth-list > li { border-top: 1px solid var(--line); padding: 9px 0; }
.sr-depth-list > li > p { margin: 0; color: var(--mute); }
.sr-depth-list .sr-rows { columns: 3 215px; column-gap: 22px; }

@media (max-width: 680px) {
  .sr-overview-notes, .sr-group-layout { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .sr-section-head { align-items: start; }
  .sr-main input[type="search"] { font-size: 16px; }
  #list-query { font-size: 16px; }
  #route-rings { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 8px; }
  #route-rings svg { min-width: 0; }
}

/* File graph marks and their shared Explorer selection states. */
.sr-group-fields circle {
  fill: var(--node);
  fill-opacity: .032;
  stroke: var(--node);
  stroke-opacity: .22;
  stroke-width: .8;
  vector-effect: non-scaling-stroke;
}
.sr-group-fields .highlighted { fill-opacity: .1; stroke-opacity: .65; }
.sr-file-map .sr-group-fields circle { fill: var(--cloud); fill-opacity: .22; stroke: none; }
.sr-file-map .sr-group-fields .highlighted { fill-opacity: .44; }
.sr-group-caption.caption-occluded { opacity: 0; pointer-events: none; }
.sr-file-edges, .sr-file-highlight, .sr-group-fields, .sr-file-labels { pointer-events: none; }
.sr-file-edges path, .sr-file-highlight path {
  fill: none;
  vector-effect: non-scaling-stroke;
}
.sr-file-edges path { stroke: #8e9edb; stroke-opacity: .048; stroke-width: .65; }
.sr-file-edges .uses, .sr-file-highlight .uses { stroke: var(--uses); }
.sr-file-edges .by, .sr-file-highlight .by { stroke: var(--by); }
.sr-file-edges .route, .sr-file-highlight .route { stroke: var(--gold); }
.sr-file-edges :is(.uses, .by, .route) { stroke-opacity: .26; }
.sr-file-highlight path { stroke-opacity: .88; stroke-width: 1.25; }
.sr-group-fields .filtered, .sr-file-edges .filtered { visibility: hidden; }
.sr-group-hit, .sr-file-hit { fill: transparent; }
.sr-group-link .sr-node-label { fill: currentColor; }
.sr-group-link:is(:hover, :focus-visible, .selected) .sr-group-hit {
  fill: var(--node);
  fill-opacity: .1;
  stroke: var(--node);
  stroke-opacity: .65;
}
.sr-group-link .sr-node-label, .sr-file-labels text { pointer-events: none; }
.sr-file-node {
  color: var(--node);
  opacity: .85;
}
.sr-file-dot { fill: currentColor; }
.sr-file-focus { fill: none; stroke: transparent; vector-effect: non-scaling-stroke; }
.sr-file-node.main { opacity: 1; }
.sr-file-node:is(:hover, :focus-visible, .selected, .neighbor) { opacity: 1; }
.sr-file-node:is(:focus-visible, .selected) .sr-file-focus { stroke: white; stroke-width: 1.8; }
.sr-file-node.neighbor .sr-file-focus { stroke: currentColor; stroke-width: .8; }
.has-file-selection .sr-file-edges { opacity: .5; }
.sr-file-labels text {
  fill: var(--fg2);
  stroke: var(--bg0);
  stroke-width: 3.5px;
  stroke-linejoin: round;
  paint-order: stroke;
  font: 550 11px var(--sans);
}
.sr-file-labels .current { fill: white; }

@media (max-width: 820px) {
  #map-graph.sr-file-map a.sr-group-link .sr-node-label { display: block; font-size: clamp(8px, 2.35vw, 9px); }
}

/* The home map has its own phone layout. The shared sheet is the fallback without JS.
   The top bar and the site menu come from the shared shell (style.css). */
.map-phone { display: none; }
@media (max-width: 600px) and (scripting: enabled) {
  body:has(#map-phone-panel) { overscroll-behavior: none; }

  body:has(#map-phone-panel) :is(#panel, #fbar, #fmob, #zshare, #zin, #zout, #zlist, #zroute) { display: none; }

  .map-phone-close {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 13px;
    color: var(--fg);
    font-size: 24px;
    cursor: pointer;
    touch-action: manipulation;
  }

  body:has(#map-phone-panel) #zreset svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
  }

  #map-chips {
    display: flex;
    position: fixed;
    z-index: 19;
    inset: calc(80px + var(--map-top)) var(--map-right) auto var(--map-left);
    justify-content: flex-start;
    gap: 8px;
    padding: 0 14px 3px;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
  }

  #map-chips button {
    flex: none;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--map-border);
    border-radius: 14px;
    background: var(--map-control);
    color: #dbe4ff;
    font: 500 12px var(--sans);
    white-space: nowrap;
    cursor: pointer;
  }

  #map-chips [aria-pressed="true"] {
    border-color: #ba9b61;
    background: #302b2c;
    color: var(--gold);
  }

  body:has(#map-phone-panel) #map-graph {
    height: 100dvh;
    background: radial-gradient(ellipse at 50% 48%, #111c3d 0%, #080e24 60%, #050815 100%);
    -webkit-user-select: none;
  }

  body:has(#map-phone-panel) .sr-group-caption .sr-node-label { white-space: nowrap; }
  body:has(#map-phone-panel) #map-graph.sr-file-map a.sr-group-link .sr-node-label { font-size: 13px; stroke-width: 4px; }
  body:has(#map-phone-panel) .sr-group-link:not(:is(.main, .selected)) .sr-node-label { fill: #dce4ff; }
  body:has(#map-phone-panel) .sr-group-link.phone-argument:not(.selected) .sr-node-label { fill: #8ce8d7; }
  body:has(#map-phone-panel) .sr-group-link.phone-statements:not(.selected) .sr-node-label { fill: var(--gold); }
  body:has(#map-phone-panel) .sr-group-link.selected .sr-group-hit { fill: #101830; fill-opacity: .94; stroke: #52658b; }
  body:has(#map-phone-panel) .sr-group-link.selected .sr-node-label { fill: #f4f6ff; }
  body:has(#map-phone-panel) .sr-group-fields .phone-selected {
    stroke: #d4dcff;
    stroke-width: 1.3px;
    stroke-opacity: .8;
    stroke-dasharray: 3 5;
  }

  body:has(#map-phone-panel) .mapctl {
    top: auto;
    right: calc(15px + var(--map-right));
    bottom: calc(76px + var(--map-bottom));
  }

  body:has(#map-phone-selection:not([hidden])) .mapctl { display: none; }
  body:has(#map-phone-panel) .mapctl #zreset { border-radius: 14px; background: #19243f; }

  #map-phone-panel {
    display: block;
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    max-width: none;
    border: 1px solid var(--map-border);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background: var(--map-sheet);
    color: var(--fg);
    box-shadow: 0 -12px 34px #0005;
  }

  #map-phone-panel {
    z-index: 15;
    max-height: 70dvh;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0 var(--map-right) var(--map-bottom) var(--map-left);
  }

  #map-phone-panel:has(.map-phone-peek:not([hidden]))::before,
  .map-phone-grab::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    margin: 7px auto 0;
    border-radius: 10px;
    background: #687594;
  }

  .map-phone-peek {
    min-height: 48px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
    font-size: clamp(9px, 2.7vw, 12px);
    color: #c5cfee;
  }

  .map-phone-peek a { display: flex; align-items: center; min-height: 44px; color: var(--gold); }
  .map-phone-peek .map-phone-verified { color: #86e7ab; }

  #map-phone-selection[hidden], .map-phone-peek[hidden] { display: none; }

  #map-phone-selection:has(.map-phone-extra[hidden]), .map-phone-grab { touch-action: none; }

  .map-phone-grab {
    display: flow-root;
    width: 60px;
    height: 18px;
    margin: 0 auto;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }

  .map-phone-grab::before { margin-top: 0; }

  .map-phone-detail { padding: 8px 19px 12px; }
  .map-phone-title { display: flex; align-items: flex-start; gap: 8px; }
  .map-phone-title h1 {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: var(--fg);
    font-size: 24px;
    line-height: 1.12;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
  }

  .map-phone-close { margin: -7px -4px 0 0; background: radial-gradient(circle, #202c49 0 18px, transparent 18.5px); }
  .map-phone-detail .meta { margin: 6px 0 0; }
  .map-phone-detail .sr-primary { min-height: 44px; margin-top: 12px; }
  .map-phone-extra { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--map-border); }
  .map-phone-extra code { overflow-wrap: anywhere; }
  .map-phone-extra a { display: flex; align-items: center; min-height: 44px; }
}

/* ===== phone: sernau route and list ===== */
@media (max-width: 600px) and (scripting: enabled) {
  #pagebody:has(.rp-head) > main > .edition-switch { display: none; }
  .sr-route-cards .sr-kicker, .sr-route-cards h2 { font-size: 13px; }
  .sr-list-controls label, #list-rows .end { font-size: 13px; }
  body[data-view="route"] .sr-card h2, body[data-view="route"] #pagebody .sr-main code { font-size: 13px; }
}
/* ===== end phone: sernau route and list ===== */
