#dmbs-breeding-root * { box-sizing: border-box; }
/* v3.1.98: override legacy external margin-top:130px — header offset is now fully handled by legal.js */
/* v3.1.117: touch-action: pan-x pan-y → 앱 내부 핀치줌 차단 (스크롤은 정상) */
/* v3.1.120: pan-y 만 허용 → 핀치줌 + 좌우 팬 차단. 가로 스크롤 필요한 자식은 각자 pan-x 지정 */
#dmbs-breeding-root { font-family: 'Malgun Gothic', -apple-system, sans-serif; background: #f2f2f2; color: #2d2a24; border-radius:10px; overflow:clip; max-width: 1140px; margin-left: auto; margin-right: auto; margin-top: 0 !important; touch-action: pan-y; overscroll-behavior-x: none; }
/* v3.1.99: 2-row nav layout — utility row (top, non-sticky) + tabs row (bottom, sticky) */
#dmbs-breeding-root .dmbs-nav-utility {
  background: #f2f2f2;
  padding: 6px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x; /* v3.1.120: 자체 가로 스크롤 허용 */
}
#dmbs-breeding-root .dmbs-nav-utility::-webkit-scrollbar { display: none; }
#dmbs-breeding-root nav { background: #f2f2f2; border-bottom: 1px solid #e0dccf; padding: 0 8px; display:flex; gap: 0; flex-wrap:nowrap; align-items:center; overflow-x:auto; position:sticky; top:0; z-index:15; scrollbar-width:none; -ms-overflow-style:none; touch-action: pan-x; /* v3.1.120 */ }
#dmbs-breeding-root nav::-webkit-scrollbar { display:none; }
#dmbs-breeding-root .dmbs-date-label { font-size:12px; color:#3d5c3a; font-weight:600; padding:0 10px 0 0; white-space:nowrap; flex-shrink:0; }
#dmbs-breeding-root nav button { background:none; border:none; padding: 12px 9px; cursor:pointer; font-size:13px; color:#666; border-bottom: 3px solid transparent; white-space:nowrap; flex-shrink:0; }
#dmbs-breeding-root nav button.active { color:#3d5c3a; border-bottom-color:#3d5c3a; font-weight:600; }
#dmbs-breeding-root main { padding: 20px; }
#dmbs-breeding-root .card { background:#fff; border-radius:10px; padding:18px; margin-bottom:14px; box-shadow:0 1px 3px rgba(0,0,0,0.05); }
#dmbs-breeding-root .task { display:flex; align-items:center; gap:12px; padding:12px; border-bottom:1px solid #f0ede4; }
#dmbs-breeding-root .task:last-child { border-bottom: none; }
#dmbs-breeding-root .task input[type=checkbox] { width:22px; height:22px; cursor:pointer; accent-color:#3d5c3a; }
#dmbs-breeding-root .task .info { flex:1; }
#dmbs-breeding-root .task .animal { font-weight:600; color:#3d5c3a; }
#dmbs-breeding-root .task .type { display:inline-block; padding:2px 8px; border-radius:4px; font-size:12px; margin-left:6px; background:#e8f0e5; color:#3d5c3a; }
#dmbs-breeding-root .task .type.feed { background:#fff4dc; color:#8a6a1f;}
#dmbs-breeding-root .task .type.egg { background:#fde8e8; color:#8a2f2f;}
#dmbs-breeding-root .task .type.hatch { background:#e5ecf7; color:#2f4f8a;}
#dmbs-breeding-root .task .type.weigh { background:#ece5f7; color:#5a2f8a;}
#dmbs-breeding-root .task .type.other { background:#eee; color:#555;}
#dmbs-breeding-root .task .note { font-size:12px; color:#888; margin-top:2px; }
#dmbs-breeding-root .task .overdue { white-space: nowrap; display: inline-block; }
#dmbs-breeding-root .task.done .info { text-decoration: line-through; opacity: 0.5; }
#dmbs-breeding-root .empty { text-align:center; color:#999; padding:40px 20px; }
#dmbs-breeding-root button.primary { background:#3d5c3a; color:#fff; border:none; padding:10px 18px; border-radius:6px; cursor:pointer; font-size:14px; }
#dmbs-breeding-root button.primary:hover { background:#2f4a2c; }
#dmbs-breeding-root button.danger { background:none; border:none; color:#c33; cursor:pointer; font-size:12px; }
#dmbs-breeding-root form { display:grid; gap:10px; }
#dmbs-breeding-root form label { font-size:13px; color:#555; display:block; margin-bottom:4px; }
#dmbs-breeding-root form input, #dmbs-breeding-root form select, #dmbs-breeding-root form textarea { width:100%; padding:8px 10px; border:1px solid #d4cfc0; border-radius:6px; font-size:14px; font-family:inherit; }
#dmbs-breeding-root form .row { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
#dmbs-breeding-root h3 { color:#3d5c3a; font-size:18px; margin-top:0; }
#dmbs-breeding-root h4 { font-size:15px; color:#555; margin: 18px 0 8px; }
/* v3.1.114: 접었다 폈다 하는 섹션 (details) — h4 와 같은 스타일 */
#dmbs-breeding-root details.dmbs-sec { margin: 18px 0 8px; border: none; padding: 0; }
#dmbs-breeding-root details.dmbs-sec > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: 0 -10px 4px;
  border-radius: 6px;
  user-select: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0.05);
  transition: background 0.12s ease;
}
#dmbs-breeding-root details.dmbs-sec > summary::-webkit-details-marker { display: none; }
#dmbs-breeding-root details.dmbs-sec > summary:hover { background: #f5f2ee; }
#dmbs-breeding-root details.dmbs-sec > summary::before {
  content: '▶';
  font-size: 10px;
  color: #888;
  transition: transform 0.18s ease;
  display: inline-block;
  flex-shrink: 0;
}
#dmbs-breeding-root details.dmbs-sec[open] > summary::before { transform: rotate(90deg); }
#dmbs-breeding-root details.dmbs-sec .dmbs-sec-title {
  font-size: 15px;
  color: #555;
  font-weight: 700;
}
#dmbs-breeding-root .animal-item, #dmbs-breeding-root .schedule-item, #dmbs-breeding-root .clutch-item { padding:10px 12px; background:#fafaf5; border-radius:6px; margin-bottom:6px; display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap;}
#dmbs-breeding-root .schedule-item .meta, #dmbs-breeding-root .clutch-item .meta { font-size:12px; color:#888; }
#dmbs-breeding-root .tag { display:inline-block; padding:2px 8px; border-radius:4px; font-size:11px; background:#e8f0e5; color:#3d5c3a; margin-right:4px; }
#dmbs-breeding-root .dday { font-weight:700; color:#c77; font-size:14px; }
#dmbs-breeding-root .dday.soon { color:#c33; }
#dmbs-breeding-root .dday.due { color:#3d5c3a; background:#e8f0e5; padding:2px 8px; border-radius:4px;}
#dmbs-breeding-root table { width:100%; border-collapse:collapse; font-size:13px; }
#dmbs-breeding-root th, #dmbs-breeding-root td { padding:8px; text-align:left; border-bottom:1px solid #f0ede4; }
#dmbs-breeding-root th { background:#fafaf5; color:#555; font-weight:600; }
#dmbs-breeding-root select.filter { padding:6px 10px; border:1px solid #d4cfc0; border-radius:6px; font-size:13px; margin-bottom:10px; }
#dmbs-breeding-root .chart { background:#fafaf5; border-radius:8px; padding:12px; }
#dmbs-breeding-root .morph-grid { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0 4px; }
#dmbs-breeding-root .morph-chip { display:inline-flex; align-items:center; gap:4px; padding:4px 10px; border:1px solid #d4cfc0; border-radius:999px; font-size:12px; cursor:pointer; background:#fafaf5; white-space:nowrap; }
#dmbs-breeding-root .morph-chip input { margin:0; width:auto !important; flex:none; }
#dmbs-breeding-root .morph-chip em { color:#888; font-style:normal; font-size:11px; }
#dmbs-breeding-root .morph-chip:has(input:checked) { background:#c8e85c; border-color:#3d5c3a; color:#000; }
#dmbs-breeding-root .tag.species { background:#e8f0e5; color:#3d5c3a; }
#dmbs-breeding-root .tag.sex-F { background:#fde2e7; color:#a8324e; }
#dmbs-breeding-root .tag.sex-M { background:#d6e7fa; color:#1f4b8a; }
#dmbs-breeding-root .tag.sex-U { background:#efefef; color:#555; }
#dmbs-breeding-root .pair-item { display:flex; justify-content:space-between; align-items:flex-start; padding:12px; background:#fdf7fa; border:1px solid #f2d7e1; border-radius:8px; margin:6px 0; gap:8px; flex-wrap:wrap; }
#dmbs-breeding-root .pair-item .meta { color:#888; font-size:12px; margin-top:4px; }
#dmbs-breeding-root .photo-gallery { display:flex; flex-wrap:nowrap; gap:8px; margin:8px 0; overflow-x:auto; overflow-y:hidden; padding-bottom:2px; max-width:100%; min-width:0; -webkit-overflow-scrolling:touch; scrollbar-width:thin; touch-action: pan-x; /* v3.1.120 */ }
#dmbs-breeding-root .animal-item > div { min-width:0; max-width:100%; }
#dmbs-breeding-root .photo-thumb { position:relative; display:block; width:100px; flex:none; border:1px solid #e5e0d0; border-radius:6px; overflow:hidden; background:#fff; text-decoration:none; color:inherit; }
#dmbs-breeding-root .photo-thumb img { width:100%; height:80px; object-fit:cover; display:block; }
#dmbs-breeding-root .photo-meta { font-size:10px; color:#666; padding:3px 4px; text-align:center; background:#fafaf5; }
#dmbs-breeding-root .photo-del { position:absolute; top:2px; right:2px; background:rgba(200,60,60,0.85); color:#fff; border:none; border-radius:50%; width:20px; height:20px; cursor:pointer; font-size:12px; line-height:1; padding:0; }
#dmbs-breeding-root .photo-pager { display:flex; flex-wrap:wrap; align-items:center; gap:4px; margin:0 0 8px; }
#dmbs-breeding-root .photo-page-btn { min-width:28px; height:28px; padding:0 8px; border:1px solid #c8c2ad; background:#fff; border-radius:4px; cursor:pointer; font-size:12px; color:#444; }
#dmbs-breeding-root .photo-page-btn:hover { background:#f0ebdc; }
#dmbs-breeding-root .photo-page-btn.active { background:#3d5c3a; color:#fff; border-color:#3d5c3a; font-weight:600; }
#dmbs-breeding-root .photo-pager-count { margin-left:6px; color:#888; font-size:11px; }
/* v3.1.110: 사진 개수 뱃지 (가로 스크롤 + 4장 이상일 때만 표시) */
#dmbs-breeding-root .photo-count-badge { display:inline-block; margin:4px 0 6px; color:#888; font-size:11px; padding:2px 10px; background:#f5f2ee; border-radius:999px; font-weight:500; }
#dmbs-breeding-root #inbreedWarn:not(:empty) { background:#fff3cd; border:1px solid #e6c200; color:#8a6d00; padding:10px; border-radius:6px; margin:6px 0; font-size:13px; }

