/* Live wallets: compact cards, genuine addresses and restrained motion. */
dialog.custody-flow{width:660px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);font-weight:600}
.custody-flow .wallet-head{padding:21px 24px}.custody-flow .wallet-head h3{font-size:20px}.custody-flow .wallet-panel{padding:20px 24px}.custody-flow .form-error{margin:0 24px 16px}.custody-flow [hidden]{display:none!important}
.custody-section-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 11px}.custody-section-heading strong{font-size:13px;font-weight:700}.custody-section-heading .micro{font-size:11px;color:var(--muted)}
.custody-flow .wallet-asset-list{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 18px}.custody-flow .wallet-asset-card{gap:9px;padding:12px 10px;border-radius:13px;position:relative}.custody-flow .wallet-asset-card .coin{width:29px;height:29px}.custody-flow .wallet-asset-card strong{font-size:13px}.custody-flow .wallet-asset-card small{font-size:10px;margin-top:3px;color:var(--muted)}
.custody-choice-check{display:none;margin-left:auto;color:var(--brand);font-size:14px}.wallet-asset-card[aria-pressed=true] .custody-choice-check,.custody-network-card[aria-pressed=true] .custody-choice-check{display:block}.custody-flow[data-custody-flow=withdraw] .wallet-asset-list{grid-template-columns:repeat(auto-fit,minmax(125px,1fr))}
.custody-networks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:17px}.custody-network-card{display:flex;align-items:center;gap:9px;min-width:0;min-height:53px;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);color:var(--text);font:inherit;font-size:12px;font-weight:650;text-align:left;transition:border-color .15s,background .15s}.custody-network-card>.coin{width:26px;height:26px;flex-shrink:0}.custody-network-card>span:not(.coin):not(.custody-choice-check){min-width:0;line-height:1.35}.custody-network-card:hover{border-color:var(--brand)}.custody-network-card[aria-pressed=true]{background:var(--brand-soft);border-color:var(--brand);box-shadow:0 0 0 1px var(--brand-line)}
.custody-security-note{font-size:11px;line-height:1.55;color:var(--muted);margin:13px 0 0}.custody-flow .wallet-actions{gap:10px;margin-top:18px}.custody-flow .wallet-actions .button{min-height:44px}.custody-flow .wallet-actions .button:not(.full){flex:1}
.custody-amount-card{padding:14px 16px 12px;border:1px solid var(--line);border-radius:15px;background:var(--surface-2);margin:2px 0 14px}.custody-balance{display:flex;justify-content:space-between;gap:12px;padding-bottom:13px;margin-bottom:12px;border-bottom:1px solid var(--line)}.custody-balance>span{min-width:0}.custody-balance>span:last-child{text-align:right}.custody-balance small{display:block;font-size:10px;font-weight:600;color:var(--muted);margin-bottom:4px}.custody-balance strong{font-size:12px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.custody-amount-card .wallet-label{font-size:11px;color:var(--muted);margin:0}
.custody-amount{display:flex;align-items:center;gap:9px;margin-top:7px}.custody-flow .custody-amount input{width:100%;min-width:0;padding:3px 0;border:0;border-radius:0;box-shadow:none;background:transparent;font-family:var(--font-mono);font-size:25px;font-weight:700;color:var(--text)}.custody-amount>[data-custody-symbol]{font-size:12px;font-weight:750;color:var(--muted)}.custody-max{color:var(--brand);background:var(--brand-soft);border:1px solid var(--brand-line);border-radius:7px;font-family:var(--font-mono);font-size:10px;font-weight:750;padding:6px 8px}.custody-amount-meta{display:flex;justify-content:space-between;gap:10px;font-size:10px;color:var(--muted);margin-top:7px}.custody-amount-meta>span:first-child{min-width:0;overflow-wrap:anywhere}
.custody-destination-card{border:1px solid var(--line);border-radius:13px;padding:12px 14px}.custody-destination-card .custody-section-heading{margin-bottom:8px}.custody-destination-card .text-link{font-size:11px;white-space:nowrap}.custody-destination{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;font-size:12px}.custody-destination-ready{font-size:10px;color:var(--green);white-space:nowrap}
.custody-preparing{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:290px;text-align:center;padding:24px 12px}.custody-preparing .eyebrow{font-size:10px;margin-top:20px}.custody-preparing h4{font-size:21px;margin:10px 0}.custody-preparing p{max-width:280px;font-size:12px;line-height:1.6;color:var(--muted);margin:0}.custody-spinner{width:48px;height:48px;border:3px solid var(--brand-line);border-top-color:var(--brand);border-radius:50%;animation:custody-spin .85s linear infinite}.custody-spinner:after{content:'';display:block;width:9px;height:9px;background:var(--brand);border-radius:50%;margin:15px auto;opacity:.5}@keyframes custody-spin{to{transform:rotate(360deg)}}
.custody-address-grid{display:grid;grid-template-columns:256px minmax(0,1fr);align-items:center;gap:22px}.custody-qr-panel{padding:12px;border:1px solid var(--brand-line);border-radius:22px;background:linear-gradient(145deg,var(--brand-soft),var(--surface-2));text-align:center}.custody-qr{position:relative;display:grid;place-items:center;background:#fff;padding:10px;border-radius:16px;aspect-ratio:1;overflow:hidden}.custody-qr>svg{display:block;width:100%;height:auto;aspect-ratio:1;background:white;shape-rendering:crispEdges}.custody-qr-logo{display:grid;place-items:center;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:36px;height:36px;background:white;border:4px solid white;border-radius:50%;box-shadow:0 0 0 1px #e3e5eb}.custody-qr-logo .coin{width:28px;height:28px;border-radius:50%}.custody-qr-caption{display:block;font-size:10px;line-height:1.4;color:var(--muted);font-weight:650;margin-top:10px}
.custody-selected-asset{display:flex;align-items:center;gap:10px;margin-bottom:10px}.custody-selected-asset>.coin{width:36px;height:36px}.custody-selected-asset strong{font-size:16px;line-height:1.3}.custody-selected-asset strong span{font-size:10px;color:var(--muted);font-weight:600}.custody-selected-asset small{display:block;font-size:11px;color:var(--text-2);margin-top:4px}.custody-ready-label{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:650;color:var(--green);margin-bottom:17px}.custody-ready-label>span{width:6px;height:6px;border-radius:50%;background:currentColor}.custody-address-info .wallet-label{font-size:11px;margin-bottom:7px}.custody-address{border:1px solid var(--line);border-radius:11px;background:var(--surface-2);padding:12px;margin-bottom:10px;min-width:0}.custody-address code{display:block;font-family:var(--font-mono);font-size:11px;font-weight:650;line-height:1.7;overflow-wrap:anywhere;word-break:break-all}.custody-address-info .button{min-height:41px;font-size:12px}.custody-address-info .button.is-copied{color:var(--green);border-color:var(--green);background:var(--green-soft)}
.custody-network-warning{font-size:11px;font-weight:650;line-height:1.55;padding:11px 13px;margin:16px 0 8px;border:1px solid var(--brand-line);border-radius:11px;background:var(--brand-soft);color:var(--text-2)}.custody-address-note{font-size:10px;line-height:1.55;color:var(--muted);margin:0}.custody-review-heading{display:flex;align-items:center;gap:10px;margin-bottom:14px}.custody-review-heading>.coin{width:36px;height:36px}.custody-review-heading strong{display:block;font-size:14px}.custody-review-heading span:not(.coin){display:block;font-size:11px;color:var(--muted);margin-top:4px}.custody-flow .custody-review-total{padding:20px;margin:0 0 12px;border:1px solid var(--brand-line);border-radius:16px;background:linear-gradient(135deg,var(--brand-soft),var(--surface-2))}.custody-review-total strong{font-size:29px;overflow-wrap:anywhere}.custody-flow .wallet-review-lines{padding:4px 14px;border:1px solid var(--line);border-radius:12px}.custody-flow .wallet-review-lines .rule-row{padding:10px 0;font-size:12px}.custody-flow .wallet-review-lines strong{max-width:67%;overflow-wrap:anywhere;text-align:right}.custody-complete .wallet-complete-amount{display:block;max-width:100%;overflow-wrap:anywhere}.custody-flow .wallet-reference{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:8px 12px}
.custody-empty{display:flex;flex-direction:column;align-items:center;padding:27px 16px 16px;text-align:center}.custody-empty-icon{display:grid;place-items:center;width:64px;height:64px;border:1px solid var(--brand-line);border-radius:20px;background:linear-gradient(140deg,var(--brand-soft),var(--surface-2));color:var(--brand);margin-bottom:9px}.custody-empty-icon svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.6}.custody-empty h4{font-size:23px;margin:9px 0}.custody-empty p{max-width:320px;color:var(--muted);font-size:12px;line-height:1.7;margin:0 0 20px}.custody-empty .button{min-height:44px}
.custody-link-body{padding:20px 24px}.custody-link-body>label{display:block;font-size:12px;font-weight:650;margin-top:12px}.custody-link-body input[name=address]{font-family:var(--font-mono);font-size:12px;margin-top:7px}.custody-link-proof{border:1px solid var(--line);border-radius:13px;background:var(--surface-2);padding:13px 14px;margin-top:15px}.custody-link-proof label{display:block;font-size:11px;color:var(--text-2);margin-bottom:10px}.custody-link-proof input{margin-top:6px}.custody-link-proof .text-link{font-size:11px}.custody-check{display:flex!important;align-items:flex-start;gap:9px;font-size:11px!important;line-height:1.6;margin:14px 0!important}.custody-check input{width:16px;min-width:16px;margin-top:2px}.custody-link-body>.button{min-height:44px}.custody-link-body .form-error{margin:12px 0 0}
.custody-linked-addresses{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr));gap:12px;margin:18px 0 0}.custody-linked-row{padding:16px;border:1px solid var(--line);border-radius:16px;background:linear-gradient(135deg,var(--surface-2),var(--surface-solid));min-width:0}.custody-linked-head{display:flex;align-items:center;gap:10px}.custody-linked-head>.coin{width:35px;height:35px;flex:none}.custody-linked-head>div{min-width:0;flex:1}.custody-linked-head strong{font-size:13px;line-height:1.4}.custody-linked-head small{display:block;font-size:10px;color:var(--muted);margin-top:3px}.custody-linked-head .tag{font-size:9px;letter-spacing:0;padding:4px 7px}.custody-linked-value{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:7px;border:1px solid var(--line);border-radius:10px;background:var(--surface-solid);padding:10px 11px;margin:15px 0 12px}.custody-linked-value>span{font-size:10px;color:var(--muted)}.custody-linked-value .wallet-copy{font-size:12px}.custody-linked-foot{display:flex;align-items:center;justify-content:space-between;gap:9px;font-size:10px;color:var(--muted)}.custody-linked-foot .text-link{font-size:11px;white-space:nowrap}.custody-linked-pending{padding:9px 10px;border-radius:9px;background:var(--amber-soft);color:var(--amber);margin-bottom:10px}.custody-linked-pending>span{display:block;font-size:10px;line-height:1.5;margin-bottom:5px}.custody-linked-empty{grid-column:1/-1;display:flex;gap:15px;align-items:center;padding:22px 18px;border:1px dashed var(--brand-line);border-radius:15px;background:var(--brand-soft)}.custody-linked-empty>span{display:grid;place-items:center;width:45px;height:45px;flex:none;font-size:22px;border-radius:12px;background:var(--surface-solid);color:var(--brand)}.custody-linked-empty strong{font-size:13px}.custody-linked-empty p{font-size:11px;color:var(--muted);line-height:1.6;margin:5px 0 0}
@media(max-width:540px){dialog.custody-flow{width:calc(100vw - 24px);border-radius:20px}.custody-flow .wallet-head{padding:18px}.custody-flow .wallet-panel,.custody-link-body{padding:17px 18px}.custody-flow .wallet-head h3{font-size:19px}.custody-flow .wallet-head p{font-size:11px}.custody-flow .wallet-steps{padding:12px 18px;gap:8px}.custody-flow .wallet-asset-list{gap:6px}.custody-flow .wallet-asset-card{flex-direction:column;justify-content:center;gap:7px;padding:10px 4px;min-height:66px;text-align:center}.custody-flow .wallet-asset-card small{display:none}.custody-flow .wallet-asset-card .coin{width:26px;height:26px}.wallet-asset-card .custody-choice-check{position:absolute;right:5px;top:5px;font-size:11px}.custody-flow[data-custody-flow=withdraw] .wallet-asset-card{flex-direction:row;justify-content:flex-start;padding:11px 12px;min-height:54px;text-align:left}.custody-flow[data-custody-flow=withdraw] .wallet-asset-card small{display:block}.custody-section-heading .micro{font-size:9px}.custody-network-card{padding:10px 9px;gap:7px;font-size:11px;min-height:53px}.custody-network-card>.coin{width:23px;height:23px}.custody-network-card .custody-choice-check{font-size:11px}.custody-address-grid{grid-template-columns:1fr;gap:14px}.custody-qr-panel{width:232px;max-width:100%;margin:auto;padding:10px}.custody-selected-asset{margin-bottom:7px}.custody-selected-asset>.coin{width:30px;height:30px}.custody-selected-asset strong{font-size:14px}.custody-ready-label{margin-bottom:11px}.custody-address{padding:9px 11px;margin-bottom:8px}.custody-address code{font-size:10px;line-height:1.6}.custody-network-warning{padding:9px 11px;font-size:10px;margin-top:12px}.custody-address-note{font-size:9px}.custody-flow .wallet-actions{margin-top:15px}.custody-balance strong{font-size:11px}.custody-amount-card{padding:12px 13px}.custody-flow .custody-amount input{font-size:23px}.custody-destination-card{padding:11px 12px}.custody-destination-ready{display:none}.custody-empty{padding:24px 6px 15px}.custody-preparing{min-height:280px}.custody-review-total strong{font-size:25px}.custody-flow .form-error{margin:0 18px 12px}}
@media(max-width:350px){.custody-flow .wallet-head{gap:10px}.custody-flow .wallet-head-icon{width:32px;height:32px}.custody-flow .wallet-head h3{font-size:17px}.custody-section-heading .micro{display:none}.custody-network-card{gap:6px;padding:9px 8px;font-size:10px}.custody-network-card>.coin{width:21px;height:21px}.custody-qr-panel{width:212px}.custody-link-proof{padding:11px}.custody-linked-head{gap:8px}}
@media(prefers-reduced-motion:reduce){.custody-spinner{animation-duration:2.5s}.custody-network-card{transition:none}}

