/* 댕그램 (Mobile-first) */
:root{
  --app-max: 430px;
  --bg: #f6f7fb;
  --text: #0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --accent:#6d5efc;
  --accent2:#0ea5e9;
  --danger:#ef4444;

  --topbar-h: 56px;
  --tabbar-h: 66px;
  --radius: 16px;

  --shadow: 0 14px 40px rgba(15,23,42,.12);
  --vh: 1vh;
}

*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Apple SD Gothic Neo, Noto Sans KR, sans-serif;
  letter-spacing: -0.2px;
}

a{ color: inherit; text-decoration: none; }
button{ font: inherit; color: inherit; }
input{ font: inherit; color: inherit; background: transparent; border: none; outline: none; }

.app{
  width: min(100%, var(--app-max));
  margin: 0 auto;
  min-height: calc(var(--vh) * 100);
  position: relative;
}

.topbar{
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, var(--app-max));
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(246,247,251,.72), rgba(246,247,251,.35));
  border-bottom: 1px solid rgba(226,232,240,.55);
}

.topbarTitle{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.title{
  font-weight: 750;
  font-size: 15px;
  line-height: 1.1;
}
.subtitle{
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbarActions{
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.iconbtn{
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(226,232,240,.7);
  background: rgba(255,255,255,.55);
  border-radius: 12px;
  cursor: pointer;
}
.iconbtn svg{ width: 18px; height: 18px; }

.view{
  padding: calc(var(--topbar-h) + env(safe-area-inset-top) + 12px) 14px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}

.sectionTitle{
  font-weight: 760;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 10px;
}

.row{ display:flex; align-items:center; }
.gap10{ gap:10px; }

.chipsRow{
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 14px;
}
.chip{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(226,232,240,.8);
}
.chip .k{ font-size:12px; color: var(--muted); }
.chip .v{ font-size:12px; font-weight: 720; }
.chip .miniBtn{
  width: 26px; height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(226,232,240,.9);
  background: rgba(248,250,252,.8);
  display:grid;
  place-items:center;
  cursor:pointer;
}
.miniBtn svg{ width: 14px; height: 14px; }

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.72));
  border: 1px solid rgba(226,232,240,.85);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(15,23,42,.10);
}

