/* Counter dock — loaded last so these anchors win over the older scene/workbench breakpoints.
   The room world is wider than a phone screen (you pan across it), so anything that belongs to
   the screen rather than to the room is fixed to the viewport. Layers stack from the bottom up
   using heights measured in ui.js: paper -> stock tray -> price tag -> the piece itself. */
body[data-screen=end] .camera-ways,body[data-screen=end] .shop-controls-hint{display:none}
.treasure-tag>em>i{display:block;font-style:normal;font-size:8px;line-height:1.5;color:#8a6a45;margin-top:2px}
/* Counterpart read-outs — patience, observed evidence, booked cost, replica claim. They live in the
   top-layer drawer, so they only need to read as the same paper stock as the rest of the folio. */
.patience-meter{display:flex;align-items:center;gap:9px;margin:12px 0 4px;padding:7px 11px;background:#e5d3a8;border:2px solid #1a1610;box-shadow:3px 3px 0 #070d0b66;color:#4c5a3c}
.patience-meter>span{font:11px var(--serif);letter-spacing:.06em}
.patience-meter>b{font:15px/1 var(--sans);letter-spacing:2px;color:#98723f}
.patience-meter>small{flex:1;text-align:right;font:11px/1.5 var(--serif);color:#6d724e}
.patience-0{background:#ecd6b6}.patience-0>b{color:#a45d45}.patience-2>b{color:#5d7a4a}
.bargain-once{margin:6px 0 0;font:11px/1.7 var(--serif);color:#8a6a45}
.confront-evidence{margin:12px 0;padding:9px 11px;background:#e9dcb6;border-left:4px solid #98723f}
.confront-evidence h4{margin:0 0 6px;font:13px var(--display);letter-spacing:.08em;color:#5a6038}
.confront-evidence p{display:flex;gap:8px;margin:4px 0;font:12px/1.7 var(--serif);color:#46553d}
.confront-evidence p>span{flex:none;min-width:44px;color:#98723f;font-size:11px}
.confront-evidence .blind-accusation{display:block;color:#a45d45}
.clue-overview{margin:12px 0 4px;padding:9px 10px;background:#e7d8b0;border:2px solid #1a1610;box-shadow:3px 3px 0 #070d0b55}
.clue-overview h4{margin:0 0 5px;font:12px var(--display);letter-spacing:.07em;color:#5a6038}
.clue-overview>small{display:block;margin-top:6px;font:10px/1.6 var(--serif);color:#8a7954}
.clue-line{display:flex;gap:8px;width:100%;text-align:left;background:transparent;border:0;border-bottom:1px solid #9b895b40;border-radius:0;padding:6px 2px;min-height:34px;color:#46553d;box-shadow:none!important;font-size:12px;line-height:1.7}
.clue-line>span{flex:none;min-width:40px;color:#98723f;font-size:10px}
.clue-line>p{flex:1;margin:0}
.clue-line:hover:not(:disabled){background:#f6e7bb66;border-color:#9c7b45}
.clue-line.current{background:#fcf0cc88;color:#233f2d}
.quote-lines .quote-subtotal{grid-column:1/-1;border-top:1px solid #9b895b55;padding-top:7px;margin-top:3px}
.quote-warning{margin:10px 0 0;padding:8px 11px;background:#efd9b4;border:2px solid #a45d45;color:#8a3626;font:12px/1.75 var(--serif)}
.recipe-cost{display:block;color:#5a6038!important;background:#e6d5aa;padding:4px 7px;border-left:3px solid #98723f;margin:5px 0!important}
.recipe-cost b{color:#7a4b2c;font-weight:400}
.bench-cost-note{margin:11px 0 0;font:11px/1.8 var(--serif);color:#8a7954}
.contract-note{display:block;margin:7px 0 0;font:10px/1.65 var(--serif);color:#7d6a48}
.contract-night .contract-note{margin:0 0 9px;color:#8a7452}
.treasure-tag>em.tag-age{color:#7a6a3f}
.treasure-tag>em.tag-age.staled,.perishable-age.staled{color:#a45d45}
.shop-operation-note{margin:0 0 9px;padding:7px 10px;background:#e9dcb6;border-left:4px solid #98723f;color:#46553d;font:12px/1.7 var(--serif)}

@media(max-width:900px) and (min-height:560px){
  .shop-room{--head-top:110px;--portrait:clamp(84px,13svh,112px);--dock-base:calc(10px + env(safe-area-inset-bottom));--dock-stock:calc(var(--dock-base) + var(--dock-contract,140px) + 8px);--dock-tagtop:calc(var(--dock-stock) + var(--dock-tray,62px) + 8px + var(--dock-tag,80px))}
  .room-day{top:52px;left:auto;right:10px;min-width:0;padding:3px 7px 5px;transform:rotate(-2deg);white-space:nowrap}
  .room-pref{padding-inline:2px;white-space:nowrap}
  /* The arrows live in the gap between the dialogue card and the shelf, never on a stall you can tap. */
  .camera-left,.camera-right{top:calc(var(--head-top) + 142px)}
  .room-day small{display:none}
  .room-day strong{display:inline;font-size:16px;margin-top:0}
  .room-day>span{display:inline;font-size:9px;margin-left:2px}
  .room-customer{position:fixed;left:10px;top:var(--head-top);width:var(--portrait);height:var(--portrait);transform:none;z-index:6}
  .customer-speech{position:fixed;left:calc(10px + var(--portrait) + 8px);right:10px;top:var(--head-top);width:auto;padding:9px 11px;z-index:7}
  .customer-speech:after{display:none}
  .customer-speech h1{font-size:17px;margin:3px 0 5px}
  .customer-speech p{font-size:12px;line-height:1.65}
  .customer-speech footer{font-size:9px;margin-top:6px;padding-top:5px}
  .counter-tray{left:8px;right:8px;bottom:var(--dock-stock)}
  .treasure-tag{position:fixed;left:50%;bottom:calc(var(--dock-tagtop) - var(--dock-tag,80px));transform:translateX(-50%) rotate(-2deg);width:min(280px,calc(100vw - 150px));min-width:0;max-width:none}
  .room-treasure{position:fixed;left:50%;bottom:calc(var(--dock-tagtop) + 6px);width:var(--dock-art,150px);height:var(--dock-art,150px)}
  .empty-counter{position:fixed;left:50%;bottom:calc(var(--dock-tagtop) + 6px);transform:translateX(-50%);width:180px;min-height:110px}
  .counter-transfer-note{position:fixed;left:50%;bottom:calc(var(--dock-tagtop) + 6px);transform:translateX(-50%) rotate(-3deg);width:min(230px,78vw)}
  .counter-bell{position:fixed;right:6px;bottom:calc(var(--dock-tagtop) - var(--dock-tag,80px));width:56px;height:68px;z-index:6}
  .counter-bell>.shop-prop-art{height:44px}
  .counter-bell>span{font-size:10px;line-height:1.3}
  .room-stamp{position:fixed;left:calc(50% + var(--dock-art,150px)/2 - 30px);bottom:calc(var(--dock-tagtop) + 6px + var(--dock-art,150px) - 54px);font-size:22px;padding:4px 9px}
  .scene-tutorial{top:calc(var(--dock-head,240px) + 8px);left:62px;right:62px;width:auto;transform:none;display:flex;align-items:center;gap:8px;padding:5px 9px;font:11px/1.55 var(--serif)}
  .scene-tutorial header{flex:none;flex-direction:column;align-items:flex-start;gap:3px}
  .scene-tutorial p{margin:0}
  .scene-tutorial .tut-skip{min-height:32px;padding:4px 9px;font-size:10px}
  .closed-shop-note{position:fixed;left:50%;top:110px;transform:translateX(-50%);width:min(320px,calc(100vw - 110px))}
  .closed-shop-note p{font-size:12px;max-width:300px}
  .night-counter-book{position:fixed;left:50%;right:auto;transform:translateX(-50%) rotate(-7deg);width:210px;height:144px;bottom:calc(var(--dock-base) + var(--dock-contract,180px) + 26px)}
  .license-scroll{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%) rotate(-1deg);width:calc(100vw - 28px)}
  body[data-camera]:not([data-camera=counter]) .counter-bell,
  body[data-camera]:not([data-camera=counter]) .treasure-tag,
  body[data-camera]:not([data-camera=counter]) .room-treasure,
  body[data-camera]:not([data-camera=counter]) .empty-counter,
  body[data-camera]:not([data-camera=counter]) .counter-transfer-note{opacity:0;pointer-events:none}
}
@media(max-width:900px) and (min-height:560px) and (max-height:700px){
  .shop-room{--head-top:96px;--portrait:clamp(60px,10svh,80px)}
  .room-day{top:50px;padding:2px 6px 4px}
  .room-day strong{font-size:15px}
  .camera-left,.camera-right{top:calc(max(var(--dock-head,0px),var(--head-top) + 100px) + 6px);min-height:40px;width:34px;font-size:22px}
  .customer-speech{padding:7px 9px}
  .customer-speech h1{font-size:14px;margin:2px 0 4px}
  .customer-speech p{font-size:11px;line-height:1.55}
  .customer-speech footer{font-size:8px;margin-top:4px;padding-top:4px}
  .scene-tutorial{font:10px/1.45 var(--serif);padding:4px 8px}
  .room-contract{padding:6px 10px 8px}
  .room-contract>p{font-size:10px;margin-block:4px}
  .contract-top{padding-bottom:1px}
  .contract-top>strong{font-size:23px}
  .contract-taste{font-size:12px!important;padding-top:4px}
  .treasure-tag{width:min(240px,calc(100vw - 140px));padding:4px 10px}
  .treasure-tag>strong{font-size:16px;line-height:1.3}
  .treasure-tag>small,.treasure-tag>span{font-size:8px}
  .counter-tray{padding:4px 6px}
  .tray-slot{width:32px;height:32px}
  .tray-tools .laid-instrument .instrument-art{width:19px;height:24px}
  .tray-tools .laid-instrument>span{font-size:10px}
  .tray-tools .laid-instrument>small{font-size:6px;line-height:1.2}
  .closed-shop-note{top:100px;width:min(300px,calc(100vw - 110px))}
  .closed-shop-note h1{font-size:22px;margin:4px 0}
  .night-brush{font-size:34px}
  .night-counter-book{width:180px;height:124px}
}
/* Wide screens: the same bottom-up dock as the phone — tray, then the price tag, then the piece.
   The tag used to hang across the artwork and cover the name; now each layer owns its own band. */
@media(min-width:901px) and (min-height:621px){
  .shop-room{--dock-artmax:280px}
  .room-customer{top:88px;left:56%;width:min(34svh,320px);height:min(34svh,320px)}
  .treasure-tag{bottom:calc(var(--dock-tray,73px) + 14px)}
  .room-treasure{bottom:calc(var(--dock-tray,73px) + var(--dock-tag,93px) + 30px);width:var(--dock-art,200px);height:var(--dock-art,200px)}
  .empty-counter,.counter-transfer-note{bottom:calc(var(--dock-tray,73px) + var(--dock-tag,93px) + 30px)}
  .room-stamp{bottom:calc(var(--dock-tray,73px) + var(--dock-tag,93px) + 40px)}
}
/* Laptop band: the room is wide but not tall, so the dialogue card lifts above the piece and
   the bell moves out of the contract paper's bay. The world can still be wider than the screen
   here (150svh), so anything anchored to a screen edge is fixed. */
@media(min-width:901px) and (min-height:621px) and (max-height:820px){
  .shop-room{--dock-artmax:210px}
  .customer-speech{position:fixed;top:12%;left:180px;width:clamp(205px,21vw,260px);z-index:7}
  .room-treasure{left:44%}
  .treasure-tag,.empty-counter,.counter-transfer-note{left:44%}
  .room-stamp{left:48%}
  .room-contract:not(.contract-night){right:3%;width:250px}
  .counter-bell{position:fixed;right:calc(3% + 262px);width:92px;height:100px;bottom:16%}
  .counter-bell>.shop-prop-art{height:70px}
  .scene-tutorial{position:fixed;top:calc(var(--dock-head,240px) + 10px);left:180px;right:auto;width:clamp(205px,21vw,260px);transform:none}
  .object-artifice{position:fixed;left:12px;top:30%;bottom:auto;width:100px;height:90px}
  .closed-shop-note{top:12%}
  .night-counter-book{left:40%;width:240px;height:170px}
}
/* Tall desktop: the lesson sits under the dialogue card in the left bay, never across the
   visitor's face or the piece on the counter. */
@media(min-width:901px) and (min-height:821px){
  .scene-tutorial{top:calc(var(--dock-head,240px) + 10px);left:24%;right:auto;width:220px;transform:none}
}
/* Short landscape: the tutorial tucks into the free left bay, clear of the day chit and the tag. */
@media(max-height:620px) and (min-width:761px){
  .customer-speech{left:146px;width:186px;z-index:7}
  /* The purse must stay narrower than the dialogue card's left edge, or English wraps into it. */
  .keeper-purse{left:10px;top:12px;padding:4px 7px}
  .keeper-purse>span{font-size:10px}
  .keeper-purse strong{font-size:18px;margin-left:4px}
  .keeper-purse>small{font-size:8px;margin-top:2px}
  .room-customer{left:auto;right:120px;top:6px;width:76px;height:76px;transform:none}
  .object-artifice{left:auto;right:12px;top:12%;bottom:auto;width:100px;height:90px}
  .room-contract{bottom:calc(8px + var(--dock-tray,62px) + 10px)}
  .contract-night{bottom:calc(8px + var(--dock-tray,62px) + 10px)}
  .treasure-tag{bottom:calc(8px + var(--dock-tray,62px) + 8px)}
  .room-treasure{bottom:calc(8px + var(--dock-tray,62px) + 8px + var(--dock-tag,80px) + 6px)}
  .empty-counter,.counter-transfer-note{bottom:calc(8px + var(--dock-tray,62px) + 8px + var(--dock-tag,80px) + 6px)}
  .room-day{top:104px;left:12px;right:auto;min-width:0;padding:3px 6px 5px;white-space:nowrap}
  .room-day small{display:none}
  .room-day strong{display:inline;font-size:16px;margin-top:0}
  .room-day>span{display:inline;font-size:9px;margin-left:2px}
  .scene-tutorial{top:auto;bottom:calc(8px + var(--dock-tray,62px) + 10px);left:12px;right:auto;width:220px;transform:none;display:flex;align-items:center;gap:7px;padding:5px 8px;font:10px/1.5 var(--serif)}
  .scene-tutorial header{flex:none;flex-direction:column;align-items:flex-start;gap:3px}
  .scene-tutorial p{margin:0}
  .scene-tutorial .tut-skip{min-height:30px;padding:3px 8px;font-size:10px}
  .closed-shop-note{top:6%;width:300px}
  .night-counter-book{left:14px;right:auto;transform:rotate(-7deg);width:180px;height:130px;bottom:12px}
}