/* Blip Foundry. Built on the site tokens (site.css). Sound is drawn in the accent-to-rose gradient, touch (haptics) in
   amber, on a timeline that stays dark in both themes. The phone is drawn in container-query units (cqw: 1% of its width). */

.bf {
  --bf-pad: 20px; --bf-thumb: #FFFFFF; --bf-rose: #E5487F;
  --bf-round: #F0592A; --bf-sharp: #FFC23D;
  --bf-tl: #15141B; --bf-tl-line: rgb(255 255 255 / 8%); --bf-tl-ink: rgb(255 255 255 / 52%);
  --ph-bg: #F4F2EE; --ph-tile: #FFFFFF; --ph-ink: #1B1A20; --ph-muted: #7A7582; --ph-line: #E6E2DA;
  --ui: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: 96px;
}
@media (prefers-color-scheme: dark) {
  .bf { --bf-thumb: #2E2C38; --bf-rose: #FF6F9A; --bf-tl: #0D0C11;
    --ph-bg: #101014; --ph-tile: #1C1B22; --ph-ink: #F2F0F7; --ph-muted: #8E8A99; --ph-line: #2A2831; }
}
.bf [hidden] { display: none !important; }
.bf-head { padding-bottom: clamp(22px, 3vw, 30px); }
.bf-head > p { margin-bottom: 0; }
.bf-head-chips { margin-top: 18px; }
.bf-noscript { padding: 16px 20px; border-radius: var(--r-m); background: var(--raised); }

/* ------------------------------------------------------------ cards and small controls */

.bf-workspace { display: grid; gap: 20px; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); align-items: start; }
.bf-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: var(--bf-pad); }
.bf-card-title { font-size: 1.05rem; letter-spacing: -0.01em; margin: 0; }
.bf-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 18px; }
.bf-bar-tools { display: flex; gap: 14px; flex-wrap: wrap; }
.bf-sub { margin: 4px 0 0; font-size: .92rem; line-height: 1.45; color: var(--muted); }
.bf-label { display: block; font: 650 .7rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.bf-fine { margin: 0; font-size: .8rem; line-height: 1.45; color: var(--faint); }
.bf-btn-sm { min-height: 38px; padding: 8px 15px; font-size: .88rem; }
.bf-btn-sm svg { width: 17px; height: 17px; }
.bf .btn:disabled { opacity: .7; cursor: progress; transform: none; }

.bf-mini { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 650 .8rem/1 var(--sans); white-space: nowrap; cursor: pointer;
  transition: background .15s, transform .15s var(--ease-out), opacity .15s; }
.bf-mini:hover { background: var(--raised); }
.bf-mini:active { transform: scale(.96); }
.bf-mini:disabled { opacity: .45; cursor: default; transform: none; }
.bf-mini svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }

.bf-switch { position: relative; display: inline-flex; align-items: center; gap: 9px; min-height: 36px; font: 650 .86rem/1 var(--sans); color: var(--ink); cursor: pointer; }
.bf-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bf-switch-ui { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line); transition: background .2s; }
.bf-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 25%); transition: transform .3s var(--spring); }
.bf-switch input:checked + .bf-switch-ui { background: var(--accent); }
.bf-switch input:checked + .bf-switch-ui::after { transform: translateX(16px); }
.bf-switch input:focus-visible + .bf-switch-ui { outline: 3px solid var(--accent); outline-offset: 2px; }

/* segmented radios: the input sits invisibly over its label, the span is the pill */
.bf-seg { display: inline-flex; gap: 2px; margin: 0; padding: 4px; border: 0; border-radius: 999px; background: var(--raised); max-width: 100%; }
.bf-seg label { position: relative; display: block; }
.bf-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bf-seg span { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 7px 14px; border-radius: 999px; color: var(--muted);
  font: 650 .84rem/1 var(--sans); white-space: nowrap; transition: color .15s, background .15s, box-shadow .15s; }
