.theme-shop {
  --paper: #fbf8f1; --wash: #f2ecdf; --ink: #332f25; --blue: #8f4029;
  --blue-deep: #663121; --line: #d8d1c4; --muted: #625d50;
}
.pop-workshop { padding-block: clamp(28px,4vw,52px) 18px; }
.pop-intro { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding-bottom: clamp(16px,2.4vw,30px); }
.pop-intro h1 { font: 670 clamp(31px,3.65vw,55px)/1.23 "Hiragino Mincho ProN","Yu Mincho","Noto Serif CJK JP",serif; letter-spacing: -.065em; }
.pop-intro h1 span { display: inline-block; color: var(--blue); }
.pop-intro p { max-width: 23em; color: var(--muted); font-size: 14px; line-height: 1.7; }
.pop-workspace { display: grid; grid-template-columns: minmax(0,1.18fr) minmax(0,1fr); background: #fffdf8; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pop-model,.pop-controls { min-width: 0; padding: clamp(18px,2.5vw,34px); }
.pop-controls { border-left: 1px solid var(--line); background: #f7f1e7; }
.pop-workspace fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.pop-workspace legend { padding: 0; margin-bottom: 10px; color: var(--ink); font-size: 17px; font-weight: 760; letter-spacing: -.03em; }
.size-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.size-choice { display: block; min-width: 0; position: relative; }
.size-choice input { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.size-choice > span { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; min-height: 45px; padding: 6px; border: 1px solid #bdb3a4; border-radius: 4px; background: #fffdf8; color: #514a40; }
.size-choice b { font: 750 19px/1.1 var(--figures); }
.size-choice small { font-size: 11px; white-space: nowrap; }
.size-choice input:checked + span { border: 2px solid var(--blue); padding: 5px; background: #f9e7d8; color: #733821; }
.size-choice input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.tabletop { margin-top: 13px; }
.table-scene {
  container-type: inline-size; position: relative; isolation: isolate; overflow: hidden;
  height: clamp(237px,24vw,315px); border-radius: 4px;
  background: linear-gradient(110deg,rgba(255,250,229,.48),transparent 68%),
              linear-gradient(to bottom,#b7c3a9 0%,#c4cfb5 71.5%,#bc946b 72%,#dfbb91 73%,#e5c49e 100%);
}
.table-scene::before { content: ""; position: absolute; inset: 73% 0 0; background: repeating-linear-gradient(1deg,transparent 0 10px,rgba(111,70,40,.055) 11px,transparent 12px 19px); }
.scene-objects {
  --scene-unit: clamp(.48px,.214cqw,.83px);
  position: absolute; inset-inline: 0; bottom: 11%; display: flex; justify-content: center; align-items: flex-end; gap: calc(25 * var(--scene-unit));
}
.paper-object {
  position: relative; container-type: inline-size; flex: none; width: calc(var(--paper-width,105) * var(--scene-unit)); height: calc(var(--paper-height,148) * var(--scene-unit));
  border: 1px solid #c3a783; background: #f8ecd1; box-shadow: 4px 4px 1px #bfa480,5px 8px 10px #6f533c42;
  transition: width .2s ease,height .2s ease;
}
.echo-paper { position: absolute; inset: 0; background: linear-gradient(152deg,#f2e4c6 0 65%,#dbb797 65% 83%,#b87555 83%); border: 1px solid #bba27f; box-shadow: 2px 3px 2px #74543744; }
.echo-near { transform: translate(5%,-1.1%) rotate(1deg); }
.echo-far { transform: translate(10%,-2.2%) rotate(2deg); }
.paper-height { position: absolute; z-index: 1; top: 0; bottom: 0; right: calc(100% + 7px); width: 5px; border: solid #52624d; border-width: 1px 0 1px 1px; }
.paper-height b { position: absolute; top: 50%; right: 7px; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl; white-space: nowrap; color: #354632; font: 680 10px/1 var(--figures); }
.paper-art { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; background: linear-gradient(152deg,transparent 0 65%,#e9c3a2 65% 83%,#ad5840 83%); color: #442e22; font-family: "Hiragino Mincho ProN","Yu Mincho","Noto Serif CJK JP",serif; line-height: 1.2; }
.paper-art::before { content:""; position:absolute; inset: 5%; border: 1px solid #875c3e88; }
.paper-art small { font-size: 10cqw; letter-spacing: .12em; }
.paper-art b { font-size: 16cqw; letter-spacing: -.08em; }
.paper-bean { position: relative; width: 15cqw; height: 23cqw; border-radius: 54%; transform: rotate(36deg); background: #8b5137; margin-bottom: 7cqw; }
.paper-bean::after { content: ""; position: absolute; inset: -1px 40% -1px 40%; border-left: 1.4cqw solid #f7ecd3; border-radius: 50%; }
.print-rule { width: 25%; height: 1px; background: currentColor; margin-top: 7%; }
.scale-mug { display: block; height: calc(90 * var(--scene-unit)); width: auto; flex: none; filter: drop-shadow(3px 5px 3px #76563750); }
.tabletop figcaption { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; margin-top: 9px; }
.tabletop figcaption strong { font: 750 21px/1.2 var(--figures); }
.tabletop figcaption span { font: 500 14px/1.2 var(--figures); }
.tabletop figcaption .model-quantity { margin-left: auto; color: #554733; font: 620 12px/1.5 var(--sans); }
.tabletop figcaption p { flex-basis: 100%; }
.tabletop figcaption p,.pop-assumptions { font-size: 12px; line-height: 1.7; color: var(--muted); }
.pop-assumptions { margin-top: 9px; }
.pop-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding: 4px 0; }
.pop-count label { font-size: 14px; line-height: 1.5; font-weight: 620; }
.num-control { display: inline-flex; align-items: center; gap: 2px; }
.num-control input { width: 58px; min-width: 0; height: 37px; text-align: center; border: 1px solid #c7bdac; border-radius: 3px; background: #fffdf8; color: var(--ink); font: 650 17px/1.3 var(--figures); }
.num-control input[aria-invalid="true"] { border-color: #aa3021; }
.num-control button { display: grid; place-items: center; min-width: 37px; min-height: 37px; border: 0; border-radius: 3px; background: transparent; color: var(--blue); font: 650 20px/1 var(--figures); cursor: pointer; }
.num-control button:hover { background: #e8dac7; }
.run-result { margin-top: 14px; border-top: 2px solid #a09076; }
.run-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 10px; }
.run-total > span { font-size: 15px; font-weight: 720; }
.run-total output { font: 700 clamp(27px,2.8vw,40px)/1.15 var(--figures); letter-spacing: -.04em; color: var(--blue); overflow-wrap: anywhere; }
.print-totals { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0 12px; }
.print-totals div { display: flex; align-items: baseline; gap: 4px; }
.print-totals dt,.run-result > p { font-size: 12px; color: var(--muted); line-height: 1.65; }
.print-totals dd { font: 680 14px/1.6 var(--figures); }
.run-legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11px; line-height: 1.4; }
.run-legend b { font-size: 13px; margin-right: auto; }
.run-legend span { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.run-legend i { width: 11px; height: 11px; border: 1px solid #806b55; }
.legend-used,.cell-ink { background: #c07b54; }
.legend-extra,.cell-spare { background: repeating-linear-gradient(135deg,#fff9ef 0 3px,#bdad95 3px 4px,#fff9ef 4px 5px); }
.sheet-run { display: flex; flex-wrap: wrap; gap: 8px clamp(9px,1.2vw,18px); margin: 8px 0 5px; }
.sheet-run:empty { display: none; }
.run-tile { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; color: #5a4a38; font: 550 11px/1.3 var(--figures); }
.paper-sheet { width: 37px; aspect-ratio: 210 / 297; padding: 2px; display: grid; gap: 1px; border: 1px solid #80715b; background: #fffaf2; box-shadow: 1px 2px 0 #b5a38d66; }
.paper-sheet[data-up="1"] { grid-template: 1fr / 1fr; }
.paper-sheet[data-up="2"] { grid-template: repeat(2,1fr) / 1fr; }
.paper-sheet[data-up="4"] { grid-template: repeat(2,1fr) / repeat(2,1fr); }
.sheet-examples,.cafe-figure { margin: 15px 0 21px; }
.sheet-examples > div { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border: 1px solid var(--line); background: #f6eee1; }
.sheet-examples a { display: grid; justify-items: center; align-items: end; gap: 4px; padding: 13px 4px; color: var(--ink); text-decoration: none; }
.sheet-examples a + a { border-left: 1px solid var(--line); }
.sheet-examples .paper-sheet { width: 44px; }
.sheet-examples strong { font-size: 14px; }
.sheet-examples small,.sheet-examples figcaption,.cafe-figure figcaption { font-size: 12px; color: var(--muted); }
.sheet-examples figcaption,.cafe-figure figcaption { margin-top: 6px; line-height: 1.7; }
.cafe-figure img { display: block; width: 100%; height: auto; max-height: 365px; object-fit: cover; border-radius: 4px; }
@media(max-width:850px) {
  .pop-model,.pop-controls { padding: 18px; }
  .pop-intro { display: block; }
  .pop-intro p { margin-top: 7px; max-width: none; }
  .num-control input { width: 48px; }
}
@media(max-width:700px) {
  .pop-workspace { grid-template-columns: 1fr; }
  .pop-controls { border-left: 0; border-top: 1px solid var(--line); }
  .table-scene { height: clamp(225px,58vw,300px); }
  .scene-objects { --scene-unit: clamp(.50px,.19cqw,.80px); }
  .num-control input { width: 58px; }
  .num-control button { min-width: 44px; min-height: 44px; }
  .pop-workspace legend { font-size: 16px; margin-bottom: 7px; }
  .tabletop { margin-top: 9px; }
}
@media(max-width:390px) {
  .pop-model,.pop-controls { padding: 13px; }
  .table-scene { height: 208px; }
  .size-choice > span { gap: 3px; }
  .size-choice b { font-size: 17px; }
  .pop-intro h1 { font-size: 31px; }
}
@media(prefers-reduced-motion:reduce) { .paper-object { transition: none; } }
@media print { .pop-workspace { display: block; } .size-pick, .num-control button { display: none; } }
