/* Page layouts and feature components for the owner workspace. Content is solid; space, not borders, separates sections. */
.page-head { margin: 8px 0 28px; display: grid; gap: 10px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; }
.page-head-copy { display: grid; gap: 8px; min-width: 0; }
.page-head-copy h1 { font-size: var(--text-3xl); }
.page-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lede { color: var(--ink-2); font-size: var(--text-md); max-width: 60ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.block { margin-bottom: 36px; }
.block:last-child { margin-bottom: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.section-head h2 { font-size: var(--text-xl); }
.section-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.section-head h2.caption { font-size: var(--text-xs); }
.section-count { color: var(--ink-3); font-weight: 500; margin-left: 6px; font-size: var(--text-md); }
.section-link { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 4px; font-size: var(--text-md); font-weight: 600; color: var(--ink-2); }
.section-link svg { width: 18px; height: 18px; }
.section-link:hover { color: var(--ink); text-decoration: none; }
.section-title { margin: 0 0 12px; }
.prose { font-size: var(--text-md); line-height: 1.6; max-width: 66ch; color: var(--ink); }
.prose + .prose { margin-top: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.row-link { color: inherit; }
.row-link:hover { text-decoration: none; }
.row-link:hover .primary { text-decoration: underline; text-underline-offset: 3px; }
.mono { font-family: ui-monospace, Consolas, Menlo, monospace; font-size: var(--text-sm); }
.code { letter-spacing: .14em; font-size: var(--text-lg); }
.field-value { margin: 0; font-size: var(--text-md); color: var(--ink); line-height: 1.45; }
.two-up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 28px; align-items: start; margin-bottom: 36px; }
.two-up:last-child { margin-bottom: 0; }
.two-up-narrow { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.two-up > .sheet { align-self: stretch; }
.sheet-body > .small-copy + form, .sheet-body > .small-copy + ul { margin-top: 14px; }
@media (max-width: 900px) { .two-up, .two-up-narrow { grid-template-columns: 1fr; gap: 20px; } }
@media (max-width: 640px) {
  .page-head { margin: 4px 0 18px; gap: 8px; }
  .page-head-copy h1 { font-size: 28px; }
  .page-actions .btn { padding: 0 16px; font-size: 15px; }
  /* Phones: the one primary action takes its own full-width row; quiet actions share the row beneath it. */
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .btn-primary { flex: 1 1 100%; order: -1; }
  .block { margin-bottom: 30px; }
  .section-head { flex-wrap: wrap; }
  .section-head .section-actions { flex: 1 1 100%; justify-content: flex-start; }
}
/* Phones: the top bar already names a top-level page, so its header copy folds away and only the actions remain. */
@media (max-width: 900px) {
  .page-head-dup .page-head-copy .caption, .page-head-dup .lede, .page-head .caption-dup { display: none; }
  .page-head-dup .page-head-copy h1 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .page-head-dup .page-head-row { justify-content: flex-end; }
  .page-head-dup { margin: 0 0 12px; }
  .page-head-dup.page-head-copy-only { margin: 0; }
  .page-head { margin: 2px 0 14px; }
}

/* Dashboard */
.today { margin: 6px 0 36px; display: grid; gap: 8px; }
.today-date { order: 0; font-size: var(--text-sm); color: var(--ink-3); font-weight: 500; }
.today-heading { order: 1; font-size: clamp(28px, 2.4vw, 34px); font-weight: 700; line-height: 1.15; letter-spacing: -.025em; }
.today-sentence { order: 2; font-size: var(--text-lg); line-height: 1.45; max-width: 52ch; color: var(--ink-2); font-weight: 500; }
.today .task-list { order: 3; margin-top: 10px; }
.task-list { overflow: hidden; }
.task-list-empty { padding: 4px 22px; }
.task { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 22px; align-items: center; gap: 14px; padding: 14px 18px 14px 16px; min-height: 64px; color: inherit; transition: background .12s var(--ease); }
.task + .task, .task + .task-overflow { border-top: 1px solid var(--line); }
.task:hover { background: var(--surface-2); text-decoration: none; }
.task-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.task-ico svg { width: 20px; height: 20px; }
.task.tone-neg .task-ico { background: var(--red-soft); color: var(--red); }
.task.tone-amber .task-ico { background: var(--accent-soft); color: var(--accent-ink); }
.task-copy { display: grid; gap: 3px; min-width: 0; }
.task-copy strong { font-size: var(--text-md); font-weight: 600; }
.task-copy small { font-size: var(--text-sm); color: var(--ink-3); }
.task-amount { font-weight: 700; font-size: var(--text-md); }
.task-chevron { color: var(--ink-3); width: 20px; height: 20px; }
.task-more { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 46px; padding: 0 16px; font-size: var(--text-sm); font-weight: 600; color: var(--accent-ink); border-top: 1px solid var(--line); background: var(--surface-2); }
.task-more .ico { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.task-list:not(.is-expanded) .task-overflow { display: none; }
.task-list.is-expanded .task-more .ico { transform: rotate(180deg); }
.task-more-phone { display: none; } /* three or four tasks: every row already shows on wide screens */
.dash-preview { display: grid; gap: 14px; }
.dash-preview .ribbon { padding-bottom: 6px; }
@media (max-width: 640px) {
  /* Phones: the short heading is the page title, the narrative sentence stays on wide screens, two tasks show. */
  .today { margin: 2px 0 28px; gap: 6px; }
  .today-sentence { display: none; }
  .today-heading { font-size: 28px; margin: 2px 0 4px; }
  .task-list:not(.is-expanded) .task-overflow-phone { display: none; }
  .task { grid-template-columns: 40px minmax(0, 1fr) 20px; grid-template-areas: 'ico copy chevron' 'ico amount chevron'; gap: 2px 12px; padding: 12px 14px; min-height: 60px; }
  .task-ico { grid-area: ico; width: 40px; height: 40px; border-radius: 13px; }
  .task-copy { grid-area: copy; }
  .task-amount { grid-area: amount; justify-self: start; }
  .task-chevron { grid-area: chevron; align-self: center; }
  .task-more { min-height: 44px; }
  .task-more-phone { display: flex; }
}
.ribbon { display: flex; gap: 14px; overflow-x: auto; padding: 4px 4px 14px; margin: 0 -4px; scroll-snap-type: x proximity; scrollbar-width: none; }
.ribbon::-webkit-scrollbar { display: none; }
.ribbon-tile { position: relative; flex: none; width: 206px; aspect-ratio: 3 / 2; border-radius: var(--r-tile); overflow: hidden; background: var(--surface-3); scroll-snap-align: start; box-shadow: var(--shadow-sheet); transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.ribbon-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); text-decoration: none; }
.ribbon-tile:active { transform: scale(.985); }
.ribbon-tile img { width: 100%; height: 100%; object-fit: cover; }
.ribbon-tile::after { content: ''; position: absolute; inset: 0; background: var(--photo-scrim); }
.ribbon-copy { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; display: grid; color: #fff; line-height: 1.25; }
.ribbon-copy strong { font-size: var(--text-md); font-weight: 700; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.ribbon-copy small { font-size: var(--text-sm); opacity: .94; font-weight: 500; }
.ribbon-add { flex: none; width: 150px; aspect-ratio: 3 / 2.5; border: 1.5px dashed var(--line-2); border-radius: var(--r-tile); display: grid; place-items: center; align-content: center; gap: 6px; color: var(--ink-3); font-size: var(--text-sm); font-weight: 600; background: transparent; transition: background .15s var(--ease), color .15s var(--ease); }
.ribbon-add:hover { color: var(--ink); border-color: var(--ink-3); background: var(--surface); }
.ribbon-add svg { width: 20px; height: 20px; }
.ribbon-empty { padding: 8px 0; }
.ribbon-tile.is-pending { background: var(--surface); border: 1.5px dashed var(--line-2); box-shadow: none; }
.ribbon-tile.is-pending::after { display: none; }
.ribbon-pending { position: absolute; left: 14px; top: 14px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: var(--text-sm); font-weight: 600; }
.ribbon-pending svg { width: 16px; height: 16px; }
.ribbon-tile.is-pending .ribbon-copy { color: var(--ink); }
.ribbon-tile.is-pending .ribbon-copy strong { text-shadow: none; }
.ribbon-tile.is-pending .ribbon-copy small { color: var(--ink-3); opacity: 1; }
@media (max-width: 640px) { .ribbon-tile { width: 232px; } .ribbon { gap: 12px; padding-bottom: 10px; } }
.book { padding: 6px 22px 10px; }
.book-line { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; align-items: center; font-size: var(--text-md); }
.book-line + .book-line { border-top: 1px solid var(--line); }
.book-text { color: var(--ink-2); min-width: 0; }
.book-text strong { color: var(--ink); font-weight: 600; }
.book-time { color: var(--ink-3); font-size: var(--text-sm); white-space: nowrap; }
@media (max-width: 560px) { .book-line { grid-template-columns: 28px minmax(0, 1fr); } .book-time { grid-column: 2; } }
.lease-lines, .money-lines, .stat-lines { display: grid; }
.lease-lines li, .money-lines li, .stat-lines li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--text-md); }
.lease-lines li:last-child, .money-lines li:last-child, .stat-lines li:last-child { border-bottom: 0; }
.lease-lines li > span:not(.pill), .money-lines li > span:not(.pill) { display: grid; min-width: 0; }
.lease-lines strong, .money-lines strong { font-weight: 600; }
.lease-lines small, .money-lines small { color: var(--ink-3); font-size: var(--text-sm); }
.lease-lines .right, .money-lines .right { text-align: right; }
.stat-lines li span { color: var(--ink-2); }
.sheet > .lease-lines, .sheet > .money-lines, .sheet > .stat-lines { padding: 4px 22px 8px; }
@media (max-width: 640px) { .sheet > .lease-lines, .sheet > .money-lines, .sheet > .stat-lines { padding: 2px 16px 6px; } .book { padding: 4px 16px 8px; } }

/* Homes: image-led browsing. */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
/* Photo keeps its shape in every card of a row; a wrapped address grows the body and the amount row stays pinned to the bottom. */
.home-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; color: inherit; transition: transform .18s var(--ease), box-shadow .18s var(--ease); }
.home-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); text-decoration: none; }
.home-card:active { transform: scale(.99); }
.home-card-photo { position: relative; aspect-ratio: 16 / 10; background: var(--surface-3); }
.home-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.home-card-photo .photo-pending { position: absolute; inset: 0; min-height: 0; border: 0; border-radius: 0; background: var(--surface-2); }
.home-card-body { padding: 16px 20px 18px; display: grid; grid-template-rows: auto auto 1fr; gap: 6px; }
.home-card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home-card-title strong { font-size: var(--text-lg); font-weight: 700; letter-spacing: -.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-card-addr { font-size: var(--text-md); color: var(--ink-3); }
.home-card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 8px; align-self: end; }
.home-card-amount { display: grid; line-height: 1.2; }
.home-card-amount strong { font-size: var(--text-xl); font-weight: 700; }
.home-card-amount small { font-size: var(--text-sm); color: var(--ink-3); font-weight: 500; }
.home-card-foot > small { font-size: var(--text-sm); color: var(--ink-2); font-weight: 500; text-align: right; }
@media (max-width: 640px) { .home-grid { grid-template-columns: 1fr; gap: 16px; } }

