/* Espace BTS Banque — feuille de style
   Direction : papier comptable, filets de relevé bancaire, motif de guilloché. */

@font-face { font-family: "Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Serif"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-serif-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plex Serif"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-serif-latin-600-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --paper: #f2f5f2;
  --surface: #fcfcfb;
  --ink: #14232b;
  --ink-2: #44555c;
  --ink-3: #596a70;
  --rule: #d3dad6;
  --rule-strong: #aab7b0;
  --green: #12805f;
  --green-ink: #0c6a4f;
  --green-deep: #0b3f33;
  --green-wash: #e2f0ea;
  --brass: #cf7a1c;
  --brass-ink: #86490a;
  --brass-wash: #fbf0df;
  --blue: #3a6bb5;
  --red: #b3362f;
  --red-wash: #fbe9e7;
  --focus: #1f5fbf;
  --serif: "Plex Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 3px;
  --shadow: 0 1px 0 rgba(20, 35, 43, .05), 0 6px 18px -10px rgba(20, 35, 43, .28);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; color: var(--ink); }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8em; }
a { color: var(--green-ink); text-underline-offset: 2px; }
a:hover { color: var(--green-deep); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.neg { color: var(--red); }
.hidden { display: none !important; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 1rem; }

/* ---------- Masthead ---------- */
.masthead { background: var(--surface); border-bottom: 1px solid var(--rule-strong); position: relative; }
.masthead::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 3px; border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); background: transparent; pointer-events: none; }
.masthead-in { max-width: 1120px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.brand-text small { color: var(--ink-3); font-size: .8rem; }
.who { display: flex; align-items: center; gap: .6rem; font-size: .9rem; flex-wrap: wrap; justify-content: flex-end; }
.who .name { font-weight: 500; }
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 500; background: var(--green-wash); color: var(--green-deep); border: 1px solid #b6d8cb; white-space: nowrap; }
.badge.brass { background: var(--brass-wash); color: var(--brass-ink); border-color: #ecc994; }
.badge.red { background: var(--red-wash); color: var(--red); border-color: #efb9b3; }
.badge.grey { background: #eceeed; color: var(--ink-2); border-color: var(--rule); }

.tabs { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: .6rem .9rem .55rem; text-decoration: none; color: var(--ink-2); font-weight: 500; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); background: #f3f6f4; }
.tabs a[aria-current="page"] { color: var(--green-deep); border-bottom-color: var(--green); }
.tabs.admin { display: block; background: var(--brass-wash); max-width: none; border-top: 1px solid #ecd2a8; padding: 0; }
.tabs.admin .tabs-in { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; display: flex; gap: .25rem; align-items: center; overflow-x: auto; }
.tabs.admin .lbl { font-family: var(--serif); font-weight: 600; color: var(--brass-ink); padding-right: .6rem; margin-right: .3rem; border-right: 1px solid #e3bd83; white-space: nowrap; }
.tabs.admin a[aria-current="page"] { color: var(--brass-ink); border-bottom-color: var(--brass); }
.tabs.admin a:hover { background: #f8e6c8; }

main { max-width: 1120px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.page-head { margin-bottom: 1.5rem; padding-bottom: .7rem; border-bottom: 4px double var(--rule-strong); }
.page-head p { margin: .35rem 0 0; color: var(--ink-2); max-width: 70ch; }

/* ---------- Boutons et champs ---------- */
.btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .45rem 1rem; border-radius: var(--radius); border: 1px solid var(--green-ink); background: var(--green-ink); color: #fff; font-weight: 500; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.btn.secondary { background: var(--surface); color: var(--green-deep); border-color: var(--rule-strong); }
.btn.secondary:hover { background: var(--green-wash); border-color: var(--green-ink); color: var(--green-deep); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--green-ink); padding-inline: .6rem; }
.btn.ghost:hover { background: var(--green-wash); color: var(--green-deep); }
.btn.danger { background: var(--surface); color: var(--red); border-color: #e2aaa5; }
.btn.danger:hover { background: var(--red-wash); border-color: var(--red); color: var(--red); }
.btn.small { min-height: 32px; padding: .2rem .65rem; font-size: .875rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg, .ic { width: 1.1em; height: 1.1em; flex: none; }

.field { display: flex; flex-direction: column; gap: .3rem; }
.field > label, .field > .label { font-weight: 500; font-size: .92rem; }
.field .hint { color: var(--ink-3); font-size: .85rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="url"], input[type="search"], input[type="email"], select, textarea {
  width: 100%; min-height: 40px; padding: .45rem .65rem; background: #fff; border: 1px solid var(--rule-strong); border-radius: var(--radius); }
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
input[type="checkbox"], input[type="radio"] { width: 1.05rem; height: 1.05rem; accent-color: var(--green-ink); }
.check { display: flex; gap: .55rem; align-items: flex-start; cursor: pointer; }
.check input { margin-top: .22rem; }
.unit { position: relative; }
.unit input { padding-right: 3.4rem; }
.unit > span { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; font-size: .9rem; }
.form-grid { display: grid; gap: 1rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.form-grid .wide { grid-column: 1 / -1; }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: .45rem .9rem; cursor: pointer; font-weight: 500; color: var(--ink-2); min-height: 38px; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--green-ink); color: #fff; }

/* ---------- Panneaux, listes, tableaux ---------- */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 1.25rem; }
.panel + .panel { margin-top: 1.25rem; }
.panel > h2, .panel > h3 { margin-bottom: .8rem; }
.grid2 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 2rem 0 .8rem; }
.section-title:first-child { margin-top: 0; }

/* ---------- Raccourcis de l'accueil ---------- */
.shortcuts { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.shortcut { display: flex; gap: .8rem; align-items: flex-start; padding: .95rem 1rem; background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--green); border-radius: 4px; color: var(--ink); text-decoration: none; }
.shortcut:hover { border-color: var(--green); background: var(--green-wash); }
.shortcut .ic { width: 22px; height: 22px; flex: none; margin-top: .15rem; color: var(--green-ink); }

.ledger { width: 100%; border-collapse: collapse; background: var(--surface); }
.ledger th { text-align: left; font-weight: 600; font-size: .88rem; color: var(--ink-2); padding: .55rem .75rem; border-bottom: 2px solid var(--rule-strong); background: var(--surface); white-space: nowrap; }
.ledger td { padding: .6rem .75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ledger tbody tr:hover { background: #f6f9f7; }
.ledger th.num, .ledger td.num { text-align: right; }
.ledger tfoot td { font-weight: 600; border-top: 1px solid var(--rule-strong); border-bottom: 4px double var(--rule-strong); background: #f7faf8; }
.table-wrap { overflow: auto; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); }
.table-wrap.tall { max-height: 540px; }
.table-wrap .ledger th { position: sticky; top: 0; z-index: 1; }
.table-wrap .ledger { border: 0; }
.actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }

.filetype { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 3px; background: var(--green-wash); color: var(--green-deep); font-size: .68rem; font-weight: 600; letter-spacing: .02em; flex: none; border: 1px solid #b6d8cb; }
.filetype.pdf { background: #fbe9e7; color: #8f2a24; border-color: #efb9b3; }
.filetype.doc { background: #e6eefa; color: #24478a; border-color: #bccdea; }
.filetype.xls { background: #e2f0ea; color: #0b5a42; border-color: #b6d8cb; }
.filetype.ppt { background: #fbf0df; color: #86490a; border-color: #ecc994; }
.res { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--rule); }
.res:last-child { border-bottom: 0; }
.res h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.res .meta { color: var(--ink-3); font-size: .85rem; display: flex; gap: .4rem .9rem; flex-wrap: wrap; margin-top: .15rem; }
.res .desc { color: var(--ink-2); font-size: .92rem; margin-top: .15rem; }

.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.toolbar .field { min-width: 180px; }
.toolbar .grow { flex: 1 1 240px; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--rule-strong); background: var(--surface); border-radius: 99px; padding: .22rem .8rem; cursor: pointer; font-size: .9rem; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--green-ink); color: #fff; border-color: var(--green-ink); }
.empty { padding: 2rem 1rem; text-align: center; color: var(--ink-3); border: 1px dashed var(--rule-strong); border-radius: 4px; background: var(--surface); }
.empty strong { display: block; color: var(--ink-2); margin-bottom: .2rem; font-family: var(--serif); font-size: 1.05rem; }

.kpis { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: .9rem 1rem; }
.kpi .v { font-family: var(--sans); font-size: 1.9rem; font-weight: 600; line-height: 1.15; color: var(--ink); }
.kpi .l { color: var(--ink-2); font-size: .9rem; }
.kpi .s { color: var(--ink-3); font-size: .82rem; margin-top: .15rem; }

.notice { padding: .75rem 1rem; border-radius: var(--radius); border: 1px solid #b6d8cb; background: var(--green-wash); color: var(--green-deep); }
.notice.warn { background: var(--brass-wash); border-color: #ecc994; color: var(--brass-ink); }
.notice.error { background: var(--red-wash); border-color: #efb9b3; color: #8f2a24; }
.notice ul { margin: .3rem 0 0; padding-left: 1.2rem; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-art { position: relative; overflow: hidden; background: var(--green-deep); color: #eaf4ef; display: flex; flex-direction: column; justify-content: flex-end; padding: 3rem; min-height: 280px; }
.login-art svg.guil { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-art h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); position: relative; max-width: 14ch; }
.login-art p { position: relative; margin: .8rem 0 0; max-width: 38ch; color: #cfe5db; }
.login-form { display: grid; place-items: center; padding: 2rem 1.25rem; }
.login-form form { width: min(100%, 380px); }
.login-form h2 { margin-bottom: 1.1rem; }

/* ---------- Veille ---------- */
.post { padding: 1.4rem 0 1.6rem; border-bottom: 1px solid var(--rule); }
.post:first-child { padding-top: 0; }
.post:last-child { border-bottom: 0; padding-bottom: .4rem; }
.post .when { color: var(--ink-3); font-size: .88rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.post h3 { font-size: 1.3rem; margin: .3rem 0 .5rem; }
.post .resume { max-width: 70ch; white-space: pre-line; }
.post .source { font-size: .9rem; margin-top: .4rem; }
.coin { margin-top: 1rem; max-width: 70ch; background: var(--brass-wash); border: 1px solid #ecd2a8; border-left: 5px solid var(--brass); border-radius: 0 4px 4px 0; padding: .85rem 1.1rem; }
.coin h4 { font-size: 1.02rem; color: var(--brass-ink); margin-bottom: .3rem; }
.coin p { margin: 0; white-space: pre-line; }

/* ---------- Simulateurs ---------- */
.sim-nav { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.sim-nav a { padding: .4rem .9rem; border: 1px solid var(--rule-strong); border-radius: 99px; background: var(--surface); text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .92rem; }
.sim-nav a[aria-current="page"] { background: var(--green-ink); border-color: var(--green-ink); color: #fff; }
.sim { display: grid; gap: 1.5rem; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: start; }
.sim .inputs { position: sticky; top: 1rem; }
.sim .inputs .stack > * + * { margin-top: .9rem; }
.result-head { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 1.25rem; }
.result-head .kpi.main { background: var(--green-deep); border-color: var(--green-deep); }
.result-head .kpi.main .v, .result-head .kpi.main .l { color: #fff; }
.result-head .kpi.main .s { color: #cfe5db; }
.statement { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; background: var(--surface); }
.statement td { padding: .45rem .75rem; border-bottom: 1px solid var(--rule); }
.statement td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.statement tr.total td { border-top: 1px solid var(--rule-strong); border-bottom: 4px double var(--rule-strong); font-weight: 600; background: #f7faf8; }
.formula { font-family: var(--serif); font-style: normal; background: #f7faf8; border: 1px solid var(--rule); border-radius: 3px; padding: .5rem .8rem; margin: 0 0 1rem; color: var(--ink-2); }

/* ---------- Graphiques ---------- */
.chart { position: relative; background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 1rem 1rem .6rem; margin-bottom: 1.25rem; }
.chart h3 { font-family: var(--sans); font-size: .98rem; font-weight: 600; margin-bottom: .1rem; }
.chart .sub { color: var(--ink-3); font-size: .85rem; margin-bottom: .6rem; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .legend { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .88rem; color: var(--ink-2); margin: .2rem 0 .5rem; }
.chart .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: .4rem; vertical-align: -1px; }
.chart .grid line { stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis text { fill: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .axis .base { stroke: var(--rule-strong); }
.chart .endlabel { fill: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: crosshair; outline: none; }
.chart .hit:hover, .chart .hit:focus-visible { fill: rgba(20, 35, 43, .05); }
.chart .tip { position: absolute; pointer-events: none; z-index: 3; min-width: 150px; background: #fff; border: 1px solid var(--rule-strong); border-radius: 4px; box-shadow: var(--shadow); padding: .5rem .7rem; font-size: .85rem; opacity: 0; transition: opacity .08s; }
.chart .tip.on { opacity: 1; }
.chart .tip .th { color: var(--ink-3); margin-bottom: .25rem; }
.chart .tip .tr { display: flex; align-items: center; gap: .5rem; justify-content: space-between; }
.chart .tip .tr b { font-variant-numeric: tabular-nums; font-weight: 600; margin-left: auto; padding-left: .8rem; }
.chart .tip .key { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.chart .tip .tr.sum { border-top: 1px solid var(--rule); margin-top: .25rem; padding-top: .25rem; }

/* ---------- QCM ---------- */
.q-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: 1.4rem; max-width: 780px; }
.q-card .q-text { font-size: 1.12rem; margin-bottom: 1rem; white-space: pre-line; }
.q-card .q-text.html { white-space: normal; }
.q-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--ink-3); font-size: .88rem; margin-bottom: .6rem; flex-wrap: wrap; }
.bar { height: 6px; background: #e3e8e5; border-radius: 99px; overflow: hidden; margin-bottom: 1rem; }
.bar > i { display: block; height: 100%; background: var(--green); }
.opts { display: grid; gap: .5rem; }
.opt { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem .85rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); cursor: pointer; background: #fff; }
.opt:hover { border-color: var(--green-ink); background: #f6faf8; }
.opt.ok { border-color: var(--green); background: var(--green-wash); }
.opt.ko { border-color: #e2aaa5; background: var(--red-wash); }
.opt.missed { border-style: dashed; border-color: var(--green); }
.opt input { margin-top: .22rem; }
.feedback { margin-top: 1rem; padding: .7rem .95rem; border-radius: var(--radius); background: #f3f6f4; border-left: 4px solid var(--ink-3); white-space: pre-line; }
.feedback.ok { background: var(--green-wash); border-left-color: var(--green); }
.feedback.ko { background: var(--red-wash); border-left-color: var(--red); }
.feedback.mid { background: var(--brass-wash); border-left-color: var(--brass); }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; align-items: center; margin-bottom: .5rem; }
.score-big { font-family: var(--serif); font-size: 3rem; font-weight: 600; line-height: 1; }
.review { border-top: 1px solid var(--rule); padding: 1rem 0; }
.review:first-of-type { border-top: 0; }
.qnav { display: flex; gap: .3rem; flex-wrap: wrap; margin: 1rem 0; }
.qnav button { width: 2.2rem; height: 2.2rem; border: 1px solid var(--rule-strong); border-radius: 3px; background: #fff; cursor: pointer; font-variant-numeric: tabular-nums; }
.qnav button.done { background: var(--green-wash); border-color: #b6d8cb; }
.qnav button.cur { outline: 2px solid var(--green-ink); }

/* ---------- Fenêtres, messages ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 35, 43, .5); display: grid; place-items: center; padding: 1rem; z-index: 50; }
.dialog { background: var(--surface); border-radius: 5px; width: min(100%, 640px); max-height: 92vh; overflow: auto; box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .45); }
.dialog.wide { width: min(100%, 860px); }
.dialog header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.dialog .body { padding: 1.25rem; }
.dialog footer { padding: .9rem 1.25rem; border-top: 1px solid var(--rule); display: flex; justify-content: flex-end; gap: .6rem; background: #f7faf8; position: sticky; bottom: 0; }
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 60; max-width: min(92vw, 380px); }
.toast { background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.toast.error { background: #8f2a24; }
.toast.ok { background: var(--green-deep); }
.spin { width: 1.1em; height: 1.1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 3rem; text-align: center; color: var(--ink-3); }
.cred { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; }

@media (max-width: 900px) {
  .sim { grid-template-columns: 1fr; }
  .sim .inputs { position: static; }
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 220px; padding: 1.5rem; }
  main { padding-top: 1.25rem; }
  h1 { font-size: 1.55rem; }
  .res { grid-template-columns: auto 1fr; }
  .res .actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  .masthead, .tabs, .toolbar, .no-print, .toasts, .actions { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .table-wrap.tall { max-height: none; overflow: visible; }
  .slip { break-inside: avoid; }
}
.slips { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.slip { border: 1px dashed var(--rule-strong); padding: .8rem 1rem; border-radius: 4px; background: #fff; }
.slip b { font-family: var(--serif); }
@media (forced-colors: active) { .chart .hit:hover { outline: 1px solid CanvasText; } }

/* Bouton natif de sélection de fichier */
input[type="file"] { font: inherit; color: var(--ink-2); max-width: 100%; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 500; color: var(--green-deep); background: var(--surface); border: 1px solid var(--green); border-radius: var(--radius); padding: .4rem .85rem; margin-right: .75rem; cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--green-wash); }

/* Petits écrans : bandeau d'en-tête sur deux lignes lisibles */
@media (max-width: 640px) {
  .masthead-in { flex-direction: column; align-items: flex-start; gap: .55rem; padding: .6rem 1rem .7rem; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 1.1rem; white-space: nowrap; }
  .brand svg { width: 32px; height: 32px; }
  .who { width: 100%; justify-content: flex-start; gap: .4rem .6rem; }
  .who .name { margin-right: auto; }
}
/* Tableau d'amortissement plus compact */
.table-wrap.tall .ledger th, .table-wrap.tall .ledger td { padding-left: .55rem; padding-right: .55rem; }
