@font-face { font-family: Figtree; font-weight: 300 900; font-display: swap;
  src: url(fonts/figtree-latin-wght-normal.woff2) format('woff2'); }
@font-face { font-family: Figtree; font-weight: 300 900; font-display: swap;
  src: url(fonts/figtree-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20CF; }
:root {
  --papier: #F5F0E7; --carte: #FFFDF8; --encre: #1F1C19;
  --encre-55: rgb(31 28 25 / .55); --encre-35: rgb(31 28 25 / .35);
  --trait: rgb(31 28 25 / .09); --champ: rgb(31 28 25 / .045);
}
[data-palette=cedre]  { --accent: #183F35; --sur-accent: #F2ECE1; --metal: #9B6B2F; }
[data-palette=indigo] { --accent: #262B52; --sur-accent: #F1ECE3; --metal: #A35F2C; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--papier); color: var(--encre);
  font: 450 15px/1.45 Figtree, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 1; }
main { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column;
  gap: clamp(6px, 1.3dvh, 14px); padding: clamp(10px, 2dvh, 24px) 16px; }
h1 { margin: 0 0 2px; font-size: clamp(20px, 3.4dvh, 24px); font-weight: 650; letter-spacing: -.02em; }
a { color: var(--metal); font-weight: 550; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
.aide { display: block; font-size: 12px; font-weight: 450; color: var(--encre-55); }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 16px;
  padding: clamp(9px, 1.6dvh, 16px) 16px; }
.saisie { display: flex; flex-direction: column; gap: clamp(6px, 1.2dvh, 10px); }
.sens { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--champ);
  border-radius: 10px; padding: 3px; }
.sens button { border: 0; background: transparent; border-radius: 8px; min-height: clamp(30px, 5dvh, 36px);
  font-size: 14px; font-weight: 550; color: var(--encre-55); transition: background-color .15s, color .15s; }
.sens button[aria-pressed=true] { background: var(--carte); color: var(--encre);
  box-shadow: 0 1px 2px rgb(31 28 25 / .08); }
.montant { display: flex; align-items: baseline; gap: 8px; padding: 2px 0 6px; border-bottom: 1px solid var(--trait); }
.montant:focus-within { border-color: var(--encre-35); }
.montant input { flex: 1 0 45%; min-width: 0; border: 0; background: none; outline: none; color: var(--encre); padding: 0;
  font: 600 clamp(30px, 5dvh, 40px)/1.15 Figtree, sans-serif; letter-spacing: -.025em; }
#devise { font-size: 17px; font-weight: 550; color: var(--encre-55); }
#unites.inactif { opacity: .35; pointer-events: none; }
#parle { font-size: 13px; white-space: nowrap; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.bloc { background: var(--accent); color: var(--sur-accent); border-radius: 18px; padding: 14px 18px 12px; }
.bloc p { margin: 0; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.duo-col { display: flex; flex-direction: column; min-width: 0; }
.bloc-titre { font-size: 13px; font-weight: 500; opacity: .7; }
.duo-chiffre { font-size: clamp(28px, 9vw, 40px); font-weight: 600; letter-spacing: -.03em; line-height: 1.15; white-space: nowrap; }
.duo-chiffre.long { font-size: clamp(22px, 6.6vw, 34px); }
.duo.empile { grid-template-columns: 1fr; gap: 8px; }
.duo.empile .duo-chiffre { white-space: normal; overflow-wrap: anywhere; }
.vaut .duo-chiffre { opacity: .72; }
.bloc-sous { font-size: 13px; font-weight: 450; opacity: .8; }
.bloc-fois { font-size: 14px; font-weight: 600; margin-top: 10px !important; }
.bloc-moi { font-size: 13px; font-weight: 500; opacity: .55; margin-top: 8px !important; padding-top: 8px;
  border-top: 1px solid rgb(255 255 255 / .12); }
table { width: 100%; border-collapse: collapse; }
thead th { font-size: 12px; font-weight: 500; color: var(--encre-55); text-align: right; padding: 0 0 2px; }
thead th:first-child { text-align: left; }
tbody th { text-align: left; font-weight: 550; padding: clamp(4px, 1dvh, 11px) 0; }
tbody td { text-align: right; padding: clamp(4px, 1dvh, 11px) 0 clamp(4px, 1dvh, 11px) 6px; white-space: nowrap; vertical-align: top; }
tbody td.resultat { font-weight: 600; white-space: normal; overflow-wrap: anywhere; }   
tbody tr + tr > * { border-top: 1px solid var(--trait); }
tbody th .aide { white-space: nowrap; line-height: 1.3; }
td.resultat .aide { font-weight: 450; }
input.taux { width: calc(6ch + 14px); border: 0; border-radius: 6px; background: var(--champ); color: var(--encre);
  font: inherit; text-align: right; padding: 1px 6px; outline: none; }
input.taux::placeholder { color: var(--encre); opacity: 1; }
input.taux:focus { background: var(--carte); box-shadow: 0 0 0 1px var(--encre-35); }
.pied { margin: 0; padding: 0 4px; }
@media (max-height: 680px) { h1 { display: none; } }