/* Home rows: compact image-led list rows (finance, reports). */
.home-rows { padding: 4px 0; }
.home-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 22px; color: inherit; transition: background .12s var(--ease); }
.home-row + .home-row { border-top: 1px solid var(--line); }
.home-row:hover { background: var(--surface-2); text-decoration: none; }
.home-row-photo { width: 72px; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-4); }
.home-row-photo img { width: 100%; height: 100%; object-fit: cover; }
.home-row-photo.is-pending { border: 1.5px dashed var(--line-2); background: var(--surface-2); }
.home-row-photo svg { width: 18px; height: 18px; }
.home-row-copy { display: grid; gap: 2px; min-width: 0; }
.home-row-copy strong { font-size: var(--text-md); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-row-copy small { font-size: var(--text-sm); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-row-figure { text-align: right; display: grid; gap: 2px; max-width: 46%; }
.home-row-figure strong { font-size: var(--text-md); font-weight: 700; }
.home-row-figure small { font-size: var(--text-sm); color: var(--ink-3); }
@media (max-width: 640px) { .home-row { grid-template-columns: 60px minmax(0, 1fr) auto; gap: 12px; padding: 12px 16px; } .home-row-photo { width: 60px; } .home-row-figure small { display: none; } .home-row-copy small { white-space: normal; } }

/* Home detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px 36px; align-items: start; }
.detail-main { min-width: 0; }
.detail-side { display: grid; gap: 16px; }
.hero-photo { margin: 0 0 18px; }
.hero-photo img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-sheet); background: var(--surface-3); box-shadow: var(--shadow-sheet); }
.hero-photo figcaption { margin-top: 8px; font-size: var(--text-sm); color: var(--ink-3); }
.hero-photo-pending .photo-pending { aspect-ratio: 16 / 8; min-height: 0; }
.spec-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.spec { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-sheet); font-size: var(--text-sm); font-weight: 600; color: var(--ink-2); }
.spec svg { width: 16px; height: 16px; color: var(--ink-3); }
.chips-static { margin-top: 14px; }
.chips-static .chip { cursor: default; height: 34px; font-size: var(--text-sm); box-shadow: none; }
@media (max-width: 1000px) { .detail { grid-template-columns: 1fr; } }

/* Multi-step flow (home setup) */
.flow { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: start; }
.flow-steps ol { display: grid; gap: 4px; position: sticky; top: calc(var(--topbar-h) + 16px); }
.step { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--tap); padding: 8px 12px 8px 9px; border-radius: 14px; color: var(--ink-3); font-size: var(--text-md); font-weight: 600; text-align: left; transition: background .15s var(--ease), color .15s var(--ease); }
.step:not(:disabled):hover { background: var(--surface); color: var(--ink); }
.step:disabled { opacity: .6; }
.step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: var(--text-xs); font-weight: 700; flex: none; background: var(--surface); box-shadow: var(--shadow-ctl); }
.step-num svg { width: 13px; height: 13px; }
.step.current { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sheet); }
.step.current .step-num { background: var(--accent-fill); color: var(--accent-text); box-shadow: none; }
.step.done .step-num { background: var(--green-soft); color: var(--green); box-shadow: none; }
.flow-main { padding: 24px 26px 22px; }
.flow-heading { margin-bottom: 20px; display: grid; gap: 4px; }
.flow-heading h2 { font-size: var(--text-2xl); letter-spacing: -.02em; }
.flow-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); justify-content: flex-start; }
@media (max-width: 900px) {
  .flow { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .flow-steps, .flow-main { min-width: 0; }
  .flow-steps ol { position: static; display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
  .step { width: auto; flex: none; padding: 5px 10px 5px 5px; min-height: var(--tap); }
  .step .step-name { display: none; }
  .step.current .step-name { display: inline; }
  .flow-main { padding: 16px 16px 18px; }
  /* The step pills already count the steps, so the sheet keeps only the step name and its one-line help. */
  .flow-heading { margin-bottom: 14px; gap: 2px; }
  .flow-heading .caption { display: none; }
  .flow-heading h2 { font-size: var(--text-xl); }
}
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 16px; margin-top: 4px; }
.upload-zone { border: 1.5px dashed var(--line-2); border-radius: var(--r-sheet); padding: 28px 20px 24px; text-align: center; display: grid; justify-items: center; gap: 8px; background: var(--surface-2); margin-bottom: 16px; }
.upload-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-sheet); margin-bottom: 4px; }
.upload-icon svg { width: 20px; height: 20px; }
.upload-zone strong { font-size: var(--text-lg); }
.upload-help { font-size: var(--text-sm); color: var(--ink-3); max-width: 44ch; }
.upload-zone .file-btn { margin-top: 8px; }
.upload-zone .small-copy:empty { display: none; }
.upload-hint { font-size: var(--text-sm); color: var(--ink-3); font-weight: 500; }
.upload-zone.is-dragover { border-color: var(--accent); border-style: solid; background: var(--accent-soft); }
.upload-zone.is-dragover .upload-icon { color: var(--accent-ink); }
@media (hover: none) { .upload-hint { display: none; } }
.sample-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photo-tile { border-radius: var(--r-tile); overflow: hidden; background: var(--surface-2); display: grid; box-shadow: var(--shadow-sheet); }
.photo-tile img { aspect-ratio: 4 / 3; width: 100%; height: auto; object-fit: cover; }
.photo-tile-copy { padding: 10px 12px 4px; display: grid; line-height: 1.25; }
.photo-tile-copy small { color: var(--ink-3); font-size: var(--text-sm); }
.photo-tile-actions { display: flex; gap: 4px; padding: 8px 10px 10px; flex-wrap: wrap; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.listing-preview { overflow: hidden; }
.listing-preview-photo { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.listing-preview-price { margin-top: 10px; font-size: var(--text-lg); font-weight: 700; }
.listing-preview-price small { color: var(--ink-3); font-weight: 500; font-size: var(--text-sm); }
.review-confirm { margin-top: 20px; padding: 14px 16px; background: var(--accent-soft); border-radius: 14px; color: var(--ink); }
@media (max-width: 760px) { .review-grid { grid-template-columns: 1fr; } }

/* Guidance panel */
.guidance { background: var(--surface-2); border-radius: var(--r-sheet); padding: 18px 20px; display: grid; gap: 10px; }
.guidance h3 { font-size: var(--text-md); }
.guidance-list { padding-left: 18px; list-style: decimal; display: grid; gap: 6px; font-size: var(--text-sm); color: var(--ink-2); }
.guidance-sources { display: grid; gap: 4px; font-size: var(--text-sm); }
.guidance-sources a { color: var(--accent-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.guidance-sources svg { width: 13px; height: 13px; }

/* Lease editor and the printable preview */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px 36px; align-items: start; }
.editor-main { display: grid; gap: 16px; }
.editor-side { display: grid; gap: 14px; position: sticky; top: calc(var(--topbar-h) + 16px); }
.editor-group { padding: 20px 22px; }
.editor-group-head { margin-bottom: 16px; display: grid; gap: 2px; }
.editor-group-head h2 { font-size: var(--text-lg); }
.editor-main > .notice { margin-top: 4px; }
@media (max-width: 1000px) { .editor { grid-template-columns: 1fr; } .editor-side { position: static; } }
.paper { padding: 40px 44px; max-width: 780px; display: grid; gap: 26px; margin-bottom: 24px; }
.paper-head { display: grid; gap: 6px; padding-bottom: 20px; border-bottom: 1px solid var(--line-2); }
.paper-head h1 { font-size: var(--text-4xl); }
.paper section h2 { font-size: var(--text-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.paper-caution { font-size: var(--text-sm); color: var(--ink-2); padding: 12px 14px; background: var(--accent-soft); border-radius: 14px; }
@media (max-width: 640px) { .paper { padding: 24px 18px; } .editor-group { padding: 18px 16px; } }

/* Inline forms (charges, condition report start): a sheet on their own, plain when already inside one. */
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; align-items: end; margin: 0 0 18px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--sheet-line); border-radius: var(--r-sheet); box-shadow: var(--shadow-sheet); }
.inline-form-plain { background: transparent; border: 0; box-shadow: none; border-radius: 0; margin: 0; padding: 20px 22px 8px; }
.charge-panel:not([hidden]) + .table-wrap { border-top: 1px solid var(--line); margin-top: 10px; }
@media (max-width: 640px) { .inline-form-plain { padding: 16px 16px 2px; } }
.inline-form .field > span:empty::before { content: '\00a0'; }
.inline-form .btn { width: 100%; }
.guide-form .form-grid { padding-top: 4px; }

/* Messages */
.thread { display: grid; overflow: hidden; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.thread-head div { display: grid; line-height: 1.25; flex: 1; }
.thread-head small { color: var(--ink-3); font-size: var(--text-sm); }
.thread-list { display: grid; gap: 10px; padding: 18px 18px; max-height: 58vh; overflow: auto; background: var(--surface-2); }
.bubble { justify-self: start; max-width: min(72%, 560px); padding: 11px 15px; border-radius: 18px 18px 18px 6px; background: var(--surface); box-shadow: var(--shadow-ctl); display: grid; gap: 4px; }
.bubble p { font-size: var(--text-md); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble small { font-size: var(--text-sm); color: var(--ink-3); }
.bubble.mine { justify-self: end; background: var(--accent-soft); border-radius: 18px 18px 6px 18px; }
.thread-empty { padding: 8px 4px; }
.thread-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 12px 18px 14px; border-top: 1px solid var(--line); align-items: end; }
.thread-form textarea { min-height: 46px; }
.message-preview { color: var(--ink-2); }
@media (max-width: 640px) { .bubble { max-width: 90%; } .thread-list { max-height: none; } }

/* Activity */
.feed-audit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: -4px 0 16px; }
.feed-day { margin-bottom: 22px; }
.feed-day h2 { margin: 0 0 8px; }
.feed { display: grid; padding: 4px 22px; }
.feed-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.feed-item:last-child { border-bottom: 0; }
.feed-copy { display: grid; gap: 3px; font-size: var(--text-md); }
.feed-copy p { color: var(--ink-2); }
.feed-copy strong { color: var(--ink); }
.feed-copy time { color: var(--ink-3); font-size: var(--text-sm); }
@media (max-width: 640px) { .feed { padding: 2px 16px; } }

/* Reports */
.progress-block { display: grid; gap: 10px; }
.progress-row { display: flex; justify-content: space-between; gap: 12px; font-size: var(--text-sm); color: var(--ink-2); }
.progress-row.total { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); font-weight: 600; }
.progress { width: 100%; height: 10px; appearance: none; -webkit-appearance: none; border: 0; border-radius: var(--r-pill); overflow: hidden; background: var(--surface-3); accent-color: var(--accent); }
.progress::-webkit-progress-bar { background: var(--surface-3); border-radius: var(--r-pill); }
.progress::-webkit-progress-value { background: var(--accent); border-radius: var(--r-pill); }
.progress::-moz-progress-bar { background: var(--accent); border-radius: var(--r-pill); }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) auto; gap: 12px; align-items: center; font-size: var(--text-sm); }
.bar-label { display: grid; line-height: 1.2; }
.bar-label strong { font-weight: 600; }
.bar-label small { color: var(--ink-3); font-size: var(--text-sm); }
.bar-track { height: 10px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: var(--r-pill); transition: width .5s var(--ease); }
.bar-fill.neg { background: var(--red); }
.bar-value { min-width: 84px; text-align: right; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 1fr auto; } .bar-track { grid-column: 1 / -1; } }

