:root {
  --bg: #f6f6f4; --card: #fff; --text: #1d1d1b; --muted: #6b6b66; --line: #e2e2dc;
  --accent: #2e5bff; --warn: #a15c00; --neg: #b3261e; --demo: #7a3fbf;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; gap: 8px; }
.top nav { display: flex; gap: 6px 16px; align-items: center; flex-wrap: wrap; }
.top nav a { white-space: nowrap; }
.brand { font-weight: 700; color: var(--text); }
main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 24px; margin: 0; }
h2 { font-size: 18px; margin: 0 0 12px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; }
.narrow { max-width: 560px; }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.neg { color: var(--neg); }
.note { background: #fff8e6; border-left: 3px solid #e6b800; padding: 8px 12px; color: #5c4a00; }
.flash { background: #e8f5e9; padding: 8px 12px; border-radius: 6px; }
.error, .errorlist { color: var(--neg); }
.badge { font-size: 12px; padding: 1px 6px; border-radius: 4px; background: var(--line); color: var(--muted); }
.badge.demo { background: #f0e6fa; color: var(--demo); }
.button, button.primary { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 7px 14px; font: inherit; cursor: pointer; }
.button:hover { text-decoration: none; opacity: .9; }
button { font: inherit; cursor: pointer; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; }
form.inline { display: inline; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; max-width: 100%; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field ul { list-style: none; padding: 0; margin: 0; }
label.check { display: flex; gap: 8px; align-items: center; }
.narrow form > label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; align-items: end; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.calc .formula { color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 13px; white-space: nowrap; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.summary div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { padding: 6px 12px; border-radius: 6px; color: var(--text); }
.tab.active { background: var(--text); color: #fff; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.crumbs { margin: 0 0 6px; color: var(--muted); }
.history { padding: 8px 0; border-bottom: 1px solid var(--line); }
details { padding: 6px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 600px) {
  .facts { grid-template-columns: 1fr; }
  .facts dd { margin-bottom: 8px; }
}
