/* Advanced farm calculator (/tools/farm), phone redesign Nov 2026 (mockup: asicprofit-admin/preview/mobile-calcs/farm).
   Labels above the fields, units inside, 44 px taps, folding steps; one hero result; a calm pinned result bar on phones.
   Motion is slow on purpose (owner 7 Nov: "too aggressive"). Uses the site's colour tokens, so dark mode follows. */
.fmx { --fx-navy: #13243a; --fx-g: var(--pos); --fx-line: hsl(var(--border)); --fx-field: hsl(var(--field-border)); --fx-mut: hsl(var(--muted-foreground)); --fx-soft: hsl(var(--muted)); --fx-card: hsl(var(--card)); --fx-ease: cubic-bezier(.22,.61,.36,1); }
:root[data-theme="dark"] .fmx { --fx-navy: #0f1b2c; }
.fmx .lead .fx-short { display: none; }
.fx-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; padding-bottom: 32px; }
@container (min-width: 820px) { .fx-grid { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 28px; } }
.fx-in, .fx-out { min-width: 0; }
.fx-in input, .fx-in button, .fx-sheet input, .fx-sheet button { font: inherit; color: inherit; }
/* the site's page-wide pill style for inputs (app.css "controls: pills") must not draw a second box inside ours */
.fmx .fx-box input, .fmx .fx-step input { background: transparent !important; border: 0 !important; border-radius: 0 !important; padding-inline: 0 !important; box-shadow: none !important; height: auto; }

/* folding steps with a one-line summary */
.fx-sec { background: var(--fx-card); border: 1px solid var(--fx-line); border-radius: 16px; margin: 0 0 12px; }
.fx-sec > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px; border-radius: 16px; }
.fx-sec > summary::-webkit-details-marker { display: none; }
.fx-sec > summary:focus-visible { outline: 3px solid var(--fx-g); outline-offset: 2px; }
.fx-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--fx-navy); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; }
:root[data-theme="dark"] .fx-n { background: hsl(var(--foreground)); color: hsl(var(--background)); }
.fx-st { flex: 1; min-width: 0; } .fx-st b { display: block; font-size: 17px; }
.fx-st small { display: block; color: var(--fx-mut); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-sec[open] > summary small { display: none; }
.fx-chev { flex: none; color: var(--fx-mut); transition: transform .45s var(--fx-ease); }
.fx-sec[open] > summary .fx-chev { transform: rotate(180deg); }
.fx-body { padding: 0 16px 16px; }
.fx-sub { margin: 0; border-radius: 12px; }
.fx-sub > summary { min-height: 52px; padding: 8px 12px; border-radius: 12px; } .fx-sub .fx-st b { font-size: 15px; }
.fx-sub > .fx-body { padding: 0 12px 12px; }

/* fields: label above, unit inside, helper line under */
.fx-f { display: block; margin: 0 0 16px; min-width: 0; }
.fx-l { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.fx-box { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--fx-field); border-radius: 12px; background: var(--fx-card); }
.fx-box:focus-within, .fx-step:focus-within { border-color: var(--fx-g); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fx-g) 18%, transparent); }
.fx-box input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: none; font-size: 17px; padding: 11px 0; font-variant-numeric: tabular-nums; }
.fx-u { flex: none; color: var(--fx-mut); font-size: 14.5px; }
.fx-help { display: block; color: var(--fx-mut); font-size: 13.5px; line-height: 1.45; margin-top: 6px; }
.fx-err { display: block; color: var(--neg); font-size: 13.5px; margin-top: 6px; }
.fx-err[hidden] { display: none; }
.fx-note { background: var(--fx-soft); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin: 0 0 14px; }
.fx-empty { color: var(--fx-mut); margin: 0 0 10px; }

