/* The approved wood, ink and painted icons remain the shared visual language. */
#game #menu-settings{grid-area:1/1;justify-self:start;width:42px;height:42px;min-width:42px;padding:7px;border:0;background:transparent;box-shadow:none}
#menu-settings .icon{width:28px;height:28px}
#game .portrait{pointer-events:none}
#t3-settings{display:none!important}
#sheet #npc-dialogue .npc-actions{display:none}
/* Image-based infinity and stock use the same baseline without changing the tool row. */
#game :is(#fuel-label,#wood-label){right:3px;bottom:2px;min-width:20px;min-height:20px;box-sizing:border-box;display:grid;place-items:center;padding:0 4px;border:1px solid #ad8a56;border-radius:4px;background:#0a2025;color:#f3dfac;line-height:18px;z-index:2}
#fuel-label .infinite-fuel{display:block;width:13px;height:7px;object-fit:contain;max-width:none}
/* Equipment state is a compact mark; the condition rail has its own breathing room. */
#game .item-cell{position:relative;overflow:hidden}
#game .item-cell>.item-icon{position:absolute;inset:7px 7px 22px;width:auto;height:auto;max-height:none;max-width:none;display:block}
#game .item-cell .item-icon>.icon{display:block;width:100%;height:100%;max-height:100%;max-width:100%;filter:none}
#game .item-cell .equipped{position:absolute;left:4px;top:4px;right:auto;width:18px;height:18px;padding:0;border:0;border-radius:0;background:transparent;line-height:0;z-index:2}
#game .item-cell .equipped img{display:block;width:100%;height:100%;object-fit:contain}
#game .item-cell .durability{position:absolute;left:7px;right:39px;bottom:8px;height:4px;border:1px solid #89704377;border-radius:3px;background:#041518;overflow:hidden;box-shadow:none}
#game .item-cell .durability i{height:100%;display:block;border-radius:2px;background:#b8cba4}
#game .item-cell .durability.worn i{background:#ebc05d}
#game .item-cell .durability.critical i{background:#eb7868}
#game .item-cell .durability.broken{background:#954c414d;border-color:#b76e58}
#game #sheet .item-cell .count{bottom:4px;right:4px}
/* The bag stays square; the sale receipt gets more horizontal space. */
#sheet .shop-layout[data-shop-mode=sell]{grid-template-columns:minmax(100px,.38fr) minmax(0,.62fr);gap:8px}
#sheet .shop-layout[data-shop-mode=sell] .shop-bag-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
#sheet .shop-bag-grid .item-cell{width:100%;aspect-ratio:1;min-height:0;height:auto;padding:0;display:block}
#sheet .shop-bag-grid .item-cell>.item-icon{inset:5px 5px 19px;max-height:none}
#sheet .cart-item{display:grid;grid-template-columns:30px minmax(0,1fr) 36px;gap:7px 5px;align-items:center;min-width:0;padding:10px 2px;margin:0;border-bottom:1px solid #82927233}
#sheet .cart-item>.item-icon{grid-area:1/1;width:30px;height:34px;display:block}
#sheet .cart-item>.item-icon .icon{width:100%;height:100%;display:block;filter:none}
#sheet .cart-item .shop-line-main{display:contents}
#sheet .cart-item strong{grid-area:1/2;font-size:12px;line-height:1.5;min-width:0;overflow-wrap:anywhere;white-space:normal}
#sheet .cart-item .shop-quantity{grid-area:2/1/3/4;display:grid;grid-template-columns:40px minmax(36px,56px) 40px;justify-content:center;align-items:center;gap:4px;margin:0;min-width:0;flex-wrap:nowrap}
#sheet .cart-item .shop-quantity button{width:40px;min-width:40px;height:40px;min-height:40px;padding:6px}
#sheet .cart-item .shop-quantity label{min-width:0;margin:0}
#sheet .cart-item .shop-quantity input{width:100%;min-width:0;height:40px;min-height:40px;margin:0;padding:4px 1px;text-align:center;font-size:14px;box-sizing:border-box}
#sheet .cart-item small{grid-area:3/1/4/4;font-size:11px;line-height:1.5;text-align:right;color:#c9c8b2}
#sheet .cart-item .shop-remove{grid-area:1/3;position:static;width:36px;min-width:36px;height:36px;min-height:36px;margin:0;padding:8px;justify-self:end;border:0;background:transparent;box-shadow:none}
#sheet .cart-item .shop-remove .icon{width:18px;height:18px}
#game #channel-select>[data-channel]{border:1px solid transparent;background-clip:padding-box;box-shadow:none;margin:0;transform:none}
#game #channel-select>[aria-checked=true]{border-color:#a58d5d;background:#28564a;box-shadow:none;color:#f4d99d}
#game #channel-select>[data-channel]:before,#game #channel-select>[data-channel]:after{display:none}
/* One anchored dock: old lines float above the one-line strip or compact composer. */
#game #chat-dock{position:absolute;left:20px;bottom:22px;width:clamp(280px,26vw,380px);max-width:calc(100% - 40px);display:flex;flex-direction:column;gap:4px;z-index:15;pointer-events:none}
#game #chat-dock>:is(#desktop-chat,#chat-preview){position:relative;inset:auto;transform:none;width:100%;max-width:none;pointer-events:auto;box-sizing:border-box}
#game #chat-dock #chat-preview{height:44px;min-height:44px;display:flex;flex-direction:row;align-items:center;gap:5px;padding:0 5px}
#game #chat-dock #chat-preview .chat-preview-heading{display:contents}
#game #chat-dock .chat-preview-label{display:none}
#game #chat-dock #chat-preview-text{order:0;flex:1;min-width:0;display:block}
#game #chat-dock #chat-preview-text p{margin:0;line-height:20px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
#game #chat-dock #chat-preview-unread{order:1;flex:none;display:inline-flex;gap:3px}
#game #chat-dock #chat-expand{order:2;flex:none;width:36px;min-width:36px;height:36px;min-height:36px;padding:6px;display:flex;align-items:center;justify-content:center;margin:0;border:0;background:transparent;box-shadow:none}
#chat-expand [data-icon],#chat-expand .icon,#desktop-chat-collapse [data-icon],#desktop-chat-collapse .icon{display:block;width:100%;height:100%}
#game #chat-dock #desktop-chat{height:auto;min-height:0;padding:6px 8px;overflow:visible}
#game #desktop-chat .chat-panel{height:auto;min-height:0;display:flex;flex-direction:column}
#game #desktop-chat .chat-tabs{padding-right:38px;min-height:32px}
#game #desktop-chat #chat-log{display:none}
#game #desktop-chat-collapse{top:3px;right:3px;width:36px;min-width:36px;height:36px;min-height:36px;padding:7px;display:flex;align-items:center;justify-content:center;background:transparent}
#game #desktop-chat .chat-form{padding-top:3px;margin:0}
#game #desktop-chat .chat-compose{gap:5px}
#game #chat-floating{display:flex;flex-direction:column;gap:2px;pointer-events:none;min-height:0;width:100%;overflow:hidden}
#game #chat-floating p{margin:0;padding:1px 8px;box-sizing:border-box;height:22px;min-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:transparent;border-radius:3px;font-size:12px;line-height:20px;text-shadow:0 1px 2px #000,0 0 3px #000;opacity:1;transition:opacity 2s ease;--channel-color:#d8dfcc;color:var(--channel-color)}
#game #chat-floating p.fading{opacity:0}
#game #chat-floating p[data-channel=party]{--channel-color:#96dfbe}
#game #chat-floating p[data-channel=world]{--channel-color:#94cfee}
#game #chat-floating p[data-channel=whisper]{--channel-color:#edafd7}
#game #chat-floating p[data-channel=system]{--channel-color:#e4c88e}
#game #chat-floating strong{color:inherit;font-weight:500}
#game #chat-floating .message-text{margin-left:4px}
@media(max-width:999px),(max-height:649px){
 #game #chat-dock{left:12px;bottom:194px;width:min(360px,calc(100% - 84px));max-width:calc(100% - 24px)}
 #game.compact-keyboard #chat-dock{bottom:174px}
 #game #chat-dock #chat-expand{width:40px;min-width:40px;height:40px;min-height:40px}
 #game #dash-button{display:none}
 #game .desktop-controls-only{display:none!important}
}
@media(prefers-reduced-motion:reduce){#game #chat-floating p{transition:none}}
@media(max-width:599px){
 #sheet .shop-layout[data-shop-mode=sell]{grid-template-columns:minmax(64px,.28fr) minmax(0,.72fr);gap:6px}
 #sheet .shop-layout[data-shop-mode=sell] .shop-bag-grid{grid-template-columns:minmax(0,1fr)}
 #sheet .shop-layout[data-shop-mode=sell] .shop-bag .shop-column-heading{display:block;min-width:0}
 #sheet .shop-layout[data-shop-mode=sell] .shop-bag .shop-column-heading small{display:block;font-size:9px;white-space:normal;overflow-wrap:anywhere;line-height:1.4}
}

#game #fuel-label:has(.infinite-fuel){width:24px;height:20px;min-width:24px;min-height:20px;padding:0;border:0;background:transparent}
#game #fuel-label .infinite-fuel{width:24px;height:20px;max-width:none;display:block;object-fit:contain}

/* Only the pinned newest message has a surface; floating older lines stay clear. */
#game[data-chat-mode=expanded] #chat-floating p:last-child{background:rgba(6,23,25,.48)}

/* Three separate controls: quiet 32px faces inside 44px touch targets. */
#sheet .cart-item .shop-quantity{width:min(100%,140px);min-width:0;box-sizing:border-box;grid-template-columns:44px minmax(28px,44px) 44px;gap:4px;padding:0;border:0;border-radius:0;background:transparent;justify-self:center;overflow:visible}
#sheet .cart-item .shop-quantity button{position:relative;isolation:isolate;border:0;border-radius:0;background:transparent;box-shadow:none;display:grid;place-items:center;padding:0;width:44px;min-width:44px;height:44px;min-height:44px;color:#f2d59c;opacity:1;transform:none}
#sheet .cart-item .shop-quantity button:before{content:"";position:absolute;inset:6px;border:1px solid #a78550;border-radius:6px;background:#284441;box-shadow:inset 0 1px 0 #d4b67729;z-index:-1}
#sheet .cart-item .shop-quantity button .icon{display:block;position:relative;width:14px;height:14px;filter:none;font-size:0;line-height:0}
#sheet .cart-item .shop-quantity button .icon:before,#sheet .cart-item .shop-quantity button[data-step="1"] .icon:after{content:"";position:absolute;left:0;top:6px;width:14px;height:2px;border-radius:1px;background:currentColor}
#sheet .cart-item .shop-quantity button[data-step="1"] .icon:after{transform:rotate(90deg)}
#sheet .cart-item .shop-quantity button:disabled{color:#8a9a90;opacity:.45}
#sheet .cart-item .shop-quantity button:not(:disabled):hover:before{background:#3a5d50;border-color:#e0bf7e}
#sheet .cart-item .shop-quantity button:focus-visible{outline:2px solid #edca83;outline-offset:-2px;border-radius:6px}
#sheet .cart-item .shop-quantity label{display:grid;align-items:center;height:44px}
#sheet .cart-item .shop-quantity input{border:0;border-bottom:1px solid #a78550;border-radius:0;background:#071e2277;box-shadow:none;padding:0;width:100%;height:36px;min-height:36px;appearance:textfield;font-size:17px;font-weight:600;line-height:36px;font-variant-numeric:tabular-nums;color:#f6e6bc}
#sheet .cart-item .shop-quantity input:focus-visible{outline:2px solid #edca83;outline-offset:1px}
#sheet .cart-item .shop-quantity input::-webkit-inner-spin-button,#sheet .cart-item .shop-quantity input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
#sheet .cart-item .shop-remove .close-mark:before,#sheet .cart-item .shop-remove .close-mark:after{width:14px;height:2px}
#game .desktop-collapse-glyph{display:none}
@media(min-width:1000px) and (min-height:650px){
 #game[data-layout=wide] #chat-floating{display:none}
 #game[data-layout=wide] #chat-dock{width:clamp(256px,26vw,360px)}
 #game[data-layout=wide] #chat-dock #desktop-chat{height:214px;padding:5px 7px;overflow:hidden}
 #game[data-layout=wide] #desktop-chat .chat-panel{height:100%;min-height:0}
 #game[data-layout=wide] #desktop-chat #chat-log{display:block;flex:1;min-height:0;overflow:auto}
 #game[data-layout=wide] #desktop-chat .chat-tabs{padding-right:72px}
 #game[data-layout=wide] #desktop-chat-minimize{display:block;top:4px;right:33px;width:40px;min-width:40px;height:32px;min-height:32px;padding:0;font-size:11px}
 #game[data-layout=wide] #desktop-chat-collapse{top:4px;right:3px;width:30px;min-width:30px;height:32px;min-height:32px;padding:0}
 #game[data-layout=wide] .desktop-collapse-glyph{display:block;font-size:20px}
 #game[data-layout=wide] .mobile-compose-icon{display:none}
 #game[data-layout=wide] #chat-preview-mode{order:2;flex:none;display:block;width:38px;min-width:38px;height:32px;min-height:32px;font-size:11px;margin:0}
 #game[data-layout=wide] #chat-dock #chat-expand{order:3}
 #game[data-layout=wide][data-chat-mode=compact] #chat-dock #chat-preview{height:104px;min-height:104px;align-items:flex-start;padding-top:5px}
 #game[data-layout=wide][data-chat-mode=compact] #chat-dock #chat-preview-text p{display:block}
}
