/* The writer's desk (fiammo.co/app/newsletter, web/newsletter.mjs): app.css's
 * tokens and pieces, and only what the desk adds. Paper is paper, ink is
 * voice: the one ink button a screen has (Write an issue, Next, Publish,
 * Export as CSV), copper for the marks (a switch, a tick, a chosen colour,
 * the tab you're on), grey for what waits. An issue is kept, and says so in
 * grey where a countdown would be. */

/* ------------------------------------------------------------ the desk */
.nl-head { display: flex; gap: 16px; align-items: flex-start; }
img.nl-mark { object-fit: cover; }
.nl-mark { width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 6%, transparent); }
.nl-head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nl-title { font-family: var(--serif); font-size: 30px; line-height: 1.2; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.nl-address { font-size: 14px; color: var(--gold-text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.nl-address:hover { text-decoration: underline; }
.nl-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.nl-actions .sub { flex: 1; min-width: 200px; }
.nl-switcher { display: flex; gap: 6px; flex-wrap: wrap; }
.nl-switcher .chip { text-decoration: none; }
.nl-paused { margin: 0; font-size: 14px; color: var(--muted-strong); padding: 10px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--fg) 5%, transparent); }
.nl-numbers { margin: 0; font-size: 15px; color: var(--muted-strong); }
.nl-section { display: flex; flex-direction: column; gap: 8px; }
.nl-list { padding: 4px 0; display: flex; flex-direction: column; }
.nl-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; min-height: 64px; position: relative; }
.nl-row + .nl-row { box-shadow: inset 0 1px 0 var(--border); }
.nl-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nl-row-title { font-family: var(--serif); font-size: 18px; line-height: 1.3; font-weight: 600; color: var(--fg); text-decoration: none; overflow-wrap: anywhere; }
a.nl-row-title:hover { text-decoration: underline; }
.nl-row-dek { margin: 0; font-size: 14px; color: var(--muted-strong); overflow-wrap: anywhere; }
.nl-person { margin: 0; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
/* FiammoEmptyRow: the row's own shape, saying so. */
.empty-row .nl-row-slot { width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0; background: color-mix(in srgb, var(--fg) 5%, transparent); }
.empty-row .sub { flex: 1; }
.nl-start-card, .nl-gone, .nl-invite { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.nl-start-line { font-family: var(--serif); font-size: 22px; margin: 0; }

/* ------------------------------------------------------------ forms */
.nl-step, .nl-form { display: flex; flex-direction: column; gap: 16px; }
.nl-field { display: flex; flex-direction: column; gap: 6px; }
.nl-input, .nl-area, .nl-big { width: 100%; border-radius: 10px; border: 1px solid var(--border); background: var(--paper); color: var(--fg);
  padding: 0 14px; font-size: 16px; min-height: 46px; }
.nl-area { padding: 12px 14px; resize: vertical; font-family: var(--serif); line-height: 1.6; min-height: 120px; }
.nl-big { font-family: var(--serif); font-size: 24px; font-weight: 600; min-height: 56px; }
.nl-input.small { min-height: 36px; font-size: 14px; padding: 0 10px; border-radius: 8px; }
.nl-input:focus, .nl-area:focus, .nl-big:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.nl-slug-row { display: flex; align-items: stretch; border-radius: 10px; border: 1px solid var(--border); background: var(--paper); overflow: hidden; }
.nl-slug-row:focus-within { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.nl-slug-pre { display: flex; align-items: center; padding: 0 0 0 14px; color: var(--muted); font-size: 16px; white-space: nowrap; }
.nl-slug-row .nl-slug { border: 0; box-shadow: none; padding-left: 1px; min-width: 0; }
.nl-slug-row .nl-slug:focus { box-shadow: none; }
.nl-example { margin: 0; font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 15px; }
.sub.error, p.error { color: var(--error); }
/* The seven pastels, a ring and a check on the chosen one (CircleColourPicker). */
.nl-tints { display: flex; gap: 12px; flex-wrap: wrap; }
.nl-tint { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--dot); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  color: #3A2A1C; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.nl-tint.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--gold); }
.nl-tint .ic { width: 16px; height: 16px; }
.nl-cover { width: 100%; max-width: 420px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.nl-invite-row { display: flex; gap: 8px; align-items: center; }
.nl-invite-row .nl-input { max-width: 260px; }
.nl-danger { margin-top: 16px; align-items: flex-start; }

/* A switch, copper when on. The whole row is the label. */
.nl-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.nl-toggle-text { display: flex; flex-direction: column; gap: 2px; }
.nl-toggle-label { font-size: 15px; font-weight: 500; }
.nl-switch { width: 46px; height: 28px; border-radius: 999px; border: 0; padding: 0; flex-shrink: 0; cursor: pointer; position: relative;
  background: color-mix(in srgb, var(--fg) 16%, transparent); transition: background .18s var(--arrive); }
.nl-switch .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .18s var(--arrive); }
.nl-switch.on { background: var(--gold); }
.nl-switch.on .knob { transform: translateX(18px); }

/* ------------------------------------------------------------ the composer */
body[data-view="nl-write"], body[data-view="nl-publish"] { background: var(--card); }
.nl-bar { flex-wrap: nowrap; }
.nl-chip-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.chip .sep { color: var(--muted); }
/* Where a countdown would be: always, never dismissible. */
.nl-kept { font-size: 13px; color: var(--muted); white-space: nowrap; margin: 0; }
.nl-saved.bad { color: var(--error); cursor: pointer; }
.round.on { color: var(--gold-text); box-shadow: inset 0 0 0 1.5px var(--gold); }
.nl-format { display: flex; gap: 2px; justify-content: center; padding: 4px 16px 8px; position: sticky; top: 60px; z-index: 3;
  background: color-mix(in srgb, var(--card) 92%, transparent); overflow-x: auto; scrollbar-width: none; }
.nl-format::-webkit-scrollbar { display: none; }
body.focus .nl-format { opacity: 0; transition: opacity .3s var(--arrive); }
body.focus .nl-format:hover, body.focus .nl-format:focus-within { opacity: 1; }
/* The issue's title and subtitle: one line each that wraps and grows. */
.nl-line { display: block; width: 100%; resize: none; overflow: hidden; line-height: 1.25; }
.nl-dek { border: 0; background: transparent; font-family: var(--sans); font-size: 19px; color: var(--muted-strong); padding: 0; outline: none; margin-top: -6px; }
.nl-dek::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.nl-sheet { padding-top: 28px; }
.nl-first { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--border); font-size: 14px; color: var(--muted-strong); }
.nl-first p { margin: 0; flex: 1; }
.nl-photo { align-items: flex-start; }
.nl-photo-text { flex: 1; gap: 6px; }
.nl-photo-ctl { display: flex; gap: 2px; align-items: center; }
.nl-subs-note { margin: 0; }
/* A tooltip in the site's own style (fiammoTooltip), never the browser's. */
.tip { position: relative; }
.tip::after { content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translate(-50%, -2px); z-index: 9;
  background: var(--card); color: var(--fg); box-shadow: 0 0 0 1px var(--border), 0 6px 18px rgba(0, 0, 0, .12);
  font-size: 12px; font-weight: 500; line-height: 1.2; padding: 6px 9px; border-radius: 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s var(--arrive), transform .12s var(--arrive); }
.tip:hover::after, .tip:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: .35s; }
.nl-preview-box { flex: 1; display: flex; padding: 0 16px 16px; }
.nl-preview { width: 100%; max-width: 860px; margin: 0 auto; min-height: calc(100vh - 140px); border: 0; border-radius: 12px; background: var(--paper);
  box-shadow: 0 0 0 1px var(--border); }
.nl-preview:focus, .nl-preview.has-focus { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ------------------------------------------------------------ publish */
.nl-publish-grid { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 32px; width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 16px max(24px, env(safe-area-inset-right)) 48px max(24px, env(safe-area-inset-left)); align-items: start; }
.nl-publish-set { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 76px; }
.nl-pub-title { font-family: var(--serif); font-size: 22px; line-height: 1.3; margin: -6px 0 0; overflow-wrap: anywhere; }
.nl-pub-part { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; box-shadow: inset 0 1px 0 var(--border); }
.nl-pub-part .section { margin: 0; }
.nl-sentence { margin: 0; font-size: 15px; }
.nl-change { text-align: left; color: var(--gold-text); font-weight: 600; font-size: 14px; }
.nl-carrier { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.nl-modes { display: flex; flex-direction: column; gap: 2px; }
.nl-radio { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 8px; margin: 0 -8px; border: 0; background: none;
  border-radius: 10px; text-align: left; font-size: 15px; cursor: pointer; }
.nl-radio:hover { background: color-mix(in srgb, var(--fg) 5%, transparent); }
.nl-when-box { display: flex; flex-direction: column; gap: 6px; }
.nl-when { color-scheme: light dark; font-variant-numeric: tabular-nums; }
.nl-publish-preview { min-width: 0; }
.nl-publish-preview .nl-preview { min-height: calc(100vh - 110px); max-width: none; }
.nl-version-preview .nl-preview { min-height: 70vh; }

/* ------------------------------------------------------------ phone width */
@media (max-width: 720px) {
  .nl-bar { flex-wrap: wrap; }
  .nl-kept { order: 5; flex-basis: 100%; }
  .nl-chip-name { max-width: 110px; }
  .nl-format { top: 0; justify-content: flex-start; padding: 4px 8px 8px; position: static; }
  .nl-title { font-size: 26px; }
  .nl-publish-grid { grid-template-columns: 1fr; padding: 8px 16px 40px; gap: 24px; }
  .nl-publish-set { position: static; }
  .nl-publish-preview .nl-preview { min-height: 80vh; }
  .nl-row { padding: 12px 14px; }
  .nl-photo { flex-wrap: wrap; }
  .nl-photo-ctl { width: 100%; justify-content: flex-end; }
  .nl-invite-row { flex-wrap: wrap; }
  .nl-invite-row .nl-input { max-width: none; }
  .nl-first { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .tip::after, .nl-switch, .nl-switch .knob { transition: none !important; }
}

/* On a phone the bar has no room for "Saved", but a save that didn't go
   (retrying, refused, changed elsewhere) is still said there. */
@media (max-width: 720px) {
  .nl-bar .nl-saved.bad { display: inline; flex-basis: 100%; order: 10; font-size: 13px; }
}

/* ------------------------------------------------------------ email and the import (spec-web-nl-mail) */
.nl-numbers-block { display: flex; flex-direction: column; gap: 6px; }
.nl-row-numbers { color: var(--muted-strong); }
/* An address with no account: the face slot at the rows' size, the address in place of a name. */
.nl-mail-face { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--fg) 6%, transparent); color: var(--muted-strong); }
.nl-mail-face .ic svg, .nl-mail-face svg { width: 18px; height: 18px; }
.nl-address-row { font-weight: 500; }
.nl-withheld { padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--fg) 5%, transparent); color: var(--muted-strong); font-size: 14px; }
.nl-test-line { margin: 0; }
.nl-test-line.error { color: var(--error); }

