/* Tukar uses the same teak and brass as the game's social panels. */
.trade-window,.trade-toast {
 --grain:url('/play/art/teak-grain-v1.webp');
 --ivory:#fff1d1;--muted:#e1cba9;--brass:#ddb572;--edge:#78532d;
 color:var(--ivory);font:15px/1.35 system-ui,sans-serif;
 background-color:#432b1d;background-image:linear-gradient(110deg,#27150c77,#2a160dc9),var(--grain);background-size:auto,410px;
 border:2px solid #25170d;border-radius:9px;
 box-shadow:inset 0 0 0 1px var(--brass),inset 0 0 0 5px #27170f55,0 12px 38px #10090399;
}
.trade-window {
 position:fixed;z-index:960;left:50%;top:50%;transform:translate(-50%,-50%);
 width:min(590px,calc(100vw - 28px));max-height:88vh;max-height:88dvh;
 box-sizing:border-box;padding:18px 20px 14px;overflow:auto;overscroll-behavior:contain;
 scrollbar-width:thin;scrollbar-color:#ac8759 #372217;box-shadow:inset 0 0 0 1px var(--brass),0 15px 50px #160b0799,0 0 0 100vmax #140d0873;
}
.trade-window[data-phase="open"]{width:min(884px,calc(100vw - 28px))}
.trade-head,.trade-pack-head,.trade-footer,.trade-actions,.trade-people li{display:flex;align-items:center;gap:10px}
.trade-head{justify-content:space-between;border-bottom:1px solid #cfa26378;padding:0 0 12px;margin-bottom:14px}
.trade-window h2,.trade-window h3,.trade-window p,.trade-toast p{margin:0}
.trade-window h2,.trade-window h3{color:var(--ivory);font-family:Georgia,serif;font-weight:700}
.trade-window h2{font-size:clamp(22px,3vw,30px);line-height:1.12;overflow-wrap:anywhere}
.trade-window h3{font-size:19px;line-height:1.2}
.trade-timer{flex:none;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.trade-workspace{display:grid;grid-template-columns:minmax(0,1.58fr) minmax(245px,1fr);gap:12px;align-items:start}
.trade-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.trade-column,.trade-pack{min-width:0;box-sizing:border-box;border:1px solid #ac8556;border-radius:5px;background:#21150fca;box-shadow:inset 0 2px 6px #10080699,0 1px 0 #ffe2aa33}
.trade-column{min-height:142px;padding:10px;overflow-wrap:anywhere}
.trade-column h3{padding-bottom:8px;margin-bottom:8px;border-bottom:1px solid #d0a26955}
.trade-column:first-child h3{color:#f3ce88}
.trade-empty,.trade-hint,.trade-confirmed,.trade-status{color:var(--muted);font-size:13px}
.trade-column .trade-confirmed{margin-top:12px}
.trade-confirmed[data-on="true"]{color:#c3e5a0}
.trade-window .trade-changed,.trade-window .trade-status[data-error="true"]{color:#ffd091}
.trade-chip{display:grid;align-items:center;grid-template-columns:18px minmax(0,1fr) auto;gap:5px;box-sizing:border-box;padding:3px 5px;min-height:32px;background:#eddcbb;color:#342619}
.trade-chip+.trade-chip{border-top:1px solid #bca17b}
.trade-chip:has(.trade-remove){grid-template-columns:18px minmax(0,1fr) auto 24px;padding-right:0}
.trade-line-detail{display:grid;min-width:0;line-height:1.15}
.trade-line-detail strong,.trade-chip-qty{font-size:13px}.trade-line-detail small{font-size:11px;color:#614529}
.trade-chip-qty{font-variant-numeric:tabular-nums;white-space:nowrap}
.trade-window .trade-art{display:inline-grid;place-items:center;flex:none;width:26px;height:26px}
.trade-chip .trade-art{width:18px;height:18px}
.trade-art svg,.trade-art img{width:100%;height:100%;object-fit:contain;display:block}
.trade-window button,.trade-toast button {
 min-height:44px;min-width:44px;padding:7px 13px;box-sizing:border-box;
 border:1px solid #b38c5b;border-radius:4px;background:#503420;color:#fff1d1;cursor:pointer;font:600 14px/1.2 system-ui,sans-serif;
}
.trade-window .trade-primary,.trade-toast .trade-primary{color:#291b0f;background:linear-gradient(#efcf8c,#cea363);border-color:#fde4a8;box-shadow:inset 0 -2px 0 #a4773f}
.trade-window button:disabled,.trade-toast button:disabled{opacity:.55;cursor:default}
.trade-window button:focus-visible,.trade-toast button:focus-visible{outline:3px solid #ffe089;outline-offset:2px;z-index:1}
@media(hover:hover){.trade-window button:enabled:hover,.trade-toast button:enabled:hover{filter:brightness(1.15);border-color:#ffe0a2}}
.trade-window button:enabled:active,.trade-toast button:enabled:active{transform:translateY(1px)}
.trade-chip .trade-remove{align-self:stretch;min-width:24px;min-height:24px;background:transparent;color:#593419;border:0;border-left:1px solid #bca17b;border-radius:0;padding:0;font-size:16px}
.trade-window[data-phase="review"]>.trade-confirmed[data-on="true"]{display:flex;align-items:center;gap:6px;font-weight:700}
.trade-window[data-phase="review"]>.trade-confirmed[data-on="true"]::before{content:"✓";font-size:16px}
@media(pointer:coarse){.trade-chip:has(.trade-remove){grid-template-columns:18px minmax(0,1fr) auto 44px;padding-block:0}.trade-chip .trade-remove{min-height:44px;min-width:44px}}
.trade-pack{padding:10px;background-color:#372519e8}
.trade-pack-head{margin-bottom:10px}
.trade-pack-head .trade-art{width:23px;height:23px}
.trade-pack-head>span:last-child{margin-left:auto;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.trade-slots{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px}
.trade-slots .trade-slot{position:relative;min-width:0;min-height:46px;padding:3px 1px;display:grid;justify-items:center;align-content:center;gap:1px;border-radius:3px;border:1px solid #ab8656;background:linear-gradient(#f0dcb7,#ceb388);color:#332416}
.trade-slot.empty{background:#201610a8;border-color:#8a673c88;box-shadow:inset 0 2px 4px #140d0866}
.trade-slot .trade-slot-qty{position:absolute;top:1px;right:2px;min-width:12px;padding:0 2px;background:#372316;color:#fff2d1;border-radius:2px;font:700 10px/1.25 system-ui}
.trade-slot .trade-slot-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:600 10px/1.15 system-ui}
.trade-pack .trade-wallet{display:flex;align-items:center;gap:8px;width:100%;margin-top:8px;color:#ffe2a3;background:#302018;border-color:#977246}
.trade-wallet strong{margin-left:auto}.trade-wallet-add{font-size:20px;color:var(--brass)}
.trade-footer{position:sticky;bottom:-14px;z-index:2;justify-content:space-between;flex-wrap:wrap;padding:10px 0 5px;margin-top:12px;border-top:1px solid #b9915f;background:#392419}
.trade-footer .trade-status{flex:1 1 140px;padding:0 8px}.trade-status:empty{display:none}
.trade-actions{margin-left:auto;justify-content:flex-end;flex-wrap:wrap;gap:6px}
.trade-people{list-style:none;padding:0}.trade-people li{justify-content:space-between}
.trade-window>.trade-hint,.trade-window>.trade-confirmed,.trade-window>.trade-changed{margin:10px 0}
.trade-toast{position:fixed;z-index:970;left:50%;bottom:calc(16px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:min(420px,calc(100vw - 24px));box-sizing:border-box;padding:14px 16px}
.trade-toast .trade-actions{margin-top:8px}
@media(max-width:680px){
 .trade-window,.trade-window[data-phase="open"]{width:100%;left:0;top:auto;right:0;bottom:0;transform:none;max-height:92vh;max-height:92dvh;padding:14px 12px max(8px,env(safe-area-inset-bottom));border-radius:10px 10px 0 0}
 .trade-head{margin-bottom:10px;padding-bottom:9px}.trade-workspace{grid-template-columns:1fr;gap:8px}
 .trade-column{padding:7px;min-height:88px}.trade-column h3{font-size:17px}
 .trade-pack{padding:7px 9px}.trade-pack-head{margin-bottom:5px}
 .trade-chip{gap:3px;padding-inline:3px}
 .trade-slots .trade-slot{min-height:44px}.trade-footer{bottom:0}
}

/* Keep long recipe and fish lists reachable at the regular Coast dialog size. */
.coast-online-skills #dlgChoices {
 max-height: min(30dvh, 220px);
 overflow-y: auto;
 overscroll-behavior: contain;
}
.coast-online-skills #dlgChoices > button { flex-shrink: 0; }