/* === v3.1.67: Photo lightbox (fullscreen overlay, appended to body, not scoped to root) === */
/* v3.1.117: touch-action: pinch-zoom → 라이트박스에서 사진 핀치줌 허용 (네이티브 viewport zoom 사용) */
.dmbs-lightbox { position:fixed; inset:0; z-index:99999; background:rgba(0,0,0,0.92); display:none; align-items:center; justify-content:center; user-select:none; -webkit-tap-highlight-color:transparent; touch-action:pinch-zoom; overscroll-behavior:contain; }
.dmbs-lightbox.open { display:flex; }
.dmbs-lightbox .dmbs-lb-stage { max-width:92vw; max-height:90vh; display:flex; flex-direction:column; align-items:center; gap:10px; }
.dmbs-lightbox .dmbs-lb-img { max-width:92vw; max-height:82vh; object-fit:contain; display:block; box-shadow:0 6px 28px rgba(0,0,0,0.6); border-radius:4px; background:#222; }
.dmbs-lightbox .dmbs-lb-caption { color:#fff; font-size:14px; text-align:center; max-width:90vw; padding:4px 12px; line-height:1.4; text-shadow:0 1px 2px rgba(0,0,0,0.6); }
.dmbs-lightbox .dmbs-lb-close,
.dmbs-lightbox .dmbs-lb-prev,
.dmbs-lightbox .dmbs-lb-next { position:absolute; background:rgba(255,255,255,0.15); color:#fff; border:none; cursor:pointer; border-radius:50%; transition:background .15s ease, transform .15s ease; padding:0; -webkit-tap-highlight-color:transparent; font-family:inherit; }
.dmbs-lightbox .dmbs-lb-close:hover,
.dmbs-lightbox .dmbs-lb-prev:hover,
.dmbs-lightbox .dmbs-lb-next:hover { background:rgba(255,255,255,0.28); }
.dmbs-lightbox .dmbs-lb-close:active,
.dmbs-lightbox .dmbs-lb-prev:active,
.dmbs-lightbox .dmbs-lb-next:active { transform:scale(0.92); }
.dmbs-lightbox .dmbs-lb-close { top: calc(env(safe-area-inset-top, 0px) + 16px); right: calc(env(safe-area-inset-right, 0px) + 16px); width:44px; height:44px; font-size:22px; line-height:1; }
.dmbs-lightbox .dmbs-lb-prev,
.dmbs-lightbox .dmbs-lb-next { top:50%; transform:translateY(-50%); width:54px; height:54px; font-size:36px; line-height:1; }
.dmbs-lightbox .dmbs-lb-prev:active,
.dmbs-lightbox .dmbs-lb-next:active { transform:translateY(-50%) scale(0.92); }
.dmbs-lightbox .dmbs-lb-prev { left:12px; }
.dmbs-lightbox .dmbs-lb-next { right:12px; }
.dmbs-lightbox .dmbs-lb-counter { position:absolute; bottom:16px; left:50%; transform:translateX(-50%); color:#fff; font-size:13px; background:rgba(0,0,0,0.35); padding:4px 12px; border-radius:12px; pointer-events:none; }
/* v3.1.109: 업로드 완료 토스트 — 깔끔한 pill 디자인, 자동 dismiss */
.dmbs-save-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(160%);
  z-index: 99998;
  background: #1f1d18;
  color: #fff;
  border-radius: 999px;
  padding: 10px 10px 10px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  font-family: 'Malgun Gothic', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 10px 32px rgba(0,0,0,0.45);
  max-width: calc(100vw - 24px);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.28s ease;
  opacity: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dmbs-save-toast.open { transform: translateX(-50%) translateY(0); opacity: 1; }
.dmbs-save-toast-msg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}
.dmbs-save-toast-check {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
.dmbs-save-toast-btn {
  background: #c8e85c;
  color: #1a1a1a;
  border: none;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.1s ease;
}
.dmbs-save-toast-btn:hover { background: #b5d04a; }
.dmbs-save-toast-btn:active { transform: scale(0.96); }
@media (max-width: 480px) {
  .dmbs-save-toast { padding: 9px 9px 9px 20px; font-size: 14px; gap: 12px; bottom: 20px; }
  .dmbs-save-toast-msg { font-size: 14px; }
  .dmbs-save-toast-btn { padding: 9px 18px; font-size: 14px; }
}

/* v3.1.112: 라이트박스 공유 버튼 — 큼직한 pill, 하단 중앙, 강한 그림자 */
.dmbs-lightbox .dmbs-lb-actions {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 2;
}
.dmbs-lightbox .dmbs-lb-share {
  background: #c8e85c;
  color: #1a1a1a;
  border: none;
  padding: 20px 56px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.2s ease;
  font-family: inherit;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  letter-spacing: 0.02em;
}
.dmbs-lightbox .dmbs-lb-share:hover { background: #b5d04a; box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
.dmbs-lightbox .dmbs-lb-share:active { transform: scale(0.96); }
/* v3.4.7: iOS safe-area 보정 — 시계/배터리/노치 영역 침범 방지 */
@media (max-width: 540px) {
  .dmbs-lightbox .dmbs-lb-counter {
    bottom: auto;
    top: calc(env(safe-area-inset-top, 0px) + 16px);
    left: calc(env(safe-area-inset-left, 0px) + 16px);
    transform: none;
  }
  .dmbs-lightbox .dmbs-lb-actions { bottom: calc(env(safe-area-inset-bottom, 0px) + 30px); }
  .dmbs-lightbox .dmbs-lb-share { padding: 18px 48px; font-size: 18px; }
}
@media (max-width:600px){
  .dmbs-lightbox .dmbs-lb-close {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: calc(env(safe-area-inset-right, 0px) + 10px);
    width:40px; height:40px; font-size:20px;
  }
  .dmbs-lightbox .dmbs-lb-prev,
  .dmbs-lightbox .dmbs-lb-next { width:44px; height:44px; font-size:30px; }
  .dmbs-lightbox .dmbs-lb-prev { left: calc(env(safe-area-inset-left, 0px) + 6px); }
  .dmbs-lightbox .dmbs-lb-next { right: calc(env(safe-area-inset-right, 0px) + 6px); }
  .dmbs-lightbox .dmbs-lb-caption { font-size:13px; }
}

/* === v3.1.70: PWA Install Prompt bar & iOS instructions modal === */
.dmbs-install-bar { position:fixed; left:50%; transform:translate(-50%,140%); bottom:16px; z-index:9998; width:min(520px, calc(100vw - 24px)); display:flex; align-items:center; gap:10px; background:#ffffff; color:#2c2c2c; border:1px solid #e0d8c0; border-radius:14px; box-shadow:0 6px 24px rgba(0,0,0,0.14); padding:10px 12px; font:inherit; transition:transform .3s ease, opacity .3s ease; opacity:0; pointer-events:none; }
.dmbs-install-bar.open { transform:translate(-50%, 0); opacity:1; pointer-events:auto; }
.dmbs-install-bar .dmbs-ib-icon { font-size:26px; flex:none; }
.dmbs-install-bar .dmbs-ib-text { flex:1; min-width:0; display:flex; flex-direction:column; line-height:1.25; }
.dmbs-install-bar .dmbs-ib-text strong { font-size:14px; color:#3d5c3a; font-weight:700; }
.dmbs-install-bar .dmbs-ib-text span { font-size:12px; color:#666; }
.dmbs-install-bar .dmbs-ib-install { flex:none; background:#3d5c3a; color:#fff; border:none; padding:9px 16px; border-radius:8px; font-size:13px; font-weight:700; cursor:pointer; transition:background .15s; font-family:inherit; }
.dmbs-install-bar .dmbs-ib-install:hover { background:#2f4a2d; }
.dmbs-install-bar .dmbs-ib-install:active { transform:scale(0.96); }
.dmbs-install-bar .dmbs-ib-dismiss { flex:none; background:transparent; color:#888; border:none; padding:6px 8px; font-size:16px; cursor:pointer; border-radius:6px; line-height:1; font-family:inherit; }
.dmbs-install-bar .dmbs-ib-dismiss:hover { background:#f0ebdc; color:#555; }
@media (max-width:480px){
  .dmbs-install-bar { bottom:10px; padding:8px 10px; gap:8px; }
  .dmbs-install-bar .dmbs-ib-icon { font-size:22px; }
  .dmbs-install-bar .dmbs-ib-text strong { font-size:13px; }
  .dmbs-install-bar .dmbs-ib-text span { font-size:11px; }
  .dmbs-install-bar .dmbs-ib-install { padding:8px 12px; font-size:12px; }
}

.dmbs-ios-install { position:fixed; inset:0; z-index:9999; background:rgba(0,0,0,0.55); display:none; align-items:center; justify-content:center; padding:16px; }
.dmbs-ios-install.open { display:flex; }
.dmbs-ios-install .dmbs-ios-panel { background:#fff; border-radius:14px; padding:22px 22px 18px; max-width:440px; width:100%; box-shadow:0 20px 50px rgba(0,0,0,0.3); font:inherit; }
.dmbs-ios-install .dmbs-ios-panel h3 { margin:0 0 14px; color:#3d5c3a; font-size:17px; }
.dmbs-ios-install .dmbs-ios-panel ol { padding-left:20px; margin:0 0 12px; line-height:1.8; font-size:14px; color:#333; }
.dmbs-ios-install .dmbs-ios-panel ol li { margin-bottom:4px; }
.dmbs-ios-install .dmbs-ios-share { display:inline-block; background:#3d5c3a; color:#fff; border-radius:4px; padding:1px 7px; font-size:11px; margin:0 2px; vertical-align:1px; }
.dmbs-ios-install .dmbs-ios-note { color:#888; font-size:12px; margin:10px 0 0; line-height:1.5; }
.dmbs-ios-install .dmbs-ios-actions { text-align:right; margin-top:16px; }
.dmbs-ios-install .dmbs-ios-close { background:#3d5c3a; color:#fff; border:none; padding:9px 20px; border-radius:8px; cursor:pointer; font-size:14px; font-weight:600; font-family:inherit; }
.dmbs-ios-install .dmbs-ios-close:hover { background:#2f4a2d; }

/* === v3.0 Auth banners & admin switcher === */
#dmbs-breeding-root .dmbs-loggedout-banner {
  background: linear-gradient(135deg, #3d5c3a 0%, #2f4a2d 100%);
  color: #fff;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
#dmbs-breeding-root .dmbs-lb-left { flex: 1; min-width: 260px; }
#dmbs-breeding-root .dmbs-lb-left h3 { color: #fff; margin: 0 0 6px; font-size: 20px; }
#dmbs-breeding-root .dmbs-lb-left p { margin: 0; color: rgba(255,255,255,0.9); font-size: 13px; line-height: 1.5; }
#dmbs-breeding-root .dmbs-lb-right { display: flex; gap: 8px; flex-wrap: wrap; }
#dmbs-breeding-root .dmbs-lb-right button.primary {
  background: #c8e85c; color: #000; font-weight: 700; padding: 12px 20px; border-radius: 999px;
}
#dmbs-breeding-root .dmbs-lb-right button.primary:hover { background: #b5d04a; }
#dmbs-breeding-root .dmbs-lb-right button.secondary {
  background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.4);
  padding: 12px 20px; border-radius: 999px; cursor: pointer; font-size: 14px;
}
#dmbs-breeding-root .dmbs-lb-right button.secondary:hover { background: rgba(255,255,255,0.25); }

/* v3.1.71: LIVE 배지 (배너 내부) */
#dmbs-breeding-root .dmbs-live-badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 10px; padding: 5px 12px;
  background: rgba(200, 232, 92, 0.18);
  border: 1px solid rgba(200, 232, 92, 0.45);
  color: #d8f080;
  font-size: 12px; font-weight: 600;
  border-radius: 999px; line-height: 1.3;
}
#dmbs-breeding-root .dmbs-live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #6aff6a;
  box-shadow: 0 0 0 0 rgba(106, 255, 106, 0.7);
  animation: dmbs-live-pulse 1.8s ease-in-out infinite;
  flex: none;
  display: inline-block;
  vertical-align: middle;
  margin-right: 4px;
}
@keyframes dmbs-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(106, 255, 106, 0.75); }
  70%  { box-shadow: 0 0 0 10px rgba(106, 255, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(106, 255, 106, 0); }
}
/* v3.1.79: 네비게이션 우측의 빨간 LIVE 도트 (흰 배경 위) */
#dmbs-breeding-root .dmbs-live-dot-red {
  background: #ff3b3b;
  box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.75);
  animation: dmbs-live-pulse-red 1.8s ease-in-out infinite;
}
@keyframes dmbs-live-pulse-red {
  0%   { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.75); }
  70%  { box-shadow: 0 0 0 8px rgba(255, 59, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0); }
}
#dmbs-breeding-root .dmbs-live-text {
  color: #e53935;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 11px;
  margin-right: 2px;
}

/* v3.1.75: 기능 소개 카드 — 가로형, 배경 전부 흰색, 선 제거 */
#dmbs-breeding-root .dmbs-feature-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 12px 0 18px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}
#dmbs-breeding-root .dmbs-feature-card {
  background: #3d5c3a;
  border: 1px solid #3d5c3a;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  /* CSS Grid로 HTML 수정 없이 가로형 배치: 아이콘(1열, 2행 병합) + 제목(2열 1행) + 설명(2열 2행) */
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: center;
  transition: transform .15s ease, background .15s ease;
  min-width: 0;
}
#dmbs-breeding-root .dmbs-feature-card:hover {
  transform: translateY(-2px);
  background: #466b42;
}
#dmbs-breeding-root .dmbs-feature-card img {
  width: 40px; height: 40px;
  grid-row: 1 / span 2;
  grid-column: 1;
  object-fit: contain;
  /* 원본 녹색 아이콘을 카드 위에서는 흰색으로 렌더 */
  filter: brightness(0) invert(1);
}
#dmbs-breeding-root .dmbs-feature-card strong {
  grid-row: 1;
  grid-column: 2;
  font-size: 14px; font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  align-self: end;
  margin-bottom: 2px;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#dmbs-breeding-root .dmbs-feature-card span {
  grid-row: 2;
  grid-column: 2;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.3;
  align-self: start;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 태블릿: 3열 × 2행 */
@media (max-width: 900px) {
  #dmbs-breeding-root .dmbs-feature-row {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* 모바일: 가로 스크롤 */
@media (max-width: 560px) {
  #dmbs-breeding-root .dmbs-feature-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 2px;
    touch-action: pan-x; /* v3.1.120 */
  }
  #dmbs-breeding-root .dmbs-feature-card {
    flex: 0 0 70%;
    scroll-snap-align: start;
  }
  #dmbs-breeding-root .dmbs-feature-card strong { white-space: normal; }
  #dmbs-breeding-root .dmbs-feature-card span { white-space: normal; }
}

/* v3.1.84: 네비 언어 선택 드롭다운 */
#dmbs-breeding-root .dmbs-lang-sel {
  height: 26px;
  border: 1px solid #c8c2ad;
  background: #fff;
  color: #3d5c3a;
  border-radius: 4px;
  font-size: 11px;
  padding: 0 6px;
  cursor: pointer;
  margin-right: 6px;
  flex-shrink: 0;
  font-family: inherit;
}
#dmbs-breeding-root .dmbs-lang-sel:hover { border-color: #3d5c3a; }
#dmbs-breeding-root .dmbs-lang-sel:focus { outline: 2px solid #c8e85c; outline-offset: 1px; }

#dmbs-breeding-root .dmbs-unverified-banner {
  background: #fff8e1;
  border: 1px solid #ffcf33;
  color: #8a6d00;
  padding: 14px 18px;
  border-radius: 0;
}
#dmbs-breeding-root .dmbs-unverified-banner strong { color: #8a6d00; font-size: 14px; }
#dmbs-breeding-root .dmbs-unverified-banner p { margin: 6px 0 10px; font-size: 13px; color: #6a5500; }
#dmbs-breeding-root .dmbs-unverified-banner button.secondary {
  background: #fff; border: 1px solid #8a6d00; color: #8a6d00;
  padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
}
#dmbs-breeding-root .dmbs-unverified-banner button.secondary:hover { background: #8a6d00; color: #fff; }

#dmbs-breeding-root .dmbs-user-picker {
  margin-right: 10px;
  padding: 5px 10px;
  border: 1px solid #3d5c3a;
  border-radius: 6px;
  background: #fff;
  color: #3d5c3a;
  font-size: 12px;
  font-weight: 600;
  max-width: 200px;
}
@media (max-width: 720px) {
  #dmbs-breeding-root .dmbs-loggedout-banner { padding: 16px; }
  #dmbs-breeding-root .dmbs-lb-right { width: 100%; }
  #dmbs-breeding-root .dmbs-lb-right button { flex: 1; }
  #dmbs-breeding-root .dmbs-user-picker { max-width: 140px; font-size: 11px; padding: 4px 6px; }
}

/* === v3.1.0 QR code modal === */
.dmbs-qr-modal {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Malgun Gothic', -apple-system, sans-serif;
}
.dmbs-qr-backdrop {
  position: absolute; inset: 0; background: rgba(20, 25, 20, 0.55);
  backdrop-filter: blur(2px);
}
.dmbs-qr-dialog {
  position: relative;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 28px 26px 22px;
  text-align: center;
}
.dmbs-qr-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; cursor: pointer;
  font-size: 28px; line-height: 1; color: #888; padding: 4px 10px;
}
.dmbs-qr-close:hover { color: #222; }
.dmbs-qr-printarea {
  background: #fff;
  padding: 14px 10px 18px;
  border-radius: 12px;
  border: 1px dashed #d4cfc0;
  margin-bottom: 14px;
  display: flex; flex-direction: column; align-items: center;
}
.dmbs-qr-printarea canvas,
.dmbs-qr-printarea img {
  display: block;
  width: 280px; height: 280px;
  max-width: 100%;
  background: #fff;
}
.dmbs-qr-caption {
  margin-top: 10px;
  width: 100%;
  text-align: center;
}
.dmbs-qr-name {
  font-size: 20px; font-weight: 800; color: #2d2a24; letter-spacing: 0.01em;
}
.dmbs-qr-sub {
  margin-top: 4px;
  font-size: 13px; color: #3d5c3a; font-weight: 600;
}
.dmbs-qr-url {
  background: #faf8f1;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 11px;
  color: #6a6759;
  word-break: break-all;
}
.dmbs-qr-url code { font-family: 'Menlo', 'Consolas', monospace; font-size: 11px; }
.dmbs-qr-hint {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: #666;
  line-height: 1.5;
}
.dmbs-qr-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.dmbs-qr-actions button {
  padding: 10px 18px;
  border: 1px solid #d4cfc0;
  border-radius: 999px;
  background: #fff;
  color: #2d2a24;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.dmbs-qr-actions button:hover { background: #f5f2ec; border-color: #a8a18a; }
.dmbs-qr-actions .dmbs-qr-save {
  background: #3d5c3a; color: #fff; border-color: #3d5c3a;
}
.dmbs-qr-actions .dmbs-qr-save:hover { background: #2f4a2c; border-color: #2f4a2c; }
.dmbs-qr-actions .dmbs-qr-save:disabled { background: #8a9987; border-color: #8a9987; cursor: wait; }

/* Mobile-friendly nav: horizontal scroll instead of wrap */
@media (max-width: 720px) {
  #dmbs-breeding-root header { padding: 12px 14px; }
  #dmbs-breeding-root header h2 { font-size:17px; }
  #dmbs-breeding-root nav { flex-wrap: nowrap; overflow-x: auto; padding: 0 8px; gap: 0; -webkit-overflow-scrolling: touch; scrollbar-width: thin; position: sticky; top: 0; z-index: 20; background:#f2f2f2; touch-action: pan-x; /* v3.1.120 */ }
  #dmbs-breeding-root nav button { padding: 12px 10px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
  #dmbs-breeding-root nav #dmbsUnlock2, #dmbs-breeding-root nav #dmbsLock2 { margin-left: auto; padding: 8px 12px !important; font-size: 12px !important; border-radius: 999px !important; flex-shrink: 0; }
  #dmbs-breeding-root main { padding: 12px; }
  #dmbs-breeding-root .card { padding: 12px; }
  #dmbs-breeding-root form .row { grid-template-columns: 1fr !important; }
  #dmbs-breeding-root table { font-size: 12px; }
  #dmbs-breeding-root th, #dmbs-breeding-root td { padding: 6px; }
  #dmbs-breeding-root .animal-item, #dmbs-breeding-root .schedule-item, #dmbs-breeding-root .clutch-item, #dmbs-breeding-root .pair-item { flex-direction: column; align-items: stretch; }
}

/* ==================================================================
 * v3.2.6: 🌙 다크모드 — body.dmbs-dark 클래스로 활성화
 * 주요 배경/텍스트/카드/폼/테이블 색상 override
 * ================================================================== */
body.dmbs-dark #dmbs-breeding-root,
body.dmbs-dark #dmbs-breeding-root .dmbs-nav-utility,
body.dmbs-dark #dmbs-breeding-root nav { background: #1a1d1c !important; color: #e0ddd5 !important; }
body.dmbs-dark #dmbs-breeding-root nav { border-bottom-color: #2d3231 !important; }
body.dmbs-dark #dmbs-breeding-root nav button { color: #c0bdb5 !important; background: transparent !important; }
body.dmbs-dark #dmbs-breeding-root nav button.active { background: #2d3b36 !important; color: #c8e85c !important; }
body.dmbs-dark #dmbs-breeding-root main { background: #1a1d1c !important; }
body.dmbs-dark #dmbs-breeding-root .card,
body.dmbs-dark #dmbs-breeding-root .animal-item,
body.dmbs-dark #dmbs-breeding-root .schedule-item,
body.dmbs-dark #dmbs-breeding-root .clutch-item,
body.dmbs-dark #dmbs-breeding-root .pair-item { background: #252a28 !important; color: #e0ddd5 !important; border-color: #3a3f3d !important; }
body.dmbs-dark #dmbs-breeding-root h1,
body.dmbs-dark #dmbs-breeding-root h2,
body.dmbs-dark #dmbs-breeding-root h3,
body.dmbs-dark #dmbs-breeding-root strong { color: #e8e5dc !important; }
body.dmbs-dark #dmbs-breeding-root input,
body.dmbs-dark #dmbs-breeding-root select,
body.dmbs-dark #dmbs-breeding-root textarea { background: #2d3231 !important; color: #e0ddd5 !important; border-color: #3a3f3d !important; }
body.dmbs-dark #dmbs-breeding-root label { color: #c0bdb5 !important; }
body.dmbs-dark #dmbs-breeding-root .meta,
body.dmbs-dark #dmbs-breeding-root small { color: #999 !important; }
body.dmbs-dark #dmbs-breeding-root th,
body.dmbs-dark #dmbs-breeding-root td { background: #252a28 !important; color: #e0ddd5 !important; border-color: #3a3f3d !important; }
body.dmbs-dark #dmbs-breeding-root .empty { background: #2d3231 !important; color: #999 !important; }
body.dmbs-dark #dmbs-breeding-root .tag { filter: brightness(0.85) !important; }
body.dmbs-dark #dmbs-breeding-root details > summary { background: #2d3231 !important; }
body.dmbs-dark #dmbs-breeding-root details[open] > summary { border-bottom-color: #3a3f3d !important; }
body.dmbs-dark #dmbs-breeding-root .photo-gallery,
body.dmbs-dark #dmbs-breeding-root .photo-card { background: #252a28 !important; }
/* 카드 내부 흰 배경의 박스들 — section/note 등 */
body.dmbs-dark #dmbs-breeding-root [style*="background:#fff"]:not(button),
body.dmbs-dark #dmbs-breeding-root [style*="background: #fff"]:not(button) { background: #2d3231 !important; }
body.dmbs-dark #dmbs-breeding-root [style*="background:#fbfaf6"],
body.dmbs-dark #dmbs-breeding-root [style*="background:#fafaf5"],
body.dmbs-dark #dmbs-breeding-root [style*="background:#f5f2ee"],
body.dmbs-dark #dmbs-breeding-root [style*="background:#fbf6e8"] { background: #2d3231 !important; color: #e0ddd5 !important; }
/* 모달 다크 */
body.dmbs-dark .dmbs-public-card,
body.dmbs-dark #dmbsHatchCheckModal > div:not([id*="Bd"]),
body.dmbs-dark #dmbsAnimalDeathModal > div:not([id*="Bd"]),
body.dmbs-dark #dmbsFamilyTreeModal > div:not([id*="Bd"]),
body.dmbs-dark #dmbsShedModal > div:not([id*="Bd"]),
body.dmbs-dark #dmbsEnvModal > div:not([id*="Bd"]),
body.dmbs-dark #dmbsFeedResultModal > div:not([id*="Bd"]),
body.dmbs-dark #dmbsGlobalSearch > div:not([id*="Bd"]),
body.dmbs-dark #dmbsOnboarding > div:not([id*="Bd"]) { background: #252a28 !important; color: #e0ddd5 !important; }

