/* Final geometry pass: keep controls and document details on one visual grid. */
.names i{
  display:inline-block;
  min-width:1.1em;
  padding:0 .34em;
  font-family:Georgia,'Times New Roman',serif;
  font-style:normal;
  font-weight:400;
  line-height:1;
  text-align:center;
  vertical-align:.04em;
}

.document-title-control{
  width:100%;
  max-width:100%;
  padding:0 38px;
}

.title-gear,
.fullscreen .title-gear{
  right:3px;
  top:50%;
  display:grid;
  place-items:center;
  margin:0;
  line-height:1;
}

.occasion .tick{
  top:12px;
  right:12px;
  display:grid;
  place-items:center;
  padding:0;
  line-height:1;
}

.check{
  align-items:center;
}

.check input{
  margin:0;
}

.custom-add{
  align-items:stretch;
}

.custom-add input{
  min-width:0;
}

.custom-add .small-button{
  display:grid;
  place-items:center;
  flex:0 0 52px;
  padding:0;
  line-height:1;
}

.stickers{
  display:flex!important;
  flex-wrap:wrap;
  justify-content:center!important;
  gap:10px!important;
}

.stickers button{
  display:grid;
  place-items:center;
  margin:0;
  line-height:1;
}

.wish-demo{
  min-height:58px;
}

.wish-memory{
  display:flex;
  justify-content:center;
  margin:auto 0 10px;
}

.wish-polaroid{
  width:112px;
  transform:rotate(4deg);
}

.wish-polaroid img{
  width:98px;
  height:90px;
}

.wish-polaroid figcaption{
  white-space:nowrap;
  font-size:10px;
}

.photo-fields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-bottom:18px;
}

.photo-fields .photo-upload{
  height:auto;
  min-height:88px;
  margin:0;
}

.photo-fields>div{
  display:flex;
  min-width:0;
  flex-direction:column;
}

.photo-slot-title{
  flex:0 0 auto;
  margin:0 0 9px;
  line-height:1.35;
}

.photo-slot-title{
  display:block;
  margin:0 0 8px;
  color:#665b69;
  font-size:12px;
  font-weight:600;
}

.paper.dense li,
.wish-paper.dense li{
  margin:5px 0!important;
  line-height:1.35!important;
}

.wish-paper.dense .wish-kiss{
  margin-top:15px;
}

.wish-paper.dense .wish-list{
  margin-top:8px!important;
  margin-bottom:10px!important;
}

.wish-paper.dense .wish-polaroid{
  width:92px;
}

.wish-paper.dense .wish-polaroid img{
  width:78px;
  height:66px;
}

.footer-actions .back,
.footer-actions .primary,
.footer-actions .mobile-preview{
  text-align:center;
}

@media(max-width:760px){
  .editor-content{
    width:100%;
  }

  .recipient-choice,
  .occasions,
  .names-fields{
    gap:12px;
  }

  .occasion,
  .occasion.selected{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
  }

  .occasion:last-child,
  .occasion:last-child.selected{
    flex-direction:row;
  }

  .occasion .tick{
    width:21px;
    height:21px;
    top:11px;
    right:11px;
    font-size:12px;
  }

  .check,
  .wish-checks .check{
    min-height:88px;
    padding:16px 18px;
    gap:16px;
    line-height:1.45;
  }

  .check input{
    width:27px;
    height:27px;
    flex:0 0 27px;
  }

  .custom-add{
    gap:10px;
  }

  .custom-add .small-button{
    flex-basis:56px;
    min-height:56px;
    border-radius:50%;
  }

  .stickers{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:10px!important;
    margin:14px 0 24px!important;
  }

  .stickers button{
    width:100%!important;
    height:64px!important;
    aspect-ratio:auto;
    border-radius:16px!important;
    font-size:24px!important;
  }

  .stickers button:nth-last-child(3){grid-column:2}

  .document-title-control{
    padding:0 34px;
  }

  .title-gear,
  .fullscreen .title-gear{
    right:1px;
    width:30px;
    height:30px;
  }

  .names i{
    padding:0 .28em;
  }

  .wish-demo{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
  }

  .photo-fields{
    grid-template-columns:1fr;
    gap:24px;
    margin-bottom:24px;
  }

  .photo-fields .photo-upload{
    min-height:104px;
    padding:20px;
  }

  .personal-fields{
    margin-top:0;
  }

  .wish-demo strong{
    min-width:0;
    text-align:center;
  }

  .footer-actions{
    align-items:stretch;
  }

  .footer-actions .back,
  .footer-actions .primary,
  .footer-actions .mobile-preview{
    min-height:54px;
    height:54px;
  }

  /* A recipient reads the actual document first; actions follow below it. */
  .shared-contract main{
    display:flex!important;
    flex-direction:column;
  }

  .shared-contract .preview-pane:not(.fullscreen){
    order:1;
    padding-top:28px;
  }

  .shared-contract .editor{
    order:2;
    padding-top:30px;
  }
}

