/* Styles of the mock-up (maquette.html), followed by the rules of the pages it does not show. */
/* Layout: read-only app shell, fixed top bar and tab rail, content in light cards like a production board. */
:root {
  --bg: #FBF9F7;
  --card: #FFFFFF;
  --line: #E6E6E6;
  --rule: #EDEDED;
  --ink: #2D2D2E;
  --ink-2: #4A4A4C;
  --muted: #6B6B6D;
  --coral: #F36858;
  --coral-dk: #E14B3A;
  --red: #C23A2A;
  --rose: #FEEAEA;
  --coral-pale: #FBC4BC;
  --ok: #2E7D5B;
  --warn: #B8860B;
  --radius: 14px;
  color-scheme: light;
  --sans: "Urbanist", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 500;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -0.4px; text-wrap: balance; }
a { color: var(--coral-dk); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- topbar ---- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding-block: 12px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--card); z-index: 21; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; letter-spacing: -0.6px; }
.brand .dot { width: 26px; height: 26px; border-radius: 8px; background: var(--coral); display: grid; place-items: center; color: #fff; font-size: 15px; }
.proj-pill {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--rose); color: var(--red); border: 1px solid var(--coral-pale);
  padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px;
}
.proj-pill .chev { color: var(--coral-dk); }
.spacer { flex: 1 1 auto; }
.ro-badge { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 4px 9px; border-radius: 999px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--coral), var(--coral-dk)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }

/* ---- tabs ---- */
.tabs {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 57px); z-index: 15;
  background: var(--bg); border-bottom: 1px solid var(--line);
  display: flex; gap: 4px; overflow-x: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.tab { appearance: none; background: none; border: none; font: inherit; cursor: pointer;
  padding: 13px 14px 11px; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap;
  border-bottom: 3px solid transparent; }
.tab[aria-current="true"] { color: var(--ink); border-bottom-color: var(--coral); }