.bf-seg label:hover span { color: var(--ink); }
.bf-seg input:checked + span { background: var(--bf-thumb); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 10%), 0 3px 10px rgb(0 0 0 / 7%); }
.bf-seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 1px; }
.bf-waves span { padding: 7px 11px; }
.bf-waves svg { display: block; width: 30px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* sliders: label and value on one line, the range below */
.bf-ctrls { display: grid; gap: 4px; }
.bf-ctrl { display: block; min-width: 0; }
.bf-ctrl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bf-ctrl-head .bf-label { margin: 0; }
.bf-ctrl output { font: 600 .8rem/1 var(--mono); color: var(--ink); white-space: nowrap; }
.bf-ctrl.is-off { opacity: .45; }
.bf-range { --fill: 50%; display: block; width: 100%; height: 30px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.bf-range::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--fill), var(--line) var(--fill)); }
.bf-range::-moz-range-track { height: 6px; border-radius: 99px; background: var(--line); }
.bf-range::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--accent); }
.bf-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -7px; border: 0; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 10%), 0 2px 6px rgb(0 0 0 / 22%); transition: transform .2s var(--spring); }
.bf-range::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #FFFFFF; box-shadow: 0 0 0 1px rgb(0 0 0 / 10%), 0 2px 6px rgb(0 0 0 / 22%); }
.bf-range:active::-webkit-slider-thumb { transform: scale(1.18); }
.bf-range:focus-visible { outline: none; }
.bf-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent); }
.bf-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent); }
.bf-touchy .bf-range::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--bf-round) var(--fill), var(--line) var(--fill)); }
.bf-touchy .bf-range::-moz-range-progress { background: var(--bf-round); }

.bf-select { width: 100%; min-height: 38px; padding: 7px 34px 7px 12px; border-radius: 12px; border: 1px solid var(--line); color: var(--ink); font: 600 .9rem/1.2 var(--sans);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238C8894' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  -webkit-appearance: none; appearance: none; cursor: pointer; }
.bf-select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

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

.bf-try { position: sticky; top: 84px; }
.bf-device { position: relative; width: min(100%, 288px); margin: 0 auto; }
.bf-phone { container-type: inline-size; padding: 8px; border-radius: 46px; background: #0B0B0E;
  box-shadow: 0 0 0 1px #4A4853, inset 0 0 0 1px #26252C, 0 30px 50px -24px rgb(22 21 27 / 60%); }
.bf-screen { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 393 / 790; border-radius: 39px; background: var(--ph-bg); color: var(--ph-ink);
  font-family: var(--ui); display: flex; flex-direction: column; padding: 0 5cqw 4cqw; -webkit-user-select: none; user-select: none; }
.bf-screen::after { content: ""; position: absolute; left: 50%; bottom: 2.4cqw; width: 34cqw; height: 1.6cqw; margin-left: -17cqw; border-radius: 9px; background: var(--ph-ink); opacity: .35; }
.bf-status { display: flex; align-items: center; justify-content: space-between; height: 13cqw; padding: 1cqw 3cqw 0 5cqw; font: 650 4.3cqw/1 var(--ui); }
.bf-sys { display: flex; gap: 1.4cqw; align-items: center; }
.bf-sys i { display: block; width: 4.4cqw; height: 3cqw; border-radius: 1cqw; background: currentColor; opacity: .85; }
.bf-sys i:last-child { width: 7cqw; border-radius: 1.2cqw; }
.bf-app-head { display: flex; align-items: center; justify-content: space-between; gap: 3cqw; margin: 2cqw 0 4cqw; }
.bf-app-head p { margin: 0; }
.bf-app-kicker { font: 650 3.6cqw/1.2 var(--ui); color: var(--ph-muted); text-transform: uppercase; letter-spacing: .08em; }
.bf-app-title { font: 750 7.6cqw/1.1 var(--ui); letter-spacing: -0.02em; }
.bf-coins { display: inline-flex; align-items: center; gap: 1.8cqw; padding: 1.8cqw 3.2cqw 1.8cqw 2cqw; border-radius: 99px; background: var(--ph-tile);
  box-shadow: 0 0 0 1px var(--ph-line); font: 700 4.2cqw/1 var(--ui); }
.bf-coins output { font-variant-numeric: tabular-nums; }
.bf-coin-ico { width: 5.4cqw; height: 5.4cqw; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFE59A, #F5B014 60%, #D98A06); box-shadow: inset 0 0 0 .6cqw #E09A0B; }
.bf-level { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 3cqw; margin-bottom: 5cqw; font: 650 3.8cqw/1 var(--ui); color: var(--ph-muted); }
.bf-level-bar { height: 2.6cqw; border-radius: 99px; background: var(--ph-line); overflow: hidden; }
.bf-level-bar i { display: block; width: 60%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--bf-rose)); }

.bf-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3cqw; }
.bf-tile { position: relative; display: grid; justify-items: center; align-content: center; gap: 3.4cqw; aspect-ratio: 1 / 1.2; padding: 2cqw 1cqw;
  border: 0; border-radius: 6cqw; background: var(--ph-tile); color: var(--ph-ink); box-shadow: 0 0 0 1px var(--ph-line), 0 1px 2px rgb(0 0 0 / 5%);
  font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: box-shadow .2s; }
