/* The Grid queue page (plan 2026-11-24-001, U5). Its own file, on the shared tokens of style.css; no colour of its own except white. Desktop: the headline top left, the ranked list on the right,
   the filter bar along the bottom, the map between. A phone (900px and under): the map first, the headline a one-line strip, the list and the cards bottom sheets. */
body.gq-page { display: flex; flex-direction: column; height: 100vh; height: 100dvh; margin: 0; }
.gq-main { position: relative; flex: 1 1 auto; min-height: 420px; outline: none; }
.gq-map { position: absolute; inset: 0; background: var(--bg-paper-2); }
.gq-map .maplibregl-canvas { outline: none; }

.gq-card { position: absolute; z-index: 5; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px; box-shadow: 0 4px 18px rgba(38, 26, 20, 0.18); padding: 14px 16px; color: var(--text-primary); font-family: var(--font-sans); }
.gq-card[hidden] { display: none; }
.gq-card h2 { margin: 0 0 6px; font: 700 1.05rem var(--font-serif); }
.gq-card h2:focus { outline: none; }
.gq-card p { margin: 6px 0; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.4; }
.gq-sub { font-size: 0.76rem; color: var(--text-caption); }
.gq-note { font-size: 0.76rem; color: var(--text-caption); }
.gq-sub-h { margin: 12px 0 4px; font: 700 0.76rem var(--font-sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-caption); }

/* ---- headline ---- */
.gq-head { top: 12px; left: 12px; width: min(360px, calc(100% - 24px)); }
.gq-kicker { margin: 0 0 4px; font: 700 0.7rem var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-caption); }
.gq-big { margin: 0; line-height: 1; }
.gq-num { font: 700 3.2rem var(--font-serif); color: var(--text-primary); }
.gq-unit { font: 600 1.1rem var(--font-sans); color: var(--text-secondary); }
.gq-head-body[hidden] { display: none; }

/* ---- the ranked list ---- */
.gq-list { top: 12px; right: 12px; bottom: 150px; width: 330px; overflow: auto; }
.gq-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.gq-list .pd-search { width: 100%; margin: 6px 0; }
.gq-readout { margin: 4px 0 6px; font-size: 0.76rem; color: var(--text-caption); }
.gq-rows { list-style: none; margin: 0; padding: 0; }
.gq-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; width: 100%; min-height: 40px; padding: 8px 4px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--card-border);
  color: var(--text-primary); font: 0.86rem var(--font-sans); cursor: pointer; }
.gq-row:hover { background: var(--bg-paper); }
.gq-row-name { flex: 1 1 0; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.gq-row-mw { margin-left: auto; font-weight: 600; }
.gq-row-meta { flex: 0 0 100%; font-size: 0.74rem; color: var(--text-caption); }
.gq-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; }
.gq-list-close { display: none; }

/* ---- the entries card, the entry card and the about card ---- */
.gq-pick { right: 354px; bottom: 104px; width: min(380px, calc(100% - 24px)); max-height: calc(100% - 130px); overflow: auto; z-index: 7; }
.gq-about { right: 354px; top: 12px; width: min(420px, calc(100% - 24px)); max-height: calc(100% - 130px); overflow: auto; z-index: 7; }
.gq-pick .pm-btn, .gq-pick .pd-back, .gq-about .pd-back { min-height: 28px; }
.gq-entries .gq-row { padding: 6px 4px; }

/* ---- the filter bar and the key ---- */
.gq-bar { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; background: var(--card-bg);
  border: 1px solid var(--card-border); border-radius: 14px; box-shadow: 0 4px 18px rgba(38, 26, 20, 0.18); }
.gq-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gq-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 10px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 980px;
  color: var(--text-secondary); font: 600 0.75rem var(--font-sans); cursor: pointer; }
.gq-chip[aria-pressed="true"] { background: var(--accent-terracotta); border-color: var(--accent-terracotta); color: #fff; }
.gq-chip[aria-pressed="true"] .gq-dot { box-shadow: 0 0 0 2px #fff; }
.gq-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-left: auto; font-size: 0.72rem; color: var(--text-caption); }
.gq-key-item { display: inline-flex; align-items: center; gap: 6px; }
.gq-key-circle { display: inline-block; flex: none; border-radius: 50%; background: var(--bg-paper-2); border: 1px solid var(--text-caption); }
.gq-key-circle.is-plant { border: 2.5px solid var(--text-primary); }

/* ---- keyboard focus: a visible ring, never removed ---- */
.gq-row:focus-visible, .gq-chip:focus-visible, .gq-toggle:focus-visible, .gq-card .pd-back:focus-visible, .gq-card .pm-btn:focus-visible { outline: 2px solid var(--accent-terracotta-text); outline-offset: 2px; }

/* ---- the map's own controls sit above the bar ---- */
.gq-main .maplibregl-ctrl-bottom-left { bottom: 100px; }
.gq-main .maplibregl-ctrl-bottom-right { bottom: 100px; }
.gq-main .pm-basemaps { left: 56px; right: auto; bottom: 104px; align-items: flex-start; }

.gq-toggle { display: none; }

@media (max-width: 900px) {
  .gq-phone .gq-head { top: 8px; left: 8px; right: 8px; width: auto; padding: 6px 12px; }
  .gq-phone .gq-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 32px; padding: 0; background: none; border: 0; color: var(--text-primary); font: 0.86rem var(--font-sans); text-align: left; cursor: pointer; }
  .gq-phone .gq-head .gq-toggle::after { content: "More"; font-size: 0.74rem; font-weight: 700; color: var(--accent-terracotta-text); }
  .gq-phone .gq-head .gq-toggle[aria-expanded="true"]::after { content: "Less"; }
  .gq-phone .gq-head-body { padding-top: 6px; border-top: 1px solid var(--card-border); margin-top: 4px; }
  .gq-phone .gq-num { font-size: 2.4rem; }

  .gq-phone .gq-bar { left: 8px; right: 8px; bottom: 8px; padding: 6px 8px; gap: 6px 8px; }
  .gq-phone .gq-bar .gq-chips { flex-wrap: nowrap; overflow-x: auto; flex: 1 0 100%; scrollbar-width: none; }
  .gq-phone .gq-bar .gq-chips::-webkit-scrollbar { display: none; }
  .gq-phone .gq-list-toggle { order: 0; }
  .gq-phone #gq-reset { order: 1; margin-left: auto; }
  .gq-phone #gq-techs { order: 2; }
  .gq-phone #gq-statuses { order: 3; }
  .gq-phone .gq-chip { flex: none; }
  .gq-phone .gq-list-toggle { width: auto; padding: 3px 12px; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 980px; font-weight: 600; font-size: 0.78rem; min-height: 32px; }
  .gq-phone .gq-key { display: none; }

  .gq-phone .gq-list { display: none; top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 60%; border-radius: 14px 14px 0 0; z-index: 8; }
  .gq-phone .gq-list.is-open { display: block; }
  .gq-phone .gq-list-close { display: inline-block; }
  .gq-phone .gq-pick, .gq-phone .gq-about { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62%; border-radius: 14px 14px 0 0; z-index: 9; }

  .gq-phone .maplibregl-ctrl-bottom-left, .gq-phone .maplibregl-ctrl-bottom-right { bottom: 124px; }
  .gq-phone .pm-basemaps { left: auto; right: 8px; bottom: 168px; align-items: flex-end; }
}
