.address-entry-column {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

.field-row.two-col > .mobile-first-field {
  order: -1;
}

/* Saved-address and QR controls are a matched pair in both address forms. */
.home-address-choice-actions{display:flex;align-items:center;gap:7px;margin-left:auto}
.home-address-choice-actions>.saved-sender-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;width:154px!important;min-width:154px!important;height:42px!important;min-height:42px!important;margin:0!important;padding:0 10px!important;border-radius:11px!important;box-sizing:border-box;white-space:nowrap}
@media(min-width:621px){.receiver-card .card-heading,.sender-card .card-heading{min-width:0}.receiver-card .home-address-choice-actions,.sender-card .home-address-choice-actions{flex:0 1 auto;max-width:calc(100% - 110px)}html[data-access="guest"] .sender-card #useSavedSenderButton{width:154px!important;min-width:154px!important}}
@media(max-width:620px){.home-address-choice-actions{width:auto!important;margin-left:auto!important}.home-address-choice-actions>.saved-sender-button{flex:0 0 42px!important;width:42px!important;min-width:42px!important;height:42px!important;padding:0!important}.home-address-choice-actions>.saved-sender-button span{display:none}.home-address-choice-actions>.saved-sender-button img{width:21px;height:21px;margin:0}}
@media(max-width:350px){.receiver-card .card-heading,.sender-card .card-heading{flex-wrap:wrap}.home-address-choice-actions{flex-direction:column;align-items:stretch;gap:5px}.home-address-choice-actions>.saved-sender-button{width:min(210px,calc(100vw - 36px))!important;min-width:min(210px,calc(100vw - 36px))!important;padding:0 10px!important;font-size:.78rem}.home-address-choice-actions>.saved-sender-button span{display:inline}.home-address-choice-actions>.saved-sender-button img{flex:0 0 21px}}
@media(max-width:180px){.home-address-choice-actions{align-items:center}.home-address-choice-actions>.saved-sender-button{width:42px!important;min-width:42px!important;padding:0!important}.home-address-choice-actions>.saved-sender-button span{display:none}}

.forms-grid > .preview-section {
  align-self: stretch;
  min-width: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  margin-top: 0;
}

.forms-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.address-entry-column > .address-card {
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 1181px) {
  .address-entry-column > .address-card:not([hidden]) {
    height: 100%;
  }
}

.receiver-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  width: auto;
  margin-left: auto;
}
.receiver-header-actions .home-address-scan{width:auto;margin:0;border-color:var(--receiver-accent);color:var(--receiver-accent)}
.sender-card .home-address-scan{margin-left:0;border-color:var(--receiver-accent);color:var(--receiver-accent)}
.mobile-address-scan-hint{display:none}
@media(max-width:720px){.mobile-address-scan-hint{display:block;grid-column:1/-1;width:100%;margin:2px 0 0;color:var(--muted);font-size:.76rem;font-weight:500;line-height:1.3;text-align:right}}

/* Keep CSV import accessible from the receiver form. */
.receiver-card .receiver-import-actions {
  display:flex;
}

.receiver-header-actions .saved-receiver-button,
.receiver-header-actions .receiver-import-actions {
  width: auto;
  margin: 0;
  box-sizing: border-box;
}

.receiver-header-actions .saved-receiver-button,
.receiver-header-actions .csv-upload-button {
  justify-content: flex-start;
  width: auto;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: .82rem;
  white-space: nowrap;
}

.receiver-header-actions .saved-receiver-button {
  border-color: #044f59;
  background: #087482;
  color: #fff;
  font-size: .88rem;
  min-height: auto;
  padding: 10px 12px;
  border-radius: 11px;
}

.receiver-header-actions .saved-receiver-button:hover {
  border-color: #033f47;
  background: #055d68;
  color: #fff;
}

.receiver-header-actions .saved-receiver-button img {
  width: 21px;
  height: 21px;
  filter: brightness(0) invert(1);
}

.receiver-header-actions .saved-receiver-button img,
.receiver-header-actions .csv-upload-button img {
  width: 19px;
  height: 19px;
}

