/* Manascrew brand (from manascrew.co.uk): navy #204970, blue #317FBF, light blue #6B96BF, Fira Sans. */
:root {
  --navy: #204970;
  --bg: #f2f5f9;
  --surface: #ffffff;
  --text: #1b2633;
  --muted: #5d6b7b;
  --line: #dbe2ea;
  --accent: #2a6fa8;
  --accent-ink: #ffffff;
  --pos: #137a4a;
  --neg: #b4232f;
  --danger: #c2282f;
  --danger-bg: #fdecec;
  --ok-bg: #e5f3ec;
  --info-bg: #e6f0f9;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #183a5a;
    --bg: #0e1824;
    --surface: #162433;
    --text: #e6edf5;
    --muted: #9badc0;
    --line: #26384b;
    --accent: #6ba6db;
    --accent-ink: #0e1824;
    --pos: #4cc98a;
    --neg: #f07178;
    --danger: #f0646c;
    --danger-bg: #3a1c22;
    --ok-bg: #133024;
    --info-bg: #15304a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.logo { display: block; height: 26px; width: auto; }
.login-logo { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto .5rem; }
.banner.info { background: var(--info-bg); border: 1px solid var(--accent); }
.merge-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; }
.merge-card { margin: 0; height: 100%; }
.merge-card.keep { border: 2px solid var(--accent); }
.merge-card.close { border-style: dashed; }
.merge-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--muted); margin-bottom: .6rem; }
.merge-card.keep .merge-label { color: var(--accent); }
.merge-points { font-size: 1.8rem; font-weight: 800; margin-top: .75rem; font-variant-numeric: tabular-nums; }
.merge-arrow { font-size: 2rem; color: var(--muted); }
@media (max-width: 640px) {
  .merge-grid { grid-template-columns: 1fr; }
  .merge-arrow { transform: rotate(90deg); justify-self: center; }
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 .75rem; }
.card h2 { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.gem { color: var(--accent); }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .6rem 1.25rem; background: var(--navy); border-bottom: 3px solid #317fbf;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; color: #ffffff; }
.brand:hover { text-decoration: none; }
.brand .sub { color: #b9cde2; font-weight: 500; }
.topbar nav a, .topbar button.link { color: #ffffff; }
.topbar nav { display: flex; gap: 1.25rem; align-items: center; }
.page { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }

.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; gap: .75rem; }
.gap { gap: .75rem; }
.grow { flex: 1; min-width: 200px; }
.inline { display: inline; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin: 1rem 0;
}
.narrow { max-width: 440px; width: 100%; }

label { display: block; margin: .75rem 0; font-weight: 500; }
input[type=text], input[type=search], input[type=password], input:not([type]), input[inputmode] {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; font: inherit;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label.amount { width: 160px; }
label.amount input { font-size: 1.2rem; font-variant-numeric: tabular-nums; }

button, .button {
  display: inline-block; font: inherit; font-weight: 600; padding: .55rem 1rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
}
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger, .button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.button.danger:hover { text-decoration: none; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 400; }
.wide { width: 100%; margin-top: .5rem; }

.search { display: flex; gap: .5rem; }
.search input { margin: 0; min-width: 240px; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 1rem 0; }
.tabs a { padding: .5rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; }
.count { background: var(--line); border-radius: 99px; padding: 0 .5rem; font-size: .8em; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.big { font-size: 1.1rem; font-weight: 700; }
.pos { color: var(--pos); font-weight: 600; }
.neg { color: var(--neg); font-weight: 600; }

.who { display: flex; align-items: center; gap: .75rem; color: var(--text); }
.who:hover { text-decoration: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.6rem; }
.avatar.ph { display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.pill { font-size: .8rem; padding: .1rem .55rem; border-radius: 99px; background: var(--line); }
.pill.discord { background: #5865f2; color: #fff; }
.pill.google { background: #e8eaed; color: #202124; }

.profile { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.balance { text-align: right; }
.balance .value { font-size: 2.4rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--accent); }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segmented label { margin: 0; padding: .45rem .9rem; cursor: pointer; font-weight: 500; border-right: 1px solid var(--line); }
.segmented label:last-child { border-right: 0; }
.segmented input { position: absolute; opacity: 0; }
.segmented label:has(input:checked) { background: var(--accent); color: var(--accent-ink); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }

.flash { padding: .7rem 1rem; border-radius: 8px; margin: 0 0 1rem; background: var(--ok-bg); }
.flash.error { background: var(--danger-bg); color: var(--danger); }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1rem; border-radius: var(--radius); margin: 1rem 0; }
.banner.danger { background: var(--danger-bg); border: 1px solid var(--danger); }

.danger-zone { border-top: 1px solid var(--line); margin-top: 2.5rem; }
.danger-card { border-color: var(--danger); }
.confirm-who { margin: 1rem 0; padding: .75rem; background: var(--bg); border-radius: 8px; }

.pager { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); background: var(--surface);
  border: 1px dashed var(--line); border-radius: var(--radius); }
.audit { list-style: none; padding: 0; margin: 0; }
.audit li { padding: .3rem 0; }

@media (max-width: 640px) {
  .search, .search input { width: 100%; min-width: 0; }
  .balance { text-align: left; width: 100%; }
  label.amount { width: 100%; }
  th, td { padding: .55rem .6rem; }
}
