/* ===== ZIPビルダー（フロント） 最小スタイル（整理版） ===== */

/* コンテナ／パンくず */
.main-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);
}
.main-breadcrumbs{ color:#666; margin:6px 0 12px; }
.main-breadcrumbs .sep{ margin:0 6px; color:#999; }
.main-breadcrumbs .current{ font-weight:600; }

/* カード（基準） */
.main-card{
  background:#c7c7c7;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:16px 16px 12px;
  margin:12px 0;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
}
.main-card table{ width:100% !important; }
.main-sec-title{ font-weight:600; margin-bottom:10px; color:#111; }

/* 入力 */
.main-input{
  width:100%;
  padding:8px 10px;
  border:1px solid #ddd;
  border-radius:8px;
  background:#fff;
  color:#111;
  box-sizing:border-box;
  font-size:inherit;
  line-height:1.4;
  margin:0;
}
.main-input--sm{ width:auto; padding:6px 8px; }

/* ボタン */
.main-btn{
  border:1px solid #d1d5db;
  border-radius:10px;
  padding:8px 12px;
  background:#f9fafb;
  font-size:inherit;
  line-height:1.2;
  white-space:nowrap;
  display:inline-block;
  color:#111;
  cursor:pointer;
  margin:0;
}
.main-btn.-primary{
  background:#111827;
  color:#fff;
  border-color:#111827;
  text-align:center;
}
.main-btn.-ghost{
  background:#ffffff;
  border-color:#d1d5db;
  color:#111;
}
.main-btn[disabled]{ cursor:not-allowed; opacity:.6; }

/* === 新規作成フォーム（ASB挙動の移植） === */
.main-form-table{
  width:100% !important;
  table-layout:fixed;
  border-collapse:collapse;
  border:none;
  font-size:inherit;
}
.main-form-table th,
.main-form-table td{
  padding:8px 0;
  vertical-align:middle;
  background:transparent;
  color:inherit;
  border:none;
  box-sizing:border-box;
}
/* 行の下線 */
.main-form-table tr > th,
.main-form-table tr > td{
  border-bottom:1px solid #dcdcdc;
}
/* 左右比率（65/35） */
.main-form-table .td-input{  width:65%; }
.main-form-table .td-actions{
  width:35%;
  text-align:center;
  white-space:nowrap;
}
/* “謎スペース”対策 */
.main-form-table .td-input .main-input{ margin-bottom:0; }
.main-form-table td:last-child .main-input{ margin-bottom:0; }
/* 最終行は下線オフで詰める */
.main-form-table tr:last-child > th,
.main-form-table tr:last-child > td{ border-bottom:none; }

/* 一覧ツールバー／ページング */
.main-list-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}
.main-pagination{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  margin-top:10px;
}
.main-page-info{ color:#333; }

/* 実テーブル（一覧） */
.main-table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
  font-size:inherit;
}
.main-table th,
.main-table td{
  border-bottom:1px solid #e5e5e5;
  padding:10px;
  vertical-align:middle;
  background:transparent;
  color:#111;
}

/* 幅ユーティリティ */
.main-w64  { width:64px;  text-align:center; }
.main-w120 { width:120px; text-align:center; }
.main-w200 { width:200px; }

/* タブ（単一パネル） */
.main-tab-panel{ display:none; }
.main-tab-panel.is-active{ display:block; }
.main-tab-btn{ border-radius:10px; }

/* ===== プロジェクト一覧テーブル：列比率/整形 ===== */
.main-card .main-table col.col-detail { width:14%; }
.main-card .main-table col.col-no     { width:14%; }
.main-card .main-table col.col-name   { width:44%; }
.main-card .main-table col.col-level  { width:14%; }
.main-card .main-table col.col-del    { width:14%; }

.main-card .main-table thead th {
  background: transparent;
  border-bottom: 1px solid #e5e5e5;
  vertical-align: middle;
}
.main-card .main-table tbody td {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  vertical-align: middle;
}

/* 名称列は左寄せ */
.main-card .main-table thead th.col-name,
.main-card .main-table tbody td.col-name {
  text-align: left !important;
}
/* その他は中央寄せ */
.main-card .main-table thead th:not(.col-name),
.main-card .main-table tbody td:not(.col-name) {
  text-align: center;
}

/* ========== ここから Editor（エディター画面）専用（置き換え） ========== */

/* 上部実測高さ（JSで更新） */
:root{
  --abs-editor-top: 0px;
  --abs-editor-bottom-gap: 0px; /* 下端余白が不要なら 0px のまま */
}

/* パネル：ビューポート残り高さ + 上下2%の余白は“パネルのパディング”で付与 */
#tab-simple,
#tab-advanced{
  box-sizing: border-box;
  padding-block: 2%;                     /* ← ここで上下2%を確実に確保（相殺されない） */
  padding-inline: 0;                      /* 横はフル（余白なし） */
  block-size: calc(100dvh - var(--abs-editor-top) - var(--abs-editor-bottom-gap));
  overflow: hidden;                       /* 外側にスクロールバーは出さない */
}

/* カード：幅100%・高さ100%・角丸＆中スクロール用の器 */
.main-card.-editor{
  width: 100%;                            /* 100vwはやめる（角丸が“見える”） */
  height: 100%;
  margin: 0;                              /* 余白はパネルが持つので0 */
  border-radius: 12px;
  overflow: hidden;                       /* 角丸を視覚化 */
  display: flex;
  flex-direction: column;
}

/* タイトルの下は少しだけ余白 */
.main-card.-editor .main-sec-title{ margin-bottom: 12px; }

/* 可変BOX：中身は常に縦横中央。溢れたらカード内スクロール */
.main-card.-editor .main-card-box{
  flex: 1 1 auto;
  min-height: 0;                          /* 子overflowの前提 */
  overflow: auto;                         /* ここでスクロール */
  -webkit-overflow-scrolling: touch;
  display: grid;
  place-items: center;                    /* 縦横中央 */
  background: transparent;                /* 背景なし（指定通り） */
  padding: 0;
  overflow-x: hidden;                     /* 横スクロール抑止 */
}

/* 実コンテンツ：横は100%、必要なら最大幅で制限 */
.main-card.-editor .main-card-box .main-content{
  width: 100%;
  max-width: 980px;                       /* 不要なら削除可 */
  box-sizing: border-box;
}

/* --- エディター補助（見た目はあなたの基準CSSに従う） --- */
.sb-top-tabs { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.sb-count { font-weight:600; }
.sb-tab-title { font-weight:600; }

.sb-steps { width:100%; }
.sb-step { display:none; }
.sb-step.is-active { display:block; }

.sb-head-row { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.sb-head-left { font-weight:600; }
.sb-head-right {}

.sb-form { display:flex; flex-direction:column; gap:10px; }
.sb-field {}
.sb-label { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.sb-required { background:#111827; color:#fff; border-radius:6px; padding:2px 6px; font-size:12px; }
.sb-counter { color:#333; }

.sb-actions { display:flex; justify-content:space-between; align-items:center; margin-top:12px; }
.sb-actions-left {}
.sb-actions-right { display:flex; gap:8px; }

/* ===== エディター：フォーム下の余白を殺す（一覧と同じ思想） ===== */
.sb-form { margin:0; }
.sb-form .main-input { margin:0; }              /* 入力要素の下マージンを殺す */
.sb-form .sb-field:last-child { margin-bottom:0; }
.sb-form .sb-field p { margin:0; }              /* テーマが差し込む <p> の下余白対策 */

/* 進む/戻る行の上マージンだけ最小限に */
.sb-actions { margin-top:8px; }