.post{ overflow: hidden; margin: 10px 0 14px; }
.postHeader{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 12px 12px 10px;
}
.avatar{
  width: 34px; height: 34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: rgba(124,92,255,.18);
  border: 1px solid rgba(124,92,255,.35);
  flex: 0 0 auto;
}
.userMeta{ min-width: 0; }
.userLine{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
  font-weight: 760;
}
.userLine .username{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.metaLine{
  font-size: 12px;
  color: var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.badge{
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,77,90,.14);
  border: 1px solid rgba(255,77,90,.25);
  color: #8b1a23;
  flex: 0 0 auto;
}
.flag{ font-size: 14px; opacity: .95; }

.postImage{
  display: block;
  height: 320px;
  position: relative;
  background: linear-gradient(135deg, rgba(124,92,255,.18), rgba(53,208,255,.12));
  border-top: 1px solid rgba(226,232,240,.7);
  border-bottom: 1px solid rgba(226,232,240,.7);
  overflow:hidden;
}
.postImage .postPhoto{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
}
.postImage.hasPhoto .ph{ display:none; }

.postImage .ph{
  position:absolute;
  inset: 0;
  display:grid;
  place-items:center;
  font-size: 42px;
  opacity: .95;
}
.postImage .ph small{
  display:block;
  font-size: 12px;
  color: rgba(15,23,42,.78);
  margin-top: 10px;
  letter-spacing: .2px;
}

.postActions{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 10px 12px 12px;
  gap: 10px;
}
.actionsLeft{ display:flex; gap: 8px; }
.actionBtn{
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(248,250,252,.66);
  display:flex;
  align-items:center;
  gap: 8px;
  cursor:pointer;
}
.actionBtn svg{ width: 16px; height: 16px; }
.actionBtn .t{ font-size: 12px; font-weight: 650; }
.actionBtn.likeOn{
  border-color: rgba(124,92,255,.6);
  background: rgba(124,92,255,.18);
}
.actionBtn.voteOn{
  border-color: rgba(14,165,233,.55);
  background: rgba(14,165,233,.14);
}
.postCounts{
  font-size: 12px;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.postBody{ padding: 0 12px 12px; }
.postBody .caption{
  font-size: 13px;
  line-height: 1.45;
  color: rgba(15,23,42,.92);
}
.caption a.hash{
  color: rgba(14,165,233,.98);
  font-weight: 760;
  text-decoration: none;
}
.caption a.hash:hover{ text-decoration: underline; }
.postBody .previewLink{
  margin-top: 8px;
  font-size: 12px;
  color: rgba(100,116,139,.95);
  text-decoration: underline;
  cursor: pointer;
  display:inline-block;
}

/* Detail */
.detailHero{ overflow:hidden; }
.detailMeta{
  padding: 12px 12px 10px;
  border-top: 1px solid rgba(226,232,240,.7);
}
.kv{
  display:flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.pill{
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(226,232,240,.8);
  background: rgba(248,250,252,.40);
  color: rgba(15,23,42,.90);
}
.pillDanger{
  border-color: rgba(255,77,90,.35);
  background: rgba(255,77,90,.10);
}

/* Tabbar */
.tabbar{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100%, var(--app-max));
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 10px 10px calc(env(safe-area-inset-bottom) + 10px);
  display:flex;
  justify-content: space-between;
  gap: 8px;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: linear-gradient(to top, rgba(246,247,251,.76), rgba(246,247,251,.30));
  border-top: 1px solid rgba(226,232,240,.55);
}
.tab{
  flex: 1 1 0;
  height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(226,232,240,.75);
  background: rgba(255,255,255,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  cursor:pointer;
  color: rgba(15,23,42,.78);
}
.tab svg{ width: 18px; height: 18px; }
.tab span{ font-size: 12px; font-weight: 650; }
.tab.active{
  color: rgba(15,23,42,.98);
  border-color: rgba(124,92,255,.55);
  background: rgba(124,92,255,.14);
}
.tabPrimary{
  border-color: rgba(53,208,255,.45);
  background: rgba(53,208,255,.12);
}
.tabPrimary .plus{
  width: 28px; height: 28px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  font-weight: 900;
  background: rgba(53,208,255,.18);
  border: 1px solid rgba(53,208,255,.30);
}

/* Backdrop */
.backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 40;
}
.hidden{ display:none !important; }

/* Sheet */
.sheet{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100%, var(--app-max));
  max-height: calc(var(--vh) * 92);
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(226,232,240,.85);
  border-bottom: none;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  z-index: 50;
  box-shadow: var(--shadow);
  overflow: hidden;
  display:flex;
  flex-direction: column;
}
.sheetHandle{
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(100,116,139,.35);
  margin: 10px auto 8px;
}
.sheetHeader{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 0 14px 10px;
  border-bottom: 1px solid rgba(226,232,240,.7);
}
.sheetTitle{ font-weight: 780; }
.sheetBody{
  padding: 12px 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}
.sheetComposer{
  padding: 10px 12px calc(env(safe-area-inset-bottom) + 12px);
  border-top: 1px solid rgba(226,232,240,.7);
  display:flex;
  align-items:center;
  gap: 10px;
}
.composerAvatar{
  width: 30px; height: 30px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: rgba(124,92,255,.16);
  border: 1px solid rgba(124,92,255,.28);
  flex: 0 0 auto;
}
.composerInput{
  flex: 1 1 auto;
  height: 40px;
  border-radius: 999px;
  padding: 0 14px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(248,250,252,.55);
  font-size: 13px;
}
.composerInput:disabled{ opacity: .55; }
.composerSend{
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(248,250,252,.55);
  color: rgba(15,23,42,.78);
}
.composerSend:disabled{ opacity: .55; }
.composerSend:not(:disabled){
  border-color: rgba(124,92,255,.55);
  background: rgba(124,92,255,.18);
  color: rgba(15,23,42,.98);
  cursor: pointer;
}

.commentItem{
  display:flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(226,232,240,.55);
}
.commentBody{ flex: 1 1 auto; min-width: 0; }
.commentTop{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.commentUser{
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.commentTime{
  font-size: 11px;
  color: var(--muted);
  flex: 0 0 auto;
}
.commentText{
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(15,23,42,.92);
  word-break: break-word;
}

/* Search */
.searchBox input{
  width: 100%;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(248,250,252,.55);
  padding: 0 12px;
  font-size: 13px;
}
.searchResults{ margin-top: 12px; }

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  display:grid;
  place-items:center;
  z-index: 60;
  background: rgba(0,0,0,.6);
}
.modalCard{
  width: min(92%, 380px);
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(226,232,240,.85);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.modalTitle{ font-weight: 820; margin-bottom: 10px; }
.modalBody{
  display:flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0 12px;
}
.adTimer{
  font-size: 42px;
  font-weight: 900;
  text-align: center;
  padding: 10px 0;
  border-radius: 16px;
  border: 1px solid rgba(226,232,240,.75);
  background: rgba(248,250,252,.55);
}
.modalActions{ display:flex; gap: 10px; }
.btnGhost, .btnPrimary{
  flex: 1 1 0;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(248,250,252,.55);
  cursor:pointer;
}
.btnPrimary{
  border-color: rgba(124,92,255,.55);
  background: rgba(124,92,255,.18);
}
.btnPrimary:disabled{
  opacity: .55;
  cursor: not-allowed;
}

.muted{ color: var(--muted); font-size: 13px; line-height: 1.45; }

.toast{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  width: min(92%, var(--app-max));
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(255,255,255,.92);
  z-index: 90;
  box-shadow: var(--shadow);
  font-size: 13px;
}

/* sheet open -> hide tabbar */
body.sheetOpen .tabbar{
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}

/* Upload form */
.form{ padding: 14px; }
.form .field{ margin-bottom: 12px; display:flex; flex-direction: column; gap: 8px; }
.form .field span{ font-size: 12px; color: var(--muted); }

.select{
  width: 100%;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(248,250,252,.55);
  padding: 0 12px;
  font-size: 13px;
  color: rgba(15,23,42,.92);
}
.textarea{
  width: 100%;
  min-height: 88px;
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(248,250,252,.55);
  padding: 10px 12px;
  font-size: 13px;
  color: rgba(15,23,42,.92);
  resize: vertical;
}
.btnGhost, .btnPrimary{
  flex: 1 1 0;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(248,250,252,.55);
  cursor:pointer;
}
.btnPrimary{
  border-color: rgba(124,92,255,.55);
  background: rgba(124,92,255,.18);
}

/* CheckRow + Switch (dog add) */
.checkRow{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,.75);
  background: rgba(248,250,252,.30);
  margin-bottom: 12px;
}
.checkRow .label{
  display:flex;
  flex-direction: column;
  gap: 2px;
}
.checkRow .label .t{ font-weight: 780; font-size: 13px; }
.checkRow .label .d{ font-size: 12px; color: var(--muted); }

.switch{
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(248,250,252,.55);
  position: relative;
  cursor:pointer;
  flex: 0 0 auto;
}
.switch::after{
  content:"";
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,.95);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all .18s ease;
}
.switch.on{
  border-color: rgba(124,92,255,.55);
  background: rgba(124,92,255,.18);
}
.switch.on::after{
  left: 22px;
  background: rgba(255,255,255,.98);
}

/* rankRow style reused for dogs list */
.rankList{ margin-top: 12px; }
.rankRow{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 16px;
  border: 1px solid rgba(226,232,240,.65);
  background: rgba(248,250,252,.25);
  margin-bottom: 10px;
}
.rankMeta{ min-width: 0; flex: 1 1 auto; }
.rankName{ font-weight: 860; font-size: 13px; }
.rankSub{ font-size: 12px; color: var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.followBtn{
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(248,250,252,.55);
  cursor:pointer;
  font-size: 12px;
  font-weight: 760;
}

/* Search Results */
.searchResults{ margin-top: 12px; }
.resultRow{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,.65);
  background: rgba(248,250,252,.30);
  cursor:pointer;
  margin-bottom: 8px;
}
.resultRow:hover{ background: rgba(248,250,252,.45); }
.resultMeta{ min-width: 0; }
.resultName{ font-size: 13px; font-weight: 760; }
.resultSub{ font-size: 12px; color: var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }


/* User Grid */
.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 0 16px;
}
.gridItem{
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,.75);
  background: linear-gradient(135deg, rgba(124,92,255,.16), rgba(53,208,255,.10));
  display:grid;
  place-items:center;
}
.gridItem.hasPhoto{
  background-size: cover;
  background-position: center;
}
.gridItem span{ font-size: 20px; }
.dogInfo{
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(248,250,252,.30);
}

