/* "Playing on another device". Direction: the house style (docs/claude/ui.md "The house
   style"): walnut, brass, ink and ember, with the painted brass-and-walnut device set.
   One look on every page: desktop, /m, /listen and /books share this file, and only the
   desktop loads styles.css, so these values are written out and match its --hearth-*.
   Below the privacy cover and every lock on purpose (z-index under 9500): a cover must
   never have a title showing over it. */

.hd-pill, .hd-strip, .hd-scrim, .hd-inline {
  --hd-glass: rgba(30, 21, 14, .95);
  --hd-sheet: radial-gradient(560px 200px at 12% 0, rgba(245, 158, 11, .07), transparent 70%), linear-gradient(180deg, #221710 0%, #17100b 100%);
  --hd-plate: linear-gradient(180deg, #2c2016 0%, #1e150e 62%, #18110b 100%);
  --hd-plate-hi: linear-gradient(180deg, #38291c 0%, #241910 100%);
  --hd-plaque: radial-gradient(70% 120% at 50% 0, rgba(255, 170, 80, .2), transparent 72%), linear-gradient(180deg, #3d2717 0%, #2a1a0f 58%, #20140c 100%);
  --hd-plaque-hi: radial-gradient(70% 130% at 50% 0, rgba(255, 170, 80, .36), transparent 74%), linear-gradient(180deg, #47301c 0%, #2f1d11 58%, #22150c 100%);
  --hd-line: rgba(255, 201, 148, .13);
  --hd-line-hi: rgba(216, 168, 74, .46);
  --hd-brass: #c9973f;
  --hd-ink: #fff3de;
  --hd-dim: #bfb09c;
  --hd-ember: #f6b544;
  --hd-ember-soft: rgba(246, 181, 68, .13);
  --hd-track: rgba(255, 233, 200, .16);
  --hd-ease: cubic-bezier(.16, 1, .3, 1);
  /* Not inherit: /listen and /books set no font on <body>, and would draw this in a serif. */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.hd-pill *, .hd-strip *, .hd-scrim *, .hd-inline * { box-sizing: border-box; }
.hd-pill[hidden], .hd-strip[hidden], .hd-inline[hidden] { display: none !important; }

/* ── the top-bar pill ── one capsule, the bar's own 38px */
.hd-pill {
  position: relative; display: inline-flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0;
  height: var(--tb-h, 38px); max-width: 248px; padding: 0 14px 0 6px; overflow: hidden;
  border-radius: 19px; border: 1px solid var(--hd-line-hi); background: var(--hd-ember-soft); color: var(--hd-ink);
  cursor: pointer; transition: background .18s, border-color .18s;
}
.hd-pill:hover { background: rgba(246, 181, 68, .24); }
.hd-pill:focus-visible, .hd-strip button:focus-visible, .hd-inline:focus-visible, .hd-scrim button:focus-visible, .hd-scrim input:focus-visible { outline: 2px solid var(--hd-ember); outline-offset: 2px; }
.hd-pill.is-paused { border-color: var(--hd-line); background: rgba(255, 255, 255, .04); }
.hd-pill-icon { flex: none; display: grid; place-items: center; width: 26px; height: 26px; }
.hd-pill-dev { display: block; width: 26px; height: 26px; }
.hd-pill-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; text-align: left; line-height: 1.15; }
.hd-pill-kicker { font-size: 10.5px; font-weight: 600; color: var(--hd-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-pill-value { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 12.5px; font-weight: 600; }
.hd-pill-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-pill-time { flex: none; color: var(--hd-ember); font-variant-numeric: tabular-nums; }
.hd-pill.is-paused .hd-pill-time { color: var(--hd-dim); }
.hd-pill-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--hd-track); }
.hd-pill-bar i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left center; background: var(--hd-ember); transition: transform .9s linear; }
.hd-pill.is-paused .hd-pill-bar i { background: var(--hd-dim); }
/* The bar is folded away: wait in the corner, above whichever player bar is down there. */
.hd-pill-float { position: fixed; right: 16px; bottom: calc(var(--np-h, 0px) + 16px); z-index: 8900; background: var(--hd-glass); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.hd-pill-float:hover { background: #2c2016; }
/* A crowded bar keeps the picture and the clock. */
@media (max-width: 1320px) {
  .hd-pill:not(.hd-pill-float) { max-width: 92px; padding-right: 10px; }
  .hd-pill:not(.hd-pill-float) .hd-pill-kicker, .hd-pill:not(.hd-pill-float) .hd-pill-title { display: none; }
}

/* ── the phone strip ── above the tab bar and any mini player (devices.js stripBottom) */
.hd-strip {
  position: fixed; left: 8px; right: 8px; max-width: 640px; margin: 0 auto; z-index: 18;
  display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; height: 56px; padding-left: 6px; overflow: hidden;
  border-radius: 10px; border: 1px solid var(--hd-line-hi); background: var(--hd-glass); color: var(--hd-ink);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  animation: hd-rise .32s var(--hd-ease) both;
}
.hd-strip.is-paused { border-color: var(--hd-line); }
.hd-strip button { border: 0; background: none; color: inherit; font: inherit; padding: 0; cursor: pointer; }
.hd-strip-main { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; height: 100%; padding-right: 4px !important; text-align: left; }
.hd-strip-art { position: relative; display: block; width: 44px; height: 44px; }
.hd-strip-img { display: block; width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #2c2016; }
.hd-strip-dev { position: absolute; right: -5px; bottom: -3px; width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .8)); }
.hd-strip-art.no-art .hd-strip-dev { right: 2px; bottom: 2px; width: 40px; height: 40px; filter: none; }
.hd-strip-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hd-strip-kicker { font-size: 12px; font-weight: 600; color: var(--hd-ember); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-strip.is-paused .hd-strip-kicker { color: var(--hd-dim); }
.hd-strip-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-strip-time { font-size: 13px; font-weight: 600; color: var(--hd-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hd-strip-tuck { display: grid !important; place-items: center; width: 44px; height: 100%; color: var(--hd-dim) !important; }
.hd-strip-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--hd-track); }
.hd-strip-bar i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left center; background: var(--hd-ember); transition: transform .9s linear; }
.hd-strip.is-paused .hd-strip-bar i { background: var(--hd-dim); }
/* Tucked: the device and its progress, nothing else, at the same right-hand edge. */
.hd-strip-ring { display: none; }
.hd-strip.is-tucked { left: auto; right: 10px; display: block; width: 52px; height: 52px; padding: 0; border-radius: 50%; border: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; overflow: visible; }
.hd-strip.is-tucked .hd-strip-main, .hd-strip.is-tucked .hd-strip-tuck, .hd-strip.is-tucked .hd-strip-bar { display: none !important; }
.hd-strip.is-tucked .hd-strip-ring { --p: 0%; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: conic-gradient(var(--hd-ember) var(--p), var(--hd-track) 0); box-shadow: 0 6px 18px rgba(0, 0, 0, .55); }
.hd-strip.is-tucked.is-paused .hd-strip-ring { background: conic-gradient(var(--hd-dim) var(--p), var(--hd-track) 0); }
.hd-ring-face { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #1e150e; }
.hd-ring-dev { display: block; width: 28px; height: 28px; }

/* The phone's Browser swaps the tab bar for its own: the page is the whole screen. */
body.br-active .hd-strip { display: none; }

/* ── on a title's own page ── */
.hd-inline {
  display: inline-flex; align-items: center; gap: 8px; flex-basis: 100%; max-width: 100%; min-height: 36px; margin: 2px 0 0; padding: 4px 12px 4px 6px; width: fit-content;
  border: 1px solid var(--hd-line-hi); border-radius: 18px; background: var(--hd-ember-soft); color: var(--hd-ink);
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; text-align: left;
}
.hd-inline:hover { background: rgba(246, 181, 68, .24); }
.hd-inline.is-paused { border-color: var(--hd-line); background: rgba(255, 255, 255, .05); }
.hd-inline-icon { flex: none; display: grid; place-items: center; width: 24px; height: 24px; }
.hd-inline-dev { display: block; width: 24px; height: 24px; }
.hd-inline-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── the selector ── a centred popout, a sheet on a phone */
.hd-scrim { position: fixed; inset: 0; z-index: 9400; display: grid; place-items: center; padding: 24px; background: rgba(6, 5, 9, .62); animation: hd-fade .18s ease both; }
.hd-sheet {
  display: flex; flex-direction: column; width: min(600px, 92vw); max-height: min(720px, 86vh); overflow: hidden; outline: none;
  border-radius: 14px; border: 1px solid var(--hd-line-hi); background: var(--hd-sheet); color: var(--hd-ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .65);
  animation: hd-pop .26s var(--hd-ease) both;
}
.hd-sheet-head { flex: none; display: flex; align-items: flex-start; gap: 16px; padding: 20px 20px 16px 24px; border-bottom: 1px solid var(--hd-line); }
.hd-sheet-words { flex: 1; min-width: 0; }
.hd-sheet-title { margin: 0; font-family: var(--hearth-font, inherit); font-size: 21px; font-weight: 600; line-height: 1.2; text-wrap: balance; }
.hd-sheet-sub { margin: 6px 0 0; max-width: 56ch; font-size: 13.5px; line-height: 1.45; color: var(--hd-dim); text-wrap: pretty; }
.hd-x { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin: -4px -4px 0 0; border: 1px solid var(--hd-line-hi); border-radius: 50%; background: var(--hd-plate); color: var(--hd-ink); cursor: pointer; }
.hd-x:hover { background: var(--hd-plate-hi); }
.hd-sheet-body { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 4px 24px 20px; }
.hd-group { margin: 20px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hd-dim); }
.hd-empty { margin: 20px 0 8px; max-width: 48ch; font-size: 14px; line-height: 1.5; color: var(--hd-dim); text-wrap: pretty; }

.hd-row { padding: 12px 0; border-bottom: 1px solid var(--hd-line); }
.hd-sheet.is-opening .hd-row { animation: hd-row-in .3s var(--hd-ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.hd-row:last-child { border-bottom: 0; }
.hd-row-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.hd-row-head-static { cursor: default; }
.hd-dev { display: block; width: 44px; height: 44px; }
.hd-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hd-row-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; font-weight: 700; }
.hd-name-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-tag { flex: none; padding: 1px 7px; border-radius: 9px; background: rgba(255, 255, 255, .08); font-size: 11px; font-weight: 600; color: var(--hd-dim); white-space: nowrap; }
.hd-row-what, .hd-row-sub { min-width: 0; font-size: 13.5px; color: var(--hd-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-state { color: var(--hd-ember); font-weight: 600; }
.hd-row.is-paused .hd-state { color: var(--hd-dim); }
.hd-row-art { display: block; width: 56px; height: 56px; border-radius: 6px; object-fit: cover; background: #2c2016; }
.hd-row.is-followed .hd-row-name .hd-name-text { color: var(--hd-ember); }
.hd-link { flex: none; min-height: 36px; padding: 0 4px; border: 0; background: none; color: var(--hd-dim); font: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.hd-link:hover { color: var(--hd-ink); }
.hd-rename { width: 100%; max-width: 280px; height: 36px; padding: 0 10px; border: 1px solid var(--hd-line-hi); border-radius: 6px; background: rgba(0, 0, 0, .28); color: var(--hd-ink); font: inherit; font-size: 16px; font-weight: 600; }

.hd-track { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.hd-track-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hd-bar { display: block; height: 4px; border-radius: 2px; background: var(--hd-track); overflow: hidden; }
.hd-bar i { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: left center; background: var(--hd-ember); transition: transform .9s linear; }
.hd-row.is-paused .hd-bar i { background: var(--hd-dim); }
.hd-times { display: flex; justify-content: space-between; gap: 12px; }
.hd-time { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--hd-ink); white-space: nowrap; }
.hd-time-end { color: var(--hd-dim); }
.hd-range { --p: 0%; display: block; width: 100%; height: 24px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.hd-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--hd-ember) var(--p), var(--hd-track) var(--p)); }
.hd-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--hd-track); }
.hd-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--hd-ember); }
.hd-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff3de; border: 2px solid var(--hd-ember); }
.hd-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff3de; border: 2px solid var(--hd-ember); }
.hd-skip { flex: none; width: 44px; height: 44px; border: 1px solid var(--hd-line-hi); border-radius: 50%; background: var(--hd-plate); color: var(--hd-ink); font: inherit; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.hd-skip:hover { background: var(--hd-plate-hi); }
.hd-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.hd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--hd-line-hi); border-radius: 8px; background: var(--hd-plate); color: var(--hd-ink); font: inherit; font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: transform .16s var(--hd-ease); }
.hd-btn:hover { background: var(--hd-plate-hi); transform: translateY(-1px); }
.hd-btn:active { transform: translateY(1px); }
.hd-btn svg { display: block; flex: none; }
.hd-btn-primary { border: 1.5px solid var(--hd-brass); background: var(--hd-plaque); box-shadow: 0 2px 0 #0b0806; }
.hd-btn-primary:hover { background: var(--hd-plaque-hi); }
.hd-note { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--hd-dim); text-wrap: pretty; }
.hd-note:empty { display: none; }

@media (max-width: 640px) {
  .hd-scrim { place-items: end center; padding: 0; }
  .hd-sheet { width: 100%; max-height: 88dvh; border-radius: 16px 16px 0 0; border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom); animation-name: hd-sheet-up; }
  .hd-sheet-head { padding: 18px 16px 14px; }
  .hd-sheet-body { padding: 4px 16px 18px; }
}

@keyframes hd-fade { from { opacity: 0; } }
@keyframes hd-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes hd-sheet-up { from { transform: translateY(40px); opacity: .4; } }
@keyframes hd-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes hd-row-in { from { opacity: 0; transform: translateX(-8px); } }
@media (prefers-reduced-motion: reduce) {
  .hd-strip, .hd-scrim, .hd-sheet, .hd-sheet.is-opening .hd-row { animation: none; }
  .hd-pill-bar i, .hd-strip-bar i, .hd-bar i { transition: none; }
}