/* Separate destination linking/replacement flows; both finish with authentication. */
/* This longer loading label needs a real flex gap, not the shared fixed offset. */
body #custody-link-dialog [data-custody-link-next].request-pending[aria-busy="true"]>.custody-action-label{position:absolute;visibility:hidden}
body #custody-link-dialog [data-custody-link-next].request-pending[aria-busy="true"]::before{position:static;inset:auto;flex:0 0 14px;margin:0}
body #custody-link-dialog [data-custody-link-next].request-pending[aria-busy="true"]::after{position:static;inset:auto;padding:0;flex:0 0 auto;transform:none}
.custody-wallet-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:17px}
.custody-wallet-action{display:flex;align-items:center;gap:12px;min-width:0;padding:17px 15px;border:1px solid var(--brand-line);border-radius:14px;background:linear-gradient(135deg,var(--brand-soft),var(--surface-2));color:var(--text);font:inherit;text-align:left;cursor:pointer}
.custody-wallet-action>span:nth-child(2){flex:1;min-width:0}.custody-wallet-action strong{display:block;font-size:13px;font-weight:750}.custody-wallet-action small{display:block;margin-top:5px;font-size:11px;line-height:1.5;color:var(--muted)}.custody-wallet-action>span:last-child{color:var(--brand)}.custody-wallet-action:disabled{opacity:.5;cursor:default}.custody-wallet-action:focus-visible{outline:2px solid var(--brand);outline-offset:3px}.custody-action-icon{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:11px;background:var(--surface-solid);color:var(--brand);font-size:23px}
.custody-linked-addresses{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.custody-linked-chip{display:inline-flex;align-items:center;gap:7px;padding:7px 9px;border:1px solid var(--line);border-radius:9px;font-size:10px;color:var(--text-2);background:var(--surface-2)}.custody-linked-chip>.coin{width:20px;height:20px}.custody-linked-chip small{font-size:9px;color:var(--green)}.custody-linked-chip small.pending{color:var(--amber)}
.custody-link-flow .wallet-head-icon svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.6}.custody-link-stage{min-width:0;padding:0;margin:0;border:0}.custody-link-stage>label:not(.custody-check){display:block;font-size:12px;font-weight:700;margin:14px 0 7px}.custody-link-stage>input[name=address]{margin:0}.custody-link-flow .form-error{margin:13px 0 0}.custody-link-choices{margin-bottom:14px}
.custody-link-loading{display:flex;align-items:center;justify-content:center;flex-direction:column;min-height:220px;gap:16px;color:var(--muted);font-size:12px}.custody-link-loading .custody-spinner{width:38px;height:38px}.custody-link-loading .custody-spinner:after{margin:10px auto}
.custody-replace-card{align-items:flex-start;gap:10px}.custody-replace-card>span:not(.coin):not(.custody-choice-check){flex:1;min-width:0}.custody-replace-card strong{display:block;font-size:12px}.custody-replace-card code{display:block;font-family:var(--font-mono);font-size:10px;color:var(--text-2);margin-top:5px;overflow-wrap:anywhere}.custody-replace-card small{display:block;margin-top:4px;color:var(--muted);font-size:9px}.custody-replace-card .custody-choice-check{flex:none}
.custody-link-current{border:1px solid var(--line);border-radius:11px;background:var(--surface-2);padding:11px 13px;font-size:12px}.custody-link-current>span{display:block;color:var(--muted);font-size:10px;margin-bottom:5px}.custody-link-current small{display:block;color:var(--amber);font-size:10px;line-height:1.5;margin-top:6px}
.custody-link-summary{border:1px solid var(--brand-line);background:linear-gradient(135deg,var(--brand-soft),var(--surface-2));padding:14px 16px;border-radius:14px}.custody-link-summary>div{display:flex;align-items:center;gap:10px}.custody-link-summary .coin{width:32px;height:32px;flex:none}.custody-link-summary>div>span:not(.coin):not(.tag){flex:1;min-width:0}.custody-link-summary strong{font-size:13px}.custody-link-summary small{display:block;color:var(--muted);font-size:10px;line-height:1.5;margin-top:3px}.custody-link-summary .tag{font-size:9px;white-space:nowrap}.custody-link-summary>code{display:block;font-family:var(--font-mono);font-size:11px;font-weight:650;line-height:1.65;overflow-wrap:anywhere;border-top:1px solid var(--brand-line);padding-top:10px;margin-top:10px}
.custody-link-stage .custody-link-proof{margin-top:13px}.custody-link-proof label:last-of-type{margin-bottom:0}.custody-link-proof .auth-code-control{margin:9px 0 4px}.custody-link-proof .auth-code-digits{max-width:none;gap:8px}.custody-link-proof .auth-code-digits input{height:47px;margin-top:0}.custody-link-proof .text-link{margin-top:10px}.custody-link-proof input[type=password]{font-size:14px}.custody-link-setup{margin-top:13px;padding:14px;border:1px solid var(--amber);border-radius:12px;background:var(--amber-soft)}.custody-link-setup strong{font-size:13px;color:var(--amber)}.custody-link-setup p{font-size:12px;line-height:1.6;margin:8px 0 10px;color:var(--text-2)}
@media(max-width:540px){.custody-wallet-actions{grid-template-columns:1fr;gap:9px}.custody-wallet-action{padding:14px}.custody-link-summary{padding:12px}.custody-link-summary strong{font-size:12px}.custody-link-summary>code{font-size:10px}.custody-link-proof .auth-code-digits{gap:6px}.custody-link-proof .auth-code-digits input{height:43px;font-size:20px!important}.custody-link-flow .wallet-actions .button{padding-left:10px;padding-right:10px;font-size:12px}.custody-replace-card strong{font-size:11px}.custody-link-flow .wallet-head p{line-height:1.5}}

