/* =====================================================================================
   apps/web/src/styles.css — US-111

   Lines 8-123 of the frozen oracle, lifted VERBATIM: everything between the opening
   style tag at line 7 and the closing one at line 124 of
   `tools/golden/oracle/Calcul_structures_EC3_EC5.frozen.html`.

   Nothing below this header has been reordered, reformatted, renamed or "modernised".
   The note de calcul is a document an engineer signs, and the `@media print` block at
   the bottom is what shapes it; a diff here is a defect, not a refresh. The Track C
   fidelity rule in the P1 PRD applies to this file in full — including the deliberately
   unaccented text ("Verifie", "Elancement"), which must not be corrected.

   Two numbers in here are load-bearing and are asserted by `test/shell.test.ts`:
   `.bar u { left: 74.07% }` is the 1.00 tick on the utilisation bar, and it is only in
   the right place because the bar's fill saturates at taux = 1.35 in the renderer
   (US-114, oracle line 886). Move one without the other and every bar in the tool lies.

   To re-derive this file:  sed -n '8,123p' <the frozen oracle>
   ===================================================================================== */

:root{
  --bg:#f5f5f3; --card:#ffffff; --ink:#1c1c1a; --ink2:#5f5f58; --line:#dedcd6;
  --acc:#1f4e5f; --acc2:#e8eef0;
  --ok:#2f7d4f; --okbg:#e7f2ea; --warn:#9a6a00; --warnbg:#fbf1dc; --ko:#a32b28; --kobg:#f8e6e5;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);
  font:14px/1.45 "Segoe UI",system-ui,-apple-system,Roboto,Helvetica,Arial,sans-serif}
header{background:var(--acc);color:#fff;padding:14px 22px;display:flex;gap:20px;align-items:center;flex-wrap:wrap}
header h1{font-size:16px;margin:0;font-weight:600;letter-spacing:.02em}
header .sub{font-size:12px;opacity:.8}
header .grow{flex:1}
header input{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.3);color:#fff;
  border-radius:4px;padding:5px 9px;font:inherit;font-size:13px;min-width:260px}
header input::placeholder{color:rgba(255,255,255,.6)}
button{font:inherit;border:1px solid var(--line);background:#fff;color:var(--ink);
  padding:6px 12px;border-radius:4px;cursor:pointer}
