/* Bramble: a BlackBerry on a dark desk (Stream 4 owns this file).
   The phone is the only bright object. Everything else is soft-touch black plastic:
   raised keys, seams instead of cards, and one colour that is allowed to glow, the LED. */

:root {
  --desk: #17181b;
  --desk-lit: #2c2e34;
  --desk-edge: #0f1012;
  --slab: #1c1e22;
  --slab-hi: #2d3036;
  --seam: #0c0d0f;
  --legend: #e8e9eb;
  --dim: #a0a3ab;
  --faint: #6f727a;
  --send: #43b45c;
  --end: #dc4534;
  --sticker: #f1f1ed;
  --ink: #17181b;
  --led-rgb: 255 34 24;
  --led-on: 0;
  --sans: "Lucida Grande", "Segoe UI", "Trebuchet MS", "Noto Sans", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --side-w: 396px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
html { height: 100%; background: var(--desk-edge); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; height: 100%; overflow: hidden;
  color: var(--legend); font: 14.5px/1.5 var(--sans);
  background:
    radial-gradient(ellipse 58% 62% at 36% 42%, var(--desk-lit) 0%, #1f2024 46%, var(--desk) 72%, var(--desk-edge) 100%);
  -webkit-font-smoothing: antialiased;
}
/* Matte grain, so the desk reads as a surface rather than a gradient. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hidden { display: none !important; }
h1, h2, p, ul, ol, dl, dd { margin: 0; padding: 0; }
button, input { font: inherit; color: inherit; }
kbd {
  font: 11.5px/1 var(--mono); display: inline-block; padding: 3px 5px 2px; border-radius: 4px;
  background: #2a2c31; border: 1px solid var(--seam); box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  color: var(--legend);
}
:focus-visible { outline: 2px solid var(--legend); outline-offset: 2px; }
.berry { width: 1.05em; height: .9em; margin-right: .34em; vertical-align: -.06em; }
.pin { font-family: var(--mono); letter-spacing: .06em; font-variant-numeric: slashed-zero; }
.note { color: var(--dim); font-size: 13px; line-height: 1.45; }

/* ---------- layout ---------- */

#app { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); height: 100vh; height: 100dvh; }
#stage { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center;
         padding: 22px 24px 14px; }
#topbar { display: none; }
#phone-wrap { position: relative; flex: 1 1 0; min-height: 0; align-self: stretch;
              display: flex; align-items: center; justify-content: center; }
#phone-clip { position: relative; flex: none; }
#phone-clip.cropped { overflow: hidden; }
#phone { position: absolute; left: 0; top: 0; outline: none; user-select: none; -webkit-user-select: none;
         touch-action: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
#phone:focus { outline: none; }
#skin-wrap { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease-out;
             filter: drop-shadow(0 26px 30px rgba(0,0,0,.55)) drop-shadow(0 3px 4px rgba(0,0,0,.6)); }
#skin-wrap.ready { opacity: 1; }
#skin-wrap.raw { border-radius: 9% / 6%; overflow: hidden; filter: none; box-shadow: 0 26px 50px rgba(0,0,0,.6); }
#phone-clip.cropped #skin-wrap { filter: none; }
#skin { display: block; width: 100%; height: 100%; pointer-events: none; }
#screen { position: absolute; background: #000; visibility: hidden; image-rendering: auto; }
#screen.sharp { image-rendering: pixelated; }
body.booting #screen, body.running #screen, body.failed.was-on #screen { visibility: visible; }
/* No skin: a bare screen with a plain bezel. */
#phone.plain { position: relative; padding: 14px; border-radius: 18px; background: #0b0b0c;
               box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 26px 50px rgba(0,0,0,.6); }
#phone.plain #skin-wrap { display: none; }
#phone.plain #screen { position: static; display: block; visibility: visible; width: min(640px, 80vw); height: auto; aspect-ratio: 4 / 3; }
#phone:focus-visible::after { content: ""; position: absolute; inset: -6px; border-radius: 34px;
                              border: 2px solid rgba(232,233,235,.35); pointer-events: none; }