/* Condition reports */
.rooms { display: grid; gap: 16px; }
.room { padding: 20px 22px; display: grid; gap: 16px; }
.room-head { display: flex; align-items: center; justify-content: space-between; }
.room-photos { display: grid; gap: 10px; }
.room-photos-head { display: flex; justify-content: space-between; font-size: var(--text-sm); }
.photo-thumbs { display: grid; grid-template-columns: repeat(auto-fill, 96px); gap: 10px; }
.photo-thumb { position: relative; }
.photo-thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 14px; background: var(--surface-3); }
.photo-remove { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; box-shadow: var(--shadow-ctl); }
.photo-remove svg { width: 12px; height: 12px; }
.photo-strip-block { display: grid; gap: 8px; }
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-strip img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; }
@media (max-width: 640px) { .room { padding: 16px; } }

/* Admin and invites */
.account-list { display: grid; }
.account-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.account-list li:last-child { border-bottom: 0; }
.account-list li div { display: grid; flex: 1; line-height: 1.25; min-width: 0; }
.account-list strong { font-weight: 600; }
.account-list small { color: var(--ink-3); font-size: var(--text-sm); }
.sheet-secret { margin-bottom: 24px; background: var(--accent-soft); }
.sheet-secret .sheet-body { display: grid; gap: 8px; }
.secret-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 6px; }
.secret-row input { font-family: ui-monospace, Consolas, Menlo, monospace; letter-spacing: .04em; background: var(--surface); }
.invite-result { display: grid; gap: 12px; }

