/* Emailing a link (js/link-email-row.js, js/link-email-sheet.js): the line
   under a recipient's link and the sheet that shows the email before it goes.
   Loaded by index.html after delivery.css, whose recipient rows it sits in.

   The line, under the link field of a row:
     Emailed on 6 Oct, 14:05                          [Email link]

   The sheet's body, in the ordinary 560 px sheet (a bottom sheet on a phone;
   a narrower sheet would break the server's 70-character lines):
     Theirway will email this link to alex@example.com. ...
     To        alex@example.com
     From      Theirway <delivery@theirway.app>
     Reply-To  anna@studio.se
     Subject   Photos and videos for you, sent with Theirway
     Your name in the From line: Anna Berg                      [Change]
     +-- Email preview (monospace, wraps, never scrolls sideways) --+

   No new colour: --mute for the quiet line, --danger-fg for a refusal (and
   for a problem a delivery notice reports, on a link's line or on a support
   reply's arrival in admin-ticket-thread.js: the one mark, data-problem), the
   sunken --bg for the preview. */

.link-email{grid-column:1 / -1;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--space-2) var(--space-3);margin:0}
.link-email [data-part=link-email-line]{flex:1 1 12em;min-width:0;overflow-wrap:anywhere}
[data-problem]{color:var(--danger-fg)}
.link-email .btn{flex:none}

/* A producer names a link, up to 200 characters with no space in them: break
   it inside the header instead of running it under Close. (The header's text
   already has min-width:0, components.css.) */
#link-email-sheet [data-part=who]{overflow-wrap:anywhere}

.mail-facts{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:var(--space-1) var(--space-4);margin:var(--space-4) 0 var(--space-3)}
.mail-facts .fact{display:contents}
.mail-facts dt{color:var(--mute);font:400 var(--text-m)/18px var(--font-sans)}
.mail-facts dd{margin:0;font:400 var(--text-m)/18px var(--font-sans);overflow-wrap:anywhere;unicode-bidi:isolate}

/* The text part exactly as the server built it: line breaks kept, long
   links broken rather than scrolled, bidi characters kept inside their line. */
.mail-text{margin:0;padding:var(--space-3);background:var(--bg);border:1px solid var(--line2);border-radius:var(--radius-control);font:400 var(--text-s)/18px var(--font-mono);color:var(--ink2);white-space:pre-wrap;overflow-wrap:anywhere;unicode-bidi:isolate}
.mail-text:focus-visible{outline:2px solid var(--teal);outline-offset:2px}

/* The name in the From line, and the address step (js/link-email-name.js,
   js/link-email-address.js): a quiet line with a small button, or a form with
   one field. The field is the app's .text; an error is the app's .err. */
.sender-name{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--space-2) var(--space-3);margin:0 0 var(--space-3)}
.sender-name > .s{flex:1 1 12em;min-width:0;overflow-wrap:anywhere;unicode-bidi:isolate}
.sender-name .btn{flex:none}
.sender-name-form{flex:1 1 100%;display:flex;flex-direction:column;gap:var(--space-2)}
.sender-name-form .hint,.sender-name-form .err,.link-address-form .hint,.link-address-form .err{margin:0}
.sender-name-actions{display:flex;justify-content:flex-end;gap:var(--space-3)}
.link-address-form{display:flex;flex-direction:column;gap:var(--space-2)}
.link-address-form .text,.sender-name-form .text{width:100%}

.mail-result{margin:0;font:500 var(--text-l)/22px var(--font-sans);overflow-wrap:anywhere}
.mail-result:focus-visible{outline:none}

@media (max-width:820px){
  .link-email .btn,.sender-name .btn,.sender-name-actions .btn{min-height:var(--control-l)}
}
