:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #1f2937;
  --muted: #64748b;
  --primary: #0f6cbd;
  --primary-dark: #0b5494;
  --primary-soft: #e8f1fb;
  --accent: #0d9488;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .06);
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", "Microsoft YaHei", "Malgun Gothic", "Noto Sans CJK JP", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
#site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary-dark);
  white-space: nowrap;
}
.brand .dot { color: var(--accent); }
.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary-dark); }

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
select.lang-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
  cursor: pointer;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-home { background: var(--primary); color: #fff; }
.btn-home:hover { background: var(--primary-dark); text-decoration: none; }
.btn-mail { background: var(--surface); color: var(--primary-dark); border-color: var(--border); }
.btn-mail:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- Layout ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 18px 60px;
}
.page-title { font-size: 1.7rem; margin: 0 0 4px; color: var(--text); }
.page-sub { color: var(--muted); margin: 0 0 22px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  transition: transform .12s ease, box-shadow .12s ease;
  display: block;
  color: var(--text);
}
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(15,23,42,.12); text-decoration: none; }
.tool-card .ic { font-size: 1.8rem; }
.tool-card h3 { margin: 10px 0 6px; color: var(--primary-dark); }
.tool-card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
input[type="text"], input[type="number"], select.ctrl {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .95rem;
}
input:focus, select:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .col { flex: 1 1 200px; }
button.action {
  margin-top: 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
button.action:hover { background: var(--primary-dark); }
button.action-sm {
  background: var(--surface);
  color: var(--primary-dark);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: .9rem;
}
button.action-sm:hover { background: var(--surface-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data {
  border-collapse: collapse;
  width: 100%;
  font-size: .92rem;
  min-width: 720px;
}
table.data th, table.data td {
  padding: 9px 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data th:nth-child(1), table.data td:nth-child(1),
table.data th:nth-child(2), table.data td:nth-child(2),
table.data th:nth-child(3), table.data td:nth-child(3) { text-align: left; }
table.data thead th {
  background: var(--surface-2);
  color: var(--muted);
  position: sticky;
  top: 0;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
table.data tbody tr:hover { background: var(--primary-soft); cursor: pointer; }
table.data tbody tr.highlight { background: #fff4cc; }

.result-box {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  font-size: 1.05rem;
}
.result-box .big { font-size: 1.5rem; font-weight: 700; color: var(--primary-dark); }
.muted { color: var(--muted); }
.note { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.disclaimer {
  font-size: .82rem;
  color: var(--muted);
  border-top: 1px dashed var(--border);
  margin-top: 30px;
  padding-top: 14px;
}
.prop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.prop-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.prop-item .k { font-size: .8rem; color: var(--muted); }
.prop-item .v { font-size: 1.1rem; font-weight: 600; }

footer.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px 40px;
  color: var(--muted);
  font-size: .85rem;
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: .78rem;
  font-weight: 600;
}

table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-dippr { background: #dcfce7; color: #15803d; }
.badge-antoine { background: #e0f2fe; color: #0369a1; }
.badge-est { background: #f1f5f9; color: #64748b; border: 1px solid var(--border); }
.badge-none { background: #fee2e2; color: #b91c1c; }

@media (max-width: 640px) {
  .header-inner { gap: 8px; }
  .brand { font-size: 1rem; }
  .nav a { padding: 5px 8px; font-size: .82rem; }
  .btn { padding: 6px 9px; font-size: .82rem; }
  .page-title { font-size: 1.4rem; }
}
