/* Falcon Apply: the cover letter panel. Lives in #letter-mount. Uses only the tokens in app.css. */

#letter-mount { height: 100%; min-height: 0; }
.lt { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: 100%; min-height: 0; }
.lt.lt-alone { display: flex; align-items: center; justify-content: center; }
.lt-solo { max-width: 520px; }
.lt-solo h2 { font-size: var(--t-25); line-height: 1.2; letter-spacing: -0.015em; }
.lt-solo p { color: var(--ink-2); font-size: var(--t-16); }
.lt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the paper side */
.lt-paper { min-height: 0; overflow: auto; padding: var(--s-6) var(--s-5); background: var(--desk); }
/* The letter is a sheet of paper on the desk: square corners, a faint edge and a soft lift, the
   proportions of a printed page, and the person's serif. */
.lt-page { max-width: 680px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line); border-radius: 2px;
  box-shadow: 0 1px 2px rgba(20, 22, 26, .05), 0 10px 28px -12px rgba(20, 22, 26, .16);
  padding: 56px 64px 64px; font: 400 1.0625rem/1.6 var(--doc); color: var(--ink); display: flex; flex-direction: column; gap: var(--s-4); }
.lt-head { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  padding-bottom: var(--s-3); margin-bottom: var(--s-2); border-bottom: 1px solid var(--line-strong); }
.lt-hname { font: 600 1.5rem/1.2 var(--doc); letter-spacing: .01em; }
.lt-contact { font-size: var(--t-13); line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; text-wrap: balance; }
.lt-head .lt-edit { max-width: 100%; }
.lt-date { color: var(--ink-2); }
.lt-p { margin: 0; }
/* The short lines of the sheet can be typed on too. An emptied one shows what goes there. */
.lt-edit { outline: none; border-radius: 2px; cursor: text; min-width: 4ch; }
.lt-edit:empty::before { content: attr(data-ph); color: var(--ink-3); }
.lt-edit:hover { background: #faf9f6; }
.lt-edit:focus { background: #eef3ff; box-shadow: 0 0 0 3px #eef3ff; }
.lt-edit:focus-visible, .lt-body:focus-visible { outline: 2px solid var(--k-verb); outline-offset: 3px; }
.lt-mark { font: 600 var(--t-12)/1 var(--ui); color: var(--pen); margin-left: 2px; font-variant-numeric: tabular-nums; }
.lt-mark.r { color: var(--ink-3); }
/* Each paragraph can be typed on, like a resume line. */
.lt-body { outline: none; border-radius: 2px; cursor: text; }
.lt-body:hover { background: #faf9f6; }
.lt-body:focus { background: #eef3ff; box-shadow: 0 0 0 3px #eef3ff; }
/* A sentence that says what the person wants: only they can confirm it. */
.lt-own { text-decoration: underline dotted var(--k-verb); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.lt-reader { max-width: 680px; margin: calc(-1 * var(--s-2)) auto var(--s-4); color: var(--ink-2); font-size: var(--t-14); line-height: 1.45; }
.lt-owns { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.lt-owns li { display: flex; gap: var(--s-2); align-items: flex-start; justify-content: space-between; }
.lt-own-text { font: 400 var(--t-13)/1.45 var(--doc); color: var(--ink-2); border-left: 2px dotted var(--k-verb); padding-left: var(--s-2); }
.lt-own-x { flex: 0 0 auto; min-height: 32px; padding: 0 var(--s-2); font-size: var(--t-13); }
.lt-name { margin-top: var(--s-1); align-self: flex-start; }
.lt-title { max-width: 680px; margin: 0 auto var(--s-4); font-size: var(--t-25); line-height: 1.2; letter-spacing: -0.015em; font-weight: 800; }
.lt-err { max-width: 680px; margin: var(--s-3) auto 0; }
.lt-tools { max-width: 680px; margin: 0 auto var(--s-3); display: flex; flex-wrap: wrap; gap: var(--s-2); }
.lt-file-err { max-width: 680px; margin: 0 auto var(--s-3); }
.lt-short { max-width: 680px; margin: 0 auto var(--s-3); padding-left: var(--s-3); border-left: 2px solid var(--warn);
  color: var(--ink-2); font-size: var(--t-14); line-height: 1.45; }

/* before: the one field and the one button, given room */
.lt-start { max-width: 560px; margin: 10vh auto 0; display: flex; flex-direction: column; gap: var(--s-4); }
.lt-start h2 { font-size: var(--t-31); line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
.lt-site label { font-weight: 600; font-size: var(--t-14); }
.lt-site input { font-size: var(--t-16); min-height: 44px; }
.lt-acts { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.lt-start .btn.primary { min-height: 44px; padding: 0 var(--s-5); font-size: var(--t-16); }
.lt-hint { color: var(--ink-3); font-size: var(--t-14); }
.lt-ask { color: var(--warn); background: var(--warn-wash); border-radius: var(--r); padding: var(--s-2) var(--s-3); font-size: var(--t-14); }

/* while writing: steps that tick, and a quiet shimmer where the letter will be */
.lt-working { gap: var(--s-3); }
.lt-steps { list-style: none; margin: 0 0 var(--s-4); padding: 0; display: flex; flex-direction: column; gap: var(--s-2);
  font: 400 var(--t-16)/1.4 var(--ui); color: var(--ink-3); }
.lt-steps li { position: relative; padding-left: 28px; }
.lt-steps li::before { content: ""; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-strong); box-sizing: border-box; }
.lt-steps li.now { color: var(--ink); font-weight: 600; }
.lt-steps li.now::before { border-color: var(--ink); }
.lt-steps li.done { color: var(--good); }
.lt-steps li.done::before { border-color: var(--good); background: var(--good); }
.lt-steps li.done::after { content: ""; position: absolute; left: 5px; top: 5px; width: 4px; height: 8px; border: solid var(--paper); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lt-bar { height: 14px; }
.lt-bar.short { width: 60%; margin-bottom: var(--s-3); }

/* free plan */
.lt-lock { max-width: 560px; margin: 10vh auto 0; gap: var(--s-3); }
.lt-lock h2 { font-size: var(--t-25); line-height: 1.2; letter-spacing: -0.015em; }
.lt-lock p { color: var(--ink-2); font-size: var(--t-16); }
.lt-lock .btn { align-self: flex-start; }

/* the side: what the letter is built from. Tight. */
.lt-side { display: flex; flex-direction: column; min-height: 0; background: var(--desk); border-left: 1px solid var(--line); }
.lt-side-body { flex: 1 1 auto; display: flex; flex-direction: column; }
.lt-sec { padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--s-2); }
.lt-sec:last-child { border-bottom: 0; }
.lt-sec h3 { font-size: var(--t-14); font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.lt-sec.field label { font-size: var(--t-14); font-weight: 600; }
.lt-sec.field input, .lt-sec.field textarea { font-size: var(--t-14); }
.lt-sec.field textarea { min-height: 112px; line-height: 1.45; }
.lt-quiet { color: var(--ink-3); font-size: var(--t-13); }
.lt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.lt-list > li { display: flex; flex-direction: column; gap: 2px; font-size: var(--t-13); }
.lt-check { display: flex; align-items: flex-start; gap: var(--s-2); cursor: pointer; }
.lt-check input { margin: 3px 0 0; flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--ink); }
.lt-fact-text, .lt-req-text { flex: 1 1 auto; min-width: 0; font-size: var(--t-14); line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.lt-req-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s-2); }
.lt-req-text b { font-weight: 600; }
.lt-num { font: 600 var(--t-12)/1 var(--ui); color: var(--pen); margin-right: 6px; font-variant-numeric: tabular-nums; }
.lt-list > li.on { background: var(--line); box-shadow: inset 2px 0 0 var(--ink); border-radius: 0 4px 4px 0; }
.lt-list > li { padding: var(--s-1) var(--s-2); margin: 0 calc(-1 * var(--s-2)); }
.lt-fact:not(.on) .lt-fact-text, .lt-req:not(.on) .lt-req-text { color: var(--ink-3); }
.lt-src { color: var(--ink-3); font-size: var(--t-12); padding-left: 24px; overflow-wrap: anywhere; }
.lt-line { font: 400 var(--t-13)/1.45 var(--doc); color: var(--ink-2); margin-left: 24px; padding-left: var(--s-2); border-left: 2px solid var(--line); }
.lt-link { color: var(--ink-2); }
.lt-ro .lt-src { padding-left: 0; }
.lt-ro .lt-line { margin-left: 0; }
.lt-swap { align-self: flex-start; min-height: 32px; font-size: var(--t-13); }
.lt-more { padding-top: var(--s-1); }
.lt-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--t-13); }
.lt-checks li { position: relative; padding-left: 16px; color: var(--ink-2); }
.lt-checks li::before { content: ""; position: absolute; left: 2px; top: 0.5em; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.lt-checks li.warn { color: var(--warn); }
.lt-checks li.warn::before { background: var(--warn); }
.lt-foot { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-5); border-top: 1px solid var(--line); }
.lt-foot .acct-save { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); }

@media (max-width: 819px), (max-height: 599px) {
  #letter-mount, .lt { height: auto; }
  .lt { display: block; }
  .lt-paper { overflow: visible; padding: var(--s-4) var(--s-3); }
  .lt-page { padding: var(--s-5) var(--s-4) var(--s-6); font-size: var(--t-16); }
  .lt-hname { font-size: var(--t-20); }
  .lt-start, .lt-lock { margin-top: var(--s-4); }
  .lt-start h2 { font-size: var(--t-25); }
  .lt-side { border-left: 0; border-top: 1px solid var(--line); }
  .lt.lt-alone { padding: var(--s-6) var(--s-3); }
}

/* Printing from the letter tab prints the sheet alone, laid out like the PDF: app.css sets a
   0.6in page margin, and the sheet adds 0.4in so the text sits an inch in. */
@media print {
  body.print-letter * { visibility: hidden; }
  body.print-letter, body.print-letter #view-packet, body.print-letter #panel-letter, body.print-letter #letter-mount, body.print-letter .lt, body.print-letter .lt-paper {
    display: block !important; height: auto !important; overflow: visible !important; background: none !important; padding: 0 !important; }
  body.print-letter .lt-side, body.print-letter .lt-sr, body.print-letter .lt-title, body.print-letter .lt-reader,
  body.print-letter .lt-tools, body.print-letter .lt-short, body.print-letter .lt-file-err, body.print-letter .lt-err { display: none !important; }
  body.print-letter .lt-page, body.print-letter .lt-page * { visibility: visible; }
  body.print-letter .lt-page { position: absolute; left: 0; top: 0; width: 100%; max-width: none; border: 0; border-radius: 0; box-shadow: none;
    padding: 0.4in 0.4in 0; gap: 11pt; font: 400 11pt/1.35 "Source Serif 4", Georgia, "Times New Roman", serif; color: #000; }
  body.print-letter .lt-head { border-bottom: 0.5pt solid #8a8a8a; padding-bottom: 6pt; margin-bottom: 4pt; gap: 1pt; }
  body.print-letter .lt-hname { font-size: 15pt; font-weight: 700; }
  body.print-letter .lt-contact { font-size: 10pt; color: #3c4149; }
  body.print-letter .lt-date { color: #000; }
  body.print-letter .lt-p, body.print-letter .lt-edit { break-inside: avoid; }
  body.print-letter .lt-edit:empty { display: none; }
  body.print-letter .lt-mark { display: none; }
  body.print-letter .lt-own { text-decoration: none; }
  body.print-letter .lt-body, body.print-letter .lt-edit { background: none; box-shadow: none; outline: none; }
}

/* the length choice: Auto / Standard / Long, above Write and above Rewrite */
.lt-length { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.lt-length legend { padding: 0; margin-bottom: var(--s-1); font-weight: 600; font-size: var(--t-14); }
.lt-length-opts { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.lt-length-opt { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--t-14); cursor: pointer; min-height: 32px; }
.lt-length-opt input { margin: 0; width: 16px; height: 16px; accent-color: var(--ink); }
/* "Re: <job title>" above the greeting of a long letter */
.lt-re { margin: 0; font-weight: 600; }
