:root {
  --ink: #1c2127;
  --muted: #6b7280;
  --line: #e3e6ea;
  --bg: #f5f6f8;
  --card: #ffffff;
  --blue: #2f5fa8;
  --under: #fde9ec;
  --over: #fff6e0;
  --good: #0f7a3d;
  --bad: #b3261e;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: var(--blue); color: #fff;
}
.brand { color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; }
header nav { margin-right: auto; margin-left: 26px; display: flex; gap: 16px; }
header nav a { color: #dfe8f5; text-decoration: none; }
header nav a:hover { color: #fff; text-decoration: underline; }
.thresholds { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin: 0 0 16px; }
.thresholds legend { font-weight: 600; padding: 0 6px; }
.thresholds label { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; font-weight: 600; }
.thresholds label.check { font-weight: 400; color: var(--muted); }
.thresholds input[type=text] { width: 70px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; }
input.price {
  width: 88px; padding: 3px 6px; text-align: right; border: 1px solid #c9d2de;
  border-radius: 4px; background: #fff; font: inherit;
}
input.price:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
input.price.edited { border-color: var(--blue); background: #eaf1fb; font-weight: 600; }
.steps { margin: 10px 0 16px; padding-left: 22px; }
.steps li { margin-bottom: 7px; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 40px; }
footer {
  max-width: 1200px; margin: 0 auto; padding: 0 16px 24px;
  display: flex; justify-content: space-between; color: var(--muted); font-size: 12px;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 18px 20px; margin-bottom: 16px;
}
.card.narrow { max-width: 380px; margin: 40px auto; }
h1 { font-size: 19px; margin: 0 0 10px; }
h2 { font-size: 16px; margin: 0 0 10px; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; }
.warn { color: #8a5a00; background: #fff8e6; padding: 8px 10px; border-radius: 6px; }
.bad, .error { color: var(--bad); }
.flash { background: #fff4f4; border: 1px solid #f3c9c9; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.step { font-size: 15px; }

label { display: block; font-weight: 600; margin-bottom: 4px; }
.field { margin-bottom: 16px; }
input[type=file], input[type=password] {
  width: 100%; max-width: 460px; padding: 8px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff;
}
button.primary, .primary-link {
  background: var(--blue); color: #fff; border: 0; border-radius: 6px;
  padding: 9px 16px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-block;
}
button.primary:hover { background: #26497f; }
button.link { background: none; border: 0; color: #fff; cursor: pointer; text-decoration: underline; }
form.inline { margin: 0; }
.chip {
  background: #eef1f5; border: 1px solid var(--line); border-radius: 14px;
  padding: 3px 11px; cursor: pointer; font-size: 12.5px;
}
.chip:hover { background: #e2e7ef; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.summary { margin-left: auto; font-weight: 600; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 12px; background: #eef1f5; margin-right: 6px; font-size: 12.5px; }
.pill.underpriced { background: var(--under); }
.pill.overpriced { background: var(--over); }
.pill.ok { background: #e8f6ec; }

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; max-height: 62vh; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
table.audit thead th {
  position: sticky; top: 0; background: var(--blue); color: #fff; text-align: left;
  padding: 8px 10px; cursor: pointer; white-space: nowrap;
}
table.audit thead th.tick { cursor: default; width: 34px; }
table.audit td { padding: 6px 10px; border-top: 1px solid var(--line); }
table.audit tr.underpriced { background: var(--under); }
table.audit tr.overpriced { background: var(--over); }
td.num, th.num { text-align: right; white-space: nowrap; }
td.up { color: var(--good); }
td.down { color: var(--bad); }
table.list td, table.list th { padding: 7px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.reasons { margin: 8px 0 0; padding-left: 20px; }
.reasons li { margin-bottom: 4px; }
.log { background: #f7f8fa; padding: 10px; border-radius: 6px; overflow-x: auto; font-size: 12px; }
details summary { cursor: pointer; font-weight: 600; }
.export { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
a { color: var(--blue); }
