:root { font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; color: #243d32; background: #f7f7f2; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; }
button,input,select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible,select:focus-visible,input:focus-visible { outline: 3px solid #dbb832; outline-offset: 3px; }
[hidden] { display: none !important; }
.app-shell { max-width: 1080px; margin: 0 auto; padding: 18px 18px 20px; }
.rack-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 0 8px 18px; }
h1 { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: -.05em; }
.location-filter { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.location-filter select { max-width: 240px; min-height: 40px; padding: 7px 32px 7px 12px; border: 1px solid #ccd4ca; border-radius: 8px; color: #294738; background: #fff; font-size: 13px; font-weight: 600; }
.rack-stage { position: relative; touch-action: pan-y; }
.bin-collection { padding: 16px 24px 18px; border: 8px solid #788079; border-top-width: 10px; border-bottom-width: 13px; border-radius: 5px; background: repeating-linear-gradient(0deg,#27312d15 0 2px,transparent 2px 32px),linear-gradient(95deg,#d4d8ce,#ecede4 48%,#cdd3c8); box-shadow: inset 0 8px 14px #24392a20,0 6px 12px #20352b15; }
.stack-window { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 30px 26px; transform: translateX(var(--drag-x,0px)); }
.stack-bin { --bin-color:#303536; --lid-color:#f4d348; position: relative; display: flex; flex-direction: column; justify-content: center; min-width: 0; width: 100%; height: 208px; padding: 12px 8px 22px; border: 0; background: transparent; color: inherit; text-align: center; user-select: none; transform-style: preserve-3d; touch-action: pan-y; }
.stack-bin::after { content: ''; position: absolute; bottom: 2px; left: -13px; right: -13px; height: 10px; border-top: 2px solid #aab1a6; border-bottom: 2px solid #5a645d; background: linear-gradient(#929d92,#6c786c); box-shadow: 0 7px 8px #24322b24; }
.stack-lid { position: relative; display: block; z-index: 3; width: calc(100% + 8px); height: 24px; flex-shrink: 0; margin: 0 -4px -2px; border: 2px solid #0002; border-radius: 7px 7px 4px 4px; background: linear-gradient(#fff5,#0001),var(--lid-color); box-shadow: 0 4px 2px #0003; }
.stack-lid::before { content: ''; position: absolute; inset: 4px 11px; border: 2px solid #0002; border-radius: 3px; }
.stack-lid i,.stack-lid b { position: absolute; top: 8px; width: 20px; height: 7px; border-radius: 4px; background: #0004; }
.stack-lid i { left: 12px; }.stack-lid b { right: 12px; }
.stack-bin-body { position: relative; display: grid; place-items: center; flex: 1; min-height: 122px; width: 100%; padding: 12px 7px; border: 2px solid #0003; border-top: 0; border-radius: 2px 2px 16px 16px; background: linear-gradient(90deg,#ffffff13,transparent 20% 80%,#0003),var(--bin-color); box-shadow: inset 0 -7px #0002,0 5px 2px #0003; }
.stack-bin-body::before { content: ''; position: absolute; inset: 12px 8px; border-left: 4px solid #ffffff0c; border-right: 4px solid #0002; border-radius: 6px 6px 12px 12px; }
.shelf-label { position: relative; z-index: 2; display: grid; align-content: center; gap: 5px; width: 87%; min-height: 86px; padding: 8px 6px; border: 1px solid #dadbca; border-radius: 5px; color: #29382d; background: #faf9ed; box-shadow: 0 3px 6px #0004; }
.shelf-label strong { font-size: 24px; line-height: 1; letter-spacing: -.035em; }
.label-text { font-size: 12px; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.shelf-label small { color: #788071; font-size: 9px; line-height: 1.2; }
.container-kind { position: absolute; bottom: -14px; left: 0; right: 0; z-index: 3; color: #37463b; font-size: 10px; font-weight: 650; }
.container-hardware,.container-back { pointer-events: none; }
.page-arrow { position: absolute; z-index: 5; top: 50%; transform: translateY(-50%); width: 42px; height: 52px; padding: 0; border: 1px solid #ffffff75; border-radius: 8px; color: #fff; background: #17281bd9; box-shadow: 0 3px 12px #0003; font-size: 24px; line-height: 1; }
.arrow-left { left: -9px; }.arrow-right { right: -9px; }
.page-arrow:disabled { opacity: .28; cursor: default; }
.page-position { margin: 20px 0 0; color: #8a9285; font-size: 11px; font-weight: 600; text-align: center; }
.storage-message { padding: 12px; font-size: 12px; background: #fff1b8; }
.empty-rack { padding: 100px 20px; text-align: center; font-size: 14px; }
/* Each container retains its own front shape and hardware. */
.stack-bin.container-drawer { padding: 12px 10px 25px; }
.container-drawer .container-back { position: absolute; inset: 6px 0 22px; border: 8px solid #735234; border-radius: 2px; background: #261c14; box-shadow: inset 0 4px 12px #0008; }
.container-drawer .stack-lid { display: none; }
.container-drawer .stack-bin-body { border: 3px solid #482f1c88; border-radius: 2px; padding-bottom: 23px; background: repeating-linear-gradient(2deg,#ffedbf19 0 1px,transparent 1px 8px,#2b130c14 8px 9px,transparent 9px 19px),linear-gradient(100deg,#e9bc714a,transparent 20% 80%,#2d170c44),var(--bin-color); box-shadow: 0 7px 2px #0008,inset 0 0 0 3px #ffffff12; }
.container-drawer .stack-bin-body::before { border: 1px solid #f0d5a436; inset: 8px; border-radius: 0; }
.container-drawer .shelf-label { min-height: 72px; width: 83%; }
.container-drawer .container-hardware { position: absolute; z-index: 5; bottom: 33px; left: 35%; width: 30%; height: 13px; border: 4px solid #bbc2bd; border-top: 0; border-radius: 0 0 6px 6px; box-shadow: 0 3px 3px #0007; }
.container-box .stack-lid { height: 18px; border-radius: 0; background: linear-gradient(90deg,transparent 45%,#aa854a88 45% 55%,transparent 55%),var(--lid-color); }
.container-box .stack-lid i,.container-box .stack-lid b,.container-box .stack-lid::before { display: none; }
.container-box .stack-bin-body { border-radius: 0; background: linear-gradient(90deg,#0001,transparent 45%,#e1c79655 45% 55%,transparent 55%,#0001),var(--bin-color); }
.container-box .shelf-label { border-radius: 0; transform: rotate(-1deg); }
.container-shelf .container-back { position: absolute; top: 6px; bottom: 22px; left: 0; right: 0; border: 8px solid var(--bin-color); background: linear-gradient(#29311e50,transparent 25%),#d7c9af; box-shadow: inset 0 4px 8px #0003; }
.container-shelf .stack-lid { display: none; }
.container-shelf .stack-bin-body { padding: 25px 7px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.container-shelf .stack-bin-body::before { display: none; }
.container-shelf .container-hardware { position: absolute; z-index: 2; bottom: 23px; left: 0; right: 0; height: 17px; border: 1px solid #0002; background: linear-gradient(#fff4,#0001),var(--lid-color); }
.container-shelf .shelf-label { border-radius: 1px; box-shadow: 0 0 0 4px #ffffff45,0 6px 8px #0003; }
.container-case { padding-top: 24px; }
.container-case .stack-lid { border-radius: 12px 12px 0 0; height: 22px; }
.container-case .stack-lid i { top: -16px; height: 15px; left: 34%; width: 32%; border: 5px solid var(--lid-color); border-bottom: 0; border-radius: 8px 8px 0 0; background: transparent; }
.container-case .stack-lid::before,.container-case .stack-lid b { display: none; }
.container-case .stack-bin-body { border: 3px solid #0005; border-radius: 0 0 14px 14px; box-shadow: inset 7px 0 #0002,inset -7px 0 #0002,0 5px 2px #0003; }
.container-case .container-hardware::before,.container-case .container-hardware::after { position: absolute; z-index: 5; top: 36px; width: 12px; height: 22px; border: 1px solid #67746e; border-radius: 2px; background: linear-gradient(90deg,#7d8984,#dce2de,#7d8984); content: ''; }
.container-case .container-hardware::before { left: 20px; }.container-case .container-hardware::after { right: 20px; }
.container-other .stack-lid { display: none; }
.container-other .stack-bin-body { border: 5px solid #a6b5b0; border-top: 7px solid var(--lid-color); border-radius: 4px 4px 14px 14px; background: repeating-linear-gradient(90deg,transparent 0 17px,#ffffff25 17px 19px),repeating-linear-gradient(0deg,transparent 0 15px,#ffffff25 15px 17px),var(--bin-color); }
/* The entire closed container stays in front for five seconds. */
.pull-stage { position: fixed; z-index: 100; inset: 0; background: #101a13a8; perspective: 900px; pointer-events: all; }
.bin-pull-ghost { position: absolute; margin: 0; transform-origin: center; pointer-events: none; filter: drop-shadow(0 25px 23px #0009); }
.bin-pull-ghost::after,.bin-pull-ghost .container-kind { display: none; }
.bin-pull-ghost.container-drawer .container-back { visibility: hidden; }
.stack-bin.is-pulled:not(.container-drawer) { visibility: hidden; }
.stack-bin.container-drawer.is-pulled .stack-bin-body,.stack-bin.container-drawer.is-pulled .container-hardware { visibility: hidden; }
/* Full-depth opening overlay. The rack's dimensions and layout are unchanged. */
.container-motion-dialog { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden; background: transparent; }
.container-motion-dialog::backdrop { background: rgba(12,20,16,var(--motion-dim,.3)); }
.container-motion-canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.motion-close { position: absolute; z-index: 2; top: max(18px,env(safe-area-inset-top)); right: max(18px,env(safe-area-inset-right)); width: 40px; height: 40px; background: #fffffff0; box-shadow: 0 3px 16px #0003; }
/* Foreground contents: always one column, photo first, list beneath. */
body.has-modal { overflow: hidden; }
.modal { width: min(620px,calc(100% - 64px)); max-height: calc(100dvh - 64px); margin: auto; padding: 0; border: 1px solid #d7ddcf; border-radius: 14px; background: #fafbf5; color: #243d32; box-shadow: 0 28px 70px #0008; overflow-y: auto; overscroll-behavior: contain; }
.modal::backdrop { background: #101a13ba; }
.detail-card { padding: 20px; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.detail-header small { font-size: 10px; color: #8b9483; }
.detail-header h2 { margin: 4px 0; font-size: 26px; letter-spacing: -.04em; }
.detail-header p { margin: 4px 0 0; font-size: 13px; font-weight: 550; }
.icon-button { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; color: #53614e; background: #e8ece1; font-size: 24px; line-height: 1; }
.open-container { position: relative; border: 8px solid var(--lid-color); border-radius: 16px; background: var(--bin-color); box-shadow: 0 8px 12px #24362a18; }
.photo-frame { overflow: hidden; border: 4px solid var(--bin-color); border-radius: 8px; background: #e8e9df; }
.contents-photo { display: block; width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; }
.contents-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); min-height: 170px; gap: 6px; padding: 10px; background: #353f36; }
.photo-cell { overflow: hidden; border-radius: 5px; background: #f3f1e8; }
.photo-cell img { width: 100%; height: 100%; display: block; object-fit: cover; }
.open-cover { display: none; position: absolute; z-index: 2; inset: -3px; border: 3px solid #0002; border-radius: 12px; background: linear-gradient(120deg,#fff4,#0002),var(--lid-color); transform-origin: top; box-shadow: 0 8px 12px #0003; }
.reveal-contents .open-cover { display: grid; place-items: center; animation: lift-lid .8s .08s ease-in both; }
.cover-label { display: grid; gap: 6px; width: 63%; padding: 12px; color: #26392c; background: #fbfaee; border: 1px solid #dedfca; border-radius: 5px; text-align: center; }
.cover-label strong { font-size: 25px; }.cover-label span { font-size: 12px; }
@keyframes lift-lid { 0% { opacity: 1; transform: perspective(650px) rotateX(0deg) translateY(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: perspective(650px) rotateX(85deg) translateY(-120px); visibility: hidden; } }
.open-container.container-drawer { border: 9px solid #765331; border-radius: 2px; }
.container-drawer .photo-frame { border-radius: 0; border-color: #97754f; }
.container-drawer .open-cover { border-radius: 0; background: repeating-linear-gradient(2deg,#edc98322 0 1px,transparent 1px 12px),var(--bin-color); animation: slide-drawer 1s ease-out both; }
.container-drawer .open-cover i { position: absolute; bottom: 20px; left: 35%; width: 30%; height: 15px; border: 5px solid #c2c8c3; border-top: 0; border-radius: 0 0 6px 6px; }
@keyframes slide-drawer { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(150px) scale(1.15); visibility: hidden; } }
.open-container.container-box { border-radius: 0; border-color: var(--bin-color); }.container-box .photo-frame { border-radius: 0; }.container-box .open-cover { border-radius: 0; background: linear-gradient(90deg,transparent 47%,#ab8445 47% 53%,transparent 53%),var(--lid-color); animation-name: unfold-box; }
@keyframes unfold-box { from { opacity: 1; transform: perspective(650px) rotateY(0); } to { opacity: 0; transform: perspective(650px) rotateY(90deg); visibility: hidden; } }
.open-container.container-shelf { border-radius: 1px; border-color: #84613e; }.container-shelf .photo-frame { border-radius: 0; border-color: #b39367; }
.open-container.container-case { border-radius: 20px; border-color: var(--bin-color); }.container-case .open-cover { background: var(--lid-color); }
.open-container.container-other { border-radius: 12px; border-color: #a6b5b0; }
.contents-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
h3 { margin: 0; font-size: 15px; }
.edit-button { min-height: 36px; padding: 5px 12px; border: 1px solid #d3d9cb; border-radius: 7px; color: #3d563f; background: #f0f3e8; font-size: 12px; }
.contents-list { list-style: none; margin: 5px 0 0; padding: 0; }
.contents-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid #e1e6d8; font-size: 13px; line-height: 1.4; }
.contents-list li > span { flex: 1; min-width: 0; }.contents-list strong { font-size: 15px; white-space: nowrap; }.contents-list small { color: #8a9482; font-size: 11px; font-weight: 400; }
.edit-dialog { width: min(620px,calc(100% - 40px)); }
.edit-card { padding: 22px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }.modal-header h2 { margin: 0; font-size: 21px; }
.two-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.edit-card label { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: #62705b; font-size: 11px; font-weight: 600; }
.field { width: 100%; min-width: 0; min-height: 42px; padding: 8px 9px; border: 1px solid #cdd5c5; border-radius: 7px; color: #283c2b; background: #fff; font-size: 13px; }
.color-fields input { width: 100%; height: 35px; padding: 2px; border: 1px solid #cdd5c5; border-radius: 5px; background: #fff; }
.edit-label-preview { max-width: 230px; margin: 4px auto 22px; }.edit-label-preview .stack-bin { height: 185px; cursor: default; }.edit-label-preview .stack-bin::after,.edit-label-preview .container-kind { display: none; }
.photo-field { margin-bottom: 22px; }.photo-field input { max-width: 100%; font-size: 11px; }
.edit-contents { margin-top: 12px; }
.edit-item { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(0,.8fr) minmax(0,.9fr); gap: 8px; padding: 12px 0; border-top: 1px solid #dce2d3; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.button { min-height: 40px; padding: 8px 16px; border: 1px solid #c9d2c0; border-radius: 7px; color: #415c3d; background: #edf1e5; font-size: 12px; font-weight: 650; }.button.primary { border-color: #294835; color: #fff; background: #294835; }.button:disabled { opacity: .5; }
.toast { position: fixed; z-index: 3000; bottom: 20px; left: 50%; transform: translate(-50%,15px); max-width: 85vw; padding: 12px 18px; border-radius: 9px; background: #284432; color: #fff; font-size: 12px; opacity: 0; pointer-events: none; transition: .15s; }.toast.visible { opacity: 1; transform: translate(-50%,0); }.toast.error { background: #8b3a2c; }
/* Revised MP4 startup with live studio credit and version overlay. */
body.booting { overflow: hidden; }body.booting .app-shell { visibility: hidden; }
.startup-splash { position: fixed; z-index: 2000; inset: 0; display: grid; place-items: center; overflow: hidden; background: #0d1218; }
.startup-video-frame { position: relative; width: min(100vw,56.25dvh); aspect-ratio: 9 / 16; }
.startup-video,.startup-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.startup-caption { position: absolute; inset: 80% 0 auto; text-align: center; opacity: 0; transition: opacity .25s ease; color: #ffda39; }
.startup-splash.show-credit .startup-caption { opacity: 1; }
.startup-splash.still-startup .startup-video { visibility: hidden; }
.startup-credit { margin: 0 8px 8px; color: #ffda39; font-size: clamp(14px,3.6vw,20px); font-weight: 600; }
.startup-version { display: block; color: #ffda39; font-size: 14px; }
@media (max-width:700px) {
  .app-shell { padding: 16px 16px 20px; }.rack-header { margin: 0 4px 15px; gap: 12px; }.rack-header h1 { font-size: 21px; }.location-filter { gap: 6px; }.location-filter select { max-width: 190px; min-height: 36px; font-size: 12px; }
  .bin-collection { padding: 10px 11px 18px; border-width: 6px; border-bottom-width: 10px; }.stack-window { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 26px 15px; }.stack-bin { height: 165px; padding: 7px 4px 18px; }.stack-lid { height: 19px; }.stack-bin-body { min-height: 108px; padding: 8px 4px; }.shelf-label { width: 91%; min-height: 78px; padding: 6px 4px; gap: 4px; }.shelf-label strong { font-size: 20px; }.label-text { font-size: 10px; }.shelf-label small { font-size: 8px; }.container-kind { font-size: 9px; bottom: -14px; }
  .stack-bin.container-drawer { padding: 10px 6px 21px; }.container-drawer .container-back { border-width: 6px; }.container-drawer .shelf-label { width: 92%; min-height: 67px; }.container-drawer .container-hardware { bottom: 27px; height: 10px; border-width: 3px; }
  .container-case { padding-top: 17px; }.container-case .stack-lid i { top: -12px; height: 12px; border-width: 4px; }.container-case .container-hardware::before,.container-case .container-hardware::after { top: 26px; width: 9px; height: 18px; }.container-case .container-hardware::before { left: 10px; }.container-case .container-hardware::after { right: 10px; }
  .container-shelf .container-back { border-width: 6px; }.container-shelf .shelf-label { width: 80%; }.container-shelf .container-hardware { bottom: 19px; height: 13px; }
  .page-arrow { width: 34px; height: 47px; font-size: 20px; }.arrow-left { left: -9px; }.arrow-right { right: -9px; }
  .detail-card { padding: 14px; }.modal { max-height: calc(100dvh - 48px); width: calc(100% - 54px); }.detail-header { margin-bottom: 12px; }.detail-header h2 { font-size: 23px; }.detail-header p { font-size: 12px; }.contents-list li { font-size: 12px; padding: 12px 0; }.contents-list strong { font-size: 14px; }.contents-list small { font-size: 10px; }.contents-heading { margin-top: 12px; }
  .edit-dialog { width: calc(100% - 32px); }.edit-card { padding: 18px; }.two-fields { gap: 9px; }.edit-item { gap: 5px; }.edit-item .field { padding: 7px 6px; font-size: 12px; }

}
@media (max-width:350px) { .location-filter > span { display: none; }.location-filter select { max-width: 170px; }.label-text { font-size: 9px; }.shelf-label small { font-size: 7px; } }
@media (prefers-reduced-motion:reduce) {  .startup-caption { transition: none; }.open-cover { display: none !important; }.toast { transition: none; } }

.sync-help{font-size:13px;line-height:1.5;color:#586470}.stock-warning{display:block!important;font-size:11px!important;font-weight:bold;color:#765000;background:#fff0b7;padding:4px;border-radius:4px}.stock-warning.critical{color:#8b2020;background:#ffe1df}.sync-conflict{border:1px solid #ca7c64;padding:12px;margin:12px 0;border-radius:8px}#syncDialog{max-width:540px;width:94vw}#syncDialog .edit-card{max-height:85vh;overflow:auto}#syncStatus{margin:0 0 8px;text-align:center}
/* Bin photo gallery and individual contents. */
.reveal-contents .open-cover { animation-duration: .65s; animation-delay: 0s; }
.bin-slideshow { position: relative; }
.bin-slideshow .contents-photo { object-fit: contain; background: #252c28; }
.photo-controls { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; white-space: nowrap; border-radius: 24px; padding: 3px 8px; color: #fff; background: #16211de6; }
.photo-controls button { min-width: 40px; min-height: 40px; border: 0; background: transparent; color: #fff; font-size: 16px; }
.photo-controls [data-photo-step] { font-size: 28px; }.photo-controls span { font-size: 13px; }
.contents-list li:has(.item-open) { padding: 0; }
.item-open { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 14px 0; border: 0; background: transparent; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.item-open:hover,.item-open:focus-visible { background: #e8ece1; }.item-open strong { white-space: nowrap; }
.photo-editor { margin: 20px 0; }.photo-help { color: #657160; font-size: 13px; }.photo-editor h3 { display: flex; justify-content: space-between; }.photo-editor h3 small { font-weight: normal; }
.photo-previews { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 12px 0; }
.photo-thumb { position: relative; }.photo-thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.photo-thumb button { position: absolute; right: 2px; top: 2px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #fff; color: #273e2d; font-size: 22px; }
.photo-upload { display: block; font-size: 14px; font-weight: 600; margin: 14px 0; }.photo-upload input { display: block; width: 100%; margin-top: 8px; font-size: 14px; }
.item-photo { background: #e8e9df; border-radius: 10px; overflow: hidden; text-align: center; }.item-photo img { display: block; width: 100%; max-height: 330px; object-fit: contain; }.item-photo p { padding: 40px 12px; }
.item-pricing { border-top: 1px solid #d3d9cb; margin-top: 20px; padding-top: 16px; }.item-pricing p { font-size: 14px; color: #657160; }
