/* Layout: full-bleed 3D canvas; glass UI floats on top (top bar, pins, right-side page panel). */
:root {
  --ink: #2a2018;
  --ink-2: #5d4f42;
  --ink-3: #8a7b6c;
  --paper: rgba(252, 247, 238, 0.86);
  --paper-solid: #fbf6ec;
  --line: rgba(42, 32, 24, 0.11);
  --accent: #b5332b;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Geist", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --shadow: 0 8px 28px rgba(70, 45, 20, 0.16);
  --safe-b: env(safe-area-inset-bottom, 0px); /* W13 (VW10 N-2): read by main.js, so the home frame leaves room for what .enter's bottom does */
  color-scheme: light;
}

html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: #ecd9c0; color: var(--ink); font: 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
canvas#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand, .tabs, .connect {
  background: var(--paper); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: var(--shadow); border-radius: 14px;
}
.brand {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 7px 14px 7px 9px; text-decoration: none; color: var(--ink);
  font: 800 21px/1 var(--display); letter-spacing: -0.02em;
}
.brand svg { width: 28px; height: 28px; }
.tabs {
  display: flex; gap: 2px; margin-inline: auto; padding: 5px; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 7px; flex: none;
  border: 0; background: transparent; color: var(--ink-2);
  padding: 7px 11px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  font-weight: 500; font-size: 13.5px; transition: background 0.2s, color 0.2s;
}
.tab .dot, .pin .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18); }
.tab:hover, .tab.hot { background: rgba(42, 32, 24, 0.07); color: var(--ink); }
.tab[aria-current="true"] { background: var(--ink); color: var(--paper-solid); }
/* Cashmere App (owner, 6 Nov): a normal last tab; order puts it after the places main.js adds */
.tab-out { order: 1; --c: #5b8def; text-decoration: none; }
.tab .soon, .pin .go { font: 500 10.5px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.tab .soon { padding: 3px 5px; border-radius: 5px; background: rgba(224, 102, 46, 0.14); color: #b4501f; }
.tab .soon.off { background: rgba(42, 32, 24, 0.07); color: var(--ink-2); }
.connect {
  flex: none; border: 0; cursor: pointer; padding: 10px 15px;
  font-weight: 600; font-size: 13.5px; color: var(--paper-solid); background: var(--ink);
}
@media (hover: hover) { .connect:hover { background: #3d3025; } }
.sound {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; cursor: pointer;
  border-radius: 13px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
@media (hover: hover) { .sound:hover { background: var(--paper-solid); } }
/* the plain menu's button (W2B, G-24): the same glass as the top bar, between the places and the sound button */
.menu-btn {
  flex: none; border: 0; cursor: pointer; padding: 10px 15px; border-radius: 14px; font-weight: 600; font-size: 13.5px;
  color: var(--ink); background: var(--paper); box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.menu-btn[aria-expanded="true"] { background: var(--paper-solid); }
@media (hover: hover) { .menu-btn:hover { background: var(--paper-solid); } }
.sound svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound .spk { fill: currentColor; stroke: none; }
/* G-07: the notices bell sits beside the sound button, with the same plate */
.bell {
  position: relative; flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; cursor: pointer;
  border-radius: 13px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
@media (hover: hover) { .bell:hover { background: var(--paper-solid); } }
.bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell-n { position: absolute; z-index: 1; pointer-events: none; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #b4501f; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.bell-panel {
  position: absolute; top: 56px; right: 16px; z-index: 30; box-sizing: border-box; width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow: auto; /* W17 (UX1 item 9): border-box, so the padding is inside the 380 (it was 408 wide, and 371 + 28 on a phone started 12 px off the screen) */
  padding: 12px 14px; border-radius: 14px; background: var(--paper-solid); color: var(--ink); box-shadow: var(--shadow); font-size: 13.5px;
}
.bell-panel[hidden] { display: none; }
.bell-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.bell-panel ul { list-style: none; margin: 0; padding: 0; }
.bell-panel li { display: grid; gap: 3px; padding: 9px 0; border-top: 1px solid rgba(0, 0, 0, 0.08); }
.bell-panel li.read { opacity: 0.6; }
.bell-panel li span { color: var(--ink-3); }
.bell-panel li em { display: flex; gap: 12px; font-style: normal; }
.bell-panel .link { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; text-decoration: underline; font: inherit; }
/* FX6 (BW I8): the bell's links (Open, Mark read, Mark all read, Retry) are 20 px high; on touch each has a 44 px hit area (12 px above and below it) without making the rows taller */
@media (max-width: 900px), (pointer: coarse) {
  .bell-panel .link { position: relative; }
  .bell-panel .link::before { content: ""; position: absolute; inset: -12px -6px; }
}
.bell-warn { margin: 6px 0; color: #b4501f; }
.bell-none, .bell-foot { margin: 8px 0 0; color: var(--ink-3); font-size: 12.5px; }

.sound[aria-pressed="true"] .mute, .sound[aria-pressed="false"] .wave { display: none; }
.sound[aria-pressed="false"] { color: var(--ink-3); }

/* map pins */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
.pin {
  position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 11px 6px 9px; border: 0; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: var(--paper-solid); color: var(--ink); box-shadow: 0 4px 16px rgba(60, 35, 10, 0.2);
  font-weight: 600; font-size: 12.5px; transition: opacity 0.3s, background 0.2s, color 0.2s;
}
.pin::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; width: 9px; height: 9px;
  background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 0 0 2px 0; z-index: -1;
}
.pin .go { max-width: 0; overflow: hidden; opacity: 0; transition: max-width 0.25s, opacity 0.2s; }
.pin.hot { background: var(--ink); color: var(--paper-solid); }
.pin.hot .go { max-width: 48px; opacity: 0.7; }
.pin.soon { background: rgba(252, 247, 238, 0.7); color: var(--ink-2); }
.pin.soon.hot { background: var(--ink); color: var(--paper-solid); }
/* D647 (owner, 13 Nov): what can't be used in this build is grey, lights up for nothing and does nothing (src/inert.js); its tooltip says why */
.pin.is-inert, .pin.is-inert.hot { background: rgba(252, 247, 238, 0.62); color: var(--ink-3); cursor: default; }
.pin.is-inert .dot, .tab.is-inert .dot { filter: grayscale(1); opacity: 0.5; }
.tab.is-inert { color: var(--ink-3); cursor: default; }

/* page panel */
.panel {
  position: fixed; z-index: 6;
  top: calc(78px + env(safe-area-inset-top, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  width: min(520px, calc(100vw - 32px)); /* W17 (UX1 item 1): 410 px before; 480 from 901 to 1099 px and 560 from 1400 px (below): src/core/frame.js panelWidthFor says the same to the camera */
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper-solid); border-radius: 22px;
  box-shadow: 0 24px 70px rgba(60, 35, 10, 0.3), 0 0 0 1px rgba(42, 32, 24, 0.05);
  transform: translateX(calc(100% + 48px)); visibility: hidden;
  transition: transform 0.6s cubic-bezier(0.2, 0.85, 0.2, 1), visibility 0s linear 0.6s;
}
.panel.open { transform: none; visibility: visible; transition: transform 0.6s cubic-bezier(0.2, 0.85, 0.2, 1), visibility 0s; }
@media (min-width: 901px) and (max-width: 1099px) { .panel { width: 480px; } }
@media (min-width: 1400px) { .panel { width: 560px; } }
.panel-head {
  position: relative; padding: 22px 24px 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, var(--paper-solid)), var(--paper-solid));
  border-bottom: 1px solid var(--line);
}
.panel-head::before { content: ""; position: absolute; left: 24px; top: 0; width: 44px; height: 4px; border-radius: 0 0 3px 3px; background: var(--c); }
.kicker { display: block; font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; }
.panel h2 { margin: 8px 0 0; font: 800 40px/1 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.close {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 12px;
  border: 0; background: rgba(42, 32, 24, 0.06); cursor: pointer; font-size: 22px; line-height: 1; color: var(--ink-2);
}
@media (hover: hover) { .close:hover { background: rgba(42, 32, 24, 0.12); color: var(--ink); } }
.panel-body { flex: 1; overflow-y: auto; padding: 18px 24px 22px; display: flex; flex-direction: column; gap: 18px; }
.panel-body > * { flex: none; }
.blurb { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-2); max-width: 62ch; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.facts div { background: var(--paper-solid); padding: 11px 13px; min-width: 0; }
.facts dt { font-size: 11.5px; color: var(--ink-3); }
.facts dd { margin: 3px 0 0; font: 500 14.5px/1.3 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); overflow-wrap: anywhere; }
.facts div:only-child { grid-column: 1 / -1; }
.live { border-radius: 14px; padding: 14px; background: rgba(42, 32, 24, 0.04); }
.live h3 { margin: 0 0 8px; font: 700 15px/1.2 var(--display); }
.live .rows div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.live .rows div:last-child { border-bottom: 0; }
.live .rows span { color: var(--ink-2); }
.live .rows b { font: 500 13.5px var(--mono); color: var(--ink-3); }
.live .note, .actions-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); }
/* CHECK-1116 finding 4: the note stands above the buttons it explains (it was under them, and on a phone under the fold). Phase 2: the two are one block
   (.actions-dock), 8 px apart. On a phone that block is the sticky bar (below), so the note stays with its buttons: with two buttons the bar covered the note
   until the card was scrolled (Trek, Hay Bales, Gatehouse). A card with no button and no note has no block. */
.actions-dock { display: grid; gap: 8px; }
.actions-dock:not(:has(button)):has(> .actions-note[hidden]) { display: none; }
.actions-note { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions:empty { display: none; }
.actions button { flex: 1 1 140px; border: 0; border-radius: 12px; padding: 12px 14px; font-weight: 600; font-size: 14px; cursor: not-allowed; }
.actions .primary { background: var(--c); color: #fff; opacity: 0.55; }
.actions .ghost { background: rgba(42, 32, 24, 0.07); color: var(--ink-2); opacity: 0.8; }
.panel-foot { display: flex; justify-content: space-between; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.panel-foot button { border: 0; background: transparent; cursor: pointer; padding: 8px 10px; border-radius: 10px; font-weight: 500; color: var(--ink-2); }
@media (hover: hover) { .panel-foot button:hover { background: rgba(42, 32, 24, 0.06); color: var(--ink); } }
.panel-foot span { font-family: var(--mono); }

.hint {
  position: fixed; z-index: 2; margin: 0;
  left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  padding: 7px 12px; border-radius: 10px; background: var(--paper); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 12px; color: var(--ink-2); box-shadow: var(--shadow); transition: opacity 0.3s;
}
body.panel-open .hint { opacity: 0; }
/* W15 (OV-05): the island's mood line, one line under the hint inside the same box (so it keeps the hint's place, its width rules and the moments it is left out) */
.hint .mood { display: block; margin-top: 3px; font-weight: 600; color: var(--ink); }
.hint .mood[hidden] { display: none; }

/* Enter world */
.enter {
  position: fixed; z-index: 4; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 15px 22px 15px 26px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--paper-solid);
  font: 700 18px/1 var(--display); letter-spacing: -0.01em;
  box-shadow: 0 14px 34px rgba(40, 25, 10, 0.35), 0 0 0 6px rgba(252, 247, 238, 0.4);
  transition: transform 0.35s cubic-bezier(0.2, 0.85, 0.2, 1), opacity 0.35s, box-shadow 0.3s;
}
.enter svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s; }
@media (hover: hover) { .enter:hover { transform: translateX(-50%) translateY(-3px); box-shadow: 0 18px 40px rgba(40, 25, 10, 0.4), 0 0 0 8px rgba(252, 247, 238, 0.5); } }
@media (hover: hover) { .enter:hover svg { transform: translateX(3px); } }
.enter::before {
  content: ""; position: absolute; inset: -6px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 0 rgba(252, 247, 238, 0.55); animation: enter-pulse 2.6s ease-out infinite;
}
@keyframes enter-pulse { 0% { box-shadow: 0 0 0 0 rgba(252, 247, 238, 0.55); } 70%, 100% { box-shadow: 0 0 0 16px rgba(252, 247, 238, 0); } }
body.panel-open .enter, body.entering .enter { opacity: 0; pointer-events: none; transform: translate(-50%, 24px); }
body.entering .topbar, body.entering #labels, body.entering .hint { opacity: 0; pointer-events: none; transition: opacity 0.5s; }
body.entering .topbar > * { pointer-events: none; } /* faded out, so not clickable either */

.veil {
  position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, #fffaf2, #f1e3cf);
  opacity: 0; transition: opacity 1.1s ease;
}
.veil.on { opacity: 1; pointer-events: auto; }
.veil span { font: 800 34px/1 var(--display); letter-spacing: -0.02em; color: var(--ink); opacity: 0; transform: translateY(8px); transition: opacity 0.6s 0.5s, transform 0.6s 0.5s; }
.veil.on span { opacity: 1; transform: none; }
.toast {
  /* above every sheet and page (the wallet sheet sits at 60): an error must never hide behind what caused it */
  position: fixed; z-index: 90; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100vw - 32px); text-align: center;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--paper-solid); font-size: 13px;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

#loader {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 40%, #f6e8d4, #e7cfb0);
  transition: opacity 0.9s ease 0.2s, visibility 0s linear 1.1s;
}
#loader.done { opacity: 0; visibility: hidden; }
/* while the loader is up (main.js sets body.booting once the wallet is wired, and drops it after the fade), the top bar
   sits above it with only Connect shown: the rest of the bar is not wired yet */
body.booting .topbar { z-index: 11; }
/* W11 (VW8 S-6): the bell's and Live ledger's panels are inside the top bar's own stacking context (5), so under the island card (6) and a page (6): while one is open the bar is above both
   (7). The sidebar (8) and the places drawer (45) stay above it. A bar that only has closed panels is as it was. */
.topbar:has(.bell-panel:not([hidden])) { z-index: 7; }
/* FX7 (the coordinator's browser pass, 1440 x 900): the island ticker (20, chain.css) drew its chips over the top of the 520 px Live ledger drawer (its filter and search). While a bell or
   ledger panel is open the ticker goes under the bar (6), so the drawer covers the chips it overlaps and the rest stay in view. The ticker takes no pointer events either way. */
body:has(.topbar .bell-panel:not([hidden])) .ticker { z-index: 6; }
body.booting .topbar > :not(.connect) { visibility: hidden; }
.loader-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.loader-title { font: 800 46px/1 var(--display); letter-spacing: -0.03em; }
.loader-card .status { font: 500 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.bar { width: 160px; height: 4px; border-radius: 4px; background: rgba(42, 32, 24, 0.1); overflow: hidden; }
.bar i { display: block; width: 40%; height: 100%; background: var(--ink); border-radius: 4px; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

@media (max-width: 1240px) and (min-width: 901px) {
  .tab { padding: 7px 8px; font-size: 13px; gap: 6px; }
  .brand { padding-right: 11px; }
}
@media (max-width: 900px) {
  /* FX P-8: every control of the top bar is at least 44 px to tap on a phone (Menu was 40, the wallet chip 37, the sound button and the bell 40) */
  .menu-btn, .connect { min-height: 44px; }
  .sound, .bell { width: 44px; height: 44px; }
  .ledger-pill { min-height: 44px; } /* W10: it was 40 */
  .topbar { flex-wrap: wrap; }
  .tabs { order: 3; flex-basis: 100%; margin-inline: 0; }
  /* FX2 P-9: each place tab is 44 px tall to tap (the row was 34). The tab is the tap area; its pill is drawn by ::before, 10 px in from the top and
     the bottom, so the pill and the label are the size they were, and only the bar behind them is taller. */
  .tabs { padding-block: 0; }
  .tab { position: relative; isolation: isolate; min-height: 44px; }
  .tab::before { content: ""; position: absolute; inset: 10px 0; z-index: -1; border-radius: 10px; background: transparent; transition: background 0.2s; }
  .tab:hover, .tab.hot, .tab[aria-current="true"] { background: transparent; }
  .tab:hover::before, .tab.hot::before { background: rgba(42, 32, 24, 0.07); }
  .tab[aria-current="true"]::before { background: var(--ink); }
  .sound { margin-left: auto; }
  .panel { top: auto; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); width: auto; height: min(66vh, 600px); transform: translateY(calc(100% + 40px)); }
  .panel h2 { font-size: 28px; }
  .hint { display: none; }
}
@media (max-width: 600px) {
  .pin { font-size: 11px; padding: 4px 8px 4px 7px; gap: 5px; }
  .pin .dot { width: 6px; height: 6px; }
  .brand { font-size: 18px; }
  .connect { padding: 9px 12px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .panel, .panel.open, .pin, #loader, .enter { transition-duration: 0.01s; }
  .bar i, .enter::before { animation: none; }
  /* FX7 (VW11 N-3 on FX6): the Enter button does not lift on hover. It keeps its own centring, translateX(-50%), so it is not in apply.css's transform: none list */
  .enter:hover { transform: translateX(-50%); }
  .enter:hover svg { transform: none; }
}

/* panel call to action that leads somewhere (the Apply islet) */
.actions a.primary, .actions .primary.cta {
  flex: 1 1 140px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 14px; border-radius: 12px; text-decoration: none;
  background: var(--c); color: #fff; font-weight: 600; font-size: 14px; opacity: 1; cursor: pointer; transition: filter 0.2s, transform 0.2s;
}
@media (hover: hover) { .actions a.primary:hover, .actions .primary.cta:hover { filter: brightness(1.08); transform: translateY(-1px); } }
/* W5 (owner decision 2): the one plain Terms link where an owner-text line would have been (src/terms.js termsLinkHtml) */
.terms-link { margin: 10px 0 0; font-size: 12px; color: var(--ink-3); }
.terms-link a { color: inherit; text-decoration: underline; }
/* W5 (LL-01): the Live ledger pill beside the bell, and its drawer (the bell panel's plate) */
.ledger-pill { flex: none; height: 40px; padding: 0 14px; border: 0; border-radius: 13px; cursor: pointer; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); font: 600 13px var(--body); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.ledger-pill[aria-expanded="true"] { background: var(--paper-solid); }
@media (hover: hover) { .ledger-pill:hover { background: var(--paper-solid); } }
.ledger-panel { width: min(400px, calc(100vw - 32px)); }
/* W17 (UX1 item 9): a wide screen gives the ledger 520 px and the window's height less 80 (30 rows were 3.77 screens in 400 px and 544 high; 520 x 100vh - 80 is about 2.4) */
@media (min-width: 901px) { .ledger-panel { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 80px); } }
@media (min-width: 901px) and (max-width: 1099px) { .ledger-panel { width: min(440px, calc(100vw - 32px)); } }
.ledger-filter select, .ledger-filter input { width: 100%; margin: 4px 0 6px; padding: 7px 8px; border-radius: 9px; border: 1px solid rgba(42, 32, 24, 0.18); background: #fff; font: 500 13px var(--body); color: var(--ink); }
/* CHECK-1116 finding 20: the Live ledger's filter and search were 35 and 33 px high; on touch they are 44 */
@media (max-width: 900px), (pointer: coarse) { .ledger-filter select, .ledger-filter input { min-height: 44px; } }
.ledger-list { list-style: none; margin: 0; padding: 0; }
.ledger-list li { display: grid; grid-template-columns: 22px 1fr; gap: 2px 8px; padding: 8px 0; border-top: 1px solid rgba(0, 0, 0, 0.08); }
.ledger-ic { grid-row: span 2; font-size: 15px; text-align: center; color: var(--ink-3); }
.ledger-list li em { font-style: normal; font-size: 12px; color: var(--ink-3); }
@media (max-width: 520px) { .ledger-pill { padding: 0 10px; font-size: 12px; } } /* FX6 (BW I5): the old `.ledger-panel { right: 8px }` is gone: the panel starts 16 px from the edge, as the bell's does */

/* ---------- W17 (UX round, UX1 items 1 and 2): the island's place card, wide on a wide screen, a bottom sheet with its buttons in reach on a phone ---------- */
/* item 1: a wide card with a mouse: the same parts in less height (barns 1.43 to 1.18 screens at 1280 x 800, nothing to scroll at 1440 x 900), the buttons in view */
@media (min-width: 901px) and (pointer: fine) {
  .panel-head { padding: 18px 24px 14px; }
  .panel h2 { font-size: 34px; }
  .panel-body { padding: 14px 24px 16px; gap: 14px; }
  .blurb { font-size: 14px; line-height: 1.55; max-width: none; }
  .live .rows div { padding: 5px 0; }
  .blurb-more { display: none; }
}
/* item 2: on a phone the bar of buttons sticks to the foot of the card (it was below the fold on 3 of 3 places measured: 0 of 3 in view; now 3 of 3), the head and the body are tighter, and the blurb shows
   three lines with a More button for the rest (the whole text stays in the page: a screen reader reads it all, and More only lifts the clamp) */
@media (max-width: 900px) {
  .panel-head { padding: 16px 20px 12px; }
  .panel-head::before { left: 20px; }
  .panel-body { padding: 12px 20px 0; gap: 12px; }
  .actions-dock { position: sticky; bottom: 0; z-index: 2; margin: 0 -20px; padding: 10px 20px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--paper-solid); box-shadow: 0 -1px 0 var(--line); }
  .blurb:not(.open) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
  .blurb-more { align-self: flex-start; min-height: 44px; margin: -12px 0 -8px; padding: 0 4px; border: 0; background: none; cursor: pointer; font: 600 13px var(--body); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
  .blurb-more[hidden] { display: none; }
}

/* ---------- W17 (UX1 item 11): a phone's page bar is one row ----------
   On a page (body[data-mode], 600 px and less) the bar was two rows: Back, menu, sound, bell and the Live ledger pill, and the wallet chip under them. Now: Back (44), the drawer button (44), the bell (44), the Live ledger as
   an icon (44, its name kept in aria-label) and the wallet chip in what is left (it takes the rest of the row and cuts its balance, never its address). The sound button is in the drawer's foot (src/sidebarUi.js
   .side-sound), the same button pressed from there. At 375 px: 4 x 44 + 4 gaps of 8 = 208 of 343, 135 px for the chip. */
.ledger-glyph { display: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (max-width: 600px) {
  body[data-mode] .topbar { flex-wrap: nowrap; gap: 8px; }
  body[data-mode] .topbar .sound { display: none; }
  body[data-mode] .topbar .bell { margin-left: auto; }
  body[data-mode] .ledger-pill { position: relative; width: 44px; padding: 0; display: grid; place-items: center; }
  body[data-mode] .ledger-pill .ledger-glyph { display: block; }
  body[data-mode] .ledger-pill .ledger-txt { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  body[data-mode] .connect { flex: 1 1 0; min-width: 0; max-width: none; padding-inline: 10px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
  body[data-mode] .connect.on { max-width: none; }
}
/* FX6 (VW11 N-8): at 320 px the four 44 px buttons and four 8 px gaps left 80 px for the chip, and an ellipsis cut the address (about 73 px). Under 360 px the bar's gaps and sides are tighter (4 and 12 px), the chip's
   padding 6 px and its type 11 px: 104 px for the chip, 92 inside it, and the address with its dot (about 89) stays whole. The balance is hidden under 560 px (wallet.css), so it never takes the address's room. */
@media (max-width: 359px) {
  body[data-mode] .topbar { gap: 4px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  body[data-mode] .connect { padding-inline: 6px; font-size: 11px; }
}
