/* ============================================================
   Utilities Bunker — Binary / ASCII / Hex / Base64 Converter
   File: /assets/css/modules/convert/binary-ascii-hex-base64.v2.1.css
   Purpose:
   - Tool-only layout and styling
   - Mobile-first, UB-CERT aligned
   - No edits to ub-toolkit.v2.1.css
   ============================================================ */

:root{
  --bha-radius: 16px;
  --bha-gap: 14px;
  --bha-soft: rgba(0,0,0,.06);
  --bha-soft-2: rgba(0,0,0,.035);
  --bha-accent-soft: rgba(249,58,19,.10);
  --bha-accent-border: rgba(249,58,19,.26);
  --bha-mono: var(--ub-mono);
}

/* Header */
.bha-head{
  display:flex;
  gap:12px;
  justify-content:space-between;
  align-items:flex-start;
  flex-wrap:wrap;
}
.bha-title{
  margin:0;
  font-size:var(--ub-fs-5);
}
.bha-subtitle{
  margin:6px 0 0;
}

/* How to */
.bha-steps{
  margin:0;
  padding-left:18px;
}
.bha-steps li{
  margin:0 0 8px;
}
.bha-steps li:last-child{
  margin-bottom:0;
}

/* Main hero layout */
.bha-hero{
  display:grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap:var(--bha-gap);
  align-items:start;
}
@media (max-width: 1024px){
  .bha-hero{
    grid-template-columns:1fr;
  }
}

.bha-panel{
  border:1px solid var(--ub-border);
  border-radius:var(--bha-radius);
  background:var(--ub-surface-2);
  padding:12px;
}
.bha-panel--primary{
  min-width:0;
}
.bha-panel--side{
  min-width:0;
}

.bha-panel-head{
  display:flex;
  gap:12px;
  justify-content:space-between;
  align-items:flex-start;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.bha-eyebrow{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:4px 10px;
  border-radius:999px;
  background:var(--bha-accent-soft);
  border:1px solid var(--bha-accent-border);
  color:var(--ub-btn-grad-b);
  font-size:12px;
  font-weight:950;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.bha-panel-title{
  margin:8px 0 0;
}
.bha-panel-subtitle{
  margin:6px 0 0;
}

.bha-format-badges{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.bha-format-badges .ub-chip{
  min-height:36px;
  padding:8px 12px;
  pointer-events:none;
}

/* Form */
.bha-form{
  display:block;
}
.bha-form .ub-field{
  min-width:0;
}
.bha-form textarea{
  min-height:220px;
  resize:vertical;
}
#sourceInput{
  font-family:var(--bha-mono);
  line-height:1.5;
}

.bha-controls{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}
.bha-controls .ub-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.bha-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}
.bha-actions .ub-btn{
  min-width:140px;
}
@media (max-width: 560px){
  .bha-actions .ub-btn{
    width:100%;
  }
}

.bha-live{
  margin-top:12px;
}

/* Stats */
.bha-stat-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
}
@media (max-width: 520px){
  .bha-stat-grid{
    grid-template-columns:1fr;
  }
}
.bha-stat{
  padding:12px;
  border-radius:14px;
  border:1px solid var(--ub-border);
  background:var(--ub-card-bg);
  min-height:88px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.bha-stat-k{
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--ub-muted);
}
.bha-stat-v{
  margin-top:5px;
  font-family:var(--bha-mono);
  font-size:15px;
  font-weight:950;
  overflow-wrap:anywhere;
}

.bha-mini-card{
  margin-top:12px;
  margin-bottom:0;
}
.bha-mini-title{
  margin-top:0;
  font-size:var(--ub-fs-2);
}
.bha-mini-list{
  margin:0;
  padding-left:18px;
}
.bha-mini-list li{
  margin:0 0 8px;
}
.bha-mini-list li:last-child{
  margin-bottom:0;
}

/* Results */
.bha-results{
  margin-top:16px;
}
.bha-output-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:var(--bha-gap);
}
@media (max-width: 980px){
  .bha-output-grid{
    grid-template-columns:1fr;
  }
}

