.bcase{ width:100%; color:var(--text); font:inherit; }
.bcase.bcase--inherit, .bcase.bcase--content{
  max-width: var(--wp--style--global--content-size, var(--theme-content-width, var(--content-width, var(--container-max-width, 750px))));
  margin-inline: auto;
}
.bcase.bcase--narrow{
  max-width: var(--theme-narrow-container-max-width, var(--narrow-container-max-width, 750px));
  margin-inline: auto;
}
.bcase.bcase--wide{
  max-width: var(--wp--style--global--wide-size, var(--theme-wide-width, 1200px));
  margin-inline: auto;
}
.bcase.bcase--full{ max-width: none; }

/* Bestoolbox base — inherit as much as possible from the theme */
:root{
  /* COLOR bridge (your theme var first) */
  --primary: var(--theme-palette-color-1, var(--paletteColor1, var(--ct-primary-color, #1d4ed8)));
  --text: var(--theme-text-color, var(--paletteColor2, var(--ct-text-color, #1f2937)));
  --card: var(--theme-surface-1, var(--paletteColor5, var(--ct-card-bg, #fff)));
  --bg: var(--theme-surface-2, var(--paletteColor7, var(--ct-light-bg, #f7f8fa)));
  --border: var(--theme-border-color, var(--ct-border-color, rgba(0,0,0,.12)));
  /* SHAPE / SPACING bridge */
  --radius: var(--theme-radius, var(--borderRadius, 6px));
  --ctrl-h: var(--theme-control-height, 42px);
  --ctrl-py: var(--theme-control-padding-y, 10px);
  --ctrl-px: var(--theme-control-padding-x, 12px);
  /* FOCUS ring (theme may override) */
  --focus-ring: var(--theme-focus-ring, 0 0 0 6px rgba(0,0,0,.08));
}


.bcase *{ box-sizing: border-box; font: inherit; letter-spacing: inherit; line-height: inherit; }

.bcase-card{ background:var(--card); border:1px solid var(--border); border-radius:var(--radius); }

/* Top row: fields + actions on one line */
.bcase-grid{ display:grid; grid-template-columns: minmax(200px, 260px) auto auto auto; gap:12px; align-items:end; padding:12px 16px; }
.bcase-label{ display:block; margin:0 0 6px; color:rgba(0,0,0,.6); font-weight:600; }

/* Controls: inherit typography & radius, use theme heights/paddings */
.bcase-select{
  width:100%;
  padding:var(--ctrl-py) var(--ctrl-px);
  min-height:var(--ctrl-h);
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:#fff;
  line-height:1.5;
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
}
.bcase-select:focus{ outline:none; box-shadow: var(--focus-ring); }

.bcase-check{ display:flex; align-items:center; gap:8px; line-height:1.4; }

.bcase-actions{ display:flex; gap:10px; justify-content:flex-end; }
.bcase-btn{
  padding:var(--ctrl-py) var(--ctrl-px);
  border-radius:var(--radius);
  border:1px solid transparent;
  background:var(--primary);
  color:#fff;
  cursor:pointer;
}
.bcase-btn.bcase-ghost{ background:transparent; color:var(--primary); border-color:var(--primary); }

/* Textarea */
.bcase-output-wrap{ padding: 12px 16px 16px; }
.bcase-text{
  width:100%;
  min-height:280px;
  padding:var(--ctrl-py) var(--ctrl-px);
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:var(--bg);
  resize:vertical;
  line-height:1.6;
}
.bcase-text:focus{ outline:none; box-shadow: var(--focus-ring); }

/* Toast */
.bcase-toast{
  position:fixed; right:16px; bottom:16px;
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  padding:10px 12px; opacity:0; transform: translateY(6px);
  pointer-events:none; transition: opacity .18s ease, transform .18s ease;
}
.bcase-toast.show{ opacity:1; transform: translateY(0); }

/* RWD */
@media (max-width:900px){
  .bcase-grid{ grid-template-columns: 1fr; }
  .bcase-actions{ justify-content:flex-start; }
}
