/* Idea 90 — objects & floor plans (variant D) */

.sites-page-d {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.sites-d {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 1100px) {
  .sites-d {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sites-d {
    grid-template-columns: 1fr;
  }
}

.scard-d {
  background: var(--d-card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.scard-d__link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.scard-d__link:focus-visible {
  outline: var(--d-focus-ring);
  outline-offset: 3px;
}

.scard-d__top {
  height: 140px;
  background: var(--d-soft);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.scard-d__top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scard-d__top .plan-glyph {
  height: 100px;
  width: auto;
}

.scard-d__body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.scard-d__body h2 {
  font: var(--w-display2) 19px var(--font-display);
  letter-spacing: -0.02em;
  margin: 0;
}

.scard-d__meta {
  font-size: 13px;
  color: var(--d-muted);
}

.scard-d__tools {
  display: flex;
  gap: 8px;
  padding: 0 18px 14px;
  margin-top: auto;
}

.scard-d__confirm {
  margin: 0 18px 14px;
}

.site-d__side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* Превью плана — как в макете (SVG ~380px), не полный размер JPG */
.scan-d {
  overflow: auto;
  max-height: min(72vh, 560px);
}

.scan-d img,
.scan-d__img {
  width: 100%;
  max-height: min(68vh, 520px);
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}

/* Схема делит бокс скана: стены и дуги дверей лежат на том же листе. */
.scan-d__sheet {
  display: grid;
  width: fit-content;
  max-width: 100%;
  line-height: 0;
}

.scan-d__sheet > .scan-d__img,
.scan-d__sheet > .scan-d__scheme {
  grid-area: 1 / 1;
  min-width: 0;
  min-height: 0;
}

.scan-d__sheet > .scan-d__img {
  width: auto;
  max-width: 100%;
  justify-self: start;
}

.scan-d__scheme {
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
}

.scan-d__scheme svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.scan-d__scheme-label {
  position: absolute;
  z-index: 1;
  font: 600 15px/1.2 var(--font-display);
  color: var(--d-ink);
  letter-spacing: -0.01em;
  text-shadow: 0 0 6px #fff, 0 0 2px #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  .scan-d__scheme-label {
    font-size: 12px;
  }
}

.sites-page-d .scan-d .ai-d {
  z-index: 2;
}

.sites-page-d .site-delete-d {
  margin-top: 4px;
  font-size: 14px;
}

.sites-page-d .site-delete-d__summary {
  cursor: pointer;
  color: var(--d-primary);
  font-weight: 600;
  list-style: none;
  padding: 4px 0;
}

.sites-page-d .site-delete-d__summary::-webkit-details-marker {
  display: none;
}

.scan-d__empty {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  color: var(--d-muted);
  font-size: 14px;
}

.found-rooms-d .cb-d {
  color: var(--d-ok);
  font-weight: 700;
  font-size: 14px;
}

.found-rooms-d button.cb-d {
  border: 0;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  font-weight: 700;
  font-size: 14px;
}

.found-rooms-d button.cb-d.no {
  color: transparent;
}

.found-rooms-d button.cb-d:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.found-rooms-d button.cb-d.no:focus-visible {
  box-shadow: inset 0 0 0 2px var(--d-line), var(--focus-ring);
}

.site-plan-actions-d {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.site-plan-actions-d .btn {
  flex: 1;
}

.site-plan-actions-d .btn-primary {
  flex: 2;
}

.sites-page-d .card-h-d h3 {
  margin: 0;
  font: var(--w-display2) 18px var(--font-display);
  letter-spacing: -0.02em;
}

.sites-page-d .hint-d {
  font-size: 13px;
  color: var(--d-muted);
}

.site-projects-d {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

.site-projects-d li {
  padding: 10px 0;
  border-top: 1px solid var(--d-line-soft);
}

.site-projects-d li:first-child {
  border-top: 0;
}

.site-projects-d a {
  font-weight: 600;
  color: var(--d-primary);
  text-decoration: none;
}

.site-projects-d a:hover {
  text-decoration: underline;
}

.site-projects-d span {
  display: block;
  color: var(--d-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* Forms — kind toggles as D segments */
.sites-form-d .site-kind-toggle {
  display: inline-flex;
  background: var(--d-soft);
  border-radius: calc(var(--r-input) + 2px);
  padding: 4px;
  gap: 4px;
  border: 0;
}

.sites-form-d .site-kind-btn {
  padding: 9px 16px;
  border-radius: var(--r-input);
  font-size: 14px;
  color: var(--d-muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.sites-form-d .site-kind-btn.is-active {
  background: var(--d-card);
  color: var(--d-ink);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(15, 30, 46, 0.08);
}

.sites-form-d .field label,
.sites-form-d .field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--d-ink-2);
  margin-bottom: 7px;
}

.sites-form-d .input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font: 500 16px var(--font-body);
  border: var(--input-border);
  background-color: var(--input-bg);
  border-radius: var(--r-input);
  padding: 13px 14px;
  color: var(--d-ink);
}

.sites-form-d .site-plans-title {
  font: var(--w-display2) 18px var(--font-display);
  margin: 24px 0 8px;
}
