/*
 * Make your own coloring page. The site's look: white paper, black line art, pill buttons; colours only through
 * the tokens at the top of style.css. Left: the heading and the form. Right: the sheet the drawing appears on.
 */
.hoppixi-myo__stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); gap: clamp(20px, 4vw, 56px); align-items: start; padding-block: 0 clamp(30px, 4.6vw, 56px); }
.hoppixi-myo .hoppixi-head { padding-bottom: 8px; }
.hoppixi-myo .hoppixi-head h1 { font-size: clamp(34px, 4.6vw, 62px); line-height: 1; }
.hoppixi-myo .hoppixi-tool { max-width: 520px; }
.hoppixi-myo .hoppixi-label { font-size: 15px; }
/* The same field as the search box and the sign-in dialog: a grey pill with no border, and the site's one focus ring. */
.hoppixi-myo .hoppixi-input { min-height: 52px; padding: 0 22px; border: 0; border-radius: 99px; background: var(--hoppixi-color-surface); font-size: 17px; }
.hoppixi-myo .hoppixi-input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--hoppixi-color-danger); }
/* The choice of level looks like the field above it: the browser's own arrow gives way to one drawn in ink. */
.hoppixi-myo select.hoppixi-input { appearance: none; -webkit-appearance: none; padding-right: 48px; background-image: linear-gradient(45deg, transparent 50%, var(--hoppixi-color-ink) 50%), linear-gradient(135deg, var(--hoppixi-color-ink) 50%, transparent 50%); background-position: calc(100% - 27px) 50%, calc(100% - 21px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.hoppixi-myo .hoppixi-form .hoppixi-button { min-height: 50px; margin-top: 20px; padding-inline: 28px; font-size: 17px; }
.hoppixi-myo .hoppixi-tool .hoppixi-error { margin-top: 12px; font-size: 15px; }
.hoppixi-myo__free { margin-top: 18px; font-weight: 600; }
.hoppixi-myo__free + .hoppixi-myo__cost { margin-top: 4px; }
.hoppixi-myo:not([data-state="idle"]) .hoppixi-myo__free { display: none; }
.hoppixi-myo__cost { margin-top: 18px; color: var(--hoppixi-color-body); font-size: 15px; }
.hoppixi-myo__cost a { color: var(--hoppixi-color-ink); font-weight: 500; }
.hoppixi-myo__cost + .hoppixi-fine { margin-top: 10px; max-width: 46em; }
/* After drawing, the page is laid out as a library page (single-hx_sheet.php): the picture on the left, the
   visitor's sentence as the heading, Download, Print and Color online at the sizes used there. The page's own
   heading and the price and rules lines belong to "before drawing" and step aside. */
.hoppixi-myo[data-state="done"] .hoppixi-myo__stage { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); padding-top: 16px; }
.hoppixi-myo[data-state="done"] .hoppixi-myo__paper { order: -1; margin-top: 0; }
.hoppixi-myo[data-state="done"] .hoppixi-head,
.hoppixi-myo:not([data-state="idle"]) .hoppixi-myo__cost,
.hoppixi-myo:not([data-state="idle"]) .hoppixi-myo__cost + .hoppixi-fine { display: none; }
.hoppixi-myo__title { font-size: clamp(32px, 4.2vw, 56px); line-height: 1; overflow-wrap: anywhere; }
.hoppixi-myo__title--long { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.1; }
.hoppixi-myo .hoppixi-myo__actions { margin-top: 22px; font-size: 16px; gap: 12px 18px; }
.hoppixi-myo__actions .hoppixi-download { padding: 14px 24px; }
.hoppixi-myo__recent .hoppixi-grid { margin: 0; }
.hoppixi-myo__recent .hoppixi-sheet img { aspect-ratio: 3 / 4; }
.hoppixi-myo .hoppixi-tool__result > p { margin-top: 14px; }
.hoppixi-myo .hoppixi-tool__result [data-hoppixi-tool-body]:focus { outline: 0; }

/* The sheet: a sheet of paper on the grey desk, the same frame as a single coloring page. */
.hoppixi-myo__paper { margin: clamp(10px, 1.6vw, 22px) 0 0; padding: clamp(14px, 3vw, 34px); border-radius: 14px; background: var(--hoppixi-color-surface); }
.hoppixi-myo__sheet { display: grid; place-items: center; aspect-ratio: 3 / 4; background: var(--hoppixi-color-page); box-shadow: 0 2px 14px var(--hoppixi-color-shadow); }
.hoppixi-myo__sheet img { width: 100%; height: 100%; object-fit: contain; }
.hoppixi-myo__waiting { max-width: 16em; padding: 20px; color: var(--hoppixi-color-muted); text-align: center; }
.hoppixi-myo__paper[data-state="working"] .hoppixi-myo__waiting { color: var(--hoppixi-color-ink); font-weight: 600; }
.hoppixi-myo__paper[data-state="working"] .hoppixi-myo__waiting::before { content: ""; display: block; width: 34px; height: 34px; margin: 0 auto 16px; border: 3px solid var(--hoppixi-color-line); border-top-color: var(--hoppixi-color-ink); border-radius: 50%; animation: hoppixi-myo-turn .9s linear infinite; }
@keyframes hoppixi-myo-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hoppixi-myo__paper[data-state="working"] .hoppixi-myo__waiting::before { animation: none; } }

