/* Reference image adjustment surface shared by mobile and desktop. */
.ref-adjust-panel{display:none;position:fixed;z-index:240;color:var(--t);background:var(--dialog-surface,var(--white));border:.5px solid var(--bd);box-shadow:var(--shadow-xl)}
.ref-adjust-panel.show{display:flex;flex-direction:column}
.ref-adjust-head{display:flex;align-items:center;gap:10px;min-height:62px;padding:10px 14px;border-bottom:.5px solid var(--bd);flex:0 0 auto}
.ref-adjust-thumb{width:42px;height:42px;display:grid;place-items:center;overflow:hidden;border-radius:8px;background:var(--bg);flex:0 0 auto}
.ref-adjust-thumb img{display:block;width:100%;height:100%;object-fit:cover}
.ref-adjust-title{display:flex;min-width:0;flex:1;flex-direction:column;gap:2px}
.ref-adjust-title strong{font-size:14px;font-weight:750}
.ref-adjust-title span{overflow:hidden;color:var(--t3);font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.ref-adjust-close{width:30px;height:30px;display:grid;place-items:center;border-radius:50%;color:var(--t3);background:var(--fill-secondary)}
.ref-adjust-close .icon{width:16px;height:16px}
.ref-adjust-fields{display:flex;min-height:0;flex-direction:column;gap:8px;padding:12px 14px;overflow:auto}
.ref-adjust-lock{display:flex;min-height:34px;align-items:center;justify-content:center;gap:6px;padding:8px 10px;border-radius:8px;background:var(--fill-secondary);color:var(--t2);font-size:11px;font-weight:650}
.ref-adjust-lock .icon{width:14px;height:14px}
.ref-adjust-row{display:grid;grid-template-columns:58px minmax(80px,1fr) 48px 18px;align-items:center;gap:7px;min-height:30px;color:var(--t2);font-size:11px}
.ref-adjust-row input[type=range]{width:100%;min-width:0}
.ref-adjust-row input[type=number]{width:48px;height:28px;padding:0 5px;border:1px solid var(--bd);border-radius:6px;background:var(--bg);color:var(--t);font-size:11px;text-align:center}
.ref-adjust-row small{color:var(--t3);font-size:10px}
.ref-adjust-transform-row{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:4px}
.ref-adjust-transform-row button{display:grid;min-height:36px;place-items:center;border:1px solid var(--bd);border-radius:7px;background:var(--bg);color:var(--t2)}
.ref-adjust-transform-row button.active{border-color:var(--yellow-d);background:var(--yellow-alpha);color:var(--t)}
.ref-adjust-transform-row .icon{width:17px;height:17px}
.ref-adjust-secondary-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.ref-adjust-secondary-actions button{display:flex;min-height:36px;align-items:center;justify-content:center;gap:6px;border:1px solid var(--bd);border-radius:7px;background:var(--bg);color:var(--t2);font-size:11px;font-weight:650}
.ref-adjust-secondary-actions .icon{width:15px;height:15px}
.ref-adjust-panel button:disabled,.ref-adjust-panel input:disabled{opacity:.38;cursor:not-allowed}
.ref-adjust-footer{display:grid;grid-template-columns:1fr 1.5fr;gap:8px;padding:10px 14px calc(10px + env(safe-area-inset-bottom));border-top:.5px solid var(--bd);flex:0 0 auto}
.ref-adjust-footer button{min-height:40px;border-radius:9px;background:var(--fill-secondary);color:var(--t2);font-size:13px;font-weight:700}
.ref-adjust-footer button.primary{background:var(--yellow);color:#5a4200}