.receiver-header-actions .csv-upload-button .crown-icon {
  width: 15px;
  height: 15px;
  margin-left: auto;
}

.receiver-header-actions .csv-top-status:empty {
  display: none;
}

.receiver-header-actions .receiver-import-actions {
  display:flex;
  flex-wrap:wrap;
}

html[data-access="guest"] .receiver-header-actions .saved-receiver-button,
html[data-access="guest"] .receiver-header-actions .receiver-import-actions,
html[data-access="guest"] .receiver-header-actions .csv-upload-button {
  width: 220px;
  min-width: 220px;
  min-height: 42px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 11px;
  box-sizing: border-box;
  font-size: .82rem;
}

html[data-access="guest"] .receiver-header-actions .saved-receiver-button,
html[data-access="guest"] .receiver-header-actions .csv-upload-button {
  justify-content: center;
}

.receiver-footer-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%}
.receiver-footer-actions[hidden]{display:none}
.receiver-quick-save-button,.add-sender-address-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 11px 16px;
  border: 1px solid rgba(255, 90, 67, .42);
  border-radius: 14px;
  background: var(--sender-accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.receiver-quick-save-button{border-color:#075c66;background:#087482}
.receiver-quick-save-button:hover{border-color:#044f59;background:#055d68;color:#fff}
.receiver-quick-save-button img{width:22px;height:22px;filter:brightness(0) invert(1)}
.receiver-footer-actions>.form-print-share-actions{grid-column:1/-1}
.sender-form-save-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.sender-form-save-actions>.form-print-share-actions{grid-column:1/-1}.sender-form-save-actions>#saveSenderAddressButton,.sender-footer-back-button{box-sizing:border-box;width:100%;min-width:0!important;min-height:48px;padding-inline:10px}
.form-print-share-actions{display:none;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%}.form-print-share-actions button{display:inline-flex;align-items:center;justify-content:center;gap:8px;box-sizing:border-box;width:100%;min-width:0!important;min-height:44px;padding:9px 13px;border:1px solid var(--line);border-radius:12px;background:var(--page-bg-soft);color:var(--receiver-accent);font:inherit;font-weight:800;cursor:pointer}.form-print-share-actions button:hover{border-color:var(--receiver-accent);background:var(--receiver-soft)}.form-print-share-actions img{flex:none;width:21px;height:21px}
@media(max-width:720px){.form-print-share-actions{display:grid}}
.saved-address-login-dialog{position:fixed;width:min(440px,calc(100% - 24px));max-height:calc(100dvh - 24px);overflow:auto}.saved-address-login-dialog>form:first-child{position:absolute;z-index:2;top:9px;right:11px}.saved-address-login-dialog .qr-close{display:grid;float:none;width:38px;height:38px;padding:0;place-items:center;border-radius:50%;background:var(--receiver-soft);color:var(--text);font-size:1.75rem;line-height:1}.saved-address-login-dialog h2{margin-bottom:8px;padding-right:34px}.saved-address-login-dialog p{line-height:1.5}
@media(max-width:180px){.receiver-footer-actions,.sender-form-save-actions{grid-template-columns:1fr}.receiver-quick-save-button,.add-sender-address-button{width:100%}.sender-form-save-actions>.form-print-share-actions{grid-column:1}}

.add-sender-address-button:hover {
  background: #d94332;
  border-color: #c93829;
  color: #fff;
}

.add-sender-address-button img {
  width: 23px;
  height: 23px;
  filter: brightness(0) invert(1);
}

.add-sender-address-button[hidden] {
  display: none;
}

.sender-card[hidden] {
  display: none;
}

.receiver-card[hidden] {
  display: none;
}

body.hide-sender-label {
  --label-width: 85.6mm;
  --label-height: 54mm;
}

body.hide-sender-label #printArea .label-column,
body.hide-sender-label .batch-shipping-label .label-column {
  padding: 5mm;
}

body.hide-sender-label #printArea .receiver-label,
body.hide-sender-label .batch-shipping-label .receiver-label {
  border-right: 0;
}

body.hide-sender-label .batch-shipping-label {
  width: 85.6mm !important;
  min-width: 85.6mm !important;
  max-width: 85.6mm !important;
  height: 54mm !important;
  min-height: 54mm !important;
  max-height: 54mm !important;
  flex-basis: 54mm;
}

.label-size-information {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .86rem;
}

.preview-sender-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  margin: 0 auto 9px;
  padding: 8px 12px;
  border: 1px solid #acd1d5;
  border-radius: 11px;
  background: #edfafa;
  color: #075c66;
  font-size: .84rem;
  font-weight: 800;
  cursor: pointer;
}

.preview-sender-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--receiver-accent);
}

