/**
 * 물건현황 A4 고정 폼 — 미리보기·인쇄 공통
 * (사진 포함 시에도 한 장에 들어가도록 밀도·사진 슬롯을 고정)
 */
.ss-sheet {
  --ss-border: #111;
  --ss-label-bg: #fff;
  --ss-photo-h: 28mm;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 6mm 8mm 7mm;
  background: #fff;
  color: #111;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 9.5px;
  line-height: 1.25;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.ss-sheet *,
.ss-sheet *::before,
.ss-sheet *::after {
  box-sizing: border-box;
}

/* 사진: 고정 슬롯(과도하게 크지 않음). 없으면 영역 접힘 */
.ss-sheet__photoWrap {
  width: 100%;
  height: var(--ss-photo-h);
  margin: 0 0 3mm;
  border: 1px solid var(--ss-border);
  overflow: hidden;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ss-sheet__photoWrap--empty {
  background: #fafafa;
}

.ss-sheet__photoMark {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: rgba(17, 17, 17, 0.18);
  user-select: none;
  pointer-events: none;
  line-height: 1;
}

.ss-sheet__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.ss-sheet__photoWrap--interactive {
  touch-action: none;
  cursor: grab;
}

.ss-sheet__photoWrap--interactive.is-dragging {
  cursor: grabbing;
}

.ss-sheet__photoWrap--interactive.is-zoomed {
  cursor: grab;
}

.ss-sheet__photoTools {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  display: none;
  gap: 4px;
  align-items: center;
}

/* PC에서만 확대 버튼 표시 (모바일은 핀치) */
@media (hover: hover) and (pointer: fine) {
  .ss-sheet__photoWrap--interactive .ss-sheet__photoTools {
    display: flex;
  }
}

.ss-sheet__photoBtn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  padding: 0;
}

.ss-sheet__photoBtn:hover {
  background: #fff;
  border-color: #2563eb;
  color: #2563eb;
}

.ss-sheet--editable [data-ss-field] {
  cursor: text;
  outline: none;
  min-height: 1.15em;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.ss-sheet--editable [data-ss-field]:hover {
  background: rgba(37, 99, 235, 0.06);
}

.ss-sheet--editable [data-ss-field].is-editing,
.ss-sheet--editable [data-ss-field]:focus {
  background: #eff6ff;
  box-shadow: inset 0 0 0 1.5px #2563eb;
}

.ss-sheet--editable .ss-sheet__title[data-ss-field]:hover,
.ss-sheet--editable .ss-sheet__title[data-ss-field].is-editing,
.ss-sheet--editable .ss-sheet__title[data-ss-field]:focus {
  letter-spacing: 0.45em;
}

.ss-sheet--editable .ss-notes[data-ss-field] {
  min-height: 28px;
  vertical-align: top;
  text-align: left;
}

.ss-sheet__title {
  margin: 0 0 2.5mm;
  text-align: center;
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: 0.45em;
  line-height: 1.15;
}

.ss-sheet table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1.25px solid var(--ss-border);
}

.ss-sheet th,
.ss-sheet td {
  border: 1px solid var(--ss-border);
  padding: 2.5px 4px;
  vertical-align: middle;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.ss-sheet .ss-label {
  width: 16%;
  text-align: center;
  font-weight: 700;
  background: var(--ss-label-bg);
  white-space: nowrap;
  font-size: 9px;
}

.ss-sheet .ss-val {
  text-align: center;
  font-weight: 500;
  min-height: 1.2em;
}

.ss-sheet .ss-val--left {
  text-align: left;
  padding-left: 6px;
}

.ss-sheet .ss-val--strong {
  font-size: var(--fs-xs);
  font-weight: 800;
}

.ss-sheet__info {
  margin-bottom: 2.5mm;
}

.ss-sheet__leaseHead {
  display: flex;
  align-items: baseline;
  justify-content: center;
  position: relative;
  margin: 0 0 1.5mm;
  min-height: 1.2em;
}

.ss-sheet__leaseTitle {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.18em;
}

.ss-sheet__leaseUnit {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 600;
  color: #222;
}

.ss-sheet__lease {
  margin-bottom: 2.5mm;
}

.ss-sheet__lease thead th {
  text-align: center;
  font-weight: 700;
  padding: 2px 3px;
  font-size: 9px;
}

.ss-sheet__lease .ss-col-floor {
  width: 12%;
}
.ss-sheet__lease .ss-col-struct {
  width: 18%;
}
.ss-sheet__lease .ss-col-dep,
.ss-sheet__lease .ss-col-mon,
.ss-sheet__lease .ss-col-maint {
  width: 12%;
}
.ss-sheet__lease .ss-col-etc {
  width: 22%;
}

.ss-sheet__lease tbody td {
  height: 16px;
  text-align: center;
  padding: 1.5px 3px;
}

.ss-sheet__lease .ss-total td {
  font-weight: 700;
}

.ss-sheet__summary {
  margin-bottom: 2mm;
}

.ss-sheet__summary .ss-label {
  width: 14%;
}

.ss-sheet__summary .ss-notes {
  width: 36%;
  vertical-align: top;
  background: #fff;
}

.ss-sheet__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5mm;
  font-size: 10px;
  font-weight: 600;
  color: #222;
}

/* 모달 미리보기: 사진 선택 바 (인쇄 제외) */
.ss-photoBar {
  flex-shrink: 0;
  display: none;
  gap: 8px;
  padding: 10px 14px 0;
  overflow-x: auto;
  background: #d1d5db;
  -webkit-overflow-scrolling: touch;
}

.share-preview-modal--print .ss-photoBar {
  display: flex;
  align-items: center;
}

.ss-photoBar__label {
  flex-shrink: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.ss-photoBar__item {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  padding: 0;
  background: #fff;
  cursor: pointer;
}

.ss-photoBar__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ss-photoBar__item.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb;
}

.ss-photoBar__none {
  flex-shrink: 0;
  height: 52px;
  min-width: 64px;
  padding: 0 10px;
  border: 2px solid #9ca3af;
  border-radius: 6px;
  background: #f3f4f6;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
}

.ss-photoBar__none.is-selected {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}

.share-preview-modal--print .share-preview-modal__iframe {
  display: none !important;
}

.share-preview-modal--print .ss-sheetMount {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
}

.ss-sheetMount {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }

  body.ss-print-body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body.ss-print-body .ss-sheet {
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: visible !important;
    --ss-photo-h: 26mm;
  }

  body.ss-print-body .ss-sheet__photoWrap {
    height: var(--ss-photo-h);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.ss-print-body .ss-sheet__photo {
    width: 100%;
    height: 100%;
    max-height: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