/* Rank */
.rankNote{
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(226,232,240,.85);
  background: rgba(248,250,252,.35);
  color: rgba(15,23,42,.90);
  font-size: 12px;
  line-height: 1.45;
}
.rankList{ margin-top: 12px; }

.rankIdx{
  width: 26px;
  text-align:center;
  font-weight: 900;
  color: rgba(15,23,42,.92);
}
.rankScore{
  font-weight: 900;
  margin-left: auto;
}

/* Prize */
.prizeCard{ padding: 14px; }
.prizeTitle{ font-weight: 900; font-size: 15px; }
.prizeDesc{ margin-top: 10px; font-size: 13px; line-height: 1.5; color: rgba(15,23,42,.92); }
.prizeImg{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,.75);
  margin-top: 10px;
  display:block;
}


/* ===== me.html (profile) fixes ===== */
.profileCard { padding: 14px; }
.profileHeader { display:flex; gap:12px; align-items:center; }
.profileAvatar {
  width: 46px; height: 46px; border-radius: 16px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(15, 23, 42, 0.06);
  overflow: hidden;
  flex: 0 0 auto;
}
.profileAvatarImg { width:100%; height:100%; object-fit:cover; display:block; }
.profileAvatarEmoji { font-size: 22px; line-height: 1; }