.label-size-information strong {
  color: var(--text);
}

.receiver-only-label-size {
  display: none;
}

body.hide-sender-label .receiver-only-label-size {
  display: inline;
}

body.hide-sender-label .sender-receiver-label-size {
  display: none;
}

.label-size-unit {
  font-size: .76rem;
}

.sender-back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 9px 11px;
  border: 1px solid rgba(255, 90, 67, .42);
  border-radius: 11px;
  background: var(--page-bg-soft);
  color: var(--sender-accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.sender-back-button:hover {
  background: var(--sender-soft);
  border-color: var(--sender-accent);
}

.sender-back-button img {
  width: 20px;
  height: 20px;
}

.sender-card .saved-sender-button {
  margin-left: 0;
}

@media (max-width: 760px) {
  .receiver-header-actions .saved-receiver-button {
    font-size: .78rem;
  }

  .receiver-header-actions .saved-receiver-button,
  .receiver-header-actions .csv-upload-button {
    min-height: 31px;
    padding: 4px 7px;
    font-size: .72rem;
  }

  .receiver-header-actions .saved-receiver-button img,
  .receiver-header-actions .csv-upload-button img {
    width: 15px;
    height: 15px;
  }

  .receiver-header-actions .csv-upload-button .crown-icon {
    width: 12px;
    height: 12px;
  }

  .receiver-header-actions [data-short-label] {
    font-size: 0;
  }

  .receiver-header-actions [data-short-label]::after {
    content: attr(data-short-label);
    font-size: .72rem;
  }
}

@media (max-width: 460px) {
  .receiver-header-actions .saved-receiver-button {
    font-size: .84rem;
  }

  .receiver-card .card-heading {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 14px 12px;
  }

  .receiver-card .card-icon {
    width: 34px;
    height: 34px;
  }

  .receiver-card .card-heading h2 {
    font-size: 1.18rem;
  }

  .receiver-header-actions {
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 142px;
    width: 142px;
    gap: 5px;
    margin: 0 0 0 auto;
  }

  .receiver-header-actions .saved-receiver-button,
  .receiver-header-actions .receiver-import-actions,
  .receiver-header-actions .csv-upload-button {
    width: 100%;
  }

  .receiver-header-actions .saved-receiver-button,
  .receiver-header-actions .csv-upload-button {
    justify-content: flex-start;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: .8rem;
  }

  .receiver-header-actions .saved-receiver-button img,
  .receiver-header-actions .csv-upload-button img {
    width: 14px;
    height: 14px;
  }

  html[data-access="guest"] .receiver-header-actions .saved-receiver-button,
  html[data-access="guest"] .receiver-header-actions .receiver-import-actions,
  html[data-access="guest"] .receiver-header-actions .csv-upload-button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 620px) {

  .sender-card .card-heading {
    flex-wrap: wrap;
  }

  .sender-card .saved-sender-button {
    width: 100%;
    justify-content: center;
  }
}

/* Keep both address-choice labels visible on narrow screens. */
@media (min-width: 180px) and (max-width: 620px) {
  .receiver-card .card-heading,
  .sender-card .card-heading {
    flex-wrap: wrap;
  }

  .receiver-card .receiver-header-actions.home-address-choice-actions,
  .sender-card .sender-header-actions.home-address-choice-actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: min(210px, calc(100vw - 28px)) !important;
    max-width: 100%;
    margin-left: auto !important;
  }

  .receiver-card .receiver-header-actions.home-address-choice-actions > .saved-sender-button,
  .sender-card .sender-header-actions.home-address-choice-actions > .saved-sender-button,
  .receiver-card .receiver-header-actions.home-address-choice-actions > .home-address-scan,
  .sender-card .sender-header-actions.home-address-choice-actions > .home-address-scan {
    display: inline-flex;
    flex: 0 0 42px !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    padding: 0 9px !important;
    justify-content: center;
    box-sizing: border-box;
    font-size: .78rem;
    white-space: nowrap;
  }

  .home-address-choice-actions > .saved-sender-button span,
  .home-address-choice-actions > .home-address-scan span {
    display: inline !important;
  }

  .home-address-choice-actions > .saved-sender-button img,
  .home-address-choice-actions > .home-address-scan img {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
  }
}

