/* ===== Tooleon — feuille de style commune ===== */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1b1d22;
  --muted: #5f6470;
  --line: #e2e0d8;
  --accent: #0f766e;
  --accent-soft: #e3f2ef;
  --danger: #b42318;
  --ok: #147a3d;
  --code-bg: #fbfaf7;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161a; --surface: #1c1f24; --ink: #e9e7e2; --muted: #9aa0ab;
    --line: #2c3038; --accent: #3fb8a6; --accent-soft: #1d3330; --code-bg: #171a1e;
    --danger: #f2716a; --ok: #4cc47e;
  }
}
:root[data-theme="dark"] {
  --bg: #14161a; --surface: #1c1f24; --ink: #e9e7e2; --muted: #9aa0ab;
  --line: #2c3038; --accent: #3fb8a6; --accent-soft: #1d3330; --code-bg: #171a1e;
  --danger: #f2716a; --ok: #4cc47e;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans);
}
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

/* ----- En-tête ----- */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { font-weight: 700; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; letter-spacing: -0.01em; }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font: 700 14px var(--mono); }
.nav { display: flex; gap: 18px; margin-left: auto; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 640px) { .nav { display: none; } }

/* ----- Mise en page ----- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; padding-top: 28px; padding-bottom: 48px; }
@media (max-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr); } .sidebar { display: none; } }

h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.02em; }
h2 { font-size: 21px; margin: 36px 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 17px; margin: 22px 0 6px; }
.lead { color: var(--muted); margin: 0 0 22px; font-size: 17px; }
.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }

/* ----- Panneau d'outil ----- */
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .panes { grid-template-columns: 1fr; } }
.pane-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; display: flex; justify-content: space-between; }
textarea.code {
  width: 100%; min-height: 360px; resize: vertical;
  font: 13.5px/1.55 var(--mono); color: var(--ink); background: var(--code-bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 12px; tab-size: 2;
}
textarea.code:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button, .btn {
  font: 600 14px var(--sans); border-radius: 8px; padding: 8px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.08); }