/* Photo pending: the honest empty state wherever a home has no photo. Sample art is never substituted for a real home. */
.photo-pending { display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center; padding: 24px; min-height: 200px; background: var(--surface-2); color: var(--ink-3); border: 1.5px dashed var(--line-2); border-radius: var(--r-sheet); }
.photo-pending svg { width: 24px; height: 24px; }
.photo-pending strong { color: var(--ink-2); font-weight: 600; font-size: var(--text-md); }
.photo-pending span { font-size: var(--text-sm); max-width: 36ch; line-height: 1.45; }
.real-photo-note { margin-bottom: 16px; }

/* Finances */
.fin-periods { margin: 0 0 20px; }
.fin-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px 32px; align-items: center; padding: 22px 26px; margin-bottom: 20px; }
.fin-hero-main { display: grid; gap: 6px; min-width: 0; }
.fin-hero-main strong { font-size: clamp(34px, 4vw, 46px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.fin-hero-main small { font-size: var(--text-sm); color: var(--ink-3); line-height: 1.45; }
.fin-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fin-hero-stat { display: grid; gap: 2px; min-width: 0; }
.fin-hero-stat strong { font-size: var(--text-lg); font-weight: 700; letter-spacing: -.01em; }
.fin-hero-stat small { font-size: var(--text-sm); color: var(--ink-3); line-height: 1.35; }
.fin-hero-stat.tone-green strong { color: var(--green); }
.fin-hero-stat.tone-red strong { color: var(--red); }
.fin-hero-stat.tone-amber strong { color: var(--accent-ink); }
.fin-hero-foot { grid-column: 1 / -1; font-size: var(--text-sm); color: var(--ink-3); line-height: 1.5; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.fin-hero-foot a { color: var(--accent-ink); font-weight: 600; }
@media (max-width: 760px) {
  .fin-periods { margin-bottom: 14px; }
  .fin-hero { grid-template-columns: 1fr; padding: 16px 16px 14px; gap: 10px; margin-bottom: 16px; }
  .fin-hero-main small { display: none; }
  .fin-hero-main strong { font-size: 34px; }
  .fin-hero-stats { grid-template-columns: 1fr; gap: 0; }
  .fin-hero-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
  .fin-hero-stat small { order: -1; font-size: var(--text-sm); }
}
.fin-group { margin-bottom: 28px; }
.fin-note { margin: 14px 0 0; }
.fin-kv .kv { padding: 11px 0; }
.fin-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fin-sheet-head p { font-size: var(--text-sm); color: var(--ink-3); }
.fin-form { margin-top: 10px; }
.fin-form .form-actions { justify-content: flex-start; }
.fin-months td.right, .fin-months th.right { white-space: nowrap; }
.fin-table-note { padding: 0 22px 16px; font-size: var(--text-sm); color: var(--ink-3); }
.fin-sales { display: grid; }
.sale-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--text-md); }
.sale-row:last-child { border-bottom: 0; }
.sale-row strong { font-weight: 600; }
.sale-row small { color: var(--ink-3); font-size: var(--text-sm); grid-column: 1 / -1; }
.sale-row .right { text-align: right; font-weight: 700; }
@media (max-width: 640px) { .fin-table-note { padding: 0 16px 14px; } }

/* Leads and showings: requests first, pipeline counts as chips, requested and confirmed kept visibly apart. */
.lead-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.lead-counts .chip { display: inline-flex; align-items: center; gap: 8px; }
.lead-counts .chip small { font-size: var(--text-xs); font-weight: 700; color: var(--ink-3); }
.lead-counts .chip[aria-pressed="true"] small { color: inherit; opacity: .8; }
.toolbar-primary select { max-width: 220px; min-height: var(--tap); font-size: var(--text-md); border-radius: var(--r-pill); background-color: var(--surface); box-shadow: var(--shadow-ctl); padding-left: 16px; }
.request-list { display: grid; }
.request { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 16px 22px; }
.request + .request { border-top: 1px solid var(--line); }
.request .avatar { width: 36px; height: 36px; font-size: var(--text-xs); }
.request-copy { display: grid; gap: 3px; min-width: 0; }
.request-copy strong { font-weight: 600; }
.request-copy small { color: var(--ink-3); font-size: var(--text-sm); }
.request-time { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; font-size: var(--text-sm); color: var(--ink); }
.request-time svg { width: 16px; height: 16px; color: var(--ink-3); }
.request-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tour-lines .right small { display: block; margin-top: 4px; }
@media (max-width: 640px) {
  .request { grid-template-columns: 34px minmax(0, 1fr); padding: 12px 16px; }
  .request-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.showing-card { display: grid; gap: 10px; padding: 18px 20px; border-radius: var(--r-tile); background: var(--surface-2); }
.showing-card.is-requested { background: var(--accent-soft); outline: 2px dashed var(--accent-line); outline-offset: -2px; }
.showing-card.is-confirmed { background: var(--green-soft); }
.showing-card.is-closed { background: var(--surface-3); }
.showing-card .caption { color: var(--ink-3); }
.showing-card.is-requested .caption { color: var(--accent-ink); }
.showing-card.is-confirmed .caption { color: var(--green); }
.showing-time { font-size: var(--text-xl); font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.showing-card .pill { justify-self: start; }
.showing-card p { font-size: var(--text-sm); color: var(--ink-2); line-height: 1.5; max-width: 60ch; }
.showing-card textarea { min-height: 64px; background: var(--surface); }
.showing-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.message-body { white-space: pre-wrap; }
.timeline { display: grid; padding: 6px 22px 12px; }
.timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding: 12px 0; font-size: var(--text-md); }
.timeline li + li { border-top: 1px solid var(--line); }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); margin-top: 6px; justify-self: center; }
.timeline li.is-owner .timeline-dot { background: var(--accent); }
.timeline time { display: block; color: var(--ink-3); font-size: var(--text-sm); margin-top: 2px; }
.timeline-note { margin-top: 6px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); white-space: pre-wrap; }
.contact-lines a { color: var(--accent-ink); font-weight: 600; word-break: break-all; }
.note-form { display: grid; gap: 10px; margin-top: 14px; }
.note-form textarea { min-height: 64px; }
@media (max-width: 640px) { .timeline { padding: 4px 16px 10px; } }

