/* Mary's Book: THE BAR (DESIGN.md 6.1) and the Radio's panel.  Adapted from 79. Mike's Map/app/shared/bar.css on
   November 29, 2026: one bar stuck to the top; restyled as a plum ribbon with candlelight letters, softer than Mike's
   Map's garage.  Wide screens (1,000 px and up): one row, 64 px.  Narrow screens: two rows, 56 px and 48 px, the same
   pieces in the same order.  The status line and the display use ordinary Title Case letters at 18 px, never small
   capitals (Review Pass 18).  The display's candlelight on plum glass is 11.1 to 1. */
.mbbar { position: sticky; top: 0; z-index: 800; background: var(--plum); color: #FFFDF8; box-shadow: 0 2px 10px rgba(42,27,46,.25); padding-top: env(safe-area-inset-top, 0); }
.mbbar-wide { display: none; align-items: center; gap: 10px; height: 64px; padding: 0 16px; max-width: 1400px; margin: 0 auto; }
.mbbar-narrow { display: block; padding: 4px 8px; }
@media (min-width: 1000px) { .mbbar-wide { display: flex; } .mbbar-narrow { display: none; } }
.mbbar-narrow .row1 { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 56px; }
.mbbar-narrow .row2 { display: flex; align-items: center; gap: 6px; height: 48px; }
.mbbar-narrow .navs { display: flex; gap: 4px; }
.mbbar-btn { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; flex: none; border: 0; border-radius: 12px; background: rgba(255,253,248,.08); color: #FFFDF8; cursor: pointer; padding: 0; }
.mbbar-btn svg, .mbbar-contents svg, .mbbar-vol svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mbbar-btn.play svg, .mbbar-btn.prev svg, .mbbar-btn.next svg { fill: currentColor; stroke-width: 1.4; }
.mbbar-btn:hover { background: rgba(255,253,248,.18); }
.mbbar-btn:disabled { opacity: .4; cursor: default; }
.mbbar-btn.play.on { background: var(--glow); color: var(--ink); }
.mbbar-narrow .row2 .mbbar-btn { height: 44px; width: 44px; }
.mbbar-btn:focus-visible, .mbbar-logo:focus-visible, .mbbar-contents:focus-visible, .mbd:focus-visible, .mbbar-line:focus-visible { outline: 3px solid var(--glow); outline-offset: 2px; }

/* The logo: a small plum ribbon, "Mary's" in Pinyon Script (32 px, snow cream), "Book" in Fraunces (20 px, glow). */
.mbbar-logo { display: inline-flex; align-items: baseline; gap: .3rem; min-height: 48px; padding: 0 .4rem; border: 0; background: none; color: #FFFDF8; cursor: pointer; white-space: nowrap; }
.mbbar-logo .mark { display: inline-block; width: 14px; height: 26px; align-self: center; background: var(--glow); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); margin-right: .2rem; }
html[data-ornament="ornament"] .mbbar-logo .mark { width: 20px; height: 20px; border-radius: 50%; clip-path: none; background: radial-gradient(circle at 35% 35%, #F1C27D, #A3202E 70%); }
html[data-ornament="leaf"] .mbbar-logo .mark { width: 18px; height: 22px; clip-path: none; border-radius: 0 70% 0 70%; background: #D98E4A; }
.mbbar-logo .mary { font: 32px/1 var(--script); color: #FFFDF8; }
.mbbar-logo .book { font: 600 20px/1 var(--serif); color: var(--glow); }
.mbbar-contents { display: inline-flex; align-items: center; gap: .4rem; min-height: 56px; padding: 0 .9rem; border: 2px solid rgba(243,201,139,.6); border-radius: 14px; background: rgba(255,253,248,.06); color: #FFFDF8; font: 600 1rem var(--sans); cursor: pointer; flex: none; }
.mbbar-contents:hover { background: rgba(255,253,248,.16); }
.mbbar-narrow .mbbar-contents { min-height: 48px; padding: 0 .6rem; }

/* The status line: one quiet line, fading to the next every 7 seconds; never sliding sideways. */
.mbbar-status { position: relative; flex: 1 1 auto; min-width: 0; height: 44px; overflow: hidden; }
.mbbar-line { position: absolute; inset: 0; display: flex; align-items: center; width: 100%; border: 0; background: none; color: var(--glow); font: 18px/1.2 var(--sans); padding: 0 .4rem; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .5s ease; cursor: default; }
.mbbar-line.in { opacity: 1; transition-delay: .3s; } .mbbar-line.out { opacity: 0; transition-duration: .3s; transition-delay: 0s; }
.mbbar-line.go { cursor: pointer; text-decoration: underline; text-decoration-color: rgba(243,201,139,.5); text-underline-offset: 4px; }
.mb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* The radio: Last, Play / Stop, Next, the display (plum glass, candlelight letters), the level, the panel. */
.mbbar-radio { display: flex; align-items: center; gap: 6px; flex: none; }
.mbd { display: flex; align-items: center; gap: .5rem; height: 44px; min-width: 0; width: 14rem; max-width: 26vw; padding: 0 .7rem; border: 1px solid rgba(243,201,139,.35); border-radius: 10px; background: var(--glass); color: var(--glow); cursor: pointer; }
.mbbar-narrow .mbd { flex: 1 1 auto; width: auto; max-width: none; }
.mbd .w { font: 18px/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .25s ease; }
.mbd.fade .w { opacity: 0; }
.mbbar-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; flex: none; }
.mbbar-bars i { display: block; width: 3px; height: 100%; background: var(--accent); transform-origin: bottom; transform: scaleY(.15); border-radius: 1px; }
.mbbar:not(.is-playing) .mbd .mbbar-bars { display: none; }
.mbbar-vol { display: inline-flex; align-items: center; gap: 4px; color: #FFFDF8; }
.mbbar-vol input { width: 90px; accent-color: var(--glow); }
.mbbar-btn.arrow { width: 40px; }
@media (min-width: 1000px) and (max-width: 1300px) { .mbbar-vol { display: none; } .mbd { width: 12rem; } }

/* The plain hover label for an icon alone (desktop only, after 0.6 s). */
.mb-hover { position: fixed; z-index: 990; background: var(--ink); color: #FFFDF8; font: 18px/1.2 var(--sans); padding: .3rem .6rem; border-radius: 8px; pointer-events: none; white-space: nowrap; }

/* ---------- the radio's panel ---------- */
.mbr-scrim { position: fixed; inset: 0; z-index: 880; background: rgba(42,27,46,.4); }
.mbr-panel { position: fixed; z-index: 881; top: 72px; right: 16px; width: min(30rem, calc(100vw - 32px)); max-height: calc(100vh - 90px); overflow: auto; overscroll-behavior: contain; background: var(--paper); color: var(--ink);
  border-radius: 18px; box-shadow: 0 24px 60px rgba(42,27,46,.35); }
@media (max-width: 999px) { .mbr-panel { top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-height: 88vh; border-radius: 18px 18px 0 0; } }
.mbr-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: .6rem .8rem .5rem 1.1rem; background: var(--paper); border-bottom: 2px solid var(--rose); }
.mbr-head h2 { flex: 1; margin: 0; font-size: 1.4rem; }
.mbr-head .pill { min-width: 5rem; }
.mbr-head .pill[aria-checked="true"] { background: var(--pine); border-color: var(--pine); color: #FFFDF8; }
.mbr-x { width: 56px; height: 56px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--plum); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.mbr-x svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.mbr-body { padding: .8rem 1.1rem 1.4rem; }
.mbr-now { background: var(--glass); color: var(--glow); border-radius: 14px; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.mbr-now .k { font-weight: 700; } .mbr-now .t { font: 600 1.3rem/1.25 var(--serif); color: #FFFDF8; } .mbr-now .by, .mbr-now .cr { color: var(--glow); }
.mbr-now .row { display: flex; gap: 10px; margin-top: .5rem; }
.mbr-now .mb-btn { background: transparent; color: #FFFDF8; border-color: rgba(243,201,139,.6); }
.mbr-now .mb-btn svg { width: 20px; height: 20px; fill: currentColor; }
.mbr-lv { display: flex; align-items: center; gap: .8rem; margin: .8rem 0; font-weight: 600; }
.mbr-lv input { flex: 1; accent-color: var(--plum); min-height: 44px; }
.mbr-modes { display: flex; flex-wrap: wrap; gap: 10px; }
.mbr-modes .mb-btn[aria-pressed="true"] { background: var(--plum); color: #FFFDF8; }
.mbr-note { margin: .6rem 0; font-weight: 600; color: var(--plum); }
.mbr-set h3, .mbr-hidden h3 { margin: 1rem 0 .3rem; font-size: 1.15rem; }
.mbr-row { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); }
.mbr-song { flex: 1; display: flex; align-items: center; gap: .5rem; min-height: 56px; border: 0; background: none; text-align: left; cursor: pointer; font-weight: 600; color: var(--ink); padding: 0 .2rem; }
.mbr-song.plain { cursor: default; font-weight: 400; }
.mbr-row.on .mbr-song { color: var(--plum); }
.mbr-heart { width: 52px; height: 52px; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.mbr-heart svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.mbr-heart.is-fav { color: #A3202E; } .mbr-heart.is-fav svg { fill: #A3202E; }
.mbr-about { margin-top: 1rem; }

@media (prefers-reduced-motion: reduce) { .mbbar-line, .mbd .w { transition: none; } }

/* A phone (an iPhone SE is 375 px wide): the first row must fit Back, Forward, the logo and Contents with nothing
   pushed off the edge, at every Text Size.  The bar's words stay at 18 px or more, in px, so Biggest cannot widen it. */
@media (max-width: 999px) {
  .mbbar-narrow .navs .mbbar-btn { width: 44px; height: 44px; }
  .mbbar-narrow .mbbar-contents { font-size: 18px; gap: .25rem; padding: 0 .55rem; }
  .mbbar-narrow .mbbar-contents svg { width: 20px; height: 20px; }
  .mbbar-narrow .row1 { min-width: 0; }
  .mbbar-narrow .mbbar-logo { min-width: 0; flex: 0 1 auto; padding: 0 .2rem; }
}
@media (max-width: 420px) {
  .mbbar-narrow .mbbar-logo .mark { display: none; }
  .mbbar-narrow .navs { gap: 2px; }
}
@media (max-width: 420px) {
  .mbbar-narrow { padding: 4px 6px; }
  .mbbar-narrow .row1 { gap: 4px; }
  .mbbar-narrow .mbbar-logo { gap: .12rem; padding: 0; }
  .mbbar-narrow .mbbar-contents { padding: 0 .4rem; gap: 3px; border-width: 2px; }
  .mbbar-narrow .mbbar-contents svg { width: 18px; height: 18px; }
}
/* The bar stays at the top while the page scrolls under it: the sticking is done by its holder, #bar, a child of
   <body>, because a sticky element only sticks inside its own parent. */
#bar { position: sticky; top: 0; z-index: 800; }