.bf-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6cqw; }
.bf-tile.is-current { box-shadow: 0 0 0 2px var(--accent), 0 6px 18px -8px color-mix(in srgb, var(--accent) 60%, transparent); }
.bf-tl { font: 650 3.6cqw/1.1 var(--ui); color: var(--ph-muted); white-space: nowrap; }
.bf-tile.is-current .bf-tl { color: var(--ph-ink); }
.bf-tv { position: relative; display: grid; place-items: center; width: 12.5cqw; height: 12.5cqw; }
.bf-tv svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }

.bf-tv-tap i { width: 8cqw; height: 8cqw; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2.2cqw color-mix(in srgb, var(--accent) 18%, transparent); }
.bf-tv-tick { display: flex; gap: 0; width: auto; }
.bf-tv-tick svg { width: 5cqw; height: 7cqw; color: var(--ph-muted); stroke-width: 2.6; }
.bf-tv-tick b { min-width: 6cqw; text-align: center; font: 750 7cqw/1 var(--ui); font-variant-numeric: tabular-nums; }
.bf-tv-toggle { width: 13cqw; height: 7.6cqw; border-radius: 99px; background: var(--ph-line); transition: background .25s; display: block; }
.bf-tv-toggle i { position: absolute; top: .9cqw; left: .9cqw; width: 5.8cqw; height: 5.8cqw; border-radius: 50%; background: #fff; box-shadow: 0 .4cqw 1cqw rgb(0 0 0 / 25%);
  transition: transform .32s var(--spring); }
