/* Owned by the base block: the components every block's pages use. The app's own styles go in
   app.css, which is loaded after this file. */
:root {
    --fg: #1f2328;
    --muted: #59636e;
    --bg: #ffffff;
    --surface: #f6f8fa;
    --accent: #c0392b;
    --border: #d1d9e0;
    --ok: #1a7f37;
    --radius: 6px;
    --density: 1;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --fg: #e6edf3;
        --muted: #9198a1;
        --bg: #0d1117;
        --surface: #151b23;
        --accent: #ff6b5b;
        --border: #3d444d;
        --ok: #3fb950;
    }
}

* { box-sizing: border-box; }
/* hidden means hidden, whatever display a class gives (scripts reveal what only they can drive) */
[hidden] { display: none !important; }
body { margin: 0; font: 16px/1.5 system-ui, sans-serif; color: var(--fg); background: var(--bg); }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
code { background: var(--surface); padding: 0 .25em; border-radius: 4px; }
.muted { color: var(--muted); }

.site-header {
    display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center;
    padding: .75rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface);
}
.brand { font-weight: 700; text-decoration: none; }
.site-nav { display: flex; gap: 1rem; flex: 1; }
.site-nav a { text-decoration: none; color: var(--fg); }
.site-nav a.current { color: var(--accent); font-weight: 600; }
.account { display: flex; gap: .75rem; align-items: center; }
main { max-width: 60rem; margin: 0 auto; padding: calc(1rem * var(--density)); }

.banner { padding: .5rem .75rem; margin-bottom: 1rem; border: 1px solid var(--accent); border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-radius: var(--radius); display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.flash { padding: .5rem .75rem; border: 1px solid var(--border); border-left: 4px solid var(--ok); background: var(--surface); border-radius: var(--radius); }
.flash.error { border-left-color: var(--accent); }
.flash p { margin: .25rem 0; }

form.stack { display: grid; gap: .75rem; max-width: 26rem; }
form.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
label { display: grid; gap: .25rem; font-weight: 600; }
input, select { font: inherit; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--fg); }
button, .button {
    font: inherit; cursor: pointer; padding: .4rem .9rem; border-radius: var(--radius);
    border: 1px solid var(--accent); background: var(--accent); color: #fff; text-decoration: none;
}
button.secondary { background: transparent; color: var(--accent); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: calc(.45rem * var(--density)) .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.badge { display: inline-block; padding: 0 .5rem; border-radius: 999px; border: 1px solid var(--border); font-size: .85rem; }
.badge.done { color: var(--ok); border-color: var(--ok); }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: calc(1rem * var(--density)); margin: calc(1rem * var(--density)) 0; background: var(--surface); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.account .locale select { padding: .1rem .3rem; font-size: .85rem; border-radius: var(--radius); }

/* differences (base Diff): <del>/<ins> carry the meaning, the colours only help */
.diff { font-variant-numeric: tabular-nums; }
.diff del, .diff ins { text-decoration: none; }
.diff .del, .diff del { background: rgba(207, 34, 46, .12); }
.diff .ins, .diff ins { background: rgba(26, 127, 55, .14); }
.diff .sign { width: 1.5em; text-align: center; color: var(--muted); user-select: none; }
pre.diff { padding: .5rem 0; overflow-x: auto; }
pre.diff > span, pre.diff > del, pre.diff > ins { display: block; padding: 0 .5rem; }
details.ref-diff > summary { cursor: pointer; }

/* step-by-step forms: one fieldset per step, top to bottom */
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem 1rem .75rem; margin: 0; }
legend { font-weight: 600; padding: 0 .25rem; }
.inline-check { display: inline-flex; gap: .3rem; align-items: center; margin-right: 1rem; }
fieldset textarea { width: 100%; }