.bha-output-card{
  margin-bottom:0;
  min-width:0;
}
.bha-output-card--wide{
  grid-column:1 / -1;
}
@media (max-width: 980px){
  .bha-output-card--wide{
    grid-column:auto;
  }
}

.bha-output-head{
  display:flex;
  gap:12px;
  justify-content:space-between;
  align-items:flex-start;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.bha-output-title{
  margin:0;
  font-size:var(--ub-fs-2);
  font-weight:950;
}
.bha-output-subtitle{
  margin:4px 0 0;
  color:var(--ub-muted);
  font-size:12px;
}
.bha-copy-btn{
  min-width:92px;
}

.bha-output-box{
  width:100%;
  min-height:154px;
  resize:vertical;
  font-family:var(--ub-font);
  line-height:1.5;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.bha-output-box--mono{
  font-family:var(--bha-mono);
  letter-spacing:.01em;
}

/* Details */
.bha-detail-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:14px;
}
@media (max-width: 900px){
  .bha-detail-grid{
    grid-template-columns:1fr;
  }
}
.bha-detail-title{
  margin:0 0 8px;
  font-size:var(--ub-fs-2);
  font-weight:950;
}
.bha-work{
  min-height:140px;
  padding:12px;
  border:1px solid var(--ub-border);
  border-radius:14px;
  background:var(--ub-card-bg);
  font-family:var(--bha-mono);
  font-size:13px;
  line-height:1.55;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

/* Reference */
.bha-reference-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:14px;
}
@media (max-width: 760px){
  .bha-reference-grid{
    grid-template-columns:1fr;
  }
}
.bha-ref-title{
  margin:0 0 6px;
  font-size:var(--ub-fs-2);
  font-weight:950;
}
.bha-ref-copy{
  margin:0;
}

.bha-example-table-wrap{
  margin-top:14px;
  overflow-x:auto;
}

/* FAQ */
.bha-faq-q{
  margin:12px 0 6px;
  font-size:var(--ub-fs-2);
  font-weight:950;
}
.bha-faq-a{
  margin:0;
}

/* Rail example buttons */
.bha-example-stack{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.bha-example-btn{
  width:100%;
  justify-content:flex-start;
  text-align:left;
  min-height:44px;
  padding:10px 14px;
}

/* Code / inline examples */
code{
  font-family:var(--bha-mono);
  font-size:.95em;
  padding:.12em .38em;
  border-radius:8px;
  background:var(--bha-soft-2);
  border:1px solid var(--ub-border);
}

/* Better textarea/input polish for this tool */
#sourceInput,
.bha-output-box{
  border-radius:14px;
  border:1px solid var(--ub-border);
  background:var(--ub-surface-1);
  color:var(--ub-text);
  padding:12px;
  box-shadow:none;
}
#sourceInput:focus,
.bha-output-box:focus{
  outline:none;
  box-shadow:0 0 0 4px var(--ub-focus);
  border-color:rgba(249,58,19,.45);
}

/* Common use: visual alignment help */
.ub-card.ub-common .ub-common-list li{
  min-height:52px;
  display:flex;
  align-items:center;
}

/* Right rail spacing polish */
.ub-rail .ub-card:last-child{
  margin-bottom:0;
}

/* Dark mode tiny refinements */
html.ub-theme-dark .bha-panel{
  background:linear-gradient(180deg, var(--ub-surface-2), rgba(255,255,255,.02));
}
html.ub-theme-dark .bha-stat,
html.ub-theme-dark .bha-work,
html.ub-theme-dark code{
  background:rgba(255,255,255,.03);
}
html.ub-theme-dark .bha-eyebrow{
  background:rgba(249,58,19,.12);
}

/* Mobile touch target safety */
.bha-copy-btn,
.bha-example-btn,
.bha-actions .ub-btn,
.bha-controls .ub-chip{
  min-height:44px;
}

/* Small-screen text area tuning */
@media (max-width: 520px){
  .bha-output-box{
    min-height:132px;
  }

  #sourceInput{
    min-height:190px;
  }

  .bha-output-head{
    align-items:stretch;
  }

  .bha-copy-btn{
    width:100%;
  }
}