/* −/+ steppers */
.fx-step { display: flex; align-items: stretch; min-height: 48px; border: 1.5px solid var(--fx-field); border-radius: 12px; background: var(--fx-card); overflow: hidden; }
.fx-step button { flex: none; width: 48px; min-height: 45px; border: 0; background: var(--fx-soft); font-size: 22px; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.fx-step button:active { filter: brightness(.94); }
.fx-step input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: none; text-align: center; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* miner cards */
.fx-mc { border: 1px solid var(--fx-line); border-radius: 14px; padding: 12px; margin: 0 0 10px; background: hsl(var(--background)); }
.fx-mc-h { display: flex; gap: 10px; align-items: flex-start; }
.fx-ph { flex: none; object-fit: contain; border-radius: 6px; background: #f4f6f8; }
.fx-mc-n { flex: 1; min-width: 0; } .fx-mc-n a { font-weight: 700; color: hsl(var(--foreground)); text-decoration: none; font-size: 15.5px; overflow-wrap: anywhere; }
.fx-mc-n a:hover { text-decoration: underline; }
.fx-mc-n small, .fx-nm small { display: block; color: var(--fx-mut); font-size: 13px; margin-top: 2px; }
.fx-ai { display: inline-block; vertical-align: -3px; margin-right: 2px; border-radius: 50%; object-fit: contain; }
.fx-ai0 { display: inline-grid; place-items: center; border-radius: 5px; background: #64748b; color: #fff; font-size: 8px; font-weight: 800; font-style: normal; }
.fx-x { flex: none; width: 44px; height: 44px; margin: -6px -6px 0 0; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--fx-mut); display: grid; place-items: center; }
.fx-x:hover { background: var(--fx-soft); color: var(--neg); }
.fx-mc-g { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; }
.fx-mc-g .fx-f { margin: 0; } .fx-mc-g .fx-l { font-size: 13.5px; margin-bottom: 4px; }
.fx-mc .fx-step button { width: 44px; } .fx-mc .fx-box { padding: 0 10px; }
.fx-mc-e { font-size: 13px; color: var(--fx-mut); margin-top: 8px; }
.fx-addb { width: 100%; min-height: 52px; border: 1.5px dashed var(--fx-g); background: color-mix(in srgb, var(--fx-g) 8%, transparent); color: var(--fx-g); border-radius: 14px; font-weight: 700; font-size: 16px; cursor: pointer; }
.fx-addb:focus-visible { outline: 3px solid var(--fx-g); outline-offset: 2px; }

/* yearly-change sliders */
.fx-rg { margin: 0 0 18px; }
.fx-rg-h { display: flex; align-items: center; gap: 8px; }
.fx-rg-h .fx-l { flex: 1; min-width: 0; margin: 0; }
.fx-rg-v { min-width: 62px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 16px; }
.fx-pm { flex: none; width: 44px; height: 44px; border: 1.5px solid var(--fx-field); background: hsl(var(--background)); border-radius: 12px; font-size: 20px; font-weight: 600; cursor: pointer; touch-action: manipulation; }
.fx-rg input[type=range] { display: block; width: 100%; height: 44px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.fx-rg input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--fx-g) var(--p, 50%), var(--fx-line) var(--p, 50%)); }
.fx-rg input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--fx-g); margin-top: -10px; box-shadow: 0 1px 4px rgb(0 0 0 / .2); }
.fx-rg input[type=range]::-moz-range-track { height: 8px; border-radius: 8px; background: var(--fx-line); }
.fx-rg input[type=range]::-moz-range-progress { height: 8px; border-radius: 8px; background: var(--fx-g); }
.fx-rg input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--fx-g); }
.fx-rg input[type=range]:focus-visible { outline: 3px solid color-mix(in srgb, var(--fx-g) 40%, transparent); outline-offset: 2px; border-radius: 8px; }
.fx-rg-mm { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--fx-mut); margin-top: -6px; }
.fx-sw { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; cursor: pointer; position: relative; }
.fx-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fx-tr { flex: none; width: 52px; height: 32px; border-radius: 32px; background: var(--fx-field); position: relative; transition: background .45s ease; }
.fx-tr::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .45s var(--fx-ease); }
.fx-sw input:checked + .fx-tr { background: var(--fx-g); } .fx-sw input:checked + .fx-tr::after { transform: translateX(20px); }
.fx-sw input:focus-visible + .fx-tr { outline: 3px solid color-mix(in srgb, var(--fx-g) 40%, transparent); outline-offset: 2px; }
.fx-t { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; } .fx-t small { display: block; font-weight: 400; color: var(--fx-mut); font-size: 13.5px; margin-top: 2px; }

