/* ===========================================================================
   PBF BOUNDARIES  ·  style.css
   ---------------------------------------------------------------------------
   The page is one full-window canvas under the sim kit GUI
   (widgets/sim-kit/sim-kit.css), with the explanation parts of
   explain.js on top. The theme colours are --sk-* tokens.
   =========================================================================== */
html, body { margin: 0; height: 100%; background: var(--sk-bg); overflow: hidden; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; cursor: grab; }
#view:active { cursor: grabbing; }

/* Site rule: an element with the hidden attribute stays hidden, also when
   a rule above gives it a display value. */
[hidden] { display: none !important; }

/* ===========================================================================
   EXPLANATION (explain.js): info band, legend, "How it works" sheet.
   Fonts from lib/sci.css: STIX Two Text for titles, Inter for the rest.
   Sentence case, no uppercase labels.
   grep -n targets: ".pb-info", ".pb-legend", ".pb-how", "PHONE"
   =========================================================================== */
.pb-info { position: fixed; z-index: 30; top: 14px; left: 18px; width: min(720px, calc(100vw - 36px)); font: 13px/1.45 var(--sk-sans); color: var(--sk-text); pointer-events: none; }
.sk-root.sk-open:not(.sk-phone) .pb-info { width: min(720px, calc(100vw - var(--sk-panel-w) - 60px)); }
.pb-title { margin: 0; font: 400 1.5rem/1.15 var(--sk-serif); color: var(--sk-ink); text-shadow: 0 1px 14px rgba(0,0,0,.35); }
.pb-lead { margin: 6px 0 0; max-width: 68ch; font-size: .84rem; color: var(--sk-dim); }
.pb-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; pointer-events: auto; }
.pb-chip { font: inherit; font-size: .8rem; line-height: 1.2; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--sk-line); background: var(--sk-glass); color: var(--sk-text); cursor: pointer; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: background .15s, border-color .15s; }
.pb-chip:hover { border-color: var(--sk-accent); }
.pb-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--sk-accent) 24%, var(--sk-glass)); border-color: var(--sk-accent); color: var(--sk-ink); }
.pb-chip.pb-howbtn { color: var(--sk-accent); }
.pb-chip.pb-howbtn[aria-expanded="true"] { background: color-mix(in srgb, var(--sk-accent) 24%, var(--sk-glass)); }
.pb-cap { margin: 8px 0 0; max-width: 72ch; font-size: .86rem; color: var(--sk-text); text-shadow: 0 1px 10px rgba(0,0,0,.4); }

.pb-legend { position: fixed; z-index: 30; left: 18px; bottom: calc(var(--sk-credit) + 18px); max-width: max(220px, calc(50vw - 240px)); margin: 0; padding: 7px 11px; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; font: .76rem/1.3 var(--sk-sans); background: var(--sk-glass); border: 1px solid var(--sk-line); border-radius: 10px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); pointer-events: none; }
.pb-legend:empty { display: none; }
.pb-legend li { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pb-sw { display: inline-block; flex: none; width: 18px; height: 10px; border-radius: 3px; }
.pb-sw.pb-dot { width: 8px; height: 8px; border-radius: 50%; }
.pb-sw.pb-line { width: 16px; height: 3px; border-radius: 2px; }
.pb-sw.pb-bar { width: 72px; height: 8px; }
.pb-end { font: .72rem var(--sk-mono); color: var(--sk-text2); }
.pb-lt { color: var(--sk-text); }

.pb-how { position: fixed; z-index: 42; top: 12px; left: 12px; bottom: calc(var(--sk-credit) + 76px); width: min(460px, calc(100vw - 24px)); display: flex; flex-direction: column; color: var(--sk-text); background: var(--sk-glass); border: 1px solid var(--sk-line); border-radius: var(--sk-r); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.pb-howhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 10px 2px 18px; flex: none; }
.pb-howhead h2 { margin: 0; font: 400 1.3rem/1.2 var(--sk-serif); color: var(--sk-ink); }
.pb-x { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--sk-text); font: 22px/1 var(--sk-sans); cursor: pointer; }
.pb-x:hover { background: var(--sk-glass2); color: var(--sk-accent); }
.pb-howbody { overflow-y: auto; padding: 0 18px 20px; font: .88rem/1.55 var(--sk-sans); }
.pb-howbody h3 { margin: 16px 0 4px; font: 500 1.04rem/1.3 var(--sk-serif); color: var(--sk-ink); }
.pb-howbody p { margin: 4px 0 8px; }
.pb-howbody i { font-family: var(--sk-serif); font-size: 1.05em; }
.pb-how .sci-eq { margin: 6px 0 10px; font-size: 15px; color: var(--sk-ink); }

/* PHONE: the band is the title, the caption and a row of chips; the
   legend is one line over the dock; the sheet comes up from the dock. */
@media (max-width: 768px), ((pointer: coarse) and (max-height: 520px)) {
  .pb-info, .sk-root.sk-open .pb-info { top: calc(8px + env(safe-area-inset-top)); left: 12px; right: 12px; width: auto; }
  .pb-title { font-size: 1.12rem; }
  .pb-lead { display: none; }
  .pb-presets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 8px -12px 0; padding: 0 12px 2px; }
  .pb-presets::-webkit-scrollbar { display: none; }
  .pb-chip { flex: none; }
  .pb-cap { font-size: .8rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .pb-legend { left: 0; right: 0; max-width: none; bottom: calc(var(--sk-credit) + 57px); border-radius: 0; border-width: 1px 0 0; flex-wrap: nowrap; overflow-x: auto; padding: 5px 12px; scrollbar-width: none; }
  .pb-how { top: auto; left: 0; right: 0; bottom: calc(var(--sk-credit) + 57px); width: auto; max-height: 72vh; border-radius: 16px 16px 0 0; border-width: 1px 0 0; }
}
@media (pointer: coarse) and (max-height: 520px) and (orientation: landscape) {
  .pb-cap { -webkit-line-clamp: 1; }
  .pb-how { max-height: 82vh; }
}
@media (pointer: coarse) {
  .pb-chip { min-height: 40px; padding: 8px 14px; font-size: .84rem; }
  .pb-x { width: 44px; height: 44px; }
}
