:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #555555;
  --border: #cccccc;
  --card: #f7f7f7;
  --accent: #0055cc;
  --accent-fg: #ffffff;
  --ok: #0a7a2f;
  --warn: #b45309;
}
[data-theme="dark"] {
  --bg: #0e1116;
  --fg: #f0f3f6;
  --muted: #9aa4b2;
  --border: #2d333b;
  --card: #161b22;
  --accent: #58a6ff;
  --accent-fg: #0e1116;
  --ok: #3fb950;
  --warn: #f0883e;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  padding: 16px;
  line-height: 1.55;
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
}
header, footer {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 18px;
}
footer {
  border-bottom: none;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 28px;
  font-size: 13px;
  color: var(--muted);
}
footer a {
  color: var(--accent);
  text-decoration: none;
}
footer a:hover { text-decoration: underline; }
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.brand {
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  color: var(--fg);
}
nav {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}
nav a:hover { text-decoration: underline; }
nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  color: var(--fg);
}
button, input, select {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  border-radius: 3px;
}
button {
  cursor: pointer;
  background: var(--card);
}
button.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  font-weight: 600;
}
.box {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 3px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
label.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 8px;
  font-weight: 500;
}
label.check-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}
input[type="number"], input[type="text"], input[type="email"], select {
  width: 100%;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}
th, td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: left;
}
th { background: var(--card); }
.num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: right;
  white-space: nowrap;
}
.ad-slot {
  min-height: 90px;
  margin: 16px 0;
}
.ad-slot:empty {
  display: none;
}
.badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 3px;
}
.ok { color: var(--ok); font-weight: 700; }
.warn { color: var(--warn); font-weight: 700; }
.muted { color: var(--muted); font-size: 13px; }
h1 { font-size: 24px; margin: 0 0 8px 0; line-height: 1.25; }
h2 { font-size: 18px; margin: 20px 0 8px 0; }
.faq-item { margin-bottom: 12px; }
.faq-item strong { display: block; margin-bottom: 2px; }
.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.quick-amounts button {
  padding: 4px 10px;
  font-size: 13px;
}
.mobile-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--ok);
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 3px;
  font-size: 14px;
}
.auth-input {
  width: 145px;
  padding: 4px 6px;
  font-size: 13px;
}
@media (max-width: 600px) {
  body { padding: 12px; }
  h1 { font-size: 20px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  button, input:not([type="checkbox"]), select, .auth-input {
    font-size: 16px;
    min-height: 44px;
  }
  .quick-amounts button {
    min-height: 38px;
    font-size: 14px;
  }
  table.mobile-cards thead { display: none; }
  table.mobile-cards,
  table.mobile-cards tbody,
  table.mobile-cards tr,
  table.mobile-cards td {
    display: block;
    width: 100%;
  }
  table.mobile-cards tr {
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 3px;
    padding: 8px 10px;
    margin-bottom: 10px;
  }
  table.mobile-cards td {
    border: none;
    padding: 4px 0;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
  }
  table.mobile-cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 12px;
    flex-shrink: 0;
  }
  table.mobile-cards td.num {
    text-align: right;
  }
}