.nl-import { gap: 18px; }
.nl-import-steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
/* The file field: a drop zone that is the field's label, the input kept for the keys. */
.nl-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.nl-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; padding: 20px;
  border: 1.5px dashed color-mix(in srgb, var(--fg) 22%, transparent); border-radius: 12px; cursor: pointer; text-align: center; }
.nl-drop .ic svg, .nl-drop > svg { width: 22px; height: 22px; color: var(--muted-strong); }
.nl-drop:hover, .nl-drop.over { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 6%, transparent); }
.nl-file-input:focus-visible + .nl-drop { outline: 2px solid var(--fg); outline-offset: 2px; }
.nl-drop-line { font-weight: 600; font-size: 15px; }
.nl-drop-name { margin: 0; font-size: 14px; color: var(--muted-strong); overflow-wrap: anywhere; }
.nl-drop-name:empty { display: none; }
.nl-import-choices { display: flex; flex-direction: column; gap: 14px; }
.nl-import-progress { margin: 0; }
.nl-import-result { display: flex; flex-direction: column; gap: 16px; }
.nl-import-report { display: flex; flex-direction: column; gap: 8px; }
.nl-import-line { margin: 0; }
.nl-publish-all { margin-top: 4px; }
.set-also { margin-left: 24px; }
@media (max-width: 520px) { .set-also { margin-left: 0; } }