.bf-tile[aria-pressed="true"] .bf-tv-toggle { background: var(--leaf); }
.bf-tile[aria-pressed="true"] .bf-tv-toggle i { transform: translateX(5.4cqw); }
.bf-tv-like svg { color: var(--bf-rose); width: 10.5cqw; }
.bf-tv-like.is-on svg { fill: var(--bf-rose); }
.bf-tv-send svg { color: var(--sky); width: 10.5cqw; }
.bf-tv-saved svg { color: var(--leaf); width: 11cqw; }
.bf-tv-saved path { stroke-dasharray: 1; stroke-dashoffset: 0; stroke-width: 2.4; }
.bf-tv-coin i { width: 10cqw; height: 10cqw; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFE59A, #F5B014 60%, #D98A06);
  box-shadow: inset 0 0 0 1.1cqw #E09A0B, inset 0 0 0 2.2cqw #FFD45E; }
.bf-tv-level svg { color: var(--grape); width: 11cqw; fill: color-mix(in srgb, var(--grape) 22%, transparent); }
.bf-tv-pin { display: flex; gap: 1.6cqw; width: auto; }
.bf-tv-pin i { width: 2.6cqw; height: 2.6cqw; border-radius: 50%; background: var(--ph-ink); }
.bf-tv-pin.is-wrong i { background: var(--coral); }

.bf-float { position: absolute; left: 50%; top: 10%; z-index: 2; font: 800 4.4cqw/1 var(--ui); color: #D98A06; pointer-events: none; white-space: nowrap; }
.bf-screen-hint { margin: auto 0 4cqw; padding-top: 4cqw; text-align: center; font: 600 3.6cqw/1.3 var(--ui); color: var(--ph-muted); }
.bf-toast { position: absolute; left: 6cqw; right: 6cqw; bottom: 9cqw; z-index: 3; display: flex; align-items: center; gap: 2.6cqw; padding: 3.2cqw 4cqw;
  border-radius: 4.4cqw; background: var(--ph-ink); color: var(--ph-bg); font: 650 3.9cqw/1.2 var(--ui); box-shadow: 0 3cqw 8cqw rgb(0 0 0 / 25%);
  pointer-events: none; opacity: 0; }
.bf-toast b { display: grid; place-items: center; flex: none; width: 5.6cqw; height: 5.6cqw; border-radius: 50%; background: var(--tc, var(--leaf)); color: #fff; font-size: 3.4cqw; }

/* haptics you can't feel: little arcs beside the phone flash with each event */
.bf-buzz { position: absolute; top: 44%; width: 22px; height: 70px; pointer-events: none; }
.bf-buzz-l { left: -28px; } .bf-buzz-r { right: -28px; transform: scaleX(-1); }
.bf-buzz i { position: absolute; top: 50%; left: 0; width: 100%; height: 100%; margin-top: -35px; border: 3px solid transparent; border-left-color: var(--bf-round);
  border-radius: 50%; opacity: 0; }
.bf-buzz i + i { left: 8px; width: 70%; height: 64%; margin-top: -22px; border-left-color: var(--bf-sharp); }

.bf-support { margin-top: 14px; text-align: center; text-wrap: balance; }

/* ------------------------------------------------------------ the editor */

.bf-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.bf-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 13px 6px 9px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--muted); font: 650 .84rem/1 var(--sans); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.bf-chip:hover { color: var(--ink); background: var(--raised); }
.bf-chip[aria-checked="true"] { color: var(--ink); border-color: var(--ink); background: var(--raised); }
.bf-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.bf-chip.is-edited::after { content: ""; width: 5px; height: 5px; margin-left: -2px; border-radius: 50%; background: var(--accent); }

.bf-now { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 16px; }
.bf-play { display: grid; place-items: center; width: 56px; height: 56px; border: 0; border-radius: 50%; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--bf-rose)); box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--accent) 80%, transparent);
  transition: transform .2s var(--spring); }
.bf-play:hover { transform: scale(1.05); }
.bf-play:active { transform: scale(.94); }
.bf-play svg { width: 24px; height: 24px; fill: currentColor; margin-left: 3px; }
.bf-name { font-size: 1.5rem; margin: 0; }
.bf-now-copy .bf-sub { margin-top: 2px; }
.bf-now-tools { display: flex; gap: 6px; }

.bf-timeline { position: relative; overflow: hidden; border-radius: var(--r-m); background: var(--bf-tl); color: var(--bf-tl-ink);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 6%); --grid: 10%; }
.bf-lane { position: relative; background-image: linear-gradient(90deg, var(--bf-tl-line) 1px, transparent 1px); background-size: var(--grid) 100%; background-position: 0 0; }
.bf-lane-sound { height: 168px; }
.bf-lane-touch { height: 82px; border-top: 1px solid rgb(255 255 255 / 9%); cursor: copy; }
.bf-lane-label { position: absolute; top: 9px; left: 12px; z-index: 2; font: 700 .64rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; pointer-events: none; }
.bf-lane canvas { display: block; width: 100%; height: 100%; }
.bf-marks { position: absolute; inset: 0 12px; }
.bf-mark { position: absolute; bottom: 12px; left: calc(var(--t) * 100%); width: 12px; height: calc(12px + var(--i) * 44px); margin-left: -6px; padding: 0; border: 0;
  border-radius: 99px; cursor: grab; touch-action: none;
  background: color-mix(in oklab, var(--bf-round), var(--bf-sharp) calc(var(--s) * 100%));
  box-shadow: 0 0 calc(4px + var(--i) * 14px) color-mix(in oklab, var(--bf-round), var(--bf-sharp) calc(var(--s) * 100%)); transition: filter .15s, transform .15s; }
.bf-mark.is-buzz { width: max(14px, calc(var(--d) * 100%)); margin-left: 0; border-radius: 8px;
  background: repeating-linear-gradient(90deg, rgb(255 255 255 / 0) 0 4px, rgb(255 255 255 / 30%) 4px 6px),
    color-mix(in oklab, var(--bf-round), var(--bf-sharp) calc(var(--s) * 100%)); }
