.detail > .scroll { flex: 1; min-height: 0; }

.hero {
  position: relative;
  height: min(78vw, 46vh, 420px);
  margin-top: var(--safe-top);
}

.hero .badges { top: 12px; left: 12px; }
.hero-bone { height: 100%; border-radius: 0; }

.detail-back {
  position: absolute;
  z-index: 2;
  top: calc(var(--safe-top) + 10px);
  left: calc(var(--safe-left) + 10px);
}

.detail:has(.detail-back) .hero .badges { left: 64px; top: 20px; }

.detail-title,
.block {
  margin: 10px 12px 0;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface);
}

.detail-title .price strong { font-size: 28px; }

.detail-title h2 {
  margin: 6px 0 2px;
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0 10px;
}

.tile {
  padding: 9px 4px;
  border-radius: 12px;
  background: var(--fill);
  text-align: center;
}

.tile b {
  display: block;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-title { overflow-wrap: anywhere; }
.detail-title .send { width: 100%; margin-top: 12px; }
.tile small { color: var(--muted); font-size: 12px; }

.footnote { color: var(--muted); font-size: 12px; }
.block > .footnote { margin-top: 9px; }
.block h3 { margin-bottom: 10px; font-size: 18px; }
.detail-main { padding-bottom: 14px; }

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 12px 0;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--fill);
  font-size: 14px;
}

.banner.warning { background: var(--maybe-bg); color: var(--maybe); }

.state-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
}

.state-icon .icon { width: 15px; height: 15px; stroke-width: 2.8; }

.wish-list li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
}

.wish-list li:first-child { padding-top: 0; }
.wish-list li:last-child { padding-bottom: 0; }
.wish-list li + li { border-top: 1px solid var(--line); }
.wish-text { flex: 1; min-width: 0; font-size: 15px; }

.wish-text small,
.wish-text q {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.wish-text q { font-style: italic; quotes: "«" "»"; }
.state-word { flex: none; color: var(--state); font-size: 14px; font-weight: 700; }
.state-word.unknown { font-weight: 500; }

.household {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 8px;
}

.household li { display: flex; align-items: center; gap: 9px; min-width: 0; }
.household li > div { min-width: 0; }
.household li span:not(.state-icon) { display: block; font-size: 14px; line-height: 1.2; }
.household li.unknown > div span { color: var(--muted); }
.household small { display: block; color: var(--state); font-size: 12px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.tags span { padding: 5px 10px; border-radius: 9px; background: var(--fill); font-size: 13px; }

.description {
  font-size: 15px;
  line-height: 1.47;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  user-select: text;
}

.description.collapsed {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
}

.description-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.description-note:empty { display: none; }

.facts > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  font-size: 14px;
}

.facts > div + div { border-top: 1px solid var(--line); }
.facts dt { flex: none; color: var(--muted); }
.facts dd { min-width: 0; text-align: right; overflow-wrap: anywhere; }

.history li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
}

.history li + li { border-top: 1px solid var(--line); }
.history time,
.history li > span { color: var(--muted); }
.history li > .fell { color: var(--yes); font-weight: 600; }
.history li > .rose { color: var(--no); font-weight: 600; }
.history b { min-width: 72px; text-align: right; }

.action-bar {
  display: flex;
  flex: none;
  gap: 8px;
  padding: 8px 12px calc(var(--safe-bottom) + 8px);
  background: var(--bar);
  border-top: 1px solid var(--line);
}

.action-bar:empty { display: none; }
.action-bar .icon-button { width: 48px; height: 48px; border-radius: 14px; }
.action-bar .like.on { color: #f0435c; }
.action-bar .like .icon { width: 28px; height: 28px; }
.action-bar .button { flex: 1; min-width: 0; white-space: nowrap; }

/* Fullscreen photos */

.gallery { background: #000; color: #fff; }
.gallery .carousel { background: #000; }
.gallery .slide img { object-fit: contain; }

.gallery .counter {
  top: calc(var(--safe-top) + 18px);
  right: auto;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
}

.gallery .arrow { opacity: 1; }
.gallery .zooming .track { overflow: hidden; }
.gallery .zooming .arrow { display: none; }
.gallery .slide.zoomed { display: block; overflow: auto; }
.gallery .slide.zoomed img { display: block; width: 250%; max-width: none; height: 250%; }

.gallery-button {
  position: absolute;
  z-index: 4;
  top: calc(var(--safe-top) + 8px);
  background: rgba(40, 40, 44, .75);
  color: #fff;
}

.gallery-close { right: calc(var(--safe-right) + 8px); }
.gallery-zoom { left: calc(var(--safe-left) + 8px); }
