/* ============================================================
   QUANTUM DAWN  -  the entry (check-in) screen

   #qdEntry in index.html, shown and hidden by app.js (showEntry/hideEntry).
   It replaced the old purple login card with the user's "entry" design:
   the sunrise lab behind a dark wash, the headline and three quest tiles
   on the left, the check-in card on the right.

   Rules of the road:
   - Everything is scoped to .qe-entry / qe-* so nothing leaks into the game.
   - It is a fixed layer at --z-modal, above the hub, the sheets and the
     settings drawer. html and body never scroll (gameplay depends on that),
     so the entry is its own scroll box, like the hub.
   - The user's rule for phones: the name, the matric number and Enter Realm
     are all on the FIRST screen without scrolling. So a phone gets a
     compact layout - a shorter headline, a tighter card, and the three
     quest tiles BELOW the form - and a phone held sideways gets two
     columns with the card on the right.
   - Inputs are 16px on touch screens, or iOS zooms the page on focus.
   ============================================================ */

.qe-entry {
  --qe-gold: #f5cf77;
  --qe-text: #f5f2e9;
  --qe-serif: Georgia, "Times New Roman", serif;
  /* Large Text multiplies the small print by this (see the a11y block). */
  --qe-fs: 1;

  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 9999);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  color: var(--qe-text);
  /* On the scroll box itself, so the lab stays put and fills the screen
     while a small phone scrolls the content over it. The design's three
     layers, top to bottom: a fade to ink at the foot, a wash from the left
     that keeps the headline readable, and the lab. */
  background:
    linear-gradient(180deg, rgba(6, 16, 28, .14), rgba(6, 16, 28, 0) 45%, rgba(7, 18, 30, .91)),
    linear-gradient(90deg, rgba(5, 13, 25, .83), rgba(5, 13, 25, .58) 48%, rgba(5, 13, 25, .5)),
    url("assets/brand/lab-sunrise.webp") center / cover no-repeat #081321;
  /* The design's own stack for this screen. */
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.qe-entry[hidden], .qe-entry [hidden] { display: none !important; }
.qe-entry *, .qe-entry *::before, .qe-entry *::after { box-sizing: border-box; }
.qe-entry h1, .qe-entry h2, .qe-entry p, .qe-entry ul, .qe-entry ol { margin: 0; }
.qe-entry button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.qe-entry button:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }

