/* FIX AND FLIP TAB (FIX_AND_FLIP_ENGINE_LATTICE.md cut F6). Uses the page's own buttons and type; only layout here. */
.flip-engine { display: grid; gap: 16px; min-width: 0; }
/* Grid children default to min-width:auto and would grow to the comps table's width; the table scrolls inside instead. */
.flip-engine > *, .flip-body, .flip-body > form { min-width: 0; max-width: 100%; }
/* The display rule above would beat the browser's [hidden] - the flip panel must disappear with its tab (after-pass). */
.flip-engine[hidden] { display: none; }
/* The tab strip (equity-plan.css) is a 2-column grid whose last button drops its border. With the reps-only third tab
   hidden, the financing tab is still the last VISIBLE button; with it shown, the strip has three columns. */
.engine-mode-tabs button[hidden] { display: none; }
.engine-mode-tabs button:has(+ button[hidden]) { border-right: 0; }
.engine-mode-tabs:has(> button[data-engine-mode="flip"]:not([hidden])) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .engine-mode-tabs:has(> button[data-engine-mode="flip"]:not([hidden])) { grid-template-columns: 1fr; }
  .engine-mode-tabs button:has(+ button[hidden]) { border-bottom: 0; }
}
.flip-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; }
.flip-head h3 { margin: 0 0 4px; }
.flip-head p { margin: 0; max-width: 62ch; }
.flip-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.flip-steps button { font: inherit; padding: 8px 12px; border: 1px solid #b8c0cc; border-radius: 999px; background: #fff; color: #1b1f23; cursor: pointer; }
.flip-steps button[aria-current="step"] { background: #1f3a5f; border-color: #1f3a5f; color: #fff; }
.flip-status { min-height: 1.3em; margin: 0; }
.flip-status.is-error { color: #b42318; }
.flip-status.is-success { color: #106b3a; }
.flip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.flip-wide { grid-column: 1 / -1; }
.flip-field { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; }
.flip-field input, .flip-field select, .flip-field textarea, .flip-table input, .flip-table select, .flip-excluded input[type="number"], .flip-flag select {
  font: inherit; font-weight: 400; padding: 7px 9px; border: 1px solid #b8c0cc; border-radius: 8px; background: #fff; color: inherit; min-width: 0; max-width: 100%; box-sizing: border-box;
}
.flip-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.flip-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.flip-phase { padding: 12px 14px; border-left: 4px solid #1f3a5f; background: #eef2f7; border-radius: 6px; }
.flip-phase p { margin: 6px 0; }
.flip-log { margin: 6px 0 0; padding-left: 1.2em; font-size: .88rem; color: #4b5563; }
.flip-candidates { list-style: none; padding: 0; display: grid; gap: 10px; }
.flip-candidates li { padding: 10px; border: 1px solid #d6dce4; border-radius: 8px; }
.flip-candidates p { margin: 4px 0 8px; font-size: .9rem; color: #4b5563; }
.flip-unverified { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #fff4dd; color: #8a4b00; font-size: .78rem; font-weight: 600; }
.flip-table-scroll { overflow-x: auto; max-width: 100%; }
.flip-table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.flip-table th, .flip-table td { border-bottom: 1px solid #d6dce4; padding: 6px; text-align: left; vertical-align: top; }
.flip-table th { background: #1f3a5f; color: #fff; font-weight: 600; }
.flip-table input { width: 100%; min-width: 70px; }
.flip-table td:first-child input[name="address"] { min-width: 150px; }
.flip-table input[name="date"] { min-width: 112px; }
.flip-table input[name="price"] { min-width: 104px; }
.flip-table input[name="beds"], .flip-table input[name="baths"] { min-width: 56px; }
.flip-link { background: none; border: 0; color: #b42318; cursor: pointer; padding: 2px 0; font: inherit; text-decoration: underline; display: block; }
.flip-fieldset { border: 1px solid #d6dce4; border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; }
.flip-fieldset legend { font-weight: 700; padding: 0 4px; }
.flip-flag { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding: 4px 0; }
.flip-excluded { padding-left: 1.1em; display: grid; gap: 6px; }
.flip-arv { padding: 10px 12px; border-radius: 6px; font-weight: 600; }
.flip-arv.is-ready { background: #e8f3ec; }
.flip-arv.is-held { background: #fff4dd; }
.flip-note { font-size: .88rem; color: #4b5563; }
.flip-glance { padding: 14px 16px; background: #e8f3ec; border-radius: 8px; }
.flip-glance.is-no-deal { background: #fbe9e7; }
.flip-glance h4 { margin: 0 0 8px; }
.flip-glance dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.flip-glance dt { font-weight: 600; }
.flip-glance dd { margin: 0; }
.flip-warning { color: #8a4b00; margin: 8px 0 0; }
.flip-reports { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 640px) {
  .flip-glance dl { grid-template-columns: 1fr; }
  .flip-glance dt { margin-top: 6px; }
}
/* v2: parcel paste, extracted facts, LandGlide import, photos, reconciliation. */
.flip-paste { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.flip-extracted ul, .flip-reconcile { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.flip-extracted small { display: block; color: #4b5563; margin-left: 26px; }
.flip-import { border: 1px solid #d6dce4; border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.flip-import summary { cursor: pointer; font-weight: 600; }
.flip-photos { margin-bottom: 14px; }
.flip-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.flip-photo { margin: 0; border: 1px solid #d6dce4; border-radius: 8px; overflow: hidden; background: #fff; }
.flip-photo img { display: block; width: 100%; height: 140px; object-fit: cover; }
.flip-photo figcaption { display: grid; gap: 4px; padding: 6px; }
.flip-photo figcaption input, .flip-photo figcaption select { font: inherit; font-size: .85rem; padding: 4px 6px; border: 1px solid #b8c0cc; border-radius: 6px; min-width: 0; }
.flip-reconcile li { padding: 6px 10px; border-radius: 6px; background: #eef2f7; }
.flip-reconcile li.is-discrepancy { background: #fff4dd; }
.flip-reconcile li.is-match { background: #e8f3ec; }
@media (max-width: 640px) { .flip-paste { grid-template-columns: 1fr; } }
/* v2 UX after-pass: the status line stays in view, tap targets reach 44px, Save links read as neutral. */
.flip-engine [data-flip-status] { position: sticky; bottom: 0; z-index: 2; background: #fff; padding: 8px 0; margin: 0; min-height: 1.5em; }
.flip-engine [data-flip-status]:empty { padding: 0; }
.flip-link[data-flip-photo-save] { color: #1f2937; }
.flip-engine .button, .flip-engine .flip-link, .flip-engine select, .flip-engine .flip-check { min-height: 44px; }
.flip-engine .flip-check { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) {
  .flip-table th:first-child, .flip-table td:first-child { position: sticky; left: 0; z-index: 1; }
  .flip-table td:first-child { background: #fff; }
  .flip-table th:first-child { background: #1f3a5f; }
}
.flip-reconcile-values { display: block; color: #4b5563; margin-top: 2px; }
.flip-steps button, .flip-engine input:not([type="checkbox"]):not([type="file"]) { min-height: 44px; }
.flip-engine input[type="checkbox"] { width: 22px; height: 22px; }
/* Records intake (lattice section 6): screenshots and pasted pages, read and sorted for the rep to tick. */
.flip-intake { border: 1px solid #b8c0cc; border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; background: #f7f9fc; display: grid; gap: 10px; }
.flip-intake h4, .flip-intake h5 { margin: 4px 0; }
.flip-intake-items, .flip-intake-facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.flip-intake-item { border: 1px solid #d6dce4; border-radius: 8px; padding: 8px 10px; background: #fff; display: grid; gap: 6px; }
.flip-intake-item.is-refused { border-color: #b3261e; background: #fff4f2; }
.flip-intake-item p { margin: 0; }
.flip-intake-text { white-space: pre-wrap; font-size: .8rem; max-height: 220px; overflow: auto; background: #eef2f7; padding: 6px; border-radius: 6px; }
.flip-intake-fact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 4px 10px; align-items: center; padding: 6px 8px; border-radius: 6px; background: #fff; border: 1px solid #e3e8ef; }
.flip-intake-fact small { grid-column: 1 / -1; color: #4b5563; }
.flip-intake-fact.is-conflict { border-color: #b7791f; background: #fffaf0; }
.flip-intake-fact.is-same { opacity: .75; }
.flip-intake-fact.is-held { opacity: .7; }
.flip-intake-value { font: inherit; min-width: 0; padding: 6px 8px; border: 1px solid #b8c0cc; border-radius: 6px; background: #fff; }
span.flip-intake-value { border-color: transparent; background: transparent; }
.flip-badge { font-size: .75rem; font-weight: 700; letter-spacing: .02em; padding: 2px 8px; border-radius: 999px; background: #e3e8ef; color: #1f2937; white-space: nowrap; }
.flip-badge.is-ai { background: #fde8c8; color: #7a4100; }
.flip-intake-status { color: #7a4100 !important; }
.flip-intake-save { position: sticky; bottom: 44px; background: #f7f9fc; padding: 8px 0; z-index: 2; }
@media (max-width: 640px) { .flip-intake-fact { grid-template-columns: minmax(0, 1fr) auto; } .flip-intake-fact .flip-intake-value { grid-column: 1 / -1; } }
/* Records intake after-pass (2026-09-30): honest disabled states, neutral bulk links, 44px targets, phone room. */
.flip-intake .button:disabled, .flip-intake .button[disabled] { background: #d6dce4; color: #4b5563; border-color: #c3cad4; cursor: not-allowed; }
.flip-badge { justify-self: start; }
.flip-link.is-neutral { color: #1f2937; }
.flip-intake summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.flip-intake input[type="file"] { min-height: 44px; padding: 8px 0; }
.flip-intake-ai .flip-check input { flex: 0 0 22px; }
.flip-table tr.is-doubtful td { background: #fff7e6; }
@media (max-width: 640px) {
  .flip-intake-save { display: flex; flex-wrap: nowrap; gap: 8px; bottom: 56px; }
  .flip-intake-save .button { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; }
  .flip-engine [data-flip-status] { padding-right: 72px; }
}
/* Paste mode (2026-09-30): the entry toggle, the parcel-page box, and where each filled field came from. */
.flip-case-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.flip-entry-toggle { border: 1px solid #d6dce4; border-radius: 8px; padding: 6px 12px; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.flip-entry-toggle legend { font-weight: 700; padding: 0 4px; }
.flip-draft textarea[data-flip-draft-text] { width: 100%; min-height: 10em; font-family: inherit; }
.flip-field .flip-badge { margin-left: 6px; vertical-align: middle; }
.flip-field .flip-warning { display: block; margin-top: 2px; }
.flip-page-says { display: block; text-align: left; margin-top: 2px; }
.flip-page-source { display: block; margin-top: 2px; color: #4b5563; overflow-wrap: anywhere; }
