/* Phone access and installed-app navigation; shared content remains the source. */
.mobile-home { max-width: 960px; margin: auto; padding: 40px 24px 64px; }
.mobile-home section { padding: 28px 0; }
.mobile-home > section:first-child { min-height: 0; padding-top: 24px; }
.mobile-home h1 { max-width: 15ch; }
.mobile-home h2 { margin-bottom: 18px; }
.mobile-home .lede { margin-top: 20px; }
.mobile-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.mobile-card { display: flex; flex-direction: column; gap: 10px; border: 1px solid #666; border-radius: 14px; padding: 22px; text-decoration: none; min-height: 140px; }
.mobile-card:hover, .mobile-card:focus-visible { background: #161616; border-color: #fff; }
.mobile-card span { color: #ccc; }
.mobile-home details { border: 1px solid #666; border-radius: 12px; padding: 18px; }
.mobile-home summary { cursor: pointer; min-height: 44px; font-weight: 600; }
.mobile-finder { text-align: left; }
.mobile-finder label { display: block; font-weight: 600; margin: 12px 0; }
.mobile-finder input { width: 100%; min-height: 48px; background: #000; color: #fff; border: 1px solid #888; border-radius: 8px; padding: 12px; font: inherit; }
.mobile-finder button { min-height: 44px; margin: 8px 8px 0 0; padding: 8px 12px; border: 1px solid #888; border-radius: 8px; background: #000; color: #fff; font: inherit; cursor: pointer; }
.mobile-finder button:hover { background: #222; }
.mobile-finder ol { padding-left: 24px; }
.mobile-finder li { padding: 16px 0; border-bottom: 1px solid #666; }
.mobile-finder li > a { display: block; padding: 8px 0; font-weight: 600; }
.mobile-finder li p { color: #ccc; font-size: .95rem; margin: 8px 0; }
.mobile-home li { margin-bottom: 12px; }
.mobile-home [data-connection] { border: 1px solid #fff; padding: 14px; }
.mobile-home [data-install] { background: #fff; color: #000; border: 1px solid #fff; border-radius: 8px; padding: 14px 20px; font: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.mobile-tabs { position: fixed; z-index: 50; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: #000; border-top: 1px solid #666; }
.mobile-tabs a { display: grid; place-items: center; min-height: 48px; padding: 6px; text-align: center; text-decoration: none; color: #ccc; font-size: .9rem; overflow-wrap: anywhere; }
.mobile-tabs a[aria-current] { color: #fff; text-decoration: underline; text-underline-offset: 6px; }
.mobile-installed { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
.mobile-installed .help-btn { bottom: calc(90px + env(safe-area-inset-bottom)); }
.mobile-installed .help-panel { bottom: calc(154px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 180px); }
.mobile-installed .help-greet { display: none; }
:is(.mobile-home,.mobile-tabs) :is(a,button,summary):focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.mobile-skip { position: absolute; left: 12px; top: -100px; z-index: 100; background: #fff; color: #000; padding: 12px; }
.mobile-skip:focus { top: 12px; }
#tt-evidence-output pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; padding: 16px; border: 1px solid #666; text-align: left; }
#tt-evidence-output p { overflow-wrap: anywhere; }
@media(max-width:600px) {
  body { overflow-wrap: anywhere; }
  .sw-list, .sw, .sw > * { min-width: 0; }
  .sw { grid-template-columns: minmax(0,1fr); }
  .sw-word { overflow-wrap: anywhere; }
  .btn { max-width: 100%; white-space: normal; flex-wrap: wrap; }
  input[type=file] { max-width: 100%; min-width: 0; }
  .lesson-table { table-layout: fixed; overflow-wrap: anywhere; }
  .top { flex-wrap: wrap; gap: 12px; }
  .page th { overflow-wrap: anywhere; }
  .grid { grid-template-columns: minmax(0,1fr) !important; }
  .grid > *, .card { min-width: 0; overflow-wrap: anywhere; }
  .mobile-grid { grid-template-columns: 1fr; }
  .mobile-home { padding: 24px 20px 40px; }
  .mobile-home h1 { font-size: clamp(2rem,9vw,3rem); }
  .nav-links { flex-wrap: wrap; }
  .nav-links a { min-height: 44px; display: inline-flex; align-items: center; }
  input,select,textarea { font-size: max(16px,1em); }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } }
@media print { .mobile-tabs,.mobile-skip,[data-install],#install,[data-install-status] { display:none !important; } .mobile-installed { padding-bottom:0; } }

[data-pdf-planner] { display: grid; gap: .75rem; }
[data-pdf-planner] textarea { width: 100%; min-height: 5rem; box-sizing: border-box; font: inherit; }
@media print {
  body.mobile-print-planner { background: white !important; color: black !important; }
  .mobile-print-planner body, .mobile-print-planner main { margin: 0; padding: 0; }
  .mobile-print-planner header, .mobile-print-planner footer, .mobile-print-planner .mobile-tabs,
  .mobile-print-planner main > :not([data-planner]), .mobile-print-planner [data-pdf-planner],
  .mobile-print-planner [data-planner] > p:first-of-type { display: none !important; }
  .mobile-print-planner [data-planner] { border: 0; background: white !important; color: black !important; }
  .mobile-print-planner [data-pdf-output] p { white-space: pre-wrap; overflow-wrap: anywhere; }
  .mobile-print-planner [data-pdf-output] h3 { break-after: avoid; }
}

[data-print-hint] { display:none; }
@media print { body:not(.mobile-print-planner) [data-print-hint] { display:block; font-weight:bold; } }