/* Keep withdrawal selection on one screen without clipping form controls. */
#withdraw-dialog{width:720px}
#withdraw-dialog[data-custody-stage="0"] .wallet-panel{padding:14px 20px}
#withdraw-dialog[data-custody-stage="0"] .custody-section-heading{margin-bottom:7px}
#withdraw-dialog[data-custody-stage="0"] .wallet-asset-list{grid-template-columns:repeat(auto-fit,minmax(76px,1fr));gap:6px;margin-bottom:12px}
#withdraw-dialog[data-custody-stage="0"] .wallet-asset-card{flex-direction:row;justify-content:center;padding:8px 6px;gap:6px;min-height:44px}
#withdraw-dialog[data-custody-stage="0"] .wallet-asset-card .coin{width:22px;height:22px}
#withdraw-dialog[data-custody-stage="0"] .wallet-asset-card strong{font-size:12px}
#withdraw-dialog[data-custody-stage="0"] .wallet-asset-card small,#withdraw-dialog[data-custody-stage="0"] .wallet-asset-card .custody-choice-check{display:none}
#withdraw-dialog[data-custody-stage="0"] [data-custody-fields]{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:"network-title amount" "networks amount" "destination destination" "pause pause" "actions actions";column-gap:16px;align-items:start}
#withdraw-dialog[data-custody-stage="0"] [data-custody-fields]>.custody-section-heading{grid-area:network-title;align-self:end}
#withdraw-dialog[data-custody-stage="0"] .custody-networks{grid-area:networks;gap:6px;margin:0 0 10px}
#withdraw-dialog[data-custody-stage="0"] .custody-network-card{min-height:44px;padding:8px;gap:6px;font-size:11px}
#withdraw-dialog[data-custody-stage="0"] .custody-network-card>.coin{width:22px;height:22px}
#withdraw-dialog[data-custody-stage="0"] .custody-amount-card{grid-area:amount;padding:10px 12px;margin:0 0 10px}
#withdraw-dialog[data-custody-stage="0"] .custody-balance{padding-bottom:7px;margin-bottom:7px;gap:8px}
#withdraw-dialog[data-custody-stage="0"] .custody-balance small{margin-bottom:2px;font-size:10px;line-height:1.3}
#withdraw-dialog[data-custody-stage="0"] .custody-balance strong{font-size:11px;line-height:1.4}
#withdraw-dialog[data-custody-stage="0"] .custody-amount-card .wallet-label{margin:0;font-size:10px;line-height:1.4}
#withdraw-dialog[data-custody-stage="0"] .custody-amount{margin-top:3px}
#withdraw-dialog[data-custody-stage="0"] .custody-amount input{font-size:23px;line-height:1.3;padding:0;min-height:33px}
#withdraw-dialog[data-custody-stage="0"] .custody-amount-meta{margin-top:3px;line-height:1.4}
#withdraw-dialog[data-custody-stage="0"] .custody-destination-card{grid-area:destination;padding:10px 12px}
#withdraw-dialog[data-custody-stage="0"] .custody-destination-card .custody-section-heading{margin-bottom:5px}
#withdraw-dialog[data-custody-stage="0"] [data-custody-fields]>.custody-security-note{display:none}
#withdraw-dialog[data-custody-stage="0"] [data-custody-pause]{grid-area:pause;margin:8px 0 0}
#withdraw-dialog .wallet-actions{padding:10px 0 0;margin-top:12px}
#withdraw-dialog[data-custody-stage="0"] .wallet-actions{grid-area:actions;margin-top:10px}
#withdraw-dialog .form-error:empty{display:none}
@media(max-width:540px){
  #withdraw-dialog{width:calc(100vw - 24px)}
  #withdraw-dialog[data-custody-stage="0"] .wallet-panel{padding:12px 14px}
  #withdraw-dialog[data-custody-stage="0"] .wallet-asset-list{display:flex;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;gap:6px;margin-bottom:10px;padding:2px 2px 4px}
  #withdraw-dialog[data-custody-stage="0"] .wallet-asset-card{width:auto;flex:0 0 74px;min-height:42px;padding:7px 5px;gap:5px}
  #withdraw-dialog[data-custody-stage="0"] .wallet-asset-card strong{font-size:11px}
  #withdraw-dialog[data-custody-stage="0"] .wallet-asset-card .coin{width:20px;height:20px}
  #withdraw-dialog[data-custody-stage="0"] [data-custody-fields]{display:block}
  #withdraw-dialog[data-custody-stage="0"] .custody-network-card{padding:7px 8px;min-height:42px}
  #withdraw-dialog[data-custody-stage="0"] .custody-amount-card{padding:9px 11px;margin-bottom:9px}
  #withdraw-dialog[data-custody-stage="0"] .custody-destination-card{padding:9px 11px}
}
@media(max-height:680px) and (max-width:540px){
  #withdraw-dialog[data-custody-stage="0"] .wallet-head{padding-block:12px}
  #withdraw-dialog[data-custody-stage="0"] .wallet-head p{display:none}
  #withdraw-dialog[data-custody-stage="0"] .wallet-steps{padding-block:8px}
  #withdraw-dialog[data-custody-stage="0"] .wallet-panel{padding-block:9px}
  #withdraw-dialog[data-custody-stage="0"] .custody-section-heading{margin-bottom:5px}
  #withdraw-dialog[data-custody-stage="0"] .custody-networks{margin-bottom:7px}
  #withdraw-dialog[data-custody-stage="0"] .wallet-actions{margin-top:7px;padding-top:7px}
}

