/* Shared paper shell. Keep titles outside the independently scrolling body. */
body dialog.ui-panel button{font-family:"Noto Sans TC","Source Han Sans TC","Microsoft JhengHei","PingFang TC",sans-serif}
body dialog.ui-panel:not([data-mode=gear]){--panel-ink:#203e53;--panel-muted:#606c70;--panel-paper:#e8d9b9;--text:var(--panel-ink);--muted:var(--panel-muted);--accent:#304f65;--line:#25465c30;position:fixed;inset:0;margin:auto;height:fit-content;max-height:90dvh;overflow:visible;padding:38px 28px 24px;border:0;border-radius:3px;color:var(--panel-ink);background:radial-gradient(ellipse at 20% 8%,#fff8e166,transparent 65%),radial-gradient(ellipse at 90% 100%,#baa47e28,transparent 60%),var(--panel-paper);box-shadow:0 24px 100px #000b;isolation:isolate}
body dialog.ui-panel:not([data-mode=gear])::backdrop{background:#07121bc4;backdrop-filter:blur(5px)}
body dialog.ui-panel:not([data-mode=gear])::before{content:"";position:absolute;inset:0;background:none;border:34px solid transparent;border-image:url("../assets/ui/common/parchment-panel-v2.png") 145 155 140 155 fill /34px/0 round;pointer-events:none;z-index:-1}
body dialog.ui-panel:not([data-mode=gear])>.ui-panel-title{position:absolute;top:-21px;left:50%;transform:translateX(-50%);z-index:1;width:max-content;max-width:90%;margin:0;padding:8px 34px;background:var(--panel-ink);color:#f1dfba;font:500 21px/1.4 "PMingLiU",serif;letter-spacing:3px;clip-path:polygon(12px 0,calc(100% - 12px) 0,100% 50%,calc(100% - 12px) 100%,12px 100%,0 50%);border-block:2px solid #c9b991}
body dialog.ui-panel:not([data-mode=gear])>.ui-panel-body{max-height:calc(90dvh - 66px);overflow:auto;overscroll-behavior:contain;scrollbar-color:#657a85 #d7c7a7;padding:3px 5px}
body dialog.ui-panel:not([data-mode=gear]) button:where(:not(.roster-tile):not(.reward-card):not(.law-card)){border:1px solid #486274;background:#25485e;color:#f2e2c3;border-radius:999px;padding:9px 22px;box-shadow:inset 0 0 0 2px #e8d8b518;letter-spacing:1px}
body dialog.ui-panel:not([data-mode=gear]) button:where(:not(.roster-tile):not(.reward-card):not(.law-card)):not(:disabled):hover{background:#365b70;border-color:#718896}
body dialog.ui-panel button:focus-visible{outline:2px solid #ac6c35;outline-offset:3px}
body dialog.ui-panel:not([data-mode=gear]) button:disabled{opacity:.45;cursor:not-allowed}
body dialog.ui-panel .reward-categories{margin:24px 0 14px;gap:20px}
body dialog.ui-panel .reward-categories button{min-height:110px}
body dialog.ui-panel.reward-hub,body dialog.ui-panel.reward-money-dialog{width:min(460px,92vw)}
body dialog.ui-panel #reward-money-amount{margin:30px 0;font:500 30px/1.5 "PMingLiU",serif;color:var(--panel-ink)}
body dialog.ui-panel .reward-actions{margin-top:22px}
body dialog.ui-panel .reward-warning{color:#823f31;background:#a95f4220;border:1px solid #a76c4955}
body dialog.ui-panel #reward-empty{font-size:13px;line-height:1.9;color:var(--panel-muted)}
/* Reward contents retain their current structure; the dark cards sit on paper. */
body dialog.ui-panel button.reward-card{background:linear-gradient(145deg,#29465a,#172c3e);color:#e9dcc2;border:1px solid #2d4e63;box-shadow:0 3px 9px #182a3424}
body dialog.ui-panel button.reward-card:hover{background:linear-gradient(145deg,#36576b,#203b50)}
body dialog.ui-panel .reward-card .reward-art{color:#c0c6c5;background:#d4e2dd0b}
/* Shop surrounds use ink on paper; card art and HUD colours remain independent. */
body dialog.ui-panel[data-mode=shop] .expedition-head{position:static;padding:0 0 18px;justify-content:center;text-align:center;border:0}
body dialog.ui-panel[data-mode=shop] #shop-wallet{color:var(--panel-ink);margin:0;font-size:14px}
body dialog.ui-panel[data-mode=shop] .roster-heading h3{color:var(--panel-ink)}
body dialog.ui-panel[data-mode=shop] .roster-scroll{scrollbar-color:#657a85 #d7c7a7}
body dialog.ui-panel[data-mode=shop] .roster-tile.vacant{background:#294e6510;border-color:#294e6538}
body dialog.ui-panel[data-mode=shop] .roster-sell-zone{position:static;min-height:32px;border:1px dashed #66747a;background:#25485e09;color:#52636b;padding:6px 16px;box-shadow:none;font-size:11px}
body dialog.ui-panel[data-mode=shop] .shop-tabs button{padding:8px 22px;background:transparent;color:#4e646e;box-shadow:none;border-color:#526c7950}
body dialog.ui-panel[data-mode=shop] .shop-tabs [aria-selected=true]{background:#25485e;color:#f2e2c3;border-color:#25485e}
body dialog.ui-panel[data-mode=shop] .expedition-message{color:#823f31;background:#a95f4210}
body dialog.ui-panel[data-mode=shop] .expedition-note{color:var(--panel-muted)}
body dialog.ui-panel[data-mode=shop] .law-card{color:var(--panel-ink);background:#25485e0d;border:1px solid #25485e30}
body dialog.ui-panel[data-mode=shop] .law-card:not(:disabled):hover{background:#25485e1c}
body dialog.ui-panel[data-mode=shop] .law-card-name{color:var(--panel-ink)}
body dialog.ui-panel[data-mode=shop] .law-card-stats{color:#52636b}
body dialog.ui-panel[data-mode=shop] .law-card .law-price{color:#34556a}
body dialog.ui-panel[data-mode=shop] .law-card:disabled{opacity:.7}
body dialog.ui-panel[data-mode=shop] .law-target-zone{background:#25485e0a}
@media(max-width:650px){body dialog.ui-panel:not([data-mode=gear]){padding:34px 18px 20px}body dialog.ui-panel:not([data-mode=gear])>.ui-panel-body{max-height:calc(90dvh - 58px);padding:2px}body dialog.ui-panel:not([data-mode=gear])>.ui-panel-title{font-size:18px;top:-19px;padding:7px 25px}body dialog.ui-panel[data-mode=shop] .shop-navigation{flex-wrap:wrap}body dialog.ui-panel[data-mode=shop] .shop-controls{flex-wrap:wrap}body dialog.ui-panel .reward-categories{gap:12px}}