@media(min-width:761px){
  .stickers button{
    width:48px!important;
    height:46px!important;
  }
}

@media print{
  @page{
    size:A4 portrait;
    margin:0;
  }

  html,
  body{
    width:210mm!important;
    height:auto!important;
    margin:0!important;
    padding:0!important;
    background:#fff!important;
    overflow:visible!important;
  }

  body{position:static!important}

  header,
  .editor,
  .preview-heading,
  .preview-foot,
  .mobile-preview,
  .toast,
  dialog{display:none!important}

  main,
  .preview-pane,
  .paper-wrap,
  .paper-stack{
    width:210mm!important;
    margin:0!important;
    padding:0!important;
    gap:0!important;
    overflow:visible!important;
  }

  main,
  .shared-contract main,
  .preview-pane,
  .shared-contract .preview-pane:not(.fullscreen),
  .paper-wrap,
  .paper-stack{
    display:block!important;
    min-height:0!important;
    height:auto!important;
    position:static!important;
    border:0!important;
    border-radius:0!important;
    background:#fff!important;
  }

  .preview-pane::before,
  .shared-contract .preview-pane:not(.fullscreen)::before{display:none!important;content:none!important}

  .paper-stack .paper,
  .paper-stack .paper.fullscreen{
    width:210mm!important;
    height:297mm!important;
    min-height:297mm!important;
    max-height:297mm!important;
    margin:0!important;
    padding:13mm 17mm 11mm!important;
    border-radius:0!important;
    box-shadow:none!important;
    overflow:hidden!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
    print-color-adjust:exact;
    -webkit-print-color-adjust:exact;
  }

  .paper-stack .paper{display:flex!important;flex-direction:column!important}

  .paper-stack #paper{
    break-after:page!important;
    page-break-after:always!important;
  }

  .paper-stack .wish-paper{
    break-after:auto!important;
    page-break-after:auto!important;
  }

  #paper .signatures{margin-top:auto!important}

  .paper-stack .doc-bottom{flex:0 0 auto!important;margin-top:0!important}

  .paper-stack .wish-memory{margin-top:auto!important}

  .paper h1{
    font-size:44px!important;
  }

  .paper li,
  .wish-list li{
    font-size:13px!important;
    line-height:1.45!important;
    margin:7px 0!important;
  }

  .paper.dense li,
  .wish-paper.dense li{
    font-size:11px!important;
    margin:4px 0!important;
  }

  .paper .memory{
    margin:18px 0 12px!important;
  }

  .paper .polaroid{
    width:132px!important;
  }

  .paper .polaroid img{
    width:118px!important;
    height:108px!important;
  }

  .wish-memory{
    margin:auto 0 8mm!important;
  }

  .wish-polaroid{
    width:128px!important;
  }

  .wish-polaroid img{
    width:114px!important;
    height:94px!important;
  }

  .wish-note{
    margin:0 0 7mm!important;
  }

  .title-gear{display:none!important}
}
