/* Structure and navigation from DESIGN.md; existing content keeps its CSS. */
.section-nav { display:none; }
.section-header { display:flex; align-items:center; justify-content:space-between; gap:var(--sp-4); flex-wrap:wrap; }
.section-header-actions { display:flex; align-items:center; gap:var(--sp-4); }
.section-breadcrumb { font-family:var(--font-sans); font-size:var(--fs-sm); color:var(--mut); }
.section-synced { color:var(--ok); }
.section-page .main { min-width:0; }
.section-page .reveal { opacity:1; transform:none; }
@media(min-width:900px) {
  .app { --sbw:var(--section-menu-width); --sb-w-d:var(--section-menu-width); grid-template-columns:var(--section-menu-width) minmax(0,1fr); }
  .sidebar { background:var(--nav); }
  .sidebar .legacy-phone-nav { display:none; }
  .section-nav { display:flex; flex:1; flex-direction:column; gap:var(--sp-4); }
  .section-nav-title, .section-nav .section-nav-item {
    font-family:"IBM Plex Sans",sans-serif; font-size:var(--section-menu-font);
    line-height:1.5; text-transform:none; letter-spacing:normal;
  }
  .section-nav-title { color:var(--section-ink); font-weight:600; padding:var(--sp-2) var(--sp-3); }
  .section-nav .section-nav-item { display:block; color:var(--section-muted); padding:var(--sp-2) var(--sp-3); border:0; border-radius:var(--r-md); font-weight:400; }
  .section-nav .section-nav-child { padding-left:var(--sp-6); }
  .section-nav .section-nav-item.active { background:var(--surface-3); color:var(--section-ink); font-weight:600; }
  .section-nav-bottom { border-top:1px solid var(--section-line); margin-top:auto; padding-top:var(--sp-4); }
}
/* The approved desktop threshold is 900px, including the legacy 900–1000 band. */
@media(min-width:900px) {
  .sidebar { height:100vh; flex-direction:column; align-items:stretch; padding:var(--sp-4) var(--sp-3); overflow-y:auto; border-bottom:0; border-right:1px solid var(--section-line); }
  .sidebar .sb-spacer { display:none; }
  .sidebar .sb-foot { display:block; }
  .tabbar { display:none; }
}

/* Printed ride/race protocols use the full sheet, without the app frame. */
@media print {
  .section-page .sidebar, .section-page .tabbar, .section-page .section-header,
  .section-page #busy, .section-page #mgProgress { display:none !important; }
  .section-page .app { display:block; }
  .section-page .main { margin:0; padding:0; max-width:none; }
}

.phone-profile, .phone-nav-defs { display:none; }

/* Phone uses the same sections as the sidebar (owner 12.11, variant г).
   Existing menu text, surfaces, spacing and touch targets from DESIGN.md. */
@media(max-width:899px) {
  .td-week.pagenav a { display:inline-flex; align-items:center; gap:var(--sp-1); }
  .section-tabbar { display:grid; grid-template-columns:minmax(44px,1fr) max-content repeat(3,minmax(44px,1fr)); gap:0; }
  .section-tabbar > a, .tabbar .phone-section summary { min-width:44px; min-height:44px; padding:var(--sp-1); gap:var(--sp-1); font-size:13px; font-weight:500; }
  .section-tabbar > a span, .tabbar .phone-section summary span { white-space:nowrap; overflow:visible; text-overflow:clip; }
  .section-tabbar svg.icon { width:22px; height:22px; }
  .tabbar .phone-section { min-width:0; }
  .phone-profile { position:absolute; top:0; right:0; display:flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; color:var(--muted); }
  .phone-profile .icon { width:22px; height:22px; }
  .section-header { position:relative; padding-right:var(--sp-12); }
  .section-header-actions { gap:var(--sp-1); flex-wrap:wrap; }
  .section-breadcrumb { min-width:0; }
  .tabbar .phone-section summary { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:44px; cursor:pointer; font-size:13px; color:var(--muted); list-style:none; }
  .tabbar .phone-section summary::-webkit-details-marker { display:none; }
  .tabbar .phone-section summary.active { color:var(--ink); font-weight:600; }
  .tabbar .phone-section-links { position:absolute; left:0; right:0; bottom:100%; background:var(--nav); border:1px solid var(--line); border-radius:16px 16px 0 0; padding:16px; }
  .tabbar .phone-section-links a { min-height:44px; justify-content:center; align-items:flex-start; font-size:15px; text-align:left; }
}
/* Owner 20.11 p.7: keep date spaces in one inline formatting context.
   The shared details > summary flex rule splits wrap_digits() spans. */
body.section-page .rides-review > summary { display:block; }
