:root{color-scheme:dark;--paper:var(--ar-paper);--ink:var(--ar-text);--muted:var(--ar-dim);--line:var(--ar-line);--green:var(--ar-violet);--panel:var(--ar-panel);font-family:Tahoma,"DM Sans",sans-serif;color:var(--ink);background:var(--paper)}
*{box-sizing:border-box}body{margin:0;min-height:100vh}a{color:var(--green);text-decoration:none}a:hover{text-decoration:underline}button,input,.btn{font:inherit}button,.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;color:var(--ink);border:1px solid var(--line);background:var(--panel);border-radius:9px;padding:.65rem .95rem;cursor:pointer;line-height:1.6;text-decoration:none}button:hover:enabled,.btn:hover{border-color:var(--green);text-decoration:none}button:disabled{opacity:.52;cursor:default}.primary{background:var(--green);color:var(--ar-on-violet);border-color:var(--green)}.primary:hover:enabled,.primary:hover{background:#d2b5ff}.danger{color:#ffc2ca}.wide{width:100%}[hidden]{display:none!important}:focus-visible{outline:3px solid var(--ar-violet);outline-offset:3px}
.shell{width:min(1180px,calc(100% - 48px));margin:auto}header{background:var(--panel);border-bottom:1px solid var(--line)}header nav{display:flex;align-items:center;gap:2.5rem;height:72px}.brand{display:flex;gap:.65rem;align-items:center;font-size:1.4rem;font-weight:bold;color:var(--ink)}.mark{background:var(--green);color:#f1d6aa;border-radius:8px;padding:.1em .36em;font-size:1.6rem}.nav-link,.back,.hint,small,.images span,.pagehead p{color:var(--muted);font-size:.88rem;line-height:1.85}.pagehead{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:2.6rem 0 1.6rem}h1,h2,p{margin:0}h1{font-size:clamp(1.6rem,3vw,2.35rem);line-height:1.5}h2{font-size:1.15rem;line-height:1.7}.pagehead p,.back{margin:.4rem 0;display:block}main{padding-bottom:3rem}.empty,.panel,.card{border:1px solid var(--line);border-radius:16px;background:var(--panel)}.empty{display:grid;justify-items:center;align-content:center;gap:1.1rem;padding:3rem 1rem;min-height:360px;text-align:center}.empty p{color:var(--muted);line-height:1.9}.empty a{font-weight:bold}.woven{width:94px;height:118px;background:repeating-linear-gradient(0deg,#e6cc96 0 2px,transparent 2px 5px),#366e5a;border:6px double #b88b58;outline:1px solid #c5b193;display:grid;place-items:center;transform:rotate(-8deg);margin-bottom:9px}.woven i{width:34px;height:34px;transform:rotate(45deg);background:#b97853;border:7px double #ead1a1}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,305px),1fr));gap:1rem}.card{overflow:hidden}.photo,.imagebox,.viewport{background:var(--ar-stage)}.photo{height:215px;display:grid;place-items:center}.photo img,.imagebox :is(img,canvas){display:block;max-width:100%;max-height:100%;object-fit:contain}.photo img{height:90%;width:92%}.card-body,.panel{padding:1.3rem}.card h2,.show-grid aside h2{margin:.8rem 0;overflow-wrap:anywhere}.badge{display:inline-block;color:#ace5c7;background:#142b22;padding:.3rem .65rem;font-size:.75rem;border-radius:2rem}.missing,.notice{color:#ead095;background:#302819}.specs{margin:1rem 0}.specs div{display:flex;justify-content:space-between;gap:.5rem;padding:.55rem 0;border-bottom:1px solid var(--line);font-size:.88rem}.specs dt{color:var(--muted)}.specs dd{margin:0}.actions,.viewtools,.pages{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.actions form{margin:0}.actions button,.actions a,.viewtools button{font-size:.82rem}.pages{justify-content:center;margin:1.5rem}.editor,.show-grid{display:grid;grid-template-columns:minmax(290px,.8fr) minmax(0,1.4fr);gap:1rem;align-items:start}.show-grid{grid-template-columns:minmax(0,2fr) minmax(240px,1fr)}.previews{display:grid;gap:1rem}.panel h2{margin-bottom:.9rem}.panel fieldset{border:0;padding:0;margin:0;min-width:0}label{display:grid;gap:.45rem;margin-top:1rem;font-size:.88rem}input{width:100%;min-width:0;background:var(--ar-field);border-radius:7px;color:var(--ink);border:1px solid var(--ar-control-line);padding:.65rem}input[type=number]{direction:ltr}input[type=file]{font-size:.82rem}.numbers,.margins,.images{display:grid;gap:.65rem;grid-template-columns:repeat(3,minmax(0,1fr))}.margins,.images{grid-template-columns:repeat(2,minmax(0,1fr))}details{padding:1rem 0;border-top:1px solid var(--line);margin:1rem 0}summary{cursor:pointer}details button{margin:.8rem 0}.imagebox{height:145px;border-radius:8px;display:grid;place-items:center;overflow:hidden;padding:.5rem}.imagebox:empty:before{content:'◇';color:#89988c;font-size:2rem}.viewtools{justify-content:space-between;margin-bottom:.75rem}.viewtools h2{margin:0}.viewport{height:clamp(260px,42vw,480px);border-radius:10px;overflow:hidden}.viewport canvas{width:100%;height:100%;display:block;touch-action:none}.hint,#real-size,#viewer-status{font-size:.85rem;line-height:1.9;margin:.65rem 0}.notice{padding:.75rem;border-radius:8px;line-height:1.8;margin:.75rem 0}.error{color:#ffc2ca}.back{width:fit-content}.show-grid aside .photo{border-radius:8px}
@media(max-width:760px){.shell{width:calc(100% - 28px)}header nav{height:60px}.pagehead{margin:1.6rem 0 1rem}.editor,.show-grid{grid-template-columns:1fr}.panel{padding:1rem}.imagebox{height:125px}.viewtools{align-items:flex-start}.pagehead .btn{font-size:.82rem}.empty{min-height:320px}}

.product-head h1 { overflow-wrap: anywhere; }
.product-stage { min-width: 0; }
#product-viewer {
    display: block;
    width: 100%;
    height: clamp(340px, 57vh, 660px);
    border-radius: 11px;
    background-color: var(--ar-stage);
    --poster-color: var(--ar-stage);
    --progress-bar-color: var(--green);
}
#product-viewer[ar-status="session-started"], #product-viewer[ar-status="object-placed"] { background: transparent; }
.scan-guide { display: none; }
#product-viewer[ar-status="session-started"] .scan-guide,
#product-viewer[ar-tracking="not-tracking"] .scan-guide {
    display: block;
    position: absolute;
    inset: auto 8% 12%;
    padding: .75rem;
    border-radius: 8px;
    color: white;
    background: #222222e6;
    text-align: center;
    pointer-events: none;
}
.stage-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.angles { display: flex; gap: .4rem; }
.angles button { font-size: .85rem; }
.room-panel { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: 1rem; scroll-margin-block: 1rem; }
.room-help { font-size: .88rem; line-height: 1.9; margin-top: .6rem; }
@media(max-width:760px) {
    .product-head { margin-block: .9rem; }
    #product-viewer { height: clamp(290px, 52svh, 540px); }
    #enter-ar { width: 100%; }
}