@media (min-width: 180px) and (max-width: 250px) {
  .receiver-card .receiver-header-actions.home-address-choice-actions > .saved-sender-button,
  .sender-card .sender-header-actions.home-address-choice-actions > .saved-sender-button {
    gap: 4px;
    padding-inline: 5px !important;
    font-size: .68rem;
  }

  .home-address-choice-actions > .saved-sender-button img,
  .home-address-choice-actions > .home-address-scan img {
    flex-basis: 14px;
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 1180px) {
  .forms-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .forms-grid > .preview-section {
    margin-top: 12px;
  }
}

@media print {
  .forms-grid {
    display: block !important;
  }

  .forms-grid > .address-entry-column {
    display: none !important;
  }

  .forms-grid > .preview-section {
    display: block !important;
  }

  .label-size-information {
    display: none !important;
  }

  .preview-sender-toggle {
    display: none !important;
  }

  body.hide-sender-label.batch-print-mode #batchLabelPreview .batch-shipping-label {
    width: 85.6mm !important;
    min-width: 85.6mm !important;
    max-width: 85.6mm !important;
    height: 54mm !important;
    min-height: 54mm !important;
    max-height: 54mm !important;
    margin: 0 auto 3mm !important;
  }
}

.receiver-card .card-heading {
  align-items: center;
}

.receiver-title-block {
  display: flex;
  align-items: center;
  min-width: 0;
}

.receiver-card .receiver-header-actions {
  width: max-content;
  margin-left: 0;
}

