/* アベイルシステムの無料ツールの共通の見た目。白地に紺、余白を広く、ツール本体を主役にする */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #5d6678;
  --line: #dde1e8;
  --accent: #23418f;
  --accent-ink: #ffffff;
  --accent-soft: #e8edf8;
  --ok: #1f7a4d;
  --warn: #9a5b00;
  --warn-soft: #fbf0dd;
  --bad: #b23a3a;
  --radius: 10px;
  --display: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --body: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151c; --surface: #1a1f29; --ink: #e6e9ef; --muted: #9aa3b4; --line: #2c3341;
    --accent: #8fa8ec; --accent-ink: #12151c; --accent-soft: #232c45;
    --ok: #6fcf9b; --warn: #e7b464; --warn-soft: #3a2c14; --bad: #ef8d8d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151c; --surface: #1a1f29; --ink: #e6e9ef; --muted: #9aa3b4; --line: #2c3341;
  --accent: #8fa8ec; --accent-ink: #12151c; --accent-soft: #232c45;
  --ok: #6fcf9b; --warn: #e7b464; --warn-soft: #3a2c14; --bad: #ef8d8d;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
}
a { color: var(--accent); }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* 頭の帯 */
.site-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-head .in {
  max-width: 960px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.site-head .brand { color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 700; line-height: 1.3; }
.site-head .brand small { display: block; color: var(--muted); font-family: var(--body); font-weight: 400; font-size: 12px; }
.site-head nav a { font-size: 14px; }

/* 本文 */
.page { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 20px; }
.page > * { min-width: 0; }
h1 { font-family: var(--display); font-weight: 900; font-size: clamp(24px, 5vw, 32px); line-height: 1.35; margin: 0; text-wrap: balance; }
h2 { font-family: var(--display); font-size: 19px; margin: 0 0 8px; }
h3 { font-size: 16px; margin: 0 0 6px; }
.lead { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }

/* ツール本体の囲み */
.tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 16px;
}
@media (max-width: 560px) { .tool { padding: 16px; } }
.local-note { margin: -8px 0 0; color: var(--muted); font-size: 13px; }
.badge-check {
  display: inline-block; border: 1px solid var(--warn); color: var(--warn); background: var(--warn-soft);
  border-radius: 999px; padding: 0 10px; font-size: 12px; font-weight: 700;
}

/* 入力 */
.field { display: grid; gap: 4px; }
.field > span, .field > label { font-size: 14px; font-weight: 700; }
.field .hint { font-size: 13px; color: var(--muted); font-weight: 400; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row > .field { flex: 1 1 160px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="email"], input[type="tel"], input:not([type]), select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; width: 100%; min-height: 44px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.choice { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.choice label { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); }

/* ボタン。塗りが基本、戻るや取り消しは枠だけ。枠の無いボタンは使わない */
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 18px; border-radius: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  text-decoration: none;
}
.btn.outline { background: var(--surface); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* 結果 */
.result {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  background: var(--accent-soft);
  display: grid; gap: 8px;
}
.big { font-family: var(--display); font-size: clamp(26px, 6vw, 36px); font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.ok { color: var(--ok); }
.small { font-size: 13px; }

/* 表 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.t th, table.t td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
table.t th { font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }
table.t td.num, table.t th.num { text-align: right; }

/* 状態の札。枠だけ */
.chip { display: inline-block; border: 1px solid currentColor; border-radius: 999px; padding: 0 10px; font-size: 12px; white-space: nowrap; }

/* 使い方と注意 */
.howto { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.howto p, .howto ul, .howto ol { margin: 0 0 8px; }
.howto ul, .howto ol { padding-left: 1.4em; }
.howto .src { font-size: 13px; color: var(--muted); }

/* つなぐ先 */
.connect {
  border: 1px solid var(--accent); border-radius: var(--radius); padding: 16px 20px; background: var(--surface);
  display: grid; gap: 8px;
}
.connect .kind { font-size: 12px; color: var(--muted); }
.connect h2 { margin: 0; font-size: 17px; }
.connect p { margin: 0; }

/* カード */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card {
  display: grid; gap: 4px; align-content: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; color: var(--ink); text-decoration: none;
}
.card:hover { border-color: var(--accent); }
.card b { font-size: 15px; line-height: 1.45; }
.card span { color: var(--muted); font-size: 13px; line-height: 1.55; }
.card .chip { justify-self: start; color: var(--accent); margin-bottom: 2px; }

/* 一覧の区画 */
.area { display: grid; gap: 14px; }
.area > h2 { font-size: 22px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.scene { display: grid; gap: 8px; }
.scene > h3 { font-size: 15px; color: var(--muted); margin: 0; }

/* 足元 */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); }
.site-foot .in { max-width: 960px; margin: 0 auto; padding: 20px 16px 28px; display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.site-foot .links { display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* 知らせ */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--surface); padding: 10px 18px; border-radius: 999px;
  font-size: 14px; z-index: 50; max-width: calc(100% - 32px);
}

/* 印刷。ツールの結果だけを紙に出す */
@media print {
  body { background: #fff; color: #000; }
  .site-head, .site-foot, .howto, .connect, .related, .local-note, .no-print, .lead, h1 { display: none !important; }
  .page { padding: 0; max-width: none; }
  .tool { border: 0; padding: 0; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
