/* Flow-specific refinements for the meme template chooser.
   Loaded after meme-builder-polish.css so it only adjusts the selection card. */

#templateChooser .builder-panel-head{
  align-items:flex-start;
}

#templateChooser .builder-panel-head > .btn{
  display:none!important;
}

.template-choice-bar{
  align-items:stretch;
  margin-bottom:18px;
}

.template-choice-summary{
  display:grid;
  align-content:center;
  min-width:0;
}

.template-choice-actions{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
  min-width:min(100%,420px);
}

.template-choice-actions .btn{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-width:0;
  min-height:46px;
  text-align:center;
  text-decoration:none;
  white-space:normal;
}

.template-choice-actions .btn.primary{
  grid-column:1 / -1;
  order:-1;
}

#templateChooser + .template-gallery-link{
  display:none!important;
}

#templateChooser.is-staged:not([hidden]) + .template-gallery-link{
  display:block!important;
}

.template-gallery-link-outside{
  margin:14px 0 22px;
  padding:0;
  background:transparent;
}

.template-gallery-link-outside .btn{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:54px;
  text-align:center;
  text-decoration:none;
  background:#fff!important;
  color:#211d19;
  border-color:#211d19;
  box-shadow:3px 3px 0 #211d19;
}

.template-gallery-link-outside .btn:hover,
.template-gallery-link-outside .btn:focus-visible{
  background:#fff!important;
  color:#821d1d;
  border-color:#821d1d;
}

@media(max-width:760px){
  .template-choice-bar{
    gap:16px;
  }

  .template-choice-actions{
    grid-template-columns:1fr!important;
    min-width:0;
  }

  .template-gallery-link-outside{
    margin:12px 0 18px;
  }
}
