/* Full read-only Quest rewards, with a single-card phone gallery. */
body[data-story="true"] #tavern .story-reward-cards39{display:block;min-width:0;margin:0}
body[data-story="true"] #tavern .story-reward-cards39>strong{display:flex;align-items:center;gap:4px;font-size:16px;line-height:20px}
body[data-story="true"] #tavern .story-reward-grid39{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:6px}
body[data-story="true"] #tavern .story-reward-preview39{box-sizing:border-box;min-width:0;height:248px;padding:0;border:0;background:#151a1d;color:#f3e4bf;box-shadow:0 3px 8px #1f281d88;overflow:hidden}
body[data-story="true"] #tavern .story-reward-card39>.ability-face15{display:grid!important;width:100%;height:100%;min-height:0!important;grid-template-rows:40px minmax(0,1fr) 54px 13px!important;gap:0!important}
body[data-story="true"] #tavern .story-reward-card39 .af15-art{min-height:0!important;max-height:none!important}
body[data-story="true"] #tavern .story-reward-card39 .af15-effect{min-height:54px!important;font-size:13px!important;line-height:15px!important}
body[data-story="true"] #tavern .story-reward-resource39 .af15-heading{display:flex!important;justify-content:center!important}
body[data-story="true"] #tavern .story-reward-resource39 .af15-name{font:700 16px/18px var(--fantasy-title,Georgia,serif)!important}
body[data-story="true"] #tavern .story-reward-resource39 .af15-art>img{width:100%;height:100%;object-fit:contain}
body[data-story="true"] #tavern .story-reward-resource39 .af15-effect{display:flex!important;align-items:center!important;justify-content:center!important;gap:3px!important;flex-wrap:wrap!important;font:700 13px/15px var(--fantasy-copy,Georgia,serif)!important}
body[data-story="true"] #tavern .story-reward-resource39 .af15-effect>span{display:inline-flex;align-items:center;justify-content:center;gap:3px;white-space:nowrap}
body[data-story="true"] #tavern .story-reward-resource39 .icon{width:16px;height:16px}
body[data-story="true"] #tavern .story-reward-recovery39 .af15-effect{flex-direction:column!important;gap:1px!important;font-size:14px!important;line-height:17px!important}
body[data-story="true"] #tavern .story-reward-choices39{display:none}
@media(min-width:900px){
 body[data-story="true"][data-connected-balance178="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39){height:420px!important;max-height:calc(100dvh - 80px)!important;padding-top:4px!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39){height:420px!important;max-height:calc(100dvh - 80px)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding-top:4px!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39)>.spoken-scene21__name{flex:none!important;margin:0 0 2px!important;padding:2px 8px!important;border-width:3px!important;line-height:23px!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39)>.story-dialogue-mechanics18{flex:1 1 auto!important;min-height:0!important;overflow:visible!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .story-quest-details17:has(.story-reward-cards39){display:grid!important;grid-template-columns:minmax(220px,30%) minmax(0,1fr)!important;gap:12px;align-items:start}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .story-quest-details17:has(.story-reward-cards39)>.story-reward-cards39{grid-column:2!important;grid-row:1/span 4!important;margin:0!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .story-quest-details17:has(.story-reward-cards39)>:not(.story-reward-cards39){grid-column:1!important;margin:2px 0!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39)>.stationary-terms-actions23{position:static!important;inset:auto!important;flex:0 0 auto!important;width:100%!important;margin-top:auto!important}
}
@media(max-width:899px){
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39){position:fixed!important;left:8px!important;right:8px!important;bottom:8px!important;top:92px!important;width:auto!important;height:auto!important;max-height:calc(100dvh - 100px)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding:8px 10px!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39)>.spoken-scene21__name{flex:none!important;margin:0 0 3px 77px!important;padding:3px 8px!important;font-size:20px!important;line-height:25px!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39)>.story-dialogue-mechanics18{flex:1 1 auto!important;min-height:0!important;overflow:visible!important;font-size:15px!important;line-height:1.15!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .story-quest-details17:has(.story-reward-cards39){display:block!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .story-quest-details17:has(.story-reward-cards39) :is(h3,.story-goal-rule17){font-size:15px!important;line-height:1.15!important;margin:2px 0!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .story-quest-details17:has(.story-reward-cards39) h3{margin-left:77px!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23.spoken-patron21:not(#hartwellDialogue23):has(.story-reward-cards39) .spoken-scene21__portrait-plane{position:fixed!important;top:89px!important;bottom:auto!important;left:14px!important;width:70px!important;height:82px!important;z-index:5!important;pointer-events:none!important}
 body[data-story="true"] #tavern .story-reward-grid39{grid-template-columns:minmax(0,188px);justify-content:center;margin-top:3px}
 body[data-story="true"] #tavern .story-reward-preview39{height:214px}
 body[data-story="true"] #tavern .story-reward-preview39:not(.active){display:none}
 body[data-story="true"] #tavern .story-reward-choices39{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-top:4px}
 body[data-story="true"] #tavern .story-reward-choice39{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:0;min-height:44px;padding:2px;background:#304532;color:#f4e4bc;border:1px solid #9b8056;font:700 11px/12px Georgia,serif;text-align:center}
 body[data-story="true"] #tavern .story-reward-choice39[aria-pressed="true"]{background:#e8d8b4;color:#283a2b;border:2px solid #8b7049}
 body[data-story="true"] #tavern .story-reward-choice39>span:first-child{max-width:100%;white-space:normal}
 body[data-story="true"] #tavern .story-reward-choice-value39{display:flex;align-items:center;justify-content:center;gap:2px;min-width:0;white-space:nowrap}
 body[data-story="true"] #tavern .story-reward-choice-value39 .icon{width:14px;height:14px}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39) .story-upkeep23{margin-left:80px!important;width:calc(100% - 80px)!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39)>.stationary-terms-actions23{position:static!important;inset:auto!important;flex:0 0 auto!important;width:calc(100% - 80px)!important;margin: auto 0 0 80px!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39)>.stationary-terms-actions23>button{font-size:14px!important;line-height:17px!important;padding:4px!important}
}
@media(max-width:359px){
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39){top:4px!important;bottom:4px!important;max-height:calc(100dvh - 8px)!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23.spoken-patron21:not(#hartwellDialogue23):has(.story-reward-cards39) .spoken-scene21__portrait-plane{top:4px!important;height:76px!important}
 body[data-connected-balance178="true"][data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23.spoken-patron21:not(#hartwellDialogue23):has(.story-reward-cards39) .spoken-scene21__portrait-plane{top:1px!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39)>.story-dialogue-mechanics18{overflow:hidden!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech:has(.story-reward-cards39) .story-quest-details17 :is(h3,.story-goal-rule17){font-size:14px!important;line-height:1.12!important;margin:0!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .story-quest-details17:has(.story-reward-cards39) .story-quest-objective17{margin:0!important}
 body[data-story="true"] #tavern .story-reward-preview39{height:164px}
 body[data-story="true"] #tavern .story-reward-card39>.ability-face15{grid-template-rows:32px minmax(0,1fr) 48px 11px!important}
 body[data-story="true"] #tavern .story-reward-card39 .af15-effect{min-height:48px!important}
}
@media(max-width:319px){
 body[data-story="true"] #tavern .story-reward-cards39>strong{font-size:14px;line-height:17px}
 body[data-story="true"] #tavern .story-reward-preview39{height:151px}
}

/* Keep Quest quantities legible beside their icons in the compact desktop reward panel. */
@media(min-width:900px){
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .story-quest-details17:has(.story-reward-cards39) .story-quest-objective17 .story-goal-rule17{font-size:16px!important;line-height:1.3!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .story-quest-details17:has(.story-reward-cards39) .story-quest-objective17 .icon{width:18px!important;height:18px!important;margin:0 3px 0 2px!important;vertical-align:-3px!important}
 body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .story-quest-details17:has(.story-reward-cards39) .story-quest-objective17 h3>.icon{width:22px!important;height:22px!important;margin:0!important}
}

/* Health keeps its red meaning in reward previews and choice tabs. */
body[data-story="true"] #tavern .icon:has(use[href$="#heart"]){color:#bf3644!important;fill:#bf3644!important}

/* At short desktop widths, keep all three reward names inside the frame. */
@media(min-width:900px){
 body[data-story="true"] #tavern .story-reward-card39 .af15-heading{align-items:flex-start!important;padding-top:0!important;box-sizing:border-box!important}
 body[data-story="true"] #tavern .story-reward-card39 .af15-name{font-size:13px!important;line-height:15px!important;white-space:normal!important;overflow:hidden!important}
 body[data-story="true"] #tavern .story-reward-resource39 .af15-name{font-size:14px!important;line-height:16px!important}
}

/* Live reward names and values stay above decorative etching. */
body[data-story="true"] #tavern .story-reward-card39 .af15-heading,body[data-story="true"] #tavern .story-reward-card39 .af15-effect{position:relative;z-index:5}

/* A short desktop reward panel still needs room for Field care's full caption. */
@media(min-width:701px) and (max-height:600px){
 #lootPanel .loot-reward-card.loot-resource-card{grid-template-rows:minmax(60px,1fr) auto auto}
}

/* Expanded offered danger terms scroll above the fixed acceptance controls. */
body[data-story="true"] #tavern[data-stationary-tavern="true"] .stationary-tavern23 .spoken-scene21__speech>.story-dialogue-mechanics18[data-pressure-terms471="true"]{overflow:auto!important;overscroll-behavior:contain}
