/* #328 (visual gate ratchet): a <details> summary such as Outbox settings is a 48px tap on phones (RULES 9). */
@media (max-width: 480px) {
  details > summary { min-height: 48px; box-sizing: border-box; padding-top: 12px; padding-bottom: 12px; }
  .pw-foot { gap: 8px; }
  .pw-foot a, .pw-foot .linkbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 48px;
    min-width: 48px;
    padding: 8px 10px;
  }
}
/* Phone chrome for Kingdom, the map, and the bars around them.
   Scoped to narrow screens so desktop layout stays as it was.
   Social screens hide this shell with their own !important rules. */
@media (max-width: 640px) {
  .top { padding: 8px 8px 8px; }
  .top .in {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .top .in > svg { order: 1; flex: none; }
  .top .in > .grow { order: 2; flex: 1 1 calc(100% - 116px); min-width: 0; }
  .top .in > .lang { order: 3; flex: none; }
  .top .in > #phud { order: 5; }
  .top .in > a.topbtn,
  .top .in > .nb-wrap,
  .top .in > .sound-toggle { order: 5; flex: none; }
  .top h1 { font-size: 13px; line-height: 1.15; font-weight: 800; }
  .top .sub {
    display: inline-block;
    max-width: 100%;
    margin-top: 4px;
    padding: 3px 8px;
    border: 2px solid #1a1208;
    border-radius: 999px;
    background: #fff6d8;
    color: #1a1208;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
  }
  .top .topbtn,
  .top .nb-bell,
  .top .nb-wrap,
  .top .sound-toggle {
    box-sizing: border-box;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .top .nb-badge { top: 4px; right: 2px; }
  .lang { overflow: visible; }
  .lang button {
    box-sizing: border-box;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    font-size: 14px;
    font-weight: 800;
  }
  #phud {
    box-sizing: border-box;
    height: 48px;
    min-height: 48px;
    min-width: 48px;
    padding: 0 12px;
    align-items: center;
  }
  #phud small { font-size: 11px; font-weight: 800; }
  #phud b { font-size: 16px; line-height: 1.1; }
  .nav a {
    box-sizing: border-box;
    height: 48px;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 4px 2px 5px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
  }
  .nav a i { font-size: 18px; line-height: 20px; }
  .todayc > .row { flex-wrap: wrap; align-items: center; gap: 8px; }
  .todayc > .row .grow { min-width: 0; }
  .todayc .grow,
  .todayc .small { font-size: 14px; font-weight: 800; line-height: 1.3; color: #1a1208; }
  .todayc .chip { font-size: 12px; font-weight: 800; }
  .mcbadge { min-width: 48px; min-height: 48px; font-size: 13px; font-weight: 800; }
  .mcbadge img { width: 48px; height: 48px; }
  .todaygrid { gap: 8px; }
  .tg { min-height: 64px; padding: 8px 4px; }
  .tg b { font-size: 22px; font-weight: 800; }
  .tg small { font-size: 13px; font-weight: 800; text-align: center; line-height: 1.15; }
  #coach .btn,
  #coach .cc-skip,
  #coach button,
  .gs-card .btn,
  .gs-card button,
  #aqvb .btn {
    box-sizing: border-box;
    min-width: 48px;
    min-height: 48px;
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
  }
  #aqvb {
    position: relative;
    z-index: 28;
    margin: 8px 10px !important;
    max-width: none !important;
    color: #fff6d8;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
  }
  #aqvb > span { flex: 1 1 160px; }
  .lo-zoom button { width: 48px; height: 48px; min-width: 48px; min-height: 48px; }
  .lo-btn, .lo-entry, #app .btn, #app a.btn {
    box-sizing: border-box;
    min-width: 48px;
    min-height: 48px;
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 800;
  }
  #app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  #app select {
    box-sizing: border-box;
    min-height: 48px;
    font-size: 16px;
    font-weight: 800;
  }
  .lo-legend { max-height: calc(100% - 72px); overflow: auto; }
  .lo-legend .btn, .lo-legend summary {
    box-sizing: border-box;
    min-height: 48px;
    display: flex;
    align-items: center;
    font-weight: 800;
  }
  .lo-legend .btn { position: sticky; bottom: 0; width: 100%; justify-content: center; }
  .lu-ov .aqc-go, .aqc .aqc-go { min-height: 48px; min-width: 48px; }
}

/* #329 (visual gate ratchet): list rows such as the notification links are 48px taps on phones (RULES 9). */
@media (max-width: 480px) {
  a.item { min-height: 48px; box-sizing: border-box; }
}
