/* ============================================================
   名簿 重複チェック — style.css
   LPのデザイントークンを使用。フォントはセルフホスト（外部CDN不使用）。
   ============================================================ */

/* ------------------------------------------------------------
   フォント（セルフホスト / オフライン動作）
   - unicode-range で欧文/和文を分割し必要分のみ読み込む
   - font-display:swap で未取得時はシステムフォントにフォールバック
   - ライセンス: SIL OFL 1.1（fonts/OFL-*.txt, fonts/README.txt 参照）
   ------------------------------------------------------------ */
@font-face{
  font-family:'Shippori Mincho'; font-style:normal; font-weight:700; font-display:swap;
  src:url('fonts/shippori-mincho-latin-700.woff2') format('woff2');
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face{
  font-family:'Shippori Mincho'; font-style:normal; font-weight:700; font-display:swap;
  src:url('fonts/shippori-mincho-japanese-700.woff2') format('woff2');
  unicode-range:U+3000-303F, U+3040-309F, U+30A0-30FF, U+FF00-FFEF, U+4E00-9FFF, U+3400-4DBF;
}
@font-face{
  font-family:'Zen Kaku Gothic New'; font-style:normal; font-weight:400; font-display:swap;
  src:url('fonts/zen-kaku-gothic-new-latin-400.woff2') format('woff2');
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face{
  font-family:'Zen Kaku Gothic New'; font-style:normal; font-weight:400; font-display:swap;
  src:url('fonts/zen-kaku-gothic-new-japanese-400.woff2') format('woff2');
  unicode-range:U+3000-303F, U+3040-309F, U+30A0-30FF, U+FF00-FFEF, U+4E00-9FFF, U+3400-4DBF;
}
@font-face{
  font-family:'Zen Kaku Gothic New'; font-style:normal; font-weight:700; font-display:swap;
  src:url('fonts/zen-kaku-gothic-new-latin-700.woff2') format('woff2');
  unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face{
  font-family:'Zen Kaku Gothic New'; font-style:normal; font-weight:700; font-display:swap;
  src:url('fonts/zen-kaku-gothic-new-japanese-700.woff2') format('woff2');
  unicode-range:U+3000-303F, U+3040-309F, U+30A0-30FF, U+FF00-FFEF, U+4E00-9FFF, U+3400-4DBF;
}

:root{
  --navy:#0f2540;
  --gold:#c9a449;
  --paper:#f7f5f0;
  --ink:#1a1f28;
  --gray:#5a6677;
  --line:#dcd6c9;
  --white:#ffffff;

  --gold-soft:#fbf4df;   /* 重複ハイライト背景 */
  --radius:6px;
  --shadow:0 1px 3px rgba(15,37,64,.08), 0 6px 18px rgba(15,37,64,.06);

  --font-head:'Shippori Mincho', "Yu Mincho", "游明朝", serif;
  --font-body:'Zen Kaku Gothic New', "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family:var(--font-body);
  color:var(--ink);
  background:var(--paper);
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
}

/* ---------- ヘッダー ---------- */
.site-header{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; flex-wrap:wrap;
  padding:14px 24px;
  background:var(--navy); color:var(--white);
}
.brand{ display:flex; align-items:center; gap:14px; }
.brand-logo{ font-weight:700; letter-spacing:.12em; font-size:1.05rem; }
.brand-divider{ width:1px; height:20px; background:var(--gold); display:inline-block; }
.brand-tool{ font-family:var(--font-head); font-weight:700; font-size:1.1rem; margin:0; }
.back-link{
  color:var(--white); text-decoration:none; font-size:.9rem; opacity:.9;
  border-bottom:1px solid transparent; transition:border-color .15s, opacity .15s;
}
.back-link:hover{ opacity:1; border-bottom-color:var(--gold); }

/* ---------- レイアウト ---------- */
.layout{
  max-width:1280px; margin:24px auto; padding:0 20px;
  display:grid; grid-template-columns:minmax(340px, 460px) 1fr; gap:24px; align-items:start;
}
@media (max-width:920px){ .layout{ grid-template-columns:1fr; } }

.panel{
  background:var(--white); border:1px solid var(--line);
  border-radius:var(--radius); box-shadow:var(--shadow); padding:20px;
}
.input-panel{ position:sticky; top:16px; }
@media (max-width:920px){ .input-panel{ position:static; } }

/* ---------- セクションラベル ---------- */
.section-label{
  font-family:var(--font-head); font-size:1.05rem; font-weight:700;
  color:var(--navy); margin:0 0 14px; padding-left:12px; position:relative;
}
.section-label::before{
  content:""; position:absolute; left:0; top:.15em; bottom:.15em;
  width:3px; background:var(--gold); border-radius:2px;
}

/* ---------- 入力欄 ---------- */
.field-label{ display:block; font-weight:700; font-size:.92rem; margin-bottom:4px; }
.field-help{ font-size:.8rem; color:var(--gray); margin:0 0 8px; }
.entries{
  width:100%; resize:vertical; min-height:150px; padding:12px;
  border:1px solid var(--line); border-radius:var(--radius);
  font-family:ui-monospace, "Consolas", monospace; font-size:.88rem; line-height:1.6;
  color:var(--ink); background:#fff;
}
.entries:focus{ outline:2px solid var(--navy); outline-offset:1px; border-color:var(--navy); }

.row-controls{ margin:10px 0; }

/* ---------- ファイルゾーン ---------- */
.file-zone{
  margin:6px 0 4px; padding:16px; text-align:center; cursor:pointer;
  border:1.5px dashed var(--line); border-radius:var(--radius);
  background:var(--paper); transition:border-color .15s, background .15s;
  display:flex; flex-direction:column; gap:3px;
}
.file-zone:hover, .file-zone:focus-visible, .file-zone.is-drag{
  border-color:var(--navy); background:#fff; outline:none;
}
.file-zone-text{ font-size:.88rem; font-weight:700; color:var(--navy); }
.file-zone-sub{ font-size:.75rem; color:var(--gray); }
.enc-info{ font-size:.8rem; color:var(--gray); margin:6px 0 0; min-height:1.1em; }
.enc-info.is-warn{ color:#a05a00; font-weight:700; }

/* ---------- ボタン ---------- */
.actions{ display:flex; flex-wrap:wrap; gap:10px; margin:14px 0 6px; }
.btn{
  font-family:inherit; font-size:.92rem; font-weight:700; padding:10px 18px;
  border-radius:var(--radius); border:1px solid var(--navy);
  background:#fff; color:var(--navy); cursor:pointer;
  transition:background .12s, color .12s;
}
.btn:hover{ background:var(--paper); }
.btn:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }
.btn-primary{ background:var(--navy); color:var(--white); }
.btn-primary:hover{ background:#163056; }
.btn-ghost{ border-color:var(--line); color:var(--gray); }
.btn-ghost:hover{ background:var(--paper); color:var(--ink); }
.btn-sm{ padding:7px 12px; font-size:.84rem; }

/* ---------- オプション群 ---------- */
.opt-group{
  border:1px solid var(--line); border-radius:var(--radius);
  padding:10px 14px 12px; margin:14px 0 0;
}
.opt-legend{ font-size:.82rem; font-weight:700; color:var(--gray); padding:0 6px; }
.checks{ display:flex; flex-direction:column; gap:7px; }
.checks-inline{ display:flex; flex-wrap:wrap; gap:8px 16px; }
.check{ display:flex; align-items:center; gap:7px; font-size:.86rem; cursor:pointer; }
.check input{ width:16px; height:16px; accent-color:var(--navy); }
.muted{ color:var(--gray); font-size:.92em; }

.match-note{
  font-size:.82rem; color:var(--gray); margin:12px 0 0;
  background:var(--paper); border:1px solid var(--line);
  border-radius:var(--radius); padding:8px 12px;
}
.match-note strong{ color:var(--ink); }

.count-info{ font-size:.85rem; color:var(--gray); margin:10px 0 0; min-height:1.2em; }
.count-info.has-warn{ color:#a05a00; font-weight:700; }
.privacy-note{ font-size:.8rem; color:var(--gray); margin:8px 0 0; }
.privacy-note strong{ color:var(--ink); }

/* ---------- 結果 ---------- */
.result-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; flex-wrap:wrap;
}
.export-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.keep-select{ font-size:.82rem; color:var(--gray); }
.select-sm{
  font-family:inherit; font-size:.84rem; padding:5px 6px;
  border:1px solid var(--line); border-radius:var(--radius); background:#fff;
}

.summary{
  display:grid; grid-template-columns:repeat(4, 1fr); gap:12px;
  margin:8px 0 18px;
}
@media (max-width:560px){ .summary{ grid-template-columns:repeat(2,1fr); } }
.stat{
  border:1px solid var(--line); border-radius:var(--radius);
  padding:12px; text-align:center; background:var(--paper);
}
.stat-num{ font-family:var(--font-head); font-size:1.5rem; font-weight:700; color:var(--navy); line-height:1.2; }
.stat-num.accent{ color:#b07d00; }
.stat-label{ font-size:.78rem; color:var(--gray); margin-top:2px; }

.summary-line{
  grid-column:1 / -1; text-align:center; font-size:.95rem;
  color:var(--ink); background:var(--gold-soft);
  border:1px solid var(--gold); border-radius:var(--radius); padding:10px;
}
.summary-line.none{ background:#eef5ee; border-color:#bcd9bc; color:#2f6b2f; }

/* 重複グループ */
.groups{ display:flex; flex-direction:column; gap:14px; }
.group-card{
  border:1px solid var(--line); border-left:4px solid var(--gold);
  border-radius:var(--radius); background:var(--gold-soft); overflow:hidden;
}
.group-head{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:8px 12px; background:rgba(201,164,73,.16);
  border-bottom:1px solid var(--line);
}
.group-title{ font-weight:700; font-size:.9rem; color:var(--navy); }
.group-count{ font-size:.8rem; color:var(--gray); }
.tags{ display:flex; gap:6px; flex-wrap:wrap; margin-left:auto; }
.tag{
  font-size:.72rem; font-weight:700; color:#7a5b00;
  background:#fff; border:1px solid var(--gold);
  border-radius:999px; padding:2px 9px;
}
.group-table{ width:100%; border-collapse:collapse; background:#fff; }
.group-table th, .group-table td{
  text-align:left; font-size:.84rem; padding:6px 10px;
  border-bottom:1px solid var(--line); vertical-align:top;
}
.group-table th{ color:var(--gray); font-weight:700; font-size:.76rem; background:var(--paper); }
.group-table td.key-col{ font-weight:700; }
.group-table tr:last-child td{ border-bottom:0; }
.row-no{ color:var(--gray); width:3em; }

.empty-state{ color:var(--gray); font-size:.9rem; text-align:center; padding:40px 12px; }

/* ---------- フッター ---------- */
.site-footer{
  max-width:1280px; margin:8px auto 28px; padding:16px 20px 0;
  border-top:1px solid var(--line); color:var(--gray); font-size:.82rem; text-align:center;
}
.site-footer p{ margin:4px 0; }

/* ---------- スマホ ---------- */
@media (max-width:380px){
  .actions .btn{ flex:1 1 auto; }
  .summary{ grid-template-columns:repeat(2,1fr); }
  .group-table th:nth-child(n+4), .group-table td:nth-child(n+4){ display:none; }
}
