:root { font: 16px/1.45 system-ui,sans-serif; color:#362b25; background:#f6f0e5; --paper:#fffaf1; --accent:#3b574a; --line:#d9c9b5; color-scheme:light; }
* { box-sizing:border-box; }
body { margin:0; }
main { max-width:1040px; padding:clamp(12px,3vw,36px); margin:auto; }
h1,h2,p { margin:0; }
h1 { font-size:clamp(25px,4vw,40px); line-height:1.1; letter-spacing:.02em; }
h2 { font-size:1.2rem; }
.brand { color:#665647; font-size:.85rem; letter-spacing:.12em; margin-bottom:5px; }
header,.bar, .dialog-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
header { justify-content:space-between; margin-bottom:14px; }
button, input, select { font:inherit; max-width:100%; }
button, select { min-height:44px; padding:7px 13px; border:1px solid var(--line); border-radius:10px; background:var(--paper); color:inherit; }
button { cursor:pointer; }
button:disabled { opacity:.48; cursor:default; }
button:focus-visible { outline:3px solid #346851; outline-offset:2px; }
.primary,button[aria-pressed=true] { background:var(--accent); color:white; border-color:transparent; }
[hidden] { display:none !important; }
#roomFrame { position:relative; }
#scene { --shelf-frame:clamp(4px,.9vw,10px); position:relative; overflow:hidden; isolation:isolate; aspect-ratio:1.45; border:1px solid #caba9f; border-radius:18px; background:#ece0cb; }
.wall { position:absolute; background:linear-gradient(102deg,#decab0,#f8ecda 65%,#ead8bd); }
.desk { position:absolute; left:4%; top:58%; width:23%; height:26%; border-top:clamp(4px,.75vw,9px) solid #654631; border-left:clamp(3px,.56vw,7px) solid #775437; border-right:clamp(3px,.56vw,7px) solid #775437; }
.monitor { position:absolute; bottom:106%; left:13%; width:65%; height:105%; border:clamp(2px,.45vw,5px) solid #393b35; border-radius:5px; background:linear-gradient(145deg,#314b48,#71978a); box-shadow:2px 3px 0 #a9977c; }
.monitor::after { content:''; position:absolute; top:100%; height:24%; width:12%; left:44%; background:#393b35; }
.keyboard { position:absolute; bottom:102%; left:20%; width:54%; height:7%; background:#45413a; }
.chair { position:absolute; left:10%; top:70%; width:11%; height:19%; border:0 solid #795844; border-width:7px 3px 0; border-radius:8px 7px 0 0; }
.window { position:absolute; left:77%; top:17%; width:19%; height:34%; border:clamp(3px,.7vw,8px) solid #967253; background:linear-gradient(#a4c1b5,#e6ead4 80%); box-shadow:0 4px #b69574; }
.window i { position:absolute; inset:0; background:linear-gradient(90deg,transparent 48%,#967253 48% 53%,transparent 53%),linear-gradient(transparent 49%,#967253 49% 53%,transparent 53%); }
.window::before,.window::after { content:''; position:absolute; z-index:1; top:-7%; bottom:-7%; width:23%; background:repeating-linear-gradient(90deg,#8c9a78 0 22%,#a8ac89 22% 43%); border-radius:5px 5px 37% 37%; }
.window::after { right:0; }
.plant { position:absolute; left:83%; top:72%; width:9%; height:14%; background:linear-gradient(90deg,#ab6951,#c88b70); clip-path:polygon(-45% -130%,145% -130%,145% 0,82% 100%,18% 100%); border-top:4px solid #9e604a; }
.plant i { position:absolute; width:48%; height:118%; left:26%; bottom:100%; border-radius:100% 0 100% 0; background:#607e50; transform-origin:50% 100%; transform:rotate(-35deg); }
.plant i:nth-child(2) { transform:rotate(18deg); background:#7d945f; }
.plant i:nth-child(3) { transform:rotate(54deg); }
#shelfArea { position:absolute; inset:10% 26% 13% 27%; }
#scene[data-scope=shelf] #shelfArea { inset:6% 8%; }
#scene[data-scope=shelf] :is(.desk,.chair,.window,.plant,.floor) { display:none; }
#scene[data-scope=shelf] .wall { inset:0; border:0; }
#shelfArt,#backdropFrame,#shelfBoards,#openShelf,#figures { position:absolute; inset:0; }
#openShelf { border:0; background:transparent; width:100%; height:100%; border-radius:0; }
#shelfArt,#figures { pointer-events:none; }
#shelfArt {
  --board-inset:5%;
  --board-fill:linear-gradient(#d2a773 0 65%,#795136 68%,#a67950 100%);
  --shelf-back:linear-gradient(90deg,#926949 0%,#ac845d 7%,#a77f59 92%,#674730 100%);
  background:#886143;
  border:var(--shelf-frame) solid #785336;
  box-shadow:5px 7px 0 #61514340;
}
#backdropFrame {
  background:var(--shelf-back);
  clip-path:polygon(var(--board-inset) 0,calc(100% - var(--board-inset)) 0,
    100% 7%,100% var(--bottom-board-edge),0 var(--bottom-board-edge),0 7%);
}
#backdrop { position:absolute; }
#shelfBoards { z-index:2; }
.shelf-board { position:absolute; inset-inline:0; }
.board-shape {
  position:absolute;
  inset:0;
  background:var(--board-fill);
  clip-path:polygon(var(--board-inset) 0,calc(100% - var(--board-inset)) 0,
    100% var(--board-front),100% 100%,0 100%,0 var(--board-front));
}
.board-top { position:absolute; inset-block:0 35%; }
:is(.board-top,.texture-preview)[data-pattern=space] {
  background:radial-gradient(circle at 30% 28%,#eae7fc 0 .7px,transparent 1.4px) 0 0/21px 13px,
    radial-gradient(circle at 67% 72%,#c6bdff 0 1px,transparent 1.6px) 0 0/37px 19px,
    linear-gradient(112deg,#161b3a,#574171 52%,#202547);
}
:is(.board-top,.texture-preview)[data-pattern=moon] {
  background:radial-gradient(ellipse at 30% 40%,#747279 0 13%,#a9a6aa 16% 20%,transparent 23%) 0 0/35px 17px,
    radial-gradient(ellipse at 66% 58%,#838188 0 8%,transparent 12%) 0 0/22px 12px,#aaa7a8;
}
:is(.board-top,.texture-preview)[data-pattern=brick] {
  background:repeating-linear-gradient(0deg,transparent 0 5px,#dec2a2 5px 6px),
    repeating-linear-gradient(90deg,#a45c44 0 14px,#bf7156 14px 27px,#dec2a2 27px 28px);
}
:is(.board-top,.texture-preview)[data-pattern=grass] {
  background:repeating-linear-gradient(120deg,transparent 0 4px,#d2d99155 4px 5px,transparent 5px 9px),
    repeating-linear-gradient(97deg,#63834b 0 3px,#799755 3px 8px,#46673d 8px 10px);
}
#figures { display:contents; }
:is(#backdrop,.texture-preview)[data-theme=moon] { background:radial-gradient(circle at 79% 23%,#a4b4d0 0 5%,transparent 5.4%),radial-gradient(ellipse 92% 35% at 48% 106%,#716e6e 0 79%,#a09687 80%,transparent 82%),radial-gradient(circle at 30% 32%,#faf3db 0 1px,transparent 2px) 0 0/37px 41px,#242638; }
:is(#backdrop,.texture-preview)[data-theme=space] { background:radial-gradient(circle at 31% 36%,#fff 0 1px,transparent 2px) 0 0/43px 37px,radial-gradient(ellipse at 70% 65%,#744d79,#282847 49%,#131829 80%); }
.figure,.figure-frame { position:absolute; width:calc(var(--projected-size) * var(--body-width,1)); aspect-ratio:var(--body-ratio,1);
  transform:translate(calc(-100% * var(--anchor-x,.5)),calc(-100% * var(--anchor-y,1))) rotate(var(--rotation,0deg)); }
.figure { z-index:5; display:grid; place-items:center; min-height:0; padding:0; border:0; border-radius:0; background:none; touch-action:manipulation; }
.figure-photo { position:absolute; inset:0; pointer-events:none; }
.photo-crop { overflow:hidden; }
.photo-crop img { position:absolute; display:block; max-width:none; pointer-events:none; }
.figure-placeholder { position:absolute; inset:0; display:grid; place-items:center; overflow:hidden; overflow-wrap:anywhere;
  background:#eee4d3; border-radius:8px; padding:3px; font-size:.875rem; pointer-events:none; }

#scene[data-editing=true] .figure { touch-action:none; cursor:grab; }
.room-arrow { position:absolute; z-index:8; top:50%; transform:translateY(-50%); font-size:26px; line-height:1; min-width:44px; }
#prevRoom { left:3px; } #nextRoom { right:3px; }
#actions,#edit,#card,#detail { margin-top:12px; }
#edit,#controls { display:grid; gap:9px; }
#card button { display:grid; width:100%; justify-items:start; gap:3px; }
#card span { font-size:.87rem; }
#detail { display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start; }
#detailPreview,.registration-preview { display:grid; place-items:center; justify-self:center; width:min(100%,55svh); aspect-ratio:1;
  background:#eee4d3; border-radius:12px; touch-action:pan-y; }
.detail-photo { position:relative; width:calc(100% * var(--body-width)); height:calc(100% * var(--body-height)); }
#detail .bar { margin-top:12px; }
dialog { color:inherit; background:var(--paper); width:min(94vw,520px); max-height:88svh; border:1px solid var(--line); border-radius:16px; padding:16px; }
dialog::backdrop { background:#29271c75; }
#dialogBody,.form-grid { display:grid; gap:12px; }
label { display:inline-flex; flex-wrap:wrap; gap:5px; align-items:center; }
.form-grid label { display:grid; }
.choice-list { display:grid; gap:6px; }
.choice-list button { text-align:left; }
.angles { display:grid; grid-template-columns:repeat(3,1fr); gap:5px; }
.angles button { padding:6px; display:grid; justify-items:center; gap:3px; font-size:.85rem; }
.angles img { width:auto; height:auto; max-width:38px; max-height:38px; }
.cube-widget { display:grid; justify-items:center; gap:8px; }
.cube-stage { width:156px; height:134px; display:grid; place-items:center; perspective:360px; }
.cube { position:relative; width:76px; height:76px; transform-style:preserve-3d; transition:transform .35s ease; }
.cube button { position:absolute; inset:0; width:100%; border-radius:3px; border:1px solid #8f775d;
  background:#eee0c4; backface-visibility:hidden; padding:0; }
.cube button[aria-pressed=true] { background:var(--accent); }
.cube [data-tag=front] { transform:translateZ(38px); }
.cube [data-tag=right] { transform:rotateY(90deg) translateZ(38px); }
.cube [data-tag=left] { transform:rotateY(-90deg) translateZ(38px); }
.cube [data-tag=back] { transform:rotateY(180deg) translateZ(38px); }
.cube [data-tag=top] { transform:rotateX(90deg) translateZ(38px); }
.cube [data-tag=bottom] { transform:rotateX(-90deg) translateZ(38px); }
@media (prefers-reduced-motion:reduce) { .cube { transition:none; } }
@media (max-width:560px) {
  #scene { aspect-ratio:1 / 1.12; }
  #scene[data-scope=shelf] { aspect-ratio:1 / 1.02; }
  #shelfArea { inset:14% 24% 16%; }
  #detail { grid-template-columns:1fr; }
  button,select { padding-inline:9px; }
}
.figure { pointer-events:auto; }
.figure-frame { z-index:7; pointer-events:none; }

#roomFrame { touch-action:pan-y; }
#roomFrame:has(#scene[data-scope=shelf]:not([hidden])) { touch-action:auto; }
#lockedRoom { aspect-ratio:1.45; display:grid; place-items:center; border-radius:18px; overflow:hidden;
  background:radial-gradient(ellipse at 55% 32%,#9fb3a2,#566e65 58%,#374a46); }
@media (max-width:560px) { #lockedRoom { aspect-ratio:1 / 1.12; } }
#scene[data-window=none] .window { display:none; }
#scene[data-window=rounded] .window { border-radius:50%; overflow:hidden; }
#scene[data-window=rounded] .window i { background:linear-gradient(90deg,transparent 48%,#967253 48% 53%,transparent 53%); }
#scene[data-scenery=sunset] .window { background:linear-gradient(#71567c,#ec9676 65%,#f8d79d); }
#scene[data-scenery=night] .window { background:radial-gradient(circle at 70% 25%,#faf3c8 0 6%,transparent 7%),#222e50; }
#scene[data-curtain=none] .window::before,#scene[data-curtain=none] .window::after { display:none; }
#scene[data-curtain=linen] .window::before,#scene[data-curtain=linen] .window::after {
  background:repeating-linear-gradient(90deg,#dbcab1 0 22%,#eee1cb 22% 43%); }
#scene[data-shelf-style=light] #shelfArt { --shelf-back:#d2bfa4; --board-fill:linear-gradient(#e4d0b2 65%,#b99d78 68%); background:#c2a782; border-color:#b99d78; }
#scene[data-shelf-style=dark] #shelfArt { --shelf-back:#53413b; --board-fill:linear-gradient(#826352 65%,#402c24 68%); background:#48332a; border-color:#402c24; }
.edit-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:4px 2px 9px; }
.edit-toolbar > * { flex:none; max-width:100%; }
.edit-toolbar label { flex-wrap:nowrap; }
.edit-toolbar select { max-width:clamp(130px,30vw,300px); }
.area-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px;
  border:6px solid #785336; padding:5px; background:#b88b60; }
.handles { position:absolute; inset:0; outline:2px dashed #fff7cf; pointer-events:none; }
.handles span { position:absolute; width:28px; height:28px; display:grid; place-items:center;
  transform:translate(-50%,-50%); pointer-events:auto; touch-action:none; }
.handles span::before { content:''; width:13px; height:13px; border:2px solid #315444; background:white; box-shadow:0 0 2px #30251d; }
.handles [data-handle=move] { left:0; top:50%; cursor:move; }
.handles [data-handle=scale] { left:100%; top:100%; cursor:nwse-resize; }
.handles [data-handle=rotate] { left:100%; top:0; cursor:crosshair; }
.handles [data-handle=rotate]::before { background:#f8ca77; }

.tiles { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.tiles > * { min-height:105px; border-radius:14px; }
.tiles button { background:#e4e8d7; color:#25392d; font-size:1.05rem; }
#collectionList,.registration-form { margin-bottom:16px; }
.registration-form { display:grid; gap:12px; }
.registration-images { display:grid; align-content:start; gap:10px; min-width:0; }
.registration-preview { min-width:0; overflow:hidden; }
.registration-preview p { padding:12px; text-align:center; }
.registration-shelf h3 { margin:0 0 5px; font-size:1rem; }
.registration-fields { display:grid; gap:8px; min-width:0; }
.registration-fields > p { margin:0; }
.registration-fields fieldset { min-width:0; border:1px solid #caba9f; border-radius:10px; }
.registration-fields textarea { width:100%; min-height:64px; font:inherit; }
.chips button { border-radius:999px; }
.registration-form > p { margin:0; }
.registration-form > p:empty { display:none; }
#goHome { margin-top:12px; }
@media (min-width:760px) {
  .registration-form { grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:start; }
  .registration-form > :is(label,p,.registration-footer) { grid-column:1 / -1; }
}
dialog:has(.registration-form) { width:min(94vw,960px); }
.registration-form label { display:grid; }
.registration-fields .bar label { flex:1; min-width:0; }
.registration-photos { display:grid; gap:9px; }
.photo-subject { font-weight:600; overflow-wrap:anywhere; }
#offlineStatus { margin-bottom:14px; padding:9px 12px; background:#e6ede5; border-radius:8px; }
#updateNotice { margin-block:8px 12px; }
#updateDialog .bar { justify-content:flex-end; }
#shelfWorkspace[data-pattern-open=true] {
  display:grid; gap:10px;
  height:max(310px,calc(100dvh - 108px));
  grid-template-rows:minmax(100px, .85fr) minmax(0,1fr);
}
#shelfWorkspace[data-pattern-open=true] #roomFrame { display:grid; place-items:center; container-type:size; }
#shelfWorkspace[data-pattern-open=true] #scene {
  --scene-ratio:1.45;
  width:min(100cqw,calc(100cqh * var(--scene-ratio)));
  aspect-ratio:var(--scene-ratio);
}
@media (max-width:560px) {
  #shelfWorkspace[data-pattern-open=true] #scene[data-scope=shelf] { --scene-ratio:calc(1 / 1.02); }
}
@media (orientation:landscape) and (min-width:540px) {
  #shelfWorkspace[data-pattern-open=true] {
    height:max(240px,calc(100dvh - 118px));
    grid-template-columns:minmax(0,1fr) minmax(250px,.65fr);
    grid-template-rows:minmax(0,1fr);
  }
}
#shelfPatternPanel {
  min-width:0; padding:8px; background:var(--paper); border:1px solid var(--line); border-radius:12px;
  display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:8px;
}
#shelfPatternPanel > .bar { justify-content:flex-end; }
.pattern-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.pattern-tabs [aria-selected=true] { background:var(--accent); color:white; border-color:transparent; }
.pattern-pane { display:grid; align-content:start; gap:8px; padding:3px; overflow:auto; }
.texture-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.texture-choices button { display:grid; grid-template-rows:clamp(70px,12vw,100px) auto; gap:4px; align-content:start; padding:5px; font-size:.85rem; overflow-wrap:anywhere; }
.texture-preview { border-radius:4px; background:repeating-linear-gradient(4deg,var(--grain,#ab845f) 0 3px,var(--wood,#bb9268) 3px 8px); }
#shelfPatternPanel[data-shelf-style=light] { --grain:#d2bfa4; --wood:#e4d0b2; }
#shelfPatternPanel[data-shelf-style=dark] { --grain:#53413b; --wood:#826352; }

dialog.photo-editor { width:min(96vw,680px); max-height:calc(100dvh - 18px); padding:clamp(9px,3vw,16px); }
.photo-editor[open],.cutout-preview,.cutout-color-settings { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
.cutout-sources:has(.cutout-backdrop) { flex-wrap:nowrap; justify-content:space-between; }
.cutout-backdrop { flex:none; flex-wrap:nowrap; font-size:.9rem; }
.cutout-view-tools button { min-width:44px; }
.cutout-view-tools output { min-width:3.3em; text-align:center; font-variant-numeric:tabular-nums; }
.cutout-subject { overflow-wrap:anywhere; }
.cutout-camera { display:none; }
@media (pointer:coarse) { .cutout-camera { display:inline-block; } }
.cutout-guide { padding:8px 10px; border:1px solid var(--line); border-radius:8px; }
.cutout-guide summary { cursor:pointer; font-weight:600; padding-block:5px; }
.cutout-guide p { margin-top:7px; font-size:.9rem; }
.cutout-status:empty,.cutout-notice:empty,.cutout-holder:empty,.cutout-hint:empty,.cutout-swatches:empty { display:none; }
.cutout-status,.cutout-notice { color:#7a391e; }
.cutout-viewport { position:relative; height:clamp(120px,40svh,380px); overflow:clip; border-radius:8px; background:#eee6d9; }
.cutout-stage {
  position:absolute; top:50%; left:50%; overflow:hidden;
  background:repeating-conic-gradient(#e6e4de 0% 25%,#fff 0% 50%) 50% / 20px 20px;
}
.cutout-viewport[data-moving=true] { touch-action:none; cursor:grab; }
.cutout-viewport[data-moving=true]:active { cursor:grabbing; }
.cutout-confirmation { background:#f4e1c8; padding:8px; border-radius:7px; min-height:44px; }
.cutout-confirmation input { width:1.2rem; height:1.2rem; accent-color:var(--accent); }
.cutout-stage[data-backdrop=light],.crop-picture[data-backdrop=light] { background:#fff; }
.cutout-stage[data-backdrop=dark],.crop-picture[data-backdrop=dark] { background:#242526; }
.cutout-stage canvas { display:block; width:100%; height:auto; }
.cutout-stage canvas[data-color-tool=true] { cursor:crosshair; }
.cutout-stage canvas[data-brush=true] { touch-action:none; cursor:crosshair; }
.cutout-brush-ring {
  position:absolute; aspect-ratio:1; border:1px solid white; outline:1px solid #262626; border-radius:50%;
  transform:translate(-50%,-50%); pointer-events:none;
}
.cutout-swatch::before {
  content:''; display:inline-block; width:1.1rem; height:1.1rem; margin-inline-end:5px; vertical-align:-.18em;
  border:1px solid currentColor; border-radius:3px; background:var(--swatch);
}
.cutout-range { display:grid; grid-template-columns:1fr auto; gap:1px 8px; }
.cutout-range input { grid-column:1 / -1; width:100%; min-height:32px; margin:0; accent-color:var(--accent); }
.cutout-hint { font-size:.87rem; }
.cutout-actions { position:sticky; bottom:-16px; padding-block:8px 4px; z-index:1; background:var(--paper); }
.cutout-actions .primary { flex:1; }
.crop-preview { display:grid; gap:8px; }
.crop-preview h3 { margin:0; font-size:1rem; }
.crop-picture { position:relative; justify-self:center; overflow:hidden; width:min(100%,calc(36svh * var(--crop-ratio)));
  background:repeating-conic-gradient(#d6cfc6 0 25%,#faf7ee 0 50%) 0 0 / 18px 18px; }
.crop-picture canvas { display:block; width:100%; height:auto; }
.crop-frame { position:absolute; box-shadow:0 0 0 1000px #211c175e; outline:2px solid #fff; outline-offset:-2px;
  border:1px solid #25392d; pointer-events:none; }
.crop-dimensions { text-align:center; font-variant-numeric:tabular-nums; }
.crop-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 12px; }

.header-actions { display:flex; gap:14px; flex-wrap:wrap; }
#scene {
  --floor-start:71%;
  --floor-inset:12%;
  --corner-start:0%;
  --shelf-foot:calc(var(--floor-start) + 4%);
}
#scene[data-scope=room] {
  background:linear-gradient(90deg,#b39a7f,#d4bc9f 15%,#d9c2a8 82%,#bda285);
}
#scene[data-scope=room] .wall {
  inset:var(--corner-start) var(--floor-inset) calc(100% - var(--floor-start));
  border:1px solid #92765d;
  border-width:0 2px 2px;
}
#scene[data-scope=room] .wall::before {
  content:''; position:absolute; bottom:100%; left:-2px; right:-2px; height:100vh;
  background:inherit;
}
.floor {
  position:absolute; inset:var(--floor-start) 0 0;
  clip-path:polygon(var(--floor-inset) 0,calc(100% - var(--floor-inset)) 0,100% 100%,0 100%);
  background:linear-gradient(#ad8965,#d9b795 62%,#e5c6a5);
}
.floor::before {
  content:''; position:absolute; inset:0; opacity:.65;
  background:repeating-linear-gradient(180deg,transparent 0 21%,#936f515c 22% 23%,transparent 24% 28%);
}
#scene[data-scope=room] #shelfArea { bottom:calc(100% - var(--shelf-foot)); }
#scene[data-scope=room] .window { left:75%; width:12%; height:auto; aspect-ratio:4 / 5; }
#scene[data-scope=room][data-window=rounded] .window { aspect-ratio:1; }
#scene[data-scope=room] .desk { left:14%; width:12%; height:19%; top:62%; }
#scene[data-scope=room] .chair { left:15%; width:9%; height:15%; }
#scene[data-scope=shelf] .wall { background:linear-gradient(#ead7be 82%,#c8a785 82%,#dfc09c); }

.collection-entry {
  display:grid; grid-template-columns:56px minmax(0,1fr); gap:12px; align-items:center; width:100%;
}
.collection-entry > span:last-child { display:grid; overflow-wrap:anywhere; }
.collection-entry small { color:#665647; }
.collection-thumb {
  display:grid; place-items:center; width:56px; height:56px; overflow:hidden;
  background:#ece1d1; border-radius:6px; font-size:.62rem; text-align:center;
}
.collection-thumb:has(img) { background:transparent; }
.collection-thumb img { display:block; width:auto; height:auto; max-width:100%; max-height:100%; }
#detailFields { display:grid; grid-template-columns:auto minmax(0,1fr); gap:7px 12px; }
#detailFields dd { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
#detailNoPhoto { padding:2rem; text-align:center; background:#eee4d3; border-radius:12px; }
.position-pad {
  display:grid; grid-template:repeat(3,44px) / repeat(3,44px); gap:5px; width:max-content; justify-self:center;
}
.position-pad button:nth-child(1) { grid-area:1 / 2; }
.position-pad button:nth-child(2) { grid-area:2 / 1; }
.pad-center { grid-area:2 / 2; }
.position-pad button:nth-of-type(3) { grid-area:2 / 3; }
.position-pad button:nth-of-type(4) { grid-area:3 / 2; }
.position-center { justify-self:center; }
.gauges { display:grid; gap:12px; width:min(100%,500px); }
.gauges > div { display:grid; grid-template-columns:5.5rem minmax(0,1fr) 5.5rem; gap:4px 8px; align-items:center; }
.gauges label { grid-column:1 / 3; }
.gauges input { width:100%; margin:0; accent-color:var(--accent); }
.gauges output { text-align:right; font-variant-numeric:tabular-nums; }
.gauges button { padding-inline:4px; }
.rotation-side { display:grid; justify-items:center; gap:1px; font-size:.8rem; }
.rotation-side i { color:var(--accent); font:600 1.7rem/1 system-ui,sans-serif; }
.date-fields { display:grid; gap:10px; min-width:0; }
.date-hint { margin:0; font-size:.85rem; color:#665647; }
.date-select { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.date-wheel {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  padding:6px 7px;
  border:1px solid var(--line);
  border-radius:9px;
  background:linear-gradient(#eee7d9,#fffaf1 35% 65%,#eee7d9);
  touch-action:none;
  cursor:ns-resize;
}
.date-wheel:focus-within { outline:2px solid var(--accent); outline-offset:1px; }
.date-wheel::before,.date-wheel::after {
  content:'';
  grid-column:1 / -1;
  justify-self:center;
  width:6px;
  height:6px;
  border:solid var(--accent);
  border-width:2px 2px 0 0;
  transform:rotate(-45deg);
  pointer-events:none;
}
.date-wheel::after { transform:rotate(135deg); }
.date-wheel input {
  width:100%;
  min-width:0;
  min-height:44px;
  padding:0;
  border:0;
  outline:none;
  background:transparent;
  color:inherit;
  text-align:center;
  font-variant-numeric:tabular-nums;
}
.date-wheel span { font-size:.82rem; user-select:none; pointer-events:none; }
.detail-navigation { grid-column:1 / -1; justify-content:space-between; }
#collectionList > .chips { margin:8px 0 12px; }