@media(max-height:600px) and (max-width:540px){
  #withdraw-dialog[data-custody-stage="0"] .wallet-head-icon{display:none}
  #withdraw-dialog[data-custody-stage="0"] .wallet-head{padding-block:10px}
  #withdraw-dialog[data-custody-stage="0"] .wallet-steps{padding-block:6px}
  #withdraw-dialog[data-custody-stage="0"] .wallet-panel{padding-block:6px}
  #withdraw-dialog[data-custody-stage="0"] .custody-networks{display:flex;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;padding:2px 2px 4px}
  #withdraw-dialog[data-custody-stage="0"] .custody-network-card{flex:0 0 142px}
}

#withdraw-dialog[data-custody-stage="0"] .custody-balance>span:first-child{flex:2;min-width:0}
#withdraw-dialog[data-custody-stage="0"] .custody-balance>span:last-child{flex:1;min-width:0}
@media(max-height:600px) and (max-width:540px){
  #withdraw-dialog[data-custody-stage="0"] .wallet-head{padding-block:8px}
  #withdraw-dialog[data-custody-stage="0"] .wallet-panel{padding-block:4px}
  #withdraw-dialog[data-custody-stage="0"] .wallet-actions{margin-top:6px;padding-top:6px}
}

/* Center the deposit identity and address within their existing cards. */
#deposit-dialog[data-custody-stage="1"] .custody-address-info{text-align:center}
#deposit-dialog[data-custody-stage="1"] .custody-selected-asset{flex-direction:column;justify-content:center;text-align:center}
#deposit-dialog[data-custody-stage="1"] .custody-selected-asset>div{min-width:0}
#deposit-dialog[data-custody-stage="1"] .custody-ready-label{justify-content:center}
#deposit-dialog[data-custody-stage="1"] .custody-address-info .wallet-label,
#deposit-dialog[data-custody-stage="1"] .custody-address code{text-align:center}

