/* Happy Lil Forge: part of the Happy Lil Clouds family.
   A soft sky by day, a calm night sky in dark mode, puffy rounded shapes,
   and colors chosen to meet WCAG contrast in both schemes. */

/* ---- fonts (self-hosted: Nunito, SIL OFL 1.1, see fonts/NUNITO-OFL.txt) ---- */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("fonts/nunito-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url("fonts/nunito-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- tokens ---- */
:root {
  color-scheme: light dark;

  /* day sky */
  --bg: #f5f9ff;          /* page */
  --surface: #ffffff;     /* cards */
  --surface-2: #edf4ff;   /* card headers, soft fills */
  --line: #d6e3f5;        /* decorative separators */
  --line-strong: #7a8ca6; /* control borders (3:1 on surfaces) */
  --ink: #1b2738;
  --muted: #526175;
  --link: #1d5fc4;
  --primary: #2563d4;
  --on-primary: #ffffff;
  --primary-soft: #e3eeff;
  --sky-top: #c9e1ff;
  --sky-bottom: #e6f1ff;
  --cloud: #ffffff;
  --sun: #f2a516;
  --sun-soft: #fff4d6;
  --add-bg: #e2f6e9; --add-fg: #16703e;
  --del-bg: #fde8eb; --del-fg: #b42339;
  --merged-bg: #efe7fd; --merged-fg: #6a3cbf;
  --hunk: #e8f0ff;
  --mark: #ffe48a;
  --shadow: 0 1px 2px rgb(27 39 56 / 6%), 0 6px 18px rgb(37 99 212 / 7%);
  --focus: #1d5fc4;

  /* for the illustration symbols */
  --cloud-fill: #ffffff;
  --cloud-face: #1b2738;

  --r-sm: 8px; --r: 14px; --r-lg: 20px; --pill: 999px;
  --font: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;

  accent-color: var(--primary);
}
@media (prefers-color-scheme: dark) {
  :root {
    /* night sky */
    --bg: #0d1626;
    --surface: #132037;
    --surface-2: #192a45;
    --line: #273a5a;
    --line-strong: #7487a8;
    --ink: #e8effb;
    --muted: #a7b5cc;
    --link: #8fbcff;
    --primary: #8fbcff;
    --on-primary: #0d1626;
    --primary-soft: #1d3157;
    --sky-top: #152a4d;
    --sky-bottom: #0f1e37;
    --cloud: #1d3156;
    --sun: #ffcb5c;
    --sun-soft: #2d2b4f;
    --add-bg: #12362a; --add-fg: #82e3ab;
    --del-bg: #3d1b27; --del-fg: #ff9eac;
    --merged-bg: #2a2148; --merged-fg: #cbb3ff;
    --hunk: #172846;
    --mark: #6b5a14;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 18px rgb(0 0 0 / 25%);
    --focus: #8fbcff;
    --cloud-fill: #20375f;
    --cloud-face: #e8effb;
  }
}

/* ---- base ---- */
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; }
code, pre, kbd { font-family: var(--mono); font-size: 13px; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; overflow-x: auto; }
:not(pre) > code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
::selection { background: var(--mark); color: var(--ink); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-block: 24px 72px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.err { color: var(--del-fg); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.narrow { max-width: 28rem; }
.table-wrap { overflow-x: auto; }

/* icons from icons.svg */
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.i.lg { width: 1.4em; height: 1.4em; }
.illo { display: block; width: 88px; height: 88px; margin: 0 auto 8px; color: var(--primary); }
.has-i { display: inline-flex; align-items: center; gap: 0.4em; }

/* ---- accessibility helpers ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--primary); color: var(--on-primary); padding: 10px 16px; border-radius: var(--pill); font-weight: 700; }
.skip:focus { top: 10px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }

/* ---- header: a little band of sky with a cloudy edge ---- */
.top {
  position: relative;
  display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  padding: 14px 24px 12px;
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
}
.top::before { /* faint background clouds */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-color: var(--cloud);
  mask: url("sky.svg") no-repeat right 6% top 50% / auto 130%;
  opacity: 0.95;
}
.top::after { /* scalloped cloud edge under the header */
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; pointer-events: none;
  background-color: var(--sky-bottom);
  mask: url("cloud-edge.svg") repeat-x left top / 120px 14px;
}
.top > * { position: relative; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; color: var(--ink); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.top nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: 8px; margin-right: auto; }
.top nav a, .account a, .account button.link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--pill); color: var(--ink); font-weight: 650;
}
.top nav a:hover, .account a:hover, .account button.link:hover { background: color-mix(in oklab, var(--surface) 70%, transparent); text-decoration: none; }
.top nav a[aria-current="page"], .account a[aria-current="page"] { background: var(--surface); box-shadow: var(--shadow); }
.account { display: flex; align-items: center; gap: 4px; }
.account form { margin: 0; }
.account .who-agent { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-weight: 650; }

