:root {
  --text: #1f2328;
  --muted: #59636e;
  --line: #d1d9e0;
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --accent: #1f4e79;
  --fraud: #c0392b;
  --legit: #8c959f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

header { border-bottom: 1px solid var(--line); background: var(--bg-alt); padding: 22px 0 16px; }
header h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; }
.meta { margin: 0; color: var(--muted); font-size: 13.5px; }
a { color: var(--accent); }

section { padding: 26px 0 30px; border-bottom: 1px solid var(--line); }
h2 { font-size: 19px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
.sub, .note { color: var(--muted); font-size: 13.5px; }
.note { margin: 8px 0 0; }

.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.stat { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 21px; font-weight: 600; }
.stat.fraud .value { color: var(--fraud); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.chart-box { position: relative; height: 280px; }
.chart-box.wide { height: 300px; }

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data th { background: var(--bg-alt); font-weight: 600; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data.small { font-size: 12.5px; }
table.data td.text { text-align: left; }
tr.highlight td { font-weight: 600; }
.tag { padding: 1px 7px; border-radius: 10px; font-size: 11.5px; }
.tag.tp { background: #e6f4ea; color: #1e6b34; }
.tag.fp { background: #fff4e5; color: #8a5300; }
.tag.fn { background: #fde8e7; color: #a12a1f; }

table.confusion { border-collapse: collapse; font-size: 14px; }
table.confusion th, table.confusion td { border: 1px solid var(--line); padding: 8px 16px; text-align: center; }
table.confusion th { background: var(--bg-alt); font-weight: 600; }
table.confusion td.good { background: #e6f4ea; }
table.confusion td.bad { background: #fde8e7; }

.scroll { overflow-x: auto; }
.filters, .pager, .examples { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
button {
  font: inherit; font-size: 13.5px; padding: 5px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text);
}
button:hover { border-color: var(--accent); }
button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
button:disabled { opacity: 0.5; cursor: default; }

.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; margin-top: 10px; }
.form label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.form input, .form select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.form button[type=submit] { background: var(--accent); color: #fff; border-color: var(--accent); align-self: end; padding: 7px 12px; }
#predictResult { margin-top: 14px; }
.result { border: 1px solid var(--line); border-left: 4px solid var(--legit); padding: 10px 14px; border-radius: 4px; }
.result.fraud { border-left-color: var(--fraud); }
.result strong { font-size: 16px; }

footer { color: var(--muted); font-size: 12.5px; padding: 18px 20px 30px; }

@media (max-width: 800px) {
  .cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