/* results */
#fmOut { scroll-margin-top: 12px; }
.fx-hero { background: var(--fx-navy); color: #fff; border-radius: 20px; padding: 18px 18px 16px; margin: 0 0 12px; }
:root[data-theme="dark"] .fx-hero { border: 1px solid var(--fx-line); }
.fx-k { font-size: 14px; opacity: .85; }
.fx-big { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin: 2px 0 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fx-big.neg { color: #ff8a80; }
.fx-hsub { font-size: 14.5px; opacity: .9; }
.fx-pb { display: flex; gap: 10px; margin-top: 14px; }
.fx-pb > div { flex: 1; min-width: 0; background: rgb(255 255 255 / .1); border-radius: 12px; padding: 10px 12px; }
.fx-pb span { display: block; font-size: 12.5px; opacity: .8; } .fx-pb b { font-size: 18px; font-variant-numeric: tabular-nums; }
.fx-sbar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; margin: 14px 0 8px; background: rgb(255 255 255 / .15); }
.fx-sbar i { display: block; height: 100%; }
.fx-leg { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; opacity: .9; }
.fx-leg span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; background: var(--c); vertical-align: -1px; }
.fx-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.fx-facts > div { min-width: 0; background: var(--fx-card); border: 1px solid var(--fx-line); border-radius: 12px; padding: 10px; }
.fx-facts span { display: block; font-size: 12.5px; color: var(--fx-mut); } .fx-facts b { font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fx-card { background: var(--fx-card); border: 1px solid var(--fx-line); border-radius: 16px; padding: 14px 16px; margin: 0 0 12px; min-width: 0; }
.fx-card h2 { font-size: 17px; margin: 0 0 10px; }
.fx-bd { list-style: none; margin: 0; padding: 0; }
.fx-bd li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--fx-line); font-variant-numeric: tabular-nums; }
.fx-bd li:last-child { border-bottom: 0; }
.fx-bd li span { min-width: 0; } .fx-bd li small { display: block; color: var(--fx-mut); font-size: 12.5px; }
.fx-bd li b { white-space: nowrap; }
.fx-bd li.fx-tot { border-top: 2px solid hsl(var(--foreground)); padding-top: 11px; font-size: 17px; }
.fmx .pos { color: var(--pos); } .fmx .neg { color: var(--neg); } .fx-mut { color: var(--fx-mut); }
.fx-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.fx-chart text { font-size: 11px; fill: var(--fx-mut); }
.fx-cg { stroke: var(--fx-line); }
.fx-ca { fill: color-mix(in srgb, var(--fx-g) 9%, transparent); }
.fx-cl { fill: none; stroke: var(--fx-g); stroke-width: 2.5; stroke-linejoin: round; }
.fx-ci { stroke: hsl(var(--foreground)); stroke-width: 1.5; stroke-dasharray: 6 5; }
.fx-cbe { fill: hsl(var(--background)); stroke: var(--fx-g); stroke-width: 3; }
.fx-chart text.fx-cbt { font-size: 12px; font-weight: 700; fill: var(--fx-g); stroke: hsl(var(--card)); stroke-width: 4px; paint-order: stroke; }
.fx-cleg { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin-top: 8px; }
.fx-cleg span::before { content: ""; display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--fx-g); margin-right: 6px; vertical-align: 4px; }
.fx-cleg .fx-cleg-i::before { border-top: 2px dashed hsl(var(--foreground)); }
.fx-yr { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.fx-yc { border: 1px solid var(--fx-line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.fx-yc h3 { margin: 0 0 6px; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fx-yc h3 small { color: var(--fx-mut); font-weight: 400; font-size: 12.5px; }
.fx-yc dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.fx-yc dt { color: var(--fx-mut); } .fx-yc dt small { display: block; font-size: 12px; } .fx-yc dt b { color: hsl(var(--foreground)); }
.fx-yc dd { margin: 0; text-align: right; white-space: nowrap; }
.fx-foot { font-size: 13px; color: var(--fx-mut); margin: 8px 0 14px; }
.fx-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.fx-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid hsl(var(--foreground)); background: none; font: inherit; font-weight: 700; color: hsl(var(--foreground)); cursor: pointer; }
.fx-btn.fx-txt { border-color: transparent; text-decoration: underline; font-weight: 600; }
.fx-flash { animation: fx-fl 1.4s ease; border-radius: 8px; }
@keyframes fx-fl { 0% { background-color: rgb(34 197 94 / .38); } 100% { background-color: transparent; } }

/* pinned result bar (phones and tablets, while the results are off screen): calm, slow slide */
.fx-bar { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 44; max-width: 704px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border: 0; border-radius: 16px; background: var(--fx-navy); color: #fff; font: inherit; text-align: left; cursor: pointer; box-shadow: 0 8px 24px rgb(15 23 42 / .35); transform: translateY(140%); opacity: 0; pointer-events: none; transition: transform .55s var(--fx-ease), opacity .55s ease; }
.fx-bar.on { transform: none; opacity: 1; pointer-events: auto; }
.fx-bar:focus-visible { outline: 3px solid var(--fx-g); outline-offset: 3px; }
.fx-bar-a { flex: 1; min-width: 0; } .fx-bar-a span { display: block; font-size: 12.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-bar-a b { font-size: 21px; font-variant-numeric: tabular-nums; } .fx-bar-a b.neg { color: #ff8a80; } .fx-bar-a b.fx-sm { font-size: 15px; }
.fx-bar-p { text-align: right; font-size: 12.5px; opacity: .9; white-space: nowrap; } .fx-bar-p b { display: block; font-size: 15px; }
.fx-bar-go { flex: none; width: 36px; height: 36px; border-radius: 50%; background: rgb(255 255 255 / .14); display: grid; place-items: center; }
html.fx-bar-on .to-top { bottom: calc(92px + env(safe-area-inset-bottom)); }
@media (max-width: 1099px) { .fmx { padding-bottom: 84px; } }

/* add-miner sheet (look and motion from mobile-ui.css) */
.fx-sheet .apm-sheet-p { height: 88vh; max-height: 88vh; max-width: 720px; margin: 0 auto; }
.fx-afl { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none; flex: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.fx-afl::-webkit-scrollbar { display: none; }
.fx-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--fx-field, #c9d1cc); border-radius: 999px; background: hsl(var(--background)); font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fx-chip small { color: hsl(var(--muted-foreground)); font-weight: 500; font-size: 12.5px; }
.fx-chip[aria-pressed="true"] { border-color: var(--pos); background: color-mix(in srgb, var(--pos) 10%, transparent); color: var(--pos); }
.fx-sheet .apm-list { flex: 1; padding-bottom: 16px; }
.fx-hits li[data-i] { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 6px 10px; border-radius: 12px; cursor: pointer; }
.fx-nm { flex: 1; min-width: 0; } .fx-nm b { display: block; font-size: 15px; font-weight: 600; } .fx-nm em { font-style: normal; font-weight: 700; color: var(--pos); }
.fx-inc { flex: none; text-align: right; font-size: 12.5px; color: hsl(var(--muted-foreground)); white-space: nowrap; } .fx-inc b { display: block; color: var(--pos); font-size: 15px; }
.fx-sheet .apm-list li[aria-selected="false"] { font-weight: inherit; }
/* the search box keeps a field edge and square-ish corners (the site's page-wide pill rule would round it), and the rows
   (data-i, not the picker's data-v) get the picker's hover colour */
.fx-sheet .apm-q { background: hsl(var(--background)); color: hsl(var(--foreground)); border-color: hsl(var(--field-border)); border-radius: 12px; }
.fx-sheet .apm-list li[data-i]:hover, .fx-sheet .apm-list li[data-i]:focus { background: hsl(var(--muted)); outline: none; }
:root[data-theme="dark"] .fx-ph { background: #e8ecf0; }
.fx-toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 65; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: hsl(var(--foreground)); color: hsl(var(--background)); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .45s ease; }
.fx-toast.on { opacity: 1; }

/* phones: the short intro, so the first step starts on the first screen */
@media (max-width: 759px) {
  .fmx .lead .fx-long { display: none; } .fmx .lead .fx-short { display: inline; }
  .fx-big { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) { .fx-bar, .fx-chev, .fx-tr, .fx-tr::after, .fx-toast { transition: none; } .fx-flash { animation: none; } }
@media print { .fx-bar, .fx-toast, .fx-acts { display: none; } .fx-sec .fx-body { display: block; } }
/* right-to-left pages: amounts and units ("34 kW", "−$1,200") stay in reading order */
:is(.fx-bd, .fx-facts, .fx-pb, .fx-yc, .fx-bar-a, .fx-bar-p, .fx-inc, .fx-mc-e) b, .fx-yc dd, .fx-rg-v { unicode-bidi: isolate; direction: ltr; }
[dir="rtl"] .fx-big { direction: ltr; text-align: right; }
