/* New-website workspace: keep setup and its preview in view together. */
#modal-new-project { padding:20px; }
#modal-new-project .setup-modal { width:100%; max-width:1680px; height:calc(100vh - 40px); height:calc(100dvh - 40px); max-height:none; padding:0; display:flex; flex-direction:column; overflow:hidden; }
.setup-header { display:flex; gap:24px; align-items:center; padding:14px 20px; border-bottom:1px dashed var(--border); flex-shrink:0; }
.setup-header h2 { font-size:24px; line-height:1.25; margin:0 0 4px; }
.setup-header p { margin:0; font-size:14px; line-height:1.5; color:var(--text2); }
.setup-skip { margin-left:auto; display:grid; gap:6px; flex-shrink:0; }
.setup-skip span { font-size:14px; color:var(--text2); }
#modal-new-project .setup-close { width:44px; min-width:44px; padding:0; font-size:24px; align-self:flex-start; }
.setup-body { display:grid; grid-template-columns:minmax(0,1.9fr) minmax(320px,1fr); gap:20px; min-height:0; flex:1; padding:20px 24px; }
.setup-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; align-content:start; overflow-y:auto; overscroll-behavior:contain; padding:4px 6px 6px 2px; min-width:0; }
.setup-group { min-width:0; margin:0; padding:12px; border:1px dashed var(--border); }
.setup-group legend { padding:0 6px; font-size:16px; font-weight:700; color:var(--text); }
.setup-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#modal-new-project .field { margin:0 0 10px; min-width:0; }
#modal-new-project .label { font-size:14px; line-height:1.4; margin-bottom:4px; color:var(--text); }
#modal-new-project .label span { font-size:12px; color:var(--text2); }
#modal-new-project .input { min-height:40px; padding:8px; font-size:14px; line-height:1.4; }
#modal-new-project textarea { resize:vertical; min-height:64px; }
#modal-new-project input[type="file"] { font-size:12px; padding:6px; }
#modal-new-project .btn { min-height:44px; font-size:14px; white-space:normal; }
.setup-checkbox { display:flex; align-items:center; gap:10px; font-size:14px; line-height:1.5; cursor:pointer; min-height:32px; }
.setup-checkbox input { width:18px; height:18px; flex-shrink:0; }
#modal-new-project .setup-hint { margin:4px 0 8px; font-size:14px; line-height:1.5; color:var(--text2); }
.setup-hint:empty { display:none; }
.setup-extras summary { font-size:14px; line-height:1.5; cursor:pointer; padding:4px 0; }
.setup-extras .btn { margin-top:8px; }
.setup-colors { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:14px; }
#modal-new-project input[type="color"] { padding:4px; height:44px; cursor:pointer; }
.setup-preview { min-width:0; min-height:0; display:flex; flex-direction:column; padding:16px; border:1px dashed var(--border); background:var(--bg); }
.setup-preview-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.setup-preview h3 { font-size:16px; margin:0; }
.setup-devices { display:flex; gap:6px; }
#modal-new-project .setup-devices .btn { font-size:12px; padding:6px 10px; }
.setup-devices [aria-pressed="true"] { outline:2px solid var(--green); outline-offset:1px; }
.setup-preview-stage { position:relative; flex:1; min-height:220px; overflow:hidden; background:var(--bg2); border:1px solid var(--border); }
#setup-preview-frame { position:absolute; top:0; border:0; transform-origin:top left; background:#ffffff; pointer-events:none; }
#setup-preview-empty { position:absolute; inset:0; margin:0; padding:32px; display:grid; place-items:center; text-align:center; font-size:16px; line-height:1.7; color:var(--text); }
#setup-preview-empty[hidden] { display:none; }
.setup-footer { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:12px 20px; border-top:1px dashed var(--border); flex-shrink:0; }
.setup-footer p { margin:0; font-size:14px; line-height:1.5; }
#modal-new-project .setup-footer .setup-hint { margin:4px 0 0; }
.setup-footer-actions { display:flex; gap:12px; flex-shrink:0; }
#setup-error { color:var(--red); margin-top:8px; }
@media (max-width:1200px) { .setup-body { grid-template-columns:minmax(0,1.5fr) minmax(300px,1fr); gap:16px; padding:16px; } .setup-fields { grid-template-columns:minmax(0,1fr); } }
@media (max-width:850px) {
  #modal-new-project { padding:8px; }
  #modal-new-project .setup-modal { height:calc(100vh - 16px); height:calc(100dvh - 16px); }
  .setup-header { flex-wrap:wrap; gap:12px; padding:16px; }
  .setup-header > div:first-child { flex:1; }
  .setup-skip { order:3; width:100%; margin:0; grid-template-columns:auto 1fr; align-items:center; gap:12px; }
  .setup-skip span { font-size:12px; }
  .setup-body { display:block; overflow-y:auto; overscroll-behavior:contain; }
  .setup-fields { overflow:visible; padding:2px; gap:16px; }
  .setup-preview { margin-top:16px; height:500px; }
  .setup-footer { padding:12px 16px; flex-wrap:wrap; gap:10px; }
  .setup-footer-actions { width:100%; justify-content:flex-end; }
  #modal-new-project .input { font-size:16px; }
}
@media (max-width:420px) { .setup-row { grid-template-columns:minmax(0,1fr); gap:0; } .setup-colors { grid-template-columns:repeat(2,minmax(0,1fr)); } .setup-skip { grid-template-columns:1fr; gap:4px; } }
/* At high zoom or on short screens, let the whole dialog scroll so its
   header and actions cannot squeeze the form out of view. */
@media (max-height:600px) {
  #modal-new-project .setup-modal { display:block; overflow-y:auto; }
  .setup-body { display:block; overflow:visible; }
  .setup-fields { overflow:visible; }
  .setup-preview { height:500px; margin-top:16px; }
}
