/* 找物件 — a thread with the composer pinned to the bottom.

   The layout is deliberately the one every agent already knows from ChatGPT:
   conversation scrolls, the box stays put, nothing else competes with either.
   What keeps it from reading as an AI wrapper is what lands in the thread —
   parcels, 地號 and a link out, not paragraphs of generated reasoning. */

.find {
  display: flex;
  flex-direction: column;
  /* dvh, not vh: mobile Safari's collapsing toolbar makes vh taller than the
     visible viewport, which buries the composer under the browser chrome. */
  height: 100dvh;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.find-thread {
  flex: 1;
  overflow-y: auto;
  /* Room for the scrollbar on the right, or it sits on top of the 「看 591」
     buttons and clips them. `stable` keeps the gutter reserved before the thread
     is long enough to scroll, so the list does not shift sideways on the first
     result. */
  padding: 2rem 0.75rem 1.5rem 0;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

/* --- empty state --- */

.find-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60%;
  text-align: center;
}

.find-empty h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.find-empty > p {
  margin: 0 0 2rem;
  color: var(--muted);
}

.find-openers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.find-openers button {
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s;
}

.find-openers button:hover {
  border-color: var(--forest);
  background: var(--soft);
}

/* --- turns --- */

.find-said {
  /* Hug the text. Without this the bubble is a full-width block whatever she
     typed, and a six-character brief reads as an empty grey bar. */
  width: fit-content;
  max-width: 85%;
  margin: 1.75rem 0 0 auto;
  padding: 0.7rem 1rem;
  border-radius: 16px 16px 4px 16px;
  background: var(--mint);
  line-height: 1.6;
  white-space: pre-wrap;
}

.find-answer {
  margin: 1.25rem 0 0;
  line-height: 1.6;
}

.find-working { color: var(--muted); }
.find-error { color: #97402f; }

.find-count {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.find-muted { color: var(--muted); }

.find-note {
  margin: 0 0 0.75rem;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--forest);
  background: var(--soft);
  border-radius: 0 10px 10px 0;
  color: var(--ink);
  font-size: 0.95rem;
}

/* --- results --- */

/* Two answers to two questions, kept apart: what is on the market, and what she
   could go and develop. Nothing links a listing to a specific building below road
   level, so merging them would be a claim we cannot support. */
.find-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.find-h {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.find-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.find-list li {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.find-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.find-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.find-none {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Quiet until wanted. Building a case is the committed action on this screen, but
   it is not what she came for — the list is. */
.find-case {
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.85rem;
  white-space: nowrap;
}

.find-case:hover:not(:disabled) { border-color: var(--forest); color: var(--forest); }
.find-case:disabled { color: var(--muted); cursor: default; }

/* --- the listings themselves --- */

.find-listings {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.find-listing {
  display: flex;
  gap: 0.75rem;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.find-listing:hover { border-color: var(--forest); }

.find-shot {
  flex-shrink: 0;
  width: 5.5rem;
  height: 4.125rem;
  object-fit: cover;
  border-radius: 8px;
  background: var(--soft);
}

.find-listing-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  justify-content: center;
}

/* The price is why she opened the row, so it is the only thing here at full size. */
.find-price {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.find-unit {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.find-listing-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Listing titles are written for 591's own search — emoji, repetition, sales
   language. One line, clipped: enough to recognize, not enough to shout. */
.find-listing-title {
  font-size: 0.85rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.find-all {
  align-self: flex-start;
  font-size: 0.82rem;
  color: var(--forest);
  text-decoration: none;
  padding: 0.15rem 0;
}

.find-all:hover { text-decoration: underline; }

.find-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.find-parcel {
  font-weight: 600;
  font-size: 1.0625rem;
}

.find-meta,
.find-permit {
  color: var(--muted);
  font-size: 0.875rem;
}

.find-link {
  flex-shrink: 0;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--forest);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.find-link:hover {
  border-color: var(--forest);
  background: var(--soft);
}

.find-more {
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  min-height: 2.5rem;
}

/* --- composer --- */

.find-composer {
  flex-shrink: 0;
  padding-bottom: 0.75rem;
  /* The thread scrolls under the composer, so it needs its own ground. */
  background: var(--paper);
}

.find-composer-box {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 2px 12px rgb(20 37 31 / 6%);
}

.find-composer-box:focus-within {
  border-color: var(--forest);
}

.find-composer textarea {
  flex: 1;
  border: 0;
  padding: 0.5rem 0;
  background: none;
  color: var(--ink);
  line-height: 1.5;
  resize: none;
  /* 16px minimum stops iOS Safari zooming the page on focus — she opened this on
     an iPad first, and a viewport that jumps on tap reads as a broken app. */
  font-size: 1rem;
}

.find-composer textarea:focus { outline: none; }

.find-composer button[type='submit'] {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
}

.find-composer button[type='submit']:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: default;
}

.find-foot {
  margin: 0.6rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}

@media (max-width: 32rem) {
  .find { padding: 0 0.875rem; }
  .find-row { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .find-shot { width: 4.5rem; height: 3.375rem; }
  .find-link { text-align: center; }
}