.bf-mark:hover { filter: brightness(1.15); }
.bf-mark:active { cursor: grabbing; }
.bf-mark.is-sel { outline: 2px solid #fff; outline-offset: 3px; }
.bf-mark:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 99px; }
.bf-mark.is-buzz:focus-visible { border-radius: 8px; }
.bf-mark.is-firing { filter: brightness(1.5); transform: scaleY(1.12); }
.bf-axis { position: relative; height: 24px; margin: 0 12px; border-top: 1px solid rgb(255 255 255 / 9%); font: 500 .68rem/1 var(--mono); }
.bf-axis span { position: absolute; top: 7px; transform: translateX(-50%); white-space: nowrap; }
.bf-axis span:first-child { transform: none; }
.bf-playhead { position: absolute; top: 0; bottom: 24px; left: 12px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 12px rgb(255 255 255 / 70%);
  opacity: 0; pointer-events: none; }
.bf-stats { margin: 10px 2px 0; font: 500 .78rem/1.5 var(--mono); color: var(--faint); }

.bf-hap { margin-top: 16px; padding: 14px 16px 12px; border-radius: var(--r-m); background: var(--raised); }
.bf-hap-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.bf-hap-title { margin: 0; }
.bf-hap-title b { color: var(--ink); font-weight: 650; letter-spacing: .04em; }
.bf-hap-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.bf-hap-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 20px; align-items: start; }
.bf-hap-body .bf-seg { background: var(--surface); }
.bf-hap-body .bf-ctrls { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px 18px; }
.bf-hap-empty { padding: 4px 0 8px; }
.bf-hap-hint { margin-top: 6px; }

.bf-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; margin-top: 16px; }
.bf-group { min-width: 0; margin: 0; padding: 12px 16px 10px; border: 1px solid var(--line); border-radius: var(--r-m); }
.bf-group legend { padding: 0 6px; margin-left: -6px; font: 750 .92rem/1 var(--sans); color: var(--ink); }
.bf-row { display: block; margin: 4px 0 10px; }
.bf-row .bf-seg { display: flex; }
.bf-row .bf-seg label { flex: 1; }
.bf-row .bf-seg span { width: 100%; }

/* ------------------------------------------------------------ export */

