/* Stray Pets 입양 사이트. 외부 글꼴·CDN 없이 시스템 글꼴만 쓴다. */
:root {
  --ink: #1b1b1a;
  --ink-2: #5b5a56;
  --ink-3: #8a8986;
  --line: #e6e5e1;
  --bg: #fcfcfb;
  --card: #ffffff;
  --well: #f0efec;
  --accent: #2a78d6;
  --accent-soft: #cde2fb;
  --good: #0b7a0b;
  --bad: #c03434;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.3; margin: 4px 0 10px; }
h2 { font-size: 17px; margin: 22px 0 8px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

/* 머리글 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.brand { font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.top nav { display: flex; gap: 14px; flex-wrap: wrap; font-size: 15px; }
.top nav a { color: var(--ink-2); }
.top nav a.on { color: var(--ink); font-weight: 600; }
main { max-width: 1080px; margin: 0 auto; padding: 16px; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: 600 16px/1 var(--font); cursor: pointer; }
.btn:disabled { opacity: .35; cursor: default; }

/* 목록 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-top: 12px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; color: var(--ink); }
a.card:hover { text-decoration: none; border-color: #c9c8c3; }
.card .thumb { position: relative; aspect-ratio: 1 / 1; background: var(--well); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 10px 12px 12px; }
.card .kind { font-weight: 600; }
.card .meta { color: var(--ink-2); font-size: 14px; }
.tag { position: absolute; left: 8px; bottom: 8px; font-size: 12px; line-height: 1; padding: 5px 8px; border-radius: 999px; background: rgba(20, 20, 20, .68); color: #fff; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 20px 0; }

/* 프로필 */
.profile { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photos.single { grid-template-columns: minmax(0, 360px); }
figure { margin: 0; }
figure img { width: 100%; display: block; border-radius: 8px; background: var(--well); aspect-ratio: 1 / 1; object-fit: cover; }
figcaption { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
figcaption strong { color: var(--ink); }
.imgwrap { position: relative; }
.noimg { aspect-ratio: 1 / 1; border-radius: 8px; background: var(--well); display: grid; place-items: center; color: var(--ink-3); }
.profile-text h2:first-child { margin-top: 4px; }
.intro p { margin: 0 0 8px; }
.facts { display: grid; grid-template-columns: 5em minmax(0, 1fr) 5em minmax(0, 1fr); column-gap: 12px; margin: 0; font-size: 15px; }
.facts dt, .facts dd { margin: 0; padding: 5px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--ink-2); }
/* 움직임 컷: 설명 | 영상 (영상은 AI 보정 사진 아래 칸) */
.motion { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; margin-top: 12px; }
.motion p { margin: 0; }
.motion video { width: 100%; height: auto; display: block; border-radius: 8px; background: var(--well); }
.tag.status { left: auto; bottom: auto; right: 8px; top: 8px; }
.card-link { margin: 6px 0 0; }
.contact { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.contact p { margin: 0; }
.tel { font-size: 20px; font-weight: 600; }

/* 근거 앵커: 누르거나 올리면 필드 이름과 값 */
.anchor { position: relative; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: help; outline: none; }
.anchor:hover::after, .anchor:focus::after { content: attr(data-tip); position: absolute; left: 0; top: 100%; margin-top: 6px; z-index: 10; width: max-content; max-width: 280px; padding: 6px 9px; border-radius: 6px; background: #1b1b1a; color: #fff; font-size: 13px; font-weight: 400; line-height: 1.45; white-space: normal; text-decoration: none; }
.anchor.ok { text-decoration-color: var(--good); }
.anchor.bad { text-decoration-line: underline line-through; text-decoration-style: wavy; text-decoration-color: var(--bad); }
.flagged { position: relative; text-decoration: underline dotted var(--bad); text-underline-offset: 4px; cursor: help; outline: none; }
.flagged:hover::after, .flagged:focus::after { content: attr(data-tip); position: absolute; left: 0; top: 100%; margin-top: 6px; z-index: 10; width: max-content; max-width: 320px; padding: 6px 9px; border-radius: 6px; background: #1b1b1a; color: #fff; font-size: 13px; line-height: 1.45; white-space: normal; }

/* 짝 비교 (모바일 우선, 한 화면에) */
.page-compare main { max-width: 560px; padding: 10px 14px 16px; }
.page-compare .top { padding: 8px 14px; }
.compare .notice { font-size: 13px; color: var(--ink-2); margin: 0 0 4px; }
.compare .progress { font-size: 14px; color: var(--ink-2); margin: 0 0 8px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shot { padding: 0; border: 3px solid transparent; border-radius: 10px; background: var(--well); cursor: pointer; aspect-ratio: 1 / 1; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot.sel { border-color: var(--accent); }
.compare .q { font-weight: 600; margin: 12px 0 6px; font-size: 16px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choices button { min-height: 46px; border-radius: 10px; border: 1px solid #c9c8c3; background: var(--card); color: var(--ink); font: 500 16px/1.2 var(--font); cursor: pointer; }
.choices button.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.compare .submit { width: 100%; margin-top: 14px; }
.compare .done { font-size: 17px; margin-top: 14px; }
/* 입양 의향 한 문항 (표를 몇 개 넣은 뒤 한 번만) */
.intent { margin-top: 8px; padding: 16px; border: 1px solid #dedcd6; border-radius: 12px; background: var(--card); }
.intent .q { margin-top: 0; }
.intent .notice { margin: 10px 0 0; }
.btn.ghost { width: 100%; margin-top: 10px; background: transparent; color: var(--ink-2); border-color: #c9c8c3; font-weight: 500; }

/* 같은 아이 판정 (팀 내부 검수용): 사진은 자르지 않고 전체를 보인다 */
.calibrate h1 { font-size: 19px; margin: 2px 0 6px; }
.calibrate .notice { font-size: 13px; color: var(--ink-2); margin: 0 0 4px; }
.calibrate .progress { font-size: 14px; color: var(--ink-2); margin: 0 0 8px; }
.pair .view { margin: 0; aspect-ratio: 1 / 1; border-radius: 10px; background: var(--well); overflow: hidden; }
.pair .view img { width: 100%; height: 100%; object-fit: contain; aspect-ratio: auto; border-radius: 0; background: none; }
.calibrate .q { font-weight: 600; margin: 12px 0 6px; font-size: 16px; }
.choices button:disabled { opacity: .45; cursor: default; }
.calibrate .done { font-size: 17px; margin-top: 14px; }

/* 실시간 결과 (프로젝터용 큰 글씨) */
.page-live main { max-width: 1400px; padding: 20px 28px; }
.live-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.live h1 { font-size: 34px; margin: 0; }
.kind-note { font-size: 22px; font-weight: 600; margin: 6px 0 0; }
.live-controls { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.live-controls select { font: 500 18px var(--font); padding: 8px 10px; border-radius: 8px; border: 1px solid #c9c8c3; background: var(--card); color: var(--ink); }
.hero { font-size: 64px; font-weight: 700; margin: 10px 0 14px; line-height: 1.1; }
.hero .unit { font-size: 30px; margin-left: 4px; }
.hero .muted { font-size: 18px; font-weight: 400; margin-left: 12px; }
.bars { width: 100%; border-collapse: collapse; font-size: 24px; }
.bars th { text-align: left; font-size: 16px; font-weight: 500; color: var(--ink-2); padding: 0 12px 8px 0; }
.bars td { padding: 10px 12px 10px 0; vertical-align: middle; border-top: 1px solid var(--line); }
.bars td.name { width: 24%; font-weight: 600; }
.bars td.name .n { display: block; font-size: 15px; font-weight: 400; color: var(--ink-2); }
.bars td.win { width: 50%; }
.bars td.best { width: 26%; }
.meter { display: grid; grid-template-columns: minmax(0, 1fr) 8.5em; align-items: center; gap: 12px; }
.track { position: relative; height: 24px; }
.track .axis { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.track .mid { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: #8a8986; }
.track .fill { position: absolute; left: 0; top: 2px; height: 20px; border-radius: 0 4px 4px 0; background: var(--accent); }
.track .ci { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: #104281; }
.track .ci::before, .track .ci::after { content: ""; position: absolute; top: -6px; width: 2px; height: 14px; background: #104281; }
.track .ci::before { left: 0; }
.track .ci::after { right: 0; }
.track.best .fill { background: #86b6ef; }
.meter .val { font-variant-numeric: tabular-nums; font-size: 22px; }
.meter .val small { font-size: 16px; color: var(--ink-2); }
.bars tr.orig td { color: var(--ink-2); }
.legend { font-size: 15px; margin-top: 14px; max-width: 70em; }

/* 편집 갤러리 */
.gallery-card { padding: 14px 16px; margin: 16px 0; }
.gallery-card h2 { margin: 0 0 10px; font-size: 18px; }
.figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.figs figcaption { margin: 6px 0 0; font-size: 13px; line-height: 1.5; }
.verdict { font-weight: 600; }
.verdict.ok { color: var(--good); }
.verdict.bad { color: var(--bad); }
.intro.review { margin-top: 14px; }

@media (max-width: 760px) {
  .profile { grid-template-columns: 1fr; gap: 8px; }
  .facts { grid-template-columns: 5em minmax(0, 1fr); }
  h1 { font-size: 20px; }
  .bars { font-size: 18px; }
  .bars td.name { width: 30%; }
  .meter { grid-template-columns: 1fr; gap: 4px; }
  .hero { font-size: 44px; }
}

/* 쇼츠 스튜디오 (관리자 화면) */
.subnav { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; padding: 0 0 10px; margin-bottom: 12px; border-bottom: 1px solid var(--line); font-size: 15px; }
.subnav a { color: var(--ink-2); padding: 4px 0; }
.subnav a.on { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.subnav .mode { margin-left: auto; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--well); color: var(--ink-2); }
.subnav .mode.live { background: #fde8e7; color: var(--bad); font-weight: 600; }
.notice { padding: 8px 12px; border-radius: 8px; background: var(--well); color: var(--ink-2); margin: 0 0 12px; }
.notice.bad { background: #fde8e7; color: var(--bad); }
.err { color: var(--bad); }
.ok { color: var(--good); }
.warn { color: #9a5b00; }
.crumb { margin: 0 0 4px; font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.small-btn { min-height: 40px; padding: 0 14px; font-size: 15px; }
.ghost-btn { background: var(--card); color: var(--accent); }
.ghost-btn:hover { text-decoration: none; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.field input, .field select, .field textarea, .search input, .search select, .studio-head select, .row > input, textarea { font: 400 16px/1.4 var(--font); color: var(--ink); padding: 9px 11px; border: 1px solid #c9c8c3; border-radius: 8px; background: var(--card); min-width: 0; }
.field small { font-size: 12px; }
.login { max-width: 380px; margin: 40px auto; }
.studio-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.studio-head h1 { margin: 0; }
.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search input { width: 260px; max-width: 100%; }
.studio-cards { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.chip { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--well); color: var(--ink-2); }
.chip.published { background: #e3f3e3; color: var(--good); }
.studio { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 8px; }
.stage { display: flex; flex-direction: column; gap: 14px; }
.player { width: 100%; max-width: 360px; aspect-ratio: 9 / 16; background: #14130f; border-radius: 12px; overflow: hidden; position: relative; }
.player video { width: 100%; height: 100%; display: block; background: #14130f; }
.player .empty { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.player .empty img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; border-radius: 0; aspect-ratio: auto; }
.player .empty p { position: relative; margin: 0; padding: 16px; color: #fff; font-weight: 600; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.make .field select { width: 100%; }
.progress-box { margin-top: 10px; }
.bar { height: 10px; border-radius: 999px; background: var(--well); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.upload h2 { margin-top: 0; }
.upload textarea { width: 100%; resize: vertical; font-size: 14px; line-height: 1.5; }
.capcheck ul { margin: 6px 0 10px; }
.plats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.plat { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.plat-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.plat .btn { width: 100%; }
.plat .result { margin: 0; min-height: 1.5em; }
.st { font-weight: 600; }
.st.dry_run { color: var(--accent); }
.st.published { color: var(--good); }
.st.failed, .st.refused, .st.uploading { color: var(--bad); }
.evidence { margin-top: 28px; }
.checks { list-style: none; padding: 0; margin: 8px 0; font-size: 14px; }
.checks li { padding: 6px 10px 6px 12px; border-left: 3px solid var(--line); margin-bottom: 6px; background: var(--card); }
.checks li.ok { border-color: var(--good); }
.checks li.warn { border-color: #d39b2a; color: var(--ink); }
.checks li.fail { border-color: var(--bad); color: var(--ink); }
.panel { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 16px; background: var(--card); }
.panel h2 { margin: 0 0 8px; }
.plat-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.badge.ok { background: #e3f3e3; color: var(--good); }
.badge.fail { background: #fde8e7; color: var(--bad); }
.creds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-top: 10px; }
.creds .row, .creds .msg, .creds .live-checks { grid-column: 1 / -1; }
.creds code { font-size: 11px; color: var(--ink-3); }
.posts { display: grid; gap: 0; margin-top: 10px; font-size: 14px; }
.post { display: grid; grid-template-columns: 8.5em minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1.3fr) 6em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.post.head { font-weight: 600; color: var(--ink-2); border-top: 0; padding-top: 0; }
.post .when { color: var(--ink-2); font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .studio { grid-template-columns: 1fr; }
  .player { max-width: 100%; max-height: 72vh; margin: 0 auto; }
  .plats { grid-template-columns: 1fr; }
  .creds { grid-template-columns: 1fr; }
  .post.head { display: none; }
  .post { grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .post .when { grid-column: 1 / -1; }
  .subnav .mode { margin-left: 0; }
  .search input { width: 100%; }
  .search { width: 100%; }
}
