/* The store's shared interface parts (D540..D544, "the Back store design system v1"): the question box, the message slot, the skeleton, the skip link and the focus ring.
   Loaded on every page after store.css; the colours are the tokens. */

/* The focus ring is --fill (#00658C, 6.4:1 on white); --accent is 2.97:1 and fails the 3:1 the WCAG asks of a focus indicator. */
:focus-visible { outline: 3px solid var(--fill); outline-offset: 2px; }
.formats input:focus-visible + span { outline-color: var(--fill); }
.chips-picker:focus-within { outline-color: var(--fill); }

.skip-link { position: absolute; left: .5rem; top: -4rem; z-index: 100; padding: .6rem 1rem; background: var(--fill); color: var(--fill-ink); border-radius: 0 0 6px 6px; text-decoration: none; font-weight: 500; }
.skip-link:focus { top: 0; }

button.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 500; }

/* The question box: store.ask (ask-dialog.js). */
dialog.ask { width: min(32rem, calc(100vw - 2rem)); max-width: none; padding: 1.25rem 1.4rem; }
dialog.ask.ask-danger { border-top: 4px solid var(--bad); }
.ask-title { margin: 0 0 .6rem; }
.ask-body p { margin: 0 0 .6rem; color: var(--ink-2); overflow-wrap: anywhere; }
.ask-field { margin: .9rem 0 0; }
.ask-input, .ask-typed { display: block; width: 100%; margin-top: .25rem; padding: .55rem .65rem; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--control); border-radius: 6px; }
textarea.ask-input { min-height: 5rem; resize: vertical; }
.ask-problem { margin: .5rem 0 0; color: var(--bad); }
.ask-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; margin-top: 1.1rem; }
.ask-buttons button { min-height: 2.5rem; }

