/* =========================================
   AI指示整形 GATE 専用CSS（#bb-ai-gate-app 限定）
   完全差し替え版：チェック式フィルター + select崩れ対策込み
========================================= */

#bb-ai-gate-app{
  --bbag-accent:#3b82f6;
  --bbag-glow:rgba(59,130,246,.16);
}

/* 縦書き巻き込みを島内だけ解除 */
#bb-ai-gate-app, #bb-ai-gate-app *{
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
}

#bb-ai-gate-app .bb-grid-layout{
  display:grid;
  grid-template-columns:0.8fr 1.2fr;
  gap: 22px;
  align-items:start;
  width:100%;
  margin-top: 30px;
}

#bb-ai-gate-app .bb-panel{
  background:#fff;
  border-radius:12px;
  box-sizing:border-box;
}

#bb-ai-gate-app .tool-section-label{
  font-weight:900;
  font-size:14px;
  letter-spacing:.06em;
  color:#334155;
  margin:0 3px 12px;
}

#bb-ai-gate-app .form-row{ 
    margin-bottom: 18px;
    border: solid 1px #e8e8e8;
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f8f8;
 }

#bb-ai-gate-app label{
  display:block;
  font-weight:900;
  font-size:18px;
  color:#111827;
  margin:0;
}

#bb-ai-gate-app .bb-hint{
  margin:0 5px 10px;
  font-size:12px;
  color:#64748b;
  line-height:1.5;
}
#bb-ai-gate-app .bb-mini{
  margin:0 0 10px;
  font-size:12px;
  color:#64748b;
}

#bb-ai-gate-app .bb-empty-msg{
  padding:12px;
  border:1px dashed #cbd5e1;
  border-radius:10px;
  background:#f8fafc;
  color:#475569;
  font-size:12px;
  line-height:1.5;
}

/* =========================================
   Filter grid（チェック式）
========================================= */

#bb-ai-gate-app .bbag-mode-grid{
  display:grid;
  gap:15px;
  grid-template-columns: 1fr 1fr;
  margin-bottom:10px;
}

#bb-ai-gate-app .bbag-filter-card{
  display:block;
  border-radius:12px;
  border:1px solid #e2e8f0;
  background:#fff;
  padding:18px 20px;
  cursor:pointer;
  text-align:left;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  min-height: 92px;
  position:relative;
  user-select:none;
}

#bb-ai-gate-app .bbag-filter-card:hover{
  transform: translateY(-1px);
  border-color:#cbd5e1;
  box-shadow:0 10px 20px rgba(15,23,42,.06);
}

#bb-ai-gate-app .bbag-filter-card.is-active{
  border-color: var(--bbag-accent);
  box-shadow:0 0 0 3px rgba(59,130,246,.12);
}

#bb-ai-gate-app .bbag-filter-check{
  position:absolute;
  top:14px;
  left:14px;
  width:16px;
  height:16px;
  accent-color: var(--bbag-accent);
}

#bb-ai-gate-app .bbag-filter-ui{ padding-left: 26px; }

#bb-ai-gate-app .bbag-filter-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}

#bb-ai-gate-app .bbag-filter-name{
  font-weight:900;
  font-size:14px;
  color:#0f172a;
}

#bb-ai-gate-app .bbag-filter-code{
  font-size:10px;
  color:#475569;
  border:1px solid #e2e8f0;
  border-radius:999px;
  padding:3px 8px;
  white-space:nowrap;
}

#bb-ai-gate-app .bbag-filter-desc{
  margin-top:10px;
  font-size:12px;
  color:#64748b;
  line-height:1.4;
}

#bb-ai-gate-app .bbag-filter-tags{
  margin-top:10px;
  font-size:11px;
  color:#334155;
  font-weight:800;
}

/* =========================================
   textarea
========================================= */

#bb-ai-gate-app .bbag-ta{
  width:100%;
  min-height:220px;
  resize:vertical;
  border-radius:12px;
  padding:12px;
  border:1px solid #e2e8f0;
  background:#f8fafc;
  color:#0f172a;
  line-height:1.6;
  box-sizing:border-box;
  outline:none;
}
#bb-ai-gate-app .bbag-ta:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(59,130,246,.15);
  background:#fff;
}

/* =========================================
   bottom row
========================================= */

#bb-ai-gate-app .bbag-minirow{
  display:grid;
  grid-template-columns: 170px 1fr;
  gap: 20px;
  align-items:end;
  margin-top: 30px;
}

#bb-ai-gate-app .bbag-scorebox{
  border-radius:12px;
  border:1px dashed #cbd5e1;
  background:#f8fafc;
  padding:10px 60px;
  min-height: 88px;
  margin: 0 auto;
}
#bb-ai-gate-app .bbag-scorebox__ttl{ font-size:12px; letter-spacing:.12em; color:#64748b; }
#bb-ai-gate-app .bbag-scorebox__val{ font-size:37px; font-weight:900; color:#0f172a; margin-top:0;     line-height: 1.2;}
#bb-ai-gate-app .bbag-scorebox__hint{ font-size:12px; color:#64748b; margin-top:4px; line-height:1.4; }

#bb-ai-gate-app .bbag-btnrow{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
  align-items:flex-end;
}

/* =========================================
   SELECT（用途）崩れ対策：島内で強制上書き
========================================= */

#bb-ai-gate-app .bbag-selectwrap{
  display:block;
  /*width:360px;*/
  max-width:100%;
  margin-bottom: 20px;
}

