@import "./newsletter-editor-templates.css";

.ne { margin:0; background:var(--nh-ground); color:var(--nh-ink); font:var(--nh-font-body-md); display:flex; flex-direction:column; height:100dvh; }
.ne-header { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:start; gap:var(--nh-space-md); padding:var(--nh-space-sm) var(--nh-space-lg); background:var(--nh-surface); border-bottom:1px solid var(--nh-line); flex:none; }
.ne-header-nav { display:flex; align-items:center; gap:var(--nh-space-sm); min-width:0; }
.ne-header-nav>.nh-btn { font-size:var(--nh-size-body-sm); padding:var(--nh-space-xs) var(--nh-space-sm); min-height:36px; }
.ne-back { display:inline-flex; align-items:center; gap:var(--nh-space-sm); }
.ne-back svg { flex:none; }
.ne-toolbar { padding:0; background:var(--nh-surface); display:flex; flex-wrap:wrap; gap:var(--nh-space-xs) var(--nh-space-sm); align-items:center; min-width:0; }
.ne-toolbar>.ne-actions { display:contents; }
.ne-toolbar .nh-btn { font-size:var(--nh-size-body-sm); min-height:36px; padding:var(--nh-space-xs) var(--nh-space-sm); }
.ne-name { flex:0 1 180px; min-width:0; margin:0; }
.ne-name .nh-input { min-height:36px; padding:var(--nh-space-xs) var(--nh-space-sm); font-size:var(--nh-size-body-sm); }
.ne-name input { display:block; width:100%; box-sizing:border-box; }
.ne-actions { display:flex; flex-wrap:wrap; gap:var(--nh-space-sm); }
#ne-status { margin:0 0 0 auto; align-self:center; color:var(--nh-muted); font-size:var(--nh-size-body-sm); white-space:nowrap; }
.ne-error { color:var(--nh-bad); flex:1 1 100%; margin:0; }
.ne-warnings { flex:1 1 100%; color:var(--nh-warn); margin:0; }
.ne-phone-hint { display:none; padding:var(--nh-space-lg); margin:0; background:var(--nh-info-bg); color:var(--nh-info); }
#ne-main { display:flex; flex-direction:column; flex:1; min-height:0; overflow:auto; }
#ne-sdk { flex:1 0 480px; min-height:480px; }
.ne-name-dialog { box-sizing:border-box; width:calc(100% - 32px); max-width:var(--nh-dialog-max); padding:var(--nh-space-xl); border:1px solid var(--nh-line); border-radius:var(--nh-radius-xl); color:var(--nh-ink); background:var(--nh-surface); box-shadow:var(--nh-shadow-menu); }
.ne-name-dialog::backdrop { background:var(--nh-scrim); }
.ne-name-dialog h2 { font:var(--nh-font-headline-md); margin:0; }
.ne-name-dialog p { color:var(--nh-muted); }
.ne-name-dialog .nh-input { width:100%; box-sizing:border-box; margin:var(--nh-space-sm) 0 var(--nh-space-lg); }
.ne-panel { padding:var(--nh-space-xl); }
.ne-panel h2 { font:var(--nh-font-headline-md); }
.ne-panel p { color:var(--nh-muted); max-width:70ch; }
.ne-inline-form { display:flex; flex-wrap:wrap; align-items:end; gap:var(--nh-space-lg); }
.ne-inline-form .nh-field { flex:0 1 400px; }
.ne-inline-form input { display:block; width:100%; box-sizing:border-box; }
#ne-history { padding:0; list-style:none; max-width:70ch; }
#ne-history li { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--nh-space-md); padding:var(--nh-space-md) 0; border-bottom:1px solid var(--nh-line); }
.ne-restore { padding:var(--nh-space-lg); background:var(--nh-info-bg); border-radius:var(--nh-radius-md); max-width:70ch; }
.ne-unsaved-guard { display:flex; gap:var(--nh-space-sm); align-items:center; min-height:44px; margin-bottom:var(--nh-space-md); }
.ne-unsaved-guard input { min-width:24px; min-height:24px; }
#ne-preview { display:block; width:100%; height:700px; border:1px solid var(--nh-line); background:var(--nh-surface); }
.ne-index { max-width:var(--nh-content-max); padding:var(--nh-space-xl); margin:auto; }
.ne-drafts { padding:0; list-style:none; border:1px solid var(--nh-line); border-radius:var(--nh-radius-xl); background:var(--nh-surface); }
.ne-drafts li { padding:var(--nh-space-lg); display:flex; gap:var(--nh-space-lg); align-items:center; justify-content:space-between; }
.ne-drafts li + li { border-top:1px solid var(--nh-line); }
.ne-drafts li div { min-width:0; overflow-wrap:anywhere; }
.ne-drafts p { margin:var(--nh-space-xs) 0 0; }
.ne button:focus-visible,.ne a:focus-visible,.ne input:focus-visible { outline:3px solid var(--nh-focus); outline-offset:2px; }
.ne [hidden] { display:none !important; }
@media (max-width:1100px) { .ne-header { grid-template-columns:minmax(0,1fr); } }
@media (max-width:767px) {
    .ne-header { padding:var(--nh-space-sm) var(--nh-space-lg); }
    .ne-toolbar { padding:0; }
    .ne-toolbar .nh-btn,.ne-header-nav>.nh-btn { min-height:44px; }
    .ne-desktop-action { display:none; }
    .ne-phone-hint { display:block; }
    #ne-sdk { flex:0 0 auto; min-height:220px; height:250px; }
    .ne-panel { padding:var(--nh-space-lg); }
    .ne-actions { width:100%; }
    #ne-status { flex:0 1 auto; margin-left:0; }
}

#ne-output-preview { width:100%; min-height:640px; border:1px solid var(--nh-line); background:var(--nh-surface); }
#ne-outputs { padding-left:24px; }
#ne-outputs li { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--nh-line); }
