:root{
  --bg:#070707;
  --panel:#111111;
  --panel-2:#171717;
  --border:#2b2b2b;
  --copper:#b66a3c;
  --paper:#f4efe7;
  --muted:#a9a39c;
  --danger:#d45f5f;
  --ok:#7fb07a;
}
*{box-sizing:border-box}
body{
  margin:0;background:var(--bg);color:var(--paper);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.shell{max-width:1220px;margin:0 auto;padding:28px}
.topbar{display:flex;justify-content:space-between;gap:18px;align-items:center;margin-bottom:20px}
h1,h2{font-family:Georgia,"Times New Roman",serif;margin:0}
h1{font-size:30px;font-weight:500}
h2{font-size:22px;margin-bottom:8px}
.eyebrow{font-size:11px;letter-spacing:.18em;color:var(--copper);font-weight:800;margin-bottom:6px}
.panel{
  background:linear-gradient(180deg,var(--panel),#0d0d0d);
  border:1px solid var(--border);border-radius:14px;padding:18px;margin-bottom:16px
}
.compact{margin:0;min-height:105px}
.muted{color:var(--muted);font-size:14px}
.hidden{display:none!important}
.auth-box{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px}
button{
  background:var(--copper);border:0;color:#111;font-weight:800;border-radius:9px;
  padding:11px 15px;cursor:pointer
}
button:hover{filter:brightness(1.06)}
button.ghost{background:transparent;color:var(--paper);border:1px solid var(--border)}
input{
  width:100%;background:#0b0b0b;border:1px solid #333;border-radius:9px;color:var(--paper);
  padding:12px 13px;font-size:15px;outline:none
}
input:focus{border-color:var(--copper)}
label{display:block;font-size:12px;color:var(--muted);font-weight:700;letter-spacing:.04em}
label input{margin-top:6px}
.login-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:12px;align-items:end;margin-top:15px}
.message{min-height:18px;margin:10px 0 0;color:var(--muted)}
.lookup{display:grid;grid-template-columns:minmax(320px,.85fr) 1.15fr;gap:28px;align-items:end}
.lookup-row{display:flex;gap:10px;margin-top:7px}
.lookup-row input{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:17px}
.bow-name{font-family:Georgia,"Times New Roman",serif;font-size:28px}
.status-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}
.dots{display:flex;gap:8px;margin:12px 0 7px}
.dots span{width:20px;height:20px;border-radius:50%;border:2px solid #565656;background:#151515}
.dots span.on{border-color:var(--copper);background:var(--copper);box-shadow:0 0 0 3px rgba(198,129,69,.13)}
.big-stat{font-size:27px;font-weight:800;margin-top:12px}
.tabs{display:flex;gap:8px;flex-wrap:wrap;border-bottom:1px solid var(--border);padding-bottom:12px;margin-bottom:18px}
.tab{
  background:#151515;border:1px solid #333;color:var(--paper);padding:9px 13px;border-radius:9px;
  font-size:13px
}
.tab.active{background:var(--copper);color:#111;border-color:var(--copper)}
.piece-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:18px}
.piece-name{font-family:Georgia,"Times New Roman",serif;font-size:27px}
.spec-chips{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.chip{background:#171717;border:1px solid #333;border-radius:999px;padding:8px 11px;font-size:13px}
.diagram-wrap{
  overflow-x:auto;background:#f4efe7;color:#151515;border-radius:12px;padding:18px;margin-bottom:16px
}
svg{min-width:900px;width:100%;height:auto;display:block}
.measurement-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.spec-table{width:100%;border-collapse:collapse;font-size:14px}
.spec-table th,.spec-table td{border-bottom:1px solid #2b2b2b;padding:10px 8px;text-align:left}
.spec-table th{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.08em}
.empty{padding:30px 8px;color:var(--muted);text-align:center}
.error{color:var(--danger)}
.ok{color:var(--ok)}
@media(max-width:820px){
  .shell{padding:14px}
  .topbar,.piece-head{align-items:flex-start}
  .lookup,.status-row,.measurement-grid,.login-grid{grid-template-columns:1fr}
  .lookup-row{flex-direction:column}
}

/* v6.7.133: fit the complete technical illustration inside focused fullscreen viewport. */
html.sq-recipe-fit,html.sq-recipe-fit body{width:100%;height:100%;overflow:hidden}
html.sq-recipe-fit .shell{max-width:none;width:100%;height:100%;padding:8px 12px;overflow:hidden;display:flex;flex-direction:column}
html.sq-recipe-fit .topbar,html.sq-recipe-fit .lookup,html.sq-recipe-fit .status-row{display:none!important}
html.sq-recipe-fit #appPanel{display:flex;flex-direction:column;flex:1;min-height:0}
html.sq-recipe-fit #appPanel>section.panel{display:flex;flex-direction:column;flex:1;min-height:0;margin:0;padding:8px 12px;overflow:hidden}
html.sq-recipe-fit .tabs{flex:0 0 auto;margin-bottom:6px;padding-bottom:6px}
html.sq-recipe-fit #pieceContent{flex:1;min-height:0;display:flex;flex-direction:column;overflow:auto}
html.sq-recipe-fit .piece-head{margin-bottom:6px;flex:0 0 auto}
html.sq-recipe-fit .piece-name{font-size:18px}
html.sq-recipe-fit .diagram-wrap{width:100%;max-width:100%;min-width:0;flex:1;min-height:0;overflow:hidden;padding:6px;display:flex;align-items:center;justify-content:center;margin-bottom:4px}
html.sq-recipe-fit .diagram-wrap svg{min-width:0!important;width:100%!important;height:100%!important;max-height:100%!important;object-fit:contain;flex:1;display:block}
html.sq-recipe-fit .measurement-grid{display:none}
@media (orientation:landscape){html.sq-recipe-fit .shell{padding:4px 8px}html.sq-recipe-fit .piece-head{margin-bottom:2px}html.sq-recipe-fit .tabs{margin-bottom:3px;padding-bottom:3px}}

/* v6.7.134: portrait/landscape contain-fit for full technical diagram */
html.sq-recipe-fit,html.sq-recipe-fit body{height:100%!important;max-height:100%!important;overflow:hidden!important}
html.sq-recipe-fit .shell{height:100dvh!important;max-height:100dvh!important;overflow:hidden!important}
html.sq-recipe-fit #pieceContent{overflow:hidden!important;min-height:0!important}
html.sq-recipe-fit .diagram-wrap{box-sizing:border-box!important;flex:1 1 auto!important;min-height:0!important;max-height:100%!important;overflow:hidden!important}
html.sq-recipe-fit .diagram-wrap>svg{display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;min-width:0!important;min-height:0!important;object-fit:contain!important}
html.sq-recipe-fit .twist-panel{display:none!important}

/* v6.7.135: reserve actual viewport space for the drawing, no offscreen flex content */
html.sq-recipe-fit #appPanel{height:100%!important;overflow:hidden!important}
html.sq-recipe-fit #appPanel>.lookup,html.sq-recipe-fit #appPanel>.status-row{display:none!important}
html.sq-recipe-fit #appPanel>section.panel:last-of-type{height:100%!important;flex:1 1 0!important;overflow:hidden!important;min-height:0!important}
html.sq-recipe-fit #pieceContent{height:100%!important;flex:1 1 0!important;min-height:0!important;overflow:hidden!important}
html.sq-recipe-fit .diagram-wrap{flex:1 1 0!important;min-height:0!important;min-width:0!important;width:100%!important;height:auto!important;overflow:hidden!important}
html.sq-recipe-fit .diagram-wrap svg{min-width:0!important;min-height:0!important;max-width:100%!important;max-height:100%!important;display:block!important}

/* v6.7.200: blank technical editor must scroll inside embedded fullscreen iframe */
html:has(.blank-editor:not(.hidden)),html:has(.blank-editor:not(.hidden)) body,
html.sq-recipe-fit:has(.blank-editor:not(.hidden)),html.sq-recipe-fit:has(.blank-editor:not(.hidden)) body{height:auto!important;max-height:none!important;overflow-y:auto!important;}
html:has(.blank-editor:not(.hidden)) .shell,html.sq-recipe-fit:has(.blank-editor:not(.hidden)) .shell{height:auto!important;max-height:none!important;overflow:visible!important;display:block!important;}
html:has(.blank-editor:not(.hidden)) #appPanel,html.sq-recipe-fit:has(.blank-editor:not(.hidden)) #appPanel{height:auto!important;max-height:none!important;overflow:visible!important;display:block!important;}
html:has(.blank-editor:not(.hidden)) .blank-editor,html.sq-recipe-fit:has(.blank-editor:not(.hidden)) .blank-editor{height:auto!important;max-height:none!important;overflow:visible!important;}


/* Four concise fields together at the top of every piece. */
.piece-editor .piece-basic-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:end}
@media(max-width:950px){.piece-editor .piece-basic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:500px){.piece-editor .piece-basic-grid{grid-template-columns:1fr}}

/* Fullscreen blank recipe: restore native scrolling and disable legacy fit clipping */
html,html.sq-recipe-fit{height:auto!important;max-height:none!important;overflow-y:auto!important}
html body,html.sq-recipe-fit body{height:auto!important;max-height:none!important;overflow-y:auto!important}
html .shell,html.sq-recipe-fit .shell{height:auto!important;max-height:none!important;overflow:visible!important;display:block!important}
html #appPanel,html.sq-recipe-fit #appPanel{height:auto!important;max-height:none!important;overflow:visible!important;display:block!important}
html #pieceContent,html.sq-recipe-fit #pieceContent{height:auto!important;max-height:none!important;overflow:visible!important}
html .blank-editor,html.sq-recipe-fit .blank-editor{height:auto!important;max-height:none!important;overflow:visible!important}
html.sq-recipe-fit .twist-panel{display:block!important}

/* v208: Let the technical sheet scroll inside the fullscreen iframe. */
html:has(.blank-editor:not(.hidden)),html:has(.blank-editor:not(.hidden)) body{height:auto!important;min-height:100%!important;overflow-y:auto!important;overflow-x:hidden!important}
html:has(.blank-editor:not(.hidden)) .shell,html:has(.blank-editor:not(.hidden)) #appPanel,html:has(.blank-editor:not(.hidden)) .blank-editor{height:auto!important;max-height:none!important;overflow:visible!important}
html:has(.blank-editor:not(.hidden)) #appPanel>section.panel{height:auto!important;max-height:none!important;overflow:visible!important;flex:none!important}
html:has(.blank-editor:not(.hidden)) .piece-basic-grid{grid-template-columns:minmax(180px,2fr) 90px minmax(135px,1fr) minmax(135px,1fr)!important;max-width:none!important}
@media(max-width:780px){html:has(.blank-editor:not(.hidden)) .piece-basic-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:440px){html:has(.blank-editor:not(.hidden)) .piece-basic-grid{grid-template-columns:1fr!important}}
