/* ベース */
* { box-sizing: border-box; }
html { scroll-padding-top: 60px; scroll-behavior: smooth; }
body { font-family: 'Noto Sans JP', system-ui, -apple-system, Segoe UI, sans-serif; color:#333; margin:0; background:#f7faf7; }
a { color: inherit; text-decoration: none; }
ul { margin: .4rem 0 .8rem 1.2rem; }
hr { border: none; border-top: 1px solid #e2eee6; margin: 2rem 0; }
.container { width: min(1100px, 92%); margin: 0 auto; }
.title-row { display:flex; align-items:center; justify-content:space-between; gap:.75rem; flex-wrap:wrap; }
input::placeholder, textarea::placeholder { color:#aab5ad; }
::-webkit-input-placeholder { color:#aab5ad; }
::-moz-placeholder { color:#aab5ad; }
:-ms-input-placeholder { color:#aab5ad; }


/* テーマ（緑） */
:root{
  --c-main:#0f7a3a;
  --c-main-strong:#0c6831;
  --c-accent:#31c36a;
  --c-bg:#f7faf7;
  --c-th:#f1f7f1;
  --c-border:#d8e8db;
  --c-text:#1f2a1f;
  --c-err-bg:#ffe6f3;
  --c-err-border:#e0529e;
  --c-err-text:#b00059;
  --c-preview:#0a66c2;
}

.header { position: sticky; top: 0; z-index: 50; background: var(--c-main); color:#fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.header .container { padding: .9rem 0; }
.header h1 { margin: 0; font-size: clamp(1.05rem, 2vw, 1.25rem); font-weight: 700; letter-spacing: .02em; }

.site-content .container { padding: 1.2rem 0 3rem; }
.site-content h1 { margin: 1rem 0 1.2rem; font-size: 1.5rem; color: var(--c-main); }

.information { background: #fff; border: 1px solid var(--c-border); border-radius: 8px; padding: 1rem 1.2rem; margin: 1rem 0 1.2rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.information .warning { margin: 0 0 .6rem; color: #a25800; font-weight: 700; }
.policy-box { background: #fafdfa; border: 1px solid #e1f0e5; border-radius: 6px; padding: .6rem .8rem; }
.policy-btn { margin-top: .6rem; }

.form h2 { font-size: 1.18rem; color: var(--c-main); margin: .2rem 0 .8rem; }
.caution .warning { color:#a25800; }

.table { width: 100%; border-collapse: collapse; background:#fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.table.is-bordered th, .table.is-bordered td { border: 1px solid var(--c-border); vertical-align: top; }
.table th { width: 300px; background: var(--c-th); text-align: left; padding: .75rem .85rem; font-weight: 700; color: var(--c-text); }
.table td { padding: .75rem .85rem; }
.table .eg { margin:.25rem 0 0 1rem; color:#666; font-size: .92rem; }

.required { color:#d62828; margin-left: .25rem; }
.small { color:#666; font-size:.9rem; }

.input { width: 100%; padding: .55rem .6rem; border: 1px solid #bcd7c3; border-radius: 6px; font-size: 1rem; background:#fff; }
.input:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px color-mix(in hsl, var(--c-accent) 40%, transparent); }
.input.is-10pct{ width:10%; } .input.is-30pct{ width:30%; } .input.is-50pct{ width:50%; }
.mt4 { margin-top: .4rem; }

.select select { appearance:none; -webkit-appearance:none; width: 220px; padding:.5rem .6rem; border:1px solid #bcd7c3; border-radius: 6px; background:#fff; font-size:1rem; }
.select select:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px color-mix(in hsl, var(--c-accent) 40%, transparent); }

.flex-ai-center { display:flex; gap:.6rem; align-items:center; flex-wrap: wrap; }
.checkbox-col label { display: inline-block; margin-bottom: .3rem; }

/* セクション右上/下ツール */
.section-tools { display:flex; flex-direction:column; gap:.5rem; margin:.35rem 0 .6rem; }
.copy-group { display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; }
.mini-btn { font-size:.86rem; padding:.35rem .6rem; border:1px solid var(--c-border); color:var(--c-main); background:#fff; border-radius:8px; cursor:pointer; display:inline-block; }
.mini-btn:hover { border-color: var(--c-main); }
.copy-previews { display:grid; gap:.25rem .75rem; }
.copy-previews.two-col { grid-template-columns: 1fr 1fr; }
.copy-preview { font-size:.9rem; color: var(--c-preview); padding:.35rem .5rem; background:#fff; border:1px dashed var(--c-border); border-radius:8px; }
.copy-preview.hl { border-color: var(--c-main); background:#f0fbf3; }

/* ボタン群 */
.field.is-grouped.is-grouped-centered { text-align: center; margin-top: 1.2rem; }
.button { border:none; border-radius: 8px; padding:.75rem 1.3rem; font-weight:700; cursor:pointer; }
.button.control { background: var(--c-main); color:#fff; }
.button.control:hover { background: var(--c-main-strong); }
.button.primary { background: #0aa04f; color:#fff; }
.button.primary:hover { background:#098a45; }
.button.ghost { background:#fff; border:1px solid var(--c-border); color: var(--c-main); }
.button.ghost:hover { border-color: var(--c-main); }
.button.debug { background:#ffd24d; color:#533f03; }
.button.debug:hover { background:#ffc21a; }
.button.danger { background:#e54848; color:#fff; }
.button.danger:hover { background:#cc3f3f; }

.debug-panel { display:flex; align-items:center; gap:.5rem; }
.debug-note { color:#6b5e00; }
.clearall-panel { margin-left:auto; }

/* 発表者 学年入力の「年」サフィックス */
.grade-cell { display:flex; align-items:center; gap:.35rem; }
.input.grade-num { width: 2ch; text-align:center; }
.suffix { color:#666; }

.grade-hint-row { margin-top:.35rem; }

/* フッター */
footer { padding: 1.5rem 0; color:#777; text-align: center; }
.display_error { display:none; color:#b00020; font-weight:700; margin-bottom: .6rem; }

/* エラー（セル単位） */
.has-error { background: var(--c-err-bg); }
.field-error { color: var(--c-err-text); margin-top: .35rem; font-size: .92rem; }
.input.error, .select.error select { border-color: var(--c-err-border); }

/* サマリー表示（確認/サンクス共通） */
.summary-card { background:#fff; border:1px solid var(--c-border); border-radius:10px; padding:1rem; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.summary-card h3 { margin:.6rem 0; font-size:1.05rem; color:var(--c-main-strong); }
.summary-grid { display:grid; grid-template-columns: 220px 1fr; gap:.35rem .6rem; }
.summary-grid .key { background:var(--c-th); padding:.4rem .6rem; border-radius:6px; }
.summary-grid .val { padding:.4rem .6rem; border-radius:6px; }
.review-actions { display:flex; gap:.5rem; flex-wrap:wrap; }

/* モバイル */
@media (max-width: 800px) {
  .table th { width: 100%; display:block; border-bottom: none; }
  .table td { display:block; border-top: none; }
  /* 発表者テーブルだけは横並びを維持（縦積みしない） */
  #presentersTable { display: table; table-layout: fixed; width: 100%; }
  #presentersTable th, #presentersTable td { display: table-cell !important; }
  .table-wrap { overflow-x: auto; scrollbar-gutter: stable both-edges;}
  
}

/* 印刷 */
@media print {
  .summary-grid { grid-template-columns: 220px 1fr !important; }
}

/* ========== 印刷補助 ========== */
.print-only { display: none; }

@media print {
  /* 背景や余計なUIを消す */
  body { background: #fff !important; }
  .header,           /* 追従ヘッダ */
  .title-row,        /* ページ上部の「応募申込」＋デバッグなど */
  .review-actions,   /* 確認画面のボタン群（修正・送信・印刷） */
  .debug-panel,      /* デバッグUI */
  .clearall-panel,   /* すべて削除ボタン */
  .section-tools,    /* セクション右側の小ボタン群（コピー等） */
  #thanksView .information  /* 確認画面の見出しとリード文 */
  { display: none !important; }

  /* 印刷専用ヘッダを出す */
  .print-only { display: block !important; margin: 0 0 1rem; }
  .print-title { font-weight: 700; font-size: 1.05rem; }
  .print-status.chip {
    display: inline-block; margin-left: .6rem;
    padding: .15rem .6rem; border: 1px solid #aaa; border-radius: 999px;
    font-size: .85rem;
  }

  /* サマリーの2カラムを維持（項目左・内容右） */
  .summary-grid { grid-template-columns: 220px 1fr !important; }
}

/* ========== 発表者テーブルの横スクロール保証 ========== */
.table-wrap { overflow-x: scroll; scrollbar-gutter: stable both-edges; }
#presentersTable {
  min-width: 980px;          /* これ以下には潰れない → 横スクロールに逃がす */
  table-layout: auto;
}

#presentersTable .input { min-width: 9rem; }
#presentersTable .grade-num { min-width: 0; width: 3ch; text-align: center; }
#presentersTable th:nth-child(5),
#presentersTable td:nth-child(5) { width: 6rem; }
/* 発表者テーブル（列幅の微調整） */
/* #  氏名  カナ  学校名  学年  性別  操作 */
#presentersTable th:nth-child(2), #presentersTable td:nth-child(2) { min-width: 6rem; }  /* 氏名 少し狭く */
#presentersTable th:nth-child(3), #presentersTable td:nth-child(3) { min-width: 9rem; }  /* カナ 少し狭く */
#presentersTable th:nth-child(5), #presentersTable td:nth-child(5) { width: 4.5rem; text-align:center; } /* 学年 さらに狭く */
#presentersTable th:nth-child(6), #presentersTable td:nth-child(6) { min-width: 6.5rem; } /* 性別 少し広く */
#presentersTable th:nth-child(7), #presentersTable td:nth-child(7) { min-width: 6.5rem; } /* 操作 少し広く */

::placeholder { color: #cbd3cf; opacity: 1; }
::-ms-input-placeholder { color: #cbd3cf; }
:-ms-input-placeholder  { color: #cbd3cf; }