/* Area: deals — styles for src/next/areas/deals.js views. Tokens only (see next.css :root). */
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.deal-expense { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 14px; }
.deal-take { margin-top: 18px; padding: 16px 18px; border-radius: var(--r-md); background: var(--olive-tint); display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.deal-take-total { border-top: 1.5px solid var(--line); padding-top: 10px; font-size: 18px; }
.deal-take-line { margin: 0; padding: 14px 16px; border-radius: var(--r-md); background: var(--olive-tint); font-size: 16px; }
.deal-take-line b { font-size: 20px; }
.offer-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 160px; gap: 10px; align-items: center; }
.offer-row input[type=checkbox], .check-line input { width: 22px; height: 22px; accent-color: var(--olive); }
.offer-row input:not([type=checkbox]), .cl-line input[name=text] { min-height: 48px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--card); padding: 0 12px; font-size: 16px; min-width: 0; width: 100%; }
.cl-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; }
.cl-offset { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.cl-offset input { width: 72px; min-height: 48px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--card); padding: 0 10px; font-size: 16px; text-align: right; }
.check-line { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 16px; }
.phone .deal-expense { grid-template-columns: minmax(0, 1fr); }
.phone .deal-expense .field:first-child { grid-column: 1 / -1; }
.phone .offer-row { grid-template-columns: 28px minmax(0, 1fr); }
.phone .offer-row input[type=date] { grid-column: 2; }
.phone .cl-line { grid-template-columns: minmax(0, 1fr) auto; }
.phone .cl-line .cl-offset { grid-column: 1; }

/* ---------- They asked (open requests on this deal) ---------- */
.deal-ask { align-items: flex-start; }
.deal-ask .actions { flex-wrap: wrap; justify-content: flex-end; }
.phone .deal-ask { flex-wrap: wrap; }
.phone .deal-ask .actions { width: 100%; justify-content: flex-start; }
/* the full deal edit form */
.deal-edit-set { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
.deal-edit-set legend { margin-bottom: 10px; }
.check-chip { cursor: pointer; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip:has(input:checked) { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.check-chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* the checklist editor's contract lines (0112): days · after acceptance / before closing · key date */
.cl-line.dated { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.cl-offset select { min-height: 48px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--card); padding: 0 10px; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); }
.cl-key { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.cl-key input { width: 20px; height: 20px; accent-color: var(--accent, var(--olive)); }
.phone .cl-line.dated { grid-template-columns: minmax(0, 1fr) auto; }
/* offer sheet: the calendar toggle sits under the line, not squeezed into the checkbox column */
.offer-row .check-line { grid-column: 2 / -1; display: flex; align-items: center; gap: 10px; margin-top: -4px; }

/* missing paperwork (lib/required-docs.js) */
.pw-strip { margin: -4px 0 16px; padding: 14px 16px; border-radius: var(--r-md); background: var(--card-2); border: var(--hair); display: flex; flex-direction: column; gap: 10px; }
.pw-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pw { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--card); font-size: 14px; }
.pw svg { width: 16px; height: 16px; }
.pw b { font-weight: 700; }
.pw span { color: var(--ink-2); font-weight: 600; }
.pw-signed svg { color: var(--good); }
.pw-sent svg { color: var(--warn); }
.pw-missing { border-color: var(--accent, var(--olive)); }
.pw-missing svg, .pw-missing span { color: var(--accent, var(--olive)); }

/* what the AI read on a deal (0124) */
.sug-list { display: grid; gap: 10px; margin: 6px 0 14px; }
.sug-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line); }
.sug-row input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--ink); }
.sug-row .t { min-width: 0; line-height: 1.45; }
.sug-nobox { width: 20px; flex: none; }
.sug-quote { text-align: left; font-size: 14px; color: var(--ink-2); font-style: italic; white-space: normal; }
.sug-card .actions.sug-actions { flex-wrap: wrap; }   /* the two buttons stack on a phone instead of widening the card */
.phone .sug-card .actions.sug-actions > .btn { flex: 1 1 auto; }

