:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #6c5ce7;
  --accent-dark: #5443d4;
  --border: #e3e5ee;
  --ok: #16a34a;
  --warn: #d97706;
  --link: #4b3fcf;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161d;
    --card: #1e212b;
    --text: #e8eaf1;
    --muted: #9aa1b2;
    --border: #2f3342;
    --link: #a99cff;
  }
}
* { box-sizing: border-box; }
a { color: var(--link); }
a:hover { text-decoration: none; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
header.site {
  background: var(--accent);
  color: #fff;
  padding: 14px 16px;
}
header.site .inner, main, footer { max-width: 760px; margin: 0 auto; }
header.site a { color: #fff; text-decoration: none; font-weight: 700; }
header.site nav { margin-top: 4px; font-size: 14px; }
header.site nav a { font-weight: 400; margin-right: 14px; opacity: .9; }
main { padding: 20px 16px 40px; }
h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 28px 0 10px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
input[type=number], input[type=text] {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}
select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
button:disabled { opacity: .6; cursor: default; }
input:focus { outline: 2px solid var(--accent); border-color: transparent; }
button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 15px;
  cursor: pointer;
}
button:hover { background: var(--accent-dark); }
button.sub { background: transparent; color: var(--muted); border: 1px solid var(--border); }
button.sub:hover { background: var(--bg); }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.stat { background: var(--bg); border-radius: 10px; padding: 12px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; }
.stat .v small { font-size: 13px; font-weight: 400; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: right; }
th:first-child, td:first-child { text-align: left; }
.bar { height: 10px; border-radius: 5px; background: var(--border); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.tool-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tool-list a { text-decoration: none; color: inherit; }
.tool-list .card:hover { border-color: var(--accent); }
.tool-list h2 { margin: 0 0 6px; font-size: 17px; color: var(--accent); }
details.faq { border-bottom: 1px solid var(--border); padding: 10px 0; }
details.faq:last-child { border-bottom: 0; }
details.faq summary { cursor: pointer; font-weight: 700; }
details.faq p { margin: 8px 0 0; color: var(--muted); }
.card ul, .card ol { margin: 8px 0; padding-left: 22px; }
.card li { margin: 4px 0; }
.article h2 { margin-top: 26px; }
.article p { margin: 10px 0; }
.formula { background: var(--bg); border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; overflow-x: auto; }
.ad { min-height: 90px; margin: 16px 0; text-align: center; color: var(--muted); font-size: 12px; }
footer { padding: 20px 16px 40px; font-size: 12px; color: var(--muted); }
.tracker .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tracker .name { font-weight: 700; font-size: 17px; }
.tracker .big { font-size: 28px; font-weight: 700; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 110px; }
.row > button { flex: 0 0 auto; }
