/* 사진: 폴라로이드 앨범, 전체화면 사진 뷰어 (ledger.css에서 분리) */

/* ── 폴라로이드 사진 앨범 ── */
.tl-photos {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 0 4px;
}
.tl-photos:empty { display: none; padding: 0; }
.tl-note-wrap { margin-top: 8px; }
.tl-note {
  width: 100%;
  min-height: 52px;
  resize: none;
  field-sizing: content;
  overflow: hidden;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1.5px dashed var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.45;
  outline: none;
}
.tl-note-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.tl-note-row .tl-note { flex: 1; min-width: 0; width: auto; }
.tl-ai-btn {
  flex-shrink: 0;
  width: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  color: var(--accent2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.tl-ai-btn:active { background: var(--accent-bg); }
.tl-ai-btn:disabled { opacity: 0.35; cursor: default; }
.tl-ai-btn[hidden] { display: none !important; }
.tl-note:focus {
  border-style: solid;
  border-color: rgba(124,58,237,0.45);
  background: var(--surface);
}
.tl-note::placeholder { color: var(--text3); font-weight: 500; }
:root[data-theme="light"] .tl-note { background: rgba(0,0,0,0.03); }

.polaroid {
  position: relative;
  background: #fff;
  padding: 5px 5px 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4), 0 1px 4px rgba(0,0,0,0.2);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(.17,.67,.35,1.3), box-shadow 0.2s;
  transform-origin: bottom center;
}
.polaroid:hover {
  transform: rotate(0deg) scale(1.18) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 30;
  position: relative;
}
.polaroid img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  display: block;
}
.polaroid-del {
  position: absolute;
  top: -6px; right: -6px;
  width: 22px; height: 22px;
  background: var(--red);
  border-radius: 50%;
  border: none;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 1;
  z-index: 5;
}
.polaroid-del:hover { background: #c00; }

.tl-card-amt-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tl-card-amt-col {
  flex: 1;
  min-width: 0;
}

.tl-photo-add {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 2px dashed var(--border2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tl-photo-add:hover { border-color: var(--accent2); color: var(--accent2); }

/* ── 사진 뷰어 ── */
.photo-viewer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}
.photo-viewer.open { display: flex; }

.pv-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #1c0a40 0%, #0f1a4a 45%, #1a0d3d 100%);
}
:root[data-theme="light"] .pv-bg {
  background: linear-gradient(145deg, #ede0ff 0%, #fce8f3 45%, #dff0ff 100%);
}

.pv-header {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: max(52px, env(safe-area-inset-top, 52px)) 48px 0;
  pointer-events: none;
}
.pv-info-meta {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.pv-info-cat {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.01em;
}
.pv-info-detail {
  font-weight: 400;
  color: rgba(255,255,255,0.70);
}
:root[data-theme="light"] .pv-info-meta  { color: rgba(30,10,70,0.50); }
:root[data-theme="light"] .pv-info-cat   { color: rgba(30,10,70,0.88); }
:root[data-theme="light"] .pv-info-detail{ color: rgba(30,10,70,0.55); }

.pv-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top, 16px));
  right: 16px;
  z-index: 10;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  border: none;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
:root[data-theme="light"] .pv-close { color: #333; background: rgba(0,0,0,0.12); }

.pv-stage {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pv-polaroid {
  background: #fff;
  padding: 10px 10px 42px;
  box-shadow:
    0 24px 60px rgba(0,0,0,0.55),
    0 6px 20px rgba(0,0,0,0.3),
    0 1px 4px rgba(0,0,0,0.2);
  transform-origin: center bottom;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.pv-polaroid img {
  display: block;
  width: min(calc(100vw - 20px), calc(100svh - 230px));
  height: min(calc(100vw - 20px), calc(100svh - 230px));
  object-fit: contain;
  background: #000;
}
.pv-caption {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  text-align: center;
  font-size: 12px;
  color: #aaa;
  letter-spacing: 0.5px;
  font-family: Georgia, serif;
}

.pv-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  border: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.15s;
}
.pv-nav:hover { background: rgba(255,255,255,0.30); }
.pv-nav:active { transform: translateY(-50%) scale(0.9); }
.pv-nav--prev { left: 12px; }
.pv-nav--next { right: 12px; }
:root[data-theme="light"] .pv-nav { color: #333; background: rgba(0,0,0,0.10); }

.pv-dots {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 7px;
  align-items: center;
  height: 16px;
}
.pv-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all 0.25s;
  border: none;
}
.pv-dot.active {
  width: 22px;
  border-radius: 4px;
  background: rgba(255,255,255,0.9);
}
:root[data-theme="light"] .pv-dot        { background: rgba(80,40,160,0.25); }
:root[data-theme="light"] .pv-dot.active { background: var(--accent); }
