/* 享栄OB・OG会 名簿チェック — 色は支援サイト（kyoei.pages.dev）と同じ紺と金 */
:root {
  --navy: #0b1f3f;
  --navy-2: #14305c;
  --gold: #c9a24a;
  --gold-2: #e2c46f;
  --ink: #14141f;
  --muted: #5b6272;
  --line: #e6e8f0;
  --bg: #f7f8fc;
  --tint: #eef2f8;
  --card: #fff;

  --ok: #0b7d3e;
  --ok-bg: #e7f5ec;
  --cand: #9a6a00;
  --cand-bg: #fdf4dc;
  --ng: #b42318;
  --ng-bg: #fdecea;

  --r: 12px;
  --r-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- 見出し ---------- */
.site-head {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 28px 0 56px;
  border-bottom: 4px solid var(--gold);
}
.eyebrow { color: var(--gold-2); font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.site-head h1 { font-size: 30px; font-weight: 700; line-height: 1.3; margin: 4px 0 8px; }
.lead { font-size: 15px; opacity: .92; }
.safe {
  display: inline-block; margin-top: 12px; font-size: 13px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
  padding: 4px 12px; border-radius: 999px;
}

main.wrap { margin-top: -32px; }

/* ---------- タブ ---------- */
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: var(--card); padding: 6px; border-radius: var(--r);
  box-shadow: 0 4px 16px rgba(11,31,63,.10);
  margin-bottom: 20px;
}
.tab {
  font: inherit; border: 0; background: transparent; cursor: pointer;
  padding: 10px 12px; border-radius: var(--r-sm); text-align: center;
  color: var(--muted); display: flex; flex-direction: column; gap: 0;
}
.tab-main { font-weight: 700; font-size: 16px; }
.tab-sub { font-size: 12px; }
.tab:hover { background: var(--tint); }
.tab.is-on { background: var(--navy); color: #fff; }
.tab.is-on .tab-sub { color: var(--gold-2); }

.panel { display: none; }
.panel.is-on { display: block; }

/* ---------- 入力の箱 ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; min-width: 0;
}
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.box h2, .box h3 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.box h3 { font-size: 15px; }
.num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none;
  border-radius: 50%; background: var(--gold); color: var(--navy); font-size: 14px; font-weight: 700;
}
.count { font-size: 14px; font-weight: 700; color: var(--navy); background: var(--tint); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.hint { font-size: 14px; color: var(--muted); margin-bottom: 10px; }

textarea {
  width: 100%; height: 220px; resize: vertical;
  font: inherit; font-size: 16px; line-height: 1.6;
  padding: 10px 12px; border: 1px solid #cfd4e0; border-radius: var(--r-sm);
  background: #fff; color: var(--ink);
}
textarea:focus { outline: 3px solid rgba(201,162,74,.35); border-color: var(--gold); }
textarea[readonly] { background: var(--tint); }

.readout { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; }
.readout .ok { color: var(--ok); font-weight: 700; }
.readout .note { color: var(--muted); }
.readout details.warn { color: var(--cand); width: 100%; }
.readout summary { cursor: pointer; font-weight: 700; }
.readout ul { margin: 6px 0 0 18px; color: var(--ink); }
.readout li.more { color: var(--muted); list-style: none; }

/* ---------- オプションとボタン ---------- */
.opts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 16px 2px; }
.opt { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; cursor: pointer; }
.opt input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--navy); flex: none; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: var(--r-sm);
  padding: 12px 20px; font-size: 16px; border: 1px solid transparent; line-height: 1.2;
}
.btn-main { background: var(--navy); color: #fff; min-width: 180px; box-shadow: 0 2px 0 var(--gold); }
.btn-main:hover { background: var(--navy-2); }
.btn-sub { background: #fff; color: var(--navy); border-color: #c6cddd; }
.btn-sub:hover { background: var(--tint); }
.btn-ghost { background: transparent; color: var(--muted); padding-left: 8px; padding-right: 8px; text-decoration: underline; text-underline-offset: 3px; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn:focus-visible, .tab:focus-visible, .chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.kbd-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- 結果 ---------- */
.result { margin-top: 28px; scroll-margin-top: 16px; }
.result-title { font-size: 18px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }

.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.chip {
  font: inherit; cursor: pointer; text-align: left;
  background: #fff; border: 2px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px;
}
.chip-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.chip-num { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--navy); }
.chip-match .chip-num { color: var(--ok); }
.chip-cand .chip-num { color: var(--cand); }
.chip-none .chip-num { color: var(--ng); }
.chip.is-on { border-color: var(--navy); background: var(--tint); }

.result-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.sort { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sort select { font: inherit; font-size: 15px; padding: 6px 10px; border: 1px solid #c6cddd; border-radius: var(--r-sm); background: #fff; color: var(--ink); }
.result-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { background: var(--navy); color: #fff; font-weight: 700; font-size: 13px; text-align: left; padding: 10px 12px; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl .c-no { width: 56px; color: var(--muted); text-align: right; }
.tbl .c-name { font-weight: 700; white-space: nowrap; }
.tbl .c-judge { white-space: nowrap; }
.tbl .c-year { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .c-note { color: var(--muted); font-size: 13px; min-width: 180px; }
.tbl .m-note { display: none; }
.tbl tr.row-none td { background: #fffafa; }
.tbl td.empty { text-align: center; color: var(--muted); padding: 24px; }

.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.badge-match { color: var(--ok); background: var(--ok-bg); }
.badge-cand { color: var(--cand); background: var(--cand-bg); }
.badge-none { color: var(--ng); background: var(--ng-bg); }
.legend { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* 重なり */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.stat-num { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.stat-warn .stat-num { color: var(--ng); }
.box-warn { border-color: #f3c7c2; background: #fffafa; }
.dupe-list { list-style: none; max-height: 320px; overflow: auto; }
.dupe-list li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.dupe-list li:first-child { border-top: 0; }
.dupe-list .times { color: var(--ng); font-weight: 700; }
.dupe-list .where { font-size: 13px; color: var(--muted); width: 100%; }
.dupe-list .empty { color: var(--muted); }
#roster-clean { height: 260px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding-top: 40px; padding-bottom: 40px; }

/* ---------- お知らせ ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 12px 16px; border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(0,0,0,.2); display: flex; gap: 16px; align-items: center;
  font-size: 15px; z-index: 10; max-width: calc(100% - 32px);
}
.toast[hidden] { display: none; }
.toast button { font: inherit; font-weight: 700; color: var(--gold-2); background: none; border: 0; cursor: pointer; white-space: nowrap; text-decoration: underline; }

/* ---------- スマホ ---------- */
@media (max-width: 720px) {
  .site-head { padding: 20px 0 48px; }
  .site-head h1 { font-size: 24px; }
  .grid2 { grid-template-columns: 1fr; }
  textarea { height: 170px; }
  .chips { grid-template-columns: 1fr 1fr; }
  .btn-main { flex: 1 1 100%; }
  .kbd-hint { display: none; }
  .tab-sub { display: none; }
  .tbl .c-no, .tbl .c-note, .tbl th:last-child { display: none; }
  .tbl .c-name { white-space: normal; }
  .tbl .m-note { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 2px; }
}
