/* GitOne — PyOne
   Thème « papier » : fond clair légèrement minéral, encre vert-noir, accent pétrole.
   Un seul motif fort : le rail de branche, réservé au contenu chronologique. */

@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/instrument-sans-latin-wght-normal.woff2") format("woff2"); 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: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/instrument-sans-latin-ext-wght-normal.woff2") format("woff2"); 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; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); 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: "JetBrains Mono"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2"); 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; }

/* Palette PyOne, tirée du logo (terre cuite #d67554) et de la bannière (noir #070508, blanc cassé).
   En thème clair, liens et boutons utilisent une terre cuite plus profonde pour rester lisibles (5,3:1). */
:root {
  --brand: #d67554;
  --paper: #f6f5f4;
  --surface: #ffffff;
  --sunken: #efedeb;
  --ink: #151113;
  --ink-2: #423c3e;
  --muted: #736b6d;
  --rule: #e3dfdd;
  --rule-strong: #ccc5c3;
  --accent: #b04e2d;
  --accent-ink: #8f3d21;
  --accent-wash: #fbefe9;
  --on-accent: #ffffff;
  --ok: #1e7a44;     --ok-wash: #e6f3eb;
  --warn: #8a5a00;   --warn-wash: #fbf2dd;
  --danger: #c0203f; --danger-wash: #fdebef;
  --merged: #6b46c1; --merged-wash: #f0ebfb;
  --add: #e6f4ea;    --add-num: #cfe9d7;
  --del: #fdecee;    --del-num: #f7d3d9;
  --hunk: #f7efeb;
  --focus: 0 0 0 3px rgba(214, 117, 84, .35);
  --pop-shadow: 0 10px 30px rgba(21, 17, 19, .14), 0 1px 3px rgba(21, 17, 19, .08);
  --sans: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r-ctl: 5px;
  --r-box: 8px;
  --sidebar: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    /* Thème sombre : le noir et le blanc cassé de la bannière, la terre cuite exacte du logo. */
    --paper: #0b090a; --surface: #141113; --sunken: #1d191b; --ink: #f1eee9; --ink-2: #cec8c3; --muted: #9a918d;
    --rule: #2b2628; --rule-strong: #3e3739; --accent: #d67554; --accent-ink: #e99a7b; --accent-wash: #2c1912; --on-accent: #1a0c06;
    --ok: #4fc27c; --ok-wash: #14291d; --warn: #e2a64c; --warn-wash: #2e2413; --danger: #f2687f; --danger-wash: #351820;
    --merged: #ab8ced; --merged-wash: #251e37; --add: #13291b; --add-num: #19361f; --del: #321820; --del-num: #431f28;
    --hunk: #241a17; --focus: 0 0 0 3px rgba(214, 117, 84, .42); --pop-shadow: 0 10px 30px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--sans); color: var(--ink); background: var(--paper); font-feature-settings: "ss01", "tnum"; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.012em; color: var(--ink); }
h1 { font-size: 24px; line-height: 1.2; }
h2 { font-size: 17px; line-height: 1.3; }
h3 { font-size: 14px; line-height: 1.4; }
p { margin: 0 0 10px; }
code, pre, kbd, .mono { font-family: var(--mono); font-size: 12.5px; font-feature-settings: "calt" 0; }
:where(code) { background: var(--sunken); border-radius: 3px; padding: 1px 5px; overflow-wrap: anywhere; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 24px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
.mt { margin-top: 14px; }
.narrow-form { max-width: 720px; }
.ctl-h { height: 34px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-ctl); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.icon { display: inline-block; vertical-align: -3px; flex-shrink: 0; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 32px; height: 32px; color: var(--rule-strong); }

/* ---------- Avatars : initiales sur pastille, teinte dérivée du nom ---------- */
.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font: 600 10px/1 var(--sans); letter-spacing: .02em; color: #fff; flex-shrink: 0; vertical-align: middle; }
.avatar.xs { width: 18px; height: 18px; font-size: 8px; }
.avatar.lg { width: 48px; height: 48px; font-size: 17px; }
.av-0 { background: #b04e2d; } .av-1 { background: #3d6b4a; } .av-2 { background: #7a4a12; } .av-3 { background: #5b3f99; }
.av-4 { background: #8c2f45; } .av-5 { background: #3b566b; } .av-6 { background: #5f6b2f; } .av-7 { background: #5e5557; }

/* ---------- Coquille : barre latérale + contenu ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--rule); background: var(--paper); padding: 18px 14px 14px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); padding: 2px 6px 16px; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark { height: 30px; width: 26px; flex-shrink: 0; display: block; }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name strong { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.brand-name span { font-size: 12px; color: var(--muted); }
.sidebar .menu-toggle { display: none; }
.sidebar-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.side-search { position: relative; margin-bottom: 14px; }
.side-search .icon { position: absolute; left: 9px; top: 9px; color: var(--muted); }
.side-search input { padding-left: 30px !important; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-ctl); color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--sunken); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--surface); color: var(--ink); box-shadow: inset 3px 0 0 var(--brand), 0 0 0 1px var(--rule); }
.nav a .icon { color: var(--muted); }
.nav a.active .icon { color: var(--accent); }
.nav .count { margin-left: auto; }
.side-section { margin-top: 22px; }
.side-section h2 { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; padding: 0 8px 6px; display: flex; align-items: center; }
.side-section h2 a { margin-left: auto; font-weight: 500; }
.side-repos a { display: block; padding: 4px 8px; border-radius: var(--r-ctl); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.side-repos a:hover { background: var(--sunken); text-decoration: none; color: var(--ink); }
.side-repos a.active { color: var(--ink); font-weight: 600; }
.side-repos .owner { color: var(--muted); }
.side-user { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--rule); }
.side-user-id { display: flex; gap: 10px; align-items: center; padding: 4px 6px 8px; }
.side-user-id div { min-width: 0; }
.side-user-id strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-id span { font-size: 12px; color: var(--muted); }
.side-user .nav a { font-size: 13px; padding: 5px 8px; }
.side-user form { margin: 0; }
.nav .linkbtn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 8px; border: 0; background: none; color: var(--ink-2); font: 500 13px var(--sans); cursor: pointer; border-radius: var(--r-ctl); text-align: left; }
.nav .linkbtn:hover { background: var(--sunken); color: var(--danger); }
.nav .linkbtn .icon { color: var(--muted); }

/* Le contenu occupe toute la largeur disponible (plafond seulement sur les très grands écrans) ;
   les formulaires gardent une largeur de lecture confortable. */
.content { padding: 28px 44px 64px; max-width: 1840px; width: 100%; min-width: 0; }
.content.narrow { max-width: 820px; margin-inline: auto; }
.panel > .form, .panel > .inline-form, .side-layout .form { max-width: 920px; }
.pagehead p, .panel > .desc { max-width: 80ch; }

/* ---------- En-têtes de page ---------- */
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead p { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.pagehead .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section { margin-top: 32px; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.back { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; margin-bottom: 12px; color: var(--muted); }

/* ---------- Boîtes ---------- */
.box { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-box); }
.box + .box { margin-top: 16px; }
.box-pad { padding: 18px 20px; }
.box-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--rule); font-weight: 600; font-size: 13px; }
.box-head .actions { margin-left: auto; display: flex; gap: 6px; }
.box-foot { padding: 12px 16px; border-top: 1px solid var(--rule); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.panel { padding: 20px 0; border-top: 1px solid var(--rule); }
.panel:first-of-type { border-top: 0; padding-top: 0; }
.panel > h2 { margin-bottom: 4px; }
.panel > .desc { color: var(--muted); font-size: 13px; margin-bottom: 14px; max-width: 70ch; }
.panel.danger > h2 { color: var(--danger); }

.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-top: 1px solid var(--rule); }
.rows > li:first-child { border-top: 0; }
.rows .main { flex: 1; min-width: 0; }
.rows .title { font-weight: 600; color: var(--ink); }
a.title:hover { color: var(--accent); }
.rows .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.rows .side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; color: var(--muted); font-size: 12.5px; }
.rows.compact > li { padding: 8px 16px; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin: 10px 0 4px; }
.empty .btn { margin-top: 12px; }

/* ---------- Contrôles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--rule-strong); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink); font: 500 13px/1 var(--sans); cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--sunken); color: var(--ink); }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.btn-merge { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-merge:hover { filter: brightness(.93); background: var(--ok); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-merge, .btn-merge:hover { color: #0b1a10; } }
/* Action destructrice : contour cramoisi, rempli seulement au survol (jamais confondue avec l'action principale). */
.btn-danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-danger:hover { color: #1a0a0e; } }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--sunken); }
.btn-warn-text { color: var(--danger); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }

:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) {
  width: 100%; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink); font: 400 14px var(--sans);
}
:where(textarea) { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
:where(select) { padding-right: 6px; }
:where(input, select, textarea):focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
:where(input:disabled, input[readonly]) { background: var(--sunken); color: var(--ink-2); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child, .label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 160px; }
.inline-form .field.fit { flex: 0 0 auto; min-width: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.choice { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 11px 12px; border: 1px solid var(--rule-strong); border-radius: var(--r-ctl); cursor: pointer; }
.choice input { margin-top: 3px; grid-row: span 2; }
.choice strong { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.choice span { color: var(--muted); font-size: 12.5px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }
.choices { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.choices legend { font-weight: 600; font-size: 13px; padding: 0; margin-bottom: 6px; }
.input-xs { width: 72px !important; }
.copy { display: flex; gap: 6px; }
.copy input { font-family: var(--mono); font-size: 12.5px; }
.rules { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12.5px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; }
.meter { height: 4px; border-radius: 2px; background: var(--sunken); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; transition: width .2s; }
.meter .s1 { width: 25%; background: var(--danger); } .meter .s2 { width: 50%; background: var(--warn); }
.meter .s3 { width: 75%; background: #4f8f3a; } .meter .s4 { width: 100%; background: var(--ok); }
.meter-label { font-size: 12px; color: var(--muted); min-height: 18px; }

/* ---------- Étiquettes ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 3px; font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--sunken); white-space: nowrap; vertical-align: middle; }
.tag .icon { width: 12px; height: 12px; vertical-align: 0; }
.tag-accent { color: var(--accent-ink); background: var(--accent-wash); }
.tag-ok { color: var(--ok); background: var(--ok-wash); }
.tag-warn { color: var(--warn); background: var(--warn-wash); }
.tag-danger { color: var(--danger); background: var(--danger-wash); }
.tag-merged { color: var(--merged); background: var(--merged-wash); }
.tag-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--rule-strong); }
.tag-mono { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); background: var(--accent-wash); }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11.5px; font-weight: 600; background: var(--sunken); color: var(--ink-2); }
.count-alert { background: var(--danger); color: #fff; }
.state { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-weight: 600; font-size: 13px; color: #fff; }
.state .icon { width: 14px; height: 14px; vertical-align: 0; }
.state-open { background: var(--ok); } .state-merged { background: var(--merged); } .state-closed { background: var(--danger); }
@media (prefers-color-scheme: dark) { .state, .count-alert { color: #120d0e; } }

/* ---------- Messages ---------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r-box); margin-bottom: 18px; border-left: 3px solid; background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); }
.notice > .icon { margin-top: 1px; }
.notice ul { margin: 4px 0 0; padding-left: 18px; }
.notice .detail { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.notice-info { border-color: var(--accent); } .notice-info > .icon { color: var(--accent); }
.notice-success { border-color: var(--ok); } .notice-success > .icon { color: var(--ok); }
.notice-warn { border-color: var(--warn); background: var(--warn-wash); } .notice-warn > .icon { color: var(--warn); }
.notice-error { border-color: var(--danger); background: var(--danger-wash); } .notice-error > .icon { color: var(--danger); }
.reveal { margin-top: 10px; display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.reveal > div { display: flex; flex-direction: column; gap: 3px; }
.reveal code { font-size: 14px; padding: 5px 9px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.reveal .copy { min-width: min(520px, 100%); }

/* ---------- Menus déroulants ---------- */
details.pop { position: relative; display: inline-block; }
details.pop > summary { list-style: none; }
details.pop > summary::-webkit-details-marker { display: none; }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid currentColor; opacity: .6; }
.pop-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 240px; max-width: min(420px, 90vw); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-box); box-shadow: var(--pop-shadow); padding: 6px; }
.pop-menu.right { left: auto; right: 0; }
.pop-menu.scroll { max-height: 340px; overflow: auto; }
.pop-menu .pop-title { padding: 6px 8px 8px; font-size: 12.5px; color: var(--muted); }
.pop-menu a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-ctl); color: var(--ink); }
.pop-menu a:hover { background: var(--sunken); text-decoration: none; }
.pop-menu a.selected { font-weight: 600; }
.pop-menu a .check-slot { width: 14px; display: inline-flex; color: var(--accent); }
.pop-section { padding: 8px; }
.pop-section + .pop-section { border-top: 1px solid var(--rule); }
.pop-section .label { display: block; margin-bottom: 6px; }
.pop-section p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: middle; border-top: 1px solid var(--rule); }
.table thead th { border-top: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--sunken) 55%, transparent); }
.table td.num, .table th.num { text-align: right; }
.table .row-muted td { color: var(--muted); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who strong { display: block; }
.who .meta { font-size: 12.5px; color: var(--muted); }
.ua { max-width: 360px; }
.table code:not(.json) { white-space: nowrap; overflow-wrap: normal; }

/* ---------- Rail chronologique (commits, revues, activité) ---------- */
.rail { list-style: none; margin: 0; padding: 0; position: relative; }
.rail::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: var(--rule); border-radius: 1px; }
.rail > li { position: relative; padding: 0 0 18px 36px; }
.rail > li:last-child { padding-bottom: 0; }
.rail .node { position: absolute; left: 6px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-2); }
.rail .node.accent { border-color: var(--brand); }
.rail .node.ok { border-color: var(--ok); background: var(--ok); }
.rail .node.merged { border-color: var(--merged); background: var(--merged); border-radius: 3px; transform: rotate(45deg); width: 11px; height: 11px; left: 6.5px; }
.rail .node.danger { border-color: var(--danger); background: var(--danger); }
.rail .node.warn { border-color: var(--warn); }
.rail .node.avatar-node { width: 24px; height: 24px; left: 0; top: 0; border: 0; background: none; }
.rail .day { font-size: 12.5px; font-weight: 600; color: var(--muted); padding-bottom: 10px; }
.rail .day .node { width: 8px; height: 8px; left: 8px; top: 6px; background: var(--rule-strong); border: 0; }
.rail-item { display: flex; gap: 12px; align-items: flex-start; }
.rail-item .main { flex: 1; min-width: 0; }
.rail-item .meta { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.rail-item .side { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.commit-title { color: var(--ink); font-weight: 600; }
.commit-title:hover { color: var(--accent); }
.sha { font-family: var(--mono); font-size: 12px; color: var(--ink-2); padding: 2px 6px; border-radius: 3px; background: var(--sunken); }
a.sha:hover { text-decoration: none; color: var(--accent); }
.rail .bubble { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-box); }
.bubble-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid var(--rule); font-size: 13px; }
.bubble-body { padding: 12px 14px; }
.bubble.approved { border-color: color-mix(in srgb, var(--ok) 45%, var(--rule)); }
.bubble.changes_requested { border-color: color-mix(in srgb, var(--danger) 45%, var(--rule)); }
.event-line { font-size: 13px; color: var(--ink-2); padding-top: 2px; }
.event-line strong { color: var(--ink); }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); }
/* Panneau de marque : même fond que la bannière PyOne, rails en gris, branche active en terre cuite. */
.auth-side { --auth-bg: #070508; position: relative; overflow: hidden; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; background: var(--auth-bg); color: #f1eee9; }
.auth-wordmark { display: inline-block; align-self: flex-start; position: relative; z-index: 1; }
.auth-wordmark img { display: block; width: 187px; height: auto; }
.auth-statement { max-width: 34ch; position: relative; z-index: 1; }
.auth-statement h1 { font-size: 34px; line-height: 1.12; letter-spacing: -.022em; font-weight: 600; color: #f6f3ee; }
.auth-statement p { color: #a9a39b; margin-top: 14px; font-size: 15px; max-width: 42ch; }
.auth-graph { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: rgba(255, 255, 255, .13); }
.auth-graph .lead { color: #d67554; }
.auth-legal { font-size: 12.5px; color: #8d877f; position: relative; z-index: 1; max-width: 30ch; }
.auth-main { background: var(--surface); display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
.auth-card { width: 100%; max-width: 360px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-card .lead { color: var(--muted); margin-bottom: 22px; }
.auth-card .form { gap: 14px; }
.auth-card .btn-primary { height: 38px; font-size: 14px; }
.auth-alt { margin-top: 18px; font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }
.otp { font-family: var(--mono) !important; font-size: 20px !important; letter-spacing: .35em; text-align: center; height: 44px !important; }
.qr { display: flex; justify-content: center; margin: 4px 0 10px; }
.qr svg { width: 176px; height: 176px; border-radius: 6px; background: #fff; padding: 4px; box-shadow: inset 0 0 0 1px var(--rule); }
.secret-key { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 16px; }
.secret-key code { font-size: 12.5px; letter-spacing: .06em; }
.steps { margin: 0 0 14px; padding-left: 20px; color: var(--ink-2); }
.steps li { margin-bottom: 4px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 14px 0; }
.codes code { text-align: center; font-size: 14px; padding: 7px; }

/* ---------- Tableau de bord ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 24vw, 400px); gap: 40px; align-items: start; }
.dash-aside .codeblock { white-space: pre-wrap; word-break: break-all; }
.queue-group + .queue-group { margin-top: 28px; }
.queue-group h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.queue-group h2 .count { font-size: 12px; }
.attention { display: flex; flex-direction: column; gap: 8px; margin-bottom: 26px; }
.dash-aside .box + .box { margin-top: 16px; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr auto; }
.facts dt, .facts dd { padding: 8px 0; border-top: 1px solid var(--rule); margin: 0; font-size: 13px; }
.facts dt { color: var(--ink-2); }
.facts dd { text-align: right; font-weight: 600; }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }
.facts .bad { color: var(--danger); } .facts .fine { color: var(--ok); } .facts .soso { color: var(--warn); }
.codeblock { margin: 0; padding: 10px 12px; background: var(--sunken); border-radius: var(--r-ctl); overflow-x: auto; white-space: pre; line-height: 1.6; }

/* ---------- Dépôt ---------- */
.repohead { margin-bottom: 18px; }
.repohead-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.repohead h1 { font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
.repohead h1 a { color: var(--ink-2); }
.repohead h1 a.name { color: var(--ink); font-weight: 650; }
.repohead h1 .slash { color: var(--rule-strong); margin: 0 6px; font-weight: 400; }
.repohead .desc { margin: 6px 0 0; color: var(--muted); }
.tabs { display: flex; gap: 22px; margin-top: 16px; border-bottom: 1px solid var(--rule); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { display: flex; align-items: center; gap: 7px; padding: 8px 0 10px; color: var(--ink-2); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; border-bottom-color: var(--rule-strong); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.tabs a .icon { color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.crumbs { font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.crumbs .slash { color: var(--rule-strong); margin: 0 5px; }
.crumbs strong { font-weight: 600; }
.repo-stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.repo-stats a { color: var(--ink-2); }
.lastcommit { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--rule); background: var(--paper); border-radius: var(--r-box) var(--r-box) 0 0; font-size: 13px; flex-wrap: wrap; }
.lastcommit .msg { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.files td { padding: 7px 16px; border-top: 1px solid var(--rule); font-size: 13.5px; }
.files tr:first-child td { border-top: 0; }
.files tr:hover td { background: color-mix(in srgb, var(--sunken) 50%, transparent); }
.files a { color: var(--ink); display: inline-flex; gap: 8px; align-items: center; }
.files a:hover { color: var(--accent); }
.files .icon-dir { color: var(--accent); }
.files .icon-file { color: var(--muted); }
.files .size { width: 1%; white-space: nowrap; text-align: right; color: var(--muted); font-size: 12.5px; }
.readme-head { display: flex; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--rule); font-size: 13px; font-weight: 600; }
.readme-body { padding: 24px 32px; }
.plain-readme { white-space: pre-wrap; margin: 0; }
.blob-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--rule); background: var(--paper); border-radius: var(--r-box) var(--r-box) 0 0; }
.code-view { display: flex; overflow-x: auto; }
.code-view pre { margin: 0; padding: 12px 0; font-size: 12.5px; line-height: 20px; }
.gutter { padding: 12px 12px 12px 16px !important; text-align: right; color: var(--muted); user-select: none; border-right: 1px solid var(--rule); min-width: 52px; }
.gutter a { color: inherit; }
.gutter a:target { color: var(--accent); font-weight: 700; }
.code-view .src { flex: 1; padding-left: 16px !important; tab-size: 4; }
.blob-image { padding: 24px; text-align: center; background: repeating-conic-gradient(var(--sunken) 0 25%, var(--surface) 0 50%) 50% / 18px 18px; }
.blob-image img { max-width: 100%; }
.editor { font-family: var(--mono) !important; font-size: 13px !important; line-height: 1.6 !important; min-height: 440px; white-space: pre; overflow-wrap: normal; overflow-x: auto; tab-size: 4; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 20px; border: 1.5px dashed var(--rule-strong); border-radius: var(--r-box); text-align: center; cursor: pointer; color: var(--ink-2); background: var(--surface); }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-wash); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-list { margin-top: 10px; font-size: 13px; }
.upload-list li { padding: 3px 0; }

/* ---------- Diff ---------- */
.diff-summary { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; font-size: 13px; color: var(--ink-2); }
.diff-toc { margin-bottom: 18px; font-size: 13px; }
.diff-toc li { padding: 3px 0; display: flex; gap: 8px; align-items: center; }
.plus { color: var(--ok); font-weight: 600; font-family: var(--mono); font-size: 12px; }
.minus { color: var(--danger); font-weight: 600; font-family: var(--mono); font-size: 12px; }
.diff-file { margin-bottom: 16px; }
.diff-file-head { display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--rule); background: var(--paper); border-radius: var(--r-box) var(--r-box) 0 0; position: sticky; top: 0; z-index: 2; font-size: 13px; }
.diff-file-head .path { font-family: var(--mono); font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.change { font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 3px; background: var(--sunken); color: var(--ink-2); }
.change-added { color: var(--ok); background: var(--ok-wash); } .change-deleted { color: var(--danger); background: var(--danger-wash); } .change-renamed { color: var(--merged); background: var(--merged-wash); }
table.diff { font-family: var(--mono); font-size: 12.5px; }
table.diff td { padding: 0 10px; line-height: 20px; vertical-align: top; }
table.diff .ln { width: 1%; min-width: 48px; text-align: right; color: var(--muted); user-select: none; }
table.diff .code { white-space: pre; width: 100%; }
table.diff .mk { display: inline-block; width: 14px; color: var(--muted); user-select: none; }
table.diff tr.add td { background: var(--add); } table.diff tr.add .ln { background: var(--add-num); }
table.diff tr.del td { background: var(--del); } table.diff tr.del .ln { background: var(--del-num); }
table.diff tr.hunk td { background: var(--hunk); color: var(--muted); padding-top: 3px; padding-bottom: 3px; }
table.diff tr.meta td { color: var(--muted); font-style: italic; }

/* ---------- Pull requests ---------- */
.prhead h1 { font-size: 24px; font-weight: 600; }
.prhead h1 .num { color: var(--muted); font-weight: 400; }
.prhead .by { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; color: var(--ink-2); font-size: 13.5px; }
.pr-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 20vw, 340px); gap: 32px; align-items: start; margin-top: 20px; }
.pr-side .box + .box { margin-top: 14px; }
.mergebox { padding: 16px 18px; }
.mergebox h3 { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.mergebox.ready h3 .icon { color: var(--ok); }
.mergebox.blocked h3 .icon { color: var(--warn); }
.mergebox ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.mergebox .merge-form { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); }
.compare { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.compare .arrow { padding-bottom: 8px; color: var(--muted); }
.pr-row-state.open .icon { color: var(--ok); } .pr-row-state.merged .icon { color: var(--merged); } .pr-row-state.closed .icon { color: var(--danger); }
.segmented { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--r-ctl); overflow: hidden; }
.segmented a { padding: 5px 12px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.segmented a + a { border-left: 1px solid var(--rule-strong); }
.segmented a:hover { background: var(--sunken); text-decoration: none; }
.segmented a.active { background: var(--ink); color: var(--paper); }

/* ---------- Paramètres (compte, dépôt, admin) ---------- */
.side-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; align-items: start; }
.subnav { display: flex; flex-direction: column; gap: 1px; position: sticky; top: 24px; }
.subnav a { padding: 6px 10px; border-radius: var(--r-ctl); color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.subnav a:hover { background: var(--sunken); text-decoration: none; color: var(--ink); }
.subnav a.active { color: var(--ink); background: var(--surface); box-shadow: inset 3px 0 0 var(--brand), 0 0 0 1px var(--rule); }
.subnav a .count { margin-left: auto; }
.danger-row { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.danger-row:first-of-type { border-top: 0; padding-top: 4px; }
.danger-row .what { flex: 1; min-width: 240px; }
.danger-row .what p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.danger-row form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.danger-row form input { width: 240px; }
.profile { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 26px; }
.profile h1 { font-size: 22px; }
.profile .meta { color: var(--muted); margin-top: 2px; }
.profile .tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.profile .when { margin-left: auto; text-align: right; font-size: 12.5px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; align-items: start; }
.action-stack { display: flex; flex-direction: column; gap: 8px; }
.action-stack form { margin: 0; }
.action-stack .btn { width: 100%; justify-content: flex-start; height: 34px; }
.health { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); border-top: 1px solid var(--rule); }
.health div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); }
.health dt { font-size: 13px; color: var(--muted); }
.health dd { margin: 2px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.health dd .sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.health dd.bad { color: var(--danger); } .health dd.fine { color: var(--ok); } .health dd.soso { color: var(--warn); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters input, .filters select { width: auto; }
.filters input[type=search], .filters .wide { flex: 1; min-width: 220px; }
.filters label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.json { font-size: 11.5px; color: var(--ink-2); max-width: 420px; white-space: pre-wrap; display: inline-block; background: none; padding: 0; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 18px 0; font-size: 13px; color: var(--muted); }

/* ---------- Erreurs ---------- */
.error-page { padding: 64px 0; max-width: 520px; }
.error-page .code { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.error-page p { color: var(--ink-2); margin: 10px 0 20px; }

/* ---------- Markdown ---------- */
.markdown { line-height: 1.65; overflow-wrap: break-word; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown h1, .markdown h2, .markdown h3 { margin: 1.4em 0 .5em; }
.markdown h1 { font-size: 24px; } .markdown h2 { font-size: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.markdown p, .markdown ul, .markdown ol, .markdown table, .markdown pre, .markdown blockquote { margin: 0 0 14px; }
.markdown pre { padding: 12px 14px; background: var(--sunken); border-radius: var(--r-ctl); overflow-x: auto; line-height: 1.55; }
.markdown table { width: auto; }
.markdown th, .markdown td { border: 1px solid var(--rule); padding: 6px 12px; }
.markdown th { background: var(--paper); font-weight: 600; }
.markdown blockquote { padding: 2px 14px; border-left: 3px solid var(--accent); color: var(--ink-2); }
.md-img { color: var(--muted); font-style: italic; }

/* ---------- Coloration syntaxique (palette GitOne) ---------- */
.hljs { color: var(--ink); background: transparent; }
.hljs-comment, .hljs-quote { color: #7a8781; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-meta .hljs-keyword { color: #8a3b6f; }
.hljs-string, .hljs-regexp, .hljs-template-tag, .hljs-addition { color: #2f6b3a; }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: #a0520c; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #2f5d8a; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-property { color: #4a5868; }
.hljs-type, .hljs-title.class_, .hljs-class .hljs-title { color: #5b3f99; }
.hljs-meta, .hljs-tag, .hljs-name { color: #5c5a52; }
.hljs-deletion { color: var(--danger); }
.hljs-emphasis { font-style: italic; } .hljs-strong { font-weight: 700; }
@media (prefers-color-scheme: dark) {
  .hljs-comment, .hljs-quote { color: #7e8b85; }
  .hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-meta .hljs-keyword { color: #e68cc4; }
  .hljs-string, .hljs-regexp, .hljs-template-tag, .hljs-addition { color: #8fd19e; }
  .hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: #f0b072; }
  .hljs-title, .hljs-title.function_, .hljs-section { color: #8db8e3; }
  .hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-property { color: #a9c3d6; }
  .hljs-type, .hljs-title.class_, .hljs-class .hljs-title { color: #c2a8f2; }
  .hljs-meta, .hljs-tag, .hljs-name { color: #b5b2a8; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .dash, .pr-grid { grid-template-columns: 1fr; }
  .content { padding: 24px 28px 56px; }
  .side-layout { grid-template-columns: 1fr; gap: 18px; }
  .subnav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rule); gap: 18px; }
  .subnav a, .subnav a.active { white-space: nowrap; padding: 6px 0 9px; border-radius: 0; background: none; box-shadow: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
  .subnav a.active { border-bottom-color: var(--ink); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .content { min-width: 0; }
  .repohead h1 { font-size: 18px; overflow-wrap: anywhere; }
  .toolbar > .spacer { display: none; }
  .sidebar { position: sticky; top: 0; height: auto; z-index: 30; flex-direction: column; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .sidebar-top { display: flex; align-items: center; }
  .brand { padding: 4px 0; }
  .sidebar .menu-toggle { display: inline-flex; margin-left: auto; }
  .sidebar-body { display: none; padding-top: 12px; max-height: calc(100vh - 60px); overflow-y: auto; }
  body.nav-open .sidebar-body { display: flex; }
  .content { padding: 20px 16px 48px; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-mobile-brand { display: flex; }
  .auth-main { padding: 28px 16px; min-height: 100vh; }
  .rules { grid-template-columns: 1fr; }
  .readme-body { padding: 18px; }
  .two-col { grid-template-columns: 1fr; }
  .danger-row form input { width: 100%; }
  .profile .when { margin-left: 0; text-align: left; }
}
