/* Phone-first interaction surface. Desktop enhancements follow below. */
:root { --field-nav-height: 72px; }
.mobile-catalog { display: block; }
.plan-details summary { cursor: pointer; list-style: none; padding: 14px 0; font-size: 14px; font-weight: 600; min-height: 48px; }
.plan-details summary::after { content: '+'; float: right; font-size: 20px; }
.plan-details[open] summary::after { content: '−'; }
.plan-closeout { margin-top: 14px; }
.catalog-item { border-bottom: 1px solid var(--line); }
.catalog-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; list-style: none; cursor: pointer; padding: 18px 0; min-height: 64px; font-size: 13px; line-height: 1.5; }
.catalog-item summary small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.catalog-item summary b { font-size: 17px; white-space: nowrap; }
.catalog-item dl { padding: 0 0 16px; font-size: 12px; }
.catalog-item dl div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; }
.catalog-item dt { color: var(--muted); }
.catalog-item dd { margin: 0; }
@media (max-width: 800px) {
  html { scroll-padding-bottom: 180px; }
  body { font-size: 15px; }
  .main { padding: 20px 16px calc(100px + env(safe-area-inset-bottom)); }
  .topbar { height: 60px; padding: 0 16px; }
  .topbar .icon-button { min-width: 44px; min-height: 44px; }
  h1 { font-size: 27px; line-height: 1.2; }
  .eyebrow { font-size: 10px; }
  .page-heading { margin: 9px 0 20px; gap: 14px; }
  .subtitle { font-size: 14px; line-height: 1.5; margin-top: 7px; max-width: none; }
  .btn { min-height: 48px; font-size: 14px; padding: 12px 14px; }
  .back-btn { min-height: 44px; font-size: 13px; margin-bottom: 7px; }
  .page-heading > .btn { min-width: 48px; min-height: 48px; }
  .home-actions .btn { min-height: 48px; font-size: 13px; }
  .summary { margin-bottom: 20px; }
  .stat-item { padding: 13px 15px; }
  .stat-label { font-size: 11px; }
  .stat-number { margin-top: 7px; font-size: 24px; }
  .stat-number small { font-size: 10px; }
  .section-title h2 { font-size: 17px; }
  .filters { gap: 10px; margin-bottom: 16px; }
  .search-box { min-height: 48px; }
  .search-box input { font-size: 16px; }
  .tabs-row { width: 100%; padding: 3px; gap: 0; }
  .filter-tab { flex: 1; min-width: 0; min-height: 44px; font-size: 11px; padding: 7px 5px; }
  .plans-grid { grid-template-columns: 1fr; gap: 16px; }
  .plan-map { height: 105px; }
  .card-content { padding: 17px; }
  .plan-card h3 { font-size: 19px; }
  .plan-title-button { min-height: 44px; }
  .project-code { font-size: 10px; }
  .status-pill { font-size: 10px; }
  .location, .card-metrics, .progress-label, .card-footer { font-size: 12px; }
  .location { margin-top: 2px; }
  .card-metrics { margin-top: 16px; }
  .open-plan { font-size: 13px; min-height: 44px; }
  .map-expand { width: 44px; height: 44px; }
  .bottom-grid { margin-top: 20px; }
  .tip-panel { display: none; }
  .activity-text { line-height: 1.5; font-size: 12px; }
  .activity-text small { font-size: 11px; }
  .mobile-nav { min-height: var(--field-nav-height); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .mobile-nav button { min-width: 64px; min-height: 52px; font-size: 11px; justify-content: center; }
  .mobile-nav .icon { width: 23px; height: 23px; }
  .panel { padding: 17px; }
  .detail-grid { display: flex; flex-direction: column; gap: 16px; }
  .detail-grid > aside { order: initial; }
  .plan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 0; }
  .plan-actions .btn { font-size: 12px; padding: 10px 8px; }
  .pole-row { padding: 17px 0; gap: 10px; flex-wrap: wrap; }
  .pole-info { min-width: 120px; }
  .pole-info h3 { font-size: 15px; }
  .pole-info p { font-size: 12px; line-height: 1.5; }
  .pole-row .btn { min-height: 48px; font-size: 12px; padding: 10px; }
  .pole-symbol { height: 40px; width: 36px; }
  .map-poles button { min-height: 48px; font-size: 13px; }
  .detail-grid > aside .detail-map { height: 150px; }
  .notice { font-size: 12px; line-height: 1.6; }
  body[data-editing='true'] .mobile-nav { display: none; }
  body[data-editing='true'] .main { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
  body[data-editing='true'] .page-heading { margin-bottom: 14px; }
  body[data-editing='true'] .page-heading .subtitle { display: none; }
  .pole-switcher { padding: 12px; gap: 8px; margin-bottom: 12px; }
  .pole-switcher label { font-size: 12px; gap: 8px; }
  .pole-switcher select { font-size: 16px; min-width: 0; max-width: 66%; min-height: 48px; padding: 8px; }
  .live-status { font-size: 12px; }
  .flow-steps { gap: 6px; margin-bottom: 16px; }
  .flow-step { display: flex; flex-direction: column; align-items: flex-start; padding: 10px; min-height: 78px; gap: 7px; font-size: 13px; }
  .flow-step .step-circle { display: none; }
  .flow-step.selected { border-bottom: 3px solid var(--green); }
  .flow-step small { font-size: 11px; line-height: 1.3; }
  #flow-header { scroll-margin-top: 12px; }
  .photo-quick-actions { flex-direction: column; gap: 8px; margin-top: 16px; }
  .photo-quick-actions .btn { min-height: 48px; font-size: 14px; }
  .photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 18px 0; }
  .photo-image { height: 110px; }
  .photo-caption { padding: 12px 9px; font-size: 13px; line-height: 1.4; }
  .photo-caption small { font-size: 11px; }
  .photo-add { width: 36px; height: 36px; }
  .save-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; border-radius: 0; margin: 0; padding: 9px 16px calc(12px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px #203d3408; gap: 8px; }
  .save-bar p { font-size: 11px; }
  .flow-actions { gap: 8px; }
  .flow-actions .btn { min-height: 50px; font-size: 13px; padding: 10px 8px; }
  .flow-actions .btn:first-child { flex: .85; }
  .flow-actions .btn:last-child { flex: 1.15; }
  .flow-actions .icon { width: 16px; height: 16px; }
  .material-row { grid-template-columns: minmax(0,1fr); gap: 12px; padding: 18px 0; }
  .material-name { font-size: 14px; line-height: 1.5; }
  .material-name small { font-size: 12px; }
  .quantity { justify-self: end; width: 158px; }
  .quantity button { width: 48px; min-height: 48px; font-size: 22px; }
  .quantity input { width: 60px; min-height: 48px; font-size: 18px; }
  .confirm-line { padding: 14px 0; font-size: 14px; }
  .confirm-line input { width: 24px; height: 24px; flex-shrink: 0; }
  .review-list > button { font-size: 13px; padding: 16px 0; }
  .review-list b { font-size: 12px; max-width: 112px; }
  .review-material { font-size: 13px; line-height: 1.5; }
  .catalog { display: none; }
  body[data-screen='materials'] .section-title { align-items: flex-start; flex-direction: column; }
  .modal { padding: 0; align-items: end; }
  .modal-box { width: 100%; max-width: none; max-height: 94dvh; border-radius: 18px 18px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
  .modal-head { position: sticky; top: -20px; z-index: 2; padding: 12px 0; margin-top: -8px; background: white; }
  .modal-head h3 { font-size: 21px; }
  .modal .icon-button { min-width: 48px; min-height: 48px; }
  .modal label.field { font-size: 13px; margin-top: 18px; }
  .field input, .field select, .field textarea { min-height: 48px; font-size: 16px; }
  .fields-two { grid-template-columns: 1fr; gap: 0; }
  .modal-box .modal-action { position: static; display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0 0; }
  .modal-action .btn { min-height: 48px; font-size: 13px; }
  .upload-area { padding: 16px 12px; }
  .capture-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .capture-actions .btn { font-size: 12px; padding: 9px; }
  .preview { max-height: 180px; }
  .toast-message { top: 68px; bottom: auto; max-width: calc(100% - 24px); padding: 12px 14px; font-size: 12px; pointer-events: none; }
}
@media (min-width: 801px) {
  .mobile-catalog { display: none; }
  .plan-details { display: block; }
  .plan-details > summary { font-size: 13px; }
}
@media (max-width: 359px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .panel { padding: 14px; }
  .flow-step { font-size: 12px; padding: 9px 7px; }
  .flow-step small { font-size: 10px; }
  .pole-switcher label { font-size: 11px; }
  .flow-actions .btn { font-size: 12px; }
  .stat-item { padding: 12px; }
  .stat-number { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
