/* Transfer amount/account/keypad composition, adapted for buying and selling. */
.ld-trade-content{display:grid;grid-template-columns:minmax(0,1fr);gap:var(--ld-space-lg);padding:calc(var(--ld-top-occlusion) + var(--ld-space-lg)) var(--ld-screen-gutter) var(--ld-scroll-end)}
.ld-trade-content>*{min-width:0}
.ld-trade .ld-managed-header{padding-bottom:var(--ld-space-md)}
.ld-trade .ld-detail-toolbar{justify-content:space-between}
.ld-trade[data-phase=entry]{background:radial-gradient(ellipse at 0 0,var(--ld-sky-100),transparent 40%),radial-gradient(ellipse at 100% 0,var(--ld-lime-100-50),transparent 30%),var(--ld-surface)}
.ld-trade[data-phase=entry] .ld-managed-header{background:linear-gradient(110deg,color-mix(in srgb,var(--ld-sky-100) 50%,var(--ld-surface)),var(--ld-surface));border-bottom:0}
.ld-trade-amount{container-type:inline-size;display:grid;gap:var(--ld-space-sm)}
.ld-amount-input{display:flex;align-items:baseline;min-width:0;font-size:clamp(32px,calc((100cqw - 72px) / var(--ld-amount-length,4) * 1.55),80px);letter-spacing:-.03em;line-height:1}
.lucid .ld-amount-input input{font-size:inherit;width:100%;min-width:0;padding:0;border:0;background:transparent;letter-spacing:inherit;line-height:1;caret-color:var(--ld-black-16)}
.ld-amount-input input::placeholder{color:var(--ld-text);opacity:1}
.lucid .ld-unit-choice{display:flex;align-items:center;gap:var(--ld-space-sm);font-size:var(--ld-type-small);white-space:nowrap;padding:12px 0 12px 8px}
.ld-amount-meta{display:flex;justify-content:space-between;gap:var(--ld-space-sm);align-items:center}
.lucid .ld-amount-meta button{font-size:var(--ld-type-small);color:var(--ld-muted);padding:8px}
.ld-trade-muted{font-size:var(--ld-type-small);color:var(--ld-muted);line-height:1.5}
.ld-trade-error{color:var(--ld-loss);font-size:var(--ld-type-small);line-height:1.4}
.ld-trade-error:empty{display:none}
.ld-trade-route{position:relative;display:grid;gap:var(--ld-space-sm)}
.lucid .ld-transfer-row{width:100%;min-height:88px;display:flex;align-items:center;gap:12px;padding:20px 16px;background:var(--ld-surface);border:1px solid var(--ld-border);border-radius:var(--ld-radius-card);box-shadow:var(--ld-shadow-card);text-align:left}
.ld-transfer-tile,.ld-transfer-row>.ld-tile{width:40px;height:40px;flex:0 0 40px;display:grid;place-items:center;border-radius:var(--ld-radius-tile);background:var(--ld-neutral-25)}
.ld-transfer-tile img{max-width:20px;max-height:20px}
.ld-transfer-row .ld-security-logo{max-width:24px;max-height:24px}
.ld-transfer-copy{min-width:0;flex:1;display:grid;gap:var(--ld-space-xs)}
.ld-transfer-copy strong{font-size:var(--ld-type-small);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ld-transfer-copy strong .ld-choice-chevron{display:inline-block;width:7px;height:7px;margin:0 0 3px 4px}
.ld-transfer-copy small,.ld-transfer-values small{font-size:var(--ld-type-caption);color:var(--ld-muted);white-space:nowrap}
.ld-transfer-values{display:grid;gap:var(--ld-space-xs);text-align:right;flex-shrink:0;font-variant-numeric:tabular-nums}
.ld-transfer-values strong{font-size:var(--ld-type-small);font-weight:500}
.ld-transfer-values small:empty{display:none}
.lucid .ld-trade-direction{position:absolute;z-index:1;left:calc(50% - 18px);top:calc(50% - 18px);width:36px;height:36px;border:1px solid var(--ld-border);border-radius:50%;display:grid;place-items:center;background:var(--ld-surface);box-shadow:var(--ld-shadow-control)}
.ld-trade-direction img{width:18px;height:18px;transform:rotate(90deg)}
.ld-trade-stop{display:grid;gap:var(--ld-space-sm)}
.ld-trade-stop .ld-setting-row{padding:0;min-height:40px}
.ld-trade-stop .ld-setting-row>span,.ld-trade-stop>label{font-size:var(--ld-type-small)}
.ld-stop-input{display:flex;align-items:center;gap:var(--ld-space-sm);padding:var(--ld-space-md);background:var(--ld-neutral-25);border-radius:var(--ld-radius-tile)}
.ld-stop-input input{width:100%;min-width:0;background:none;border:0;padding:0}
.ld-trade-keypad-panel{position:absolute;z-index:3;bottom:var(--ld-safe-bottom);left:var(--ld-screen-gutter);right:var(--ld-screen-gutter);padding:8px 16px 16px;border:1px solid var(--ld-border);border-radius:var(--ld-radius-feature);background:var(--ld-surface);box-shadow:var(--ld-shadow-dock)}
.ld-trade-keypad{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin-bottom:var(--ld-space-sm)}
.lucid .ld-trade-keypad button{min-height:48px;font-size:var(--ld-type-title);text-align:center;border-radius:var(--ld-radius-tile)}
.lucid .ld-trade-keypad button:hover{background:var(--ld-neutral-25)}
.lucid .ld-keypad-dismiss{display:flex;justify-content:center;align-items:center;width:48px;height:24px;margin:-4px auto 0;color:var(--ld-muted)}
.ld-keypad-dismiss .ld-choice-chevron{width:7px;height:7px}
.ld-trade-actions{display:grid;grid-template-columns:1fr;gap:var(--ld-space-sm);width:100%;pointer-events:auto}
.ld-trade-actions.ld-paired{grid-template-columns:1fr 1fr}
.lucid .ld-trade-actions button{min-height:48px;padding:12px 16px;border-radius:var(--ld-radius-card);text-align:center}
.lucid .ld-trade-actions .ld-action-secondary{background:var(--ld-black-8)}
.lucid .ld-trade-actions button:disabled{background:var(--ld-neutral-50);color:var(--ld-black-32);opacity:1}
.ld-trade .ld-dock-wrap{gap:var(--ld-space-md)}
.ld-trade-intro{display:grid;gap:var(--ld-space-xl);justify-items:start}
.ld-trade-intro h1{font-size:var(--ld-type-heading);line-height:1.4}
.ld-trade-card{padding:var(--ld-card-padding);display:grid;gap:var(--ld-space-md)}
.ld-trade-card .ld-information-rows{font-size:var(--ld-type-small);line-height:1.4}
.ld-trade-card .ld-information-rows dd{overflow-wrap:anywhere}
.ld-trade-success{display:grid;justify-items:center;text-align:center;gap:var(--ld-space-md);padding:var(--ld-space-lg) 0}
.ld-trade-success h1{font-size:40px;overflow-wrap:anywhere;max-width:100%}
.ld-trade-success-icon>.ld-tile{width:64px;height:64px}
.ld-trade[data-phase=submitted]{background:linear-gradient(180deg,var(--ld-surface) 20%,var(--ld-sky-100) 52%,var(--ld-lime-100) 78%,var(--ld-surface))}
.ld-trade[data-phase=submitted] .ld-card{background:var(--ld-white-50)}
.ld-trade .ld-inline-pill{white-space:nowrap;padding:8px 12px}
.ld-trade-footer .ld-brief-composer{margin:16px 1px 0}
.ld-trade-footer .ld-trade-actions{gap:16px}
.ld-account-sheet{padding:var(--ld-space-lg)}
.lucid .ld-account-option{width:100%;display:grid;gap:var(--ld-space-xs);padding:16px;border-radius:var(--ld-radius-tile);min-height:48px}
.ld-account-option[aria-pressed=true]{background:var(--ld-neutral-25)}
.ld-account-option small{color:var(--ld-muted);font-size:var(--ld-type-caption)}
@media(max-width:374px){.ld-trade-card{padding:var(--ld-card-padding-compact)}.lucid .ld-transfer-row{gap:8px;padding:16px 12px}.ld-transfer-tile,.ld-transfer-row>.ld-tile{width:32px;height:32px;flex-basis:32px}.ld-transfer-values small{max-width:100px;overflow:hidden;text-overflow:ellipsis}}

.ld-trade:not([data-keyboard]) .ld-amount-input input:focus,
.ld-trade:not([data-keyboard]) .ld-stop-input input:focus{outline:none}

/* Proposed Trade composition: agency Intelligence gradient and order-type control. */
.ld-trade:not(.ld-transfer){--ld-trade-wash:linear-gradient(180deg,transparent 0%,var(--ld-surface) 100%),url('../assets/transfer/trade-gradient.svg');background-image:var(--ld-trade-wash);background-size:100% 500px,100% 500px;background-position:0 0,0 0;background-repeat:no-repeat;background-color:var(--ld-surface)}
.ld-trade:not(.ld-transfer) .ld-managed-header{background-image:var(--ld-trade-wash);background-size:100% 500px,100% 500px;background-position:0 0,0 0;background-repeat:no-repeat;background-color:var(--ld-surface);border:0}
.ld-trade-security{display:grid;gap:8px}
.ld-trade-security>div:first-child{display:flex;gap:12px;align-items:center}
.ld-trade-security .ld-tile{width:44px;height:44px;flex:none}
.ld-trade-security small{font-size:var(--ld-type-small);color:var(--ld-muted)}
.ld-trade-security h1{font-size:var(--ld-type-title);line-height:1.2;margin-top:4px}
.ld-trade-sides{display:flex;gap:8px}
.lucid .ld-trade-sides .ld-secondary{width:80px;min-width:80px;flex:0 0 80px;font-size:var(--ld-type-body);font-weight:500}
.ld-trade:not(.ld-transfer) .ld-trade-content{gap:16px}
.ld-trade-amount .ld-trade-sides{margin-top:var(--ld-space-sm);margin-bottom:var(--ld-space-sm)}
.ld-agent-order-options{position:fixed;inset:auto;margin:0;padding:8px;border:1px solid var(--ld-border);border-radius:var(--ld-radius-card);background:var(--ld-surface);color:var(--ld-text);box-shadow:var(--ld-shadow-dock)}
.lucid .ld-agent-order-options button{display:flex;justify-content:space-between;align-items:center;width:100%;min-height:48px;padding:12px 16px;border-radius:var(--ld-radius-tile);text-align:left;font-size:var(--ld-type-small)}
.ld-agent-order-options button:hover{background:var(--ld-neutral-25)}
.ld-trade-input-footer{position:absolute;z-index:3;bottom:var(--ld-safe-bottom);left:var(--ld-screen-gutter);right:var(--ld-screen-gutter);display:grid;gap:var(--ld-space-sm);background:linear-gradient(transparent,var(--ld-surface) 44px)}
.ld-trade-input-footer .ld-trade-keypad-panel{position:relative;inset:auto}
.lucid .ld-trade-order-type{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;padding:8px 0;font-size:var(--ld-type-small);color:var(--ld-muted);text-align:center}
.ld-trade-order-type strong{color:var(--ld-text);font-weight:500}
.ld-trade-order-type .ld-choice-chevron{width:6px;height:6px;flex:none}
.ld-trade-order-type small{font-size:inherit}
.ld-trade [data-dock-action]{pointer-events:auto;background:var(--ld-white-64);border-radius:var(--ld-radius-card);backdrop-filter:blur(20px)}

.ld-trade:not(.ld-transfer) .ld-trade-content{padding-top:calc(var(--ld-top-occlusion) + var(--ld-space-md))}
#trade-question{display:grid;gap:16px}
#trade-question label{font-size:var(--ld-type-small);color:var(--ld-muted)}
#trade-question textarea{width:100%;min-height:112px;resize:vertical;padding:16px;border:1px solid var(--ld-border);border-radius:var(--ld-radius-tile);font:inherit;background:var(--ld-neutral-25);color:var(--ld-text)}

.ld-trade[data-phase=entry]:not(.ld-transfer) .ld-trade-content{padding-top:calc(var(--ld-top-occlusion) + var(--ld-space-xl) + var(--ld-space-md))}
.ld-agent-order-options small{font-size:var(--ld-type-caption);color:var(--ld-muted)}
.ld-agent-order-options [aria-pressed=true]{background:var(--ld-neutral-25)}
.ld-trade-amount .ld-amount-meta{margin-top:var(--ld-space-sm)}

.ld-agent-order-options .ld-context-chip{font-size:var(--ld-type-caption);flex:none;margin-left:var(--ld-space-sm)}
.ld-agent-order-options .ld-context-label{padding:4px 8px;gap:4px}
.ld-agent-order-options .ld-context-halo{opacity:.4;filter:blur(4px)}
.ld-trade-limit .ld-stop-input{background:var(--ld-white-64);border:1px solid var(--ld-border)}

/* Agency approval video 2e103b0b…: warm wash rises behind confirmation,
   holds briefly, then recedes. Timing/easing are an interactive web adaptation. */
:is(#trade,#transfer)[data-phase=submitted],:is(#trade,#transfer)[data-phase=submitted] .ld-managed-header{background:var(--ld-surface)}
:is(#trade,#transfer)[data-phase=submitted]::before{content:'';position:absolute;inset:0;pointer-events:none;background-image:var(--ld-confirm-wash,url('../assets/transfer/trade-gradient.svg'));background-position:center;background-size:100% 100%;background-repeat:no-repeat;mask-image:linear-gradient(transparent 12%,black 38%,black 58%,transparent 82%);opacity:0;animation:ld-trade-confirm-wash 5700ms ease-in-out both}
:is(#trade,#transfer)[data-phase=submitted] .ld-scroll{z-index:1}
:is(#trade,#transfer)[data-phase=submitted] .ld-trade-success{min-height:280px;align-content:center;padding:var(--ld-space-xl) 0}
:is(#trade,#transfer)[data-phase=submitted] .ld-trade-success-icon{animation:ld-trade-confirm-enter 500ms cubic-bezier(.22,1,.36,1) both}
:is(#trade,#transfer)[data-phase=submitted] .ld-trade-success> :not(.ld-trade-success-icon){animation:ld-trade-confirm-enter 500ms 100ms cubic-bezier(.22,1,.36,1) both}
@keyframes ld-trade-confirm-wash{0%{opacity:0;transform:translateY(55%)}20%,55%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(55%)}}
@keyframes ld-trade-confirm-enter{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){:is(#trade,#transfer)[data-phase=submitted]::before,:is(#trade,#transfer)[data-phase=submitted] .ld-trade-success>*{animation:none}}
