/* The /shop/ app (plugin tdb-file-shop, spec 2026-10-22 §5). v3 tokens only, so light and dark follow the
   theme; 44 px targets; long numbers wrap; nothing moves for a visitor who asked for less motion. */

.fs-app {
  display: block;
  min-width: 0;
}

/* The hero (Ionut, 26 Oct 2026): the trail, the heading, one line, one search bar, the upload and examples to try,
   in one column. The site's theme paints it as every page's dark hero (v4/css/shop.css); here only its order. */

.fs-hero__in {
  display: grid;
  gap: var(--sp-3);
  min-width: 0;
}

.fs-hero .crumbs,
.fs-hero__h,
.fs-hero__lede {
  margin: 0;
}

/* One search bar: the field and its button together. */
.fs-q {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 820px;
  min-height: 60px;
  margin-top: var(--sp-2);
  padding: 6px 6px 6px var(--sp-4);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-2);
  background: var(--field-bg);
  box-shadow: var(--shadow-float);
  color: var(--ink-3);
  transition: border-color var(--dur-1) ease;
}

.fs-q:focus-within {
  border-color: var(--focus);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.fs-q svg {
  flex: none;
}

.fs-q input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: var(--step-1);
}

.fs-q input[type="search"]:focus {
  outline: none;
}

.fs-q__go {
  flex: none;
  min-height: 48px;
}

.fs-kbd {
  padding: 0 var(--sp-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  line-height: 1.6;
}

.fs-hint {
  max-width: 820px;
  margin: 0;
  color: var(--ink-3);
  font-size: var(--step--1);
}

/* What the upload takes, before any click. */
.fs-formats {
  max-width: 820px;
  margin: 0;
  color: var(--ink-2);
  font-size: var(--step--1);
}

.fs-formats b {
  color: var(--ink);
  font-weight: 600;
}

/* The bar is also the upload (Ionut, 26 Oct 2026): its own button opens the picker, a file held over the page lights
   it and says what a drop does, and a line along its foot shows the work while a read is checked (modal.js). */
.fs-q {
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur-1) ease, box-shadow var(--dur-1) ease;
}

.fs-q__up {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0 var(--sp-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--dur-1) ease, background-color var(--dur-1) ease;
}

.fs-q__up:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.fs-q__up svg {
  flex: none;
  color: var(--accent-ink, var(--accent));
}

/* What a drop does, over the field while a file is held over the page. */
.fs-q__drop {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 0 var(--sp-4);
  border-radius: inherit;
  background: var(--field-bg);
  color: var(--ink);
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-1) ease;
}

.fs-q.is-over {
  border-style: dashed;
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.fs-q.is-over .fs-q__drop {
  opacity: 1;
}

/* The work as a line along the bar's foot: the fingerprint, the lookup, the upload by its percent, the match. */
.fs-q__line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  transition: width var(--dur-2) ease;
}

.fs-q__line.is-on {
  opacity: 1;
}

/* The picker itself is never seen: the bar's button opens it. */
.fs-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* A dropped read's steps and answer, under the bar, as wide as it. The dialog's own styles draw them (modal.css). */
.fs-reader {
  max-width: 820px;
  min-width: 0;
}

.fs-reader .tdbfs__msg:empty {
  display: none;
}

/* The examples. */
.fs-hero__alt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-5);
  max-width: 820px;
  margin-top: var(--sp-1);
}

.fs-tries {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
}

.fs-tries__h {
  color: var(--ink-3);
  font-size: var(--step--1);
}

.fs-try {
  min-height: 44px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  cursor: pointer;
  transition: color var(--dur-1) ease, border-color var(--dur-1) ease;
}

.fs-try:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.fs-body {
  padding-top: var(--sp-5);
}

/* The answer ---------------------------------------------------------------- */

.fs-results {
  display: grid;
  gap: var(--sp-4);
  min-width: 0;
  transition: opacity var(--dur-1) ease;
}

.fs-app.is-busy .fs-results {
  opacity: 0.6;
}

/* The toolbar: the count with the sort, then the file types and the make. */
.fs-bar {
  display: grid;
  gap: var(--sp-3);
}

