.framing-page,.framing-page * { box-sizing: border-box; }
.framing-page { min-height: 100vh; margin: 0; color: rgb(253,239,213); background: #000; }
.framing-app { width: 100%; padding: 18px 18px 48px; font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.framing-shell { width: min(1600px,100%); min-width: 0; margin: 0 auto; padding: 18px; border: 1px solid rgba(0,255,255,.68); border-radius: 18px; background: linear-gradient(145deg,rgba(16,20,21,.99),rgba(3,5,6,.99)); box-shadow: 0 18px 54px rgba(0,0,0,.62),0 0 18px rgba(255,255,255,.1); }
.framing-heading { display: flex; min-width: 0; gap: 16px; align-items: end; justify-content: space-between; }
.framing-eyebrow { margin: 0 0 4px; color: rgba(253,239,213,.55); font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.framing-heading h1,.framing-dialog h2 { margin: 0; color: #fff; font-size: clamp(1.55rem,4vw,2.35rem); }
.framing-zoom { display: flex; flex: 0 0 auto; margin-left: auto; gap: 6px; align-items: center; justify-self: end; }
.framing-shell button,.framing-dialog button,.framing-dialog a { display: inline-flex; min-height: 42px; margin: 0; padding: 0 13px; align-items: center; justify-content: center; border: 1px solid rgba(0,255,255,.55); border-radius: 9px; color: #fff; background: rgba(0,255,255,.07); font: 700 .76rem/1 system-ui,sans-serif; text-decoration: none; cursor: pointer; }
.framing-shell button:hover,.framing-shell button:focus-visible,.framing-dialog button:hover,.framing-dialog button:focus-visible,.framing-dialog a:hover,.framing-dialog a:focus-visible { background: rgba(0,255,255,.2); outline: none; }
.framing-zoom button:first-child,.framing-zoom button:last-child { width: 42px; padding: 0; font-size: 1.2rem; }
.framing-plan-tools { display: flex; min-width: 0; max-width: 100%; gap: 10px; margin: 16px 0 10px; align-items: center; }
.framing-plan-select { display: grid; min-width: 0; flex: 0 0 min(290px,38vw); gap: 4px; }
.framing-plan-select span { color: rgba(253,239,213,.58); font-size: .68rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.framing-plan-select select { min-height: 38px; padding: 0 34px 0 11px; border: 1px solid rgba(0,255,255,.55); border-radius: 9px; color: #fff; background: #091011; font: 700 .8rem/1 system-ui,sans-serif; cursor: pointer; }
.framing-filters { display: flex; min-width: 0; max-width: 100%; flex: 1 1 auto; gap: 6px; margin: 0; overflow-x: auto; scrollbar-width: thin; }
.framing-filters button { min-height: 36px; padding-inline: 11px; white-space: nowrap; }
.framing-filters button[aria-pressed="true"] { color: #001011; background: aqua; }
.framing-viewport { position: relative; display: flex; width: 100%; min-height: 280px; align-items: center; justify-content: center; border: 1px solid rgba(0,255,255,.34); border-radius: 12px; background: #111516; overflow: hidden; touch-action: none; cursor: grab; }
.framing-viewport.is-dragging { cursor: grabbing; }
.framing-stage { position: relative; box-sizing: content-box; width: min(1600px,100%); margin: auto; padding: 16px; border: 2px solid rgba(0,255,255,.76); border-radius: 6px; background: #fff; transform-origin: center center; will-change: transform; overflow: hidden; }
.framing-stage > img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.framing-hotspots { position: absolute; inset: 16px; }
.framing-hotspot { --marker-color: #00ffff; position: absolute; z-index: 2; width: 44px; min-height: 44px !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; left: calc(var(--marker-x) * 1%); top: calc(var(--marker-y) * 1%); background: transparent !important; transform: translate(-50%,-50%); }
.framing-hotspot::before { content: ""; width: 10px; height: 10px; border: 1px solid #001011; border-radius: 50%; background: var(--marker-color); box-shadow: 0 0 0 1px rgba(255,255,255,.92),0 0 9px var(--marker-color); transform: translate(13px,-13px); transition: transform .14s ease; }
.framing-hotspot:hover::before,.framing-hotspot:focus-visible::before { transform: translate(13px,-13px) scale(1.35); }
.framing-hotspot:focus-visible { outline: 2px solid #fff !important; outline-offset: -4px !important; }
.framing-hotspot[data-type="shear"] { --marker-color: #ffb347; }
.framing-hotspot[data-type="hardware"] { --marker-color: #ff6f61; }
.framing-hotspot[data-type="section"] { --marker-color: #a78bfa; }
.framing-hotspot[data-type="elevation"] { --marker-color: #70e18f; }
.framing-hotspot[hidden] { display: none !important; }
.framing-status { min-height: 1.2em; margin: 9px 2px 0; color: rgba(253,239,213,.56); font-size: .72rem; }
.framing-dialog { width: calc(100vw - 20px); max-width: none; height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); margin: auto; padding: 0; border: 1px solid rgba(0,255,255,.72); border-radius: 16px; color: rgb(253,239,213); background: #080b0c; box-shadow: 0 22px 70px rgba(0,0,0,.86); overflow: hidden; }
.framing-dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(4px); }
.framing-dialog-card { position: relative; display: grid; grid-template-rows: auto minmax(0,1fr) auto; height: 100%; padding: 14px; }
.framing-dialog-card > header { display: flex; gap: 12px; padding-right: 52px; align-items: start; justify-content: space-between; }
.framing-dialog h2 { font-size: 1.5rem; }
#framing-dialog-close { position: absolute; top: 10px; right: 10px; z-index: 5; width: 44px; padding: 0; font-size: 1.45rem; }
.framing-dialog-options { display: grid; min-height: 0; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 8px; margin-top: 14px; align-content: start; overflow: auto; }
.framing-dialog-options button { min-height: 50px; justify-content: flex-start; text-align: left; }
.framing-dialog-options[hidden],.framing-detail-view[hidden] { display: none; }
.framing-detail-view { position: relative; display: grid; min-height: 0; margin: 14px 0 0; place-items: center; overflow: auto; background: #070a0b; }
.framing-detail-view img { display: block; width: auto; max-width: 100%; max-height: 100%; margin: 0 auto; border: 1px solid rgba(0,255,255,.35); border-radius: 10px; background: #fff; object-fit: contain; }
.framing-detail-view.is-loading::before { content: ""; position: absolute; z-index: 2; width: 36px; height: 36px; box-sizing: border-box; border: 3px solid rgba(0,255,255,.18); border-top-color: aqua; border-right-color: #ff6a2a; border-radius: 50%; animation: framing-detail-spin .85s linear infinite; }
.framing-detail-view.is-loading img { visibility: hidden; }
@keyframes framing-detail-spin { to { transform: rotate(360deg); } }
.framing-dialog footer { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }
.framing-dialog footer #framing-dialog-back { margin-right: auto; }
@media (max-width:900px) { .framing-app { padding: 0 0 36px; } .framing-shell { padding: 14px; } }
@media (max-width:560px) {
   .framing-shell { padding: 12px 8px; border-radius: 14px; }
   .framing-heading { align-items: flex-start; }
   .framing-heading h1 { font-size: 1.35rem; }
   .framing-zoom { gap: 3px; }
   .framing-zoom button { min-height: 36px; padding-inline: 8px; }
   .framing-zoom button:first-child,.framing-zoom button:last-child { width: 36px; }
   .framing-plan-tools { display: grid; grid-template-columns: minmax(0,1fr) auto; width: 100%; margin-top: 12px; align-items: end; }
   .framing-plan-select,.framing-plan-select select,.framing-filters { width: 100%; }
   .framing-plan-select { grid-column: 1; }
   .framing-zoom { grid-column: 2; margin-left: 0; }
   .framing-filters { grid-column: 1 / -1; grid-row: 2; }
   .framing-filters button { min-height: 34px; }
   .framing-viewport { min-height: 0; }
   .framing-stage { padding: 8px; }
   .framing-hotspots { inset: 8px; }
   .framing-hotspot { width: 42px; min-height: 42px !important; }
   .framing-hotspot::before { width: 8px; height: 8px; transform: translate(9px,-9px); }
   .framing-hotspot:hover::before,.framing-hotspot:focus-visible::before { transform: translate(9px,-9px) scale(1.35); }
   .framing-dialog { width: calc(100vw - 20px); height: calc(100dvh - 20px); max-height: calc(100dvh - 20px); }
   .framing-dialog-card { padding: 10px; }
   .framing-detail-view img { max-height: 100%; }
}
@media (prefers-reduced-motion: reduce) { .framing-detail-view.is-loading::before { animation: none; } }
