/* The fact-find on screen (owner, 25 October 2026: "need a beautifull on screen and download fact find doc";
   js/views/factfind.js). A calm document: the brokerage's logo and firm, the case, then each part's answers with a copy
   button beside each. Tokens only (app.css :root), so light and dark both work; on a phone every row stacks and every
   button is 44px to press; printed, it is the document alone, each applicant on a new page. */

.fd-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; max-width: 940px; margin: 0 auto 16px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
@media (min-width: 901px) {
  /* Kept in reach while reading a long fact-find, under the top bar. */
  .fd-bar { position: sticky; top: 66px; z-index: 15; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); }
}
.fd-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; flex: 1 1 260px; min-width: 0; }
.fd-for { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.fd-for select { width: auto; max-width: 300px; min-width: 0; color: var(--ink); font-weight: 500; }
.fd-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); min-height: 36px; cursor: pointer; }
.fd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-actions .btn svg { width: 16px; height: 16px; }

.fd-doc { max-width: 940px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-2);
  padding: 34px 44px 40px; overflow-wrap: anywhere; }

/* The cover: logo and firm, the title and the case's reference, who it is for, the facts. */
.fd-brand { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.fd-logo { height: 42px; width: auto; display: block; }
.fd-firm { font-weight: 700; color: var(--ink-2); font-size: 13.5px; text-align: right; }
.fd-firm span { color: var(--muted); font-weight: 500; }
.fd-titlerow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.fd-titlerow h1 { font: 700 34px/1.1 var(--f-display); letter-spacing: -.025em; margin: 0; }
.fd-ref { font-size: 13.5px; font-weight: 600; color: var(--accent-2); background: var(--accent-soft); padding: 4px 12px; border-radius: 999px; }
.fd-subject { font-size: 17px; color: var(--ink-2); margin: 6px 0 18px; }
.fd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 28px; margin: 0; padding: 16px 0 18px;
  border-top: 1px solid var(--line-2); border-bottom: 2px solid var(--accent); }
.fd-facts dt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fd-facts dd { margin: 3px 0 0; font-size: 14.5px; }

.fd-ready { margin: 18px 0 0; padding: 12px 16px; border-radius: 10px; font-size: 14px; line-height: 1.55;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent); }
.fd-ready.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 28%, transparent); }
.fd-ready a { font-weight: 600; }
.fd-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
.fd-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; }
.fd-toc a { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 12px; border-radius: 999px; font-size: 13px;
  background: var(--sunk); border: 1px solid var(--line-2); color: var(--ink-2); text-decoration: none; }
.fd-toc a:hover { background: var(--accent-soft); color: var(--accent-2); text-decoration: none; }