#phone-clip.cropped #phone:focus-visible::after, body.running #phone:focus-visible::after { display: none; }
/* A running phone normally holds the keyboard; say so when it doesn't. */
body.running.phone-away #ticker::after { content: "\00a0\00b7\00a0click the phone to type"; color: var(--legend); }

/* ---------- the LED ---------- */

.led { --c: var(--led-rgb); display: block; position: absolute; border-radius: 50%; pointer-events: none;
       opacity: var(--led-on); transition: opacity 70ms linear;
       background: radial-gradient(circle at 42% 38%, #fff 0%, rgb(var(--c)) 34%, rgb(var(--c) / .9) 58%, rgb(var(--c) / 0) 74%);
       box-shadow: 0 0 5px 1px rgb(var(--c) / .95), 0 0 20px 5px rgb(var(--c) / .5), 0 0 64px 20px rgb(var(--c) / .2); }
.led-bar { position: static; width: 9px; height: 9px; flex: none; }
body.failed .led { animation: led-fault 1.8s steps(1, end) infinite; }
@keyframes led-fault { 0%, 12% { opacity: 1; } 12.01%, 100% { opacity: 0; } }

/* ---------- under the phone ---------- */

#under { flex: none; align-self: stretch; display: flex; align-items: center; justify-content: center;
         gap: 18px; min-height: 34px; margin-top: 12px; }
#ticker { font: 12px/1.3 var(--mono); color: var(--faint); white-space: nowrap; overflow: hidden;
          text-overflow: ellipsis; min-width: 0; letter-spacing: .01em; }
#ticker .seg.on { color: var(--legend); }
#ticker .seg.done { color: var(--dim); }
#ticker .sep { margin: 0 .55em; color: #45474d; }
#ticker.bad { color: #ff8a7c; }
#ticker.quiet { opacity: .55; transition: opacity 2s ease 3s; }
#pills { display: flex; gap: 6px; flex: none; }

#coach { position: absolute; left: 0; top: 4px; width: min(204px, 60%);
         padding: 11px 14px; border-radius: 10px; background: rgba(12,13,15,.9); border: 1px solid #3a3d44;
         box-shadow: 0 10px 30px rgba(0,0,0,.55); color: var(--dim); font-size: 13px; line-height: 1.5;
         pointer-events: none; opacity: 1; transition: opacity .6s ease; }
#coach b { color: var(--legend); font-weight: 600; }
#coach.gone { opacity: 0; }
body.failed #coach { display: none; }

#add-banner { flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
              margin-bottom: 12px; padding: 8px 8px 8px 14px; border-radius: 10px; max-width: 100%;
              background: var(--sticker); color: var(--ink); box-shadow: 0 6px 20px rgba(0,0,0,.45); font-size: 13.5px; }
#add-banner .pin { font-size: 15px; font-weight: 700; margin-left: .2em; }
#add-banner .add-actions { display: flex; gap: 6px; }
#add-banner .add-short { display: none; }

/* ---------- keys (buttons) ---------- */

