/* Hair Harvester — selling: the choice of kind and the lot wizard. Loaded after the core stylesheet; scope every rule to this area's pages. */

/* Scopes: .sellchoose (the choice of kind), .sellpage (the wizard for a new lot and for editing one),
   .selledit (the short form of a lot that already has bids), .mylots (the seller's list), .verifypage (video verification). */

/* ---------- the choice of kind ---------- */
.sellchoose h1 { margin-bottom: var(--s2); }
.sellchoose .sellchoose-lead { margin: 0 0 var(--s5); max-width: 36em; }
.sellchoose .sellchoose-lead b { color: var(--ink); }
/* each choice says that it leads on: a stitched arrow at its right edge */
.sellchoose .choice { display: flex; align-items: center; min-height: 76px; padding-right: 46px; }
.sellchoose .choice::before { top: 50%; margin-top: -14px; }
.sellchoose .choice::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 14px; height: 14px; margin-top: -7px; background: var(--red);
  -webkit-mask: var(--i-arrow-red) center / 14px 14px no-repeat; mask: var(--i-arrow-red) center / 14px 14px no-repeat;
}
.sellchoose .choice:hover::after { background: var(--cloth); }
.sellchoose .choice:active { background: #000; }
.sellchoose .choice.kind-cut b, .sellchoose .choice.kind-to_cut b { font-size: 1.375rem; }
/* what will be needed stands after the choices: on a phone the choices are on the first screen */
.sellchoose .sellneed { margin: var(--s5) 0 0; }
.sellchoose p.sellneed { max-width: 36em; padding-top: var(--s4); background: var(--run) top / auto 2px repeat-x; }

@media (min-width: 640px) {
  /* the two kinds of hair take half a row each, the three finished goods a third each */
  .sellchoose .choices { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .sellchoose .choice { grid-column: span 3; }
  .sellchoose .choice.kind-product { grid-column: span 2; }
}
@media (min-width: 960px) {
  .sellchoose { display: grid; grid-template-columns: minmax(0, 720px) minmax(280px, 1fr); column-gap: clamp(40px, 5vw, 72px); align-items: start; }
  .sellchoose > h1, .sellchoose > .sellchoose-lead { grid-column: 1 / -1; }
  .sellchoose .sellneed { margin: 0; }
  .sellchoose p.sellneed { padding-top: var(--s4); }
}

/* ---------- the wizard ---------- */
/* a lot that exists is edited under its own name: the long-title rung, as on the lot page */
.selledit h1, .sellpage.is-edit h1 { font-size: var(--t-long); }
/* «Крок N з M»: the template writes M as text. N is counted from the list of steps itself, so the line follows the script
   without knowing it: a step that is passed or current adds one to «sellstep»; every step adds one to «sellsteps».
   A counter is drawn only in a span that is empty, so a script that writes the number as text takes over by doing so. */
.sellpage { counter-reset: sellstep sellsteps; }
.sellpage .steps li { counter-increment: sellsteps; }
.sellpage .steps li.done, .sellpage .steps li.now { counter-increment: sellsteps sellstep; }
.sellpage .wizhead { display: flex; flex-direction: column-reverse; margin-top: var(--s4); }
.sellpage .steps { margin: 0 0 var(--s4); }
.sellpage .stepcount { margin: 0 0 14px; }
.sellpage .stepcount b { font: 700 1.25rem/1.2 var(--serif); color: var(--red); }
.sellpage .stepcount .at:empty::before { content: counter(sellstep); }
.sellpage .stepcount .of:empty::before { content: counter(sellsteps); }
.sellpage .steps-note { margin: 0 0 var(--s5); max-width: 40em; font-size: 1rem; line-height: 1.4; color: var(--ink-2); }
/* the note about what follows is read once: it leaves when the first step is passed */
.sellpage .wizhead:has(.steps li.done) + .steps-note { display: none; }
.sellpage .note.error { margin: 0 0 var(--s5); }

/* the form lies straight on the linen: cloth fields, no panel around a step */
.sellpage .step { margin: 0; }
.sellpage .step > h2 { margin: 0 0 var(--s2); }
.sellpage .step > p.lead { margin: 0 0 var(--s5); font-size: 1.125rem; line-height: 1.5; }

/* numbers that matter are set in the serif, as a price is */
.sellpage input[type=number], .sellpage input[data-money] { min-height: 60px; font: 700 1.625rem/1 var(--serif); letter-spacing: -.01em; }
.sellpage .step > .field > input[type=number] { max-width: 220px; }
.sellpage input[type=datetime-local] { max-width: 340px; }

/* the measuring ribbon under the length. The block is «hidden» in the markup until a script takes it over:
   the script removes «hidden», sets --cm from the typed number and adds the class «sewn» when the number is above zero */
.sellpage .lenribbon { margin: calc(-1 * var(--s2)) 0 var(--s5); }
@media (min-width: 640px) {
  /* length and weight side by side, the ribbon under both; on a phone it follows the length it draws */
  .sellpage .lenrow > .field:first-child { grid-column: 1; grid-row: 1; }
  .sellpage .lenrow > .field:last-child { grid-column: 2; grid-row: 1; }
  .sellpage .lenrow > .lenribbon { grid-column: 1 / -1; grid-row: 2; }
}
.sellpage .lenribbon .mira { margin: 0 0 var(--s2); }
.sellpage .lenribbon .fill { display: none; }
.sellpage .lenribbon.sewn .fill { display: block; }
.sellpage .lenribbon .help { margin-top: 0; max-width: 34em; }

/* a tag with one sign in it («$») is still a full touch field */
.sellpage .pills span { min-width: 48px; justify-content: center; }

/* structure: three equal tags, each with a drawing of the strand */
.sellpage .pills:has(input[name$="texture"]) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 480px; }
.sellpage .pills input[name$="texture"] + span { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 10px 6px 8px; text-align: center; overflow-wrap: anywhere; }
.sellpage .pills input[name$="texture"] + span::before {
  content: ""; flex: none; width: 26px; height: 34px; background: currentColor;
  -webkit-mask: var(--strand) center / 26px 34px no-repeat; mask: var(--strand) center / 26px 34px no-repeat;
}
.sellpage .pills input[name$="texture"][value="straight"] + span { --strand: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 26 34%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22%3E%3Cpath d=%22M7 2V32M13 2V32M19 2V32%22/%3E%3C/svg%3E"); }
.sellpage .pills input[name$="texture"][value="wavy"] + span { --strand: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 26 34%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22%3E%3Cpath d=%22M7 2c4 5-4 9 0 14s-4 10 0 16M13 2c4 5-4 9 0 14s-4 10 0 16M19 2c4 5-4 9 0 14s-4 10 0 16%22/%3E%3C/svg%3E"); }
.sellpage .pills input[name$="texture"][value="curly"] + span { --strand: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 26 34%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.8%22 stroke-linecap=%22round%22%3E%3Cpath d=%22M7 2c5 2 5 6 0 7s-5 5 0 7 5 6 0 7-5 5 0 8M17 2c5 2 5 6 0 7s-5 5 0 7 5 6 0 7-5 5 0 8%22/%3E%3C/svg%3E"); }

/* several of many: a tag with a square to tick, so it is not taken for one of many */
.sellpage .pills input[type=checkbox] + span::before { content: ""; flex: none; width: 20px; height: 20px; background: var(--cloth); box-shadow: inset 0 0 0 1.5px var(--ink); }
.sellpage .pills input[type=checkbox]:checked + span::before { background: var(--cloth) var(--i-check-ink) center / 14px 12px no-repeat; box-shadow: none; }

/* the photo drop zone carries a plus above its words */
.sellpage .drop::before, .selledit .drop::before, .verifypage .drop::before {
  content: ""; display: block; width: 22px; height: 22px; margin: 0 auto 10px; background: var(--i-plus) center / 22px 22px no-repeat;
}
/* inside a .field the zone would take the weight of a label: its second line stays plain, as in the wizard */
.selledit .drop .muted { font-weight: 400; }
.sellpage .previews, .selledit .previews { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.sellpage .step .tips { margin-top: var(--s5); }

/* back and forward: one height; on the first step there is no way back, so «Далі» takes the row */
.sellpage .wiznav { margin-top: var(--s5); }
.sellpage .wiznav .btn { min-height: 58px; }
.sellpage .wiznav [data-back][style*="hidden"] { display: none; }

/* without the script the whole form is one page: every part gets its number in a rhombus and a stitch above */
html:not(.js) .sellpage .wizhead { display: none; }
html:not(.js) .sellpage form { counter-reset: sellpart; }
html:not(.js) .sellpage .step { counter-increment: sellpart; padding: var(--s5) 0 var(--s2); background: var(--run) top / auto 2px repeat-x; }
html:not(.js) .sellpage .step > h2 { position: relative; display: flex; align-items: center; min-height: 39px; padding-left: 51px; margin-bottom: var(--s3); }
html:not(.js) .sellpage .step > h2::before {
  content: counter(sellpart); position: absolute; left: 0; top: 0; width: 39px; height: 39px; display: grid; place-items: center;
  font: 700 1.0625rem/1 var(--serif); letter-spacing: 0; background: var(--i-num) center / 39px 39px no-repeat;
}
html:not(.js) .sellpage .nojs-submit { margin-top: var(--s4); }

/* beside the form (under it on a phone): what comes after the form, or the photos a lot already has */
.sellpage .sellside { margin-top: var(--s7); }
.sellpage .sellside > h2 { margin: 0 0 var(--s3); font-size: var(--t-panel); }
.sellpage .sellnext { scroll-margin-top: 24px; margin-bottom: 0; }
.sellpage .sellnext .track { margin: var(--s4) 0; }
.sellpage .sellnext .track li { padding-bottom: var(--s4); font-size: 1.1875rem; }
.sellpage .sellnext .track li:last-child { padding-bottom: 0; }
.sellpage .sellnext .track .small { display: block; margin-top: 4px; line-height: 1.4; color: var(--ink-2); }
.sellpage .sellnext .tips { margin-top: var(--s4); padding-top: var(--s4); font-size: 1rem; background: var(--run) top / auto 2px repeat-x; }
/* a photo the lot already has: on its mount, with the way to remove it under the picture */
.sellpage .sellphotos .thumbs { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s3) var(--s2); }
.sellpage .sellphotos .thumbs form { gap: 0; padding: 6px 6px 0; background: var(--cloth); box-shadow: inset 0 0 0 1px var(--line); }
.sellpage .sellphotos .thumbs .link { display: inline-flex; align-items: center; min-height: 44px; }
/* a photograph that waits for a moderator on a lot in bidding (O4): the card is too narrow for the chip, so the mark is
   plain bold words that wrap between them */
.sellpage .sellphotos .thumbs .waitmark { display: block; margin-top: 6px; font-weight: 700; font-size: .9375rem; line-height: 1.25; text-align: center; }
/* after «Видалити» the page comes back to this block (the form's address ends with its anchor), so the seller sees what is left */
.sellpage .sellphotos { scroll-margin-top: var(--s4); }

@media (max-width: 639.98px) {
  .sellpage .wiznav [data-next] { font-size: 1.25rem; }
  .sellpage .wiznav [data-finish] { padding-inline: 12px; }
}
@media (min-width: 960px) {
  .sellpage .steps { margin-bottom: var(--s5); }
  .sellpage .step > h2 { margin-bottom: var(--s3); }
  .sellpage .step > p.lead { font-size: 1.1875rem; }
  /* the photos a lot already has are a short block: they stand beside the form from here, level with the page title */
  .wizard.sellpage:has(.sellphotos) { max-width: none; display: grid; grid-template-columns: minmax(0, 720px) minmax(280px, 1fr); column-gap: clamp(40px, 5vw, 72px); align-items: start; }
  .sellpage .sellphotos { margin-top: 52px; }
  /* in the side column the block is on the first screen already: its anchor must not move the page
     (a scroll margin of a whole window keeps the page at its top) */
  .sellpage .sellphotos { scroll-margin-top: 100vh; }
}
/* «Що буде далі» is a long text: in a column narrower than about 350px it grows taller than the window (971px at 280px),
   so it stays under the form, as on a phone, until the window is 1200px wide */
@media (min-width: 1200px) {
  .wizard.sellpage:has(.sellnext) { max-width: none; display: grid; grid-template-columns: minmax(0, 720px) minmax(280px, 1fr); column-gap: clamp(40px, 5vw, 72px); align-items: start; }
  .sellpage .steps-note { display: none; }
  .sellpage .sellnext { margin-top: 52px; }
}
/* pinned only in a window that holds the whole block (at most 700px tall from 1200px, plus the gap above and below) */
@media (min-width: 1200px) and (min-height: 760px) {
  .sellpage .sellnext { position: sticky; top: 24px; }
}

/* ---------- «Мої лоти» ---------- */
/* a line that only reports where the lot is stays quiet; red and bold are kept for what the seller has to do */
.mylots .next .calm { font-weight: 400; color: var(--ink-2); }
.mylots .mylots-add { margin: var(--s5) 0 0; }
@media (max-width: 639.98px) {
  .mylots .mylots-add .btn { display: flex; width: 100%; }
}

/* ---------- video verification ---------- */
.verifypage .lead-plain { max-width: 38em; }
/* the drawing and its caption: the caption is text of a readable size, not a part of the picture */
.verifypage .setup { grid-template-columns: minmax(0, 1fr); }
.verifypage .setup figure { margin: 0; width: 100%; max-width: 340px; justify-self: center; }
.verifypage .setup svg { width: 100%; max-width: none; height: auto; }
.verifypage .setup svg text { font-family: var(--serif); }
.verifypage .setup figcaption { margin-top: 6px; font-size: 1rem; line-height: 1.35; color: var(--ink-2); text-align: center; }
.verifypage .setup ol li::marker { font-family: var(--serif); font-weight: 700; }
.verifypage .vsteps .tips { margin-top: 0; }
.verifypage .vsteps .tips + p { margin-top: var(--s4); margin-bottom: 0; }
.verifypage .vsteps li > p:last-child { margin-bottom: 0; }
.verifypage .codebox + form { text-align: center; }
.verifypage .drop { margin-bottom: var(--s3); }
.verifypage .progress { margin: 0 0 var(--s3); }
/* the closing line under the upload form keeps clear of its button (F93) */
.verifypage [data-upload] + p { margin-top: var(--s3); }
/* the code ran out: the step is not done any more, the time is told in red and bold, and a new code becomes the action */
.verifypage .vsteps > li.done:has(.codebox.expired)::before { background-image: var(--i-num); color: var(--ink); }
.verifypage .codebox.expired [data-countdown] { color: var(--red); font-weight: 700; }
.verifypage .codebox.expired + form .link {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 58px; margin: 0; padding: 10px 22px;
  background: var(--red); color: var(--cloth); font: 700 1.25rem/1.15 var(--sans); text-align: center; text-decoration: none;
  outline: 1px dashed rgba(248, 244, 234, .6); outline-offset: -5px; transition: background-color .15s;
}
.verifypage .codebox.expired + form .link:hover { background: var(--red-deep); }
.verifypage .codebox.expired + form .link:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }
/* ...and the third step says so: a recording is not accepted with a lapsed code, so the upload rests on pale cloth and the
   sentence of the step without a code is shown above it. An upload that is already on its way is left as it is. */
.verifypage .needcode { display: none; }
.verifypage .vsteps:has(.codebox.expired) .needcode { display: block; }
.verifypage .vsteps:has(.codebox.expired) [data-upload]:not(:has(.progress:not([hidden]))) .drop {
  pointer-events: none; background: var(--panel); outline-color: var(--line); color: var(--ink-2);
}
.verifypage .vsteps:has(.codebox.expired) [data-upload]:not(:has(.progress:not([hidden]))) .drop::before { opacity: .45; }
.verifypage .vsteps:has(.codebox.expired) [data-upload]:not(:has(.progress:not([hidden]))) .btn {
  pointer-events: none; background: var(--line); color: var(--ink-2); box-shadow: none;
}
/* an upload that failed and a code that lapsed, in either order: the script disables the form although its bar still
   tells why the upload failed, so the rules above do not reach it. It rests the same way (the button by the core). */
.verifypage [data-upload]:has(input[type=file]:disabled) .drop {
  pointer-events: none; background: var(--panel); outline-color: var(--line); color: var(--ink-2);
}
.verifypage [data-upload]:has(input[type=file]:disabled) .drop::before { opacity: .45; }

/* a code is running (the page shows only a code that is still valid): on one column the numbered steps come first,
   so the code and its clock are on the first screen; the preparation, done by then, follows them */
@media (max-width: 959.98px) {
  /* «Отримати код» lands on the first step (its form's address ends with #code) */
  .verifypage .vsteps > li:first-child { scroll-margin-top: var(--s2); }
  .verifypage .verifycols:has(.codebox) { display: flex; flex-direction: column; }
  .verifypage .verifycols:has(.codebox) .setup { order: 2; margin-top: var(--s2); }
}

@media (min-width: 960px) {
  /* preparation on the left, the three numbered steps on the right */
  .narrow.verifypage { max-width: none; margin: 0; }
  .verifypage .verifycols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; margin-top: var(--s5); }
  .verifypage .setup { margin: 0; }
  .verifypage .vsteps { margin: 0; }
  .verifypage .vsteps > li:first-child { padding-top: 0; background: none; }
  .verifypage .vsteps > li:first-child::before { top: 0; }
  /* the first step is on the first screen here: its anchor must not move the page (a scroll margin of a whole window keeps it at the top) */
  .verifypage .vsteps > li:first-child { scroll-margin-top: 100vh; }
}
