/* Newsletter admin: light, in the Instagram look (paper, lilac, ink). */
:root {
  --paper: #F3EFE7; --card: #FBFAF7; --ink: #160C2E; --ink2: #4A4160; --ink3: #8A819C;
  --lilac: #B9A3E0; --violet: #7F63AD; --soft: #EEE8F5; --peach: #E7A98C; --line: rgba(22, 12, 46, .08);
  --shadow: 0 30px 60px -36px rgba(22, 12, 46, .28), 0 0 0 1px rgba(22, 12, 46, .05);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); -webkit-font-smoothing: antialiased;
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.011em;
  background:
    radial-gradient(900px 500px at 8% -10%, rgba(185, 163, 224, .45), transparent 60%),
    radial-gradient(700px 420px at 100% 0%, rgba(231, 169, 140, .28), transparent 60%),
    var(--paper);
  background-attachment: fixed;
}
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: rgba(243, 239, 231, .72); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand img:first-child { border-radius: 8px; }
.brand .word { height: 19px; }
.crumb { padding: 4px 11px; border-radius: 999px; background: var(--soft); color: var(--violet); font-weight: 600; font-size: 13px; }
.top nav { margin-left: auto; display: flex; gap: 4px; }
.top nav a { padding: 7px 13px; border-radius: 999px; text-decoration: none; color: var(--ink2); font-weight: 500; font-size: 14px; }
.top nav a:hover { background: rgba(22, 12, 46, .05); color: var(--ink); }

main { max-width: 1320px; margin: 0 auto; padding: 34px 28px 80px; }
.card { background: var(--card); border-radius: 32px; box-shadow: var(--shadow); padding: 28px; }
.denied { max-width: 420px; margin: 80px auto; text-align: center; }
.denied h1 { margin: 0 0 6px; letter-spacing: -.03em; }
.denied p { color: var(--ink2); margin: 0 0 20px; }

