/* OWMap BSL1 — Brew Module Stylesheet
   Art direction: Extreme minimalism, copper/gold/platinum palette.
   Gamified micro-interactions, lunar-arc credit meter, reveal animation.
   All class names mirror brew-panel.jsx + brew-flow.jsx exactly.
   ─────────────────────────────────────────────────────────────────────── */

/* ── Design tokens ────────────────────────────────────────────────────────── */
:root {
  --brew-copper:       #c8973a;
  --brew-gold:         #f5c842;
  --brew-platinum:     rgba(244, 241, 232, 0.90);
  --brew-plat-dim:     rgba(244, 241, 232, 0.55);
  --brew-plat-ghost:   rgba(244, 241, 232, 0.22);
  --brew-bg:           #0a0d0b;
  --brew-surface:      #111610;
  --brew-surface2:     #171e13;
  --brew-border:       rgba(200, 151, 58, 0.18);
  --brew-border-hi:    rgba(200, 151, 58, 0.38);
  --brew-glow:         rgba(200, 151, 58, 0.12);
  --brew-glow-hi:      rgba(200, 151, 58, 0.22);
  --brew-gold-glow:    rgba(245, 200, 66, 0.20);
  --brew-danger:       #b85450;
  --brew-success:      #4ea87e;
  --brew-warn:         #c8973a;
  --brew-radius:       12px;
  --brew-radius-sm:    7px;
  --brew-radius-xs:    4px;
  --brew-font:         'Inter', 'Noto Sans SC', system-ui, sans-serif;
  --brew-mono:         'JetBrains Mono', 'Fira Code', monospace;
  --brew-transition:   220ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Keyframes ────────────────────────────────────────────────────────────── */
@keyframes brew-spin {
  to { transform: rotate(360deg); }
}
@keyframes brew-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}
@keyframes brew-slide-up {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes brew-reveal-open {
  0%   { opacity: 0; transform: scale(0.94) translateY(16px); }
  60%  { opacity: 1; transform: scale(1.01) translateY(-3px); }
  100% { opacity: 1; transform: scale(1)    translateY(0);    }
}
@keyframes brew-pulse-ring {
  0%   { transform: scale(1);   opacity: 0.8; }
  100% { transform: scale(2.6); opacity: 0;   }
}
@keyframes brew-ambient-fade {
  0%   { opacity: 0; transform: translateY(4px); }
  15%  { opacity: 1; transform: translateY(0);   }
  85%  { opacity: 1; transform: translateY(0);   }
  100% { opacity: 0; transform: translateY(-4px);}
}
@keyframes brew-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes brew-toast-in {
  from { opacity: 0; transform: translateX(100%) scale(0.92); }
  to   { opacity: 1; transform: translateX(0)     scale(1);   }
}
@keyframes brew-arc-fill {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}
@keyframes brew-dot-blink {
  0%, 80%, 100% { opacity: 0.25; }
  40%           { opacity: 1;    }
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.brew-spinner {
  display:       inline-block;
  width:         13px;
  height:        13px;
  border:        1.8px solid rgba(200, 151, 58, 0.30);
  border-top-color: var(--brew-copper);
  border-radius: 50%;
  animation:     brew-spin 0.75s linear infinite;
  vertical-align: middle;
  flex-shrink:   0;
}

/* ══════════════════════════════════════════════════════════════════════════
   BREW PANEL (main hub)
══════════════════════════════════════════════════════════════════════════ */

/* Outer overlay wrapper (rendered by BrewFlow for 'panel' step) */
.brew-flow-overlay > .brew-panel {
  position: relative;
  z-index: 1;
}

.brew-panel {
  position:   fixed;
  inset:      0;
  z-index:    900;
  display:    flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 12, 10, 0.74);
  backdrop-filter: blur(4px);
  animation: brew-fade-in 220ms ease both;
}

.brew-panel__inner {
  position:      relative;
  width:         100%;
  max-width:     440px;
  max-height:    90dvh;
  overflow-y:    auto;
  background:    var(--brew-surface);
  border:        1px solid var(--brew-border);
  border-bottom: none;
  border-radius: var(--brew-radius) var(--brew-radius) 0 0;
  padding:       0 0 env(safe-area-inset-bottom, 0);
  animation:     brew-slide-up 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
  scrollbar-width: thin;
  scrollbar-color: var(--brew-border) transparent;
}

/* Header */
.brew-panel__header {
  position: sticky;
  top:      0;
  z-index:  2;
  padding:  18px 20px 14px;
  background: var(--brew-surface);
  border-bottom: 1px solid var(--brew-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brew-panel__title-row {
  display:     flex;
  align-items: center;
  gap:         8px;
}

.brew-panel__title {
  font-family:    var(--brew-mono);
  font-size:      15px;
  font-weight:    600;
  letter-spacing: 0.12em;
  color:          var(--brew-copper);
  text-transform: uppercase;
}

.brew-panel__sub {
  font-size:  11px;
  color:      var(--brew-plat-dim);
  margin:     0;
  letter-spacing: 0.04em;
}

.brew-panel__close {
  position:   absolute;
  top:        16px;
  right:      18px;
  background: none;
  border:     none;
  cursor:     pointer;
  color:      var(--brew-plat-ghost);
  padding:    4px;
  border-radius: var(--brew-radius-xs);
  transition: color var(--brew-transition), background var(--brew-transition);
  line-height: 1;
}
.brew-panel__close:hover { color: var(--brew-platinum); background: var(--brew-glow); }

/* Footer */
.brew-panel__foot {
  padding:     12px 20px 16px;
  border-top:  1px solid var(--brew-border);
  font-size:   10px;
  color:       var(--brew-plat-ghost);
  text-align:  center;
  letter-spacing: 0.04em;
}

/* ── Credits arc block ────────────────────────────────────────────────── */
.brew-credits-block {
  padding: 20px 20px 12px;
}

.brew-credits-head {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   10px;
  font-size:       10px;
  text-transform:  uppercase;
  letter-spacing:  0.1em;
  color:           var(--brew-plat-ghost);
}

.brew-credits-info {
  display:        flex;
  flex-direction: column;
  align-items:    center;
}

.brew-credits-loading,
.brew-credits-err {
  display:     flex;
  align-items: center;
  gap:         6px;
  font-size:   12px;
  color:       var(--brew-plat-dim);
  padding:     18px 0;
  justify-content: center;
}

/* Skeleton arc placeholder — shown while credit data loads */
.brew-sk-arc {
  width:         160px;
  height:        90px;
  border-radius: var(--brew-radius-sm);
  background:    linear-gradient(90deg, var(--brew-surface2) 25%, rgba(200,151,58,0.06) 50%, var(--brew-surface2) 75%);
  background-size: 200% 100%;
  animation:    brew-shimmer 1.4s infinite;
}

.brew-credits-err { color: var(--brew-danger); }

.brew-low-credits-hint {
  font-size:  11px;
  color:      var(--brew-warn);
  text-align: center;
  padding:    4px 0 2px;
  opacity:    0.85;
}

.brew-get-more {
  background:    none;
  border:        none;
  color:         var(--brew-copper);
  font-size:     11px;
  cursor:        pointer;
  text-decoration: underline;
  padding:       0;
  transition:    color var(--brew-transition);
}
.brew-get-more:hover { color: var(--brew-gold); }

.brew-unlimited-badge {
  font-size:      11px;
  letter-spacing: 0.08em;
  color:          var(--brew-gold);
  font-family:    var(--brew-mono);
  padding:        3px 10px;
  border:         1px solid rgba(245, 200, 66, 0.28);
  border-radius:  20px;
  background:     var(--brew-gold-glow);
  text-transform: uppercase;
}

/* ── Credits arc SVG ──────────────────────────────────────────────────── */
.brew-credits-arc {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            4px;
}

.arc-svg { overflow: visible; }

.arc-fill {
  transition: stroke-dasharray 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.arc-balance {
  font-family:    var(--brew-mono);
  font-size:      22px;
  font-weight:    700;
  letter-spacing: -0.01em;
}

.arc-total {
  font-family:    var(--brew-mono);
  font-size:      10px;
  letter-spacing: 0.04em;
}

.arc-refresh {
  font-size:  10px;
  color:      var(--brew-plat-ghost);
  text-align: center;
  letter-spacing: 0.03em;
}

/* ── Mode cards ───────────────────────────────────────────────────────── */
.brew-modes {
  display:   flex;
  gap:       10px;
  padding:   0 20px 16px;
}

.brew-mode-card {
  flex:           1;
  background:     var(--brew-surface2);
  border:         1px solid var(--brew-border);
  border-radius:  var(--brew-radius);
  padding:        16px 14px 14px;
  display:        flex;
  flex-direction: column;
  gap:            10px;
  transition:     border-color var(--brew-transition), box-shadow var(--brew-transition);
  position:       relative;
  overflow:       hidden;
}
.brew-mode-card::before {
  content:  '';
  position: absolute;
  inset:    0;
  border-radius: var(--brew-radius);
  background: radial-gradient(ellipse at 50% 0%, var(--brew-glow) 0%, transparent 65%);
  pointer-events: none;
}
.brew-mode-card:hover {
  border-color: var(--brew-border-hi);
  box-shadow:   0 0 18px var(--brew-glow);
}

/* Brew A — no extra overrides needed; card base style handles it.
   Kept as a hook for future mode-specific accent colours. */
.brew-mode-a {}

.brew-mode-locked {
  opacity: 0.52;
  filter:  saturate(0.3);
}
.brew-mode-locked .bmc-btn {
  cursor: default;
}

.bmc-icon { line-height: 1; }

.bmc-labels { flex: 1; }

.bmc-name {
  font-size:      13px;
  font-weight:    600;
  color:          var(--brew-platinum);
  letter-spacing: 0.02em;
}

.bmc-eng {
  font-family:    var(--brew-mono);
  font-size:      10px;
  color:          var(--brew-copper);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top:     2px;
}

.bmc-desc {
  font-size:   11px;
  color:       var(--brew-plat-dim);
  line-height: 1.5;
  margin-top:  4px;
}

.bmc-btn {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             5px;
  background:      var(--brew-copper);
  color:           #08100c;
  border:          none;
  border-radius:   var(--brew-radius-sm);
  font-size:       12px;
  font-weight:     600;
  padding:         7px 0;
  cursor:          pointer;
  letter-spacing:  0.04em;
  transition:      background var(--brew-transition), transform var(--brew-transition), box-shadow var(--brew-transition);
  width:           100%;
}
.bmc-btn:hover:not(:disabled):not(.bmc-btn--disabled) {
  background:  var(--brew-gold);
  box-shadow:  0 0 12px var(--brew-gold-glow);
  transform:   translateY(-1px);
}
.bmc-btn:active:not(:disabled) { transform: translateY(0); }

.bmc-btn--disabled {
  background: rgba(200, 151, 58, 0.28);
  color:      rgba(8, 16, 12, 0.55);
}

.bmc-btn--upgrade {
  background: transparent;
  color:      var(--brew-copper);
  border:     1px solid var(--brew-border);
  font-size:  11px;
  padding:    6px 0;
}

.bmc-cost {
  font-family:    var(--brew-mono);
  font-size:      10px;
  opacity:        0.7;
  letter-spacing: 0.06em;
}

/* ── History strip ────────────────────────────────────────────────────── */
.brew-history-block {
  padding: 0 20px 20px;
}

.brew-history-head {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   10px;
  font-size:       10px;
  text-transform:  uppercase;
  letter-spacing:  0.1em;
  color:           var(--brew-plat-ghost);
}

.brew-history-all {
  background:  none;
  border:      none;
  color:       var(--brew-copper);
  font-size:   10px;
  cursor:      pointer;
  letter-spacing: 0.06em;
  padding:     0;
  transition:  color var(--brew-transition);
}
.brew-history-all:hover { color: var(--brew-gold); }

.brew-hist-scroll {
  display:   flex;
  gap:       8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.brew-hist-scroll::-webkit-scrollbar { display: none; }

.brew-hist-loading {
  display:    flex;
  gap:        8px;
}

.brew-hist-sk {
  width:        120px;
  height:       80px;
  flex-shrink:  0;
  background:   linear-gradient(90deg, var(--brew-surface2) 25%, rgba(200,151,58,0.06) 50%, var(--brew-surface2) 75%);
  background-size: 200% 100%;
  animation:    brew-shimmer 1.4s infinite;
  border-radius: var(--brew-radius-sm);
}

.brew-hist-empty {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            4px;
  padding:        24px 0;
  text-align:     center;
  width:          100%;
}

.bhe-icon {
  font-size:  24px;
  opacity:    0.35;
  line-height: 1;
}

.bhe-text {
  font-size: 12px;
  color:     var(--brew-plat-dim);
}

.bhe-sub {
  font-size: 10px;
  color:     var(--brew-plat-ghost);
}

/* ── History card ─────────────────────────────────────────────────────── */
.brew-hist-card {
  flex-shrink:    0;
  width:          130px;
  background:     var(--brew-surface2);
  border:         1px solid var(--brew-border);
  border-radius:  var(--brew-radius-sm);
  padding:        10px 10px 8px;
  display:        flex;
  flex-direction: column;
  gap:            5px;
  transition:     border-color var(--brew-transition);
  cursor:         default;
}
.brew-hist-card:hover { border-color: var(--brew-border-hi); }

.bhc-top {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             4px;
}

.bhc-status {
  font-size:      9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family:    var(--brew-mono);
  padding:        2px 5px;
  border-radius:  var(--brew-radius-xs);
}

.bhs-approved  { color: var(--brew-success); background: rgba(78, 168, 126, 0.12); }
.bhs-rejected  { color: var(--brew-danger);  background: rgba(184, 84, 80, 0.12);  }
.bhs-failed    { color: var(--brew-danger);  background: rgba(184, 84, 80, 0.12);  }
.bhs-review    { color: var(--brew-warn);    background: rgba(200, 151, 58, 0.12); }
.bhs-pending   { color: var(--brew-plat-dim); background: var(--brew-glow);        }
.bhs-refunded  { color: var(--brew-plat-ghost); background: var(--brew-glow);      }

.bhc-mode {
  font-size: 9px;
  color:     var(--brew-plat-ghost);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.bhc-place {
  font-size:    11px;
  color:        var(--brew-platinum);
  font-weight:  500;
  white-space:  nowrap;
  overflow:     hidden;
  text-overflow: ellipsis;
  line-height:  1.3;
}

.bhc-title {
  font-size:    10px;
  color:        var(--brew-plat-dim);
  white-space:  nowrap;
  overflow:     hidden;
  text-overflow: ellipsis;
  font-style:   italic;
}

.bhc-foot {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-top:      auto;
}

.bhc-cost {
  font-family:    var(--brew-mono);
  font-size:      9px;
  color:          var(--brew-plat-ghost);
  letter-spacing: 0.05em;
}

.bhc-play {
  display:         flex;
  align-items:     center;
  justify-content: center;
  width:           22px;
  height:          22px;
  background:      var(--brew-copper);
  color:           #08100c;
  border:          none;
  border-radius:   50%;
  cursor:          pointer;
  transition:      background var(--brew-transition), transform var(--brew-transition);
  flex-shrink:     0;
}
.bhc-play:hover { background: var(--brew-gold); transform: scale(1.08); }

/* ── Tier badge ───────────────────────────────────────────────────────── */
.brew-tier-badge {
  display:        inline-block;
  font-family:    var(--brew-mono);
  font-size:      9px;
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding:        2px 7px;
  border-radius:  12px;
  line-height:    1.6;
}

.tier-f  { color: var(--brew-plat-ghost); border: 1px solid rgba(200,200,200,0.15); background: rgba(200,200,200,0.05); }
.tier-i  { color: var(--brew-plat-dim);   border: 1px solid rgba(200,200,200,0.25); background: rgba(200,200,200,0.08); }
.tier-p1 { color: var(--brew-copper);     border: 1px solid rgba(200,151,58,0.35);  background: rgba(200,151,58,0.08);  }
.tier-p2 { color: var(--brew-gold);       border: 1px solid rgba(245,200,66,0.45);  background: var(--brew-gold-glow);  }
.tier-x  {
  color:      var(--brew-gold);
  border:     1px solid rgba(245,200,66,0.55);
  background: linear-gradient(90deg, rgba(200,151,58,0.15), rgba(245,200,66,0.15));
  box-shadow: 0 0 8px var(--brew-gold-glow);
}

/* ── Creator teaser ───────────────────────────────────────────────────── */
.brew-creator-teaser {
  margin:        0 20px 20px;
  padding:       14px 16px;
  background:    linear-gradient(135deg, rgba(200,151,58,0.08) 0%, rgba(245,200,66,0.05) 100%);
  border:        1px solid rgba(245,200,66,0.22);
  border-radius: var(--brew-radius);
}

.bct-label {
  font-size:      10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color:          var(--brew-gold);
  font-family:    var(--brew-mono);
  margin-bottom:  8px;
}

.bct-stats {
  display: flex;
  gap:     16px;
  margin-bottom: 8px;
}

.bct-stat {
  display:        flex;
  flex-direction: column;
  align-items:    flex-start;
  gap:            1px;
}

.bcts-n {
  font-family:    var(--brew-mono);
  font-size:      18px;
  font-weight:    700;
  color:          var(--brew-gold);
  line-height:    1;
}

.bcts-l {
  font-size:  9px;
  color:      var(--brew-plat-ghost);
  letter-spacing: 0.04em;
}

.bct-coming {
  font-size:   10px;
  color:       var(--brew-plat-ghost);
  font-style:  italic;
  line-height: 1.4;
}

/* ══════════════════════════════════════════════════════════════════════════
   BREW FLOW OVERLAY
══════════════════════════════════════════════════════════════════════════ */

.brew-flow-overlay {
  position:   fixed;
  inset:      0;
  z-index:    910;
  display:    flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 12, 10, 0.80);
  backdrop-filter: blur(6px);
  animation:  brew-fade-in 200ms ease both;
}

/* ── Shared panel base ────────────────────────────────────────────────── */
.brew-flow-panel {
  position:      relative;
  width:         100%;
  max-width:     400px;
  max-height:    90dvh;
  overflow-y:    auto;
  background:    var(--brew-surface);
  border:        1px solid var(--brew-border);
  border-radius: var(--brew-radius);
  animation:     brew-slide-up 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
  scrollbar-width: thin;
  scrollbar-color: var(--brew-border) transparent;
  margin: 0 16px;
}

/* ── Shared close button (small variant) ─────────────────────────────── */
.bfp-close {
  position:   absolute;
  top:        14px;
  right:      16px;
  background: none;
  border:     none;
  cursor:     pointer;
  color:      var(--brew-plat-ghost);
  font-size:  13px;
  padding:    4px 6px;
  border-radius: var(--brew-radius-xs);
  transition: color var(--brew-transition), background var(--brew-transition);
  line-height: 1;
  z-index:    2;
}
.bfp-close:hover { color: var(--brew-platinum); background: var(--brew-glow); }
.bfp-close--sm   { position: static; display: block; margin: 8px auto 0; font-size: 11px; color: var(--brew-plat-ghost); }

/* ─────────────────────────────────────────────────────────────────────────
   PARAM PANEL  (.bfp-params)
───────────────────────────────────────────────────────────────────────── */
.bfp-params {}

.bfp-header {
  padding:       18px 20px 14px;
  border-bottom: 1px solid var(--brew-border);
  padding-right: 44px;
}

.bfp-mode-label {
  font-size:      12px;
  font-weight:    600;
  color:          var(--brew-copper);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family:    var(--brew-mono);
}

.bfp-coord-badge {
  display:    flex;
  align-items: baseline;
  gap:         6px;
  margin-top:  6px;
}

.bfpb-name {
  font-size:   13px;
  color:       var(--brew-platinum);
  font-weight: 500;
}

.bfpb-latlon {
  font-family:    var(--brew-mono);
  font-size:      10px;
  color:          var(--brew-plat-dim);
  letter-spacing: 0.04em;
}

.bfp-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Sections */
.bfp-section {
  display:        flex;
  flex-direction: column;
  gap:            8px;
}

.bfp-section--inline {
  flex-direction: row;
  align-items:    center;
  justify-content: space-between;
}
.bfp-section--inline .bfp-row-chips { justify-content: flex-end; }

.bfp-section-label {
  font-size:      10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color:          var(--brew-plat-ghost);
  font-family:    var(--brew-mono);
}

.bfp-hint {
  font-size:      9px;
  color:          var(--brew-plat-ghost);
  text-transform: none;
  letter-spacing: normal;
  font-family:    var(--brew-font);
}

/* Story type grid */
.bfp-type-grid {
  display:               grid;
  grid-template-columns: repeat(5, 1fr);
  gap:                   6px;
}

.bfp-type-chip {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            4px;
  padding:        8px 4px;
  background:     var(--brew-surface2);
  border:         1px solid var(--brew-border);
  border-radius:  var(--brew-radius-sm);
  cursor:         pointer;
  font-size:      10px;
  color:          var(--brew-plat-dim);
  transition:     all var(--brew-transition);
  white-space:    nowrap;
}
.bfp-type-chip:hover { border-color: var(--brew-border-hi); color: var(--brew-platinum); }
.bfp-type-chip.active {
  border-color: var(--brew-copper);
  color:        var(--brew-copper);
  background:   var(--brew-glow);
  box-shadow:   inset 0 0 0 1px var(--brew-border-hi);
}

.chip-icon {
  font-size:   16px;
  line-height: 1;
}

/* Row chips (audience, language, visibility) */
.bfp-row-chips {
  display:  flex;
  gap:      6px;
  flex-wrap: wrap;
}

.bfp-row-chip {
  padding:       5px 12px;
  background:    var(--brew-surface2);
  border:        1px solid var(--brew-border);
  border-radius: 20px;
  font-size:     11px;
  color:         var(--brew-plat-dim);
  cursor:        pointer;
  transition:    all var(--brew-transition);
  white-space:   nowrap;
}
.bfp-row-chip:hover { border-color: var(--brew-border-hi); color: var(--brew-platinum); }
.bfp-row-chip.active {
  border-color: var(--brew-copper);
  color:        var(--brew-copper);
  background:   var(--brew-glow);
}

/* Tags */
.bfp-tags {
  display:  flex;
  gap:      6px;
  flex-wrap: wrap;
  align-items: center;
}

.bfp-tag {
  display:       flex;
  align-items:   center;
  gap:           4px;
  padding:       3px 8px 3px 10px;
  background:    var(--brew-glow);
  border:        1px solid var(--brew-border);
  border-radius: 20px;
  font-size:     11px;
  color:         var(--brew-copper);
  font-family:   var(--brew-mono);
}
.bfp-tag button {
  background:   none;
  border:       none;
  cursor:       pointer;
  color:        var(--brew-plat-ghost);
  font-size:    9px;
  padding:      0 1px;
  line-height:  1;
  transition:   color var(--brew-transition);
}
.bfp-tag button:hover { color: var(--brew-danger); }

.bfp-tag-input-wrap {
  display:     flex;
  align-items: center;
  gap:         4px;
}

.bfp-tag-input {
  background:    transparent;
  border:        none;
  border-bottom: 1px solid var(--brew-border);
  color:         var(--brew-platinum);
  font-size:     11px;
  padding:       3px 4px;
  outline:       none;
  width:         90px;
  font-family:   var(--brew-font);
  transition:    border-color var(--brew-transition);
}
.bfp-tag-input:focus { border-bottom-color: var(--brew-copper); }
.bfp-tag-input::placeholder { color: var(--brew-plat-ghost); }

.bfp-tag-add {
  background: var(--brew-copper);
  color:      #08100c;
  border:     none;
  width:      18px;
  height:     18px;
  border-radius: 50%;
  font-size:  12px;
  cursor:     pointer;
  line-height: 1;
  display:    flex;
  align-items: center;
  justify-content: center;
  transition: background var(--brew-transition);
}
.bfp-tag-add:hover { background: var(--brew-gold); }

/* Advanced toggle */
.bfp-advanced-toggle {
  background:     none;
  border:         none;
  cursor:         pointer;
  color:          var(--brew-copper);
  font-size:      11px;
  padding:        6px 0;
  letter-spacing: 0.04em;
  text-align:     left;
  transition:     color var(--brew-transition);
}
.bfp-advanced-toggle:hover { color: var(--brew-gold); }

/* Advanced options block */
.bfp-advanced {
  display:        flex;
  flex-direction: column;
  gap:            14px;
  border-top:     1px solid var(--brew-border);
  padding-top:    14px;
  animation:      brew-fade-in 200ms ease both;
}

/* Brewer note textarea */
.bfp-note {
  width:         100%;
  background:    var(--brew-surface2);
  border:        1px solid var(--brew-border);
  border-radius: var(--brew-radius-sm);
  color:         var(--brew-platinum);
  font-size:     12px;
  font-family:   var(--brew-font);
  padding:       10px 12px;
  resize:        vertical;
  outline:       none;
  line-height:   1.5;
  box-sizing:    border-box;
  transition:    border-color var(--brew-transition);
}
.bfp-note:focus  { border-color: var(--brew-copper); }
.bfp-note::placeholder { color: var(--brew-plat-ghost); }

.bfp-note-count {
  font-family:    var(--brew-mono);
  font-size:      9px;
  color:          var(--brew-plat-ghost);
  text-align:     right;
  margin-top:     -4px;
}

/* VHM toggle */
.bfp-vhm-toggle {
  display:       flex;
  flex-direction: column;
  gap:           4px;
  padding:       12px 14px;
  background:    rgba(245, 200, 66, 0.05);
  border:        1px solid rgba(245, 200, 66, 0.18);
  border-radius: var(--brew-radius-sm);
  cursor:        pointer;
  transition:    background var(--brew-transition), border-color var(--brew-transition);
}
.bfp-vhm-toggle.active {
  background:    rgba(245, 200, 66, 0.10);
  border-color:  rgba(245, 200, 66, 0.40);
}
.bfp-vhm-toggle input { display: none; }

.vhm-label {
  display:     flex;
  align-items: center;
  gap:         8px;
}

.vhm-title {
  font-size:      12px;
  font-weight:    600;
  color:          var(--brew-gold);
  letter-spacing: 0.04em;
}

.vhm-cost {
  font-family:    var(--brew-mono);
  font-size:      10px;
  color:          var(--brew-copper);
  background:     rgba(200, 151, 58, 0.15);
  padding:        1px 6px;
  border-radius:  10px;
}

.vhm-desc {
  font-size:   10px;
  color:       var(--brew-plat-dim);
  line-height: 1.4;
}

/* Footer */
.bfp-footer {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         14px 20px 18px;
  border-top:      1px solid var(--brew-border);
  gap:             12px;
  position:        sticky;
  bottom:          0;
  background:      var(--brew-surface);
}

.bfp-cost-badge {
  font-family:    var(--brew-mono);
  font-size:      12px;
  color:          var(--brew-copper);
  letter-spacing: 0.06em;
}

.bfp-submit {
  flex:            1;
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             6px;
  background:      var(--brew-copper);
  color:           #08100c;
  border:          none;
  border-radius:   var(--brew-radius-sm);
  font-size:       13px;
  font-weight:     700;
  padding:         10px 0;
  cursor:          pointer;
  letter-spacing:  0.04em;
  transition:      background var(--brew-transition), box-shadow var(--brew-transition), transform var(--brew-transition);
}
.bfp-submit:hover:not(:disabled) {
  background: var(--brew-gold);
  box-shadow: 0 0 18px var(--brew-gold-glow);
  transform:  translateY(-1px);
}
.bfp-submit:active:not(:disabled) { transform: translateY(0); }
.bfp-submit:disabled {
  background:  rgba(200, 151, 58, 0.35);
  cursor:      not-allowed;
}

.bfp-submitting {
  display:     flex;
  align-items: center;
  gap:         6px;
}

/* ─────────────────────────────────────────────────────────────────────────
   WAIT PANEL  (.bfp-wait)
───────────────────────────────────────────────────────────────────────── */
.bfp-wait {
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  text-align: center;
}

.bfw-title {
  font-size:      16px;
  font-weight:    600;
  color:          var(--brew-copper);
  letter-spacing: 0.05em;
  font-family:    var(--brew-mono);
}

/* Steps */
.bfw-steps {
  display:        flex;
  flex-direction: column;
  gap:            10px;
  width:          100%;
  text-align:     left;
}

.bfw-step {
  display:     flex;
  align-items: center;
  gap:         10px;
  padding:     8px 12px;
  border-radius: var(--brew-radius-sm);
  transition:  background var(--brew-transition), opacity var(--brew-transition);
}

.bfw-step--idle  { opacity: 0.30; }
.bfw-step--active { background: var(--brew-glow); opacity: 1; }
.bfw-step--done  { opacity: 0.55; }

.bfws-dot {
  font-family:    var(--brew-mono);
  font-size:      13px;
  color:          var(--brew-copper);
  width:          16px;
  text-align:     center;
  flex-shrink:    0;
}
.bfw-step--done .bfws-dot  { color: var(--brew-success); }
.bfw-step--active .bfws-dot { color: var(--brew-gold);    }

.bfws-label {
  font-size:   12px;
  color:       var(--brew-plat-dim);
  flex:        1;
}
.bfw-step--active .bfws-label { color: var(--brew-platinum); font-weight: 500; }
.bfw-step--done   .bfws-label { color: var(--brew-success); text-decoration: line-through; }

.bfws-running {
  font-size:   10px;
  color:       var(--brew-copper);
  font-family: var(--brew-mono);
  animation:   brew-dot-blink 1.4s infinite;
}

/* Place hint */
.bfw-place-hint {
  display:     flex;
  align-items: center;
  gap:         6px;
  font-size:   12px;
  color:       var(--brew-plat-dim);
}

.bfwph-dot {
  font-size: 14px;
  line-height: 1;
}

/* Ambient message */
.bfw-ambient {
  font-size:   12px;
  color:       var(--brew-plat-ghost);
  font-style:  italic;
  letter-spacing: 0.02em;
  animation:   brew-ambient-fade 7s ease both;
  min-height:  18px;
}

/* Progress bar */
.bfw-progress-track {
  width:         100%;
  height:        3px;
  background:    rgba(200, 151, 58, 0.12);
  border-radius: 2px;
  overflow:      hidden;
}

.bfw-progress-fill {
  height:     100%;
  background: linear-gradient(90deg, var(--brew-copper), var(--brew-gold));
  border-radius: 2px;
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Footer */
.bfw-footer {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  width:           100%;
  gap:             10px;
}

.bfw-est {
  font-size:   10px;
  color:       var(--brew-plat-ghost);
  font-family: var(--brew-mono);
  letter-spacing: 0.04em;
}

.bfw-cancel {
  background:  none;
  border:      none;
  cursor:      pointer;
  font-size:   11px;
  color:       var(--brew-plat-dim);
  padding:     4px 0;
  transition:  color var(--brew-transition);
}
.bfw-cancel:hover { color: var(--brew-platinum); }

.bfw-refund {
  font-size:  9px;
  opacity:    0.55;
  margin-left: 3px;
}

/* ─────────────────────────────────────────────────────────────────────────
   REVEAL PANEL  (.bfp-reveal)   「开箱时刻」
───────────────────────────────────────────────────────────────────────── */
.bfp-reveal {
  opacity:   0;
  transform: scale(0.94) translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.bfp-reveal.revealed {
  opacity:   1;
  transform: scale(1) translateY(0);
  /* Override animation from base — reveal uses CSS transition, not keyframe */
  animation: none;
}

/* Reveal header shimmer */
.bfr-header {
  padding: 22px 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--brew-border);
}

.bfr-celebration {
  font-family:    var(--brew-mono);
  font-size:      13px;
  font-weight:    600;
  color:          var(--brew-copper);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background:     linear-gradient(90deg, var(--brew-copper), var(--brew-gold), var(--brew-copper));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation:      brew-shimmer 2.5s linear infinite;
}

/* Story card */
.bfr-card {
  margin:        16px 20px;
  padding:       18px 20px;
  border:        1px solid var(--brew-border);
  border-radius: var(--brew-radius);
  display:       flex;
  flex-direction: column;
  gap:           10px;
  position:      relative;
  overflow:      hidden;
  transition:    border-color var(--brew-transition);
}
.bfr-card:hover { border-color: var(--brew-border-hi); }

.bfr-card-divider {
  height:     1px;
  background: linear-gradient(90deg, transparent, var(--brew-border), transparent);
  margin:     2px 0;
}

.bfr-title {
  font-size:      17px;
  font-weight:    700;
  color:          var(--brew-platinum);
  letter-spacing: 0.02em;
  line-height:    1.3;
  margin:         0;
  text-align:     center;
}

.bfr-meta-row {
  display:         flex;
  justify-content: center;
  gap:             10px;
}

.bfr-place {
  font-size:   11px;
  color:       var(--brew-plat-dim);
  letter-spacing: 0.03em;
}

.bfr-excerpt {
  font-size:   12px;
  color:       var(--brew-plat-dim);
  font-style:  italic;
  line-height: 1.65;
  margin:      0;
  text-align:  center;
  padding:     0 4px;
  border-left: none;
  quotes:      none;
}

/* Play CTA */
.bfr-play-btn {
  display:         flex;
  align-items:     center;
  justify-content: center;
  gap:             8px;
  background:      var(--brew-copper);
  color:           #08100c;
  border:          none;
  border-radius:   var(--brew-radius-sm);
  font-size:       13px;
  font-weight:     700;
  padding:         11px 0;
  cursor:          pointer;
  letter-spacing:  0.05em;
  width:           100%;
  transition:      background var(--brew-transition), box-shadow var(--brew-transition), transform var(--brew-transition);
  margin-top:      4px;
}
.bfr-play-btn:hover {
  background: var(--brew-gold);
  box-shadow: 0 0 18px var(--brew-gold-glow);
  transform:  translateY(-1px);
}
.bfr-play-btn:active { transform: translateY(0); }

.bfr-duration {
  font-family:    var(--brew-mono);
  font-size:      10px;
  opacity:        0.65;
  letter-spacing: 0.04em;
}

/* Annotation section */
.bfr-annotation {
  padding:       0 20px 22px;
  display:       flex;
  flex-direction: column;
  gap:           10px;
}

.bfra-head {
  font-size:      11px;
  color:          var(--brew-plat-dim);
  letter-spacing: 0.03em;
  line-height:    1.4;
}

.bfra-note {
  width:         100%;
  background:    var(--brew-surface2);
  border:        1px solid var(--brew-border);
  border-radius: var(--brew-radius-sm);
  color:         var(--brew-platinum);
  font-size:     12px;
  font-family:   var(--brew-font);
  padding:       10px 12px;
  resize:        none;
  outline:       none;
  line-height:   1.5;
  box-sizing:    border-box;
  transition:    border-color var(--brew-transition);
}
.bfra-note:focus  { border-color: var(--brew-copper); }
.bfra-note::placeholder { color: var(--brew-plat-ghost); }

.bfra-tags {
  display:  flex;
  gap:      6px;
  flex-wrap: wrap;
  align-items: center;
}

.bfra-tag {
  display:       flex;
  align-items:   center;
  gap:           4px;
  padding:       3px 8px 3px 10px;
  background:    var(--brew-glow);
  border:        1px solid var(--brew-border);
  border-radius: 20px;
  font-size:     11px;
  color:         var(--brew-copper);
  font-family:   var(--brew-mono);
}
.bfra-tag button {
  background: none;
  border:     none;
  cursor:     pointer;
  color:      var(--brew-plat-ghost);
  font-size:  9px;
  padding:    0 1px;
  line-height: 1;
  transition: color var(--brew-transition);
}
.bfra-tag button:hover { color: var(--brew-danger); }

.bfra-tag-add-wrap {}

.bfra-tag-input {
  background:    transparent;
  border:        none;
  border-bottom: 1px solid var(--brew-border);
  color:         var(--brew-platinum);
  font-size:     11px;
  padding:       3px 4px;
  outline:       none;
  width:         100px;
  font-family:   var(--brew-font);
  transition:    border-color var(--brew-transition);
}
.bfra-tag-input:focus { border-bottom-color: var(--brew-copper); }
.bfra-tag-input::placeholder { color: var(--brew-plat-ghost); }

/* Visibility selector */
.bfra-vis-row {
  display:  flex;
  gap:      6px;
  flex-wrap: wrap;
}

.bfra-vis-opt {
  display:       flex;
  align-items:   center;
  gap:           5px;
  padding:       5px 11px;
  background:    var(--brew-surface2);
  border:        1px solid var(--brew-border);
  border-radius: 20px;
  font-size:     11px;
  color:         var(--brew-plat-dim);
  cursor:        pointer;
  transition:    all var(--brew-transition);
}
.bfra-vis-opt input { display: none; }
.bfra-vis-opt:hover { border-color: var(--brew-border-hi); color: var(--brew-platinum); }
.bfra-vis-opt.active {
  border-color: var(--brew-copper);
  color:        var(--brew-copper);
  background:   var(--brew-glow);
}

/* Save / skip */
.bfra-save {
  background:    var(--brew-copper);
  color:         #08100c;
  border:        none;
  border-radius: var(--brew-radius-sm);
  font-size:     12px;
  font-weight:   700;
  padding:       10px 0;
  cursor:        pointer;
  width:         100%;
  display:       flex;
  align-items:   center;
  justify-content: center;
  gap:           6px;
  letter-spacing: 0.04em;
  transition:    background var(--brew-transition), box-shadow var(--brew-transition);
}
.bfra-save:hover:not(:disabled) {
  background: var(--brew-gold);
  box-shadow: 0 0 14px var(--brew-gold-glow);
}
.bfra-save:disabled { background: rgba(200, 151, 58, 0.30); cursor: not-allowed; }
.bfra-save.saved    { background: var(--brew-success); color: #fff; }

.bfra-skip {
  background:  none;
  border:      none;
  cursor:      pointer;
  font-size:   11px;
  color:       var(--brew-plat-ghost);
  text-align:  center;
  padding:     4px 0;
  width:       100%;
  transition:  color var(--brew-transition);
}
.bfra-skip:hover { color: var(--brew-plat-dim); }

/* ─────────────────────────────────────────────────────────────────────────
   ERROR PANEL  (.bfp-error)
───────────────────────────────────────────────────────────────────────── */
.bfp-error {
  padding:    40px 28px 28px;
  text-align: center;
  display:    flex;
  flex-direction: column;
  align-items: center;
  gap:         14px;
}

.bfe-icon {
  font-size:  32px;
  line-height: 1;
  opacity:    0.7;
}

.bfe-title {
  font-size:      15px;
  font-weight:    600;
  color:          var(--brew-platinum);
  letter-spacing: 0.02em;
}

.bfe-msg,
.bfe-body {
  font-size:   12px;
  color:       var(--brew-plat-dim);
  line-height: 1.5;
  max-width:   280px;
}

.bfe-retry {
  background:    var(--brew-copper);
  color:         #08100c;
  border:        none;
  border-radius: var(--brew-radius-sm);
  font-size:     13px;
  font-weight:   700;
  padding:       10px 28px;
  cursor:        pointer;
  letter-spacing: 0.04em;
  transition:    background var(--brew-transition);
}
.bfe-retry:hover { background: var(--brew-gold); }

.bfe-close {
  background:  none;
  border:      none;
  cursor:      pointer;
  font-size:   11px;
  color:       var(--brew-plat-ghost);
  padding:     4px 0;
  transition:  color var(--brew-transition);
}
.bfe-close:hover { color: var(--brew-plat-dim); }

/* ─────────────────────────────────────────────────────────────────────────
   INSUFFICIENT CREDITS PANEL  (.bfp-insufficient)
───────────────────────────────────────────────────────────────────────── */
.bfp-insufficient {
  padding:     36px 28px 28px;
  text-align:  center;
  display:     flex;
  flex-direction: column;
  align-items: center;
  gap:         14px;
}

.bfi-icon {
  font-size:      40px;
  font-family:    var(--brew-mono);
  color:          var(--brew-copper);
  opacity:        0.55;
  line-height:    1;
  letter-spacing: -0.05em;
}

.bfi-title {
  font-size:      16px;
  font-weight:    700;
  color:          var(--brew-platinum);
  letter-spacing: 0.04em;
}

.bfi-body {
  display:        flex;
  flex-direction: column;
  gap:            12px;
  width:          100%;
  max-width:      280px;
}
.bfi-body > p {
  margin:    0;
  font-size: 12px;
  color:     var(--brew-plat-dim);
}

.bfi-options {
  display:        flex;
  flex-direction: column;
  gap:            8px;
}

.bfi-opt {
  display:       flex;
  align-items:   center;
  gap:           8px;
  padding:       10px 14px;
  background:    var(--brew-surface2);
  border:        1px solid var(--brew-border);
  border-radius: var(--brew-radius-sm);
  font-size:     12px;
  color:         var(--brew-plat-dim);
  text-align:    left;
}

.bfio-icon {
  font-family:    var(--brew-mono);
  color:          var(--brew-copper);
  font-size:      14px;
  flex-shrink:    0;
}

.bfi-upgrade-btn {
  background:    linear-gradient(135deg, var(--brew-copper), var(--brew-gold));
  color:         #08100c;
  border:        none;
  border-radius: var(--brew-radius-sm);
  font-size:     12px;
  font-weight:   700;
  padding:       11px 0;
  cursor:        pointer;
  width:         100%;
  letter-spacing: 0.04em;
  transition:    opacity var(--brew-transition), transform var(--brew-transition);
}
.bfi-upgrade-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ─────────────────────────────────────────────────────────────────────────
   ACHIEVEMENT TOAST
───────────────────────────────────────────────────────────────────────── */
.brew-achievement {
  position:      fixed;
  bottom:        80px;
  right:         20px;
  z-index:       999;
  display:       flex;
  align-items:   center;
  gap:           12px;
  padding:       12px 16px;
  background:    var(--brew-surface);
  border:        1px solid rgba(245, 200, 66, 0.35);
  border-radius: var(--brew-radius);
  box-shadow:    0 4px 28px rgba(0, 0, 0, 0.45), 0 0 20px var(--brew-gold-glow);
  max-width:     280px;
  animation:     brew-toast-in 400ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ba-icon {
  font-size:   24px;
  line-height: 1;
  flex-shrink: 0;
}

.ba-text {
  display:        flex;
  flex-direction: column;
  gap:            2px;
}

.ba-title {
  font-size:      12px;
  font-weight:    700;
  color:          var(--brew-gold);
  letter-spacing: 0.06em;
  font-family:    var(--brew-mono);
  text-transform: uppercase;
}

.ba-desc {
  font-size:  11px;
  color:      var(--brew-plat-dim);
  line-height: 1.4;
}

/* ─────────────────────────────────────────────────────────────────────────
   COORD PICKER OVERLAY
───────────────────────────────────────────────────────────────────────── */
.brew-coord-picker {
  position:   fixed;
  inset:      0;
  z-index:    920;
  pointer-events: none;
}

.bcp-top-bar {
  position:        absolute;
  top:             0;
  left:            0;
  right:           0;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         14px 18px;
  background:      linear-gradient(to bottom, rgba(8, 12, 10, 0.85), transparent);
  pointer-events:  auto;
}

.bcp-hint {
  font-size:   12px;
  color:       var(--brew-platinum);
  letter-spacing: 0.03em;
}

.bcp-cancel {
  background:    none;
  border:        1px solid var(--brew-border);
  border-radius: var(--brew-radius-sm);
  color:         var(--brew-plat-dim);
  font-size:     11px;
  padding:       5px 12px;
  cursor:        pointer;
  pointer-events: auto;
  transition:    all var(--brew-transition);
}
.bcp-cancel:hover { border-color: var(--brew-border-hi); color: var(--brew-platinum); }

.bcp-precision {
  position:    absolute;
  top:         52px;
  left:        50%;
  transform:   translateX(-50%);
  font-size:   10px;
  color:       var(--brew-copper);
  font-family: var(--brew-mono);
  background:  rgba(8, 12, 10, 0.72);
  padding:     3px 12px;
  border-radius: 20px;
  border:      1px solid var(--brew-border);
  letter-spacing: 0.04em;
  pointer-events: none;
}

.bcp-picked {
  position:        absolute;
  bottom:          28px;
  left:            50%;
  transform:       translateX(-50%);
  display:         flex;
  align-items:     center;
  gap:             12px;
  padding:         12px 16px;
  background:      var(--brew-surface);
  border:          1px solid var(--brew-border-hi);
  border-radius:   var(--brew-radius);
  box-shadow:      0 4px 24px rgba(0, 0, 0, 0.5);
  pointer-events:  auto;
  animation:       brew-slide-up 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
  white-space:     nowrap;
}

.bcp-picked-pulse {
  width:         10px;
  height:        10px;
  border-radius: 50%;
  background:    var(--brew-copper);
  position:      relative;
  flex-shrink:   0;
}
.bcp-picked-pulse::after {
  content:          '';
  position:         absolute;
  inset:            -4px;
  border-radius:    50%;
  border:           1px solid var(--brew-copper);
  animation:        brew-pulse-ring 1.4s ease-out infinite;
}

.bcp-picked-info {
  display:        flex;
  flex-direction: column;
  gap:            2px;
}

.bcp-picked-name {
  font-size:      12px;
  font-weight:    600;
  color:          var(--brew-platinum);
  letter-spacing: 0.02em;
}

.bcp-picked-region {
  font-size:  10px;
  color:      var(--brew-plat-dim);
}

.bcp-confirm {
  background:    var(--brew-copper);
  color:         #08100c;
  border:        none;
  border-radius: var(--brew-radius-sm);
  font-size:     12px;
  font-weight:   700;
  padding:       7px 14px;
  cursor:        pointer;
  letter-spacing: 0.04em;
  white-space:   nowrap;
  transition:    background var(--brew-transition), transform var(--brew-transition);
}
.bcp-confirm:hover { background: var(--brew-gold); transform: translateY(-1px); }

/* ─────────────────────────────────────────────────────────────────────────
   RESPONSIVE ADJUSTMENTS
───────────────────────────────────────────────────────────────────────── */

/* Small screens — bottom sheet style for panels */
/* ── Tablet range (481px–768px) ─────────────────────────────────────────── */
@media (min-width: 481px) and (max-width: 768px) {
  /* Slightly narrow the flow panel to fit tablet layout */
  .brew-flow-panel {
    max-width:  380px;
    margin:     0 12px;
    max-height: 88dvh;
  }

  /* Reduce padding on header */
  .bfp-header {
    padding: 16px 16px 14px;
  }

  /* Type grid: 4-column on tablet */
  .bfp-type-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Brew mode row: allow 2 columns */
  .brew-modes {
    flex-wrap: wrap;
    gap: 8px;
  }
  .brew-mode-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  /* Brew achievement: inset from sides */
  .brew-achievement {
    right: 12px;
    max-width: 300px;
  }

  /* Credit display font scale */
  .bcp-amount { font-size: 32px; }
}

/* ── Mobile (≤480px) ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .brew-flow-panel {
    max-width:     100%;
    border-radius: var(--brew-radius) var(--brew-radius) 0 0;
    margin:        0;
    position:      fixed;
    bottom:        0;
    left:          0;
    right:         0;
    max-height:    92dvh;
    animation:     brew-slide-up 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .bfp-type-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .brew-modes {
    flex-direction: column;
  }

  .brew-achievement {
    bottom:    calc(env(safe-area-inset-bottom, 0) + 70px);
    right:     12px;
    left:      12px;
    max-width: none;
  }
}

/* Touch — ensure tap targets meet 44px minimum */
@media (pointer: coarse) {
  .bmc-btn, .bfp-submit, .bfr-play-btn, .bfra-save, .bfi-upgrade-btn, .bcp-confirm {
    min-height: 44px;
  }
  .bfp-type-chip, .bfp-row-chip, .bfra-vis-opt { min-height: 36px; }
  .bfp-tag button { min-width: 24px; min-height: 24px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:   0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:  0.01ms !important;
  }
  .bfr-celebration { animation: none; -webkit-text-fill-color: var(--brew-copper); }
  .bfw-ambient     { animation: none; opacity: 1; }
}
