/* ─── FLAT CARD (shared component) ─── */
flat-card {
  display: block;
  min-width: 0;
}
flat-card > .flat-card {
  height: 100%;
}

.flat-card {
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}
a.flat-card { text-decoration: none; color: inherit; }
.flat-card:hover { transform: translateY(-4px); }
.flat-card.is-selected {
  outline: 2px solid var(--navy-dark);
  outline-offset: 3px;
}
.flat-card--sold { opacity: 0.72; }
.flat-card--sold .flat-tag { background: var(--sold, #8a9199); }

.flat-tag {
  background: var(--navy);
  color: var(--bg);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.flat-tag .rooms { font-weight: 600; text-transform: uppercase; }
.flat-tag .saved { font-weight: 500; opacity: 0.8; }

.flat-plan {
  aspect-ratio: 5/4;
  background: var(--bg);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}
.flat-plan svg,
.flat-plan img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  flex-shrink: 1;
  min-width: 0;
}

.flat-body {
  padding: 28px 28px 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 284px;
  max-height: 284px;
  background: var(--bg-2);
}
.flat-body .area {
  font-size: 44px;
  font-weight: 300;
  color: var(--navy-dark);
  line-height: 1;
  margin-bottom: 14px;
}
.flat-body .area small {
  font-size: 16px;
  color: var(--ink-soft);
  font-weight: 400;
}
.flat-body .specs {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 24px;
  line-height: 1.7;
}
.flat-body .price {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.flat-body .price .val {
  font-size: 22px;
  font-weight: 500;
  color: var(--navy-dark);
}
.flat-body .price .ppm {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.flat-body .arr {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy-dark);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.flat-card:hover .arr { transform: translateX(4px); }

/* compact — боковая панель шахматки */
.flat-card--compact .flat-body {
  min-height: 0;
  max-height: none;
  padding: 20px 20px 22px;
}
.flat-card--compact .flat-body .area { font-size: 36px; margin-bottom: 10px; }
.flat-card--compact .flat-body .specs { margin-bottom: 16px; }
.flat-card--compact .flat-plan { padding: 20px; }
.flat-card--compact:hover { transform: none; }

/* detail panel wrapper on chess page */
.detail-panel {
  position: sticky;
  top: 96px;
  min-width: 0;
}
.detail-panel--empty {
  background: var(--bg-2);
  color: var(--ink-soft);
  border-radius: 4px;
  padding: 48px 24px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.detail-panel--empty .ico {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--navy-mid);
}
.detail-panel__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.detail-panel__actions .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-dark);
  color: var(--bg);
  padding: 16px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: background 0.2s;
  text-align: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.detail-panel__actions .btn-primary:hover { background: var(--navy); }
.detail-panel__actions .btn-ghost {
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  background: var(--bg);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s;
}
.detail-panel__actions .btn-ghost:hover {
  border-color: var(--navy-mid);
  color: var(--navy-dark);
}
.detail-legend {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--bg-2);
  border-radius: 4px;
  border-left: 3px solid var(--navy-mid);
}

@media (max-width: 1200px) {
  .detail-panel { position: static; }
}

@media (max-width: 768px) {
  .flat-plan { padding: 24px; }
  .flat-body { padding: 22px 22px 26px; }
  .flat-body .area { font-size: 36px; }
}
