/* Supply camp (shop between campaign rounds). Design: docs/DESIGN.md `06`, prototype design/proto/gen.py 06.
   The shared pieces (.flow, .stage, .dock, .resbar, .respill, .ushop, .armycard, .facts) live in ds.css; this file adds
   only what the real game needs beyond the prototype: upkeep, quick-victory pick, market sheet, ledger, toast. */

/* One-line role on every width (r3 consensus 5). */
.shop .ushop .desc{display:block;color:var(--text-2);margin-top:2px;line-height:1.3}
.shop .ushop .h3 .chip{margin-left:6px;vertical-align:2px}
.shop .res .was{margin-left:4px;font-weight:600;font-size:.8em;color:var(--text-2);text-decoration:line-through;text-decoration-thickness:1.5px}
/* Secondary buttons stay tonal in both themes: marigold is the only heavy button (r3 consensus 5). */
.shop .ushop .btn.sm:not([disabled]),.shop .sh-market .btn:not([disabled]){background:var(--s3);color:var(--text);box-shadow:inset 0 0 0 1.5px var(--line-strong),0 2px 0 var(--edge)}
[data-theme="light"] .shop .ushop .btn.sm:not([disabled]),[data-theme="light"] .shop .sh-market .btn:not([disabled]){background:var(--s2);color:var(--text)}
.shop .ushop .sh-buy{min-width:72px}

/* After-buy preview inside the sticky header. */
.shop .respill b em{margin-left:2px}

/* Cards that only the real game has. */
.sh-quick{display:flex;flex-direction:column;gap:8px}
.sh-quick .seg button{min-height:44px}
.sh-upkeep .list .li{gap:8px}
.sh-upkeep .li .btn{padding:0 12px}
.sh-market .ic{color:var(--text-2);flex:none}
.sh-tools{gap:8px}
.sh-dismiss summary{display:flex;align-items:center;gap:6px;min-height:44px;cursor:pointer;font:600 var(--f14)/1.2 var(--ui);color:var(--text);list-style:none}
.sh-dismiss summary::-webkit-details-marker{display:none}
.sh-dismiss summary::before{content:"";width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);margin:0 4px 0 2px;transition:transform .15s}
.sh-dismiss[open] summary::before{transform:rotate(45deg)}
.sh-dismiss .row{gap:8px;padding-top:4px}
.sh-dismiss .btn .pc-ic{width:22px;height:22px}

/* Enemy card: on a phone one compact strip (next enemy + win reward); the full card is for wide screens. */
.sh-enemy .over,.sh-enemy .sh-enemy-strip,.sh-enemy .facts{display:none}
.sh-enemy .sh-next{margin:0}
.shop .stage>.panel{display:flex;flex-direction:column;gap:12px}
.shop .armycard .board.rows2{margin:5px}

/* Undo toast: above the docked button. */
.sh-toast{position:fixed;left:16px;right:16px;bottom:calc(92px + var(--safe-b));z-index:35;max-width:560px;margin:0 auto}
.sh-toast .btn{font-weight:700}

/* Sheets */
.sh-sheetbar{position:static;margin:0;padding:0;background:none}
.sh-custom summary{display:flex;align-items:center;min-height:44px;cursor:pointer;font:700 var(--f14)/1.2 var(--ui)}
.sh-custom .seg button{min-height:44px}
.sh-custom .sh-amt{min-width:44px;text-align:center;font:700 var(--f19)/1 var(--ui)}
.sh-custom .iconbtn{font:700 var(--f19)/1 var(--ui);color:var(--text)}
.sh-ledger .li{min-height:52px;flex-wrap:wrap;gap:4px 12px}
.sh-ledger .li .grow{min-width:150px}
.sh-ledger .sum{border-top:1.5px solid var(--line-strong);font-weight:700}
.sh-trip{gap:10px}
#shop-market,#shop-info{max-height:88vh;overflow:auto}