/* A part: its heading with Copy all, its groups, a list's items as blocks, and label | answer | copy rows. */
.fd-sec { margin-top: 34px; scroll-margin-top: 140px; }
.fd-sec-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.fd-sec-h h2 { margin: 0; font: 700 20px/1.25 var(--f-display); letter-spacing: -.01em; color: var(--accent-2); }
.fd-sub { color: var(--muted); font-size: 14px; }
.fd-copyall { margin-left: auto; }
.fd-copyall svg { width: 15px; height: 15px; }
.fd-gh { margin: 20px 0 2px; font: 700 11.5px var(--f-body); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.fd-group:first-of-type > .fd-gh { margin-top: 14px; }
.fd-item { margin: 12px 0 6px; padding: 2px 0 0 14px; border-left: 3px solid var(--accent-soft); }
.fd-ih { margin: 4px 0 0; font: 600 14.5px var(--f-display); }
.fd-isub { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }
.fd-rows { margin: 0; }
.fd-row { display: grid; grid-template-columns: minmax(0, 36%) minmax(0, 1fr); gap: 2px 20px; align-items: center; min-height: 48px; padding: 2px 0;
  border-bottom: 1px solid var(--line-2); }
.fd-row:last-child { border-bottom: 0; }
.fd-row dt { font-size: 13.5px; color: var(--muted); }
.fd-row dd { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.fd-val { flex: 1; min-width: 0; font-size: 15px; color: var(--ink); }
.fd-multi { white-space: pre-wrap; }
.fd-masked { font-family: var(--f-mono); letter-spacing: .06em; }
.fd-note { display: block; margin-top: 2px; font-size: .85em; color: var(--warn); }
.fd-missing dt { color: var(--ink-2); font-weight: 600; }
.fd-act { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.fd-copy { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: transparent;
  color: var(--muted); cursor: pointer; transition: background .12s, color .12s; }
.fd-row:hover .fd-copy:not(:disabled), .fd-copy:focus-visible { color: var(--accent-2); }
.fd-copy:hover:not(:disabled) { background: var(--accent-soft); }
.fd-copy.done { color: var(--good); background: var(--good-soft); }
.fd-copy:disabled { opacity: .4; cursor: not-allowed; }
.fd-alt { display: inline-flex; align-items: center; gap: 5px; min-height: 44px; min-width: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); font-size: 12.5px; cursor: pointer; }
.fd-alt svg { width: 14px; height: 14px; }
.fd-alt:hover { background: var(--accent-soft); color: var(--accent-2); }
.fd-alt.done { color: var(--good); border-color: var(--good); }
.fd-fill { white-space: nowrap; }

/* Still needed: whose, each with Fill in. */
.fd-need-list { list-style: none; margin: 0; padding: 0; }
.fd-need-list li { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 0; border-bottom: 1px solid var(--line-2); }
.fd-need-list li:last-child { border-bottom: 0; }
.fd-need-list .muted { font-size: 13px; margin-left: 6px; }
.fd-none { margin: 12px 0 0; color: var(--ink-2); }

@media (max-width: 640px) {
  .fd-bar { padding: 10px; }
  .fd-for { flex-wrap: wrap; width: 100%; }
  .fd-for select { max-width: 100%; width: 100%; }
  .fd-actions { width: 100%; }
  .fd-actions .btn { flex: 1 1 calc(50% - 8px); }
  .fd-back { width: 100%; justify-content: flex-start; }
  .fd-doc { padding: 20px 16px 28px; border-radius: 12px; }
  .fd-brand { flex-wrap: wrap; }
  .fd-firm { text-align: left; }
  .fd-titlerow h1 { font-size: 27px; }
  .fd-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; }
  .fd-row { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 8px 0 6px; }
  .fd-row dt { font-size: 12.5px; }
  .fd-sec-h h2 { font-size: 18px; }
  .fd-copyall { margin-left: 0; }
  .fd-item { padding-left: 10px; }
}

@media print {
  .fd-doc { border: 0; box-shadow: none; padding: 0; max-width: none; border-radius: 0; }
  .fd-act, .fd-copyall, .fd-toc, .fd-hint, .fd-fill, .fd-ready a { display: none !important; }
  .fd-ready { background: none; border: 1px solid #ccc; }
  .ff-person { break-before: page; }
  .fd-sec-h, .fd-gh, .fd-ih { break-after: avoid; }
  .fd-row { break-inside: avoid; min-height: 0; padding: 4px 0; }
  .fd-titlerow h1 { font-size: 26px; }
}

/* Fill in from the fact-find lands on the box itself, marked until it is left (js/views/case.js, js/views/people.js). */
.field.fill-here { box-shadow: 0 0 0 2px var(--accent); border-radius: 8px; }

/* The fact-find, round 11 (owner, 25 October 2026: "client address we need 3 years history"; "let put in day of months
   at address and employment"; "make it a breeze to work with"). public/js/forms.js draws these. */

/* How much of the three years of addresses is covered: in words above the previous addresses, and under the timeline. */
.addr-cover { margin: 2px 0 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.45; background: var(--info-soft); color: var(--ink-2); }
.addr-cover.warn { background: var(--warn-soft); color: var(--ink); }
.addr-cover.good { background: var(--good-soft); color: var(--good); font-weight: 600; }
.addr-cover.good::before { content: "✓ "; }
.vx-row .addr-cover { margin: 8px 0 0; }

/* The address history in view mode: a short timeline, newest first, a dot for each address and a dashed one for a gap. */
.addr-line { list-style: none; margin: 4px 0 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); display: grid; gap: 10px; }
.addr-line > li { position: relative; display: grid; grid-template-columns: minmax(150px, max-content) minmax(0, 1fr); gap: 2px 14px; align-items: baseline; }
.addr-line > li::before { content: ""; position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); }
.addr-line > li.now::before { background: var(--accent); }
.addr-line > li.addr-gap::before { border-color: var(--warn); border-style: dashed; }
.addr-when { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.addr-what { min-width: 0; overflow-wrap: anywhere; }
.addr-gap .addr-when, .addr-gap .addr-what { color: var(--warn); font-weight: 600; }
@media (max-width: 560px) { .addr-line > li { grid-template-columns: minmax(0, 1fr); } .addr-when { white-space: normal; } }

/* A month and year saved before the day was asked, said under its date box with "remove it". */
.ff-month { color: var(--ink-2); }
.ff-month-clear { border: 0; background: none; padding: 0; color: var(--link); cursor: pointer; font: inherit; text-decoration: underline; }
@media (pointer: coarse) {
  .ff-month-clear { position: relative; }
  .ff-month-clear::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
}

/* A term in years and months (round 21, owner, 9 November 2026: "like 30 years 7 months"; js/forms.js yearsMonthsHtml): two short boxes,
   each with its unit after it, side by side on a phone too. */
.ym { gap: 10px; flex-wrap: nowrap; align-items: center; }
.ym-part { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ym-part input { width: 4.5em; text-align: right; }
.ym-unit { color: var(--muted); white-space: nowrap; }
