/* Phone and touch layer shared by the three posts. Loaded after each page's own styles.
   Contents on small screens, touch-sized controls, readable wide charts and a full-width play window. */

/* contents: the side column is hidden below 1100px, so the same links sit in a panel under the meta block */
.toc-m { display: none; }
.toc-fab { display: none; }
@media (max-width: 1100px) {
  .toc-m { display: block; max-width: 768px; margin: 0 0 32px; border-top: 1px solid var(--rule-2, #d4d4d4); border-bottom: 1px solid var(--rule-2, #d4d4d4); }
  .toc-m summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; list-style: none; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--ink, #202020); }
  .toc-m summary::-webkit-details-marker { display: none; }
  .toc-m summary::after { content: "+"; font-size: 20px; font-weight: 400; line-height: 1; color: var(--muted, #727272); }
  .toc-m[open] summary::after { content: "\2212"; }
  .toc-m nav { padding-bottom: 6px; }
  .toc-m nav a { display: flex; align-items: center; min-height: 44px; border: 0; border-top: 1px solid var(--rule, #e6e6e6); font-size: 15px; color: var(--ink-2, #4a4a4a); }
  .toc-m nav a:hover { color: var(--blue, #1f4fa8); }
  .toc-fab { display: inline-flex; align-items: center; position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
    min-height: 44px; padding: 0 18px; border: 1px solid var(--ink, #202020); border-radius: 22px; background: #fff; color: var(--ink, #202020);
    font-size: 14px; font-weight: 500; box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
    opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s, transform .2s; }
  .toc-fab.on { opacity: 1; transform: none; pointer-events: auto; }
  .toc-fab:hover { color: var(--ink, #202020); border-bottom-color: var(--ink, #202020); }
}

/* touch: every button at least 44px tall, small links get a larger invisible tap area */
@media (pointer: coarse), (max-width: 640px) {
  button:not(.pf-sq):not(.vbtn):not(.dot) { min-height: 44px; }
  .seg button, .stepper .btn { min-width: 44px; }
  .vbtn { width: 44px; height: 44px; }
  .stepper .dot { position: relative; }
  .stepper .dot::after { content: ""; position: absolute; inset: -16px; }
  .top a, .crumb a, .foot a, .meta dd a, sup a { position: relative; }
  .top a::after, .crumb a::after, .foot a::after, .meta dd a::after { content: ""; position: absolute; inset: -13px -6px; }
  sup a::after { content: ""; position: absolute; inset: -14px -8px; }
}

/* charts drawn at a fixed width keep readable text on a phone and scroll sideways in their own box */
.chartscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.chartscroll:focus-visible { outline: 2px solid var(--blue, #1f4fa8); outline-offset: 4px; }
.swipe-hint { display: none; }
@media (max-width: 700px) {
  .chartscroll > svg { min-width: 680px; }
  .swipe-hint:not([hidden]) { display: block; margin: 0 0 6px; font-size: 13px; color: var(--muted, #727272); }
}

/* the play window runs edge to edge on a phone so the board squares reach about 44px */
@media (max-width: 640px) {
  .playfly { margin-left: -20px; margin-right: -20px; border-left: 0; border-right: 0; border-radius: 0; }
  .pf-grid { padding: 12px; }
  .pf-coord { font-size: 11px; }
}
