/* ==========================================================================
   Netbooster : calculateurs et baromètre crypto (classes préfixées .nbt-)
   Chargé seulement sur /calculateurs/ et /barometre/, après main.css.
   Variables reprises de main.css : --ink, --brand, --sun, --paper, --card, --line, --muted, --radius, --shadow.
   ========================================================================== */

.nbt-body { padding-top: 24px; }
.nbt-h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); letter-spacing: -0.035em; margin: 0 0 16px; }
.nbt-h3 { font-size: 1.25rem; margin: 0 0 4px; }
.nbt-h4 { font-size: 1rem; margin: 22px 0 8px; }
.nbt-sub { font-weight: 500; font-size: .82rem; color: var(--muted); }

/* ---------- Avertissements ---------- */
.nbt-warning { display: flex; gap: 12px; align-items: flex-start; background: var(--sun-soft); border: 2px solid var(--ink); border-left-width: 8px; border-radius: var(--radius); padding: 14px 16px; margin: 0 0 24px; }
.nbt-warning p { margin: 0; font: 500 .95rem/1.55 var(--f-head); color: var(--ink); }
.nbt-warning__icon { flex: none; line-height: 0; margin-top: 2px; }
.nbt-warning__icon .icon { width: 24px; height: 24px; color: var(--ink); }
.nbt-warning--risk { background: #FFE9E5; border-left-color: #D92D20; }
.nbt-warning--risk .nbt-warning__icon .icon { color: #B42318; }

/* ---------- Calculateur : formulaire et résultat ---------- */
.nbt-app { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; margin: 0 0 24px; }
.nbt-panel { min-width: 0; background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 16px; }
.nbt-panel__title { display: flex; align-items: center; gap: .55em; font: 800 .76rem/1.2 var(--f-head); text-transform: uppercase; letter-spacing: .1em; color: var(--ink); margin: 0 0 18px; }
.nbt-panel__title::before { content: ""; width: .7em; height: .7em; background: var(--sun); border: 2px solid var(--ink); border-radius: 2px; flex: none; }
.nbt-panel--form { container-type: inline-size; container-name: nbtform; }
.nbt-panel--result { background: var(--ink); color: #E6E8F7; box-shadow: 4px 4px 0 var(--sun); }
.nbt-panel--result .nbt-panel__title { color: #fff; }

.nbt-form { margin: 0; }
.nbt-field { margin: 0 0 16px; }
.nbt-field[hidden], .nbt-set[hidden], .nbt-err[hidden] { display: none; }
.nbt-field > label:not(.nbt-choice) { display: block; font: 700 .93rem/1.35 var(--f-head); color: var(--ink); margin: 0 0 6px; }
.nbt-opt { font-weight: 500; color: var(--muted); }
.nbt-inputwrap { display: flex; align-items: stretch; background: #fff; border: 2px solid var(--ink); border-radius: var(--radius-sm); overflow: hidden; }
.nbt-inputwrap:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }
.nbt-inputwrap:has([aria-invalid="true"]) { border-color: #D92D20; background: #FFF6F5; }
.nbt-input { flex: 1; min-width: 0; width: 100%; min-height: 44px; border: 0; background: transparent; padding: .55em .8em; font: 600 1.05rem/1.3 var(--f-head); color: var(--ink); font-variant-numeric: tabular-nums; border-radius: 0; }
.nbt-input:focus, .nbt-input:focus-visible { outline: none; }
.nbt-input::placeholder { color: #7A809A; font-weight: 500; }
.nbt-select { cursor: pointer; }
.nbt-unit { display: flex; align-items: center; padding: 0 .85em; background: var(--paper-2); border-left: 2px solid var(--ink); font: 700 .95rem/1 var(--f-head); color: var(--ink); }
.nbt-help { margin: 6px 0 0; font: 400 .82rem/1.4 var(--f-head); color: var(--muted); }
.nbt-help--block { margin: -4px 0 16px; }
.nbt-err { margin: 6px 0 0; font: 700 .86rem/1.4 var(--f-head); color: #B42318; }

.nbt-set { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.nbt-set > legend { padding: 0; margin: 0 0 8px; font: 700 .93rem/1.35 var(--f-head); color: var(--ink); }
.nbt-set--box { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 14px 14px 0; }
.nbt-set--box > legend { padding: 0 6px; margin-left: -6px; }
.nbt-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.nbt-choice { display: flex; align-items: center; gap: .6em; min-height: 44px; padding: .5em .9em; border: 2px solid var(--ink); border-radius: var(--radius-sm); background: var(--card); cursor: pointer; font: 600 .93rem/1.3 var(--f-head); color: var(--ink); }
.nbt-choice input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.nbt-choice:has(input:checked) { background: var(--sun-soft); box-shadow: 2px 2px 0 var(--ink); }
.nbt-choice:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; }
.nbt-choice--check { width: 100%; }

.nbt-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
@container nbtform (min-width: 440px) {
	.nbt-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nbt-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.nbt-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.nbt-actions .btn { min-height: 44px; justify-content: center; }

/* Résultat */
.nbt-out { min-height: 120px; }
.nbt-placeholder { margin: 0; font: 400 1rem/1.55 var(--f-text); color: #B8BCDA; }
.nbt-big { display: flex; flex-direction: column; gap: 3px; margin: 0 0 14px; padding: 0 0 16px; border-bottom: 1px solid #2A3170; }
.nbt-big__label { font: 800 .72rem/1.3 var(--f-head); text-transform: uppercase; letter-spacing: .1em; color: #B8BCDA; }
.nbt-big__value { font: 800 clamp(1.9rem, 7vw, 2.6rem)/1.05 var(--f-head); letter-spacing: -0.03em; color: var(--sun); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.nbt-big__hint { font: 500 .92rem/1.4 var(--f-head); color: #D5D8EE; }
.nbt-rows { margin: 0; }
.nbt-rows__item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 14px; padding: 9px 0; border-bottom: 1px dashed #2A3170; }
.nbt-rows__item dt { font: 600 .9rem/1.35 var(--f-head); color: #B8BCDA; }
.nbt-rows__item dd { margin: 0 0 0 auto; text-align: right; font: 600 .98rem/1.35 var(--f-head); color: #fff; font-variant-numeric: tabular-nums; }
.nbt-rows__item dd strong { font-weight: 800; }
.nbt-rows .nbt-sub { color: #B8BCDA; }
.nbt-rows__item.is-total dd { color: var(--sun); font-size: 1.1rem; }
.nbt-rows__item.is-pos dd { color: #7DE3B8; }
.nbt-rows__item.is-neg dd { color: #FFB4A8; }
.nbt-note { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: #1C2250; font: 500 .88rem/1.5 var(--f-head); color: #D5D8EE; }
.nbt-note--formula { background: transparent; border: 1px dashed #3A4290; }
.nbt-note--warn { background: #3A2A08; border-left: 4px solid var(--sun); color: #FFE9A8; }
.nbt-note--ok { border-left: 4px solid #12B886; }
.nbt-error-title { margin: 0 0 8px; font: 800 1rem/1.3 var(--f-head); color: #FFB4A8; }
.nbt-errors { margin: 0; padding-left: 1.1em; font: 500 .94rem/1.5 var(--f-head); }
.nbt-errors li { margin: 0 0 6px; }
.nbt-errors a { color: #fff; }
.nbt-privacy { display: flex; gap: .55em; align-items: flex-start; margin: 18px 0 0; font: 500 .8rem/1.45 var(--f-head); color: #B8BCDA; }
.nbt-privacy .icon { flex: none; margin-top: .1em; }
.nbt-noscript { margin: 12px 0 0; padding: 10px 12px; border: 2px solid var(--sun); border-radius: var(--radius-sm); color: #fff; font: 600 .9rem/1.45 var(--f-head); }

/* ---------- Texte explicatif ---------- */
.nbt-prose { max-width: 820px; margin-top: 36px; }
.nbt-prose h2:first-child { margin-top: 0; }
.nbt-formulas { list-style: none; margin: 0 0 1.4em; padding: 0 !important; display: grid; gap: 10px; }
.nbt-formulas li { display: grid; gap: 4px; margin: 0; padding: 10px 14px; background: var(--card); border: 2px solid var(--ink); border-left: 8px solid var(--brand); border-radius: var(--radius); }
.nbt-formulas li span { font: 800 .72rem/1.3 var(--f-head); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.nbt-formulas code { padding: 0; background: none; font: 700 .95rem/1.5 var(--f-head); color: var(--ink); white-space: normal; overflow-wrap: anywhere; }
.nbt-example { background: var(--sun-soft); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px 6px; margin: 0 0 1.4em; }
.nbt-checks { list-style: none; padding: 0 !important; }
.nbt-checks li { position: relative; padding: 8px 0 8px 30px; border-bottom: 1px solid var(--line); margin: 0; }
.nbt-checks li::before { content: ""; position: absolute; left: 4px; top: 16px; width: 12px; height: 7px; border-left: 3px solid var(--brand); border-bottom: 3px solid var(--brand); transform: rotate(-45deg); }
.nbt-faq details p { margin: 0 0 14px; }

.nbt-sources { max-width: 820px; margin-top: 36px; padding: 16px 18px; border: 2px dashed var(--line-2); border-radius: var(--radius); font: 500 .9rem/1.5 var(--f-head); }
.nbt-sources__title { margin: 0 0 8px; font: 800 .74rem/1.3 var(--f-head); text-transform: uppercase; letter-spacing: .09em; }
.nbt-sources ul { margin: 0 0 8px; padding-left: 1.1em; }
.nbt-sources a { color: var(--ink); text-decoration-color: var(--brand); text-decoration-thickness: 2px; overflow-wrap: anywhere; }
.nbt-sources a:hover { color: var(--brand-dark); }
.nbt-sources__date { margin: 0; color: var(--muted); font-size: .84rem; }

/* ---------- Cartes (hub, outils liés) ---------- */
.nbt-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; list-style: none; margin: 0 0 28px; padding: 0; }
.nbt-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 4px; align-content: start; height: 100%; min-height: 44px; padding: 16px 18px; background: var(--card); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--radius); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.nbt-card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); color: var(--ink); }
.nbt-card__icon { grid-row: span 3; display: grid; place-items: center; width: 44px; height: 44px; background: var(--sun); border-radius: 8px; color: var(--ink); }
.nbt-card__icon .icon { width: 24px; height: 24px; }
.nbt-card__name { font: 800 1.1rem/1.2 var(--f-head); letter-spacing: -0.02em; }
.nbt-card__text { font: 400 .92rem/1.45 var(--f-text); color: var(--muted); }
.nbt-card__go { display: inline-flex; align-items: center; gap: .35em; font: 700 .85rem/1.3 var(--f-head); color: var(--brand-dark); }
.nbt-related { margin-top: 48px; }
.nbt-baro-teaser { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: center; margin: 0 0 8px; padding: 18px; background: var(--ink); color: #D5D8EE; border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--sun); }
.nbt-baro-teaser .nbt-h3 { color: #fff; }
.nbt-baro-teaser p { margin: 0; font: 400 .98rem/1.5 var(--f-text); }
.nbt-baro-teaser .nbt-card__icon { width: 44px; height: 44px; }
.nbt-baro-teaser .btn { justify-self: start; min-height: 44px; }

/* ---------- Baromètre ---------- */
.nbt-baro__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.nbt-baro__stamp { margin: 0; font: 600 .9rem/1.4 var(--f-head); color: var(--muted); }
.nbt-baro__bar .btn { min-height: 44px; }
.nbt-baro__bar .btn[disabled] { opacity: .6; cursor: progress; transform: none; box-shadow: var(--shadow-sm); }
.nbt-baro__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin: 0 0 18px; }
.nbt-baro > .nbt-privacy { color: var(--muted); }
.nbt-quote__price { margin: 0 0 6px; font: 800 clamp(2rem, 7vw, 2.8rem)/1 var(--f-head); letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.nbt-quote__change { margin: 0; font: 800 1rem/1.3 var(--f-head); }
.nbt-quote__change.is-up { color: #067A56; }
.nbt-quote__change.is-down { color: #B42318; }
.nbt-loading, .nbt-fallback { margin: 0; font: 600 .95rem/1.45 var(--f-head); color: var(--muted); }
.nbt-fallback { padding: 14px 16px; border: 2px dashed var(--line-2); border-radius: var(--radius-sm); }
.nbt-stale { margin: 10px 0 0; font: 600 .82rem/1.4 var(--f-head); color: #8A5300; }
.nbt-fng__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 14px; }
.nbt-fng__value { margin: 0; font: 800 3.2rem/1 var(--f-head); letter-spacing: -0.04em; color: var(--ink); }
.nbt-fng__value span { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.nbt-fng__label { margin: 0; padding: .4em .8em; border: 2px solid var(--ink); border-radius: 999px; font: 800 .95rem/1.2 var(--f-head); color: #fff; background: var(--ink); }
.nbt-fng__label--xfear { background: #D92D20; }
.nbt-fng__label--fear { background: #C2310F; }
.nbt-fng__label--neutral { background: var(--sun); color: var(--ink); }
.nbt-fng__label--greed { background: #067A56; }
.nbt-fng__label--xgreed { background: #055C41; }
.nbt-gauge { margin: 0 0 10px; }
.nbt-gauge__track { position: relative; height: 14px; border: 2px solid var(--ink); border-radius: 999px; background: linear-gradient(90deg, #D92D20 0%, #E8482B 25%, var(--sun) 50%, #7BD389 75%, #0E9F6E 100%); }
.nbt-gauge__marker { position: absolute; top: -8px; bottom: -8px; width: 8px; margin-left: -4px; background: var(--ink); border: 2px solid #fff; border-radius: 4px; }
.nbt-gauge__scale { display: flex; justify-content: space-between; margin-top: 6px; font: 700 .72rem/1 var(--f-head); color: var(--muted); }
.nbt-chart { display: block; width: 100%; max-width: 560px; height: auto; }
.nbt-chart__grid { stroke: var(--line-2); stroke-width: 1; }
.nbt-chart__grid.is-mid { stroke: var(--ink); stroke-dasharray: 4 4; opacity: .5; }
.nbt-chart__axis { fill: var(--muted); font: 600 10px var(--f-head); }
.nbt-chart__line { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.nbt-chart__dot { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.nbt-chart__dot.is-last { fill: var(--sun); }
.nbt-histo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 12px 0 0; padding: 0; }
.nbt-histo li { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--paper); font: 600 .74rem/1.3 var(--f-head); color: var(--muted); }
.nbt-histo strong { font-size: 1.05rem; color: var(--ink); }

/* ---------- Écrans larges ---------- */
@media (min-width: 640px) {
	.nbt-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nbt-panel { padding: 24px 22px; }
	.nbt-baro-teaser { grid-template-columns: auto minmax(0, 1fr) auto; padding: 20px 22px; }
	.nbt-baro-teaser .btn { justify-self: end; }
}
@media (min-width: 760px) {
	.nbt-baro__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nbt-fng { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
	.nbt-app { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; }
	.nbt-panel--result { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
	.nbt-related .nbt-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
	.nbt-cards--hub { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.nbt-baro__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
	.nbt-fng { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 480px) {
	.nbt-choice { flex: 1 1 100%; }
	.nbt-histo { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
	.nbt-histo li { padding: 5px 6px; }
}
@media print {
	.nbt-actions, .nbt-baro__bar .btn { display: none !important; }
	.nbt-panel--result { box-shadow: none; }
	.nbt-panel--result, .nbt-panel--result * { background: none !important; color: #000 !important; }
}