/* The message slot (slot.js): a message sits under the control that caused it, in space that is already reserved, so nothing under it moves. */
.slot { flex: 0 0 100%; min-height: 1.5rem; margin: .35rem 0 0; font-size: .95rem; overflow-wrap: anywhere; }
.slot > span { display: block; }
.slot .slot-why { color: var(--muted); }
.slot.slot-bad { color: var(--bad); }
.slot.slot-good { color: var(--good); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The skeleton: grey bars where text will be, while the data comes (skeleton.js, and the shell's own markup). */
.skeleton { display: block; height: 1rem; margin: .5rem 0; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--rule) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: skeleton-move 1.4s linear infinite; }
.skeleton.wide { width: 60%; } .skeleton.narrow { width: 35%; } .skeleton.tall { height: 2.2rem; }
@keyframes skeleton-move { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* THE CUSTOMER PAGES (D546, D548). The rule: at a viewport of 375 px nothing is wider than the screen (a control, `tests/test_no_customer_page_is_wider_than_a_phone.py`, draws each page at 375 px in eight languages). A flex
   child may shrink (`min-width: 0`), a row wraps, a long word breaks, and a table becomes a list. Every control a finger may press is at least 44 px high. The Back store (`body.staff`) has its own sheets. */
body:not(.staff) main, body:not(.staff) .card, body:not(.staff) form, body:not(.staff) label { min-width: 0; }
body:not(.staff) .card, body:not(.staff) .release, body:not(.staff) .muted { overflow-wrap: anywhere; }
body:not(.staff) input, body:not(.staff) select, body:not(.staff) textarea { max-width: 100%; }
body:not(.staff) .row { flex-wrap: wrap; }
body:not(.staff) .row > * { min-width: 0; }
.uid label { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }          /* the Computer ID box fills the row, and its button and notes wrap below it */
.uid input { flex: 1 1 100%; width: 100%; min-width: min(100%, calc(40ch + 1.5rem)); }          /* all 39 characters of a Computer ID show */
.uid { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: flex-end; }
.uid > p, .uid > details { flex: 0 0 100%; }
body:not(.staff) .money { flex-wrap: wrap; }
body:not(.staff) .money input { min-width: 5rem; }
body:not(.staff) .queue-list .row > button, body:not(.staff) .queue-list .row > label { flex: 0 0 auto; }
body:not(.staff) .actions > * { max-width: 100%; }
body:not(.staff) video, body:not(.staff) img, body:not(.staff) svg { max-width: 100%; }
.hash, .secret { overflow-wrap: anywhere; word-break: break-all; }

body:not(.staff) :is(button, .button, select, input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden])) { min-height: 44px; }
body:not(.staff) #nav a { display: inline-flex; align-items: center; min-height: 44px; }
body:not(.staff) #nav .signout { margin-left: .5rem; }
.nav-toggle { display: none; }
@media (max-width: 40rem) {
  body:not(.staff) .top { flex-wrap: wrap; }
  .nav-toggle:not([hidden]) { display: inline-flex; align-items: center; order: 2; }
  body:not(.staff) #nav { display: none; flex: 0 0 100%; flex-direction: column; align-items: stretch; gap: 0; order: 3; border-top: 1px solid var(--rule); }
  body:not(.staff) #nav.open { display: flex; }
  body:not(.staff) #nav a { padding: 0 .25rem; border-bottom: 1px solid var(--rule); }
  body:not(.staff) #nav .signout { margin: .5rem 0 0; }
  /* the language menu on a phone: the select alone (its label stays for a screen reader), on the brand's line beside the Menu button, not a row of its own */
  body:not(.staff) .top { gap: .25rem .6rem; }
  body:not(.staff) .top .language { order: 1; margin-left: auto; }
  body:not(.staff) .top .language .lang-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #sign-ins .txn, #sign-ins .txn tbody, #sign-ins .txn tr, #sign-ins .txn td { display: block; width: 100%; }
  #sign-ins .txn thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #sign-ins .txn tr { padding: .5rem 0; border-bottom: 1px solid var(--rule); }
  #sign-ins .txn td { display: flex; gap: .75rem; justify-content: space-between; padding: .15rem 0; border: 0; text-align: right; white-space: normal; }
  #sign-ins .txn td::before { content: attr(data-label); flex: none; color: var(--ink-2); text-align: left; }
}
.noscript { margin: 0; text-align: center; }
/* One footer on every customer page (D548): the sign-in page's was centred under its card, the others sit at the left edge of the content. */
.foot.sign-in-foot { max-width: 74rem; margin: 2rem auto 1rem; justify-content: flex-start; }
.sign-in-foot .copyright { text-align: left; }

/* The shop's quieter list (D549), and the one Add an instrument card (D547). */
.filters-box { margin: 0 0 .5rem; }
.filters-box > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--ink-2); }
.which { margin: 0 0 .75rem; }
.calbody .part { margin: 0 0 .4rem; }
fieldset.way { border: 0; margin: 0 0 .75rem; padding: 0; }
fieldset.way label.check { margin: 0 0 .25rem; min-height: 44px; }
.add-instrument .choice-body[hidden] { display: none; }

/* A tick box or a round button is at least 24 px (WCAG 2.5.8), and its whole label is the thing to press (D1240). */
body:not(.staff) input[type=radio], body:not(.staff) input[type=checkbox] { width: 1.5rem; height: 1.5rem; flex: none; }
body:not(.staff) label:has(> input[type=radio]), body:not(.staff) label:has(> input[type=checkbox]) { cursor: pointer; min-height: 1.5rem; }

/* Phones: the licences come before the steps that explain them (D1240). */
@media (max-width: 40rem) {
  #licences:not([hidden]) { display: flex; flex-direction: column; }
  #licences > #seat-steps, #licences > #manual { order: 2; }
  #licences > #awaiting, #licences > #pending, #licences > #none-seats { order: 1; }
}

/* Help and contact: a question opens to its answer, and the whole line is the thing to press (D1240). */
.faq summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 500; }
.faq p { margin: 0 0 .75rem; }
