.tti-layout {display:grid;grid-template-columns:minmax(290px, .85fr) minmax(0, 1.15fr);grid-template-areas:"input preview" "settings preview";gap:20px;align-items:start;}
.tti-input {grid-area:input;min-width:0;}
.tti-input textarea {width:100%;min-height:220px;resize:vertical;}
.tti-settings {grid-area:settings;min-width:0;}
.tti-settings details {border-top:1px solid #e5e7eb;padding:14px 0;}
.tti-settings summary {font-weight:700;cursor:pointer;margin-bottom:12px;}
.tti-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:stretch;}
.tti-fields > div {display:flex;flex-direction:column;justify-content:flex-end;min-width:0;}
.tti-fields .tool-label {overflow-wrap:anywhere;}
.tti-fields input,.tti-fields select {width:100%;min-width:0;min-height:48px;height:48px;}
.tti-fields input[type=color] {padding:4px;}
.tti-settings .tool-check-row {margin-top:14px;flex-wrap:wrap;}
.tti-preview-panel {grid-area:preview;position:sticky;top:0;min-width:0;}
.tti-preview {display:flex;min-height:240px;max-height:60vh;overflow:auto;align-items:flex-start;justify-content:center;padding:12px;border:1px solid #d1d5db;border-radius:6px;background-color:#fff;background-image:linear-gradient(45deg,#e5e7eb 25%,transparent 25%),linear-gradient(-45deg,#e5e7eb 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e5e7eb 75%),linear-gradient(-45deg,transparent 75%,#e5e7eb 75%);background-size:20px 20px;background-position:0 0,0 10px,10px -10px,-10px 0;}
.tti-preview canvas {display:block;max-width:100%;height:auto;flex-shrink:0;}
.tti-preview canvas[hidden],#text-to-image-tool [hidden] {display:none;}
#tti-empty {align-self:center;padding:12px;background:#fff;text-align:center;}
#tti-status {min-height:24px;overflow-wrap:anywhere;}
#text-to-image-tool button:disabled {opacity:.5;cursor:not-allowed;}
@media(max-width:850px){.tti-layout{grid-template-columns:1fr;grid-template-areas:"input" "preview" "settings";gap:16px}.tti-preview-panel{position:static}.tti-preview{min-height:180px;max-height:50vh}.tti-input textarea{min-height:160px}}