/* What it is, how it works, questions: the same left edge as the rest of the page. */
.hoppixi-myo .hoppixi-about { width: auto; margin-inline: 0; padding-inline: 0; }
.hoppixi-myo .hoppixi-about .hoppixi-section { padding-block: 28px; }
.hoppixi-myo .hoppixi-about h2 { margin-bottom: 12px; font-size: clamp(24px, 2.6vw, 32px); }
.hoppixi-myo .hoppixi-about .hoppixi-steps { padding-left: 1.25em; list-style: decimal; }
.hoppixi-myo .hoppixi-about .hoppixi-faq__item p { margin-bottom: 16px; }

@media (max-width: 820px) {
    /* One column in reading order: heading, the sheet (once there is something on it), then the form or the
       Download and Print buttons. The left column's children join the grid so the sheet can sit between them. */
    .hoppixi-myo__stage { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .hoppixi-myo__ask { display: contents; }
    .hoppixi-myo .hoppixi-head { order: 1; }
    .hoppixi-myo__paper { order: 2; margin: 4px 0 18px; }
    .hoppixi-myo .hoppixi-tool { order: 3; max-width: none; }
    .hoppixi-myo__free { order: 4; }
    .hoppixi-myo__cost { order: 4; }
    .hoppixi-myo__cost + .hoppixi-fine { order: 5; }
    .hoppixi-myo__paper[data-state="idle"] { display: none; }
    .hoppixi-myo .hoppixi-form [data-hoppixi-tool-submit] { width: 100%; }
    .hoppixi-myo[data-state="done"] .hoppixi-myo__stage { grid-template-columns: minmax(0, 1fr); padding-top: 0; }
    .hoppixi-myo[data-state="done"] .hoppixi-myo__paper { order: 2; margin: 10px 0 18px; }
}

/* Printing this page prints the drawing alone, filling the sheet. */
@media print {
    .hoppixi-myo > :not(.hoppixi-myo__stage), .hoppixi-myo__ask, .hoppixi-toast, .hoppixi-dialog { display: none; }
    .hoppixi-myo, .hoppixi-myo__stage { display: block; padding: 0; }
    .hoppixi-myo__ask { display: none !important; }
    .hoppixi-myo__paper { margin: 0; padding: 0; background: none; }
    .hoppixi-myo__sheet { aspect-ratio: auto; box-shadow: none; }
    .hoppixi-myo__sheet img { width: 100%; height: auto; max-height: 96vh; }
    .hoppixi-myo__waiting { display: none; }
}