.fs-bar__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
}

.fs-count {
  margin: 0;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.fs-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-4);
}

.fs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.fs-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.fs-chip:hover {
  background: var(--bg-hover);
}

.fs-chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.fs-chip__n {
  color: var(--ink-3);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}

.fs-chip[aria-pressed="true"] .fs-chip__n {
  color: var(--bg);
}

/* A native select, drawn like the chips, with its own chevron. */
.fs-select {
  position: relative;
  display: inline-flex;
  max-width: 100%;
}

.fs-select select {
  min-height: 44px;
  max-width: 100%;
  padding: 0 var(--sp-6) 0 var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-raised);
  color: var(--ink);
  font: inherit;
  font-size: var(--step--1);
  appearance: none;
  cursor: pointer;
}

.fs-select::after {
  position: absolute;
  top: 50%;
  right: var(--sp-3);
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  content: "";
  pointer-events: none;
  transform: rotate(45deg);
}

.fs-select select:focus-visible,
.fs-try:focus-visible,
.fs-q__up:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* A group is one original and every file made from it. */
.fs-groups {
  display: grid;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.fs-group {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  background: var(--bg-raised);
}

.fs-group__head {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--line);
}

.fs-group__title {
  margin: 0;
  color: var(--ink);
  font-size: var(--step-1);
  line-height: var(--leading-snug);
  overflow-wrap: anywhere;
}

.fs-group__facts {
  margin: 0;
  color: var(--ink-2);
  font-size: var(--step--1);
}

.fs-ids {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  margin: var(--sp-2) 0 0;
}

.fs-ids > div {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  min-width: 0;
}

.fs-ids dt {
  color: var(--ink-3);
  font-size: var(--step--1);
}

.fs-ids dd {
  margin: 0;
  color: var(--ink);
}

.fs-num {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

/* The digits that matched: the main button's own pair, which the theme keeps readable in light and dark. */
.fs-num mark {
  padding: 0 1px;
  border-radius: var(--radius-1);
  background: var(--btn-bg);
  color: var(--btn-ink);
}

.fs-term {
  border-bottom: 1px dotted var(--ink-3);
  cursor: help;
}

.fs-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Pick, the file, its size, its price, then its buttons and the menu: one line of items however many buttons there
   are (a visitor's Buy and Details, a member's Download, insta.css), the file's name taking what they leave. It was a
   grid of 7 fixed columns, and a member's 8th item fell to a line of its own under every file (26 Oct 2026). */
.fs-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1);
  border-top: 1px solid var(--line);
}

.fs-row:first-child {
  border-top: 0;
}

.fs-row:hover {
  background: var(--bg-hover);
}

.fs-row > * {
  flex: none;
}

.fs-pick {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
}