.bf-export { margin-top: 20px; }
.bf-export-head { margin: 0 4px 14px; }
.bf-export-head .muted { font-weight: 600; }
.bf-code { overflow: hidden; border-radius: var(--r-l); border: 1px solid var(--code-line); background: var(--code-bg); color: var(--code-ink); box-shadow: var(--shadow-1); }
.bf-code-head { border-bottom: 1px solid var(--code-line); }
.bf-tabs { display: flex; gap: 2px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.bf-tabs::-webkit-scrollbar { display: none; }
.bf-tabs button { position: relative; flex: none; padding: 18px 13px 17px; border: 0; background: none; color: rgb(232 230 239 / 62%);
  font: 650 .86rem/1 var(--sans); cursor: pointer; transition: color .15s; }
.bf-tabs button:hover { color: var(--code-ink); }
.bf-tabs button[aria-selected="true"] { color: #FFFFFF; }
.bf-tabs button::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 0; height: 2px; border-radius: 2px; background: #FFB27A;
  transform: scaleX(0); transition: transform .3s var(--ease-out); }
.bf-tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.bf-tabs button:focus-visible { outline-color: #FFB27A; outline-offset: -5px; }
.bf-panel:focus-visible { outline: 2px solid #FFB27A; outline-offset: -4px; border-radius: 0 0 var(--r-l) var(--r-l); }

.bf-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 24px; }
.bf-file-ico { display: grid; place-items: center; width: 120px; height: 72px; border-radius: 14px; background: rgb(255 255 255 / 6%); }
.bf-file-ico canvas { width: 104px; height: 48px; }
.bf-file-copy p { margin: 0; }
.bf-file-name { font: 650 1.05rem/1.3 var(--mono); color: #fff; overflow-wrap: anywhere; }
.bf-file-meta { margin-top: 4px !important; font: 500 .8rem/1.5 var(--mono); color: #8A859A; }
.bf-file-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.bf-file .btn-primary { background: #fff; color: #15141B; }
.bf-btn-ghost { background: transparent; color: var(--code-ink); border-color: rgb(255 255 255 / 18%); }
.bf-btn-ghost:hover { background: rgb(255 255 255 / 8%); }

.bf-code-tools { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 14px 16px 0 24px; }
.bf-code-meta { flex: 1 1 260px; margin: 0; font: 500 .76rem/1.45 var(--mono); color: #8A859A; }
.bf-code-btn { min-height: 32px; padding: 7px 12px; border-radius: 8px; border: 1px solid rgb(255 255 255 / 14%); background: rgb(255 255 255 / 7%); color: var(--code-ink);
  font: 600 .78rem/1 var(--sans); cursor: pointer; }
.bf-code-btn:hover { background: rgb(255 255 255 / 12%); }
.bf-code-btn:focus-visible, .bf-check input:focus-visible { outline-color: #FFB27A; }
.bf-check { display: inline-flex; align-items: center; gap: 7px; font: 600 .78rem/1 var(--sans); color: var(--code-ink); cursor: pointer; }
.bf-check input { width: 16px; height: 16px; margin: 0; accent-color: #FFB27A; }
.bf-pre { min-height: 260px; max-height: 560px; margin: 0; padding: 14px 24px 26px; overflow: auto; border: 0; border-radius: 0; background: transparent; font-size: .84rem; }
.bf-panel[data-tab="wav"] .bf-code-tools, .bf-panel[data-tab="wav"] .bf-pre { display: none; }
.bf-panel:not([data-tab="wav"]) .bf-file { display: none; }
.bf-panel[data-tab="wav"] { padding-bottom: 4px; }

/* ------------------------------------------------------------ field notes */

.bf-guide { margin-top: clamp(64px, 9vw, 104px); }
.bf-guide-head { margin-bottom: 26px; }
.bf-guide-head h2 { margin: 0; }
.bf-tips { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.bf-tip { display: flex; flex-direction: column; padding: 24px; border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--line); }
.bf-tip h3 { margin: 16px 0 8px; font-size: 1.12rem; }
.bf-tip p { margin: 0; font-size: .97rem; color: var(--muted); }
.bf-tip code { padding: .1em .38em; border-radius: 5px; background: var(--raised); font-size: .84em; color: var(--ink); overflow-wrap: anywhere; }
.bf-tip .bf-src { margin-top: auto; padding-top: 14px; font-size: .8rem; color: var(--faint); }
.bf-src a { color: var(--muted); }
.bf-src a:hover { color: var(--accent-ink); }
.bf-tip-ico { display: block; width: 48px; height: 48px; padding: 7px; border-radius: 14px; background: var(--raised); }
.bf-tip-ico path, .bf-tip-ico circle, .bf-tip-ico rect { fill: none; stroke: var(--bf-round); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.bf-tip-ico .bf-tip-axis { stroke: var(--faint); stroke-width: 2.4; }
.bf-built { margin-top: 22px; max-width: 760px; }

/* ------------------------------------------------------------ narrow screens */

@media (max-width: 1020px) {
  .bf-workspace { grid-template-columns: minmax(0, 1fr); }
  .bf-try { position: static; }
}
@media (max-width: 640px) {
  .bf { --bf-pad: 16px; }
  .bf-now { grid-template-columns: auto minmax(0, 1fr); }
  .bf-now-tools { grid-column: 1 / -1; }
  .bf-lane-sound { height: 132px; }
  .bf-hap-body { grid-template-columns: minmax(0, 1fr); }
  .bf-hap-body .bf-seg { justify-self: start; }
  .bf-file { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .bf-file-tools { grid-column: 1 / -1; justify-content: flex-start; }
  .bf-file-ico { width: 84px; height: 56px; }
  .bf-file-ico canvas { width: 72px; height: 34px; }
  .bf-code-tools { padding-left: 16px; }
  .bf-pre { padding-inline: 16px; font-size: .78rem; }
  .bf-tip { padding: 20px; }
}
@media (max-width: 400px) {
  .bf-buzz { display: none; }
  .bf-tabs button { padding-inline: 10px; }
}
