:root {
  --bg: #ffffff; --fg: #1b1d22; --muted: #5d6470; --line: #e3e6eb; --card: #f6f7f9;
  --accent: #1f6feb; --accent-fg: #ffffff; --good: #1a7f37; --warn: #9a6700; --bad: #cf222e;
  --radius: 10px; --max: 920px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14161a; --fg: #e6e8eb; --muted: #9aa3ae; --line: #2a2f37; --card: #1c1f25; --accent: #4c8dff; --good: #3fb950; --warn: #d29922; --bad: #f85149; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.55; font-size: 17px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 1.2rem 0 .6rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 .6rem; }
h3 { font-size: 1.08rem; margin: 1.4rem 0 .4rem; }
img { max-width: 100%; height: auto; }
.muted { color: var(--muted); font-size: .92rem; }
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; color: var(--fg); font-size: 1.1rem; }
.site-header nav a { margin-left: 14px; text-decoration: none; color: var(--muted); }
.site-header nav a:hover { color: var(--fg); }
.crumbs { font-size: .88rem; color: var(--muted); margin-top: 10px; }
.crumbs a { color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.2rem 0 2rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid a.card { text-decoration: none; color: var(--fg); }
.grid a.card:hover { border-color: var(--accent); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .9rem; }
.table-scroll { overflow-x: auto; }
input, select, button { font: inherit; color: inherit; }
input[type=number], input[type=text], select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
button { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.answer { font-size: 2rem; font-weight: 700; line-height: 1.2; margin: .4rem 0; font-variant-numeric: tabular-nums; }
.answer small { display: block; font-size: 1rem; font-weight: 500; color: var(--muted); }
.sources { font-size: .85rem; color: var(--muted); }
@media (max-width: 560px) { h1 { font-size: 1.5rem; } .answer { font-size: 1.6rem; } body { font-size: 16px; } }
/* converter widget */
.conv-row { display: grid; grid-template-columns: 1fr auto 1.3fr; gap: 12px; align-items: end; }
.conv-in { display: flex; gap: 10px; }
.conv-in label { flex: 1; font-size: .85rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.conv-in input { font-size: 1.3rem; color: var(--fg); }
.conv-eq { font-size: 1.6rem; color: var(--muted); padding-bottom: 8px; }
.conv-out { display: flex; flex-direction: column; padding-bottom: 6px; }
.conv-main { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ruler { width: 100%; height: 70px; margin-top: 14px; color: var(--fg); }
@media (max-width: 560px) { .conv-row { grid-template-columns: 1fr; } .conv-eq { display: none; } }
@media print { .site-header, .site-footer, .conv, button, .crumbs { display: none; } }
