/**
 * AQLI — STYLES-COMPREHENSIVE v5.5 (Responsive Architecture)
 * Loads AFTER css/app.css and is designed to COMPLEMENT it, never fight it.
 *
 * app.css owns: design tokens, typography, header/nav, Cultural Motion,
 *   cards' refined character, the passport (.pp), splash, view transitions.
 * This file owns: structural safeguards, legacy module classes (EWO markup),
 *   the AQLI Atmosphere System, and (new in v5.5) the responsive architecture.
 *
 * v5.5 change log:
 *  - FIXED the three-round map bug. .cnv-card was being repainted glass by
 *    PART 3's selector `.card:not(.pp):not(.khero):not(.helper)` — specificity
 *    (0,4,0) with !important, which OUTRANKS PART 7's `.cnv-card` (0,1,0)
 *    regardless of source order. .cnv-card is now excluded there, exactly as
 *    .pp and .khero already were. It is an identity surface, not a page card.
 *  - FIXED the tapped-node label. PART 7's blanket halo on `.cnv-card svg text`
 *    was painting a near-white 3px stroke over the active node's cream label.
 *    The active node is now exempt from the halo.
 *  - overflow-x:hidden upgraded to clip where supported, so position:sticky
 *    works (hidden creates a scroll container and silently breaks sticky).
 *  - NEW PART 8: three layouts, one codebase. Phone / Tablet / Desktop / Wide.
 *
 * NOTHING has been redesigned. No colour, type family, or interaction changed.
 */

/* ============================================================
   PART 1 — STRUCTURAL SAFEGUARDS (kept from v7.2.0 base)
   ============================================================ */

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
/* clip guards horizontal overflow WITHOUT creating a scroll container,
   which is what lets position:sticky work further down the page. */
@supports (overflow-x: clip) {
  html, body { overflow-x: clip; }
}

img { max-width: 100%; height: auto; }
svg { max-width: 100%; }

@media print {
  nav { display: none; }
  main { padding-bottom: 0; }
}

/* ============================================================
   PART 2 — LEGACY MODULE CLASSES (EWO markup app.css doesn't cover)
   ============================================================ */

