/* One document look (vault/doc/render.js). Screen: a white letter page on the canvas, phase tape above it.
   Print: black on white, no tints or shadows, letter size, page breaks between pages.
   Rules: Jost for text, the display face only for the wordmark and document title, 14px minimum on screen,
   no colored dots, no colored edge strips, no gradients. Status words sit on solid tapes. */
.fd-canvas { --fd-ink: #121416; --fd-soft: #4a4842; --fd-rule: #121416; --fd-hair: #d6d4cc; --fd-page: #ffffff; max-width: 864px; margin: 0 auto; }
.fd-tape-row { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.fd-tape-kind { font: 500 14px/1.3 var(--ws-ui, Jost, Arial, sans-serif); color: var(--ws-soft, #59574f); }
.fd-pages { display: grid; gap: 24px; }
.fd-page {
  box-sizing: border-box; width: 100%; max-width: 816px; min-width: 0; margin: 0 auto; padding: 56px 56px 40px;
  background: var(--fd-page); color: var(--fd-ink); border: 1px solid var(--ws-page-edge, #e3e1d9); border-radius: 2px;
  box-shadow: var(--ws-shadow, none); font: 400 15px/1.45 var(--ws-ui, Jost, Arial, sans-serif); overflow-wrap: anywhere;
}
.fd-page p { margin: 0 0 10px; }
.fd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid var(--fd-rule); }
.fd-co { min-width: 0; }
.fd-page .fd-wordmark { margin: 0 0 6px; font: 800 34px/1 var(--ws-display, 'Arial Narrow', sans-serif); letter-spacing: .03em; text-transform: uppercase; }
.fd-co-lines { margin: 0; font-size: 14px; line-height: 1.45; color: var(--fd-soft); }
.fd-co--none .fd-co-lines:first-child { font-weight: 600; color: var(--fd-ink); }
.fd-title { text-align: right; min-width: 0; }
.fd-page .fd-kind { margin: 0 0 8px; font: 800 30px/1 var(--ws-display, 'Arial Narrow', sans-serif); letter-spacing: .03em; text-transform: uppercase; }
.fd-meta { margin: 0; display: grid; gap: 2px; font-size: 14px; }
.fd-meta div { display: flex; justify-content: flex-end; gap: 8px; }
.fd-meta dt { color: var(--fd-soft); }
.fd-meta dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.fd-status { margin: 8px 0 0; }
.fd-run { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--fd-rule); font-size: 14px; font-weight: 600; }
.fd-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 24px; margin: 20px 0 8px; }
.fd-parties dt, .fd-facts dt { font-size: 14px; color: var(--fd-soft); }
.fd-parties dd, .fd-facts dd { margin: 2px 0 0; font-weight: 600; }
.fd-sec { margin-top: 22px; break-inside: auto; }
.fd-page .fd-sec h2 { margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--fd-rule); font: 600 14px/1.3 var(--ws-ui, Jost, Arial, sans-serif); letter-spacing: .08em; text-transform: uppercase; }
.fd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 24px; margin: 0; }
.fd-blank { display: inline-block; min-width: 120px; border-bottom: 1px solid var(--fd-hair); height: 1em; }
.fd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fd-scroll { overflow-x: auto; max-width: 100%; }
.fd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fd-table th { text-align: left; font-weight: 600; color: var(--fd-soft); border-bottom: 1px solid var(--fd-rule); padding: 6px 8px 6px 0; white-space: nowrap; }
.fd-table td { overflow-wrap: normal; word-break: normal; padding: 7px 8px 7px 0; border-bottom: 1px solid var(--fd-hair); vertical-align: top; }
.fd-table .fd-n, .fd-totals .fd-n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fd-table small, .fd-small { font-size: 14px; color: var(--fd-soft); }
.fd-empty { color: var(--fd-soft); }
.fd-own-rate { display: block; font-weight: 600; }
.fd-totals { margin: 16px 0 0 auto; min-width: 280px; border-collapse: collapse; font-size: 15px; }
.fd-totals th { text-align: left; font-weight: 400; padding: 5px 24px 5px 0; }
.fd-totals td { padding: 5px 0; }
.fd-totals .fd-grand th, .fd-totals .fd-grand td { font-weight: 700; font-size: 18px; border-top: 2px solid var(--fd-rule); padding-top: 8px; }
.fd-fill { display: grid; gap: 18px; }
.fd-line { border-bottom: 1px solid var(--fd-ink); min-height: 34px; display: flex; align-items: flex-end; }
.fd-line span { font-size: 14px; color: var(--fd-soft); padding-bottom: 2px; }
.fd-sign { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px 32px; margin-top: 8px; }
.fd-sig { display: grid; gap: 4px; }
.fd-sig-line { display: block; border-bottom: 1px solid var(--fd-ink); height: 40px; }
.fd-sig span:last-child { font-size: 14px; color: var(--fd-soft); }
.fd-sig--done .fd-sig-mark { display: flex; align-items: flex-end; min-height: 64px; border-bottom: 1px solid var(--fd-ink); }
.fd-sig-img { display: block; max-width: 100%; max-height: 80px; width: auto; }
.fd-sig--done .fd-sig-mark .fd-sig-typed { font: italic 500 26px/1.2 var(--ws-ui, Jost, Arial, sans-serif); padding-bottom: 4px; overflow-wrap: anywhere; }
.fd-sig--done .fd-sig-who { font-size: 14px; color: var(--fd-soft); }
.fd-sig--done .fd-sig-who strong { color: var(--fd-ink); font-weight: 600; }
.fd-foot { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--fd-rule); font-size: 14px; color: var(--fd-soft); }
.fd-foot p { margin: 0 0 6px; }
.fd-foot-co { font-weight: 600; color: var(--fd-ink); }