.profileMeta { min-width: 0; flex: 1; }
.profileNameRow { display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; }
.profileName { font-weight: 900; font-size: 16px; letter-spacing: -0.2px; }
.profileHandle { font-size: 12px; font-weight: 750; }
.profileSub { margin-top: 4px; font-size: 12px; line-height: 1.35; }
.profileSub .dot { margin: 0 6px; opacity: .65; }
.flagEmoji { font-size: 14px; vertical-align: -1px; }

.profileActions { display:flex; gap:10px; margin-top: 12px; }
.chipBtn {
  flex: 1;
  height: 42px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,0.75);
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 14px;
  text-decoration: none;
  color: inherit;
  font: inherit;
}
.chipBtn:active { transform: translateY(0.5px); }
.chipBtn .k { font-weight: 850; font-size: 13px; }
.chipBtn .v { font-weight: 800; font-size: 12px; opacity: .7; }
.chipBtn.danger { border-color: rgba(239, 68, 68, .25); }

.sectionCard { padding: 14px; margin-top: 10px; }
.sectionHead { display:flex; align-items:center; justify-content:space-between; margin-bottom: 10px; }
.miniLink {
  height: 32px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  display:flex; align-items:center;
  text-decoration: none;
  color: inherit;
  font-weight: 850;
  font-size: 12px;
  background: rgba(255,255,255,0.75);
}

.dogChips {
  display:flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.dogChip {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255,255,255,0.85);
  font: inherit;
  font-weight: 850;
}
.dogChip.active {
  background: rgba(99, 102, 241, 0.10);
  border-color: rgba(99, 102, 241, 0.30);
}
.dogInfo { margin-top: 10px; padding: 12px; border-radius: 16px; background: rgba(15, 23, 42, 0.04); }
.dogInfoTop { display:flex; justify-content:space-between; gap: 10px; align-items:baseline; }
.dogName { font-weight: 900; font-size: 15px; }
.dogBirth { font-size: 12px; }
.dogMeta { margin-top: 8px; font-size: 12px; }

.grid {
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.gridItem {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: rgba(15, 23, 42, 0.05);
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  color: inherit;
}
.gridItem.hasPhoto {
  background-size: cover;
  background-position: center;
}
.gridEmoji { font-size: 26px; opacity: .75; }

.dogEmpty, .postEmpty { padding: 6px 0 2px; }


/* ===== me/profile Instagram-like polish ===== */
.profileCard { padding: 16px; }
.profileHeader { display:flex; gap:12px; align-items:center; }

.profileAvatar{
  width:48px; height:48px; border-radius:18px;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 10px 28px rgba(15,23,42,.08);
  border: 1px solid rgba(15,23,42,.06);
  overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}
.profileAvatarImg{ width:100%; height:100%; object-fit:cover; display:block; }

.profileMeta{ min-width:0; }
.profileNameRow{ display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; }
.profileName{ font-weight:900; font-size:16px; letter-spacing:-.2px; }
.profileHandle{ font-size:12px; font-weight:800; opacity:.75; }
.profileSub{ margin-top:6px; font-size:12px; line-height:1.35; opacity:.8; }
.profileSub .dot{ margin:0 6px; opacity:.6; }

/* 버튼 3개 균형 + 인스타 느낌 */
.profileActions{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.actionPill{
  height:42px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,0.85);
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
  display:flex; align-items:center; justify-content:center;
  text-decoration:none;
  color: inherit;
  font: inherit;
  font-weight:850;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.actionPill:active{ transform: translateY(0.5px); }
.actionPill.danger{
  border-color: rgba(239,68,68,.18);
}

/* 섹션 카드 균형 */
.sectionCard{
  padding:16px;
  margin-top:12px;
  border-radius:18px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(15,23,42,.06);
  box-shadow: 0 14px 34px rgba(15,23,42,.07);
}
.sectionHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}
.miniLink{
  height:34px;
  padding:0 12px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,0.85);
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
  display:flex; align-items:center;
  text-decoration:none; color:inherit;
  font-weight:850; font-size:12px;
}