a.btn { display: inline-block; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); color: #fff; }
.page-meta { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); }
select, input[type="number"], input[type="text"] {
  font: 14px var(--sans); padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
label.inline { font-size: 14px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.status { font-size: 14px; min-height: 22px; margin-top: 10px; }
.status.err { color: var(--danger); }
.status.ok { color: var(--ok); }

/* ----- Formulaires des calculateurs ----- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field input, .field select { width: 100%; }
.input-unit { position: relative; }
.input-unit input { padding-right: 38px; }
.input-unit span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 18px 0; }
.kpi { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--code-bg); }
.kpi .k { font-size: 13px; color: var(--muted); }
.kpi .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi.main { background: var(--accent-soft); border-color: transparent; }
.kpi.main .v { color: var(--accent); }

.chart-wrap { position: relative; height: 300px; margin-top: 8px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.table-scroll { overflow-x: auto; margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; max-height: 420px; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 7px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { position: sticky; top: 0; background: var(--surface); font-weight: 600; color: var(--muted); }
table.data th:first-child, table.data td:first-child { text-align: left; }

/* ----- Contenu éditorial (important pour le SEO et AdSense) ----- */
.prose { max-width: 720px; }
.prose p, .prose li { color: var(--ink); }
.prose code { font-family: var(--mono); font-size: 0.92em; background: var(--code-bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }

/* ----- Accueil ----- */
.hero { padding: 44px 0 18px; }
.grid-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 18px 0 40px; }
.card { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card .tag { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.card h3 { margin: 6px 0 4px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 0 0; }

/* ----- Emplacements publicitaires (non intrusifs) ----- */
/* Hauteur réservée => pas de saut de mise en page (CLS) quand la pub se charge */
.ad-slot { margin: 26px 0; text-align: center; }
.ad-slot .ad-label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ad-slot.inline { min-height: 120px; }
.ad-slot.side { min-height: 600px; position: sticky; top: 20px; margin-top: 0; }
.ad-placeholder { border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; display: grid; place-items: center; height: 100%; min-height: inherit; }
.ad-slot.empty { display: none; }
.ad-slot.idle { visibility: hidden; }  /* sans annonce mais à l'écran : place gardée pour ne pas faire sauter la page */

.sidebar .box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.sidebar .box h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sidebar .box ul { list-style: none; margin: 0; padding: 0; }
.sidebar .box li { padding: 4px 0; font-size: 15px; }
.sidebar .box a { text-decoration: none; }

/* ----- Pied de page ----- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-top: 22px; padding-bottom: 22px; }
.site-footer a { color: var(--muted); }
.site-footer .copy { margin-right: auto; }

.theme-toggle { margin-left: 8px; padding: 6px 10px; font-size: 13px; }

.chart-tip { position: absolute; display: none; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.45; padding: 8px 10px; border-radius: 6px; white-space: nowrap; z-index: 2; }
:root { --c-base: #b9b4a6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-base: #59606b; } }
:root[data-theme="dark"] { --c-base: #59606b; }

/* ----- Jauge IMC ----- */
.gauge { position: relative; margin: 22px 0 6px; }
.gauge-bar { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #d97706 0%, #d97706 14%, #147a3d 14%, #147a3d 39.6%, #e3a008 39.6%, #e3a008 60%, #c2410c 60%, #c2410c 80%, #b42318 80%); }
.gauge-needle { position: absolute; top: -6px; width: 4px; height: 24px; margin-left: -2px; background: var(--ink); border-radius: 2px; transition: left .25s; }
.gauge-labels { position: relative; height: 18px; font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.gauge-labels span { position: absolute; transform: translateX(-50%); }
.gauge-labels span:first-child { transform: none; }
.gauge-labels span:last-child { transform: translateX(-100%); }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.macros div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; text-align: center; }
.macros strong { display: block; font-size: 19px; }
.macros span { font-size: 13px; color: var(--muted); }
.note { font-size: 13px; color: var(--muted); }

/* ----- Étiquettes (vacances, jours fériés) ----- */
.tag-now, .tag-soon, .tag-muted { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; margin-left: 6px; }
.tag-now { background: var(--accent); color: #fff; }
.tag-soon { background: var(--accent-soft); color: var(--accent); }
.tag-muted { background: var(--code-bg); color: var(--muted); border: 1px solid var(--line); }
.zone-badge:empty { display: none; }
.zone-badge { display: inline-block; font-weight: 700; font-size: 15px; padding: 4px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
table.vac td { white-space: normal; }
table.vac td:last-child { text-align: left; }
input[type="date"] { font: 14px var(--sans); padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 100%; }

/* ----- Sélecteur de langue ----- */
.lang-switch { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; margin-left: 12px; white-space: nowrap; }
.lang-switch:hover { color: var(--ink); border-color: var(--muted); }
@media (max-width: 640px) { .lang-switch { margin-left: auto; } }

/* Emplacement sans annonce (site pas encore accepté, ou pas d'enchère) : géré par site.js (hideSlot) */

/* Encart d'affiliation : discret, toujours signalé */
.partner { margin: 22px 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; font-size: 14px; }
.partner-tag { display: inline-block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 8px; }

/* ----- Météo ----- */
.wx-search { display: flex; flex-wrap: wrap; gap: 8px; }
.wx-search input { flex: 1 1 220px; min-width: 0; }
.wx-unit { margin-left: auto; }
.wx-results { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; gap: 6px; }
.wx-results button { width: 100%; text-align: left; font-weight: 500; }
.wx-place { margin: 6px 0 8px; font-size: 22px; }
.wx-now { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 14px 16px; border-radius: 8px; background: var(--accent-soft); }
.wx-now-main { display: flex; align-items: center; gap: 10px; }
.wx-ico { font-size: 22px; line-height: 1; text-align: center; }
.wx-ico.big { font-size: 46px; }
.wx-temp { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wx-now-meta { font-size: 14.5px; color: var(--muted); }
.wx-now-meta strong { color: var(--ink); font-size: 16px; }
.wx-list { list-style: none; padding: 0; margin: 6px 0 0; }
.wx-row { display: grid; grid-template-columns: minmax(92px, 1.3fr) 34px 44px minmax(60px, 3fr) 44px minmax(64px, 1.1fr) minmax(62px, 1fr); align-items: center; gap: 8px;
  padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.wx-row.muted { display: block; color: var(--muted); }
.wx-row.trend { color: var(--muted); }
.wx-d { font-weight: 600; color: var(--ink); text-transform: capitalize; }
.wx-lo { text-align: right; color: var(--muted); }
.wx-hi { font-weight: 700; }
.wx-p { font-size: 13px; color: #2563eb; white-space: nowrap; }
.wx-w { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.wx-bar { position: relative; height: 6px; border-radius: 3px; background: var(--line); }
.wx-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #38bdf8, #f59e0b); }
.wx-row.trend .wx-bar i { opacity: .45; }
.wx-past { margin-top: 22px; }
.wx-years { margin-top: 8px; }
.wx-years summary { cursor: pointer; font-weight: 600; }
.wx-credit { margin-top: 10px; }
.wx-cities { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 14px; }
@media (max-width: 560px) {
  .wx-row { grid-template-columns: 1fr 28px 36px 36px; grid-template-areas: "d i l h" "b b b b" "p p w w"; row-gap: 4px; }
  .wx-d { grid-area: d; } .wx-row .wx-ico { grid-area: i; } .wx-lo { grid-area: l; } .wx-hi { grid-area: h; text-align: right; }
  .wx-bar { grid-area: b; } .wx-p { grid-area: p; } .wx-w { grid-area: w; }
  .wx-unit { margin-left: 0; }
}
:root[data-theme="dark"] .wx-p { color: #60a5fa; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wx-p { color: #60a5fa; } }

/* ----- Convertisseur ----- */
.cv-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 16px; border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--code-bg); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.cv-drop:hover, .cv-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.cv-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.cv-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.cv-big { font-size: 17px; }
.cv-big strong { color: var(--accent); }
.cv-private { margin: 10px 0 0; }
.cv-list, .cv-results { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.cv-list li, .cv-results li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.cv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-size { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-list button { padding: 3px 9px; font-size: 13px; }
.cv-choices { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.cv-opts { margin: 10px 0; gap: 14px; }
.cv-opts:empty { display: none; }
.cv-dl { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#cv-go { min-width: 160px; }
#cv-go:disabled { opacity: .5; cursor: not-allowed; }
.cv-grid .card h3 { margin-top: 0; }
input[type="range"] { accent-color: var(--accent); vertical-align: middle; }

/* Convertisseur de devises */
.fx-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.4fr) auto minmax(160px, 1.4fr); gap: 12px; align-items: end; }
.fx-swap { height: 38px; font-size: 18px; padding: 0 12px; }
.fx-out { margin: 18px 0 4px; padding: 16px 18px; border-radius: 8px; background: var(--accent-soft); }
.fx-out .k { font-size: 14px; color: var(--muted); }
.fx-big { font-size: clamp(26px, 5vw, 36px); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin: 2px 0; }
.fx-pairs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.fx-pairs a { display: inline-block; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 14px; }
@media (max-width: 640px) { .fx-row { grid-template-columns: 1fr; } .fx-swap { justify-self: center; } }
/* Simulateur freelance */
.fl-table td { vertical-align: top; }
.fl-table tbody tr[data-id] { cursor: pointer; }
.fl-table tbody tr[data-id]:hover td { background: var(--code-bg); }
.fl-table td:first-child { white-space: normal; min-width: 210px; }
.fl-note { font-size: 12.5px; color: var(--muted); font-weight: 400; margin: 2px 0 0; white-space: normal; }
.fl-tag { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.fl-best td { background: var(--accent-soft); }
.fl-tag.fl-warn { color: #9a5b00; background: #fdf0d9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fl-tag.fl-warn { color: #f0b85a; background: #3a2c14; } }
:root[data-theme="dark"] .fl-tag.fl-warn { color: #f0b85a; background: #3a2c14; }
.fl-bar { height: 5px; background: var(--line); border-radius: 3px; margin-top: 5px; min-width: 90px; }
.fl-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.fl-detail td { background: var(--surface); text-align: left; white-space: normal; cursor: default; }
.fl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; padding: 6px 0; position: sticky; left: 12px; width: min(740px, calc(100vw - 72px)); }
.fl-grid h4 { margin: 4px 0 8px; font-size: 14px; }
.fl-grid table.data td { white-space: normal; }
.fl-adv { margin-top: 12px; }
.fl-adv summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.fl-adv .form-grid { margin-top: 12px; }
.fl-grid table.data td:last-child { white-space: nowrap; }
