/* Phase 1: scan-first site detail + sectioned site editor. */
@media (max-width: 760px) {
  .site-detail-title-row {
    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:8px !important;
  }
  .site-detail-title-row > div:first-child { min-width:0; }
  .site-detail-title-row > div:first-child p { margin-bottom:2px !important; }
  .site-detail-title-actions { display:flex; align-items:center; gap:6px; flex:0 0 auto; }
  .site-detail-title-actions a {
    min-height:34px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 9px;
    border:1px solid var(--occ-mobile-line);
    border-radius:9px;
    background:white;
    color:var(--occ-mobile-text);
    text-decoration:none;
    font-size:11px;
    font-weight:700;
  }
  .site-detail-title-actions .view-stream-button { margin:0 !important; }
  .site-detail-title-actions .site-detail-edit-button { color:var(--occ-mobile-blue); }

  .site-detail-glance {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
    margin:0 10px 8px;
  }
  .site-detail-glance > div {
    min-width:0;
    min-height:70px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:flex-start;
    gap:1px;
    padding:8px 9px;
    border:1px solid var(--occ-mobile-line);
    border-radius:11px;
    background:white;
    box-shadow:var(--occ-mobile-shadow);
  }
  .site-detail-glance-icon { font-size:13px; line-height:1; }
  .site-detail-glance strong { font-size:17px; line-height:1.15; color:var(--occ-mobile-text); }
  .site-detail-glance small { width:100%; font-size:9.5px; line-height:1.2; color:var(--occ-mobile-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

  /* Full weather/occupancy prose remains available on desktop; mobile gets the glance strip. */
  .site-detail-context { display:none !important; }
  .site-detail-page > .site-motion-mute-control,
  .site-detail-page > .motion-mute-control { margin:0 10px 8px !important; }

  .site-detail-camera-heading {
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin:10px 10px 6px;
  }
  .site-detail-camera-heading h3 { margin:0; font-size:15px; line-height:1.2; }
  .site-detail-camera-heading span { display:block; margin-top:1px; font-size:10px; color:var(--occ-mobile-muted); }
  .site-detail-camera-grid { margin:0 10px !important; }

  /* Site editor is intentionally sectioned so normal edits do not require scanning one giant form. */
  .site-edit-form { gap:7px !important; }
  .site-edit-section {
    margin:0 !important;
    padding:0 !important;
    border:1px solid var(--occ-mobile-line) !important;
    border-radius:11px !important;
    background:white !important;
    overflow:hidden;
  }
  .site-edit-section-heading,
  .site-edit-collapsible > summary {
    min-height:48px;
    padding:8px 10px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    list-style:none;
    cursor:default;
  }
  .site-edit-collapsible > summary { cursor:pointer; }
  .site-edit-collapsible > summary::-webkit-details-marker { display:none; }
  .site-edit-section-heading > div,
  .site-edit-collapsible > summary > div { min-width:0; display:flex; flex-direction:column; gap:1px; }
  .site-edit-section-heading strong,
  .site-edit-collapsible > summary strong { font-size:13px; color:var(--occ-mobile-text); }
  .site-edit-section-heading span,
  .site-edit-collapsible > summary div > span { font-size:10px; color:var(--occ-mobile-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .site-edit-collapsible > summary > span:last-child { font-size:20px; color:#8b9aa4; transform:rotate(0deg); transition:transform .15s ease; }
  .site-edit-collapsible[open] > summary > span:last-child { transform:rotate(90deg); }
  .site-edit-collapsible[open] > summary { border-bottom:1px solid #edf1f3; }

  .site-edit-fields { display:grid; gap:8px; padding:0 10px 10px; }
  .site-edit-section-general .site-edit-fields { padding-top:0; }
  .site-edit-fields label { display:grid; gap:3px; font-size:10px !important; font-weight:700; color:#526773; }
  .site-edit-location-fields { grid-template-columns:1fr 1fr; }
  .site-edit-location-fields .site-edit-help { grid-column:1 / -1; margin:0 !important; padding:2px 0 0; }

  .site-edit-section-type { padding-bottom:8px !important; }
  .site-edit-section-type .feature-toggle { margin:0 10px !important; }

  .site-edit-camera-body { padding:8px; }
  .site-edit-camera-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:7px; }
  .site-edit-camera-toolbar > span { font-size:10px; line-height:1.25; color:var(--occ-mobile-muted); }
  .site-edit-camera-toolbar > button { min-height:32px !important; padding:5px 8px !important; font-size:10px !important; flex:0 0 auto; }
  .site-edit-cameras .site-modal-camera-list article {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    padding:7px 8px !important;
    margin-bottom:5px !important;
    border:1px solid #e7edf0 !important;
    border-radius:9px !important;
    background:#fbfcfd !important;
  }
  .site-edit-cameras .site-modal-camera-list article > div:first-child { min-width:0; }
  .site-edit-cameras .site-modal-camera-list article > div:first-child span { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .site-edit-cameras .site-modal-camera-list article > div:last-child { display:flex; gap:3px; }
  .site-edit-cameras .site-modal-camera-list article button { min-height:28px !important; padding:4px 6px !important; font-size:9px !important; }

  /* Keep the important actions reachable while the section body scrolls. */
  .site-edit-form .modal-actions,
  .site-edit-form .ui-modal-actions {
    position:sticky;
    bottom:0;
    z-index:3;
    margin:2px -2px -2px !important;
    padding:8px 2px calc(8px + env(safe-area-inset-bottom)) !important;
    background:linear-gradient(to bottom,rgba(255,255,255,.94),#fff 28%);
  }
}