/* 강아지 칩 */
.dogChips{
  display:flex; gap:8px;
  overflow-x:auto;
  padding: 2px 0 8px;
  -webkit-overflow-scrolling: touch;
}
.dogChip{
  height:34px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,0.85);
  box-shadow: 0 10px 26px rgba(15,23,42,.05);
  font: inherit;
  font-weight:850;
  white-space:nowrap;
}
.dogChip.active{
  background: rgba(99,102,241,.10);
  border-color: rgba(99,102,241,.22);
}

/* 게시물 그리드(인스타 느낌) */
.grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:6px; }
.gridItem{
  border-radius:14px;
  overflow:hidden;
  aspect-ratio: 1 / 1;
  background: rgba(15,23,42,.05);
  box-shadow: 0 10px 26px rgba(15,23,42,.05);
}
.gridItem.hasPhoto{ background-size: cover; background-position: center; }


/* ===== FIX: 한글 버튼/칩 글자 쪼개짐 + 레이아웃 튕김 방지 ===== */
.actionBtn,
.followBtn,
.btnGhost,
.btnPrimary,
.chip,
.miniLink,
.dogChip,
.actionPill,
.tab span{
  white-space: nowrap;     /* 글자 중간 줄바꿈 금지 */
  word-break: keep-all;    /* 한글은 keep-all로 */
  overflow-wrap: normal;   /* anywhere/break-word 방지 */
  line-break: strict;
}

/* 버튼이 너무 좁아져서 글자가 튀어나오는 것 방지 */
.actionBtn,
.followBtn,
.btnGhost,
.btnPrimary,
.miniLink,
.actionPill{
  min-width: 76px;
  justify-content: center;
  text-align: center;
}

/* 칩 내부 텍스트도 줄바꿈 금지 + 말줄임 */
.chip{
  min-width: 0;
}
.chip .k,
.chip .v{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* (선택) 작은 화면에서 버튼들이 ‘버튼 단위로만’ 줄바꿈되게 */
.chipsRow{
  flex-wrap: wrap;
}


/* ===== Upload page buttons (fix overflow) ===== */
#view .uploadActions{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
}
#view .uploadActions .btnGhost,
#view .uploadActions .btnPrimary{
  width:100%;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

#view .uploadSubmitRow{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  margin-top:12px;
}
#view .uploadSubmitRow .btnPrimary,
#view .uploadSubmitRow .btnGhost{
  width:100%;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

@media (max-width: 720px){
  #view .uploadActions{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px){
  #view .uploadSubmitRow{ grid-template-columns:1fr; }
}

/* upload.html 전용: 선택 버튼 4개 줄 */
.uploadPickRow{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
}
@media (max-width: 520px){
  .uploadPickRow{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 등록/피드로 2개 줄 */
.uploadSubmitRow{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}
@media (max-width: 360px){
  .uploadSubmitRow{ grid-template-columns: 1fr; }
}



/* upload.html 버튼 줄바꿈/튕김 방지 */
.uploadActions{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 720px){
  .uploadActions{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.uploadActions > button{
  width: 100%;
  min-width: 0;
}

.uploadSubmitRow{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 480px){
  .uploadSubmitRow{
    grid-template-columns: 1fr;
  }
}
.uploadSubmitRow > button,
.uploadSubmitRow > a{
  width: 100%;
  min-width: 0;
}

.gridItem.isVideo{position:relative}
.gridItem.isVideo .gridPlay{
  position:absolute; inset:auto 10px 10px auto;
  width:28px;height:28px;border-radius:999px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.45); color:#fff; font-weight:900; font-size:12px;
}