/* One fixed model-detail shell. Only the inset right information panel scrolls. */
.model-dialog{width:min(1100px,94vw);height:min(752px,calc(100dvh - 40px));max-height:none;border-radius:18px;overflow:hidden}
#model-content{height:100%;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.model-dialog .dialog-top{flex:none;min-height:84px;padding:20px 29px}
.model-dialog .close{width:44px;height:44px}
.model-dialog .dialog-grid{flex:1;min-height:0;overflow:hidden;grid-template-columns:.9fr 1.1fr}
.model-dialog .product-preview{min-width:0;min-height:0;overflow:hidden;justify-content:center;align-items:center;padding:24px}
.model-dialog .large-product{height:350px;max-height:calc(100% - 135px);width:100%;object-fit:contain;margin:0 0 18px;flex-shrink:1;min-height:0}
.model-dialog .preview-meta{text-align:center;max-width:100%;flex:none}
.model-dialog .preview-caption{margin:0 0 16px}
.model-dialog .preview-meta .button{display:inline-flex}
.model-dialog .detail-options{display:flex;flex-direction:column;min-height:0;min-width:0;padding:24px;overflow:hidden}
.embedding-context{flex:none;min-width:0;margin:0 0 12px}
.embedding-context>label{display:block;font-size:12px;font-weight:600;margin-bottom:8px}
.embedding-selector-row{display:flex;gap:8px;min-width:0;align-items:center}
.embedding-selector-row select{flex:1;width:0;min-width:0;min-height:44px;font-size:11px;padding:11px 30px 11px 12px;text-overflow:ellipsis}
.embedding-selector-row .add-embedding{width:44px;height:44px;flex:none;border-radius:8px}
.embedding-context-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-top:5px}
.embedding-context-meta p{font-size:9px;color:var(--muted);line-height:1.5;margin:0}
.embedding-context-meta .inherit-standard{font-size:9px;min-height:32px;padding:0}
.context-dialog-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.context-dialog-actions .button{margin:0;min-height:44px;font-size:11px}
.context-dialog-actions .text-button{min-height:44px}
#new-embedding-error{color:var(--red);font-size:11px}
.review-site{overflow-wrap:anywhere;color:var(--muted)}
.model-dialog .detail-tabs{flex:none;margin-bottom:20px;min-width:0}
.model-dialog .detail-tabs button{min-height:44px}
#detail-tab-panel{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#c7cbc1 transparent;padding:0 14px 12px 0;outline-offset:-3px}
#detail-tab-panel::-webkit-scrollbar{width:6px}#detail-tab-panel::-webkit-scrollbar-track{background:transparent}#detail-tab-panel::-webkit-scrollbar-thumb{background:#c7cbc1;border-radius:8px}
#detail-tab-panel:focus-visible{outline:2px solid #c3361b66;outline-offset:-2px;border-radius:8px;padding-left:4px}
.model-dialog .variant-check{min-height:48px;padding:12px;gap:10px}
.model-dialog .variant-check input{flex:none;width:17px;height:17px;accent-color:var(--red);margin:0}
.model-dialog .standard-options{padding:0;border:0;min-width:0}
.model-dialog .standard-options legend{font-size:12px;font-weight:600;padding:0;margin-bottom:7px}
.model-dialog .standard-check.is-disabled{opacity:.48;cursor:not-allowed}
.model-dialog .standard-check input[type=radio]{appearance:none;border:1px solid #9c9e99;border-radius:3px;background:#fff;position:relative;cursor:pointer}
.model-dialog .standard-check input[type=radio]:checked{border-color:var(--red);background:var(--red)}
.model-dialog .standard-check input[type=radio]:checked::after{content:'';position:absolute;left:5px;top:2px;width:4px;height:8px;border:solid white;border-width:0 2px 2px 0;transform:rotate(45deg)}
.model-dialog .standard-check input:disabled{cursor:not-allowed}
.model-dialog .feature-check{justify-content:flex-start}
.model-dialog .feature-check span{line-height:1.6}
.model-dialog .tab-intro{font-size:12px;font-weight:600;line-height:1.5;color:var(--ink);margin:0 0 24px;padding:0;background:transparent;border:0}
.model-dialog .product-preview.live-preview{position:relative;display:flex;flex-direction:column;min-height:0;padding:0;overflow:hidden;align-items:stretch;justify-content:center}
.model-live-frame,#model-live-preview{display:block;flex:1;width:100%;height:100%;min-height:0;border:0;background:#f8f7f4}
.preview-empty{padding:30px;max-width:100%;text-align:center;font-size:12px;line-height:1.7;color:var(--muted)}
.embed-live-preview{margin-top:12px}
.embed-live-preview summary{cursor:pointer;font-size:11px;min-height:44px;display:flex;align-items:center;color:var(--red);text-decoration:underline;text-underline-offset:4px}
.embed-live-preview iframe{display:block;width:100%;height:360px;border:1px solid var(--line);border-radius:12px;background:var(--paper);margin-top:8px}
body:has(.model-dialog[open]){overflow:hidden}
@media(max-width:720px){
  .model-dialog{width:calc(100vw - 24px);height:min(752px,calc(100dvh - 24px));border-radius:16px}
  .model-dialog .dialog-top{min-height:76px;padding:15px 18px;gap:10px}
  .model-dialog .dialog-top h2{font-size:19px}
  .model-dialog .dialog-top .inline-actions{gap:8px}
  .model-dialog .dialog-top .badge{font-size:8px}
  .model-dialog .dialog-grid{display:grid;grid-template-columns:1fr;grid-template-rows:240px minmax(0,1fr)}
  .model-dialog .product-preview{display:grid;grid-template-columns:95px minmax(0,1fr);gap:14px;padding:12px 18px;border-right:0;border-bottom:1px solid var(--line)}
  .model-dialog .large-product{width:95px;height:122px;max-height:122px;margin:0}
  .model-dialog .preview-meta{text-align:left}
  .model-dialog .preview-caption{font-size:9px;margin-bottom:10px;line-height:1.6}
  .model-dialog .preview-meta .button{font-size:10px;min-height:44px;padding:10px 12px}
  .model-dialog .detail-options{padding:18px}
  .model-dialog .detail-tabs{gap:18px;margin-bottom:17px}
  #detail-tab-panel{padding-right:10px}
  .model-dialog .variant-check small{font-size:8px}
}
@media(max-width:720px) and (max-height:700px){.model-dialog .dialog-grid{grid-template-rows:180px minmax(0,1fr)}}
@media(max-width:370px){.model-dialog .detail-tabs{gap:10px}.model-dialog .detail-tabs button{font-size:10px}}

/* One continuous settings panel; a single save action replaces the former tabs/review. */
.model-dialog .embedding-context{margin-bottom:24px}
.model-dialog .option-actions{justify-content:flex-end}
.model-dialog .option-actions{position:sticky;bottom:0;z-index:1;align-items:center;gap:16px;background:#fff;padding-bottom:4px}
.model-dialog .option-actions .button{flex:none}
.model-save-status{flex:1;min-width:0;margin:0;color:var(--muted);font-size:11px;line-height:1.5;overflow-wrap:anywhere}
.model-save-status:empty{visibility:hidden}
.model-save-status.visible{color:#27583b}
@media(max-width:370px){.model-dialog .option-actions{gap:10px}.model-save-status{font-size:10px}}
