/* Scoped merchant desk: original-game hierarchy, existing site shell. */
body[data-page=encyclopedia] .merchant-desk{--desk-text:#e9dfce;--desk-muted:#b5ab9c;--desk-gold:#e7bc72;display:grid;grid-template-columns:minmax(260px,.9fr) minmax(0,1.35fr);gap:22px;align-items:start;color:var(--desk-text);font-size:14px;line-height:1.7}
body[data-page=encyclopedia] .merchant-desk :is(h1,h2,h3,p){margin-top:0}
body[data-page=encyclopedia] .merchant-desk :is(h1,h2,h3,strong){color:var(--desk-text)}
body[data-page=encyclopedia] .merchant-desk :is(a,summary){color:var(--desk-gold)}
body[data-page=encyclopedia] .merchant-desk :is(small,.merchant-footnote,.merchant-version){color:var(--desk-muted)}
.merchant-selector,.merchant-right{min-width:0;background:radial-gradient(ellipse at top,#393633 0,#242323 65%);border:1px solid #817464;box-shadow:inset 0 0 0 3px #252323,inset 0 0 0 4px #5b5248,0 6px 24px #0003;border-radius:3px}
.merchant-selector{position:sticky;top:16px;padding:16px;display:flex;flex-direction:column;min-height:min(620px,calc(100dvh - 32px));max-height:calc(100dvh - 32px)}
.merchant-selector>:is(.merchant-tabs,.merchant-selector-head){flex:none}
.merchant-tabs{display:flex;justify-content:center;gap:10px;border-bottom:1px solid #6c6151;padding:1px 0 14px}
.merchant-tabs a{padding:7px 10px;text-decoration:none;white-space:nowrap;font-size:16px;font-weight:700;border-bottom:2px solid transparent;color:#aca49a!important}
.merchant-tabs a[aria-current=page]{color:#ffd494!important;border-color:#e7bc72;text-shadow:0 0 15px #e0a94144}
.merchant-tabs small{font-size:10px;margin-left:5px;color:inherit!important}
.merchant-selector-head{padding:18px 1px 12px;text-align:center}
.merchant-selector-head h2{font-size:18px;color:#e7bc72!important;margin-bottom:12px}
.merchant-selector-head p{font-size:12px;margin:7px 0 0;color:#b5ab9c}
body[data-page=encyclopedia] .merchant-desk .merchant-search input{background:#1d1e1f;color:#e9dfce;border:1px solid #625b52;width:100%;min-height:42px;padding:9px 12px;border-radius:3px;font-size:13px}
.merchant-choices{min-height:0;flex:1;overflow:auto;scrollbar-color:#82725a #242323;scrollbar-width:thin;padding:3px;scroll-padding:8px}
.merchant-chapter{margin-bottom:22px}
.merchant-chapter h3{font-size:15px;padding:6px 10px;margin:0 0 7px;color:#edc477!important;background:linear-gradient(90deg,#80633255,transparent);border-left:2px solid #ad8849}
.merchant-quest-choice{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 10px;border:1px solid transparent;border-left:2px solid #6b6050;text-decoration:none!important;position:relative}
.merchant-quest-choice[aria-current=true]{background:linear-gradient(90deg,#a8864933,#a8864910);border-color:#9b804e;border-left:3px solid #edc477}
.merchant-quest-choice:hover{background:#b9924620}
.merchant-quest-choice>span:first-child{min-width:0}
.merchant-quest-choice strong{display:block;font-size:15px;font-weight:600;color:#e6c385!important}
.merchant-quest-choice small{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;line-height:1.6;margin-top:3px}
.merchant-status{width:27px;height:27px;flex:none;border:1px solid #7c715d;border-radius:50%;text-align:center;color:#998a71;line-height:25px}
.merchant-status.done{color:#ffcf57;border-color:#d6aa42;background:#8b651622}
.merchant-right{padding:20px 24px}
.merchant-profile-title{text-align:center;border-bottom:1px solid #776956;margin-bottom:14px;padding-bottom:10px}
.merchant-profile-title>span{font-size:11px;letter-spacing:.15em;color:#b4a58e}
.merchant-profile-title h1{font-family:Georgia,'Noto Serif SC',serif;font-size:27px;line-height:1.4;margin:2px 0 6px}
.merchant-profile-body{display:grid;grid-template-columns:104px minmax(0,1fr);gap:18px;align-items:start;padding-bottom:16px}
.merchant-portrait{border:3px double #a09480;background:#1c1b1b;box-shadow:0 2px 8px #0005}
body[data-page=encyclopedia] .merchant-portrait .ency-native-image{width:100%;height:auto;aspect-ratio:1;object-fit:cover;display:block;border:0;border-radius:0;background:transparent}
.merchant-portrait>span{display:block;font-size:10px;text-align:center;border-top:1px solid #756b5c;padding:3px;color:#c3b49e}
.merchant-greeting{font-size:14px;line-height:1.9;color:#dccba6!important;margin:0 0 10px}
.merchant-version{font-size:11px;line-height:1.6}
.merchant-section{padding:16px 0;border-top:1px solid #786d5a66}
.merchant-section>h2,.merchant-section>h3{font-size:17px;text-align:center;margin-bottom:16px;color:#e7bc72!important}
.merchant-kicker{display:block;text-align:center;letter-spacing:.08em;font-size:11px;color:#b4a58e}
.merchant-output h2{font-size:21px;margin:4px 0 20px;text-align:center;color:#e7bc72!important}
.merchant-product{display:grid;grid-template-columns:125px minmax(0,1fr);align-items:center;gap:20px}
.merchant-product p,.merchant-product dl{font-size:12px;margin:0 0 8px}
.merchant-product dl div{padding:3px 0;border-bottom:1px dotted #80705a77}
.merchant-product a{font-size:12px}
.merchant-item-quality{color:#d5c1a1!important}
.merchant-item-tile{display:flex;flex-direction:column;align-items:center;text-align:center;min-width:0;text-decoration:none!important;font-size:12px;line-height:1.5;gap:7px}
.merchant-item-tile>span{overflow-wrap:anywhere}
.merchant-slot{width:88px;height:105px;display:flex;align-items:center;justify-content:center;position:relative;background:linear-gradient(135deg,#353634,#1a1c1c);border:3px double #8c8374;box-shadow:inset 0 0 15px #0006;padding:7px 7px 25px;flex:none}
body[data-page=encyclopedia] .merchant-desk .merchant-slot :is(.ency-native-image,.ency-preview-thumb){width:100%;height:100%;object-fit:contain;background:transparent;border:0;border-radius:0}
.merchant-slot .ency-preview-thumb>small{font-size:9px;background:#262425}
.merchant-slot-count{position:absolute;bottom:0;left:0;right:0;border-top:1px solid #7a7164;background:#292928;color:#e9dfce;font-size:12px;line-height:22px;text-align:center;min-height:22px}
.merchant-text-slot b{font-family:Georgia,serif;font-size:22px;color:#d4cabb}
.merchant-output-tile .merchant-slot{width:112px;height:142px}
.merchant-material-grid,.merchant-reward-grid{display:flex;justify-content:center;flex-wrap:wrap;gap:17px}
.merchant-material-grid>.merchant-item-tile,.merchant-reward-grid>.merchant-item-tile{width:94px}
.merchant-reward-grid{gap:12px}
.merchant-reward-grid>.merchant-item-tile{width:68px;font-size:11px;gap:5px}
.merchant-reward-grid .merchant-slot{width:68px;height:82px;padding:5px 5px 22px}
.merchant-reward-grid .merchant-slot-count{font-size:11px;line-height:20px;min-height:20px}
.merchant-reward-grid .merchant-text-slot b{font-size:12px;line-height:1.4;text-align:center;overflow-wrap:normal}
.merchant-divider{height:18px;text-align:center;color:#e7bc72;font-size:12px;line-height:18px;background:linear-gradient(90deg,transparent,#0c0e0e,transparent);margin:0 0 4px}
.merchant-footnote{font-size:12px;line-height:1.8;text-align:center;margin:15px 0 2px;color:#b5ab9c!important}
.merchant-craft-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));align-content:start;gap:7px}
.merchant-craft-choice{display:flex;flex-direction:column;align-items:center;padding:6px 4px 8px;text-decoration:none!important;background:#1c2021;border:1px solid #555858;font-size:11px;line-height:1.5;text-align:center;gap:5px}
.merchant-craft-choice[aria-current=true]{outline:1px solid #e7bc72;outline-offset:-1px;background:#60513555;box-shadow:inset 0 0 15px #d9aa4433}
.merchant-craft-choice:hover{border-color:#e7bc72}
.merchant-craft-choice .merchant-slot{border:0;background:transparent;box-shadow:none;width:70px;height:76px;padding:0}
.merchant-craft-choice .merchant-slot-count{display:none}
.merchant-craft-choice>span{color:#e9dfce;overflow-wrap:anywhere}
.merchant-craft-choice>small{font-size:10px}
.merchant-load-more{grid-column:1/-1;min-height:44px;background:#3e3528;border:1px solid #9a8157;color:#e7bc72}
.merchant-task-title{border-top:1px solid #786d5a99;text-align:center;padding:12px 0}
.merchant-task-title h2{font-size:22px;margin:2px 0 10px;color:#e7bc72!important}
.merchant-task-title .ency-quest-check{justify-content:center;width:max-content;margin:auto;border-color:#88734f;background:#292824;color:#dac5a0}
body[data-page=encyclopedia] .merchant-desk .merchant-task-title .ency-quest-check{min-height:40px;padding:5px 10px;gap:7px}
body[data-page=encyclopedia] .merchant-desk .merchant-task-title .ency-quest-check>span{display:inline}
body[data-page=encyclopedia] .merchant-task-goals .ency-task-objective{background:transparent;border:0;border-bottom:1px dotted #756a5b;padding:12px 0;margin:0;color:#e9dfce}
body[data-page=encyclopedia] .merchant-task-goals .ency-completion-action{color:#f0d394;font-size:17px}
body[data-page=encyclopedia] .merchant-task-goals .ency-objective-kind{background:#4e4433;border:1px solid #8b754c;color:#e7c98c}
body[data-page=encyclopedia] .merchant-task-goals :is(p,li){color:#c5baa8;font-size:12px}
body[data-page=encyclopedia] .merchant-task-goals .ency-goal-method{background:#1b1d1d;border-color:#645c50;color:#d1c5b3}
body[data-page=encyclopedia] .merchant-task-goals .ency-completion-rules li{background:#36322a;border-color:#6b5c42;color:#e5d3b2}
.merchant-task-goals .ency-target-actions{display:flex;flex-wrap:wrap;gap:8px}
.merchant-task-goals .ency-target-actions>a{display:flex;align-items:center;gap:5px;font-size:12px}
.merchant-prerequisites{text-align:center;font-size:12px}
.merchant-goal{padding:0 0 15px}.merchant-goal-method{margin:7px 0;font-size:13px!important;color:#c5baa8!important}.merchant-goal-sources{font-size:12px}.merchant-goal-sources summary{cursor:pointer;min-height:38px;line-height:38px}.merchant-goal-sources .ency-goal-source-preview{margin-top:10px}
.merchant-task-footer{border-block:1px solid #786d5a99;background:linear-gradient(90deg,transparent,#96713540,transparent);padding:17px 6px;display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:12px}
.merchant-local-state{color:#edc477}
.merchant-empty{padding:24px 10px;color:#b5ab9c}
.merchant-scope{font-size:12px;color:#baa8c7;line-height:1.8;margin:16px 0}
.merchant-desk a:focus-visible,.merchant-desk input:focus-visible{outline:2px solid #f4d495;outline-offset:3px}
@media(min-width:1500px){.merchant-selector{min-height:min(760px,calc(100dvh - 32px))}}
@media(max-width:760px){.merchant-reward-grid{max-width:244px;margin-inline:auto}}
@media(max-width:1100px){body[data-page=encyclopedia] .merchant-desk{grid-template-columns:minmax(220px,.85fr) minmax(0,1.2fr);gap:12px}.merchant-selector{padding:10px}.merchant-tabs{gap:2px}.merchant-tabs a{font-size:14px;padding:7px}.merchant-right{padding:20px}.merchant-profile-body{grid-template-columns:100px minmax(0,1fr);gap:13px}}
@media(max-width:760px){body[data-page=encyclopedia] .merchant-desk{grid-template-columns:1fr;gap:14px}.merchant-selector{position:static;min-height:0;max-height:none;padding:13px}.merchant-selector-head{padding:12px 0 8px}.merchant-selector-head h2{display:none}.merchant-tabs a{font-size:16px;padding:8px 12px}.merchant-choices{flex:initial;max-height:280px;overscroll-behavior:contain}.merchant-craft-grid{grid-template-columns:repeat(auto-fill,minmax(78px,1fr));max-height:320px}.merchant-craft-choice .merchant-slot{height:65px;width:61px}.merchant-right{padding:20px 16px}.merchant-profile-title h1{font-size:24px}.merchant-profile-body{grid-template-columns:95px minmax(0,1fr);gap:14px}.merchant-greeting{font-size:13px}.merchant-selection{scroll-margin-top:80px}.merchant-product{grid-template-columns:105px minmax(0,1fr);gap:12px}.merchant-output-tile .merchant-slot{width:96px;height:126px}.merchant-task-title h2{font-size:20px}.merchant-reward-grid,.merchant-material-grid{gap:10px}.merchant-task-footer{flex-wrap:wrap;justify-content:center}.merchant-profile-title>span{font-size:10px}}

/* Task: compact merchant header; goals and rewards share the first screen. */
.merchant-desk[data-pane=quests] .merchant-profile{display:flex;align-items:center;gap:14px;padding-bottom:12px}
.merchant-desk[data-pane=quests] .merchant-profile-title{order:2;text-align:left;border:0;padding:0;margin:0;flex:1}
.merchant-desk[data-pane=quests] .merchant-profile-title h1{font-size:21px;margin:0}
.merchant-desk[data-pane=quests] .merchant-profile-title>span{display:none}
.merchant-desk[data-pane=quests] .merchant-profile-body{display:contents}
.merchant-desk[data-pane=quests] .merchant-portrait{width:62px;flex:none;order:1}
.merchant-desk[data-pane=quests] .merchant-portrait>span{display:none}
.merchant-desk[data-pane=quests] .merchant-profile-body>div:last-child{order:3;max-width:58%}
.merchant-desk[data-pane=quests] .merchant-greeting{font-size:12px;margin:0;line-height:1.5}
.merchant-desk[data-pane=quests] .merchant-version{font-size:10px;margin:4px 0 0}
.merchant-task-title{display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;padding:12px 0}
.merchant-task-title h2{font-size:23px;margin:0}
.merchant-task-title .merchant-kicker{text-align:left}
body[data-page=encyclopedia] .merchant-desk .merchant-task-title .ency-quest-check{margin:0;flex:none}
.merchant-task-overview{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(160px,1fr);gap:20px;align-items:start}
.merchant-task-overview .merchant-section{padding:13px 0}
.merchant-task-overview .merchant-section>h3{text-align:left;font-size:16px;margin-bottom:10px}
.merchant-task-aside{min-width:0;padding:0 0 0 16px;border-left:1px solid #786d5a66}
.merchant-task-aside .merchant-reward-grid{justify-content:flex-start;gap:10px}
.merchant-task-aside .merchant-reward-grid>.merchant-item-tile{width:64px}
.merchant-task-aside .merchant-prerequisites{text-align:left}
.merchant-task-overview .merchant-goal{padding-bottom:8px}
.merchant-task-overview .merchant-goal-sources summary{min-height:32px;line-height:32px}
.merchant-task-footer{padding:10px 4px}
@media(min-width:1500px){body[data-page=encyclopedia] .merchant-desk{grid-template-columns:minmax(280px,.75fr) minmax(0,1.55fr)}}
@media(max-width:1150px){.merchant-task-overview{grid-template-columns:1fr;gap:0}.merchant-task-aside{border-left:0;padding:0}.merchant-desk[data-pane=quests] .merchant-profile-body>div:last-child{display:none}}
@media(max-width:760px){.merchant-task-title h2{font-size:21px}.merchant-task-overview{grid-template-columns:1fr}.merchant-task-aside .merchant-reward-grid{max-width:none;margin:0}.merchant-desk[data-pane=quests] .merchant-profile{padding-bottom:8px}.merchant-desk[data-pane=quests] .merchant-portrait{width:46px}}
