/* ══ THE FILE CONVERTER BOX (13 Nov 2026), js/fconv.js. Ported from design-gallery/tries/convert (cv.css), the look he
   saw. Colours, buttons, the picker, the chip and the Orbit spinner are the kit's (crm-kit.css, scoped to .kt); this
   file only lays them out. Nothing moves when words change: every row has a fixed height, the state line and its text
   slot are reserved, the picker has a fixed width, the footer is always there. ══ */
.fcv-host .pp-ov { z-index: 1000; }
.fcv-host { --fcv-dash: #c4c4cb; --fcv-dash-hi: #6e6e76; --fcv-card: var(--sp-wash); }
:root[data-theme="dark"] .fcv-host { --fcv-dash: #4a4a53; --fcv-dash-hi: #8a8a93; --fcv-card: #222228; }
/* ⚠ NO prefers-color-scheme here (17 Nov 2026): the CRM follows only its own sun/moon switch (crm-kit.css turned the OS rule off).
   Following the laptop setting made this card dark under light-mode text: "cant see shit". */

/* one size, whatever is in it: the box never grows or re-centres while files arrive */
.fcv-host .fcv-box { width: min(640px, 100%); height: min(640px, calc(100vh - 24px)); }
.fcv-host .fcv-bd { display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }

/* the drop area: our own button, the real file input stays hidden. Empty box = it fills the box; with files = a strip */
.fcv-host .fcv-drop { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 160px; padding: 24px; background: var(--sp-bg); color: var(--sp-ink); border: 2px dashed var(--fcv-dash); border-radius: 16px; font: inherit; text-align: center; cursor: pointer; overflow: hidden; transition: border-color 160ms ease, background-color 160ms ease, transform 160ms var(--sp-ease-out); }
.fcv-host .fcv-drop:active:not(:disabled) { transform: scale(.99); }
.fcv-host .fcv-drop:disabled { cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .fcv-host .fcv-drop:hover:not(:disabled) { border-color: var(--fcv-dash-hi); }
  .fcv-host .fcv-drop:hover:not(:disabled) .fcv-drop-ic { transform: translateY(-2px); }
}
.fcv-host .fcv-drop.is-over { border-color: var(--sp-red); background: color-mix(in srgb, var(--sp-red) 6%, var(--sp-bg)); }
.fcv-host .fcv-drop-ic { display: grid; place-items: center; flex: none; width: 56px; height: 56px; margin-bottom: 12px; border-radius: 50%; background: var(--dp-tint); color: var(--sp-red); transition: transform 220ms var(--sp-ease-out); }
.fcv-host .fcv-drop.is-over .fcv-drop-ic { transform: translateY(-4px); }
.fcv-host .fcv-drop-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fcv-host .fcv-drop-w { display: grid; gap: 2px; }
.fcv-host .fcv-drop-t { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.fcv-host .fcv-drop-s { font-size: 15px; color: var(--sp-grey); }
.fcv-host .fcv-drop-s:empty { display: none; }
.fcv-host .fcv-drop.is-small { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 14px; min-height: 0; height: 68px; padding: 0 18px; text-align: left; }
.fcv-host .fcv-drop.is-small .fcv-drop-ic { width: 36px; height: 36px; margin: 0; }
.fcv-host .fcv-drop.is-small .fcv-drop-ic svg { width: 18px; height: 18px; }
.fcv-host .fcv-drop.is-small .fcv-drop-t { font-size: 16px; }
.fcv-host .fcv-drop.is-small .fcv-drop-s { font-size: 14px; }

/* one row per file: a soft panel on the white box. Fixed height: name and size, the picker, the X, the state line */
.fcv-host .fcv-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.fcv-host .fcv-card { display: grid; grid-template-columns: minmax(0, 1fr) 220px 36px; grid-template-rows: 48px 28px; align-items: center; column-gap: 12px; row-gap: 6px; height: 106px; padding: 12px 10px 12px 16px; background: var(--fcv-card); border-radius: 14px; }
.fcv-host .fcv-head { min-width: 0; display: grid; gap: 1px; }
.fcv-host .fcv-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; line-height: 1.35; font-weight: 600; }
.fcv-host .fcv-size { font-size: 14px; color: var(--sp-grey); font-variant-numeric: tabular-nums; min-height: 19px; }
.fcv-host .fcv-pick { min-width: 0; }
.fcv-host .fcv-pick .po-btn { min-height: 44px; }
.fcv-host .fcv-pick .po-btn:disabled { cursor: default; color: var(--sp-ink); opacity: .7; }
.fcv-host .fcv-note { display: block; font-size: 14px; color: var(--sp-grey); }
.fcv-host .fcv-x { position: relative; color: var(--sp-grey); }
.fcv-host .fcv-x::before { content: ""; position: absolute; inset: -4px; }   /* 44px to the finger, 36px on screen */
@media (hover: hover) and (pointer: fine) { .fcv-host .fcv-x:hover:not(:disabled) { color: var(--sp-ink); background: var(--sp-soft); } }
.fcv-host .fcv-x:disabled { cursor: default; opacity: .4; }

/* the state line: its height is kept from the start */
.fcv-host .fcv-state { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-width: 0; height: 28px; font-size: 14px; color: var(--sp-grey); }
.fcv-host .fcv-state.is-ok { color: var(--sp-ok); font-weight: 500; }
.fcv-host .fcv-state.is-bad { color: var(--sp-red); font-weight: 500; }
.fcv-host .fcv-state .sn { --sn-ok: var(--sp-ok); }
.fcv-host .fcv-state-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcv-host .fcv-state-t.is-slot { flex: none; width: 150px; font-variant-numeric: tabular-nums; }
.fcv-host .fcv-sp { flex: none; width: 16px; height: 16px; }
.fcv-host .fcv-bar { flex: 1 1 auto; max-width: 220px; height: 6px; border-radius: 999px; background: var(--sp-soft); overflow: hidden; }
.fcv-host .fcv-bar[data-none] { visibility: hidden; }
.fcv-host .fcv-bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--sp-red); transform-origin: left; transform: scaleX(0); transition: transform 200ms linear; }