.fs-pick input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.fs-row__label {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.fs-row__label:hover {
  text-decoration: underline;
}

/* A dot says the kind of file at a glance, in the site's own colours (one palette, 26 Oct 2026): the original a ring, the
   stages filled from the accent to the ink as they go further; the word says it for everyone. */
.fs-stage::before {
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: var(--sp-2);
  border-radius: 50%;
  background: var(--ink-3);
  content: "";
}

.fs-stage--original::before {
  box-sizing: border-box;
  border: 2px solid var(--ink-3);
  background: transparent;
}

.fs-stage--stage1::before {
  background: var(--accent);
}

.fs-stage--stage2::before {
  background: var(--accent-ink);
}

.fs-stage--stage3::before,
.fs-stage--stage4::before,
.fs-stage--stage5::before {
  background: var(--ink);
}

.fs-row__price {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.fs-row__go,
.fs-row__buy {
  min-height: 44px;
}

/* The file's size: quiet, aligned, never wrapping. */
.fs-row__size {
  color: var(--ink-3);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fs-more {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-1);
  background: transparent;
  color: var(--ink-2);
  font-size: var(--step-1);
  line-height: 1;
  cursor: pointer;
}

.fs-more:hover {
  border-color: var(--line);
  background: var(--bg-hover);
}

.fs-load {
  justify-self: center;
}

/* Nothing found: never a dead end. */
.fs-empty {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-2);
}

.fs-empty p {
  margin: 0;
  color: var(--ink-2);
}

.fs-empty .fs-empty__h {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.fs-empty a,
.fs-custom a {
  color: var(--link);
}

/* The tray: what is ticked, its total, one button for the cart. */
.fs-tray {
  position: fixed;
  bottom: var(--sp-4);
  left: 50%;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  width: min(640px, calc(100% - 2 * var(--sp-4)));
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  background: var(--bg-raised);
  box-shadow: var(--shadow-float);
  transform: translateX(-50%);
}

.fs-tray[hidden] {
  display: none;
}

.fs-tray__sum {
  flex: 1 1 auto;
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

.fs-tray__total {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* The row menu: what the right click does, also from the ⋯ button and the menu key. */
.fs-menu {
  position: fixed;
  z-index: 60;
  display: grid;
  min-width: 240px;
  max-width: calc(100% - 16px);
  padding: var(--sp-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  background: var(--bg-raised);
  box-shadow: var(--shadow-float);
}

.fs-menu[hidden] {
  display: none;
}

.fs-menu__item {
  min-height: 44px;
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: var(--radius-1);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.fs-menu__item:hover,
.fs-menu__item:focus-visible {
  background: var(--bg-hover);
}

.fs-menu__item[disabled] {
  color: var(--ink-3);
  cursor: default;
}

.fs-chip:focus-visible,
.fs-row__label:focus-visible,
.fs-more:focus-visible,
.fs-pick:focus-within,
.fs-term:focus-visible,
.fs-menu__item:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* A phone ------------------------------------------------------------------ */

@media (max-width: 600px) {
  .fs-hero {
    padding-block: var(--sp-5);
  }

  .fs-q {
    padding-left: var(--sp-3);
  }

  .fs-q .fs-kbd {
    display: none;
  }

  .fs-hero__lede {
    font-size: var(--step-0);
  }

  /* On a phone the bar's upload keeps its icon; its name stays for screen readers. */
  .fs-q__up {
    padding: 0 var(--sp-2);
  }

  .fs-q__up-t {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .fs-q__drop {
    font-size: var(--step--1);
  }

  /* The examples, like the file types below, stay on one line and scroll sideways. */
  .fs-tries {
    flex-wrap: nowrap;
    width: calc(100% + 2 * var(--gutter));
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .fs-try {
    flex: none;
  }

  /* The file types stay on one line and scroll sideways, edge to edge. */
  .fs-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .fs-chips {
    flex-wrap: nowrap;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .fs-chip {
    flex: none;
    scroll-snap-align: start;
  }

  .fs-select--make,
  .fs-select--make select {
    width: 100%;
  }

  /* A phone keeps the file, its price and Buy on the line, the size under the file's name; Details is the name. */
  .fs-row {
    display: grid;
    grid-template-areas:
      "pick label price buy more"
      "pick size price buy more";
    grid-template-columns: 44px minmax(0, 1fr) auto auto 44px;
    row-gap: 0;
    padding-block: var(--sp-2);
  }

  .fs-pick {
    grid-area: pick;
  }

  .fs-row__label {
    grid-area: label;
    min-height: 0;
  }

  .fs-row__size {
    grid-area: size;
  }

  .fs-row__price {
    grid-area: price;
  }

  .fs-row__buy {
    grid-area: buy;
  }

  .fs-more {
    grid-area: more;
  }

  .fs-row__go {
    display: none;
  }

  /* A member's row: the file and its size, the price, Download, the menu. */
  .fs-row.has-insta {
    grid-template-areas:
      "label price get more"
      "size price get more";
    grid-template-columns: minmax(0, 1fr) auto auto 44px;
  }

  .fs-row.has-insta .tdbfs-insta__get {
    grid-area: get;
  }

  .fs-group__head {
    padding: var(--sp-3);
  }

}

@media (prefers-reduced-motion: reduce) {
  .fs-results,
  .fs-q,
  .fs-q__up,
  .fs-q__drop,
  .fs-q__line,
  .fs-try {
    transition: none;
  }
}
