.consent-panel{position:fixed;bottom:42px;left:14px;z-index:2147483000;max-width:430px;max-height:70vh;overflow:auto;background:#fff7e6;color:#252921;border:2px solid #252921;box-shadow:4px 4px 0 #252921;padding:18px;font:14px/1.6 system-ui,sans-serif;box-sizing:border-box}.consent-panel p{margin:0 0 14px}.consent-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.consent-actions button{font:700 13px/1.5 system-ui,sans-serif;border:1px solid #252921;padding:9px 12px;background:#fff7e6;color:#252921;cursor:pointer}.consent-actions button:first-child{background:#c83428;color:white}.consent-panel a{color:#252921;text-decoration:underline}.consent-panel[hidden]{display:none!important}.tracking-settings{position:fixed;bottom:max(8px,env(safe-area-inset-bottom));left:8px;z-index:2147482000;border:1px solid #d5c190;background:#241d19dd;color:#fff7e6;font:11px/1.3 system-ui,sans-serif;padding:5px 8px;cursor:pointer}.consent-actions button:focus-visible,.tracking-settings:focus-visible{outline:3px solid #168594;outline-offset:2px}@media(max-width:500px){.consent-panel{left:10px;right:10px;bottom:45px;max-width:none;font-size:12px;padding:14px}}

/* PHONE, UPRIGHT and SIDEWAYS match ui-mobile.mjs; the desktop rules above stay intact.
   HUD offsets use its design pixels and --m, but text and touch targets are not scaled. */
@media (max-width: 760px), (max-height: 520px) {
  .consent-panel {
    bottom: auto;
    max-width: none;
    max-height: none;
    height: 94px;
    padding: 6px;
    box-shadow: none;
    font: 12px/14px system-ui, sans-serif;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 4px;
  }
  .consent-panel p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
  .consent-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    align-items: stretch;
  }
  .consent-actions button, .consent-actions a {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 32px;
    padding: 3px 2px;
    font: 700 11px/13px system-ui, sans-serif;
    text-align: center;
    overflow-wrap: anywhere;
  }
  .tracking-settings { display: none; }
}

@media (max-width: 760px) and (min-height: 520.02px), (max-width: 559.98px) {
  /* Below the quests (at most 328 design pixels in the consent sample). */
  .consent-panel {
    left: calc(6px * var(--m) + var(--safe-l));
    right: calc(6px * var(--m) + var(--safe-r));
    top: calc(332px * var(--m) + var(--safe-t));
  }
}

@media (min-width: 350px) and (max-width: 389.98px) and (max-height: 599.98px) {
  /* The short upright sample has only 58.6px between quests and event.
     Four 12px text lines beside three 48px-tall choices fit in 56px. */
  .consent-panel {
    top: calc(329px * var(--m) + var(--safe-t));
    height: 56px;
    padding: 2px 4px;
    grid-template-columns: minmax(0, 1fr) 126px;
    grid-template-rows: minmax(0, 1fr);
    gap: 6px;
    font: 11px/12px system-ui, sans-serif;
  }
}

@media (max-height: 520px) and (min-width: 560px) {
  /* Status/quests end at x406; the event begins 286 design pixels from the right. The switch row under the status ends
     near 120 real pixels (its button) plus 245 design ones (the longest safe line): clear it too, but stay at least
     144px wide - at 568x320 there is no room, and the panel covers the end of that line, never the switch. */
  .consent-panel {
    left: calc(min(max(414px * var(--m), 120px + 253px * var(--m)), 100vw - var(--safe-l) - var(--safe-r) - 292px * var(--m) - 144px) + var(--safe-l));
    right: calc(292px * var(--m) + var(--safe-r));
    top: calc(6px * var(--m) + var(--safe-t));
    height: 128px;
  }
}

@media (max-height: 520px) and (min-width: 560px) and (max-width: 693.98px) {
  /* The two narrow landscape samples need more text rows; still above the chat. */
  .consent-panel { height: 200px; }
}