/* Status tapes: a word on a solid fill, never a dot. */
.fd-pill {
  display: inline-flex; align-items: center; min-height: 24px; padding: 2px 12px 2px 8px; box-sizing: border-box;
  background: var(--fd-pill, #e4e2da); color: #121416; font: 500 14px/1.2 var(--ws-ui, Jost, Arial, sans-serif); white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 25%, 100% 50%, calc(100% - 4px) 75%, 100% 100%, 0 100%);
}
.fd-pill[data-st='draft'], .fd-pill[data-st='none'] { --fd-pill: #e4e2da; }
.fd-pill[data-st='sent'], .fd-pill[data-st='confirmed'] { --fd-pill: #80cf8a; }
.fd-pill[data-st='viewed'] { --fd-pill: #a9c8f5; }
.fd-pill[data-st='declined'] { --fd-pill: #f48a74; }
.fd-pill[data-st='void'] { --fd-pill: #d3d1c9; }
.fd-pill[data-st='signed'] { --fd-pill: #80cf8a; }
.fd-pill[data-st='queued'], .fd-pill[data-st='not_sent'] { --fd-pill: #e4e2da; }
.fd-pill[data-st='bounced'], .fd-pill[data-st='failed'], .fd-pill[data-st='complained'] { --fd-pill: #f6c453; }

/* Tools around the page (screen only): toolbar, versions, confirmations, settings. Day and Night tokens. */
.fd-tools { max-width: 864px; margin: 0 auto 16px; display: grid; gap: 12px; color: var(--ws-ink); font: 400 15px/1.45 var(--ws-ui, Jost, Arial, sans-serif); }
.fd-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fd-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; box-sizing: border-box;
  border: 1px solid var(--ws-line-strong); background: var(--ws-page); color: var(--ws-ink); font: 500 14px/1.2 var(--ws-ui, Jost, Arial, sans-serif);
  border-radius: 6px; cursor: pointer; text-decoration: none;
}
.fd-btn:hover { background: var(--ws-hover); }
.fd-btn:focus-visible, .fd-panel :focus-visible, .fd-settings :focus-visible { outline: 2px solid var(--ws-ink); outline-offset: 2px; }
.fd-btn--strong { background: var(--ws-accent); color: var(--ws-on-accent); border-color: var(--ws-accent); }
.fd-btn--strong:hover { background: var(--ws-accent); filter: brightness(.95); }
.fd-btn[disabled] { opacity: .6; cursor: default; }
@media (pointer: coarse) { .fd-btn, .fd-panel select, .fd-panel input, .fd-settings input, .fd-settings summary { min-height: 44px; } }
.fd-panel { background: var(--ws-page); border: 1px solid var(--ws-page-edge); border-radius: 8px; padding: 14px 16px; }
.fd-panel h2 { margin: 0 0 8px; font: 600 16px/1.3 var(--ws-ui, Jost, Arial, sans-serif); }
.fd-panel ul { list-style: none; margin: 0; padding: 0; }
.fd-panel li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 0; border-top: 1px solid var(--ws-line); }
.fd-panel li:first-child { border-top: 0; }
.fd-panel .fd-who { min-width: 0; flex: 1 1 180px; }
.fd-panel .fd-who span { display: block; font-size: 14px; color: var(--ws-soft); }
.fd-panel .fd-who .fd-pill { display: inline-flex; color: #121416; }
.fd-panel select, .fd-panel input { min-height: 40px; padding: 0 10px; border: 1px solid var(--ws-line-strong); background: var(--ws-page); color: var(--ws-ink); font: inherit; font-size: 14px; border-radius: 6px; box-sizing: border-box; }
.fd-panel label { font-size: 14px; color: var(--ws-soft); display: block; margin: 8px 0 4px; }
.fd-sent-form { display: grid; gap: 6px; margin-top: 8px; }
.fd-sent-form input { width: 100%; }
.fd-hint { margin: 4px 0 0; font-size: 14px; color: var(--ws-soft); }
.fd-needs { margin: 0; font-size: 14px; color: var(--ws-ink); }
.fd-needs strong { font-weight: 600; }
.fd-panel .fd-sub { margin: 14px 0 4px; font: 600 15px/1.3 var(--ws-ui, Jost, Arial, sans-serif); }
.fd-panel .fd-warn li { display: block; font-size: 14px; }
.fd-panel .fd-check { display: flex; align-items: center; gap: 8px; color: var(--ws-ink); }
.fd-panel .fd-check input { min-height: 0; width: 20px; height: 20px; }
.fd-panel #fdRemindAt { width: 100%; max-width: 280px; }
.fd-mail-preview { margin: 10px 0 4px; font-size: 14px; }
.fd-mail-preview summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; font-weight: 500; }
.fd-mail-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; padding: 10px 12px; border: 1px solid var(--ws-line); border-radius: 6px; font: 400 14px/1.45 var(--ws-ui, Jost, Arial, sans-serif); color: var(--ws-ink); background: var(--ws-page); }
.fd-settings { background: var(--ws-page); border: 1px solid var(--ws-page-edge); border-radius: 8px; padding: 10px 16px; }
.fd-settings summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.fd-settings-co { display: grid; gap: 4px; margin: 12px 0; max-width: 520px; }
.fd-settings-co h3 { margin: 8px 0 4px; font: 600 15px/1.3 var(--ws-ui, Jost, Arial, sans-serif); }
.fd-settings-co label { font-size: 14px; color: var(--ws-soft); margin-top: 6px; }
.fd-settings-co input { min-height: 40px; padding: 0 10px; border: 1px solid var(--ws-line-strong); background: var(--ws-page); color: var(--ws-ink); font: inherit; font-size: 15px; border-radius: 6px; }
.fd-settings-co .fd-btn { justify-self: start; margin-top: 8px; }
.fd-index { max-width: 864px; margin: 0 auto; }
.fd-index h1 { font: 600 22px/1.2 var(--ws-ui, Jost, Arial, sans-serif); margin: 0 0 6px; color: var(--ws-ink); }
.fd-index a { color: var(--ws-ink); }

@media (max-width: 720px) {
  .fd-page { padding: 24px 18px 20px; }
  .fd-head { flex-direction: column; gap: 14px; }
  .fd-title { text-align: left; }
  .fd-meta div { justify-content: flex-start; }
  .fd-page .fd-wordmark { font-size: 28px; }
  .fd-page .fd-kind { font-size: 26px; }
  .fd-totals { min-width: 0; width: 100%; }
}

@media print {
  @page { size: letter; margin: .55in; }
  .fd-noprint, .fd-tools, .fd-tape-row, .fd-settings { display: none !important; }
  .fd-canvas, .fd-pages { max-width: none; margin: 0; display: block; }
  .fd-page {
    max-width: none; width: auto; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none !important;
    background: #fff !important; color: #000 !important; font-size: 10.5pt; overflow: visible;
  }
  .fd-page * { color: #000 !important; background: transparent !important; box-shadow: none !important; text-shadow: none !important; }
  .fd-page + .fd-page { break-before: page; }
  .fd-head, .fd-run, .fd-sec h2, .fd-table th, .fd-foot, .fd-totals .fd-grand th, .fd-totals .fd-grand td { border-color: #000 !important; }
  .fd-table td { border-color: #999 !important; }
  .fd-line, .fd-sig-line { border-color: #000 !important; }
  .fd-scroll { overflow: visible; }
  .fd-table tr, .fd-sig, .fd-facts div, .fd-totals { break-inside: avoid; }
  .fd-page .fd-sec h2 { break-after: avoid; }
  .fd-table, .fd-co-lines, .fd-meta, .fd-parties dt, .fd-facts dt, .fd-foot, .fd-line span, .fd-sig span:last-child { font-size: 10pt; }
  .fd-page .fd-wordmark { font-size: 26pt; }
  .fd-page .fd-kind { font-size: 22pt; }
}

/* Company tape (a saved call sheet layout picks the color). A tape label only, like the phase tape. */
.fd-co-tape { text-transform: none; letter-spacing: .02em; }
.fd-co-tape[data-tape='coral'] { --ph: var(--ph-shoot); }
.fd-co-tape[data-tape='teal'] { --ph: var(--ph-prep); }
.fd-co-tape[data-tape='amber'] { --ph: var(--ph-dev); }
.fd-co-tape[data-tape='violet'] { --ph: var(--ph-post); }
.fd-co-tape[data-tape='green'] { --ph: var(--ph-money); }
.fd-co-tape[data-tape='blue'] { --ph: var(--st-ask); }