#bb-ai-gate-app .bbag-selectlabel{
  display:block;
  margin:0 0 6px;
  font-weight:900;
  font-size:14px;
  color:#111827;
}

#bb-ai-gate-app select#bbag-template.bbag-select{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;

  height:48px !important;
  padding:10px 44px 10px 20px !important;
  border-radius:10px !important;

  border:1px solid #e2e8f0 !important;
  background:#fff !important;
  color:#0f172a !important;

  font-size:14px !important;
  font-weight:500 !important;
  line-height:1.2 !important;

  -webkit-appearance:none !important;
  appearance:none !important;

  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent) !important;
  background-position:
    calc(100% - 18px) 20px,
    calc(100% - 12px) 20px,
    0 0 !important;
  background-size:6px 6px, 6px 6px, 100% 100% !important;
  background-repeat:no-repeat !important;

  outline:none !important;
}

#bb-ai-gate-app select#bbag-template.bbag-select:focus{
  border-color:#93c5fd !important;
  box-shadow:0 0 0 3px rgba(59,130,246,.15) !important;
}

/* =========================================
   BUTTON
========================================= */

#bb-ai-gate-app .bbag-btn-primary{
  width:360px;
  max-width:100%;
  background: var(--bbag-accent);
  color:#fff;
  font-size: 16px;
  border:none;
  border-radius:10px;
  padding:12px 14px;
  height:88px;
  font-weight:900;
  box-shadow:0 10px 20px rgba(15,23,42,.08);
}

#bb-ai-gate-app .bbag-btn-primary:hover{ filter: brightness(.98); }
#bb-ai-gate-app .bbag-btn-primary:disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
}

#bb-ai-gate-app .bbag-btn-sub{
  display:block;
  font-size:12px;
  opacity:.92;
  font-weight:800;
  margin-top:5px;
  color: rgba(255,255,255,.92);
}

/* =========================================
   after
========================================= */

#bb-ai-gate-app .bbag-after{
  border-radius:12px;
  border:1px solid #e2e8f0;
  background:#0b1220;
  padding:14px;
  color:#e5e7eb;
}

#bb-ai-gate-app .bbag-after-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}

#bb-ai-gate-app .bbag-after-title{ font-weight:900; font-size:12.5px; }

#bb-ai-gate-app .bbag-output{
  margin:0;
  white-space:pre-wrap;
  word-break:break-word;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.04);
  padding:12px;
  line-height:1.65;
  font-size:12.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* バッジ/スタッツは一旦隠す（必要なら復活） */
#bb-ai-gate-app .bbag-badges,
#bb-ai-gate-app .bbag-stats{ display:none; }

/* =========================================
   HERO（ページ上部）
========================================= */

.gate-hero__inner{
  max-width: 960px;
  margin: 0 auto 10px;
  padding-bottom:20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:40px;
  border-bottom:solid 1px #efefef;
}
.gate-hero__content{ flex: 1; margin: 0 10px;}
.gate-hero__visual{ flex: 0 0 380px; text-align:center; }
.gate-hero__label{
  font-size: 14px;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 8px;
}
.gate-hero__title{
  font-size: 32px;
  line-height: 1.3;
  margin-bottom: 20px;
}
.gate-hero__title-sub{ font-weight: 700; color: #6c757d; }
.gate-hero__description{ font-size: 15px; line-height: 1.8; }
.gate-hero__visual img{ max-width:100%; height:auto; border-radius:8px; }

/* =========================================
   responsive
========================================= */

@media (max-width: 980px){
  #bb-ai-gate-app .bb-grid-layout{ grid-template-columns: 1fr; }
  #bb-ai-gate-app .bbag-minirow{ grid-template-columns: 1fr; }
  #bb-ai-gate-app .bbag-btnrow{ justify-content: stretch; }
  #bb-ai-gate-app .bbag-selectwrap{ width:100%; }
  #bb-ai-gate-app .bbag-btn-primary{ width:100%; }
  #bb-ai-gate-app .bbag-mode-grid{ grid-template-columns: 1fr; }
  .gate-hero__inner{ flex-direction:column; align-items:flex-start;gap: 0; }
  .gate-hero__visual{ flex: 0 0 auto; width:100%; }
}
/* 空状態スケルトン */
#bb-ai-gate-app .bbag-empty{
  border:1px dashed #cbd5e1;
  border-radius:12px;
  padding:20px;
  background:#f8fafc;
  text-align:left;
}

#bb-ai-gate-app .bbag-skeleton{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:12px;
}

#bb-ai-gate-app .sk-line{
  height:10px;
  background:linear-gradient(
    90deg,
    rgba(0,0,0,0.06) 25%,
    rgba(0,0,0,0.12) 37%,
    rgba(0,0,0,0.06) 63%
  );
  background-size:400% 100%;
  animation: sk-shimmer 1.4s ease infinite;
  border-radius:6px;
}

#bb-ai-gate-app .sk-title{
  width:60%;
  height:14px;
}

#bb-ai-gate-app .sk-line.short{
  width:40%;
}

#bb-ai-gate-app .sk-block{
  height:60px;
  border-radius:10px;
  background:rgba(0,0,0,0.05);
}

@keyframes sk-shimmer{
  0%{ background-position:100% 0; }
  100%{ background-position:0 0; }
}

#bb-ai-gate-app .bbag-empty-hint{
  font-size:12px;
  color:#64748b;
}