/* Touch controls, small screens and the mobile connection workflow. */
.mobile-menu-button,.mobile-model-choice,.mobile-actions{display:none}
.skip-link{position:absolute;top:-80px;left:16px;z-index:30;background:var(--ink);color:#fff;padding:14px 18px;border-radius:6px}
.skip-link:focus{top:12px}
#configHeading,#resultsSection{scroll-margin-top:20px}
@media(max-width:900px){
  body{padding-bottom:calc(86px + env(safe-area-inset-bottom,0px))}
  .header{height:auto;min-height:74px;padding:14px 18px;gap:12px;flex-wrap:wrap;z-index:3}
  .brand{font-size:23px}.brand-mark{width:29px;transform:scale(.9)}
  .private-badge{margin-left:0;font-size:12px;padding:8px}
  .mobile-menu-button{display:flex;align-items:center;justify-content:center;gap:8px;margin-left:auto;min-height:44px;padding:8px 12px;border:1px solid var(--border);border-radius:6px;font-size:14px;background:#fff}
  .mobile-menu-button span{font-size:18px}
  .header nav{display:none;width:100%;height:auto;margin:0;padding:8px 0 0;gap:8px;flex-wrap:wrap;border-top:1px solid var(--border)}
  .header.menu-open nav{display:flex}
  .header nav>*{height:auto;min-height:44px;padding:10px 12px!important;border-radius:6px;font-size:14px}
  .header nav .nav-active{display:none}
  main{padding:0 18px}
  .intro{padding:26px 0 22px}.intro p{font-size:14px}.intro-note{display:none}h1{font-size:30px}
  .workspace{grid-template-columns:minmax(0,1fr);gap:24px}
  .config-panel{padding:20px;border-radius:10px;min-width:0}
  .panel-heading h2{font-size:20px}.text-button{min-height:44px;padding:10px;font-size:13px}
  .form-section{padding:20px 0}.section-label h3{font-size:16px}.section-label b{font-size:12px}
  label{font-size:13px;margin-top:16px}
  input,select,.model-fields input,.registry-filters select{font-size:16px;min-height:48px;height:48px;line-height:1.3}
  .model-fields label{font-size:13px;margin-top:12px}
  .equipment-row{grid-template-columns:minmax(0,1fr)}
  .equipment-row .device-select,.equipment-row .search-model-button{display:none}
  .mobile-model-choice{display:flex;flex-direction:column;align-items:stretch;text-align:left;gap:5px;width:100%;min-width:0;min-height:70px;border:1px solid #dce2e1;border-radius:7px;padding:12px;background:#fafbf9}
  .mobile-model-choice>span{font-size:16px;line-height:1.4;font-weight:650;overflow-wrap:anywhere}
  .mobile-model-choice small{display:flex;align-items:center;justify-content:space-between;color:#526e69;font-size:13px}
  .mobile-model-choice small span{font-size:22px;line-height:1}
  .end-title{font-size:14px}.end-badge{height:28px;width:28px;font-size:13px}
  .device-hint{align-items:center;gap:6px}.device-state,.device-hint a{font-size:12px}.device-hint a{display:inline-flex;align-items:center;min-height:44px}
  .between{margin:14px 0}.between button{min-width:44px;height:44px;font-size:21px}
  .field-hint{font-size:12px;line-height:1.6;color:#60746e}
  .endpoint-details{font-size:13px}.endpoint-details summary,.advanced summary{min-height:44px;padding:12px 0;font-size:13px}
  .segments button{min-height:44px;font-size:14px}
  .distance-presets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
  .distance-presets button{min-height:44px;padding:8px 4px;font-size:13px}
  .primary,.secondary{min-height:48px;font-size:14px;white-space:normal}
  .find-button{font-size:15px}.live-note{font-size:12px;line-height:1.6;text-align:center}
  .cisco-banner{align-items:stretch;flex-direction:column;padding:16px;gap:10px;margin:0 0 20px}
  .cisco-banner p strong{font-size:14px}.cisco-banner p span{font-size:12px;line-height:1.6;max-width:none}
  .cisco-banner>button{display:flex;align-items:center;justify-content:space-between;max-width:none;min-height:46px;padding:10px 12px;border:1px solid #c7d8cd;border-radius:6px;background:#fff;font-size:14px;text-align:left;white-space:normal}
  .cisco-banner>button span{margin-left:8px}.cisco-symbol{display:none}
  .connection-card{padding:18px 16px 0}.connection-heading{gap:8px}.small-pill{font-size:12px}
  .connection-diagram{gap:8px;padding:22px 0}.device-node{flex:0 1 95px;min-width:0}
  .device-node strong,.device-node small{overflow-wrap:anywhere}.device-node small{font-size:12px}
  .device-node svg{max-width:100%}.link-line{min-width:0}.link-line small{font-size:12px;overflow-wrap:anywhere}.wire{margin-left:0;margin-right:0}
  .connection-status{margin-left:-16px;margin-right:-16px;padding:12px 16px;font-size:12px;line-height:1.6}
  .examples{gap:7px;padding:14px 0 22px}.examples>span{font-size:12px}.examples button{min-height:44px;font-size:12px;padding:10px}
  .result-heading{flex-wrap:wrap;align-items:center;gap:12px}.result-heading h2{font-size:22px}.result-heading .secondary{padding:10px 12px}
  .result-explainer{font-size:13px;line-height:1.6}
  .product-main{gap:14px;padding:18px 16px;flex-wrap:wrap}.product-description h3{font-size:18px;line-height:1.45}.product-subtitle{font-size:13px}
  .product-visual{width:74px;height:78px}.product-visual img{width:70px}
  .product-type{font-size:12px}.tags{gap:5px}.tags span{font-size:12px;white-space:normal;overflow-wrap:anywhere}
  .match-badge{display:block;font-size:12px;white-space:normal;line-height:1.5}
  .recommend-strip{padding:10px 16px;font-size:12px;line-height:1.7}
  .product-reason{padding:0 16px 16px;font-size:13px;line-height:1.6}
  .product-bottom{padding:8px 16px;gap:4px;flex-wrap:wrap;align-items:stretch}
  .product-bottom button,.product-bottom a{min-height:44px;display:flex;align-items:center;font-size:13px;white-space:normal;line-height:1.5}
  .empty{padding:22px 16px}.empty p,.empty ul,.error-box{font-size:14px;line-height:1.7}
  .saved-chips{max-width:100%}.saved-chip{max-width:100%}.saved-chip button{min-height:44px;font-size:12px;overflow-wrap:anywhere}.saved-chip button+button{min-width:44px}
  .scope-note{font-size:12px}.footer-links{gap:8px 20px}footer{font-size:12px}footer button{min-height:44px;font-size:12px}
  .mobile-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.5fr);gap:10px;position:fixed;bottom:0;left:0;right:0;z-index:5;padding:12px max(16px,env(safe-area-inset-right,0px)) calc(12px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));border-top:1px solid #d6dfd8;background:#fffffff5;box-shadow:0 -5px 24px #16334310}
  .mobile-actions button{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;min-height:48px;font-size:14px}.mobile-actions .secondary span{margin:0}
  body:has(dialog[open]){overflow:hidden}
  body:has(dialog[open]) .mobile-actions,body:has(input:focus) .mobile-actions{visibility:hidden}
  #toast{bottom:calc(94px + env(safe-area-inset-bottom,0px));font-size:14px}
  .dialog-heading h2{overflow-wrap:anywhere}.dialog-heading button{min-width:44px;min-height:44px;padding:8px;font-size:28px;flex-shrink:0}
  #dialogContent{font-size:14px;overflow-wrap:anywhere}#dialogContent h3{font-size:16px}
  .registry-summary>*{font-size:12px}.registry-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.registry-filters select:last-child{grid-column:1 / -1}
  .device-result{gap:12px;flex-wrap:wrap;padding:16px 0}.device-result>div{flex:1 1 200px}.device-result strong{font-size:16px}.device-result small,.device-result p{font-size:13px}.device-result a{min-height:44px;display:inline-flex;align-items:center;font-size:13px}.device-result .secondary{min-height:46px;padding:10px 16px;font-size:14px}
  .source-row{grid-template-columns:minmax(0,1fr) auto}.source-row a{display:inline-flex;align-items:center;min-height:44px;font-size:14px;overflow-wrap:anywhere}.source-row small,.source-row>span{font-size:12px}
  .detail-actions{display:grid;grid-template-columns:1fr}.note-box{font-size:13px}#dialogContent .warning-list{font-size:13px}
}
@media(max-width:540px){
  .port-vendor{grid-template-columns:minmax(0,1fr);gap:0}
  .product-main{display:grid;grid-template-columns:64px minmax(0,1fr);gap:12px}
  .product-visual{width:64px;height:72px}.product-visual img{width:62px}
  .match-badge{grid-column:1 / -1;justify-self:start}
  .product-bottom{flex-direction:column}.product-bottom button{justify-content:space-between}
  .product-description h3 span{display:block;margin:0;font-size:16px;line-height:1.2}
  .device-node{flex-basis:80px}.device-node strong{font-size:12px}
  .connection-heading .eyebrow{letter-spacing:.7px;font-size:12px}
}
@media(max-width:600px){
  dialog{width:100%;max-width:none;height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;margin:0;padding:0;border:0;border-radius:0}
  dialog[open]{display:flex;flex-direction:column}
  .dialog-heading{position:relative;flex-shrink:0;gap:12px;padding:calc(12px + env(safe-area-inset-top,0px)) 16px 12px}
  .dialog-heading h2{font-size:20px}
  #dialogContent{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 18px calc(24px + env(safe-area-inset-bottom,0px))}
  .bom{display:block;width:100%;font-size:14px}
  .bom thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0)}
  .bom tbody{display:grid;gap:12px}
  .bom tr{display:block;padding:4px 14px;border:1px solid var(--border);border-radius:8px;background:#fafbf9}
  .bom td{display:block;border:0;padding:9px 0;font-size:14px;overflow-wrap:anywhere}
  .bom td+td{border-top:1px solid var(--border)}
  .bom td::before{content:attr(data-label);display:block;color:var(--muted);font-size:12px;font-weight:650;letter-spacing:.3px;margin-bottom:4px}
  .bom td strong{font-size:16px}.bom a{display:inline-flex;align-items:center;min-height:44px;font-size:13px}
}
@media(max-width:380px){
  .header{padding:12px 14px;gap:8px}.brand{font-size:20px;gap:8px}.brand-mark{width:25px}.brand small{font-size:12px;letter-spacing:1.8px}
  .mobile-menu-button{padding:8px;font-size:13px;gap:5px}.private-badge{font-size:12px;padding:6px;gap:4px}
  main{padding:0 14px}.config-panel{padding:16px}.connection-card{padding-left:14px;padding-right:14px}
  .connection-status{margin-left:-14px;margin-right:-14px}h1{font-size:28px}
}
@media(max-width:600px){.results-panel .product-main{grid-template-columns:74px minmax(0,1fr)}}

/* Keep focused controls above the fixed mobile action bar. */
@media(max-width:900px){html{scroll-padding-block-end:110px}:is(button,a,input,select,textarea,summary,[tabindex]){scroll-margin-block-start:20px}}