/* ---------- shell ---------- */
.qe-shell {
  max-width: 1510px;
  min-height: 100%;
  margin: 0 auto;
  padding:
    max(28px, env(safe-area-inset-top, 0px))
    max(clamp(24px, 4.8vw, 80px), env(safe-area-inset-right, 0px))
    max(23px, env(safe-area-inset-bottom, 0px))
    max(clamp(24px, 4.8vw, 80px), env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
}

/* ---------- header ---------- */
/* It wraps (Back under the brand) rather than let the two overlap on a
   narrow phone. */
.qe-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; flex: none; }
.qe-brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.qe-logo {
  flex: none;
  width: 74px;
  height: 53px;
  padding: 4px 6px;
  border-radius: 8px;
  background: #ededf1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  display: grid;
  place-items: center;
}
.qe-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.qe-brand-text { min-width: 0; }
.qe-overline { text-transform: uppercase; letter-spacing: .23em; font-size: calc(8px * var(--qe-fs)); color: #dbd4c3; font-weight: 700; }
.qe-wordmark { font: 600 34px/1.2 var(--qe-serif); letter-spacing: -.04em; color: #fff2d2; white-space: nowrap; }
.qe-wordmark span { color: var(--qe-gold); }
.qe-header-note { font-size: calc(11px * var(--qe-fs)); color: #dbd6cd; letter-spacing: .03em; white-space: nowrap; }
.qe-header-note > span { margin-right: 9px; color: var(--qe-gold); }

/* Back to the hub (only when reopened from Player details). Styled like
   the hub's header buttons; it takes the header note's place. */
.qe-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(245, 207, 119, .45);
  border-radius: 28px;
  background: rgba(8, 18, 31, .84);
  color: var(--qe-text);
  font-size: calc(13px * var(--qe-fs)) !important;
  line-height: 1.2;
  white-space: nowrap;
}
.qe-back:hover { background: #243043; border-color: var(--qe-gold); }
.qe-back-arrow { color: var(--qe-gold); font-size: 16px; line-height: 1; }
.qe-back-short { display: none; }
.qe-entry.is-switching .qe-header-note { display: none; }

/* ---------- the two columns ----------
   The quest tiles come after the card in the page (a screen reader reaches
   the form first, and a phone can put them under it), so the left column
   is two grid rows: the headline sitting on the tiles, both beside the
   card. */
.qe-layout {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(370px, .85fr);
  grid-template-rows: auto auto;
  grid-template-areas: "intro card" "quests card";
  column-gap: clamp(35px, 7vw, 105px);
  align-content: center;
  padding: 38px 0 32px;
}
.qe-intro { grid-area: intro; align-self: end; min-width: 0; }
.qe-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--qe-gold);
  font-size: calc(10px * var(--qe-fs));
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.qe-eyebrow > span { flex: none; width: 23px; height: 1px; background: var(--qe-gold); }
.qe-entry .qe-title {
  font: 500 clamp(52px, 5.1vw, 78px)/.99 var(--qe-serif);
  letter-spacing: -.055em;
  margin: 19px 0 20px;
  color: #fff5de;
  text-shadow: 0 3px 30px #03101a;
}
.qe-title em { color: var(--qe-gold); font-weight: 500; }
.qe-intro-copy { color: #d2dce9; font-size: calc(14px * var(--qe-fs)); line-height: 1.75; }

/* ---------- quest tiles ---------- */
.qe-entry .qe-quests {
  grid-area: quests;
  align-self: start;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 500px;
  gap: 10px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
}
.qe-mini {
  --qe-accent: #61e1d5;
  position: relative;
  min-width: 0;
  padding: 5px 8px 12px;
  text-align: center;
  border: 1px solid rgba(144, 186, 195, .18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(16, 39, 57, .4), rgba(7, 20, 33, .9));
}
.qe-mini-operator { --qe-accent: #c49bff; }
.qe-mini-expert { --qe-accent: #f5cf77; }
.qe-mini img { display: block; width: 100%; height: 111px; object-fit: contain; filter: drop-shadow(0 0 12px rgba(195, 153, 56, .13)); }
.qe-mini p { font-size: calc(13px * var(--qe-fs)); font-weight: 600; color: var(--qe-accent); }
.qe-mini p > span { font-size: 9px; margin-right: 5px; opacity: .9; }
.qe-mini small { display: block; font-size: calc(10px * var(--qe-fs)); color: #c3cfdd; }

/* ---------- the check-in card ---------- */
.qe-card {
  grid-area: card;
  align-self: center;
  justify-self: end;
  width: 100%;
  max-width: 465px;
  position: relative;
  border: 1px solid rgba(180, 162, 121, .47);
  border-radius: 22px;
  padding: 30px 34px 26px;
  background: linear-gradient(150deg, rgba(20, 35, 52, .96), rgba(10, 20, 35, .98) 68%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.qe-card::before { content: ""; position: absolute; height: 2px; width: 84px; top: -1px; left: 34px; background: var(--qe-gold); box-shadow: 0 0 18px rgba(245, 207, 119, .31); }
.qe-card-top { display: flex; align-items: center; gap: 13px; margin-bottom: 21px; }
.qe-orb { flex: none; width: 46px; height: 46px; border: 1px solid rgba(245, 207, 119, .27); border-radius: 13px; display: grid; place-items: center; background: rgba(245, 207, 119, .04); }
.qe-orb svg { width: 33px; height: 33px; stroke: var(--qe-gold); fill: none; stroke-width: 1; }
.qe-orb svg circle { fill: var(--qe-gold); }
.qe-card-kicker { font-size: calc(10px * var(--qe-fs)); color: var(--qe-gold); letter-spacing: .13em; font-weight: 700; text-transform: uppercase; line-height: 1.5; }
.qe-card-kicker small { display: block; font-size: calc(10px * var(--qe-fs)); color: #b9c6d6; font-weight: 400; letter-spacing: 0; text-transform: none; }
.qe-entry .qe-form-title { font: 500 38px/1.04 var(--qe-serif); letter-spacing: -.035em; color: #fff1d1; }
/* Focused (tabindex -1) only to start a screen reader at the card when the
   entry is reopened on a touch screen; it is not a control, so no ring. */
.qe-form-title:focus { outline: none; }
.qe-form-copy { font-size: calc(12px * var(--qe-fs)); color: #c2cede; padding: 13px 0 22px; }

.qe-field { margin-bottom: 18px; }
.qe-field label { display: block; margin-bottom: 8px; color: #e5e9f1; font-size: calc(12px * var(--qe-fs)); font-weight: 600; }
.qe-field input {
  display: block;
  width: 100%;
  height: 50px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid #607087;
  background: #0b1625;
  color: #fff8e7;
  font: inherit;
  font-size: 14px;
  padding: 0 14px;
  transition: border-color .15s, box-shadow .15s;
}
.qe-field input::placeholder { color: #9caabe; opacity: 1; }
.qe-field input:hover { border-color: #c1b58c; }
.qe-field input:focus { outline: 2px solid var(--qe-gold); outline-offset: 3px; border-color: var(--qe-gold); }
.qe-field input[aria-invalid="true"] { border-color: #ffa9a4; }
.qe-entry .qe-field-error { margin-top: 8px; font-size: calc(12px * var(--qe-fs)); line-height: 1.4; color: #ffb9b1; }

.qe-submit {
  border: 1px solid #ffe7ac;
  border-radius: 9px;
  min-height: 54px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  margin-top: 25px;
  color: #182235;
  background: linear-gradient(100deg, #f7d78d, #eabc61);
  font-weight: 700 !important;
  font-size: 15px !important;
  text-align: left;
  box-shadow: 0 5px 23px rgba(245, 207, 119, .08), inset 0 1px rgba(255, 255, 255, .4);
  transition: background .15s, box-shadow .15s;
}
.qe-submit-arrow { font-size: 23px; line-height: 1; }
.qe-submit:hover { background: #ffe4a8; box-shadow: 0 6px 26px rgba(245, 207, 119, .15); }
.qe-entry .qe-data-note { font-size: calc(11px * var(--qe-fs)); line-height: 1.6; color: #b6c3d4; text-align: center; text-wrap: balance; margin: 15px auto 0; }

.qe-sr-only {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* A phone or a tablet: 16px text in the boxes, or iOS zooms in on focus. */
@media (pointer: coarse) {
  .qe-field input { font-size: 16px; }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .qe-entry *, .qe-entry *::before, .qe-entry *::after { transition: none !important; animation: none !important; }
}
body.a11y-reduced-motion .qe-entry *,
body.a11y-reduced-motion .qe-entry *::before,
body.a11y-reduced-motion .qe-entry *::after { transition: none !important; animation: none !important; }
body.quality-low .qe-mini img { filter: none; }

/* ---------- accessibility settings ---------- */
/* High contrast: a darker lab, a solid card, brighter small print and
   firmer borders, as on the hub. */
body.a11y-high-contrast .qe-entry {
  background:
    linear-gradient(180deg, rgba(4, 11, 21, .8), rgba(4, 11, 21, .9)),
    url("assets/brand/lab-sunrise.webp") center / cover no-repeat #050b14;
}
body.a11y-high-contrast .qe-card { background: #081323; border-color: var(--qe-gold); }
body.a11y-high-contrast .qe-mini { background: #081323; border-color: #8fa3bb; }
body.a11y-high-contrast .qe-field input { border-color: #b8c6d8; background: #050c16; }
body.a11y-high-contrast .qe-field input::placeholder { color: #c7d2e0; }
body.a11y-high-contrast .qe-intro-copy,
body.a11y-high-contrast .qe-form-copy,
body.a11y-high-contrast .qe-card-kicker small,
body.a11y-high-contrast .qe-data-note,
body.a11y-high-contrast .qe-mini small,
body.a11y-high-contrast .qe-header-note,
body.a11y-high-contrast .qe-overline { color: #ffffff; }
body.a11y-high-contrast .qe-back { background: #050c16; border-color: var(--qe-gold); }
/* Large text: the small print grows; the display type is already big. */
body.a11y-large-text .qe-entry { --qe-fs: 1.2; }

/* ============================================================
   Short desktop (a laptop): the design's own tightening, then a little
   more for 1366x640-class screens.
   ============================================================ */
@media (min-width: 1001px) and (max-height: 800px) {
  .qe-shell { padding-top: max(23px, env(safe-area-inset-top, 0px)); padding-bottom: max(18px, env(safe-area-inset-bottom, 0px)); }
  .qe-layout { padding: 27px 0; }
  .qe-entry .qe-title { font-size: 64px; }
  .qe-card { padding-top: 25px; padding-bottom: 23px; }
  .qe-mini img { height: 92px; }
}
/* 701-724px tall (1280x720): the page ran 2-22px taller than the window,
   mostly bottom padding - on Windows, with its classic scrollbars, a
   scrollbar for nothing. Less air round the columns, same type. */
@media (min-width: 1001px) and (min-height: 701px) and (max-height: 724px) {
  .qe-layout { padding: 15px 0; }
}
@media (min-width: 1001px) and (max-height: 700px) {
  .qe-shell { padding-top: max(16px, env(safe-area-inset-top, 0px)); padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
  .qe-logo { width: 64px; height: 46px; }
  .qe-wordmark { font-size: 30px; }
  .qe-layout { padding: 16px 0; }
  .qe-entry .qe-title { font-size: 54px; margin: 14px 0 14px; }
  .qe-intro-copy { line-height: 1.6; }
  .qe-entry .qe-quests { margin-top: 16px; }
  .qe-mini img { height: 72px; }
  .qe-card { padding: 20px 30px 18px; }
  .qe-card-top { margin-bottom: 14px; }
  .qe-entry .qe-form-title { font-size: 32px; }
  .qe-form-copy { padding: 8px 0 14px; }
  .qe-field { margin-bottom: 12px; }
  .qe-field input { height: 46px; }
  .qe-submit { margin-top: 16px; min-height: 50px; }
  .qe-entry .qe-data-note { margin-top: 10px; }
}

/* ============================================================
   Narrow windows and portrait tablets (<= 1000px): the design's
   narrower two columns.
   ============================================================ */
@media (max-width: 1000px) {
  .qe-layout { column-gap: 32px; grid-template-columns: minmax(0, 1fr) minmax(345px, 1fr); }
  .qe-card { padding: 25px; }
  .qe-card::before { left: 25px; }
  .qe-entry .qe-title { font-size: 53px; }
  .qe-mini img { height: 83px; }
  .qe-mini small { font-size: calc(9px * var(--qe-fs)); }
  .qe-mini p > span { display: none; }
  .qe-header-note { display: none; }
}
/* ...and short (a 960x600 window or tablet): Enter Realm ran 5-30px off
   the first screen, more with Large Text. The laptop tightening above
   starts at 1001px, so it gets its own. */
@media (min-width: 761px) and (max-width: 1000px) and (min-height: 561px) and (max-height: 700px) {
  /* No footer below any more: the card's own bottom padding is enough air,
     and 960x600 then fits without a scrollbar for nothing. */
  .qe-shell { padding-top: max(20px, env(safe-area-inset-top, 0px)); }
  .qe-layout { padding: 12px 0 0; }
  .qe-entry .qe-title { font-size: 46px; margin: 14px 0; }
  .qe-card { padding: 20px 25px 18px; }
  .qe-card-top { margin-bottom: 14px; }
  .qe-form-copy { padding: 8px 0 14px; }
  .qe-field { margin-bottom: 12px; }
  .qe-submit { margin-top: 16px; }
}

/* ============================================================
   Phones held upright (<= 760px wide, unless short and sideways).

   Name, matric number and Enter Realm on the first screen: a one-line
   brand, a two-line headline, the card, and the quest tiles under the
   form. The eyebrow and the intro line return on a tall phone.
   ============================================================ */
@media (max-width: 760px) and (orientation: portrait), (max-width: 760px) and (min-height: 561px) {
  .qe-shell {
    padding:
      max(14px, env(safe-area-inset-top, 0px))
      max(16px, env(safe-area-inset-right, 0px))
      max(16px, env(safe-area-inset-bottom, 0px))
      max(16px, env(safe-area-inset-left, 0px));
  }
  .qe-header { gap: 8px 10px; }
  .qe-brand { gap: 10px; }
  .qe-logo { width: 46px; height: 34px; padding: 3px 4px; border-radius: 7px; }
  .qe-overline { font-size: calc(7px * var(--qe-fs)); letter-spacing: .14em; }
  .qe-wordmark { font-size: 24px; }
  .qe-back { padding: 10px 14px; gap: 7px; }
  .qe-back-long { display: none; }
  .qe-back-short { display: inline; }

  .qe-layout {
    display: flex;
    flex-direction: column;
    /* Centred in what is left under the brand: with the journey-steps
       footer gone, a tall phone otherwise ended in an empty band. The
       layout grows with its content, so a short phone still scrolls. */
    justify-content: center;
    gap: 14px;
    padding: 14px 0 18px;
  }
  .qe-intro, .qe-card, .qe-entry .qe-quests { align-self: stretch; }
  .qe-eyebrow { display: none; }
  .qe-entry .qe-title { font-size: clamp(26px, 7.6vw, 32px); line-height: 1.05; letter-spacing: -.04em; margin: 0; }
  .qe-br-wide { display: none; }
  .qe-intro-copy { display: none; }

  .qe-card { max-width: none; justify-self: stretch; padding: 18px 18px 16px; border-radius: 18px; }
  .qe-card::before { left: 18px; width: 64px; }
  .qe-card-top { gap: 10px; margin-bottom: 10px; }
  .qe-orb { width: 36px; height: 36px; border-radius: 10px; }
  .qe-orb svg { width: 26px; height: 26px; }
  .qe-entry .qe-form-title { font-size: clamp(22px, 6.6vw, 26px); line-height: 1.1; }
  .qe-form-copy { padding: 6px 0 12px; }
  .qe-field { margin-bottom: 12px; }
  .qe-field label { margin-bottom: 6px; }
  .qe-field input { height: 48px; font-size: 16px; }
  .qe-entry .qe-field-error { margin-top: 6px; }
  .qe-submit { margin-top: 16px; min-height: 52px; }
  .qe-entry .qe-data-note { margin-top: 10px; }

  .qe-entry .qe-quests { max-width: none; margin-top: 0; gap: 8px; }
  .qe-mini { padding: 4px 4px 9px; }
  .qe-mini img { height: 64px; }
  .qe-mini p { font-size: calc(12px * var(--qe-fs)); }
}
/* A tall phone (390x844 and up) has room for the eyebrow, the intro line
   and bigger tiles, and still shows Enter Realm on the first screen. */
@media (max-width: 760px) and (min-height: 740px) {
  .qe-shell { padding-top: max(20px, env(safe-area-inset-top, 0px)); }
  .qe-layout { gap: 18px; padding-top: 22px; }
  .qe-eyebrow { display: flex; }
  .qe-entry .qe-title { font-size: clamp(30px, 8.4vw, 36px); margin: 12px 0 10px; }
  .qe-intro-copy { display: block; font-size: calc(13px * var(--qe-fs)); line-height: 1.6; }
  .qe-mini img { height: 84px; }
}
/* Back as an arrow alone (its aria-label still names it) where the brand
   needs the room: a 360px phone, and a small phone held sideways. */
@media (max-width: 360px), (max-height: 560px) and (orientation: landscape) and (max-width: 760px) {
  .qe-entry .qe-back { width: 44px; padding: 10px; justify-content: center; }
  .qe-entry .qe-back-short { display: none; }
}
@media (max-height: 560px) and (orientation: landscape) and (max-width: 700px) {
  .qe-entry .qe-wordmark { font-size: 20px; }
}
@media (max-width: 360px) {
  .qe-shell { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .qe-wordmark { font-size: 22px; }
  .qe-card { padding: 16px 14px 14px; }
  .qe-card::before { left: 14px; }
}

/* ============================================================
   Phones held sideways and other short windows (<= 560px tall): two
   columns - the brand, the headline and the tiles on the left, the card
   on the right, its Enter Realm on the first screen.
   ============================================================ */
@media (max-height: 560px) and (orientation: landscape) {
  .qe-shell {
    display: grid;
    /* min(): a fixed-size track would take its full 380px before the
       headline column got anything, squeezing the brand on a 568px phone. */
    grid-template-columns: minmax(0, 1fr) min(380px, 52%);
    /* Content-sized rows, the whole group centred top to bottom. The
       journey-steps footer used to close off the foot of the screen; without
       it, rows pinned to the top left a dark band under the card. The shell
       is only min-height 100%, so a window too short for it still grows and
       scrolls instead of cutting off the top. */
    grid-template-rows: auto auto auto;
    grid-template-areas: "head card" "intro card" "quests card";
    align-content: center;
    column-gap: clamp(14px, 3vw, 48px);
    padding:
      max(10px, env(safe-area-inset-top, 0px))
      max(16px, env(safe-area-inset-right, 0px))
      max(10px, env(safe-area-inset-bottom, 0px))
      max(16px, env(safe-area-inset-left, 0px));
  }
  .qe-layout { display: contents; }
  .qe-header { grid-area: head; gap: 8px 10px; }
  .qe-brand { gap: 10px; }
  .qe-logo { width: 46px; height: 34px; padding: 3px 4px; border-radius: 7px; }
  .qe-overline { font-size: calc(7px * var(--qe-fs)); letter-spacing: .14em; }
  /* The headline column can get very narrow in a small window held
     sideways (440x375, Android split screen): "Quantum Dawn" goes onto two
     lines there rather than run under the card. */
  .qe-wordmark { font-size: 22px; white-space: normal; line-height: 1.05; }
  .qe-header-note { display: none; }
  .qe-back { padding: 10px 14px; gap: 7px; }
  .qe-back-long { display: none; }
  .qe-back-short { display: inline; }

  .qe-intro { grid-area: intro; align-self: start; padding-top: 14px; }
  .qe-eyebrow { font-size: calc(9px * var(--qe-fs)); }
  .qe-entry .qe-title { font-size: clamp(24px, 4.2vw, 34px); line-height: 1.04; letter-spacing: -.045em; margin: 8px 0 6px; }
  .qe-title .qe-br-wide { display: none; }
  .qe-intro-copy { font-size: calc(12px * var(--qe-fs)); line-height: 1.5; }

  .qe-entry .qe-quests { max-width: 440px; margin-top: 12px; gap: 8px; }
  .qe-mini { padding: 3px 4px 7px; }
  .qe-mini img { height: 52px; }
  .qe-mini p { font-size: calc(12px * var(--qe-fs)); }
  .qe-mini p > span { display: none; }

  .qe-card { grid-area: card; align-self: start; justify-self: stretch; max-width: none; padding: 14px 18px 12px; border-radius: 16px; }
  .qe-card::before { left: 18px; width: 64px; }
  .qe-card-top { display: none; }
  .qe-entry .qe-form-title { font-size: 22px; line-height: 1.1; }
  .qe-form-title .qe-br-wide { display: none; }
  .qe-form-copy { padding: 2px 0 8px; }
  .qe-field { margin-bottom: 8px; }
  .qe-field label { margin-bottom: 4px; }
  .qe-field input { height: 44px; font-size: 16px; }
  .qe-entry .qe-field-error { margin-top: 4px; }
  .qe-submit { margin-top: 10px; min-height: 48px; padding-block: 10px; }
  .qe-entry .qe-data-note { margin-top: 6px; }
}
/* A phone this short (667x375 and below) drops the eyebrow and the card's
   intro line so the headline and tiles fit beside the card. */
@media (max-height: 400px) and (orientation: landscape) {
  .qe-eyebrow { display: none; }
  .qe-intro { padding-top: 10px; }
  .qe-entry .qe-title { margin-top: 0; }
  .qe-form-copy { display: none; }
  .qe-entry .qe-form-title { margin-bottom: 8px; }
}
/* A small phone held sideways: the tiles' captions would wrap, and below
   about 640px wide the tiles themselves have no room beside the card. */
@media (max-height: 560px) and (orientation: landscape) and (max-width: 720px) {
  .qe-mini small { display: none; }
}
@media (max-height: 560px) and (orientation: landscape) and (max-width: 640px) {
  .qe-entry .qe-quests { display: none; }
}