.voice-card {
  width: 100%;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border-radius: 16px;
  text-align: center;
}
.voice-card .emoji { font-size: 2rem; margin: 0.5rem 0; }
.voice-card .description { font-size: 0.85rem; color: var(--sage, #7FA492); margin-bottom: 1rem; }

.five-worlds {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
  margin-bottom: 1rem;
}
@media (min-width: 768px)  { .five-worlds { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .five-worlds { grid-template-columns: repeat(5, 1fr); } }

.world-button {
  width: 100%;
  min-height: 60px;
  padding: 1rem;
  text-align: center;
  border: 2px solid var(--deep, #123B33);
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.world-button .emoji { font-size: 1.6rem; }

.garden-container {
  width: 100%;
  padding: 1rem;
  border-radius: 16px;
  margin-bottom: 1rem;
}
.garden-canvas { width: 100%; height: auto; border-radius: 6px; background: #f0f8f0; }
.garden-info { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
@media (min-width: 768px)  { .garden-info { grid-template-columns: 1fr 1fr 1fr; } }
.garden-stat { text-align: center; padding: 1rem; border-radius: 12px; }

.canvas-wrapper { width: 100%; margin: 1rem 0; }
#drawingCanvas {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  border: 2px solid var(--deep, #123B33);
  border-radius: 12px;
  touch-action: none;
}

.carousel-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
}
.carousel-item { flex: 0 0 100%; min-width: 100%; }

/* Story Garden: titles wrap inside their cards (confirmed fix) + breathing */
#stGardenGrid, .st-garden {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.st-pick {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 150px;
  height: auto;
  padding: 22px 14px;
  overflow: hidden;
}
.st-pick .st-pe { font-size: 2.3em; line-height: 1; }
.st-pick .st-pt {
  position: static;
  display: block;
  width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  text-align: center;
  font-size: .92rem;
  line-height: 1.3;
}
.st-pick .st-badge { position: absolute; top: 8px; right: 8px; }

/* ============================================================
   PART 3 — AQLI ATMOSPHERE SYSTEM v3
   One living canvas · AQLI Glass · Room Rhythms · The Emblem
   ============================================================ */

:root {
  --aqli-glass:        rgba(255, 253, 246, 0.88);   /* ~12% transparency */
  --aqli-glass-soft:   rgba(255, 253, 246, 0.80);
  --aqli-glass-border: rgba(212, 169, 78, 0.40);
  --aqli-glass-shadow: 0 6px 22px rgba(18, 59, 51, 0.10);
  --aqli-reading:      #FFFDF7;
}

/* ---- Layer 1: ONE environment, owned by AQLI itself. ---- */
body {
  background:
    radial-gradient(1100px 560px at 50% -160px, rgba(18, 59, 51, 0.14), transparent 62%),
    radial-gradient(900px 540px at 100% 102%, rgba(212, 169, 78, 0.12), transparent 58%),
    radial-gradient(700px 430px at 0% 55%, rgba(18, 59, 51, 0.06), transparent 60%),
    linear-gradient(180deg, #F6F0E1 0%, #EFE7D3 52%, #E7DEC6 100%) !important;
  background-attachment: fixed;
}

.view, main { background: transparent !important; }

/* ---- Room Rhythms ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transition: background 0.45s ease;
  background: transparent;
}
body[data-room="kids"]::before      { background: radial-gradient(900px 600px at 50% 0%, rgba(242, 184, 160, 0.10), transparent 65%); }
body[data-room="learning"]::before,
body[data-room="lesson1"]::before   { background: radial-gradient(900px 600px at 50% 0%, rgba(127, 164, 146, 0.10), transparent 65%); }
body[data-room="community"]::before { background: radial-gradient(900px 600px at 50% 0%, rgba(233, 200, 127, 0.10), transparent 65%); }
body[data-room="resources"]::before { background: radial-gradient(900px 600px at 50% 0%, rgba(201, 111, 74, 0.08), transparent 65%); }
body[data-room="profile"]::before   { background: radial-gradient(900px 600px at 50% 0%, rgba(233, 200, 127, 0.13), transparent 65%); }

/* ---- Layer 2: AQLI Glass — paper floating over parchment.
        EXPLICIT surfaces only. Deep-green identity surfaces
        (.pp, .khero, .helper, .mt-card, .room.open, and as of v5.5
        .cnv-card — the emblem map) are never listed here. ---- */
.card:not(.pp):not(.khero):not(.helper):not(.cnv-card),
.post,
.kword,
.st-pick,
.kquest,
.answer:not(.correct):not(.wrong),
.sr-i,
.k-continue,
.kn-card,
.pz-e:not(.pz-q),
.voice-card,
.garden-container,
.world-button,
.room:not(.open),
.lp-i,
.gs-chip {
  background: var(--aqli-glass) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: var(--aqli-glass-border) !important;
  box-shadow: var(--aqli-glass-shadow);
}

.garden-stat { background: var(--aqli-glass-soft) !important; }

/* ---- White hunters ---- */
[style*="background: white"], [style*="background:white"],
[style*="background: #fff"],  [style*="background:#fff"],
[style*="background: #FFFFFF"], [style*="background:#FFFFFF"],
[style*="background: #ffffff"], [style*="background:#ffffff"],
[style*="background-color: white"], [style*="background-color:white"],
[style*="background-color: #fff"],  [style*="background-color:#fff"] {
  background: var(--aqli-glass) !important;
}

/* ---- TRUE exceptions — dignity and function keep their own ground ---- */

#pfCard, .pp {
  background: linear-gradient(160deg, var(--deep, #123B33), var(--card, #1A4A40)) !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(233, 200, 127, 0.45) !important;
}

.khero  { background: linear-gradient(160deg, var(--deep, #123B33), var(--card, #1A4A40)) !important; }
.helper { background: var(--deep, #123B33) !important; }
.mt-card:not(.open):not(.done) { background: var(--deep, #123B33) !important; }
.mt-card.done { background: var(--sand, #E9C87F) !important; }
.room.open { background: var(--deep, #123B33) !important; }
.pz-opt { background: var(--deep, #123B33) !important; }

canvas, #drawingCanvas, #kidCanvas {
  background: #FFFFFF !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

header, nav#appNav, .lang-screen, #splash, .modal {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

input.search, textarea.search, select.search, textarea, select {
  background: var(--aqli-reading) !important;
}

.kpanel, .lesson-screen, .lp-detail, .ktabs, .kswatches, .kavatars,
.st-dots, .pz-opts, .pz-seq, .jrow, .gs-row, .dir-filter {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

/* ---- Breathing ---- */
.pagesub { margin-bottom: 22px; }
.kn-card, .st-stage { padding: 24px; }

/* ---- The Emblem lives in the environment ---- */
body::after {
  content: "⏳";
  position: fixed;
  right: 18px;
  bottom: 92px;
  font-size: 44px;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}
.emptyst::before { content: "⏳ "; opacity: 0.55; }

/* ===== END v3 ===== */

/* ============================================================
   PART 4 — v4 VISIBLE PASS (July 23, night build)
   Readability · Connection Map · Tablet Layout
   ============================================================ */

/* ---- 4.1 READABILITY ---- */
.card .sub,
.res .ver,
.post .pmeta,
.voice-card .description,
.lp-s,
.st-badge:not(.new),
.kword .wn {
  color: var(--body, #3A4A45) !important;
  font-weight: 700;
}
.sr-none, .emptyst { color: var(--body, #3A4A45); }

.kwcat, .cnv-sub, .jt, .gs-lbl {
  color: var(--clay, #C96F4A);
}
h2.pagetitle { color: var(--ink, #1A2E29); }

.bigbtn.sand { color: var(--deeper, #0C2B25) !important; }
.chip.grow { color: var(--body, #3A4A45); }

/* ---- 4.2 CONNECTION MAP: pop it out ---- */
.cnv-e { stroke: #A8C4B4; stroke-width: 2.5; }
.cnv-e.hot { stroke: var(--sand, #E9C87F); stroke-width: 4; }
.cnv-n circle { stroke-width: 3; }
.cnv-n .cnv-t { font-size: 13px; }
.cnv-n.sm .cnv-t { font-size: 11px; }
.cnv-v { font-size: 13px; }
.cnv-card { padding: 20px 16px 24px; }
@media (min-width: 768px) {
  .cnv-card { padding: 26px 22px 30px; }
}

/* ---- 4.3 TABLET LAYOUT ---- */
@media (min-width: 768px) {
  main { max-width: 1040px; }

  #view-home.active #homeCards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
    align-items: stretch;
  }
  #view-home.active #homeCards .card { margin-bottom: 0; }

  #view-resources.active #resList { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; align-items: stretch; }
  #view-resources.active #resList .card { margin-bottom: 0; }
}
@media (min-width: 1180px) {
  #view-home.active #homeCards { grid-template-columns: 1fr 1fr 1fr; }
}

/* ===== END v4 ===== */

/* ============================================================
   PART 5 — v5 GLASS ITERATION (founder P0: environment dominates)
   ============================================================ */

:root {
  --aqli-glass:        rgba(253, 250, 240, 0.72);
  --aqli-glass-soft:   rgba(253, 250, 240, 0.60);
  --aqli-glass-border: rgba(212, 169, 78, 0.50);
  --aqli-glass-shadow: 0 12px 36px rgba(18, 59, 51, 0.14),
                       inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* Stronger blur + gentle saturation. .cnv-card excluded — v5.5. */
.card:not(.pp):not(.khero):not(.helper):not(.cnv-card),
.post, .kword, .st-pick, .kquest, .answer:not(.correct):not(.wrong), .sr-i,
.k-continue, .kn-card, .pz-e:not(.pz-q), .voice-card,
.garden-container, .world-button, .room:not(.open),
.lp-i, .gs-chip {
  backdrop-filter: blur(14px) saturate(1.06);
  -webkit-backdrop-filter: blur(14px) saturate(1.06);
}

body {
  background:
    radial-gradient(1100px 560px at 50% -160px, rgba(18, 59, 51, 0.17), transparent 62%),
    radial-gradient(900px 540px at 100% 102%, rgba(212, 169, 78, 0.15), transparent 58%),
    radial-gradient(700px 430px at 0% 55%, rgba(18, 59, 51, 0.08), transparent 60%),
    repeating-linear-gradient(115deg, rgba(18, 59, 51, 0.016) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, #F5EEDD 0%, #EDE4CD 52%, #E4DABF 100%) !important;
  background-attachment: fixed;
}

:root { --dur2: .38s; --dur3: .6s; }

@media (min-width: 768px) {
  #view-home.active #homeCards .card[data-nav]:first-child {
    grid-column: 1 / -1;
    border-top: 3px solid var(--sand, #E9C87F);
    padding-top: 24px;
    padding-bottom: 24px;
  }
}
#view-home.active #homeCards .card[data-nav]:first-child h3 { font-size: 1.35rem; }

/* ============================================================
   PART 6 — v5.3 TITLE CONTRAST
   ============================================================ */
.card:not(.pp):not(.khero):not(.helper) h3,
.card:not(.pp):not(.khero):not(.helper) h4,
#homeCards .card h3,
#resList .card h3,
.post h3 {
  color: var(--deep, #123B33) !important;
  text-shadow: none;
}
.pp h3, .khero h3, .helper h3, .fl-hero .fl-letter { color: var(--sand, #E9C87F) !important; }

/* ============================================================
   PART 7 — v5.4 THE CONNECTION MAP AS EMBLEM
   ============================================================ */
.cnv-card {
  background: linear-gradient(160deg, var(--deep, #123B33), var(--card, #1A4A40)) !important;
  border: 1px solid rgba(233, 200, 127, 0.45) !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.cnv-card h3, .cnv-card .cnv-title { color: var(--sand, #E9C87F) !important; }
.cnv-card .cnv-sub, .cnv-card p { color: rgba(247, 242, 231, 0.75) !important; }

.cnv-card svg circle {
  fill: #FFFDF7;
  stroke: rgba(233, 200, 127, 0.85);
  stroke-width: 2.5;
}
.cnv-card svg line, .cnv-card svg path {
  stroke: rgba(233, 200, 127, 0.38);
  stroke-width: 2;
}
.cnv-card svg .cnv-e.hot, .cnv-card svg .hot {
  stroke: var(--sand, #E9C87F) !important;
  stroke-width: 4;
}
.cnv-card svg text {
  fill: #1A2E29;
  stroke: rgba(255, 253, 246, 0.9);
  stroke-width: 3px;
  paint-order: stroke;
}
.cnv-card svg .cnv-v, .cnv-card svg text.cnv-v {
  fill: var(--sand, #E9C87F);
  stroke: rgba(18, 59, 51, 0.85);
  stroke-width: 2.5px;
  paint-order: stroke;
  font-style: italic;
}

/* v5.5 FIX — the tapped node fills deep green, so its own label must NOT
   carry the parchment halo. app.css already sets the cream fill; this
   removes the stroke that was smearing over it. */
.cnv-card svg .cnv-n.on .cnv-t,
.cnv-card svg .cnv-n.on .cnv-i {
  fill: var(--cream, #F7F2E7) !important;
  stroke: none !important;
  paint-order: normal;
}
/* The active node's circle keeps its deep-green fill against the new ground */
.cnv-card svg .cnv-n.on circle {
  fill: var(--deeper, #0C2B25);
  stroke: var(--sand, #E9C87F);
  stroke-width: 4;
}

/* ===== END v5.4 ===== */

/* ============================================================
   PART 8 — v5.5 RESPONSIVE ARCHITECTURE
   Three layouts, one codebase. Nothing redesigned; only adapted.

     Phone   < 768      header · cards · bottom nav
     Tablet  768–1179   header · wider main · bottom nav
     Desktop 1180–1599  header · LEFT SIDEBAR · main
     Wide    >= 1600    as desktop, four columns, wider container

   Four numbers, used everywhere, never redefined per page.
   ============================================================ */

/* ---- 8.1 CONTAINER: the stage grows in deliberate steps ---- */
@media (min-width: 1180px) { main { max-width: 1120px; } }
@media (min-width: 1600px) { main { max-width: 1480px; } }

/* Landscape notches on phones and tablets */
main {
  padding-left:  max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}

/* ---- 8.2 TYPOGRAPHY: Windows renders thinner than Safari, so large
        screens get roughly +8%. Everything is in rem, so one root value
        scales the entire app. The Aa control keeps working — its two
        classes are scaled in step. ---- */
@media (min-width: 1180px) {
  html          { font-size: 19.5px; }
  html.txt-lg   { font-size: 22.5px; }
  html.txt-xl   { font-size: 26px; }
}
@media (min-width: 1600px) {
  html          { font-size: 20px; }
  html.txt-lg   { font-size: 23px; }
  html.txt-xl   { font-size: 26.5px; }
}

/* ---- 8.3 ADAPTIVE CARD GRIDS (RA items 2, 3, 6)
        One rule for Home, Resources and every directory list. Columns
        fall out of available width — no per-page breakpoints to maintain.
        Supersedes the fixed 1fr/1fr grids in PART 4.3 and PART 5. ---- */
@media (min-width: 768px) {
  #view-home.active #homeCards,
  #view-resources.active #resList,
  #view-businesses.active #dirList,
  #view-organizations.active #dirList,
  #view-events.active #dirList,
  #view-volunteer.active #dirList,
  #gsResults {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    align-items: stretch;
  }
  #view-home.active #homeCards .card,
  #view-resources.active #resList .card,
  #dirList .card,
  #dirList .dir-card {
    margin-bottom: 0;
  }
}
/* The Home hero card still leads the grid, at every width */
@media (min-width: 768px) {
  #view-home.active #homeCards .card[data-nav]:first-child { grid-column: 1 / -1; }
}

/* Learning paths and the Story Garden breathe on bigger canvases */
@media (min-width: 1180px) {
  .lp-grid   { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .st-garden, #stGardenGrid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

/* ---- 8.4 NAVIGATION: bottom bar becomes a left rail on desktop.
        Same <nav id="appNav"> element, same five buttons, same markup.
        Nothing is duplicated and nothing is removed. ---- */
@media (min-width: 1180px) {
  body { padding-left: 224px; }

  nav#appNav {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 224px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 6px;
    padding: 28px 16px calc(env(safe-area-inset-bottom) + 24px);
    z-index: 40;                 /* header stays above it */
    box-shadow: 8px 0 28px rgba(12, 43, 37, 0.22);
    overflow-y: auto;
  }
  nav#appNav button {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 54px;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: .95rem;
    letter-spacing: .01em;
  }
  nav#appNav button svg { width: 22px; height: 22px; flex: none; }
  nav#appNav button.on {
    transform: none;
    background: var(--card, #1A4A40);
  }
  nav#appNav button:hover { background: rgba(247, 242, 231, 0.07); }
  nav#appNav button.on:hover { background: var(--card, #1A4A40); }

  /* The notification cue moves with the label, not the phone layout */
  nav#appNav .cue { top: 50%; right: 16px; transform: translateY(-50%); }

  /* Fixed-position chrome respects the rail */
  #updToast { left: calc(224px + 18px); right: 18px; bottom: 24px; }
  body::after { bottom: 28px; }

  /* Main no longer needs to clear a bottom bar */
  main { padding-bottom: 64px; }
}

/* ---- 8.5 HEADER: desktop has room. Use it. (RA item 4) ---- */
@media (min-width: 1180px) {
  header {
    padding: calc(env(safe-area-inset-top) + 16px) 28px 16px;
    gap: 16px;
  }
  .brand { gap: 14px; }
  .brand .mark { width: 38px; height: 41px; }
  .brand .name { font-size: 1.35rem; letter-spacing: .2em; }
  .brand .ge   { font-size: .95rem; margin-left: 4px; }
  .hbtns { gap: 12px; }
  .hbtn { padding: 11px 18px; }
  #appHeader .ctx { font-size: 1.08rem; }
}

/* ---- 8.6 RESOURCES: the search stays with you (RA item 10) ----
        Works because PART 1 now uses overflow-x:clip, not hidden. ---- */
@media (min-width: 768px) {
  #view-resources.active #resSearch,
  #view-search.active #gsInput {
    position: sticky;
    top: calc(env(safe-area-inset-top) + 74px);
    z-index: 30;
    box-shadow: 0 6px 18px rgba(18, 59, 51, 0.10);
  }
}

/* ---- 8.7 THE CONNECTION MAP SCALES (RA item 9, CSS half) ----
        The SVG viewBox already scales the graph uniformly, which is why
        labels vanish on a phone and balloon on desktop. Stage height and
        label sizes are now set per device. Per-breakpoint node positions
        need canvas.js — flagged separately, not attempted here. ---- */
.cnv-svg { min-height: 0; }

@media (max-width: 560px) {
  .cnv-n .cnv-t   { font-size: 20px; }
  .cnv-n.sm .cnv-t{ font-size: 17px; }
  .cnv-n .cnv-i   { font-size: 24px; }
  .cnv-n.sm .cnv-i{ font-size: 19px; }
  .cnv-v          { font-size: 19px; }
  .cnv-e          { stroke-width: 3.5; }
  .cnv-e.hot      { stroke-width: 5.5; }
}
@media (min-width: 768px) {
  .cnv-card .cnv-svg { min-height: 520px; }
}
@media (min-width: 1180px) {
  .cnv-card .cnv-svg { min-height: 620px; }
  .cnv-n .cnv-t   { font-size: 12px; }
  .cnv-n.sm .cnv-t{ font-size: 10px; }
  .cnv-v          { font-size: 12px; }
}

/* ---- 8.8 KIDS: spacing only. The architecture is not touched. (RA item 8) ---- */
@media (min-width: 768px) {
  .ktabs { gap: 10px; margin-bottom: 22px; }
  .fidel { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 14px; }
  .kwords { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
  .gd-card { padding: 18px 22px; }
}
@media (min-width: 1180px) {
  .fidel { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 16px; }
  .mt-grid { max-width: 480px; }
  .kavatars button { width: 72px; height: 72px; }
}

/* ---- 8.9 POINTER DEVICES: desktop gets hover affordances the phone
        must never inherit. app.css already guards .card:hover. ---- */
@media (hover: hover) and (min-width: 1180px) {
  .room.open, .jcard, .ktab, .lc-btn, .dir-btn, .gs-chip {
    transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  }
  .room.open:hover, .jcard:hover { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .room.open, .jcard, .ktab, .lc-btn, .dir-btn, .gs-chip { transition: none; }
  .room.open:hover, .jcard:hover { transform: none; }
}

/* ---- 8.10 PRINT: the rail disappears with the bar ---- */
@media print {
  nav#appNav { display: none; }
  body { padding-left: 0; }
  main { max-width: 100%; padding: 0; }
}

/* ===== END v5.5 ===== */