/* the footer, always there: the "one PDF" switch on the left (only with two or more pictures), Convert on the right */
.fcv-host .fcv-ft { align-items: center; border-top: 1px solid var(--sp-rule); padding-top: 14px; }
.fcv-host .fcv-join { margin: 0 auto 0 0; }
.fcv-host .fcv-join:disabled { cursor: default; }
.fcv-host .fcv-chk { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 2px; border: 1.5px solid var(--sp-line); border-radius: 6px; transition: background-color 140ms ease, border-color 140ms ease; }
.fcv-host .fcv-chk::after { content: ""; width: 9px; height: 5px; margin-top: -2px; border: solid var(--sp-on-red); border-width: 0 0 2px 2px; transform: rotate(-45deg) scale(0); transition: transform 180ms var(--sp-ease-out); }
.fcv-host .fcv-join[aria-checked="true"] .fcv-chk { background: var(--sp-red-fill); border-color: transparent; }
.fcv-host .fcv-join[aria-checked="true"] .fcv-chk::after { transform: rotate(-45deg) scale(1); }
.fcv-host .fcv-go { min-width: 132px; }
/* a quiet line button while there is nothing to convert, never a big grey block (design check 15 Nov) */
.fcv-host .fcv-go:disabled { cursor: default; opacity: 1; background: transparent; color: var(--sp-grey); box-shadow: inset 0 0 0 1px var(--sp-line); }
.fcv-host [hidden] { display: none !important; }

@media (max-width: 600px) {
  .fcv-host .fcv-box { height: calc(100vh - 24px); height: calc(100dvh - 24px); }
  .fcv-host .fcv-card { grid-template-columns: minmax(0, 1fr) 36px; grid-template-rows: 44px 44px 28px; height: 156px; padding: 12px 8px 12px 14px; }
  .fcv-host .fcv-head { grid-column: 1; grid-row: 1; }
  .fcv-host .fcv-x { grid-column: 2; grid-row: 1; }
  .fcv-host .fcv-pick { grid-column: 1 / -1; grid-row: 2; }
  .fcv-host .fcv-state { grid-row: 3; }
  /* a refused file has no picker: its line may take two lines, in the picker's place */
  .fcv-host .fcv-card.is-bad .fcv-state { grid-row: 2 / 4; align-self: start; height: auto; padding-top: 4px; }
  .fcv-host .fcv-card.is-bad .fcv-state-t { white-space: normal; }
  .fcv-host .fcv-drop.is-small { height: 60px; }
  .fcv-host .fcv-ft { flex-wrap: wrap; }
  .fcv-host .fcv-go { flex: 1 1 auto; min-height: 52px; font-size: 16px; }
  .fcv-host .fcv-join { flex: 1 1 100%; justify-content: center; }
}

/* ══ polish, 18 Nov 2026 (his "polish" sheet for Data Bank and Files): on a laptop the Convert box is in the entry box's
   family: 24px round it, a head with a line under it and the title 28px in, the body and the foot on the same edge. ══ */
@media (min-width:761px) {
  .fcv-host .pp-ov { padding: 24px; box-sizing: border-box; }
  .fcv-host .fcv-box { height: min(640px, 100%); }
  .fcv-host .fcv-box .pp-hd { padding: 22px 20px 16px 28px; border-bottom: 1px solid var(--sp-rule); }
  .fcv-host .fcv-box .pp-t { font-size: 22px; font-weight: 700; }
  .fcv-host .fcv-bd { padding: 18px 28px 20px; }
  .fcv-host .fcv-ft { padding: 14px 28px 20px; border-top: 1px solid var(--sp-rule); }
}
