:root {
    color-scheme: dark;
    --background: #0a0a0f;
    --panel: #151521;
    --text: #e4e4ef;
    --muted: #a9a9be;
    --line: #303044;
    --accent: #78b7ff;
    --win: #58dfaa;
    --loss: #ff879c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font: 15px/1.55 Inter, system-ui, sans-serif; }
a { color: var(--accent); text-underline-offset: .2em; }
button, input, select { font: inherit; }
button, input, select { border: 1px solid var(--line); border-radius: 8px; }
button { cursor: pointer; background: #202031; color: var(--text); padding: .55rem .9rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.topbar { border-bottom: 1px solid var(--line); background: var(--panel); }
.topbar nav { display: flex; align-items: center; gap: 1.2rem; min-height: 60px; }
.brand { color: var(--text); font-size: .82rem; letter-spacing: .09em; text-decoration: none; }
.signout { margin-left: auto; }
.wrap { width: min(100% - 2rem, 1100px); margin: auto; }
main { padding-block: 2.3rem 3.5rem; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .8rem; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
.intro, .hint, small { color: var(--muted); }
.intro { margin: 0 0 1.4rem; overflow-wrap: anywhere; }
.hint { margin: .35rem 0 .8rem; }
.back { display: inline-block; margin-bottom: .75rem; }
.alert, .notice { padding: .8rem 1rem; margin: 0 0 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.alert { color: var(--loss); }
.card { padding: 1.15rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); min-width: 0; }
main > section, main > .grid { margin-bottom: 1.25rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
label { display: grid; gap: .3rem; margin-bottom: .7rem; font-weight: 600; min-width: 0; }
input:not([type="hidden"]), select { width: 100%; padding: .55rem .7rem; background: var(--background); color: var(--text); }
.primary { background: var(--accent); color: #0b1a2d; border-color: transparent; font-weight: 700; }
.repositories { list-style: none; margin: 0; padding: 0; }
.repositories a { display: grid; gap: .2rem; padding: .7rem .3rem; border-bottom: 1px solid var(--line); text-decoration: none; overflow-wrap: anywhere; }
.repositories a:hover strong { text-decoration: underline; }
.repositories span { color: var(--muted); }
.import form { display: flex; max-width: 35rem; align-items: end; gap: .7rem; }
.import label { flex: 1; margin: 0; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.stats div { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: .8rem; }
.stats dt { color: var(--muted); }
.stats dd { font-size: 1.7rem; font-weight: 700; margin: 0; }
.win { color: var(--win); }
.loss, .remove { color: var(--loss); }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
th[scope="col"] { color: var(--muted); }
th[scope="row"] { font-weight: 600; }
th small.block { display: block; }
@media (max-width: 640px) {
    .grid, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid { grid-template-columns: 1fr; }
    .topbar nav { gap: .7rem; }
}