/* hello row */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 26px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 6px 13px; border-radius: 999px; background: var(--ink); color: var(--card); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; }
.hello h1 { margin: 14px 0 0; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.02; letter-spacing: -.05em; font-weight: 700; }
.hello h1 em { font-style: normal; background: linear-gradient(90deg, var(--violet), #C46A5A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(118px, 1fr)); gap: 10px; }
.stats div { background: var(--card); border-radius: 24px; padding: 16px 18px; box-shadow: var(--shadow); }
.stats div:first-child { background: linear-gradient(160deg, var(--lilac), var(--violet)); color: #fff; }
.stats div:first-child span { color: rgba(255, 255, 255, .8); }
.stats b { display: block; font-size: 30px; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12.5px; color: var(--ink3); font-weight: 500; }

/* compose */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; align-items: start; }
.ed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ed-head h2, .pv-head h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.saved { font-size: 12.5px; color: var(--ink3); opacity: 0; transition: opacity .3s; }
.saved.on { opacity: 1; }
.templates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 20px; padding: 10px; border-radius: 20px; background: var(--paper); }
.templates span { font-size: 12.5px; color: var(--ink3); font-weight: 600; padding: 0 6px; }
.templates button { border: 0; cursor: pointer; padding: 7px 13px; border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 600; box-shadow: 0 0 0 1px var(--line); transition: transform .2s, box-shadow .2s; }
.templates button:hover { transform: translateY(-1px); box-shadow: 0 0 0 1.5px var(--violet); color: var(--violet); }

.f { display: block; margin-bottom: 14px; }
.f > span { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px 4px; }
.f > span em { font-style: normal; font-weight: 400; color: var(--ink3); margin-left: 4px; }
.f input, .f textarea, .sub-tools input {
  width: 100%; border: 0; outline: 0; border-radius: 16px; padding: 12px 15px; background: var(--paper);
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .2s, background .2s;
}
.f textarea { resize: vertical; line-height: 1.55; }
.f input:focus, .f textarea:focus, .sub-tools input:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--violet), 0 0 0 5px rgba(127, 99, 173, .12); }
.f input::placeholder, .f textarea::placeholder { color: #B3ABBE; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.themes { display: flex; gap: 8px; }
.themes label { flex: 1; display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 16px; background: var(--paper); cursor: pointer; font-weight: 600; font-size: 13.5px; transition: box-shadow .2s; }
.themes input, .aud input { position: absolute; opacity: 0; pointer-events: none; }
.themes i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6), 0 3px 8px -3px rgba(22, 12, 46, .4); }
.t-paper { background: linear-gradient(160deg, #D9CDEB, #EBC9C6); } .t-lilac { background: linear-gradient(160deg, #B9A3E0, #7F63AD); } .t-peach { background: linear-gradient(160deg, #E7A98C, #C9786E); }
.themes label:has(input:checked) { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.aud { display: grid; gap: 8px; }
.aud label { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 18px; background: var(--paper); cursor: pointer; transition: box-shadow .2s; }
.aud label::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 2px #C9C1D6; background: #fff; transition: box-shadow .2s; }
.aud label:has(input:checked) { background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }
.aud label:has(input:checked)::before { box-shadow: inset 0 0 0 5.5px var(--ink); }
.aud b { display: block; font-size: 14px; }
.aud small { color: var(--ink3); font-size: 12.5px; }

.actions { display: flex; gap: 10px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 14.5px; transition: transform .2s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.ink { background: var(--ink); color: var(--card); box-shadow: 0 14px 30px -14px rgba(22, 12, 46, .7); }
.btn.ink:hover { box-shadow: 0 18px 36px -14px rgba(22, 12, 46, .8); }
.btn.soft { background: var(--soft); color: var(--violet); }
.btn.soft:hover { background: #E4DBF3; }
.btn.danger { background: #C0392B; color: #fff; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.actions .ink { flex: 1; }
.msg { min-height: 22px; margin: 12px 4px 0; font-size: 13.5px; font-weight: 500; }
.msg.ok { color: #2E7D4F; } .msg.err { color: #C0392B; }
.fine { margin: 4px 4px 0; font-size: 12.5px; color: var(--ink3); }

/* preview */
.preview { position: sticky; top: 84px; }
.pv-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 6px 14px; }
.seg { display: flex; padding: 4px; border-radius: 999px; background: rgba(22, 12, 46, .06); }
.seg button { border: 0; background: none; cursor: pointer; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 8px -2px rgba(22, 12, 46, .25); }
.pv-inbox { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; margin-bottom: 10px; border-radius: 20px; background: rgba(251, 250, 247, .7); box-shadow: 0 0 0 1px var(--line); }
.pv-inbox b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-inbox span { font-size: 13px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-frame { margin: 0 auto; width: 100%; height: calc(100vh - 230px); min-height: 560px; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); background: var(--paper); transition: width .45s cubic-bezier(.2, .8, .2, 1), border-radius .45s; }
.pv-frame.phone { width: 390px; border-radius: 44px; box-shadow: 0 0 0 10px #160C2E, 0 40px 80px -30px rgba(22, 12, 46, .6); }
.pv-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* lists */
.lists { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 28px; }
.empty { color: var(--ink3); margin: 6px 4px; }
.sent { display: grid; gap: 8px; }
.sent-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--paper); }
.sent-item div { flex: 1; min-width: 0; }
.sent-item b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.sent-item small { color: var(--ink3); font-size: 12.5px; }
.sent-item .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.tag { padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--soft); color: var(--violet); }
.tag.done { background: #E3F2E8; color: #2E7D4F; }
.sub-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.sub-tools input { padding: 9px 13px; border-radius: 14px; }
.sub-tools form { display: flex; gap: 6px; flex: 1; }
.subs { max-height: 420px; overflow: auto; }
.sub { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.sub:last-child { border: 0; }
.sub .av { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; background: linear-gradient(140deg, var(--lilac), var(--violet)); }
.sub.off .av { background: #C9C1D6; }
.sub .e { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sub.off .e { color: var(--ink3); text-decoration: line-through; }
.sub small { color: var(--ink3); font-size: 12px; white-space: nowrap; }
.sub button { border: 0; background: none; cursor: pointer; color: var(--ink3); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 8px; }
.sub button:hover { background: rgba(192, 57, 43, .1); color: #C0392B; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(22, 12, 46, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-card { width: min(440px, 100%); text-align: center; padding: 32px 28px 24px; animation: pop .35s cubic-bezier(.2, .9, .2, 1); }
@keyframes pop { from { transform: scale(.95) translateY(10px); opacity: 0; } }
.modal-card h3 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.035em; }
.modal-card p { margin: 0 0 20px; color: var(--ink2); }
.modal-card .actions { margin-top: 0; }
.modal-card .actions .btn { flex: 1; }
.bar { height: 12px; border-radius: 999px; background: var(--paper); overflow: hidden; margin: 6px 0 12px; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--lilac), var(--violet), var(--peach)); transition: width .4s; }
.big-n { font-size: 44px; font-weight: 700; letter-spacing: -.05em; line-height: 1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }

@media (max-width: 1050px) {
  .compose, .lists { grid-template-columns: 1fr; }
  .preview { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); width: 100%; }
}
@media (max-width: 560px) {
  main { padding: 22px 14px 60px; } .top { padding: 12px 14px; } .crumb { display: none; }
  .card { padding: 20px; border-radius: 26px; } .row2 { grid-template-columns: 1fr; } .themes { flex-wrap: wrap; }
  .pv-frame.phone { width: 100%; }
}