/* ---- buttons ---- */
button, a.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 2px solid var(--primary); background: var(--primary); color: var(--on-primary);
  border-radius: var(--pill); padding: 7px 18px; line-height: 1.3;
  transition: background-color .15s, border-color .15s, color .15s;
}
button:hover { background: color-mix(in oklab, var(--primary) 85%, var(--ink)); border-color: color-mix(in oklab, var(--primary) 85%, var(--ink)); }
a.btn, button.secondary { background: var(--surface); color: var(--link); border-color: var(--line-strong); }
a.btn:hover, button.secondary:hover { background: var(--primary-soft); text-decoration: none; }
button.link { background: none; border: 0; color: var(--link); padding: 0; font-weight: 650; }
button.link:hover { background: none; text-decoration: underline; }
button.primary { padding: 9px 22px; }
button.small { padding: 3px 12px; font-size: 13px; }
button.danger { background: var(--surface); color: var(--del-fg); border-color: var(--del-fg); }
button.danger:hover { background: var(--del-bg); }
.copy { min-width: 6.5em; }

/* ---- pills, tags, counts, states ---- */
.tag, .pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; line-height: 20px; padding: 0 10px; border-radius: var(--pill);
  border: 1px solid var(--line-strong); color: var(--muted); vertical-align: middle; font-weight: 700;
}
.pill.public { border-color: var(--add-fg); color: var(--add-fg); }
.count { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: var(--pill); background: var(--sun); color: #3b2a00; font-size: 12px; line-height: 20px; text-align: center; font-weight: 800; }
.tabs.inpage .count { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.state { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; padding: 3px 12px 3px 9px; border-radius: var(--pill); white-space: nowrap; }
.state.open { background: var(--add-bg); color: var(--add-fg); }
.state.merged { background: var(--merged-bg); color: var(--merged-fg); }
.state.closed { background: var(--del-bg); color: var(--del-fg); }
.status { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; }
.status.added { color: var(--add-fg); }
.status.deleted { color: var(--del-fg); }
.add { color: var(--add-fg); font-family: var(--mono); font-size: 13px; }
.del { color: var(--del-fg); font-family: var(--mono); font-size: 13px; }

/* ---- flash messages: icon + text, never color alone ---- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); margin: 12px 0; }
.flash .i { margin-top: 0.15em; }
.flash.err { background: var(--del-bg); border-color: var(--del-fg); }
.flash.ok { background: var(--add-bg); border-color: var(--add-fg); }

/* ---- repo header ---- */
.repohead { padding-top: 26px; }
.repohead h1 { margin: 0; font-size: 26px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.repohead h1 a { color: var(--ink); }
.repohead h1 .i { color: var(--primary); }
.repohead .desc { margin: 4px 0 0; color: var(--muted); }

/* ---- tabs ---- */
.tabs { display: flex; gap: 4px; margin-top: 14px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; color: var(--muted); border-radius: var(--pill); font-weight: 700; }
.tabs a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--ink); background: var(--primary-soft); }
.tabs .clones { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; max-width: 100%; }
.tabs .clone { padding: 4px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--pill); user-select: all; max-width: 100%; overflow-x: auto; white-space: nowrap; font-size: 12.5px; }
.tabs.inpage { margin: 18px 0; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--pill); padding: 3px; gap: 2px; }
.seg a { padding: 4px 14px; color: var(--muted); font-size: 14px; border-radius: var(--pill); font-weight: 700; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg a:hover { text-decoration: none; color: var(--ink); }

/* ---- headings & cards ---- */
.page-title { font-size: 26px; margin: 4px 0 14px; }
h2 { font-size: 20px; }
h2.sub { font-size: 18px; margin-top: 4px; }
h3.sub { font-size: 15px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 22px 20px; margin: 18px 0; box-shadow: var(--shadow); }
.panel h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.panel h2 .i { color: var(--primary); }
.panel.created { border: 2px solid var(--add-fg); }
.panel.created:focus { outline: 3px solid var(--add-fg); outline-offset: 3px; }
.card, .repolist, .commits, .changes, table.files, table.events, .code, .readme, .comment, .mergebox, .imgview {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}

/* ---- empty states ---- */
.empty { text-align: center; padding: 40px 16px; }
.empty p { margin: 6px 0; }
.empty pre { text-align: left; display: inline-block; }

/* ---- welcome ---- */
.welcome { display: grid; grid-template-columns: auto 1fr; gap: 4px 20px; align-items: start; background: linear-gradient(135deg, var(--sun-soft), var(--primary-soft)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 26px; margin-bottom: 28px; box-shadow: var(--shadow); }
.welcome .illo { grid-row: span 3; margin: 6px 0 0; width: 96px; height: 96px; }
.welcome h1 { font-size: 24px; margin: 6px 0 0; }
.welcome p { margin: 4px 0; }
.welcome ol { margin: 4px 0 0; padding-left: 1.2em; }
.welcome li { margin: 6px 0; }
@media (max-width: 560px) { .welcome { grid-template-columns: 1fr; } .welcome .illo { grid-row: auto; margin: 0 auto; } }

/* ---- repo list ---- */
.repolist { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.repolist li { padding: 16px 20px; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 0 12px; }
.repolist li:first-child { border-top: 0; }
.repolist li > .i { grid-row: span 3; width: 28px; height: 28px; margin-top: 2px; color: var(--primary); }
.repolist .name { font-size: 17px; font-weight: 800; margin-right: 6px; }
.repolist .desc, .repolist .meta { margin: 2px 0 0; color: var(--muted); }
.repolist .meta { font-size: 13px; }

/* ---- file browser ---- */
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.crumbs { font-weight: 800; overflow-wrap: anywhere; }
.actions { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.actions a { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.refpick { position: relative; }
.refpick summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: var(--pill); padding: 4px 12px; font-family: var(--mono); font-size: 13px; background: var(--surface); }
.refpick summary::-webkit-details-marker { display: none; }
.refpick summary::after { content: "▾"; color: var(--muted); }
.refpick ul { position: absolute; z-index: 2; top: 100%; left: 0; margin: 6px 0 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); min-width: 240px; max-height: 320px; overflow-y: auto; box-shadow: var(--shadow); }
.refpick li { padding: 4px 10px; font-family: var(--mono); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; border-radius: var(--r-sm); }
.refpick li:hover { background: var(--surface-2); }
.lastcommit { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 16px; background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; }
.lastcommit .subject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.files, table.events { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.lastcommit + table.files { border-radius: 0 0 var(--r) var(--r); }
table.files td, table.events td { padding: 8px 14px; border-top: 1px solid var(--line); }
table.files tr:first-child td, table.events tr:first-child td { border-top: 0; }
table.files thead + tbody tr:first-child td { border-top: 1px solid var(--line); }
table.files td.icon { width: 34px; padding-right: 0; color: var(--primary); }
table.files tr:hover td { background: var(--surface-2); }
table.files th, table.tokens th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 14px; font-weight: 800; background: var(--surface-2); }
td.num { text-align: right; white-space: nowrap; }
.events .detail { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; background: none; }
.events .act { font-family: var(--mono); font-size: 13px; }

/* ---- readme & markdown ---- */
.readme { margin-top: 26px; overflow: hidden; }
.readme-h { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-weight: 800; font-size: 14px; }
.md { padding: 4px 26px 18px; overflow-wrap: break-word; }
.md img { max-width: 100%; }
.md table { border-collapse: collapse; }
.md th, .md td { border: 1px solid var(--line); padding: 4px 10px; }
.md blockquote { margin: 0; padding: 2px 16px; border-left: 4px solid var(--line-strong); color: var(--muted); }

/* ---- code & diffs ---- */
.code { overflow-x: auto; }
.code table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 13px; line-height: 20px; }
.code td.ln { width: 1%; min-width: 52px; padding: 0 12px; text-align: right; color: var(--muted); user-select: none; vertical-align: top; }
.code td.ln a { color: inherit; }
.code td.ln a:hover { color: var(--link); text-decoration: none; font-weight: 700; }
.code td.src { padding: 0 14px; white-space: pre; }
.code tr:target { background: var(--sun-soft); }
.code tr.add { background: var(--add-bg); }
.code tr.del { background: var(--del-bg); }
.code tr.add td.src::before { content: "+"; color: var(--add-fg); margin-right: 6px; }
.code tr.del td.src::before { content: "−"; color: var(--del-fg); margin-right: 6px; }
.code tr.ctx td.src::before { content: " "; margin-right: 6px; }
.code tr.hunk { background: var(--hunk); color: var(--muted); }
.imgview { text-align: center; padding: 20px; }
.imgview img { max-width: 100%; }
.filediff { margin-top: 20px; }
.filediff .fh { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 9px 14px; background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.filediff .code { border-radius: 0 0 var(--r) var(--r); }
.filediff .pad { padding: 10px 14px; border: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); margin: 0; background: var(--surface); }

/* ---- commits ---- */
.commits { list-style: none; padding: 0; margin: 0; overflow: hidden; }
.commits li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 11px 16px; border-top: 1px solid var(--line); }
.commits li:first-child { border-top: 0; }
.commits li > .i { color: var(--muted); }
.commits .subject { flex: 1; min-width: 0; color: var(--ink); font-weight: 700; }
.commits .sha { margin-left: auto; }
.pager { display: flex; gap: 20px; justify-content: center; }
.pager a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.commithead h2 { margin-bottom: 4px; }
.commithead .body { white-space: pre-wrap; font-family: inherit; font-size: 14px; background: var(--surface); }

/* ---- change requests ---- */
.changes { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.changes li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-top: 1px solid var(--line); }
.changes li:first-child { border-top: 0; }
.changes .title { font-weight: 800; color: var(--ink); font-size: 16px; }
.changehead h2 { margin-bottom: 6px; font-size: 24px; }
.comment { margin-bottom: 14px; overflow: hidden; }
.comment .ch { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 9px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 14px; }
.comment .ch .i { color: var(--muted); }
.comment .md { padding: 4px 18px 10px; }
.mergebox { border-left-width: 6px; border-left-color: var(--line-strong); padding: 6px 18px 16px; margin: 22px 0; }
.mergebox p:first-child { display: flex; gap: 8px; align-items: flex-start; }
.mergebox p:first-child .i { margin-top: 0.2em; }
.mergebox.ok { border-left-color: var(--add-fg); }
.mergebox.ok p:first-child .i { color: var(--add-fg); }
.mergebox.bad { border-left-color: var(--del-fg); }
.mergebox.bad p:first-child .i { color: var(--del-fg); }
.mergebox.merged { border-left-color: var(--merged-fg); padding-bottom: 6px; }
.mergebox.merged p:first-child .i { color: var(--merged-fg); }
label.check { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.comment-form { margin-top: 12px; }

/* line comments */
tr.threadrow td { padding: 10px 14px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: normal; font-family: var(--font); font-size: 14px; }
.thread { max-width: 760px; }
.comment.inline { margin: 4px 0 10px; }
.comment.inline .ch { padding: 6px 14px; font-size: 13px; }
.comment.inline .md { padding: 0 16px; }
.comment.inline .md p { margin: 8px 0; }
.comment.outdated { opacity: .8; }
.outdated-list { padding: 10px 14px; border: 1px solid var(--line); border-bottom: 0; background: var(--surface-2); }

/* ---- search ---- */
.search-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.search-form .q { display: flex; gap: 10px; align-items: center; }
.search-box { position: relative; flex: 1; min-width: 0; }
.search-box .i { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 42px !important; }
.search-form .pathfilter { width: 15em; max-width: 100%; font-size: 13px; padding: 4px 12px !important; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.hit { margin-bottom: 18px; }
.hit .fh { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--surface-2); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; font-size: 14px; overflow-wrap: anywhere; }
.hit .code { border-radius: 0 0 var(--r) var(--r); }
.filenames { columns: 2 18em; padding-left: 18px; font-family: var(--mono); font-size: 13px; }

/* ---- forms ---- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, legend { font-weight: 800; font-size: 14px; }
input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea {
  font: inherit; padding: 9px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
}
.field input, .field select, .field textarea, .stack > textarea, .stack > input, .search-box input, .auth-form input { width: 100%; }
.row select { border-radius: var(--pill); padding-right: 10px; }
.field input, .field select, .search-box input { border-radius: var(--pill); }
textarea { font-family: var(--mono); font-size: 13px; resize: vertical; border-radius: var(--r) !important; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.hint { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
[aria-invalid="true"] { border-color: var(--del-fg) !important; box-shadow: 0 0 0 1px var(--del-fg); }
fieldset { border: 1px solid var(--line-strong); border-radius: var(--r); padding: 10px 16px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.choice input { margin-top: 5px; width: 1.05em; height: 1.05em; }
.choice-row { display: flex; gap: 18px; flex-wrap: wrap; }
.repo-picks { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 6px 0; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 4.75em !important; }
.pw-wrap .reveal { position: absolute; right: 14px; top: 50%; translate: 0 -50%; font-size: 13px; }

/* ---- sign in & setup ---- */
.auth-card { position: relative; max-width: 27rem; margin: 84px auto 40px; padding: 30px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.auth-card .illo { width: 96px; height: 96px; margin: -78px auto 4px; color: var(--primary); filter: drop-shadow(0 6px 10px rgb(37 99 212 / 15%)); }
.auth-card h1 { margin: 4px 0 4px; font-size: 26px; text-align: center; }
.lede { color: var(--muted); margin-top: 0; text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.auth-form button.primary { width: 100%; padding: 11px; font-size: 16px; }
.auth-card details { margin-top: 16px; font-size: 14px; }
.auth-card summary { cursor: pointer; color: var(--link); font-weight: 700; }
.auth-card pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- settings ---- */
.secret-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.secret { font-size: 15px; padding: 9px 14px; background: var(--surface); border: 2px dashed var(--add-fg); border-radius: var(--r-sm); user-select: all; overflow-wrap: anywhere; }
table.tokens td { vertical-align: middle; }

/* ---- motion: opt in, gentle, decorative only ---- */
@keyframes drift { from { translate: 0 0; } to { translate: -24px 0; } }
@media (prefers-reduced-motion: no-preference) {
  .top::before { animation: drift 18s ease-in-out infinite alternate; }
  button, a.btn { transition: background-color .15s, border-color .15s, color .15s, translate .15s; }
  button:active, a.btn:active { translate: 0 1px; }
}

/* ---- Windows High Contrast / forced colors ---- */
@media (forced-colors: active) {
  .top::before, .top::after { display: none; }
  .top { border-bottom: 1px solid CanvasText; }
  .count, .state, .pill, .tag, .seg a.on, .tabs a.on, .top nav a[aria-current="page"] { border: 1px solid CanvasText; }
  .tabs a.on, .top nav a[aria-current="page"], .seg a.on { text-decoration: underline; }
  .i { forced-color-adjust: auto; }
}

@media print {
  .top::before, .top::after, .skip, .account { display: none; }
}