main {
  padding-block: 26px 60px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  max-width: 1360px; margin: 0 auto;
}
.view[hidden] { display: none !important; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--coral-dk); }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.view-head h1 { font-size: clamp(26px, 4vw, 38px); }
.view-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---- board ---- */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
/* The board uses the whole width and stays within the viewport, so its horizontal scrollbar is always reachable. */
main:has(.board) { max-width: none; }
.board { max-height: max(320px, calc(100dvh - 300px)); overflow-y: auto; align-items: flex-start; }
.col { flex: 0 0 236px; min-width: 236px; display: flex; flex-direction: column; gap: 10px; }
.col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.col-head .node { font-size: 11px; font-weight: 800; color: var(--coral-dk); letter-spacing: 0.5px; }
.col-head .name { font-weight: 800; font-size: 14px; }
.col-head .count { font-size: 12px; color: var(--muted); font-weight: 700; }
.col-rail { height: 3px; border-radius: 3px; background: var(--rule); }
.col.done .col-rail { background: var(--ok); }
.col.active .col-rail { background: var(--coral); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 13px; cursor: pointer; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 1px 2px rgba(45,45,46,0.04);
}
.card:hover { border-color: var(--coral-pale); }
.card.anomaly { border-left: 4px solid var(--red); }
.card .id { font-size: 11px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.card .title { font-weight: 700; font-size: 14px; line-height: 1.3; color: var(--ink); }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.who { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink-2); }
.mini-av { width: 18px; height: 18px; border-radius: 50%; background: var(--coral-pale); color: var(--red); display: grid; place-items: center; font-size: 9px; font-weight: 800; }
.flag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 6px; border-radius: 6px; background: var(--rose); color: var(--red); }
.col.done .card { background: #fff; }
.empty-col { font-size: 12px; color: #b9b4ae; text-align: center; padding: 14px 0; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---- generic card block ---- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1.3fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ---- frieze (ticket) ---- */
.frieze { display: flex; flex-direction: column; gap: 0; }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 14px; }
.step .marker { display: flex; flex-direction: column; align-items: center; }
.step .bullet { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; border: 2px solid var(--line); background: #fff; color: var(--muted); flex: 0 0 auto; }
.step.ok .bullet { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.current .bullet { background: var(--coral); border-color: var(--coral); color: #fff; }
.step.anom .bullet { background: var(--red); border-color: var(--red); color: #fff; }
.step .line { flex: 1 1 auto; width: 2px; background: var(--rule); margin: 2px 0; min-height: 10px; }
.step:last-child .line { display: none; }
.step.ok .line { background: var(--ok); }
.step .body { padding-bottom: 20px; }
.step .srow { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.step .node { font-size: 11px; font-weight: 800; color: var(--coral-dk); }
.step .label { font-weight: 800; font-size: 15px; }
.step .st { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 6px; }
.st.s-ok { background: #E3F2EA; color: var(--ok); }
.st.s-cur { background: var(--rose); color: var(--red); }
.st.s-wait { background: #F1EFEC; color: var(--muted); }
.st.s-anom { background: #FBE3DF; color: var(--red); }
.step .proof { margin-top: 5px; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.step .proof b { font-weight: 700; color: var(--ink); }

.links { display: flex; gap: 10px; flex-wrap: wrap; }
.link-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 13px; font-size: 13px; font-weight: 700; color: var(--ink); }
.link-chip:hover { border-color: var(--coral-pale); text-decoration: none; }
.link-chip .ic { color: var(--coral-dk); }
.link-chip.ci-ok .ic { color: var(--ok); }

/* key-value */
dl.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; }
dl.kv dt { color: var(--muted); font-weight: 700; }
dl.kv dd { margin: 0; color: var(--ink); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 700; background: var(--rose); color: var(--red); padding: 3px 9px; border-radius: 999px; }
.chip.n { background: #F1EFEC; color: var(--ink-2); }

/* A-node list */
.nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.anode { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 600; }
.anode .tick { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 900; flex: 0 0 auto; }
.anode.ok .tick { background: var(--ok); color: #fff; }
.anode.off { color: var(--muted); }
.anode.off .tick { background: #EDEBE8; color: #b9b4ae; }

/* decisions */
.dec { border-left: 4px solid var(--coral); padding: 2px 0 2px 14px; display: flex; flex-direction: column; gap: 4px; }
.dec h3 { font-size: 15px; }
.dec .st { align-self: flex-start; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 6px; background: #E3F2EA; color: var(--ok); }
.dec .src { font-size: 12px; color: var(--muted); }

/* repo picker */
.repo { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; }
.repo:hover { border-color: var(--coral-pale); }
.repo .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--rose); color: var(--red); display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.repo .n { font-weight: 800; }
.repo .sub { font-size: 12px; color: var(--muted); }
.repo .eq { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--ok); background: #E3F2EA; padding: 3px 9px; border-radius: 999px; }
.repo.no { cursor: default; opacity: 0.7; }
.repo.no:hover { border-color: var(--line); }
.repo.no .eq { color: var(--muted); background: #F1EFEC; }

.section-title { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; margin-bottom: 10px; }
.note { font-size: 13px; color: var(--ink-2); background: var(--rose); border: 1px solid var(--coral-pale); border-radius: 10px; padding: 10px 13px; display: flex; gap: 9px; }
.note .i { color: var(--red); font-weight: 900; }

/* ---- exchanges thread (issue + PR) ---- */
.thread-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: inline-flex; background: #F1EFEC; border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { appearance: none; border: none; background: none; font: inherit; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); padding: 5px 15px; border-radius: 999px; }
.seg button[aria-current="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(45,45,46,0.08); }
.thread { display: flex; flex-direction: column; gap: 14px; }
.cmt { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.cmt .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; flex: 0 0 auto; }
.cmt .bubble { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; min-width: 0; }
.cmt.review .bubble { border-left: 3px solid var(--coral); }
.cmt .hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 13px; border-bottom: 1px solid var(--rule); background: #FDFBFA; font-size: 13px; }
.cmt .hd .au { font-weight: 800; color: var(--ink); }
.cmt .hd .tm { color: var(--muted); font-size: 12px; margin-left: auto; }
.cmt .src { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 7px; border-radius: 6px; }
.src.issue { background: #EDF3FF; color: #3A62B8; }
.src.pr { background: var(--rose); color: var(--red); }
.cmt .rv { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--coral-dk); }
.cmt .tx { padding: 10px 13px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.cmt .tx code { background: #F1EFEC; padding: 1px 5px; border-radius: 5px; font-size: 13px; }

@media (max-width: 720px) {
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
  /* The topbar wraps on several rows on a phone: let it scroll away and keep only the tabs pinned. */
  .topbar { position: static; }
  .tabs { top: 0; }
  dl.kv { grid-template-columns: 1fr; gap: 4px; }
  dl.kv dd { margin-bottom: 10px; }
}

/* ---- additions: server-rendered pages ---- */
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--coral); }
a.tab:hover { text-decoration: none; }
a.proj-pill:hover { text-decoration: none; }
.history { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 20px; font-size: 13px; color: var(--ink-2); }
.history form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.history label { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); }
.history input, .history button { font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: #fff; color: var(--ink); }
.history button { cursor: pointer; font-weight: 700; }
.history p { margin: 0; }
.login { max-width: 420px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 16px; }
.login p { margin: 0; color: var(--muted); font-size: 14px; }
.col-head h2 { font-size: inherit; letter-spacing: 0; }
.cards, .repos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.repos { max-width: 720px; }
a.card { color: inherit; text-decoration: none; }
.card .dev { display: inline-flex; align-items: center; gap: 6px; }
.card .flag { align-self: flex-start; }
.repo { position: relative; }
.repo .n, .repo .sub { overflow-wrap: anywhere; }
.repo a.name { color: inherit; }
.repo a.name::after { content: ""; position: absolute; inset: 0; }
.frieze, .thread { list-style: none; margin: 0; padding: 0; }
.step h2 { display: contents; font-size: inherit; letter-spacing: 0; }
.step .facts { margin-top: 5px; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.step .facts .by { font-weight: 700; color: var(--ink); }
.step .facts .proof { margin: 0; display: inline; overflow-wrap: anywhere; }
.step.skip { opacity: 0.55; }
.step.skip .label { text-decoration: line-through; }
.st.s-skip { background: #F1EFEC; color: var(--muted); }
.link-chip a { color: inherit; }
.link-chip[data-ic]::before { content: attr(data-ic) / ""; color: var(--coral-dk); }
.link-chip.ci-ok::before { color: var(--ok); }
.link-chip.ci-ko::before { color: var(--red); }
.links a.branch { overflow-wrap: anywhere; }
.exchanges { margin-top: 16px; }
.thread-head .section-title { margin: 0; }
.seg a { font-size: 13px; font-weight: 700; color: var(--muted); padding: 5px 15px; border-radius: 999px; }
.seg a:hover { text-decoration: none; }
.seg a[aria-current="page"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(45,45,46,0.08); }
.cmt .av { background: var(--coral); }
.cmt .tx > :first-child { margin-top: 0; }
.cmt .tx > :last-child { margin-bottom: 0; }
.project { align-items: start; }
dl.kv > div { display: contents; }
dl.kv ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
dl.kv ul.chips { flex-direction: row; }
dl.kv dd p { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
dl.kv dd .note p, #etat .note p { margin: 0; }
dl.kv .rules { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
#etat .nodes { list-style: none; margin: 0; padding: 0; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
#etat .anode { flex-wrap: wrap; }
#etat .anode .title { flex: 1 1 0; min-width: 0; }
#etat .anode .status { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
#etat .anode.ok .status { color: var(--ok); }
#etat .deliverables { flex-basis: 100%; list-style: none; margin: 0; padding: 0 0 0 26px; font-size: 12px; font-weight: 500; color: var(--ink-2); overflow-wrap: anywhere; }
.decisions { margin-top: 16px; }
.decisions > ul { list-style: none; margin: 0; padding: 0; gap: 20px; }
.dec .sep { display: none; }
.dec .st.s-cur { background: var(--rose); color: var(--red); }
.dec .anomaly { color: var(--red); }
/* Ticket list: the table scrolls horizontally inside its container on a phone, never the page. */
.table-scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.tickets { width: 100%; border-collapse: collapse; font-size: 14px; }
.tickets th { text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.tickets th, .tickets td { padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.tickets tr:last-child td { border-bottom: none; }
.tickets .number { font-weight: 800; color: var(--muted); white-space: nowrap; }
.tickets .title { min-width: 200px; font-weight: 700; }
.tickets .st { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.tickets .developer { white-space: nowrap; color: var(--ink-2); }

/* Long node headings wrap so the status stays in view on a phone. */
@media (max-width: 720px) {
  .tickets th, .tickets td { padding: 8px 10px; vertical-align: top; }
  .tickets .title { min-width: 140px; }
  .tickets .st { white-space: normal; }
}