@media (max-width:359px){
  .shop .ushop .desc{font-size:var(--f13)}
  .sh-toast{bottom:calc(80px + var(--safe-b))}
}
@media (min-width:1024px){
  .sh-enemy .over,.sh-enemy .facts{display:block}
  .sh-enemy .facts{display:flex}
  .sh-enemy .sh-enemy-strip{display:block}
  .sh-enemy .sh-next{display:none}
  .shop .stage>.panel{gap:16px}
  .sh-toast{left:auto;right:40px;bottom:32px;width:420px}
}
.sh-income summary{display:flex;align-items:center;gap:10px;min-height:44px;cursor:pointer;list-style:none}
.sh-income summary::-webkit-details-marker{display:none}
.sh-income summary::after{content:"";width:9px;height:9px;border-right:2px solid var(--text-2);border-bottom:2px solid var(--text-2);transform:rotate(45deg);margin-right:6px;flex:none}
.sh-income[open] summary::after{transform:rotate(-135deg)}
.sh-income .sh-ledger{margin-top:8px}
.shop .ushop .costs{gap:4px 12px}

/* ---- p3 review fixes ---- */
/* Unit cards: smaller crest and nowrap costs so three prices plus a struck price stay on one line at 390. */
.shop .ushop{gap:6px 10px;padding:12px}
.shop .ushop>.pc-ic,.shop .ushop>:first-child:not(.grow){width:44px;height:44px}
.shop .ushop .costs{flex-wrap:nowrap;gap:4px 9px}
.shop .ushop .res{font-size:var(--f15,15px);gap:3px}
.shop .ushop .res .ic{width:16px;height:16px}
.shop .ushop .res .was{margin-left:2px;font-size:.75em}
.shop .ushop .sh-buy{min-width:60px;padding:0 12px}
.shop .res.short{text-decoration:none;color:var(--danger-text,#FF9A8B)}
[data-theme="light"] .shop .res.short{color:#A32A1A}
@media (max-width:359px){.shop .ushop .costs{flex-wrap:wrap}}
/* One selected style everywhere: filled. */
.sh-quick .seg>.on,#shop-market .seg>.on{background:var(--text);color:var(--bg);box-shadow:none}
.sh-quick .seg>.on .ic,#shop-market .seg>.on .ic{color:var(--bg)}
/* Disabled Start round stays a filled, dimmed primary (not a dashed outline). */
.shop .dock .btn.primary[disabled]{background:linear-gradient(var(--accent-hi),var(--accent));color:var(--on-accent);box-shadow:none;outline:0;opacity:.5}
/* Content never ends under the docked button; stronger fade above it. */
.shop .main,.shop .panel{padding-bottom:0}
@media (max-width:1023px){.shop .stage{padding-bottom:calc(112px + var(--safe-b))}}
.dock::before{height:44px}
.shop .armycard .over{white-space:nowrap}
.sh-market .btn{min-width:64px}
/* Desktop: Start round is the first thing in the right column. */
@media (min-width:1024px){.shop .panel .dock{order:-1;margin-top:0}}
/* Light theme: borders and tracks that read on cream. */
[data-theme="light"] .shop .card,[data-theme="light"] .shop .respill,[data-theme="light"] .shop .banner{border-color:var(--line-strong)}
[data-theme="light"] .shop .ushop .btn.sm:not([disabled]),[data-theme="light"] .shop .sh-market .btn:not([disabled]){box-shadow:inset 0 0 0 1.5px var(--line-strong),0 2px 0 var(--line-strong)}

/* ---- r5: compact army, plainer cards ---- */
.shop .sh-armytext{margin:0;font:500 var(--f14)/1.35 var(--ui);color:var(--text)}
.shop .sh-strip{display:none}
@media (min-width:1024px){.shop .sh-strip{display:block}.shop .sh-armytext{display:none}}
.shop .sh-event{margin:0}
.shop .sh-tools .btn{flex:1 1 0}
.shop .ushop .fix{border-top:0;padding-top:0}
/* r5: brighter secondary text (contrast) and a quiet close in the market sheet */
.shop .muted,#shop-market .muted,#shop-info .muted{color:var(--text);opacity:.82}
[data-theme="light"] .shop .muted{color:var(--text);opacity:.78}
#shop-market .btn.quiet{background:transparent;box-shadow:none;color:var(--text-2)}
