:root{
  --bg:#f7f7f7;
  --card:#ffffff;
  --accent:#0b6;
  --muted:#6b6b6b;
  --danger:#e04;
  --glass: rgba(0,0,0,0.04);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
*{box-sizing:border-box}
html,body,#app{height:100%;margin:0;background:var(--bg);color:#111}
#app{display:flex;flex-direction:column;padding:12px;gap:10px;align-items:stretch;min-height:100vh}
.panel{background:var(--card);border-radius:12px;padding:10px;box-shadow:0 6px 18px var(--glass)}
.inputs{display:flex;flex-direction:column;gap:10px}
.row{display:flex;gap:8px;flex-wrap:wrap}
label{flex:1;min-width:140px;font-size:13px;color:var(--muted)}
input{width:100%;padding:10px;border-radius:8px;border:1px solid #e6e6e6;background:#fff;font-size:14px}
.templates{display:flex;gap:6px;flex-wrap:wrap}
.tpl-btn{padding:8px 10px;border-radius:8px;border:1px solid #eee;background:#fafafa;font-weight:600;font-size:13px}
.tpl-btn.active{background:linear-gradient(180deg,#fff,#f0fff6);border-color:rgba(11,102,51,0.12);box-shadow:0 2px 6px rgba(11,102,51,0.06)}
.actions{display:flex;gap:8px;margin-top:6px}
button{padding:10px 12px;border-radius:8px;border:1px solid #ddd;background:#fff;font-weight:600}
button.primary{background:var(--accent);color:#fff;border:0}
button#copy,button#download{background:#fff}
.preview{flex:1;display:flex;flex-direction:column;min-height:180px}
.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.output{white-space:pre-wrap;word-break:break-word;overflow:auto;padding:12px;border-radius:8px;background:#fcfcfc;border:1px solid #eee;min-height:180px}
.meta{font-size:12px;color:var(--muted)}
@media (max-width:520px){
  #app{padding:10px}
  .row{flex-direction:column}
  .actions{flex-wrap:wrap}
  .preview{min-height:220px}
}