/* ================================================
   共通スタイル — 全ツールで使い回す
   仕事中に開いて使う道具なので、落ち着いた見た目・
   高い可読性・印刷しやすさを優先する
   ================================================ */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #d9dde3;
  --text: #1a1d21;
  --text-muted: #5c6470;
  --accent: #1c5d99;
  --accent-hover: #164a7a;
  --accent-soft: #e8f0f8;
  --danger: #b3261e;
  --ok: #1e6f3f;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --wrap: 1000px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1c2024;
    --surface-2: #23282d;
    --border: #363c43;
    --text: #e6e9ec;
    --text-muted: #9aa3ad;
    --accent: #6fa8dc;
    --accent-hover: #8dbde8;
    --accent-soft: #1e2a36;
    --danger: #e2857f;
    --ok: #7bc496;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.2);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans",
               "Noto Sans JP", "Yu Gothic UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- ヘッダー ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-mark { font-size: 1.2rem; }

.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .92rem;
}
.header-nav a:hover { color: var(--accent); }

/* ---------- 見出し ---------- */

h1 {
  font-size: 1.75rem;
  line-height: 1.4;
  margin: 32px 0 8px;
  letter-spacing: .01em;
}

h2 {
  font-size: 1.25rem;
  margin: 40px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 { font-size: 1.05rem; margin: 24px 0 8px; }

.lead {
  color: var(--text-muted);
  margin: 0 0 28px;
  font-size: 1.02rem;
}

/* ---------- カード（ツール本体の枠） ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 0 0 24px;
}

.card-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
}

/* ---------- フォーム ---------- */

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field .hint {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

input[type="text"], input[type="number"], input[type="date"],
input[type="email"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .92rem;
}
.checkline input { width: 17px; height: 17px; accent-color: var(--accent); }

/* ---------- ボタン ---------- */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

button, .btn {
  font: inherit;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); }

button.primary, .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button.primary:hover, .btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表 ---------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table { border-collapse: collapse; width: 100%; font-size: .92rem; }

th, td {
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
}

thead th {
  background: var(--surface-2);
  font-weight: 700;
  position: sticky;
  top: 0;
}

tbody tr:hover { background: var(--accent-soft); }

/* ---------- 通知 ---------- */

.notice {
  padding: 12px 16px;
  border-radius: 6px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  font-size: .92rem;
  margin: 16px 0;
}
.notice.warn { border-left-color: var(--danger); }
.notice.ok   { border-left-color: var(--ok); }

/* ---------- ツール一覧 ---------- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0 40px;
  padding: 0;
  list-style: none;
}

.tool-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.tool-card .tc-cat {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent);
  text-transform: uppercase;
}
.tool-card .tc-name { font-size: 1.05rem; font-weight: 700; margin: 6px 0; }
.tool-card .tc-desc { font-size: .88rem; color: var(--text-muted); line-height: 1.6; margin: 0; }

/* ---------- 関連ツール ---------- */

.related {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 48px;
}
.related h2 { border: 0; margin: 0 0 16px; font-size: 1.1rem; }

/* ---------- 広告枠（Phase 2 まで空） ---------- */

.ad-slot { margin: 32px 0; min-height: 0; }

/* ---------- フッター ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 0;
  margin-top: 48px;
  font-size: .88rem;
  color: var(--text-muted);
}
.footer-brand { font-weight: 700; color: var(--text); margin: 0 0 4px; }
.footer-note { margin: 0 0 12px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.footer-nav a { color: var(--text-muted); }
.footer-copy { margin: 0; font-size: .8rem; }

a { color: var(--accent); }

/* ---------- 印刷 ---------- */

@media print {
  .site-header, .site-footer, .related, .btn-row, .ad-slot,
  .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .table-scroll { border: 0; overflow: visible; }
  th, td { border: 1px solid #999; padding: 4px 6px; }
  thead th { background: #eee !important; -webkit-print-color-adjust: exact; }
  @page { margin: 12mm; }
}

/* ---------- スマホ ---------- */

@media (max-width: 600px) {
  body { font-size: 15px; }
  h1 { font-size: 1.4rem; margin-top: 24px; }
  .card { padding: 16px; }
  .wrap { padding: 0 14px; }
  .btn-row button, .btn-row .btn { flex: 1 1 auto; text-align: center; }
}
