:root {
  --bg: #0d1117;
  --panel: #161b22;
  --line: #30363d;
  --text: #e6edf3;
  --muted: #9ba7b4;
  --accent: #58a6ff;
  --green: #3fb950;
  --red: #f85149;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
main { max-width: 62rem; margin: 0 auto; padding: 1.25rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1rem 0;
}
.narrow { max-width: 27rem; margin: 12vh auto; }
h1 { font-size: 1.55rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
label { display: block; font-size: .85rem; color: var(--muted); margin: .6rem 0; }
input, select {
  width: 100%;
  margin-top: .3rem;
  padding: .65rem .7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0b0f14;
  color: var(--text);
  font-size: 1rem;
}
input:focus, select:focus { outline: 2px solid rgba(88,166,255,.35); border-color: var(--accent); }
button {
  margin-top: 1rem;
  padding: .7rem 1.1rem;
  border-radius: 8px;
  border: 1px solid #1f6feb;
  background: #1f6feb;
  color: #fff;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: .55; cursor: default; }
button.ghost { background: transparent; border-color: var(--line); color: var(--text); margin-top: 0; }
.grid { display: grid; gap: .75rem; grid-template-columns: 1fr; margin: .5rem 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
}
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.actions { display: flex; gap: .5rem; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .75rem; margin: 1rem 0; }
.stat { margin: 0; }
.stat.total { border-color: var(--accent); }
.big { font-size: 1.55rem; font-weight: 700; margin: .35rem 0; font-variant-numeric: tabular-nums; }
.big span { font-size: .78rem; font-weight: 400; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { padding: .15rem .45rem; border-radius: 999px; font-size: .75rem; }
.tag.in { background: rgba(63,185,80,.15); color: var(--green); }
.tag.out { background: rgba(248,81,73,.15); color: var(--red); }
.error { color: var(--red); min-height: 1.2em; margin: .5rem 0 0; font-size: .85rem; }
.ok { color: var(--green); min-height: 1.2em; margin: .5rem 0 0; font-size: .85rem; }
.hidden { display: none !important; }

a.link {
  display: inline-block;
  text-decoration: none;
  padding: .7rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
}
input.computed {
  background: #0b0f14;
  color: var(--muted);
  border-style: dashed;
}
.partner-row {
  display: grid;
  grid-template-columns: 1fr 8rem auto;
  gap: .5rem;
  align-items: end;
  margin: .5rem 0;
}
.partner-row button { margin-top: 0; }
@media (max-width: 640px) {
  .partner-row { grid-template-columns: 1fr; }
}
