/* 3D reference composition: source / viewer / AR and export, followed by library. */
.ald-3d #stWork { display: grid; grid-template-columns: minmax(265px,1fr) minmax(330px,1.5fr) minmax(230px,.84fr); gap: 14px; align-items: stretch; }
.ald-3d .ald-panel { background: var(--panel); border-color: #303030; border-radius: 12px; }
.ald-3d .al3-controls { padding: 20px; }
.ald-3d .al3-controls .stx-h { margin: 20px 0 10px; font-size: 25px; line-height: 1.2; }
.ald-3d .al3-controls .stx-sub { font-size: 12px; margin-bottom: 20px; color: #b3b3b3; }
.ald-3d .al3-source { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ald-3d .al3-source button { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 43px; padding: 7px 5px; background: var(--panel-2); color: #c4c4c4; border: 1px solid #373737; border-radius: 8px; font-size: 11px; }
.ald-3d .al3-source button[aria-pressed="true"] { background: #94fae2; color: #071a15; border-color: #94fae2; }
.ald-3d .al3-source svg { width: 15px; height: 15px; flex: none; }
.ald-3d .al3-controls .m-lab { font-size: 11px; color: #c2c2c2; margin: 18px 0 9px; letter-spacing: .02em; }
.ald-3d #st3Pick { display: flex; flex-direction: column; width: 100%; min-height: 120px; gap: 11px; border: 1px dashed #515151; border-radius: 9px; background: var(--panel-2); padding: 18px 8px; }
.ald-3d #st3Pick svg { height: 26px; width: 26px; color: #bcbcbc; }
.ald-3d #st3Pick b { font-size: 11px; font-weight: 550; }
.ald-3d #st3Pick span { font-size: 10px; font-weight: 400; color: #b3b3b3; }
.ald-3d #st3Pick:hover { border-color: #94fae2; }
.ald-3d #st3Prev:has(img) { margin-top: 8px; }
.ald-3d #st3Prev img { max-height: 140px; object-fit: contain; }
.ald-3d #st3High .stx-ta { background: var(--input); border-color: #3b3b3b; min-height: 145px; }
.ald-3d #st3High .stx-ta::placeholder { color: #b3b3b3; }
.ald-3d .al3-source-examples { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin-top: 14px; }
.ald-3d .al3-source-examples figure { position: relative; margin: 0; border: 1px solid #393939; border-radius: 8px; overflow: hidden; aspect-ratio: 1/1; background: var(--panel-2); }
.ald-3d .al3-source-examples img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ald-3d .al3-source-examples figcaption { position: absolute; right: 0; bottom: 0; left: 0; padding: 3px 0; background: #000b; text-align: center; color: #ddd; font-size: 8px; }
.ald-3d #stEng3 { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ald-3d #stEng3 .catc { width: 100%; min-width: 0; min-height: 70px; justify-content: center; align-items: flex-start; flex-direction: column; gap: 7px; font-size: 12px; padding: 10px; background: var(--panel-2); border: 1px solid #393939; border-radius: 8px; }
.ald-3d #stEng3 .catc.on { border-color: #94fae2; background: #1c2b28; }
.ald-3d #stEng3 .catc b { font-weight: 600; }
.ald-3d #stEng3 .catc span { font-size: 9px; color: #bbb; line-height: 1.5; white-space: normal; text-align: left; }
.ald-3d .al3-coupling { margin: 9px 0 16px; color: #b3b3b3; font-size: 10px; line-height: 1.55; }
.ald-3d #stGo { width: 100%; max-width: none; min-height: 46px; margin-top: 0; font-size: 12px; background: #94fae2; color: #071a15; border-radius: 9px; }
.ald-3d .al3-controls > .m-actions { width: 100%; }
.ald-3d .al3-viewport { min-width: 0; position: relative; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; }
.ald-3d .al3-viewhead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 16px; }
.ald-3d .al3-render-modes { display: flex; align-items: stretch; padding: 3px; border: 1px solid #373737; border-radius: 10px; background: var(--panel); }
.ald-3d .al3-render-modes > * { display: flex; align-items: center; gap: 5px; min-height: 34px; padding: 7px 11px; border-radius: 7px; font-size: 11px; }
.ald-3d .al3-render-modes [aria-current] { background: #94fae2; color: #071a15; }
.ald-3d .al3-render-modes button { color: #bbb; opacity: 1; }
.ald-3d .al3-render-modes small { font-size: 8px; color: #aaa; }
.ald-3d .al3-state { font-size: 9px; color: #bcbcbc; }
.ald-3d .al3-viewbody { position: relative; display: flex; flex: 1; min-height: 340px; }
.ald-3d .al3-example { position: relative; flex: 1; margin: 0; min-height: 340px; }
.ald-3d .al3-example img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ald-3d .al3-example figcaption { position: absolute; inset: auto 0 0; text-align: center; padding: 35px 14px 14px 74px; background: linear-gradient(transparent,var(--bg) 90%); color: #bcbcbc; font-size: 10px; line-height: 1.5; }
.ald-3d .al3-tools { position: absolute; top: 18px; left: 12px; z-index: 2; display: flex; flex-direction: column; gap: 4px; width: 60px; padding: 5px; background: color-mix(in srgb, var(--panel) 92.9411764706%, transparent); border: 1px solid #363636; border-radius: 10px; }
.ald-3d .al3-tools > * { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 60px; padding: 6px 2px; color: #bcbcbc; font-size: 9px; opacity: 1; }
.ald-3d .al3-tools svg { width: 18px; height: 18px; }
.ald-3d .al3-tools b { font-size: 10px; font-weight: 500; }
.ald-3d .al3-tools small { font-size: 7px; white-space: nowrap; }
.ald-3d .al3-has-model .al3-tools [data-al3-gesture] { color: #94fae2; }
.ald-3d .al3-viewtools { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid #2b2b2b; }
.ald-3d .al3-viewtools button { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; min-height: 38px; padding: 8px 10px; border: 1px solid #3b3b3b; border-radius: 8px; color: #94fae2; white-space: nowrap; }
.ald-3d .al3-viewtools button svg { width: 13px; height: 13px; }
.ald-3d .al3-viewtools button:disabled { color: #aaa; }
.ald-3d .al3-viewhint { font-size: 10px; color: #b3b3b3; line-height: 1.5; }
.ald-3d #stStage { margin: 0; padding: 0 12px 12px 76px; flex: 1; min-width: 0; }
.ald-3d #stStage:empty { display: none; }
.ald-3d #stStage .mv { display: block; width: 100%; height: 330px; background: transparent; border-radius: 0; }
.ald-3d #stStage .m-actions { gap: 7px; flex-wrap: wrap; }
.ald-3d #stStage .m-actions > * { font-size: 10px; min-width: 0; min-height: 38px; }
.ald-3d .al3-environment { padding: 0 14px 14px; }
.ald-3d .al3-env-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; font-size: 11px; color: #bbb; }
.ald-3d .al3-concept { font-size: 9px; font-weight: 400; border: 1px solid #454545; border-radius: 4px; padding: 3px 5px; color: #bbb; }
.ald-3d .al3-env-list { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; }
.ald-3d .al3-env-list button { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; min-height: 68px; padding: 9px 3px; border: 1px solid #393939; border-radius: 8px; background: var(--panel-2); color: #bbb; opacity: 1; font-size: 9px; }
.ald-3d .al3-env-sphere { display: block; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 32% 28%,#ece8df,#878681 40%,#2b2b2b 75%); }
.ald-3d [data-al3-env="sunset"] .al3-env-sphere { background: radial-gradient(circle at 32% 28%,#efd2b5,#926b48 40%,#2e2924 75%); }
.ald-3d [data-al3-env="night"] .al3-env-sphere { background: radial-gradient(circle at 32% 28%,#8b9695,#434a4b 40%,#1c1f20 75%); }
.ald-3d .al3-side { padding: 20px 17px; }
.ald-3d .al3-side h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 600; margin: 0 0 18px; }
.ald-3d .al3-ar-row { display: flex; align-items: center; gap: 12px; }
.ald-3d .al3-qr-placeholder { display: grid; place-content: center; justify-items: center; gap: 8px; width: 76px; height: 83px; flex: none; border: 1px dashed #545454; border-radius: 7px; color: #bcbcbc; }
.ald-3d .al3-qr-placeholder svg { width: 27px; height: 27px; }
.ald-3d .al3-qr-placeholder span { font-size: 8px; }
.ald-3d .al3-ar-row b { font-size: 11px; font-weight: 550; line-height: 1.5; }
.ald-3d .al3-ar-row p { color: #b3b3b3; font-size: 10px; line-height: 1.6; margin: 8px 0 0; }
.ald-3d .al3-export { margin-top: 24px; padding-top: 23px; border-top: 1px solid #333; }
.ald-3d .al3-formats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.ald-3d .al3-formats > * { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 44px; gap: 4px; padding: 7px 2px; border: 1px solid #373737; border-radius: 7px; background: var(--panel-2); color: #bbb; font-size: 10px; opacity: 1; }
.ald-3d .al3-formats .al3-format-current { background: #1c2b28; border-color: #75bba8; color: #94fae2; }
.ald-3d .al3-formats small { font-size: 7px; }
.ald-3d .al3-stats { display: grid; gap: 16px; margin: 25px 0 15px; }
.ald-3d .al3-stats > div { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; }
.ald-3d .al3-stats dt { color: #b3b3b3; }
.ald-3d .al3-stats dd { margin: 0; color: #ccc; text-align: right; }
.ald-3d .al3-stats-note { color: #b3b3b3; font-size: 10px; line-height: 1.55; margin: 0 0 20px; }
.ald-3d .al3-export-actions { display: grid; gap: 10px; padding-top: 19px; border-top: 1px solid #333; }
.ald-3d .al3-export-actions button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px; border: 1px solid #444; border-radius: 9px; color: #eee; font-size: 11px; }
.ald-3d .al3-export-actions button svg { width: 16px; height: 16px; }
.ald-3d .al3-export-actions [data-al3-post] { background: #94fae2; color: #071a15; border-color: #94fae2; }
.ald-3d .al3-export-actions button:disabled { opacity: .55; }
.ald-3d #stGal { padding: 0; }
.ald-3d .al3-libhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.ald-3d .al3-libhead h3 { font-size: 16px; font-weight: 600; margin: 0; }
.ald-3d .al3-libhead > span { font-size: 11px; color: #b3b3b3; }
.ald-3d #stGal > .gal-h { display: none; }
.ald-3d #stGal .gal-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; }
.ald-3d #stGal .gal-it { min-width: 0; margin: 0; background: var(--panel); border: 1px solid #303030; border-radius: 10px; overflow: hidden; }
.ald-3d #stGal .gal-med { height: 120px; aspect-ratio: auto; border-radius: 0; }
.ald-3d #stGal .gal-med img { height: 100%; width: 100%; object-fit: cover; }
.ald-3d #stGal .gal-it.ex .gal-med::after { content: "Example"; position: absolute; top: 7px; left: 7px; padding: 3px 5px; background: #000c; border-radius: 4px; color: #eee; font-size: 8px; }
.ald-3d #stGal figcaption { font-size: 10px; line-height: 1.5; padding: 9px; min-height: 37px; }
.ald-3d button:focus-visible, .ald-3d [role="button"]:focus-visible { outline: 2px solid #94fae2; outline-offset: 3px; }
@media (max-width: 1150px) {
  .ald-3d #stWork { grid-template-columns: minmax(260px,1fr) minmax(0,1.45fr); }
  .ald-3d .al3-side { grid-column: 1/-1; display: grid; grid-template-columns: 1fr 1.5fr; gap: 25px; }
  .ald-3d .al3-export { margin-top: 0; padding-top: 0; border-top: 0; }
  .ald-3d #stGal .gal-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .ald-3d #stWork { display: flex; flex-direction: column; gap: 16px; }
  .ald-3d .al3-controls { padding: 18px; }
  .ald-3d .al3-side { display: block; padding: 20px; }
  .ald-3d .al3-export { margin-top: 24px; padding-top: 24px; border-top: 1px solid #333; }
  .ald-3d .al3-example { min-height: 350px; }
  .ald-3d .al3-viewhead { padding: 13px; }
  .ald-3d #stStage .mv { height: 340px; }
  .ald-3d .al3-libhead { align-items: start; flex-direction: column; gap: 7px; }
  .ald-3d #stGal .gal-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .ald-3d #stGal .gal-med { height: 145px; }
  .ald-3d #st3High .stx-ta { font-size: 16px; }
}
/* Keep the editor first, followed by the complete library/showcase rail.
   #stxRight is the current grid item; retain #stGal for the older direct gallery.
   Preserve the mobile stack and all original controls at their current sizes. */
@media (min-width: 1151px) {
  .ald-3d .stx-left { display: contents; }
  .ald-3d #stWork { order: 1; }
  .ald-3d #stxRight, .ald-3d #stGal { order: 2; }
  .ald-3d .stx-left .pricebox { order: 3; margin-top: 0; }
  .ald-3d .al3-controls { padding: 16px; }
  .ald-3d .al3-controls .stx-h { margin: 10px 0 7px; font-size: 23px; }
  .ald-3d .al3-controls .stx-sub { margin-bottom: 12px; }
  .ald-3d .al3-controls .m-lab { margin: 12px 0 8px; }
  .ald-3d .al3-source button { min-height: 44px; }
  .ald-3d #st3Pick { min-height: 96px; gap: 8px; padding: 12px 8px; }
  .ald-3d #st3Pick svg { width: 22px; height: 22px; }
  .ald-3d .al3-source-examples { margin-top: 10px; }
  .ald-3d .al3-source-examples figure { height: 58px; aspect-ratio: auto; }
  .ald-3d #stEng3 .catc { min-height: 60px; padding: 9px; }
  .ald-3d .al3-coupling { margin: 7px 0 10px; }
  .ald-3d #stErr:empty { display: none; }
  .ald-3d .al3-controls > .m-actions { margin-top: 8px; }
  .ald-3d .al3-viewport { min-height: 560px; }
  .ald-3d .al3-viewhead { padding: 12px 16px; }
  .ald-3d .al3-viewbody, .ald-3d .al3-example { min-height: 300px; }
  .ald-3d #stStage .mv { height: 300px; }
}
.ald-3d .al3-progress { color: #94fae2; font-size: 11px; line-height: 1.5; }
