/* ===== newsletter builder (web/newsletter.js). Theme variables only, so it matches every company look. */
.wrap.nl-wrap.nl-wide { max-width: 1180px; }
.nl-h2 { font-size: 18px; margin: 18px 0 10px; }
.nl-wrap .msg.ok-quiet { background: color-mix(in srgb, var(--link) 13%, var(--card)); color: var(--text); border-left: 4px solid var(--link); }
.nl-wrap .msg.ok-quiet, .nl-img .msg { margin-top: 8px; }
.nl-wrap .seg button { min-width: 0; }

/* list */
.nl-list .person { align-items: flex-start; }
.nl-li-ic { width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--link) 12%, var(--card)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; }
.nl-list .m { word-break: normal; overflow-wrap: anywhere; }

/* start: layout picker */
.nl-layouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.nl-layout { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 10px; color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow); min-width: 0; }
.nl-layout:hover, .nl-layout:focus-visible { border-color: var(--link); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 20%, transparent); }
.nl-layout[disabled] { opacity: .6; }
.nl-lthumb { display: block; position: relative; height: 170px; overflow: hidden; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
.nl-lthumb iframe { position: absolute; top: 0; left: 0; width: 600px; height: 760px; border: 0; transform: scale(.27); transform-origin: top left; pointer-events: none; }
.nl-lname { font-weight: 700; font-family: var(--font-heading); color: var(--primary); font-size: 16px; margin-top: 4px; }
.nl-layout .m { font-size: 12.5px; line-height: 1.35; }
.nl-ai-card .nl-h2 { margin-top: 0; }

/* toolbar */
.nl-bar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; margin-bottom: 8px; background: var(--bg); border-bottom: 1px solid var(--border); }
.nl-bar .te-b { font-size: 18px; }
.nl-bar .nl-view { flex: 1 1 150px; }
.nl-saved { flex: 1 1 auto; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nl-saved.bad { color: var(--error); font-weight: 600; }
.nl-bar .btn.nl-send { width: auto; margin: 0; padding: 10px 18px; font-size: 15px; flex-shrink: 0; }

/* two panes: blocks left, preview right (computers); one at a time on phones */
.nl-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.nl-side, .nl-pv { min-width: 0; }
@media (max-width: 899px) {
  .nl-grid[data-mode=edit] .nl-pv { display: none; }
  .nl-grid[data-mode=preview] .nl-side { display: none; }
}
@media (min-width: 900px) {
  .nl-bar .nl-view { display: none; }
  .nl-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
  .nl-pv { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow-y: auto; overflow-x: hidden; }
}
@media (min-width: 1300px) { .nl-grid { grid-template-columns: minmax(0, 1fr) 640px; } }
.nl-pv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.nl-pv-top .tp-label { margin: 0; }
.nl-pv-top .seg { flex: 0 1 260px; }
.nl-frame-wrap { position: relative; overflow: hidden; border-radius: var(--radius); background: color-mix(in srgb, var(--text) 6%, var(--bg)); border: 1px solid var(--border); min-height: 200px; }
.nl-frame-wrap iframe { display: block; border: 0; background: #fff; transform-origin: top left; }
.nl-pv-note { margin: 8px 2px 0; }

/* block list */
.nl-blocks { display: flex; flex-direction: column; gap: 8px; }
.nl-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.nl-block.open { border-color: var(--link); box-shadow: 0 0 0 2px color-mix(in srgb, var(--link) 22%, transparent); }
.nl-brow { display: flex; align-items: center; gap: 4px; padding: 6px 8px 6px 4px; }
.nl-bhead { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px; text-align: left; color: var(--text); font: inherit; border-radius: 10px; cursor: pointer; }
.nl-bhead:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.nl-ic { width: 34px; height: 34px; border-radius: 9px; background: color-mix(in srgb, var(--link) 12%, var(--card)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nl-ic svg, .nl-add-item svg { width: 20px; height: 20px; stroke: var(--link); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nl-bt { display: flex; flex-direction: column; min-width: 0; }
.nl-bt b { font-size: 14.5px; }
.nl-snip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nl-bacts { display: flex; gap: 4px; flex-shrink: 0; }
.nl-bacts .te-b { width: 32px; height: 32px; font-size: 14px; }
.nl-bacts .te-b.sure { width: auto; padding: 0 8px; font-size: 12.5px; font-weight: 700; background: var(--error); color: #fff; border-color: var(--error); }
.nl-fields { padding: 4px 14px 16px; border-top: 1px solid var(--border); }
.nl-fields > label:first-child, .nl-fields > .nl-img:first-child > label:first-child { margin-top: 12px; }
.nl-fields .rte-box { min-height: 90px; }
.nl-wrap .rte-bar [data-cmd=strikeThrough], .nl-wrap .rte-bar [data-cmd=h3], .nl-wrap .rte-bar [data-cmd=quote] { display: none; }
.nl-check { margin: 12px 0 0; }
.nl-item { position: relative; border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px 12px; margin: 14px 0 0; min-width: 0; }
.nl-item legend { font-weight: 700; font-size: 13px; padding: 0 6px; color: var(--primary); }
.nl-item-rm { position: absolute; top: 6px; right: 8px; padding: 4px 9px; }
.nl-fields .chip-btn[data-item-add] { margin-top: 12px; }
@media (max-width: 380px) { .nl-bacts .te-b { width: 30px; } .nl-ic { width: 30px; height: 30px; } }

/* photo field */
.nl-img-row { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.nl-thumb { width: 96px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: color-mix(in srgb, var(--text) 6%, var(--bg)); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; gap: 2px; }
.nl-thumb .m { font-size: 11px; }
.nl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nl-img-acts { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 160px; min-width: 0; }
.nl-img-acts .small-btn { cursor: pointer; }
label.small-btn.nl-upl { position: relative; display: inline-block; margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); }
label.small-btn.nl-upl:focus-within { outline: 2px solid var(--link); outline-offset: 2px; }
label.small-btn.nl-upl.busy { opacity: .6; }
.nl-file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; }
.nl-ai { margin-top: 10px; padding: 10px 12px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.nl-ai[hidden] { display: none; }
.nl-ai label:first-child { margin-top: 0; }
.nl-ai .btn { margin-top: 8px; }
.nl-credit { margin: 6px 0 0; }

/* add block menu */
.nl-add { margin-top: 10px; }
.nl-add > .btn { margin-top: 0; }
.nl-add-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin-top: 8px; padding: 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.nl-add-menu[hidden] { display: none; }
.nl-add-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); font: 600 13.5px var(--font-body); text-align: left; cursor: pointer; min-width: 0; }
.nl-add-item:hover, .nl-add-item:focus-visible { border-color: var(--link); outline: none; background: color-mix(in srgb, var(--link) 7%, var(--card)); }
.nl-add-item svg { flex-shrink: 0; }
.nl-del { margin-top: 28px; }
.nl-del.sure { background: var(--error); color: #fff; border-color: var(--error); }
/* tapping a part of the preview opens its block; the block flashes so you can see where you landed */
.nl-pv-hint { margin: 0 0 8px; }
.nl-flash { animation: nl-flash 1.2s ease-out; border-radius: var(--radius); }
@keyframes nl-flash { 0% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--link) 45%, transparent); } 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--link) 22%, transparent); } }
@media (prefers-reduced-motion: reduce) { .nl-flash { animation: none; } }

/* Claude asks before writing (no credits used) */
.nl-ask { margin-top: 14px; }
.nl-qs { border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius); padding: 14px 16px; background: var(--card); }
.nl-qs p { margin: 0 0 6px; }
.nl-qs ol { margin: 0 0 12px; padding-left: 20px; }
.nl-qs li { margin: 0 0 4px; }
.nl-qs-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.nl-qs-acts .btn { flex: 1 1 180px; margin: 0; }
