.rx-market{box-sizing:border-box;width:min(1100px,calc(100vw - 24px));height:min(760px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);margin:auto;padding:18px;border:4px solid #a48648;border-radius:20px;background:linear-gradient(#fbf2d3,#ede0af);color:#322916;font:18px Georgia,serif;overflow:hidden}
.rx-market::backdrop{background:#101b18b0}.rx-market *{box-sizing:border-box}.rx-market .market-shell{height:100%;min-height:0;display:flex;flex-direction:column;gap:12px}.rx-market header,.rx-market footer{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0}.rx-market h1{font-size:30px;margin:0}.rx-market h2{font-size:22px;margin:0}.rx-market p{margin:0;line-height:1.35}.rx-market button{font:700 17px Georgia,serif;padding:10px 14px;border:2px solid #28483d;border-radius:9px;background:linear-gradient(#466b5e,#315347);color:#fff8df;cursor:pointer;min-height:42px}.rx-market button:hover{filter:brightness(1.12)}.rx-market button:focus-visible,.rx-market textarea:focus-visible{outline:3px solid #397ca9;outline-offset:2px}.rx-market button:disabled{background:#ded4b5;color:#6b634d;border-color:#b8a779;cursor:default}.rx-market button[aria-pressed=true]{background:#397ca9}.rx-market .balance{display:flex;gap:22px;flex-wrap:wrap;padding:10px 14px;background:#e2cf97;border-radius:9px}.rx-market .balance img{width:30px;height:28px;vertical-align:middle;object-fit:contain}.rx-market .workspace{flex:1;min-height:0;display:grid;grid-template-columns:minmax(220px,1fr) minmax(300px,1.6fr);gap:16px;overflow:hidden}.rx-market .pane{min-height:0;display:flex;flex-direction:column;gap:8px;background:#fff8e3;border:2px solid #b79b5c;border-radius:12px;padding:12px;overflow:hidden}.rx-market .scroll{min-height:0;flex:1;overflow-y:scroll;overflow-x:hidden;scrollbar-gutter:stable;scrollbar-width:auto;scrollbar-color:#85673e #e4d6ad;padding-right:8px;overscroll-behavior:contain}.rx-market .scroll::-webkit-scrollbar{width:12px}.rx-market .scroll::-webkit-scrollbar-track{background:#e4d6ad;border-radius:6px}.rx-market .scroll::-webkit-scrollbar-thumb{background:#85673e;border:2px solid #e4d6ad;border-radius:6px}.rx-market .scroll-hint{font-size:13px;color:#756344}.rx-market .good{width:100%;display:flex;align-items:center;gap:10px;margin-bottom:8px;text-align:left;background:#f2e4b9;color:#322916;border-color:#baa15f}.rx-market img.good-icon{width:58px;height:58px;object-fit:contain;flex-shrink:0}.rx-market .offer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #c9b67c}.rx-market .offer-text{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.rx-market .offer img{width:42px;height:42px;object-fit:contain}.rx-market .offer small{display:block;font-size:14px;margin-top:5px}.rx-market .sale{padding:16px;background:#f2e4b9;border-radius:12px;display:flex;flex-direction:column;gap:12px}.rx-market .receipt{max-height:3.6em;overflow-y:auto;scrollbar-gutter:stable;font-size:15px;border-left:4px solid #927641;padding-left:10px;flex-shrink:0}.rx-market textarea{width:100%;height:70px;min-height:40px;resize:none;font:17px Georgia;padding:8px;border:2px solid #b79b5c;background:#fffdf1}.rx-market .note{padding:10px 0;border-bottom:1px solid #c9b67c;overflow-wrap:anywhere}.rx-market .note small{display:block;color:#756344}.rx-market .status{min-height:1.4em;font-size:15px;flex-shrink:0}.rx-market nav{display:flex;gap:8px;flex-shrink:0}
@media(max-height:650px){.rx-market{padding:10px;font-size:16px}.rx-market .market-shell{gap:6px}.rx-market h1{font-size:24px}.rx-market .balance{padding:5px 12px}.rx-market .good img.good-icon{width:40px;height:40px}.rx-market button{padding:7px 10px;min-height:34px;font-size:15px}.rx-market .pane{padding:8px}.rx-market textarea{height:45px}}
@media(max-width:650px){.rx-market .workspace{grid-template-columns:minmax(110px,.8fr) minmax(180px,1.2fr);gap:6px}.rx-market{padding:8px;font-size:14px}.rx-market h1{font-size:20px}.rx-market h2{font-size:17px}.rx-market .balance{gap:8px}.rx-market .good{flex-wrap:wrap;padding:6px}.rx-market img.good-icon{width:32px;height:32px}.rx-market .offer{flex-direction:column;align-items:stretch}.rx-market .offer img{width:28px;height:28px}}

.rx-market .pane{position:relative}.rx-market .scroll-track{position:absolute;right:12px;top:70px;bottom:12px;width:12px;background:#dfd0a4;border:1px solid #b79b5c;border-radius:6px;cursor:pointer}.rx-market .scroll-track[hidden]{display:none}.rx-market .scroll-thumb{position:absolute;left:1px;width:8px;border-radius:5px;background:#85673e;pointer-events:none}.rx-market .scroll{padding-right:20px}.rx-market .scroll-track:focus-visible{outline:3px solid #397ca9}
.rx-market select{max-width:100%;width:100%;min-height:42px;padding:8px;border:2px solid #b79b5c;border-radius:8px;background:#fff8e3;color:#322916;font:17px Georgia,serif;flex-shrink:0}

.rx-market .restart-kit{background:#785839;border-color:#573c24}.rx-market .restart-warning{padding:14px;background:#f4d58a;border:3px solid #996623;border-radius:10px;line-height:1.45}

.market-clock{display:flex;align-items:center;gap:8px;background:#f1e2b7!important;color:#382c19!important;border:2px solid #ad8846!important;border-radius:12px;font:14px Georgia!important;padding:5px!important;text-align:left;max-width:330px}.market-clock svg{width:50px;height:50px;flex-shrink:0}.market-clock .clock-copy{line-height:1.3}#rx-market-clock{position:fixed;bottom:50px;left:100px;z-index:900;cursor:pointer}#rx-market-clock[hidden]{display:none}.rx-market header{flex-wrap:wrap}.rx-market .market-clock{margin-left:auto}.rx-market .price-changed{border-color:#b57924;box-shadow:inset 0 0 0 2px #ddbe65}.rx-market .price-changed small{color:#584521;font-weight:bold}@media(max-height:650px){.rx-market .market-clock svg{width:32px;height:32px}.rx-market .market-clock{max-width:270px;font-size:12px!important}}

/* Touch retains the original goods, offers, receipts and transaction handlers. */
#rx-market-tool.rx-market-touch .market-shell { display:contents; }
#rx-market-tool.rx-market-touch .rx-mw-header { background:transparent; }
#rx-market-tool.rx-market-touch .rx-mw-header h1 { font-size:18px!important;max-width:95%; }
#rx-market-tool.rx-market-touch .balance { flex:none;align-items:center;gap:8px;padding:6px 8px;font-size:14px; }
#rx-market-tool.rx-market-touch .balance img { width:24px;height:24px; }
#rx-market-tool.rx-market-touch .market-clock { margin:0;max-width:none;flex:1;min-width:230px;font-size:12px!important; }
#rx-market-tool.rx-market-touch .market-clock svg { width:32px;height:32px; }
#rx-market-tool.rx-market-touch nav { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;overflow:visible; }
#rx-market-tool.rx-market-touch nav button { font-size:14px;padding:6px; }
#rx-market-tool.rx-market-touch nav button[aria-pressed=true] { background:linear-gradient(#fff6db,#dfcb94);color:#312919;box-shadow:inset 0 0 0 2px #9d7a3b; }
#rx-market-tool.rx-market-touch .workspace { display:flex;min-height:0; }
#rx-market-tool.rx-market-touch .pane { display:block;flex:1;min-width:0;overflow-y:scroll;padding:12px; }
#rx-market-tool.rx-market-touch .pane[hidden] { display:none!important; }
#rx-market-tool.rx-market-touch .scroll { overflow:visible;max-height:none;padding:0; }
#rx-market-tool.rx-market-touch .scroll-track,#rx-market-tool.rx-market-touch .scroll-hint { display:none; }
#rx-market-tool.rx-market-touch .pane h2 { font-size:18px;margin-bottom:10px; }
#rx-market-tool.rx-market-touch .good { flex-wrap:nowrap;min-height:60px; }
#rx-market-tool.rx-market-touch .good-icon { width:48px;height:48px; }
#rx-market-tool.rx-market-touch .offer { padding:12px 0; }
#rx-market-tool.rx-market-touch button,#rx-market-tool.rx-market-touch select { min-height:44px; }
#rx-market-tool.rx-market-touch .note-compose { display:flex;flex-direction:column;gap:6px;margin-bottom:12px; }
#rx-market-tool.rx-market-touch textarea { height:90px;min-height:70px; }
#rx-market-tool.rx-market-touch details { padding:8px 0; }
#rx-market-tool.rx-market-touch summary { cursor:pointer;min-height:44px;padding:10px 0; }
#rx-market-tool.rx-market-touch .status { flex:none;min-height:0;max-height:3em;overflow:auto;scrollbar-gutter:stable; }
#rx-market-tool.rx-market-touch .status:empty { display:none; }
#rx-market-tool.rx-market-touch footer { flex:none;flex-direction:row;align-items:center; }
#rx-market-tool.rx-market-touch .receipt { flex:1;min-width:0;max-height:2.8em;font-size:13px; }
#rx-market-tool.rx-market-touch footer button { flex:none; }
#rx-market-tool.rx-market-touch .status::-webkit-scrollbar,#rx-market-tool.rx-market-touch .receipt::-webkit-scrollbar { width:12px;background:#e4d7af; }
#rx-market-tool.rx-market-touch .status::-webkit-scrollbar-thumb,#rx-market-tool.rx-market-touch .receipt::-webkit-scrollbar-thumb { background:#8b7749;border:2px solid #e4d7af;border-radius:6px; }
@media(max-width:500px){ #rx-market-tool.rx-market-touch nav { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-height:500px) and (min-width:601px){
 #rx-market-tool.rx-market-touch .market-clock { min-width:310px;max-width:420px; }
 #rx-market-tool.rx-market-touch .balance { padding:2px 6px; }
 #rx-market-tool.rx-market-touch .pane { padding:8px; }
}

/* Separate the clock label from the larger weekday/time readout. */
.market-clock .clock-copy { flex:1;min-width:0;display:grid;grid-template-columns:90px minmax(0,1fr);align-items:center;gap:4px 10px; }
.market-clock .clock-label { display:flex;flex-direction:column;font-size:14px;line-height:1.35; }
.market-clock .clock-current { display:flex;flex-direction:column;line-height:1.15; }
.market-clock .clock-weekday { font-size:18px; }
.market-clock .clock-time { font-size:26px;font-variant-numeric:tabular-nums; }
.market-clock .clock-next { grid-column:1/-1;font-size:14px;line-height:1.3;font-variant-numeric:tabular-nums; }
#rx-market-tool.rx-market-touch .market-clock { min-width:280px; }
#rx-market-tool.rx-market-touch .market-clock svg { width:44px;height:44px; }

.market-clock .clock-label > span { white-space:nowrap; }

/* Place the update readout beside the main time, and emphasize kit totals. */
.market-clock .clock-copy { grid-template-columns:82px repeat(2,minmax(0,1fr));column-gap:6px; }
.market-clock .clock-label { grid-column:1;grid-row:1/3; }
.market-clock .clock-current { display:contents; }
.market-clock .clock-weekday { grid-column:2/4;grid-row:1; }
.market-clock .clock-time { grid-column:2;grid-row:2; }
.market-clock .clock-next { grid-column:3;grid-row:2;display:flex;flex-direction:column; }
.rx-market .balance-total { display:inline-flex;align-items:center;gap:6px; }
#rx-market-tool.rx-market-touch .balance-total { display:grid;grid-template-columns:28px minmax(0,1fr);column-gap:6px;row-gap:0;flex:1;min-width:125px; }
#rx-market-tool.rx-market-touch .balance-total img { grid-row:1/3;width:28px;height:28px; }
#rx-market-tool.rx-market-touch .balance-label { font-size:16px;line-height:1.25; }
#rx-market-tool.rx-market-touch .balance-value { font-size:24px;line-height:1.15;font-variant-numeric:tabular-nums; }
@media(max-height:500px) and (min-width:601px){
 #rx-market-tool.rx-market-touch .market-clock { min-width:350px;max-width:430px; }
}