/* the source file's name shortens with an ellipsis instead of widening the card (audit 2026-09-27) */
.sug-card, .sug-row { min-width: 0; }
.sug-card .section-t { flex-wrap: wrap; gap: 6px 10px; }
.sug-card .section-t .tag { display: block; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-row .t { min-width: 0; }

/* Offer comparison remains scrollable without widening the phone viewport. */
.offer-table-wrap { max-width:100%; overflow-x:auto; margin-top:24px; border:1px solid var(--line); border-radius:16px; }
.offer-comparison { border-collapse:collapse; width:100%; background:var(--card); font-size:16px; }
.offer-comparison caption { text-align:left; padding:18px; font-weight:700; }
.offer-comparison th,.offer-comparison td { min-width:210px; max-width:340px; padding:18px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; overflow-wrap:anywhere; }
.offer-comparison th:first-child { min-width:180px; }
.offer-comparison summary { cursor:pointer; margin-top:12px; }
.offer-comparison blockquote { margin:12px 0 0; font-size:14px; }

.deal-expense .field { min-width: 0; }
.deal-expense input { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; }
.deal-expense input[type="date"] { appearance: none; -webkit-appearance: none; min-height: 44px; }
@media (max-width: 600px) {
  .deal-expense { grid-template-columns: minmax(0, 1fr); }
  .deal-expense .btn { width: 100%; }
}

/* the new-deal sheet: the listing link beside Read link; the read home (photo, address, price) under it */
.deal-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.deal-link .field { min-width: 0; }
.deal-link input { min-width: 0; width: 100%; box-sizing: border-box; }
.deal-link .btn { min-height: 48px; white-space: nowrap; }
.deal-link-home { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r-md); background: var(--olive-tint); font-size: 16px; }
.deal-link-home img { width: 84px; height: 60px; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.deal-link-home > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.deal-link-home .muted { font-size: 15px; }
.phone .deal-link { grid-template-columns: minmax(0, 1fr); }
.phone .deal-link .btn { width: 100%; }
@media (max-width: 600px) {
  .deal-link { grid-template-columns: minmax(0, 1fr); }
  .deal-link .btn { width: 100%; }
}

@media (max-width: 600px) {
  .deal-header-top { flex-direction: column; align-items: stretch; gap: 12px; }
  .deal-header-top > .actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .deal-header-top .btn { min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
  .deal-header .spec-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .deal-header .spec { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 12px 14px; font-size: 16px; }
  .deal-header .spec > span { margin: 0; font-size: 14px; }
}

.deal-terms { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.deal-progress { min-width: 0; border-top: 1px solid var(--line); padding-top: 18px; }
.deal-progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 14px; }
.deal-progress-label > span { color: var(--ink-2); }
/* ★ 2026-10-22: "put the record the sale button next to the closed button" - it is in the stage row
   now (views/deals.js), after the last pill, because it is the same decision the last pill is. */
.deal-stages { align-items: center; }
.deal-stages .deal-close-action { margin-left: 8px; min-height: 40px; padding: 0 18px; }
@media (max-width: 600px) {
  .deal-header .h1 { font-size: 28px; line-height: 1.15; }
  .deal-header .deal-terms { display: grid; gap: 6px; }
  .deal-progress .chips { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 6px; }
  .deal-progress .chip { flex: 0 0 auto; min-height: 44px; font-size: 14px; padding: 8px 14px; }
  /* ⚠️ it scrolls WITH the pills on a phone rather than wrapping under them, which is why it lives
     inside `.chips` and not beside it */
  .deal-progress .deal-close-action { flex: 0 0 auto; min-height: 44px; }
  /* ★ and the strip SAYS it keeps going: a soft fade off the right edge, so a row that runs past
     the screen reads as scrollable instead of as everything there is (2026-10-28). */
  .deal-progress { position: relative; }
  .deal-progress::after {
    content: ""; position: absolute; right: 0; bottom: 6px; width: 28px; height: 44px;
    pointer-events: none; background: linear-gradient(to right, transparent, var(--card));
  }
}
.deal-header > div > .card-pad { min-width: 0; }

/* phone: the Deals board is the People page's stage tiles (views/deals.js). The tile carries the money
   the board's column head carried, under the count. */
.pp-tile-sum { font-size: 16px; font-weight: 700; color: var(--ink-2); margin-top: -4px; }
.pp-tile.on .pp-tile-sum { color: var(--on-dark); }

/* ---------- the deals table (views/deals.js, computer only; the phone keeps its tiles) ---------- */
.deal-table { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.dt-head, .dt-row { display: grid; grid-template-columns: minmax(0, 2.5fr) 92px minmax(0, 1fr) 190px minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; padding: 16px 24px; }
.dt-head { background: var(--card-2); border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.dt-row { border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.dt-row:first-of-type { border-top: 0; }
.dt-row:hover { background: var(--card-2); }
.dt-row:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.dt-c { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.dt-c .s { display: block; min-width: 0; font-size: 14px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-c .s.next { font-weight: 600; color: var(--ink); }
.dt-prop { flex-direction: row; align-items: center; gap: 14px; }
.dt-t { flex: 1 1 auto; min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.dt-t b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-thumb { flex: none; width: 76px; height: 58px; border-radius: var(--r-sm); overflow: hidden; background: var(--sunk); display: grid; place-items: center; }
.dt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dt-thumb.none { background: var(--card-2); border: 1px solid var(--line); }
.dt-thumb.none img { width: 70%; height: 70%; object-fit: contain; }
.dt-avs { display: flex; }
.dt-avs { gap: 4px; }
.dt-avs .av.sm { flex: none; }
.dt-price b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.dt-close b { font-size: 15px; font-weight: 700; }

/* how far along: one dot per stage of this side, the line filled behind the ones that are done */
.dt-steps { display: flex; align-items: center; }
.dt-step { flex: 1 1 0; display: flex; align-items: center; justify-content: flex-end; min-width: 0; }
.dt-step + .dt-step { position: relative; }
.dt-step + .dt-step::before { content: ''; flex: 1 1 auto; height: 2px; background: var(--line); }
.dt-step.done + .dt-step::before, .dt-step.now + .dt-step::before { background: var(--ink); }
.dt-step i { flex: none; width: 13px; height: 13px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); }
.dt-step.done i { background: var(--ink); border-color: var(--ink); }
.dt-step.now i { background: var(--card); border-color: var(--ink); box-shadow: inset 0 0 0 3px var(--ink); }

.dt-badge { align-self: flex-start; max-width: 100%; padding: 6px 14px; border-radius: var(--pill); font-size: 14px; font-weight: 700; background: var(--sunk); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-prep { background: var(--sand, var(--card-2)); }
.b-look { background: var(--sky, var(--olive-tint)); }
.b-offer { background: var(--butter, var(--warn-soft)); }
.b-uc { background: var(--blush, var(--alert-soft)); }
.b-closed { background: var(--good-soft); color: var(--good); }
.b-plain { background: var(--sunk); color: var(--ink-2); }

@media (max-width: 1180px) {
  .dt-head, .dt-row { grid-template-columns: minmax(0, 2.2fr) 84px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; padding: 14px 18px; }
  .dt-head span:nth-child(4), .dt-prog { display: none; }
}

/* the five stage groups, kept from the board: the band says which stage, how many, what they are worth */
.dt-band { display: block; padding: 14px 24px 10px; background: var(--card-2); border-top: 1px solid var(--line); }
.deal-table > .dt-band:first-of-type { border-top: 0; }
.dt-band > span { display: flex; align-items: baseline; gap: 12px; }
.dt-band b { font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dt-band .n { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.dt-band + .dt-row { border-top: 0; }
@media (max-width: 1180px) { .dt-band { padding: 12px 18px 8px; } }

/* a Looking buyer has no house: their initials sit where the photograph goes */
.dt-thumb.who { background: transparent; border: 0; }
.dt-thumb.who .av.lg { width: 56px; height: 56px; font-size: 19px; }
.dt-prog:empty { min-height: 1px; }

/* ---------- the file sheet (moved here 2026-10-28) ----------
   ⚠️ These rules lived in src/styles/studio.css, which NEITHER next.html NOR demo.html loads -
   only content-studio.html still does. So every form in "Begin file" rendered with no styling
   at all: a wall of checkboxes, names, source tags and reasons running together with nothing
   to separate one form from the next (Morgan, 2026-10-28: "Clean this up^^"). It was never a
   design problem. The rules are in deals.css now, which both pages load. */
.file-sheet .file-group { margin-top: 14px; }
.file-sheet .file-group .eyebrow { display: block; margin-bottom: 6px; }
.file-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 10px; align-items: baseline;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px;
  background: var(--card); cursor: pointer; }
.file-row:hover { border-color: var(--ink); }
.file-row input[type="checkbox"] { grid-row: 1 / span 2; align-self: center; }
.file-row .file-name { font-weight: 600; }
.file-row .file-why { grid-column: 2 / -1; font-size: 14px; color: var(--ink-2);   /* ⚠️ was var(--muted), which only exists on the landing page: an undefined custom property makes the whole declaration invalid, so the reason under each form simply inherited */ }
/* ⚠️ a line already on the file is shown and disabled, never silently dropped: "it is already here"
   is the answer to "why is this not checked", and a missing row is not. */
.file-row.is-on { opacity: .62; cursor: default; }
.file-row .file-why.is-done { color: var(--ink); }
.file-told { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
/* ★ 0257: "something not on the list" sits under the groups and above Begin file, spaced off the
   last checkbox row so it does not read as one of them. */
.file-own { margin-top: 16px; }
.file-sheet .chip-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.file-sheet .two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 560px) { .file-sheet .two-up { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: auto 1fr; } }