.key {
  appearance: none; cursor: pointer; position: relative; padding: 9px 14px; border-radius: 9px;
  border: 1px solid var(--seam); color: var(--legend); font-size: 14px; line-height: 1.2; text-align: center;
  background: linear-gradient(#383b41, #26282c);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11), inset 0 -1px 0 rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.03), 0 2px 5px rgba(0,0,0,.4);
  transition: transform 60ms ease, box-shadow 60ms ease, filter 120ms ease;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.key:hover:not(:disabled) { filter: brightness(1.12); }
.key:active:not(:disabled), .key[aria-pressed="true"] {
  transform: translateY(1px); background: linear-gradient(#222427, #2b2d32);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.04);
}
.key[aria-pressed="true"] { color: #ffd9a0; }
.key:disabled { cursor: default; color: var(--faint); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); background: #24262a; }
.key-small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.key-send { background: linear-gradient(#3da455, #2a7d3d); color: #fff; }
.key-end { color: #ff9c8f; }
.key-end:hover:not(:disabled) { color: #fff; background: linear-gradient(#c94433, #9c2c1f); filter: none; }
.key-ghost { background: none; box-shadow: none; border-color: transparent; }
#add-banner .key { background: linear-gradient(#fff, #dcdcd6); color: var(--ink); border-color: #9c9c94;
                   box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0,0,0,.25); }
#add-banner .key:disabled { color: #8a8a84; background: #e4e4de; }
#add-banner .key-ghost { background: none; box-shadow: none; border-color: transparent; font-size: 17px; padding: 2px 8px; }
.link { appearance: none; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--dim);
        text-decoration: underline; text-decoration-color: #4a4d54; text-underline-offset: 3px; font-size: 13px; }
.link:hover { color: var(--legend); }
.row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- side panel ---------- */

#side { position: relative; min-height: 0; background: linear-gradient(180deg, #202226, var(--slab) 30%, #191a1e);
        border-left: 1px solid var(--seam); box-shadow: inset 1px 0 0 rgba(255,255,255,.05), -18px 0 50px rgba(0,0,0,.28); }
#sheet-handle { display: none; }
#side-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 26px 24px 20px;
               scrollbar-width: thin; scrollbar-color: #3a3d44 transparent; }
#side-scroll > * + * { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--seam);
                       box-shadow: inset 0 1px 0 rgba(255,255,255,.045); }
#side-scroll > #devices-sec, #side-scroll > #start, #side-scroll > #fail, #side-scroll > #running {
  border-top: 0; box-shadow: none; padding-top: 0; }
#masthead h1 { font-size: 27px; line-height: 1.1; font-weight: 700; letter-spacing: -.015em; }
#lede { margin-top: 9px; color: var(--dim); max-width: 34em; }
#lede #title { color: var(--legend); }

#devices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { text-align: left; padding: 10px 12px 9px; display: grid; grid-template-columns: 1fr auto; column-gap: 8px; align-items: baseline; }
.chip b { font-size: 15px; font-weight: 700; white-space: nowrap; }
.chip .chip-os { grid-column: 1 / -1; color: var(--dim); font-size: 12.5px; margin-top: 1px; }
.chip .badge { font: 11.5px/1 var(--mono); color: var(--dim); white-space: nowrap; }
.chip[aria-checked="true"] { transform: translateY(1px); background: linear-gradient(#1b1c1f, #24262a);
                             box-shadow: inset 0 2px 5px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.06); }
.chip[aria-checked="true"] b::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px;
                                      border-radius: 50%; background: var(--send); box-shadow: 0 0 6px var(--send); vertical-align: 2px; }
.chip:disabled b, .chip:disabled .chip-os { color: var(--faint); }
#device-reason { margin-top: 8px; }

#actions { display: grid; gap: 9px; }
.action { text-align: left; padding: 13px 15px 12px; display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: baseline; }
.action b { font-size: 16.5px; font-weight: 700; }
.action .badge { font: 11.5px/1 var(--mono); color: var(--dim); white-space: nowrap; }
.action .sub { grid-column: 1 / -1; color: var(--dim); font-size: 13px; line-height: 1.4; margin-top: 3px; }
.action.primary { background: linear-gradient(#3da455, #29793b); border-color: #0d2a15; }
.action.primary .sub, .action.primary .badge { color: rgba(255,255,255,.82); }
.action.primary:active:not(:disabled) { background: linear-gradient(#256c35, #2f8744); }
#estimate { margin-top: 12px; }
#slot-note { margin-top: 6px; }
body.booting #start, body.running #start, body.failed #start { display: none; }
body.booting #devices-sec, body.failed #devices-sec { display: none; }

#fail h2 { font-size: 17px; font-weight: 700; color: #ffb3a8; }
#fail p { margin-top: 7px; color: var(--legend); }
#fail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }

/* ---------- the battery-door sticker ---------- */

#sticker { background: linear-gradient(170deg, #fbfbf8, var(--sticker) 40%, #dfdfda); color: var(--ink);
           border-radius: 4px; padding: 10px 13px 9px; position: relative;
           box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 0 0 1px rgba(0,0,0,.5), 0 3px 10px rgba(0,0,0,.45); }
.sticker-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 11.5px; }
.sticker-brand { font-weight: 700; letter-spacing: .01em; }
.sticker-brand sup { font-size: .6em; }
.relay { display: inline-flex; align-items: center; gap: 6px; font: 11px/1 var(--mono); color: #55575c; }
.relay i { width: 8px; height: 8px; border-radius: 50%; background: #9a9b96; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.relay[data-status="connecting"] i { background: #e2a52b; animation: relay-wait 1s ease-in-out infinite alternate; }
.relay[data-status="connected"] i { background: #2f9e49; box-shadow: 0 0 5px #3fc45e; }
.relay[data-status="error"] i { background: #d0392b; }
@keyframes relay-wait { to { opacity: .35; } }
.sticker-pin { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 10px; margin-top: 7px; }
.sticker-label { font: 700 11px/1 var(--mono); padding-bottom: 5px; }
#my-pin { font-size: 27px; line-height: 1; font-weight: 700; letter-spacing: .09em; user-select: all; -webkit-user-select: all; }
#barcode { grid-column: 1 / -1; width: 100%; height: 22px; margin-top: 8px; display: block; }
.sticker-foot { margin-top: 6px; font: 10.5px/1.35 var(--mono); color: #55575c; }
#bbm > * + * { margin-top: 12px; }

.switch { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 34px; height: 20px; border-radius: 10px; margin: 0;
                background: #0f1012; border: 1px solid var(--seam); box-shadow: inset 0 1px 3px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.06);
                position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
                       background: linear-gradient(#6d7078, #474a51); box-shadow: 0 1px 2px rgba(0,0,0,.6); transition: transform .15s; }
.switch input:checked { background: #1e5a2d; }
.switch input:checked::after { transform: translateX(14px); background: linear-gradient(#f4f4f4, #c9cacc); }
.field { display: grid; gap: 5px; font-size: 12.5px; color: var(--dim); margin-top: 10px; }
.field input { padding: 8px 10px; border-radius: 7px; border: 1px solid var(--seam); background: #101113;
               box-shadow: inset 0 1px 3px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.05); font-size: 16px; color: var(--legend); }
.lobby-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.online { font: 11.5px/1 var(--mono); color: var(--dim); white-space: nowrap; }
#lobby-list { list-style: none; margin-top: 10px; display: grid; gap: 1px; }
#lobby-list:empty { display: none; }
#lobby-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.05); }
#lobby-list .pin { font-size: 14px; }
#lobby-list .who { color: var(--dim); font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lobby-empty { margin-top: 10px; }

details > summary { cursor: pointer; color: var(--dim); font-size: 13.5px; list-style: none; display: flex; align-items: center; gap: 7px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 0; height: 0; border-left: 5px solid currentColor;
                            border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .12s; }
details[open] > summary::before { transform: rotate(90deg); }
details > summary:hover { color: var(--legend); }
#tips-list { list-style: none; margin-top: 10px; display: grid; gap: 9px; }
#tips-list li { color: var(--dim); font-size: 13.5px; line-height: 1.45; }
#tips-list b { color: var(--legend); font-weight: 600; }
#foot .row-links { gap: 18px; margin-bottom: 8px; }
#log { height: 200px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 8px; padding: 8px 9px; border-radius: 7px;
       background: #0d0e10; border: 1px solid var(--seam); box-shadow: inset 0 1px 4px rgba(0,0,0,.7);
       font: 11px/1.4 var(--mono); color: #8d9098; }

/* ---------- dialogs and toast ---------- */

dialog { border: 1px solid var(--seam); border-radius: 14px; padding: 24px 26px 22px; width: min(520px, calc(100vw - 28px));
         max-height: calc(100dvh - 40px); overflow: auto; color: var(--legend);
         background: linear-gradient(#26282d, var(--slab));
         box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 30px 80px rgba(0,0,0,.7); }
dialog::backdrop { background: rgba(8,9,10,.66); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
dialog p { margin-top: 12px; color: #c9cbd0; max-width: 60ch; }
dialog p b { color: var(--legend); }
dialog form { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
dialog .switch { margin-top: 16px; }
.how-steps { list-style: none; margin-top: 16px; display: grid; gap: 1px; border-radius: 9px; overflow: hidden; border: 1px solid var(--seam); }
.how-steps li { display: grid; grid-template-columns: 7.4em 1fr; gap: 12px; padding: 10px 13px; background: #17181b; align-items: baseline; }
.how-steps b { font: 700 13px/1.3 var(--mono); }
.how-steps span { color: #c9cbd0; font-size: 13.5px; line-height: 1.45; }
.how-steps li + li b::before { content: "\2193\00a0"; color: var(--faint); }
.legend { margin-top: 14px; display: grid; gap: 1px; }
.legend > div { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.06); align-items: baseline; }
.legend dt { color: var(--dim); font-size: 13px; }
.legend dd { font-size: 13.5px; }

#toast { position: fixed; left: 50%; bottom: calc(22px + var(--sab)); transform: translate(-50%, 12px); z-index: 60;
         padding: 9px 15px; border-radius: 9px; background: var(--sticker); color: var(--ink); font-size: 13.5px;
         box-shadow: 0 8px 26px rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- phones and narrow windows ---------- */

@media (max-width: 799px) {
  body { background: radial-gradient(ellipse 120% 60% at 50% 30%, var(--desk-lit) 0%, #1c1d21 55%, var(--desk-edge) 100%); }
  #app { display: block; }
  #stage { height: 100vh; height: 100dvh; padding: var(--sat) 0 calc(34px + var(--sab)); }
  #topbar { display: flex; align-items: center; gap: 9px; flex: none; align-self: stretch; height: 44px;
            padding: 0 calc(10px + var(--sar)) 0 calc(14px + var(--sal)); }
  #topbar .wordmark { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
  #topbar-device { flex: 1; min-width: 0; color: var(--dim); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #phone-wrap { align-items: flex-start; }
  #phone-clip.cropped::before, #phone-clip.cropped::after { content: ""; position: absolute; left: 0; right: 0; height: 16px; z-index: 2; pointer-events: none; }
  #phone-clip.cropped::before { top: 0; background: linear-gradient(#1b1c20, rgba(27,28,32,0)); }
  #phone-clip.cropped::after { bottom: 0; background: linear-gradient(rgba(18,19,21,0), #121315); }
  #under { min-height: 22px; margin-top: 4px; padding: 0 12px; }
  #ticker { font-size: 11px; }
  #ticker .seg.done, #ticker .seg.done + .sep { display: none; }
  #pills, #coach { display: none !important; }
  body.running.phone-away #ticker::after { content: none; }
  #add-banner { margin: 0 8px 6px; font-size: 13px; padding: 5px 5px 5px 11px; gap: 6px; flex-wrap: nowrap; justify-content: space-between; align-self: stretch; }
  #add-banner .add-long { display: none; }
  #add-banner .add-short { display: inline; }
  #add-banner .add-text { white-space: nowrap; }
  #add-banner .pin { font-size: 14px; }
  #add-banner .add-actions { gap: 4px; }
  #add-banner .key-small { padding: 8px 9px; }

  #side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-height: min(74dvh, 640px); display: flex; flex-direction: column;
          border-left: 0; border-top: 1px solid #3a3d44; border-radius: 16px 16px 0 0;
          box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 -14px 40px rgba(0,0,0,.6);
          transform: translateY(calc(100% - 34px - var(--sab))); transition: transform .26s cubic-bezier(.2,.8,.2,1); }
  body.sheet-open #side { transform: none; }
  #sheet-handle { display: flex; flex: none; align-items: center; justify-content: center; width: 100%; height: 34px;
                  appearance: none; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
  #sheet-handle span { width: 44px; height: 5px; border-radius: 3px; background: #53565e; box-shadow: inset 0 1px 1px rgba(0,0,0,.6); }
  #side-scroll { height: auto; flex: 1 1 auto; min-height: 0; padding: 4px calc(18px + var(--sar)) calc(20px + var(--sab)) calc(18px + var(--sal)); }
  body:not(.sheet-open) #side-scroll { visibility: hidden; }
  #masthead h1 { display: none; }
  #lede { margin-top: 0; font-size: 13.5px; }
  .key { padding: 12px 14px; }
  .key-small { padding: 9px 12px; }
  .action { padding: 14px 15px 13px; }
  #log { height: 150px; }
  dialog { padding: 20px 18px 18px; }
  .how-steps li { grid-template-columns: 1fr; gap: 2px; }
  .legend > div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  body.failed .led { animation: none; opacity: 1; }
}
