/* ===== Common Layout (skeleton) ===== */
.asb-container{
  max-width:980px;
  margin:20px auto;
  padding:0 12px;
  font-family:system-ui,Segoe UI,Roboto,Helvetica,Arial;
  font-size:clamp(14px, 1.6vw, 16px);
}
.asb-breadcrumbs{color:#666;margin:6px 0 12px}
.asb-breadcrumbs .sep{margin:0 6px;color:#999}
.asb-breadcrumbs .current{font-weight:600}

.asb-card{
  background:#c7c7c7; /* 薄グレー */
  color:#111;
  border:1px solid #b5b5b5;
  border-radius:12px;
  padding:16px;
  margin:12px 0;
  box-shadow:0 1px 2px rgba(0,0,0,.20);
}
/* カード内テーブルは100% */
.asb-card table{width:100% !important}
.asb-card a{color:#0b3a5b}
.asb-sec-title{font-weight:600;margin-bottom:10px;color:#111}

.asb-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.asb-row.-right{justify-content:flex-end}
.asb-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.asb-col-span-2{grid-column:span 2 / span 2}
@media (max-width:640px){.asb-grid{grid-template-columns:1fr}.asb-col-span-2{grid-column:auto}}

/* 入力・ボタン（可変フォント継承） */
.asb-input{
  width:100%;
  padding:8px 10px;
  border:1px solid #d9d9d9;
  border-radius:8px;
  background:#fff;
  color:#111;
  box-sizing:border-box;
  font-size:inherit;
  line-height:1.4;
}
.asb-input--sm{width:auto;padding:6px 8px}
.asb-label{display:block;margin:6px 0 4px;font-size:.92rem;color:#444}

.asb-btn{
  border:1px solid #d1d5db;
  border-radius:10px;
  padding:8px 12px;
  background:#f9fafb;
  cursor:pointer;
  opacity:1;
  font-size:inherit;
  line-height:1.2;
  white-space:nowrap;
  display:inline-block;
  color:#111;
}
.asb-btn.-primary{background:#111827;color:#fff;border-color:#111827}
.asb-btn.-ghost{background:#ffffff;border-color:#d1d5db;color:#111}
.asb-btn.-danger{background:#fee2e2;border-color:#fecaca}
.asb-btn.-sm{padding:4px 8px;font-size:.9rem}
.asb-btn + .asb-btn{margin-left:8px}
.asb-btn[disabled]{cursor:not-allowed;opacity:.6}

.asb-small{font-size:.85rem}
.asb-note{font-size:.9rem;color:#444;margin-top:8px}
.asb-muted{color:#555;font-size:.92rem}

/* === 一般テーブル（下線のみ、実テーブル用） === */
.asb-table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
  font-size:inherit;
}
.asb-table th,
.asb-table td{
  border-bottom:1px solid #e5e5e5;
  padding:10px;
  vertical-align:middle;
  background:transparent; /* ヘッダ背景は既存のまま */
  color:#111;
}

/* ステータス枠 */
.asb-status{
  min-height:80px;white-space:pre-line;background:#f9fafb;
  border:1px dashed #e5e7eb;border-radius:8px;padding:10px;color:#111
}

/* === タブ === */
.asb-tab-headers{display:flex;gap:6px;margin-bottom:8px}

/* ここは最小限だけ残す（角丸や余白は asb-btn に任せる） */
.asb-tab-btn{
  border-radius: 10px; /* 好みで */
}

/* 旧：.asb-tab-btn.is-active で色を変えていた場合は不要になる */

.asb-tab-btn.is-active{
  background:#111827;color:#fff;border-color:#111827
}
.asb-tab-panel{display:none}
.asb-tab-panel.is-active{display:block}

/* ページング・検索 */
.asb-actions{display:flex;gap:8px;flex-wrap:wrap}
.asb-list-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.asb-pagination{display:flex;gap:8px;align-items:center;justify-content:flex-end;margin-top:10px}
.asb-search{min-width:240px}

/* ===== AI ビルド用テーブル（APIキー／パラメータ） ===== */
.asb-ai-key-table,
.asb-sb-param-table{
  width:100% !important;
  table-layout:fixed;
  border-collapse:collapse;
  border:none;
  font-size:inherit;
}
.asb-ai-key-table th,
.asb-ai-key-table td,
.asb-sb-param-table th,
.asb-sb-param-table td{
  padding:8px 0;
  vertical-align:middle;
  background:transparent;
  color:inherit;
  border:none;
  box-sizing:border-box;
}
/* 行の下線（最終行にも付与） */
.asb-ai-key-table tr > th,
.asb-ai-key-table tr > td,
.asb-sb-param-table tr > th,
.asb-sb-param-table tr > td{
  border-bottom:1px solid #dcdcdc;
}
/* APIキー行の左右比率 */
.asb-ai-key-table .td-input{width:65%}
.asb-ai-key-table .td-actions{
  width:35%;
  text-align:center;
  white-space:nowrap;
}
/* パラメータ側の不要な下余白を抑制 */
.asb-ai-key-table .td-input .asb-input{margin-bottom:0}
.asb-sb-param-table td:last-child .asb-input{margin-bottom:0}
#sb_theme.asb-input,#sb_extra_notes.asb-input{margin-bottom:0 !important}
/* パラメータテーブル：列幅%（colgroup と一致） */
.asb-sb-param-table td:first-child{width:28%}
.asb-sb-param-table td:last-child{width:72%}

/* ===== 問題ビルダー（表・横スクロール・モーダル） ===== */
.asb-scroll-x{
  overflow-x:auto;
  background:#fff;
  border-radius:8px;
  margin-top:8px;
  padding:8px;
}
.asb-builder-table{
  width:100%;
  min-width:1200px;
  border-collapse:collapse;
  font-size:inherit;
}
.asb-builder-table th,
.asb-builder-table td{
  border-bottom:1px solid #e5e5e5;
  padding:8px;
  vertical-align:middle;
  background:transparent;
  color:#111;
}

/* ===== モーダル ===== */
.asb-modal[aria-hidden="true"]{display:none}
.asb-modal[aria-hidden="false"]{display:block}
.asb-modal__overlay{ position:fixed; inset:0; background:rgba(0,0,0,.55); backdrop-filter:blur(2px); }
.asb-modal__content{
  position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);
  width:min(900px,90vw);max-height:90vh;overflow:auto;
  background:#0f1117;            /* ダークテーマ */
  color:#e6edf3;
  border:1px solid #464646;      /* ご指定のグレー */
  border-radius:12px;
  padding:16px;
  box-shadow:0 12px 40px rgba(0,0,0,.45);
}
.asb-modal__header{
  display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;
  border-bottom:1px solid #2a2f3a;
}
.asb-modal__close{
  background:#0f1117;
  color:#c8d1db;
  border:1px solid #464646;
  border-radius:10px;
  width:36px;height:36px;line-height:34px;text-align:center;font-size:18px;
  cursor:pointer;
  transition:background .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}
.asb-modal__close:hover{ background:#151922; color:#fff; border-color:#6a6a6a; }
.asb-modal__close:active{ transform:scale(0.98); }
.asb-modal__close:focus-visible{ outline:2px solid #3b82f6; outline-offset:2px; }

.asb-code-block{
  width:100%;
  min-height:420px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:13px;
  line-height:1.55;
  border:1px solid #464646;
  border-radius:10px;
  padding:12px 14px;
  box-sizing:border-box;
  background:#0b0e14;
  color:#e6edf3;
  caret-color:#8ab4f8;
  outline:none;
  resize:vertical;
}
/* スクロールバー */
.asb-code-block::-webkit-scrollbar{height:10px;width:10px}
.asb-code-block::-webkit-scrollbar-thumb{background:#2f3541;border-radius:8px;border:2px solid #0b0e14}
.asb-code-block::-webkit-scrollbar-thumb:hover{background:#3a4150}
.asb-code-block::-webkit-scrollbar-track{background:#0b0e14;border-radius:8px}

/* モーダル内ボタン（コントラスト） */
.asb-modal .asb-btn.-ghost{
  background:#0f1117;color:#e6edf3;border:1px solid #464646;
}
.asb-modal .asb-btn.-ghost:hover{ background:#151922; border-color:#6a6a6a; }
.asb-modal .asb-btn.-primary{
  background:#3b82f6;color:#fff;border:1px solid #2e6bd1;
}
.asb-modal .asb-btn.-primary:hover{ background:#2f6fe0; }

/* スクロール位置ジャンプ抑止（ブラウザのアンカー最適化対策） */
.asb-tabs { overflow-anchor: none; }
.asb-container { overflow-anchor: none; }

/* ===== 一覧ページ（実テーブル版） ===== */
/* ヘッダは既存の背景のまま（変更なし） */
.asb-card .asb-table thead th{
  padding:10px;
  border-bottom:1px solid #e5e5e5;
  text-align:left;
  vertical-align:middle;
  background:transparent;
}
/* 本体は白背景にする（要望） */
.asb-card .asb-table tbody td{
  padding:10px;
  border-bottom:1px solid #e5e5e5;
  vertical-align:middle;
  background:#fff;
  color:#111;
  box-sizing:border-box;
}
/* 幅ユーティリティ（見出しに指定された .asb-w64 / .asb-w120 を尊重） */
.asb-card .asb-table .asb-w64{  width:64px }
.asb-card .asb-table .asb-w120{ width:120px }

/* タイトル列は左寄せ固定（thead/tbody 両方） */
.asb-card .asb-table thead th:nth-child(2),
.asb-card .asb-table tbody td:nth-child(2){
  text-align:left !important;
}

/* 編集/削除列はセル内を中央寄せ＋ボタンは全幅に */
.asb-card .asb-table thead th:nth-child(3),
.asb-card .asb-table thead th:nth-child(4),
.asb-card .asb-table tbody td:nth-child(3),
.asb-card .asb-table tbody td:nth-child(4){
  text-align:center;
}
.asb-card .asb-table tbody td:nth-child(3) .asb-btn,
.asb-card .asb-table tbody td:nth-child(4) .asb-btn{
  display:block;
  width:100%;
  margin:0;
  white-space:nowrap;
}

/* 追加の幅ユーティリティ */
.asb-w64 { width:64px ;text-align: center;}
.asb-w100 { width:100px ;text-align: center;}
.asb-w140 { width:250px }
.asb-w280 { width:450px }

.asb-w80{width:80px}
.asb-w120{width:180px}
.asb-w160{width:160px}
.asb-builder-table input.asb-input{margin-bottom:0}

/* 角丸の単一ソース（必要なら数値だけ変えれば全体反映） */
:root{ --asb-radius: 10px; }

/* ボタンの基準角丸（アプリ作成ボタンを含む） */
.asb-btn{ border-radius: var(--asb-radius); }

/* タブボタンは見た目を asb-btn に委譲（角丸は継承） */
.asb-tab-btn{ border-radius: inherit; }

/* 念のため、a要素のタブ/ボタンも同じに */
.asb-tab-headers .asb-btn,
.asb-topbar .asb-btn{ border-radius: var(--asb-radius); }
a.asb-tab-btn{ border-radius: 10px; }