.receiver-back-spacer {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.receiver-card .saved-receiver-button,
.sender-card .saved-sender-button {
  width: auto;
  min-height: 0;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: .88rem;
  font-weight: 850;
}

.receiver-card .saved-receiver-button img,
.sender-card .saved-sender-button img {
  width: 21px;
  height: 21px;
}

@media (max-width: 620px) {
  .receiver-card .card-heading {
    flex-wrap: wrap;
  }

  .receiver-card .receiver-header-actions {
    display: contents;
  }

  .receiver-card .saved-receiver-button,
  .sender-card .saved-sender-button {
    width: 100%;
    justify-content: center;
  }

  .receiver-card .receiver-header-actions{display:flex;width:100%;gap:7px}
  .receiver-card .receiver-header-actions .saved-sender-button,.sender-card .saved-sender-button{width:auto;flex:1 1 0;min-width:0;padding-inline:8px}
  .home-address-scan{flex:0 0 42px!important;width:42px!important;min-width:42px!important;padding:0!important}.home-address-scan span{display:none}.home-address-scan img{margin:0}

  html[data-access="guest"] .receiver-card .saved-receiver-button,
  html[data-access="guest"] .receiver-card .receiver-import-actions,
  html[data-access="guest"] .receiver-card .csv-upload-button {
    width: 100%;
    min-width: 0;
  }
}
.address-scan-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.address-scan-modes[hidden],.scan-mode-choice[hidden],.handwriting-source[hidden],.ocr-review[hidden]{display:none!important}.address-scan-modes button,.address-scan-modes label{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px}.address-scan-modes img{width:21px;height:21px}.handwriting-source{margin-top:15px}.ocr-review-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.ocr-review-grid label{display:grid;gap:5px;text-transform:capitalize}.ocr-review-grid input,.ocr-review-grid select{min-width:0;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text)}.ocr-status{color:var(--receiver-accent);font-weight:700}@media(max-width:520px){.address-scan-modes,.ocr-review-grid{grid-template-columns:1fr}.address-scan-chooser{max-height:calc(100dvh - 20px);overflow:auto}}
.address-image-crop-dialog{box-sizing:border-box;width:min(820px,calc(100% - 20px));max-height:calc(100dvh - 20px)!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}.crop-canvas-wrap{display:grid;place-items:center;max-width:100%;margin:12px auto;overflow:visible;touch-action:pan-y}.address-image-crop-dialog canvas{display:block;width:auto;max-width:100%;height:auto;max-height:54dvh;border:1px solid var(--line);border-radius:10px;cursor:crosshair;touch-action:none}.crop-rotate-tools{display:flex;justify-content:center;gap:10px}.crop-rotate-tools button{display:grid;place-items:center;width:42px;height:42px;padding:0;border:1px solid #acd4d9;border-radius:10px;background:var(--receiver-soft)}.crop-rotate-tools img{width:23px;height:23px}.crop-help{text-align:center;color:var(--muted)}
@media(max-width:520px){.address-image-crop-dialog{width:calc(100% - 12px);max-height:calc(100dvh - 12px)!important;padding:16px 14px}.address-image-crop-dialog canvas{max-height:42dvh}.crop-canvas-wrap{margin-block:9px}}
.crop-layout-tools{display:grid;gap:8px;margin:12px 0;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--receiver-soft)}.crop-layout-tools>span{font-weight:800}.crop-layout-tools>div{display:flex;flex-wrap:wrap;gap:7px}.crop-layout{min-height:38px;padding:7px 11px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);font-weight:700;cursor:pointer}.crop-layout.active{border-color:var(--receiver-accent);background:var(--receiver-accent);color:#fff}.crop-swap{justify-self:start;min-height:38px}.crop-layout-tools[hidden],.crop-swap[hidden]{display:none!important}@media(max-width:420px){.crop-layout-tools>div{display:grid;grid-template-columns:1fr}.crop-layout,.crop-swap{width:100%}}
.preview-actions-below-label{width:100%;margin:14px 0 4px;justify-content:flex-start}
@media(min-width:721px){.preview-actions,.preview-actions-below-label{display:flex;align-items:stretch;flex-wrap:nowrap;justify-content:flex-start;gap:7px;width:100%}.preview-actions>.primary-button,.preview-actions>.share-menu{flex:1 1 0;width:auto!important;min-width:0;height:48px}.preview-actions .share-button{height:48px;min-height:48px;padding:8px 10px}.preview-actions>.primary-button{padding:8px 10px;font-size:.78rem}.preview-actions>.primary-button span,.preview-actions .share-button span{min-width:0;overflow:hidden;text-overflow:ellipsis}.preview-actions .preview-transaction-history{flex:0 0 48px!important;width:48px!important;height:48px!important;margin-left:0!important;padding:0!important}}
.first-transfer-gift-dialog{width:min(440px,calc(100% - 24px));max-height:calc(100dvh - 24px);overflow:auto;text-align:center;background:var(--page-bg-soft);color:var(--text)}.first-transfer-gift-dialog .gift-celebration{display:block;font-size:3rem}.first-transfer-gift-dialog h2{color:var(--receiver-accent)}.first-transfer-gift-dialog [data-gift-image]{display:block;width:min(230px,100%);max-height:210px;margin:12px auto;border-radius:14px;object-fit:contain;background:#fff}.first-transfer-gift-dialog [data-gift-image][hidden]{display:none}.first-transfer-gift-dialog [data-gift-message]{font-size:1.02rem;font-weight:750;line-height:1.5}.first-transfer-gift-dialog [data-gift-counter]{display:block;margin:0 0 16px;color:var(--muted)}
@media(max-width:680px){.mobile-preview-open .preview-actions-below-label{width:100%;margin:9px 0 2px;justify-content:flex-start;flex-wrap:wrap}}
@media(max-width:720px){.mobile-preview-open #printArea .label-column{cursor:pointer;touch-action:manipulation}.mobile-preview-open #printArea .label-column:active{background:color-mix(in srgb,currentColor 8%,transparent)}}
@media(max-width:680px){.mobile-preview-open .preview-actions-below-label .share-menu{position:relative;z-index:80}.mobile-preview-open .preview-actions-below-label .share-menu-options{top:auto;right:0;bottom:calc(100% + 9px);width:min(190px,calc(100vw - 36px));max-height:min(210px,55dvh);overflow-y:auto}.mobile-preview-open .preview-actions-below-label .share-menu-options::before{top:auto;right:12px;bottom:-7px;transform:rotate(225deg)}}
.ocr-review-parties{display:grid;gap:14px}.ocr-party{margin:0;padding:12px;border:1px solid var(--line);border-radius:13px}.ocr-party legend{padding:0 7px;color:var(--receiver-accent);font-weight:800}
.ocr-review-warning{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:10px;margin:0 0 14px;padding:12px 14px;border:1px solid #dfab24;border-left:5px solid #d88a00;border-radius:12px;background:#fff3c4;color:#513900;line-height:1.45}.ocr-review-warning strong{font-size:1.25rem;line-height:1}.ocr-review-warning span{font-size:.86rem;font-weight:700}body:has(#themeToggle:checked) .ocr-review-warning{background:#3b310e;color:#ffe89a}
.handwriting-source label:has(.ocr-camera){display:none!important}
.home-address-choice-actions>.saved-sender-button{width:auto;min-width:0;height:42px;min-height:42px;flex:0 1 auto;padding:0 12px;display:inline-flex;align-items:center;justify-content:center;gap:7px}.home-address-choice-actions>.saved-sender-button span{display:inline}.home-address-choice-actions>.saved-sender-button img{width:22px;height:22px;margin:0}
@media(max-width:179px){.home-address-choice-actions>.saved-sender-button{width:42px!important;min-width:42px!important;flex:0 0 42px!important;padding:0!important}.home-address-choice-actions>.saved-sender-button span{display:none!important}}

/* Wrap form tools so CSV remains reachable in the left-side panel. */
.receiver-header-actions{flex-wrap:wrap}
.receiver-header-actions .receiver-import-actions{max-width:100%}

/* Equal form actions, with compact accessible icon buttons on narrow screens. */
body .forms-grid .address-card .home-address-choice-actions {
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  width:100%!important;
  min-width:0;
  flex:1 0 100%;
  margin:8px 0 0!important;
}
body .home-address-choice-actions .receiver-import-actions {display:contents!important}
body :is(#uploadCsvButton,#uploadSenderCsvButton,#scanReceiverAddress,#scanSenderAddress,#useSavedReceiverButton,#useSavedSenderButton) {
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center!important;
  gap:7px;
  width:100%!important;
  min-width:0!important;
  height:44px!important;
  min-height:44px!important;
  margin:0!important;
  padding:0 8px!important;
  border-radius:12px;
  font-size:.82rem;
  white-space:nowrap;
}
body .home-address-choice-actions button>img:first-child {width:21px!important;height:21px!important;margin:0!important}
body .home-address-choice-actions button>span {display:inline!important}
body .home-address-choice-actions .mobile-address-scan-hint {display:none!important}
body .home-address-choice-actions .csv-top-status {grid-column:1/-1}
@media(max-width:720px) {
  body .forms-grid .address-card .home-address-choice-actions {
    grid-template-columns:repeat(3,44px);
    justify-content:end;
  }
  body :is(#uploadCsvButton,#uploadSenderCsvButton,#scanReceiverAddress,#scanSenderAddress,#useSavedReceiverButton,#useSavedSenderButton)>span,
  body .home-address-choice-actions button>.crown-icon {display:none!important}
  body :is(#uploadCsvButton,#uploadSenderCsvButton,#scanReceiverAddress,#scanSenderAddress,#useSavedReceiverButton,#useSavedSenderButton) {
    width:44px!important;
    min-width:44px!important;
    padding:0!important;
  }
}

@media(min-width:721px) {
  body .forms-grid .address-card .home-address-choice-actions {gap:5px}
  body :is(#uploadCsvButton,#uploadSenderCsvButton,#scanReceiverAddress,#scanSenderAddress,#useSavedReceiverButton,#useSavedSenderButton) {
    height:38px!important;
    min-height:38px!important;
    padding:0 5px!important;
    gap:4px;
    font-size:.75rem;
    line-height:1.15;
  }
  body .home-address-choice-actions button>img:first-child {width:16px!important;height:16px!important;flex-shrink:0}
  body .home-address-choice-actions button>.crown-icon {width:12px!important;height:12px!important;flex-shrink:0;margin-left:0}
  body .home-address-choice-actions button>span {min-width:0;white-space:normal;overflow:visible;text-overflow:clip}
}

/* Give the title its own row; form actions must not squeeze it off-screen. */
body .forms-grid :is(.receiver-card,.sender-card)>.card-heading {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  min-width:0;
}
body .forms-grid :is(.receiver-card,.sender-card)>.card-heading>div:not(.home-address-choice-actions) {min-width:0}
body .forms-grid :is(.receiver-card,.sender-card)>.card-heading h2 {margin:0;overflow-wrap:anywhere}
body .forms-grid .address-card .home-address-choice-actions {
  grid-column:1/-1;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
}

/* The main view is a centered preview; editing remains available in a dialog. */
body.preview-focused-layout .forms-grid{grid-template-columns:minmax(0,1fr)!important;max-width:900px;margin-left:auto;margin-right:auto}
body.preview-focused-layout .forms-grid>.preview-section{grid-column:1!important;position:relative!important;top:auto!important;width:100%!important;height:auto!important;max-height:none!important;align-self:start!important}
#addressEntryDialog{width:min(820px,calc(100vw - 24px));max-height:90dvh;overflow:auto;padding:16px;border:1px solid var(--line);border-radius:18px;background:var(--page-bg-soft);color:var(--text)}
#addressEntryDialog::backdrop{background:rgb(0 0 0 / .45)}
#addressEntryDialog .address-entry-close{display:block;margin:0 0 12px auto}
#addressEntryDialog .address-entry-column{width:100%;min-height:0}
#addressEntryDialog .user-workspace-frame{min-height:65vh}
@media print{#addressEntryDialog{display:none!important}}

html:has(#addressEntryDialog[open]),body:has(#addressEntryDialog[open]){overflow:hidden!important;overscroll-behavior:none}
#addressEntryDialog.new-address-active{overflow:hidden}
#addressEntryDialog.new-address-active .address-entry-column{height:calc(90dvh - 90px);overflow:hidden}
#addressEntryDialog.new-address-active .user-workspace-frame{height:100%;min-height:0;border:0;border-radius:0;display:block}

/* Form actions belong to the forms, never to the embedded address-book flow. */
#addressEntryDialog .address-entry-column.workspace-open>#receiverFooterActions,
#addressEntryDialog .address-entry-column.workspace-open>#receiverForm,
#addressEntryDialog .address-entry-column.workspace-open>#senderForm{display:none!important}
#addressEntryDialog.new-address-active .address-entry-column{display:block;position:relative}
#addressEntryDialog.new-address-active .user-workspace-frame{width:100%;max-height:100%;margin:0}
/* A compact method picker needs only the close control inside its frame. */
#addressEntryDialog.new-address-active{width:min(440px,calc(100vw - 24px));padding:0}
#addressEntryDialog.new-address-active>.address-entry-close{display:none!important}
#addressEntryDialog.new-address-active .address-entry-column{height:min(460px,85dvh)}

#addressEntryDialog.new-address-active.manual-address-active{width:min(820px,calc(100vw - 24px))}
#addressEntryDialog.new-address-active.manual-address-active .address-entry-column{height:85dvh}

#addressEntryDialog.new-address-active:not(.manual-address-active){width:min(420px,calc(100vw - 24px))}
#addressEntryDialog.new-address-active:not(.manual-address-active) .address-entry-column{height:min(440px,85dvh)}

/* Sender data remains available for labels; address entry uses the shared flow. */
#senderForm,#addSenderAddressButton{display:none!important}
