/* Sarmate Tools - one stylesheet, no framework, no webfont.
   The whole page should land in one round trip on a phone in a basement. */

:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --surface-2: #eef0f3;
  --border: #d9dde3;
  --text: #16191d;
  --muted: #5b6471;
  --accent: #0b5cab;
  --accent-soft: #e8f0f9;
  --good: #0f7b4f;
  --warn: #8a5a00;
  --warn-soft: #fdf6e3;
  --radius: 10px;
  --maxw: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171a;
    --surface: #1c2024;
    --surface-2: #23282e;
    --border: #333a42;
    --text: #e8eaed;
    --muted: #9aa4b0;
    --accent: #6fb0f0;
    --accent-soft: #1b2a3a;
    --good: #5fc897;
    --warn: #e0b45c;
    --warn-soft: #2b2415;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* --- header ------------------------------------------------------------ */
header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
header.site .wrap {
  display: flex; align-items: center; gap: 16px;
  min-height: 56px; flex-wrap: wrap;
}
header.site a.brand {
  font-weight: 650; color: var(--text); text-decoration: none;
  letter-spacing: -0.01em;
}
header.site nav { margin-left: auto; display: flex; gap: 14px; align-items: center; }
header.site nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
header.site nav a:hover { color: var(--accent); }

.langs { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.langs a { color: var(--muted); text-decoration: none; }
.langs a[aria-current="true"] { color: var(--text); font-weight: 600; }

/* --- headings ---------------------------------------------------------- */
h1 { font-size: 1.85rem; line-height: 1.25; letter-spacing: -0.02em; margin: 1.4rem 0 .5rem; }
h2 { font-size: 1.25rem; letter-spacing: -0.01em; margin: 2.2rem 0 .6rem; }
h3 { font-size: 1.02rem; margin: 1.4rem 0 .4rem; }
.lede { color: var(--muted); font-size: 1.08rem; margin: 0 0 1.4rem; }

/* --- the answer box: the reason the page exists ------------------------ */
.answer {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 1.2rem 0;
}
.answer .label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 4px;
}
.answer .big { font-size: 1.6rem; font-weight: 680; letter-spacing: -0.02em; }
.answer p { margin: .5rem 0 0; }

/* --- result grid ------------------------------------------------------- */
.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 1rem 0; }
.results .cell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.results .cell .k {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}
.results .cell .v { font-size: 1.35rem; font-weight: 660; letter-spacing: -0.02em; }
.results .cell .sub { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .results { grid-template-columns: 1fr; } }

/* --- form -------------------------------------------------------------- */
form.calc { margin: 1.5rem 0; }
fieldset {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 18px; margin: 0 0 14px;
}
legend { font-weight: 640; padding: 0 6px; font-size: 15px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.field { flex: 1 1 10rem; margin-top: 10px; }
.field label { display: block; font-size: 14px; font-weight: 560; margin-bottom: 4px; }
.field .help { font-size: 13px; color: var(--muted); margin-top: 4px; }

input[type="number"], select {
  width: 100%; padding: 9px 10px; font-size: 16px; /* 16px: no iOS zoom */
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
}
input[type="number"]:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
.inline { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.inline input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.inline label { font-size: 15px; font-weight: 500; }

button.go {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 11px 22px; font-size: 16px; font-weight: 600; cursor: pointer;
}
button.go:hover { filter: brightness(1.08); }

.err {
  background: var(--warn-soft); border: 1px solid var(--border);
  border-left: 4px solid var(--warn); color: var(--warn);
  border-radius: var(--radius); padding: 12px 14px; margin: 1rem 0;
}

/* --- reasoning list ---------------------------------------------------- */
ul.why { list-style: none; padding: 0; margin: .6rem 0; }
ul.why li {
  padding: 9px 0 9px 26px; position: relative;
  border-bottom: 1px solid var(--border); font-size: 15.5px;
}
ul.why li:last-child { border-bottom: 0; }
ul.why li::before {
  content: ""; position: absolute; left: 7px; top: 18px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

/* --- tables ------------------------------------------------------------ */
.scroll { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
thead th { background: var(--surface-2); font-weight: 620; font-size: 13.5px;
           text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
/* Row headers stay plain text: the grey of a column head on the left-hand
   column reads as a broken table rather than as a label. */
tbody th { font-weight: 620; color: var(--text); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--surface); }

/* --- cards ------------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 14px; }
a.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
a.card:hover { border-color: var(--accent); }
a.card .t { font-weight: 640; margin-bottom: 4px; }
a.card .d { color: var(--muted); font-size: 15px; }

ul.links { list-style: none; padding: 0; display: grid;
           grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 6px; }
ul.links a { color: var(--accent); text-decoration: none; font-size: 15px; }
ul.links a:hover { text-decoration: underline; }

/* --- ad slots ----------------------------------------------------------
   Reserved now, filled later. min-height stops the page jumping the day
   ads go live, which is the thing that ruins a tool site. */
.ad {
  min-height: 90px; margin: 1.8rem 0;
  display: flex; align-items: center; justify-content: center;
}
.ad:empty { display: none; }          /* nothing reserved while there is no ad */
.ad[data-filled] { display: flex; }

/* --- footer ------------------------------------------------------------ */
footer.site {
  margin-top: 3rem; border-top: 1px solid var(--border);
  background: var(--surface); padding: 20px 0 40px;
  font-size: 14.5px; color: var(--muted);
}
footer.site .disc {
  background: var(--warn-soft); border: 1px solid var(--border);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px;
  color: var(--text);
}
footer.site .disc strong { display: block; margin-bottom: 4px; color: var(--warn); }
footer.site a { color: var(--accent); }
.srcs { font-size: 13.5px; }
.srcs li { margin: 3px 0; }

.hidden { display: none; }

/* --- internal status page ---------------------------------------------- */
.proj {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 18px 14px; margin: 14px 0; background: var(--surface);
}
.proj-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.proj-head h3 { margin: 14px 0 6px; }
.pill {
  font-size: 12px; font-weight: 650; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border); white-space: nowrap;
}
.pill-en_ligne   { background: var(--good); color: #fff; border-color: transparent; }
.pill-prevu      { background: var(--accent-soft); color: var(--accent); }
.pill-en_attente { background: var(--warn-soft); color: var(--warn); }
table.meta { width: 100%; font-size: 15px; margin: 8px 0 4px; }
table.meta th {
  width: 8.5rem; vertical-align: top; text-align: left; font-weight: 600;
  color: var(--muted); background: none; text-transform: none;
  letter-spacing: 0; font-size: 15px; padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--border);
}
table.meta td { padding: 6px 0; border-bottom: 1px solid var(--border); }
@media (max-width: 480px) {
  table.meta, table.meta tbody, table.meta tr, table.meta th, table.meta td {
    display: block; width: auto;
  }
  table.meta th { border-bottom: 0; padding-bottom: 0; }
  table.meta td { padding-top: 2px; }
}
.todo-h {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: 14px 0 0; font-weight: 650;
}
