:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --text: #1f2a24;
  --muted: #5d6a63;
  --line: #dfe4de;
  --accent: #2f6f4f;
  --accent-soft: #e4f0e9;
  --warn: #8a5a00;
  --warn-soft: #fff3d6;
  --danger: #9a2b2b;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141916;
    --surface: #1d241f;
    --text: #e8eee9;
    --muted: #a3b0a8;
    --line: #313c35;
    --accent: #6fc496;
    --accent-soft: #223a2e;
    --warn: #f0c36a;
    --warn-soft: #3a2f14;
    --danger: #ef8a8a;
  }
}
:root[data-theme="dark"] {
  --bg: #141916; --surface: #1d241f; --text: #e8eee9; --muted: #a3b0a8; --line: #313c35;
  --accent: #6fc496; --accent-soft: #223a2e; --warn: #f0c36a; --warn-soft: #3a2f14; --danger: #ef8a8a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  line-height: 1.75; font-size: 16px;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
header.site .wrap { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; padding-top: 10px; padding-bottom: 10px; }
header.site a { color: var(--text); text-decoration: none; font-size: 14px; padding: 4px 0; }
header.site a.brand { font-weight: 700; margin-right: auto; }
header.site a:hover { color: var(--accent); }
main { padding: 24px 0 48px; }
h1 { font-size: 24px; line-height: 1.4; margin: 8px 0 8px; }
h2 { font-size: 18px; margin: 32px 0 10px; }
h3 { font-size: 16px; margin: 20px 0 6px; }
p { margin: 8px 0; }
.lead { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.cols2 { grid-template-columns: 1fr 1fr; } }
label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 4px; }
label small { font-weight: 400; color: var(--muted); }
input[type=number], input[type=text], select {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.check { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0; font-size: 15px; font-weight: 400; }
.check input { margin-top: 5px; }
button.primary {
  margin-top: 18px; width: 100%; font: inherit; font-weight: 700; padding: 12px; border: 0; border-radius: 8px;
  background: var(--accent); color: #fff; cursor: pointer;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) button.primary { color: #0e1511; } }
.result { margin-top: 8px; }
.big { font-size: 28px; font-weight: 800; letter-spacing: 0.01em; line-height: 1.3; }
.big small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: middle; }
.note { background: var(--warn-soft); color: var(--text); border-left: 4px solid var(--warn); padding: 10px 12px; border-radius: 6px; font-size: 14px; margin: 14px 0; }
.err { color: var(--danger); font-weight: 600; }
.compare { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare .col { border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.compare .col.mine { border-color: var(--accent); background: var(--accent-soft); }
.compare h3 { margin-top: 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 600; color: var(--muted); }
tr.hit td { background: var(--accent-soft); font-weight: 700; }
.scroll { overflow-x: auto; }
ul.src { font-size: 13px; color: var(--muted); padding-left: 20px; }
ul.src a { color: var(--accent); word-break: break-all; }
footer.site { border-top: 1px solid var(--line); padding: 20px 0 40px; font-size: 13px; color: var(--muted); }
.tools { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.tools a { display: block; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tools a:hover { border-color: var(--accent); }
.tools strong { display: block; font-size: 17px; margin-bottom: 2px; }
.tools span { color: var(--muted); font-size: 14px; }