/* Keep the mobile address slide in view without hiding warnings or controls. */
@media(max-width:540px){
  #deposit-dialog[data-custody-stage="1"] .wallet-head{padding-block:14px}
  #deposit-dialog[data-custody-stage="1"] .wallet-steps{padding-block:10px}
  #deposit-dialog[data-custody-stage="1"] .wallet-panel{padding:14px 16px}
  #deposit-dialog[data-custody-stage="1"] .custody-address-grid{
    grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);
    grid-template-areas:"qr asset" "qr ready" "label label" "address address" "copy copy";
    gap:7px 12px;align-items:center;
  }
  #deposit-dialog[data-custody-stage="1"] .custody-address-info{display:contents}
  #deposit-dialog[data-custody-stage="1"] .custody-qr-panel{grid-area:qr;width:100%;max-width:180px;padding:8px;margin:0}
  #deposit-dialog[data-custody-stage="1"] .custody-qr{padding:6px;border-radius:12px}
  #deposit-dialog[data-custody-stage="1"] .custody-qr-logo{width:28px;height:28px;border-width:3px}
  #deposit-dialog[data-custody-stage="1"] .custody-qr-logo .coin{width:22px;height:22px}
  #deposit-dialog[data-custody-stage="1"] .custody-qr-caption{font-size:9px;margin-top:6px}
  #deposit-dialog[data-custody-stage="1"] .custody-selected-asset{grid-area:asset;align-self:end;justify-self:center;flex-wrap:nowrap;gap:7px;margin:0;min-width:0}
  #deposit-dialog[data-custody-stage="1"] .custody-selected-asset>div{min-width:0}
  #deposit-dialog[data-custody-stage="1"] .custody-selected-asset strong span{display:block;margin-top:2px}
  #deposit-dialog[data-custody-stage="1"] .custody-selected-asset small{font-size:10px}
  #deposit-dialog[data-custody-stage="1"] .custody-ready-label{grid-area:ready;align-self:start;justify-self:center;margin:0;font-size:10px;gap:5px}
  #deposit-dialog[data-custody-stage="1"] .custody-address-info .wallet-label{grid-area:label;margin:2px 0 0}
  #deposit-dialog[data-custody-stage="1"] .custody-address{grid-area:address;padding:8px 10px;margin:0}
  #deposit-dialog[data-custody-stage="1"] [data-custody-copy]{grid-area:copy;min-height:40px}
  #deposit-dialog[data-custody-stage="1"] .custody-network-warning{margin:10px 0 7px;padding:8px 10px;line-height:1.4}
  #deposit-dialog[data-custody-stage="1"] .custody-address-note{font-size:10px;line-height:1.4}
  #deposit-dialog[data-custody-stage="1"] .wallet-actions{margin-top:10px;padding:10px 0 0}
}
@media(max-width:540px) and (max-height:650px){
  #deposit-dialog[data-custody-stage="1"] .wallet-head{padding-block:12px}
  #deposit-dialog[data-custody-stage="1"] .wallet-steps{padding-block:8px}
  #deposit-dialog[data-custody-stage="1"] .wallet-panel{padding-block:12px}
  #deposit-dialog[data-custody-stage="1"] .custody-address-grid{row-gap:6px}
  #deposit-dialog[data-custody-stage="1"] .custody-qr-caption{display:none}
  #deposit-dialog[data-custody-stage="1"] .custody-address-note{font-size:9px}
}
@media(min-width:541px) and (max-width:900px) and (max-height:500px){
  #deposit-dialog[data-custody-stage="1"] .wallet-head{padding:10px 16px}
  #deposit-dialog[data-custody-stage="1"] .wallet-head p{display:none}
  #deposit-dialog[data-custody-stage="1"] .wallet-steps{padding:8px 16px}
  #deposit-dialog[data-custody-stage="1"] .wallet-panel{padding:10px 16px}
  #deposit-dialog[data-custody-stage="1"] [data-custody-ready]{display:grid;grid-template-columns:140px minmax(0,1fr);grid-template-areas:"qr info" "qr warning" "qr note";gap:6px 12px}
  #deposit-dialog[data-custody-stage="1"] .custody-address-grid{display:contents}
  #deposit-dialog[data-custody-stage="1"] .custody-qr-panel{grid-area:qr;width:140px;padding:7px;align-self:center}
  #deposit-dialog[data-custody-stage="1"] .custody-qr{padding:6px}
  #deposit-dialog[data-custody-stage="1"] .custody-qr-caption{display:none}
  #deposit-dialog[data-custody-stage="1"] .custody-qr-logo{width:28px;height:28px;border-width:3px}
  #deposit-dialog[data-custody-stage="1"] .custody-qr-logo .coin{width:22px;height:22px}
  #deposit-dialog[data-custody-stage="1"] .custody-address-info{grid-area:info;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:5px 9px}
  #deposit-dialog[data-custody-stage="1"] .custody-selected-asset{flex-direction:row;margin:0}
  #deposit-dialog[data-custody-stage="1"] .custody-selected-asset>.coin{width:26px;height:26px}
  #deposit-dialog[data-custody-stage="1"] .custody-selected-asset strong{font-size:13px}
  #deposit-dialog[data-custody-stage="1"] .custody-selected-asset small{font-size:10px;margin-top:2px}
  #deposit-dialog[data-custody-stage="1"] .custody-ready-label{margin:0}
  #deposit-dialog[data-custody-stage="1"] .wallet-label{grid-column:1/-1;margin:2px 0 0}
  #deposit-dialog[data-custody-stage="1"] .custody-address{padding:7px 9px;margin:0}
  #deposit-dialog[data-custody-stage="1"] [data-custody-copy]{min-height:38px;padding:8px 10px;font-size:11px}
  #deposit-dialog[data-custody-stage="1"] .custody-network-warning{grid-area:warning;font-size:10px;margin:0;padding:6px 8px}
  #deposit-dialog[data-custody-stage="1"] .custody-address-note{grid-area:note;font-size:9px;line-height:1.4}
  #deposit-dialog[data-custody-stage="1"] .wallet-actions{margin-top:8px;padding:8px 0 0}
  #deposit-dialog[data-custody-stage="1"] .wallet-actions .button{min-height:38px}
}
/* Preserve the full-size design; fit wallet authentication on short phones. */
@media(max-width:600px) and (max-height:700px){
 #custody-link-dialog:has([data-custody-link-stage="1"]:not([hidden])){max-height:calc(100dvh - 24px)}
 #custody-link-dialog:has([data-custody-link-stage="1"]:not([hidden])) .wallet-head{padding-block:10px}
 #custody-link-dialog:has([data-custody-link-stage="1"]:not([hidden])) .wallet-steps{padding-block:8px}
 #custody-link-dialog:has([data-custody-link-stage="1"]:not([hidden])) .custody-link-body{padding:10px 14px}
 #custody-link-dialog [data-custody-link-stage="1"] .custody-link-summary{padding:8px}
 #custody-link-dialog [data-custody-link-stage="1"] .custody-link-summary>code{padding-top:6px;margin-top:6px}
 #custody-link-dialog [data-custody-link-auth-hint]{margin-top:8px}
 #custody-link-dialog [data-custody-link-stage="1"] .custody-link-proof{padding:8px;margin-top:8px}
 #custody-link-dialog [data-custody-link-stage="1"] .custody-link-proof label{margin:0 0 8px}
 #custody-link-dialog [data-custody-link-stage="1"] .custody-link-proof label:last-of-type{margin-bottom:0}
 #custody-link-dialog [data-custody-link-stage="1"] .auth-code-control{margin:6px 0 0}
 #custody-link-dialog [data-custody-link-stage="1"] .wallet-actions{margin-top:10px;padding-top:10px;padding-bottom:0}
 #custody-link-dialog .form-error:empty{display:none}
}
@media(max-width:350px) and (max-height:700px){
 #custody-link-dialog [data-custody-link-stage="1"] .custody-link-summary>div{display:grid;grid-template-columns:28px minmax(0,1fr);gap:4px 8px}
 #custody-link-dialog [data-custody-link-stage="1"] .custody-link-summary .coin{grid-column:1;grid-row:1 / span 2;width:28px;height:28px}
 #custody-link-dialog [data-custody-link-stage="1"] .custody-link-summary>div>span:not(.coin):not(.tag){grid-column:2;grid-row:1}
 #custody-link-dialog [data-custody-link-stage="1"] .custody-link-summary .tag{grid-column:2;grid-row:2;justify-self:start}
 #custody-link-dialog [data-custody-link-stage="1"] .custody-link-summary small{display:none}
}
@media(max-width:350px) and (max-height:600px){
 #custody-link-dialog:has([data-custody-link-stage="1"]:not([hidden])) .wallet-head{padding-block:8px}
 #custody-link-dialog:has([data-custody-link-stage="1"]:not([hidden])) .wallet-steps{padding-block:6px}
 #custody-link-dialog:has([data-custody-link-stage="1"]:not([hidden])) .custody-link-body{padding-block:8px}
}