button:hover{background:#f0efeb}
header button{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.35);color:#fff}
header button:hover{background:rgba(255,255,255,.26)}
nav{display:flex;gap:2px;background:var(--acc);padding:0 22px}
.tab{background:rgba(255,255,255,.10);border:0;color:#fff;padding:9px 18px;border-radius:5px 5px 0 0;opacity:.75}
.tab.on{background:var(--bg);color:var(--acc);opacity:1;font-weight:600}
main{padding:20px 22px 60px}
.pane{display:grid;grid-template-columns:minmax(340px,400px) 1fr;gap:20px;align-items:start}
.pane[hidden]{display:none}
@media(max-width:900px){.pane{grid-template-columns:1fr}}
.card{background:var(--card);border:1px solid var(--line);border-radius:6px;padding:16px 18px}
fieldset{border:0;border-top:1px solid var(--line);margin:0 0 4px;padding:12px 0 6px}
fieldset:first-child{border-top:0;padding-top:0}
legend{font-weight:600;font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--acc);padding:0 6px 0 0}
.row{display:grid;grid-template-columns:1fr 92px 46px;gap:8px;align-items:center;margin:3px 0}
.row label{font-size:13px;color:var(--ink)}
.row label em{color:var(--ink2);font-style:normal;font-size:12px}
.row input,.row select{width:100%;padding:4px 6px;border:1px solid var(--line);border-radius:3px;font:inherit;
  background:#fffdf5}
.row input[type=text]{grid-column:2/4;background:#fff}
.row select{grid-column:2/4}
.row .u{font-size:12px;color:var(--ink2)}
.hint{font-size:11.5px;color:var(--ink2);margin:-1px 0 6px;padding-left:2px;font-style:italic}
h3{font-size:13px;text-transform:uppercase;letter-spacing:.06em;color:var(--acc);margin:20px 0 8px}
h3:first-child{margin-top:0}
.banner{display:flex;justify-content:space-between;align-items:center;border-radius:6px;padding:14px 18px;margin-bottom:6px}
.banner.ok{background:var(--okbg);border:1px solid #b9d9c4}
.banner.warn{background:var(--warnbg);border:1px solid #e2c98a}
.banner.ko{background:var(--kobg);border:1px solid #e2b0ae}
.b-sec{display:block;font-size:18px;font-weight:600}
.b-txt{font-size:12.5px;letter-spacing:.05em}
.b-right{text-align:right}
.b-num{display:block;font-size:26px;font-weight:600;line-height:1}
.b-lab{font-size:11px;color:var(--ink2);letter-spacing:.05em}
.banner.ok .b-txt,.banner.ok .b-num{color:var(--ok)}
.banner.warn .b-txt,.banner.warn .b-num{color:var(--warn)}
.banner.ko .b-txt,.banner.ko .b-num{color:var(--ko)}
table{width:100%;border-collapse:collapse;font-size:13px}
.checks th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--ink2);
  border-bottom:1px solid var(--line);padding:4px 6px;font-weight:600}
.checks td{padding:4px 6px;border-bottom:1px solid #efeee9}
.checks .num{text-align:right;font-variant-numeric:tabular-nums;width:56px}
.checks .statut{font-size:11.5px;font-weight:600;width:88px}
.checks tr.ok .statut{color:var(--ok)} .checks tr.warn .statut{color:var(--warn)} .checks tr.ko .statut{color:var(--ko)}
.checks tr.na td{color:#a2a099}
.bar-col{width:38%}
.bar{position:relative;height:9px;background:#eceae4;border-radius:5px;overflow:hidden}
.bar i{position:absolute;left:0;top:0;bottom:0;border-radius:5px;background:var(--ok)}
.bar u{position:absolute;left:74.07%;top:-2px;bottom:-2px;width:1px;background:#b6b3aa}
tr.warn .bar i{background:var(--warn)} tr.ko .bar i{background:var(--ko)}
.vals td{padding:2.5px 6px;border-bottom:1px solid #f2f1ec}
.vals .sym{color:var(--ink2);font-size:12px;width:96px}
.vals .num{text-align:right;font-variant-numeric:tabular-nums;width:110px}
.vals .u{color:var(--ink2);font-size:12px;width:52px}
.vals tr.sep td{border:0;height:8px}
.vals tr.grp td{background:var(--acc2);font-weight:600;font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;
  color:var(--acc);padding:4px 6px}
details.det{margin-top:16px;border-top:1px solid var(--line);padding-top:8px}
details.det summary{cursor:pointer;font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--acc);font-weight:600}
.tools{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
.tools .sp{flex:1}
.opt{margin-top:10px;background:#fbfaf7;border:1px solid var(--line);border-radius:5px;padding:10px 12px}
.opt table{font-size:12.5px}
.opt th{text-align:left;color:var(--ink2);font-size:11px;text-transform:uppercase;padding:3px 6px;border-bottom:1px solid var(--line)}
.opt td{padding:3px 6px;border-bottom:1px solid #f0efea}
.opt tr.best td{font-weight:600;background:var(--okbg)}
.opt .num{text-align:right;font-variant-numeric:tabular-nums}
button.mini{padding:2px 8px;font-size:11.5px}
#optfam{display:flex;gap:10px;flex-wrap:wrap;font-size:12px;margin-bottom:8px}
#optfam label{display:flex;gap:3px;align-items:center;color:var(--ink2)}
.alerte{background:var(--kobg);border:1px solid #e2b0ae;color:var(--ko);padding:8px 12px;border-radius:5px;font-size:12.5px}
.vide{color:var(--ink2);font-style:italic}
.foot{margin-top:26px;font-size:11.5px;color:var(--ink2);line-height:1.6;max-width:none}
#print{display:none}
/* ------------------------- IMPRESSION ------------------------- */
@media print{
  *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  body{background:#fff;font-size:10.5px}
  header,nav,main,.tools{display:none!important}
  #print{display:block}
  .note{padding:0}
  .n-head{display:flex;justify-content:space-between;border-bottom:2px solid #1f4e5f;padding-bottom:8px;margin-bottom:14px}
  .n-head h1{font-size:13.5px;margin:0;color:#1f4e5f;white-space:nowrap}
  .n-in .num{width:150px}
  .bar-col{width:26%}
  .n-norme{margin:2px 0 0;font-size:10px;color:#555}
  .n-meta{text-align:right;font-size:10px;line-height:1.5}
  h2{font-size:12px;color:#1f4e5f;border-bottom:1px solid #ccc;padding-bottom:2px;margin:14px 0 6px}
  h3{font-size:11px;margin:10px 0 4px}
  table{page-break-inside:auto} tr{page-break-inside:avoid}
  .bar{border:1px solid #ccc;height:8px} .bar i{background:#666!important}
  tr.ko .bar i{background:#a32b28!important}
  .checks tr.ok .statut{color:#2f7d4f} .checks tr.ko .statut{color:#a32b28}
  .n-concl{padding:6px 10px;border:1px solid #999;font-size:11.5px}
  .n-concl.ok{background:#e7f2ea} .n-concl.ko,.n-concl.warn{background:#f8e6e5}
  .n-foot{margin-top:18px;font-size:9px;color:#555;border-top:1px solid #ccc;padding-top:6px}
  details.det{display:block} details.det summary{display:none}
  @page{margin:14mm 12mm}
}
/*
 * p2.css — the accounts-and-projects chrome (P2 wave 4).
 *
 * ==================================================================================================
 * WHY THIS IS A SECOND FILE AND NOT AN ADDITION TO styles.css
 * ==================================================================================================
 * `src/styles.css` is not a stylesheet anyone wrote. It is oracle lines 8-123, lifted verbatim, and
 * `test/shell.test.ts` compares it byte for byte against the frozen HTML. A rule appended there --
 * however small, however correct -- fails that comparison and, with it, the fidelity guarantee the
 * whole port rests on.
 *
 * So P2's surfaces live here, and the separation is honest rather than merely convenient: everything
 * in `styles.css` came from the tool that engineers already use, and everything in this file is new.
 * A reviewer can tell the two apart at a glance, which is exactly what the P1 exit gate asked for.
 *
 * ==================================================================================================
 * IT INTRODUCES NO COLOURS
 * ==================================================================================================
 * Every value below is one of the thirteen `:root` custom properties the oracle declares. That is
 * the "match the existing visual language rather than introducing a second one" rule from US-212,
 * made mechanical: a new palette entry here would be visible on screen as a screen that belongs to a
 * different application.
 */

/*
 * `hidden` has to actually hide.
 *
 * The oracle's own CSS sets `nav{display:flex}` and `main{padding:...}` with element selectors,
 * which beat the browser's built-in `[hidden]{display:none}` rule. So `element.hidden = true` on
 * either of them does nothing at all -- which is exactly what the sign-in screen looked like the
 * first time it was opened in a real browser: a login card with the whole calculator still under
 * it. `!important` is the honest fix here; the alternative is a second class name that means the
 * same thing as an attribute that already exists.
 */
nav[hidden],
main[hidden],
#p2-banner[hidden],
#p2-openbar-host[hidden],
#p2-diffhost[hidden],
.p2-overlay[hidden],
.p2-chrome[hidden] {
  display: none !important;
}

/*
 * The runtime-injected header chrome: project controls, then the identity and the way out.
 *
 * `flex: 1` with the identity pushed to the end, so the two groups sit at opposite ends of the
 * header the way the oracle's own title and buttons do.
 */
.p2-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-basis: 100%;
}

.p2-chrome .p2-who {
  margin-left: auto;
}

/*
 * The chrome sits INSIDE the dark header, which sets `color:#fff`. Using `--ink2` here -- the
 * secondary text colour, chosen for a white card -- produced grey-on-dark-blue that was legible on
 * a colour picker and not on a screen. Inheriting the header's own white and dropping the opacity
 * is the same "secondary text" idea expressed in the right context, and it is exactly what the
 * oracle does for its own subtitle (`header .sub{opacity:.8}`).
 */
.p2-who,
.p2-project {
  font-size: 12px;
  white-space: nowrap;
  opacity: 0.85;
}

/*
 * The overlay. It REPLACES the calculator rather than floating over it: a modal that leaves the
 * form half-visible behind it invites a user to keep typing into inputs that are no longer the
 * thing on screen.
 */
.p2-overlay {
  padding: 12px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.p2-auth {
  max-width: 460px;
  margin: 32px auto;
}

/*
 * The oracle's `.row` is a three-column grid sized for a numeric field and a unit label. These
 * forms have neither, so the input gets the space the unit column would have taken.
 */
.p2-auth .row,
.p2-newproject .row {
  grid-template-columns: 1fr 180px;
}

.p2-auth input,
.p2-newproject input {
  width: 100%;
}

.p2-auth h2,
.p2-projects h2,
.p2-cases h2,
.p2-diff h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

/* The failure line under a form. `--ko` because it is the same class of news as a failed check. */
.p2-msg {
  margin: 8px 0 0;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--kobg);
  color: var(--ko);
  font-size: 12px;
}

/*
 * A transient confirmation in the chrome -- "Cas enregistre." It is news, not an error, and it is
 * also on the dark header: `--ok` is a green picked to read on white and disappears here.
 */
.p2-note {
  font-size: 12px;
  white-space: nowrap;
  font-weight: 600;
}

/*
 * The version banner (US-215). `--warnbg` deliberately: it is not a failure, it is something to
 * look at. It appears only when the stored versions differ from the running ones, which is why it
 * can afford to be conspicuous.
 */
.p2-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 12px 8px;
  padding: 8px 10px;
  border: 1px solid var(--warn);
  border-radius: 4px;
  background: var(--warnbg);
  color: var(--ink);
  font-size: 12px;
}

/* The strip naming the stored case currently open. Quieter than the banner: it is not a warning. */
.p2-openbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 12px 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card);
  color: var(--ink2);
  font-size: 12px;
}

.p2-openbar strong {
  color: var(--ink);
}

.p2-newproject {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.p2-newproject .row {
  flex: 1;
}

.p2-diff {
  border-left: 3px solid var(--acc);
}

/* Nothing P2 adds belongs on a note de calcul. The print block in styles.css shows `#print` only. */
@media print {
  .p2-chrome,
  .p2-overlay,
  .p2-banner,
  .p2-openbar,
  .p2-diff {
    display: none;
  }
}
