.model-explorer #compose { padding: 0; background: transparent; border: 0; box-shadow: none; }
.stack-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(290px, 340px); gap: 18px; align-items: start; }
.stack-preview, .stack-builder, .stack-output { border: 1px solid #d3d3d3; border-radius: 16px; overflow: hidden; background: #fff; }
.stack-preview-top, .stack-preview-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.stack-preview-top > span { text-transform: uppercase; font-size: 11px; letter-spacing: .08em; color: #61656a; }
.stack-preview-top strong { font-size: 13px; font-weight: 500; }
.stack-stage { height: 440px; position: relative; background: radial-gradient(ellipse at bottom, #ededed 0, #fafafa 52%, #fff 78%); }
#stack-canvas { display: block; width: 100%; height: 100%; }
.stack-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(78%, 360px); padding: 28px 18px; border: 1px dashed #b8b8b8; border-radius: 14px; background: #f4f4f4; text-align: center; }
.stack-empty strong, .stack-empty span { display: block; }
.stack-empty strong { font-size: 20px; margin: 7px 0; }
.stack-empty > span:first-child { font-size: 28px; line-height: 1; }
.stack-empty.active { background: #fff8dd; border-color: #b78a00; }
.stack-preview-bottom { border-top: 1px solid #dedede; flex-wrap: wrap; }
.stack-preview-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.stack-build-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.stack-preview-actions button, .stack-text-button { padding: 3px 0; text-decoration: underline; background: transparent; font-size: 12px; }
.stack-builder { padding: 22px; background: #f1f1f1; min-height: 560px; }
.stack-builder h3 { font-size: 25px; line-height: 1.2; letter-spacing: -.7px; margin: 16px 0 10px; }
.stack-builder p { color: #59616b; font-size: 13px; line-height: 1.6; margin: 9px 0 16px; }
.stack-builder-top { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; align-items: center; }
.stack-builder-top button { text-transform: none; letter-spacing: 0; }
.stack-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 22px 0 18px; }
.stack-steps button { border-top: 3px solid #d4d4d4; padding: 9px 0 0; font-size: 11px; text-align: left; background: transparent; border-radius: 0; }
.stack-steps button[aria-current] { border-color: #ffc400; font-weight: 700; }
.stack-steps button:disabled { opacity: .4; cursor: default; }
.stack-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 17px 0; }
.stack-choice { text-align: left; border: 1px solid #c7c7c7; border-radius: 10px; background: #fff; padding: 14px 12px; min-height: 78px; }
.stack-choice strong, .stack-choice span { display: block; }
.stack-choice strong { font-size: 20px; line-height: 1.25; }
.stack-choice span { font-size: 11px; line-height: 1.5; color: #59616b; margin-top: 5px; }
.stack-choice[aria-pressed=true] { background: #fff2bd; border-color: #aa8000; box-shadow: inset 0 0 0 1px #aa8000; }
.stack-choice:hover { border-color: #242424; }
.stack-height-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack-height-choices .stack-choice { text-align: center; padding-inline: 5px; }
.stack-rule { background: #e7e7e7; padding: 12px; border-radius: 8px; }
.stack-idle-list { padding: 0; margin: 24px 0; list-style: none; counter-reset: steps; }
.stack-idle-list li { padding: 12px 0; border-top: 1px solid #d2d2d2; counter-increment: steps; font-size: 13px; }
.stack-idle-list li::before { content: '0' counter(steps); color: #77808b; font-size: 10px; margin-right: 14px; }
.stack-primary, .stack-secondary { display: inline-flex; align-items: center; justify-content: center; padding: 11px 16px; border: 1px solid #d0d0d0; border-radius: 8px; min-height: 42px; font-size: 13px; }
.stack-primary { background: #ffc400; color: #111; border-color: #ffc400; }
.stack-secondary { background: #fff; }
.stack-primary:disabled, .stack-secondary:disabled { opacity: .45; cursor: default; }
.stack-builder > .stack-primary { width: 100%; }
.stack-builder-bottom { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.stack-builder-bottom .stack-primary { flex: 1; }
.stack-patterns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack-patterns .stack-choice { padding: 10px 8px; text-align: center; }
.stack-patterns .stack-choice strong { font-size: 12px; }
.stack-mini { height: 44px; display: flex; flex-direction: column; gap: 2px; width: 62px; margin: 0 auto 9px; }
.stack-mini i { display: flex; align-items: center; justify-content: center; flex: var(--units); background: #d8dade; border-radius: 2px; font: normal 9px Arial; min-height: 0; }
.stack-column-tabs { display: flex; gap: 6px; margin: 14px 0; }
.stack-column-tabs button { flex: 1; padding: 8px; background: #fff; border: 1px solid #ccc; border-radius: 6px; font-size: 12px; }
.stack-column-tabs button[aria-pressed=true] { background: #ffc400; border-color: #b58900; }
.stack-draft-preview { width: 100%; height: 150px; display: block; margin-top: 12px; }
.stack-status { margin: 10px 0; font-size: 12px; color: #555; min-height: 18px; }
.stack-layer-details { padding: 0 20px 14px; border-top: 1px solid #dedede; }
.stack-layer-details summary { padding: 14px 0; cursor: pointer; font-size: 12px; }
.stack-layer-list { list-style: none; margin: 0; padding: 0; }
.stack-layer-list > li { padding: 12px 0; border-top: 1px solid #e2e2e2; }
.stack-layer-list p { font-size: 12px; color: #59616b; margin: 5px 0; }
.stack-layer-controls { display: flex; gap: 14px; flex-wrap: wrap; }
.stack-layer-controls button { font-size: 12px; padding: 3px 0; text-decoration: underline; }
.stack-layer-controls button:disabled { opacity: .35; cursor: default; }
.stack-output { padding: 24px; margin-top: 18px; }
.stack-output h3 { font-size: 23px; margin: 0 0 10px; }
.stack-output h4 { margin: 22px 0 8px; font-size: 15px; }
.stack-output table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.stack-output th, .stack-output td { padding: 10px 5px; border-bottom: 1px solid #dedede; }
.stack-output-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.stack-build-dimensions { font-size: 16px; font-weight: 600; margin: 12px 0; }
.stack-save-note { color: #66717d; font-size: 11px; margin-top: 12px; }
.stack-confirmed .stack-workspace { grid-template-columns: minmax(0, 1fr); }
.stack-confirmed .stack-builder, .stack-confirmed .stack-preview-actions { display: none; }
.stack-confirmed .stack-preview-bottom { background: #ededed; }
#stack-confirmed-note { margin: 0; font-size: 13px; line-height: 1.6; max-width: 360px; color: #59616b; }
#stack-canvas[data-expandable="true"] { cursor: zoom-in; }
.stack-image-dialog canvas { width: 100%; height: 100%; max-height: calc(100dvh - 76px); min-height: 0; }
@media screen and (min-width: 901px) and (min-height: 680px) {
  body.stack-designer-page:not(.stack-designer-confirmed) { height: 100dvh; display: flex; flex-direction: column; }
  .stack-designer-page:not(.stack-designer-confirmed) > header,
  .stack-designer-page:not(.stack-designer-confirmed) > footer { flex: none; }
  .stack-designer-page:not(.stack-designer-confirmed) .model-explorer { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto minmax(0, 1fr); column-gap: 20px; padding-block: 12px 8px; }
  .stack-designer-page:not(.stack-designer-confirmed) .model-explorer > h1 { grid-column: 1; grid-row: 1; font-size: 28px; margin-bottom: 4px; }
  .stack-designer-page:not(.stack-designer-confirmed) .model-explorer > p { grid-column: 1; grid-row: 2; font-size: 13px; margin-bottom: 12px; }
  .stack-designer-page:not(.stack-designer-confirmed) .explorer-modes { grid-column: 2; grid-row: 1 / 3; align-self: start; margin-block: 0 12px; }
  .stack-designer-page:not(.stack-designer-confirmed) #compose { grid-column: 1 / -1; grid-row: 3; min-height: 0; display: flex; flex-direction: column; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-workspace { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-preview { display: flex; flex-direction: column; min-height: 0; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-stage { flex: 1; min-height: 0; height: auto; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-preview-top,
  .stack-designer-page:not(.stack-designer-confirmed) .stack-preview-bottom { flex: none; padding: 8px 16px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-layer-details { flex: none; max-height: 35%; overflow: auto; padding-bottom: 0; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-layer-details summary { padding-block: 8px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-builder { min-height: 0; padding: 14px 18px; overflow: auto; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-builder h3 { font-size: 22px; margin-block: 10px 6px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-builder p { margin-block: 6px 8px; line-height: 1.45; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-idle-list { margin-block: 14px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-idle-list li { padding-block: 8px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-steps { margin-block: 12px 10px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-choices { margin-block: 10px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-choice { min-height: 60px; padding: 6px 10px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-choice strong { font-size: 18px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-choice span { margin-top: 3px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-rule { padding: 8px; font-size: 12px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-patterns { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-patterns .stack-choice { padding: 6px 4px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-patterns .stack-choice > span { display: none; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-patterns .stack-choice strong { font-size: 11px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-mini { height: 28px; margin-bottom: 4px; width: 48px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-column-tabs { margin-block: 8px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-draft-preview { display: none; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-builder-bottom { margin-top: 10px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-status { min-height: 0; margin-block: 2px 0; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-status:empty { display: none; }
}
@media (max-width: 900px) { .stack-workspace { grid-template-columns: minmax(0, 1fr) 290px; gap: 12px; } .stack-preview-top { padding: 14px; flex-wrap: wrap; } }
@media screen and (min-width: 901px) and (min-height: 680px) and (max-height: 760px) {
  .stack-designer-page:not(.stack-designer-confirmed) .stack-builder { padding-block: 12px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-steps { margin-top: 8px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-builder h3 { margin-top: 8px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-builder p { margin-block: 4px 6px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-builder-bottom { margin-top: 6px; }
  .stack-designer-page:not(.stack-designer-confirmed) .stack-column-tabs button { padding-block: 6px; }
}
@media (max-width: 700px) { .stack-workspace { grid-template-columns: minmax(0, 1fr); } .stack-stage { height: 320px; } .stack-builder { min-height: 0; padding: 20px; } .stack-output { padding: 18px; } .stack-preview-top strong { order: 3; width: 100%; } }
@media print { body > header, body > footer, .model-explorer > h1, .model-explorer > p, .explorer-modes, #models, .stack-builder, .stack-preview-top, .stack-preview-bottom, .stack-empty, .stack-layer-details, .stack-status, .stack-output-actions, .stack-save-note { display: none !important; } .model-explorer { padding: 0 !important; background: white !important; } #compose { display: block !important; } .stack-workspace { display: block; } .stack-preview, .stack-output { border: 0; overflow: visible; } .stack-stage { height: 300px; background: white; } .stack-output { margin: 0; padding: 15px 0; } .stack-output table { break-inside: avoid; } }