/* Showing hours editor */
.hours { display: grid; gap: 16px; }
.hours-toggle { margin-bottom: 16px; }
.hours-toggle span { color: var(--ink-2); }
.hours-toggle strong { color: var(--ink); }
.hours-settings { align-items: start; }
.hours-day { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.hours-day:last-child { border-bottom: 0; padding-bottom: 4px; }
.hours-day > strong { padding-top: 9px; font-size: var(--text-sm); }
.hours-day-off { color: var(--ink-3); font-size: var(--text-sm); padding: 9px 0; }
.hours-windows { display: grid; gap: 8px; justify-items: start; }
.window-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.window-row select, .window-row input[type="date"] { width: auto; min-height: 40px; padding: 6px 36px 6px 12px; font-size: var(--text-sm); }
.window-row input[type="date"] { padding-right: 12px; }
.window-row .to { color: var(--ink-3); font-size: var(--text-sm); }
.window-remove { width: 34px; height: 34px; }
.window-remove svg { width: 16px; height: 16px; }
.hours-dated { display: grid; gap: 8px; }
.date-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.date-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px 0 12px; border-radius: var(--r-pill); background: var(--surface-3); font-size: var(--text-sm); font-weight: 600; }
.date-chip button { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--ink-3); transition: background .15s var(--ease), color .15s var(--ease); }
.date-chip button:hover { background: var(--surface); color: var(--ink); }
.date-chip svg { width: 14px; height: 14px; }
.blocked-add { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.blocked-add input { width: auto; min-height: 40px; }
.hours-errors ul { display: grid; gap: 4px; }
.hours-actions { padding: 4px 0; }
.hours-status { font-size: var(--text-sm); color: var(--ink-3); }
.hours-remove { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.slot-days { display: grid; gap: 14px; margin-top: 14px; }
.slot-day { display: grid; gap: 8px; }
.slot-day > strong { font-size: var(--text-sm); }
.slot-day > strong small { color: var(--ink-3); font-weight: 500; margin-left: 6px; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface-2); font-size: var(--text-sm); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.slot.is-held { background: var(--accent-soft); color: var(--accent-ink); }
.slot.is-held:hover { background: var(--accent-line); text-decoration: none; }
@media (max-width: 640px) {
  .hours-day { grid-template-columns: 1fr; gap: 6px; padding: 10px 0; }
  .hours-day > strong { padding-top: 0; }
  .hours-actions { flex-direction: column; align-items: stretch; }
  .hours-actions .spacer { display: none; }
  .hours-actions .btn-primary { order: -1; }
}
.data td.when { white-space: nowrap; }
@media (min-width: 641px) { .hours-settings { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.disclosure-body > p.small-copy + .block { margin-top: 14px; }

/* Ledger CSV import: the home-setup flow layout, a mapping grid, line-numbered problems, and one explicit commit box. */
.import-flow .flow-main { display: grid; gap: 16px; }
.import-flow .flow-main > .flow-heading { margin-bottom: 4px; }
.import-flow .upload-zone { margin-bottom: 0; }
.import-flow .flow-actions { margin-top: 6px; flex-wrap: wrap; }
.import-flow .flow-actions .disclosure { flex-basis: 100%; }
.map-grid .field > span small { color: var(--ink-3); font-weight: 500; text-transform: none; letter-spacing: 0; }
.map-grid select[aria-invalid="true"] { border-color: var(--accent-line); background-color: var(--accent-soft); }
.home-map { display: grid; gap: 8px; margin-top: 18px; }
.home-map-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 260px) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.home-map-value { display: grid; min-width: 0; }
.home-map-value strong { font-weight: 600; overflow-wrap: anywhere; }
.home-map-value small { color: var(--ink-3); font-size: var(--text-sm); }
.home-map-row select { min-height: 40px; font-size: var(--text-sm); }
.home-map-row.is-unmatched select { border-color: var(--accent-line); background-color: var(--accent-soft); }
.import-status { margin: 0; }
.import-errors { display: grid; gap: 6px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: var(--text-sm); color: var(--ink-2); }
.import-errors.is-red { background: var(--red-soft); color: var(--red); }
.import-errors strong { font-weight: 700; margin-right: 4px; }
.import-totals { padding: 18px 22px; }
.import-commit { display: grid; gap: 12px; }
.import-commit .form-actions { margin: 0; }
@media (max-width: 640px) {
  .home-map-row { grid-template-columns: 1fr; gap: 6px; }
  .import-totals { padding: 16px; }
  .import-commit .form-actions { flex-direction: column; align-items: stretch; }
  .import-commit .form-actions .spacer { display: none; }
  .import-commit .form-actions .btn-primary { order: -1; }
}

/* Pre-screen questions editor and the self-reported answers block on a lead. */
.pq-form { display: grid; gap: 16px; }
.pq-list { display: grid; gap: 12px; }
.pq { padding: 18px 20px 16px; display: grid; gap: 14px; }
.pq-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pq-grid { align-items: start; }
.pq-required { padding-top: 26px; }
.pq-required span { color: var(--ink-2); }
.pq-required strong { color: var(--ink); }
.pq-options { display: grid; gap: 8px; justify-items: start; }
.pq-option { display: flex; gap: 8px; align-items: center; width: min(100%, 480px); }
.pq-option input { min-height: 40px; }
.pq-remove { width: 34px; height: 34px; flex: none; }
.pq-remove svg { width: 16px; height: 16px; }
.pq-count { align-self: center; }
.pq-errors ul { display: grid; gap: 4px; }
.pq-answer span:first-child small { color: var(--ink-3); font-weight: 500; }
.pq-answer .kv-value { max-width: 40ch; white-space: pre-wrap; }
@media (max-width: 640px) {
  .pq { padding: 16px; }
  .pq-required { padding-top: 0; }
}

/* Loan planner: recorded figures on a sheet, the estimate kept visibly apart from recorded money. */
.loans-lede { margin: -6px 0 12px; max-width: 70ch; }
.loan-card + .loan-card, .loans .btn-row + .disclosure-block { margin-top: 16px; }
.loan-card .sheet-head { flex-wrap: wrap; }
.loan-card .sheet-head .btn + .btn { margin-left: 6px; }
.loan-forecast { margin-top: 18px; padding: 16px 18px; border-radius: var(--r-tile); background: var(--surface-2); display: grid; gap: 12px; }
.loan-forecast-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.loan-forecast-head strong { font-size: var(--text-sm); color: var(--ink-2); }
.loan-forecast .table-wrap { background: var(--surface); border-radius: 14px; }
.loan-forecast .data td, .loan-forecast .data th { font-size: var(--text-sm); }
.loan-forecast .data td:first-child, .loan-forecast .data th:first-child { padding-left: 14px; }
.loan-forecast .data td:last-child, .loan-forecast .data th:last-child { padding-right: 14px; }
.loan-forecast .fin-table-note { margin: 0; }
.loan-form .field small { font-size: var(--text-sm); }
@media (max-width: 640px) { .loan-forecast { padding: 14px; } }
.loan-months th, .loan-months td { white-space: nowrap; }
.loan-summary { margin: 0 0 4px; }
