/* 아이돌마스터 소트 · 취향표 (시안) — 화면 스타일
   바탕 · 글자 · 그림자 · 움직임의 값은 css/tokens.css (가족 바탕 — 노래 맞추기 것의 복사본, 손으로 고치지 않음). 여기는 취향표 것만.
   조각의 꼴(화면 머리 · 눈썹 제목 · 큰 카드 · 묶음 카드 · 아래 탭 줄 · 세그먼트 · 아래 시트 · 결과의 동작)은 노래 맞추기 docs/design.md 와 같게 */
:root { --tint: #0a8277; --tint-fill: #0a8277; --tabbar: 74px; }   /* --tint-fill: 흰 글자를 올리는 면 */
:root[data-theme="dark"] { --tint: #4fd8c7; --tint-fill: #0c8e82; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button, a, input, label { touch-action: manipulation; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
html.sheet-on, html.sheet-on body { overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--label);
  font-family: var(--font); font-size: 16px; line-height: 1.45; letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
}
#app { overflow-x: clip; }
button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2.5px solid var(--tint); outline-offset: 2px; }
a { color: inherit; }
img { display: block; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }   /* 길게 누르기는 아이돌 정보 — iOS 그림 메뉴와 겹치지 않게 */
.img-box img { -webkit-touch-callout: default; user-select: auto; }   /* 저장할 그림은 길게 눌러 저장 */
h1, h2, h3, p { margin: 0; }
body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }   /* 아이폰 가로: 다이내믹 아일랜드 · 둥근 모서리 쪽 */
[lang="ja"] body { letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.fade-in { animation: fadeIn .35s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }

/* ───── 공통 단추 */
.icon-btn { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--label-2); background: var(--fill); transition: transform .2s var(--ease), background .2s; }
.icon-btn:active { transform: scale(.9); }
.icon-btn svg { width: 19px; height: 19px; }
.cta { width: 100%; height: 56px; border-radius: 16px; background: var(--tint-fill); color: #fff; font-size: 17px; font-weight: 750;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .2s var(--ease), filter .2s, opacity .2s; box-shadow: 0 14px 30px -16px var(--tint-fill); }
.cta:active { transform: scale(.97); filter: brightness(.95); }
.cta svg { width: 20px; height: 20px; }
.btn2 { width: 100%; height: 50px; border-radius: var(--r-btn); background: var(--fill); font-size: 16px; font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .2s var(--ease); }
.btn2:active { transform: scale(.97); }
.btn2 svg { width: 19px; height: 19px; }
.cta:disabled, .btn2:disabled { opacity: .45; pointer-events: none; box-shadow: none; }
.empty { padding: 48px 0; text-align: center; color: var(--label-2); font-size: 15px; }

/* 브랜드 로고: 한 색 SVG 를 가면으로 — 색은 --c */
.logo { display: block; background: var(--c); -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }

/* ───── 세그먼트 (미끄러지는 흰 칸) */
.seg { position: relative; display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; padding: 3px; border-radius: 12px; background: var(--fill); }
.seg button { position: relative; z-index: 1; height: 36px; padding: 0 12px; border-radius: 9px; font-size: 14.5px; font-weight: 600; color: var(--label-2); transition: color .2s; white-space: nowrap; }
.seg button[aria-checked="true"] { color: var(--label); }
.seg .thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n)); border-radius: 9px; background: var(--card);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .18), 0 0 0 .5px rgba(0, 0, 0, .04); transform: translateX(calc(var(--i) * 100%)); transition: transform .32s var(--ease); }
[data-theme="dark"] .seg .thumb { background: #48484a; }

/* ───── 화면 틀 */
.screen { max-width: 560px; margin: 0 auto; padding: calc(10px + var(--top)) var(--gutter) calc(28px + var(--bottom)); }
.home { max-width: 880px; margin: 0 auto; padding: calc(10px + var(--top)) var(--gutter) calc(var(--tabbar) + 28px + var(--bottom)); }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.topbar h1 { flex: 1; min-width: 0; font-size: 19px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 맨 위 화면의 머리: 왼쪽에 이름(첫 화면은 로고 + 두 줄), 오른쪽에 단추 */
.tabhead { display: flex; align-items: center; gap: 11px; min-height: 46px; margin-bottom: 14px; }
.tabhead h1 { flex: 1; min-width: 0; font-size: 30px; font-weight: 850; letter-spacing: -.035em; line-height: 1.12; }
.tabhead .logo { flex: none; width: 40px; height: 40px; border-radius: 12px; background: none; -webkit-mask: none; mask: none; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--tint-fill) 80%, #000); }
.tabhead.brand h1 { font-size: 20px; letter-spacing: -.03em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabhead.brand h1 small { display: block; margin-bottom: 1px; font-size: 11.5px; font-weight: 700; letter-spacing: 0; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; }

/* 눈썹 제목: 서비스 색 짧은 줄 + 작은 글자 */
.sec-title { display: flex; align-items: center; gap: 8px; margin: 26px 2px 10px; font-size: 12.5px; font-weight: 800; letter-spacing: .04em; color: var(--label-2); }
.sec-title::before { content: ""; flex: none; width: 14px; height: 2.5px; border-radius: 2px; background: var(--tint); }
.tabhead + .sec-title { margin-top: 4px; }

/* ───── 첫 화면 (js/home.js) */
/* 큰 카드: 주 동작 하나 — 아이돌 얼굴이 제 이미지 컬러 위에 놓인 기울인 격자 + 어두운 막 */
.hero { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; width: 100%; min-height: 190px; padding: 20px;
  border-radius: 24px; overflow: hidden; color: #fff; text-align: left; isolation: isolate; box-shadow: var(--shadow-l); transition: transform .25s var(--ease); }
.hero:active { transform: scale(.985); }
.hero-bg { position: absolute; inset: 0; z-index: -1; background: #15171c; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 14, 20, .1) 0%, rgba(12, 14, 20, .5) 50%, rgba(8, 10, 14, .9) 100%); }
.hero-tilt { position: absolute; inset: -34% -14%; transform: rotate(-8deg); container-type: size; }   /* 칸 크기는 이 틀 높이의 1/3 (cqh 는 조상 틀 기준이라 격자를 한 겹 안에) */
.hero-grid { position: absolute; inset: 0; display: grid; grid-template-rows: repeat(3, 1fr); grid-auto-flow: column; grid-auto-columns: calc((100cqh - 20px) / 3); gap: 10px; justify-content: center; }
.hero-grid i { border-radius: 50%; background: var(--c) center/cover; }
.hero-text { position: relative; min-width: 0; }
.hero-text small { display: block; font-size: 13px; font-weight: 700; letter-spacing: .01em; color: rgba(255, 255, 255, .78); }
.hero-text b { display: block; margin-top: 4px; font-size: 30px; font-weight: 850; letter-spacing: -.03em; line-height: 1.1; word-break: keep-all; text-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
.hero-go { position: relative; flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #111418;
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .7); transition: transform .25s var(--spring); }
.hero-go svg { width: 25px; height: 25px; }
@media (hover: hover) { .hero:hover .hero-go { transform: scale(1.06); } }
@media (min-width: 640px) { .hero { min-height: 240px; padding: 26px; } .hero-text b { font-size: 36px; } .hero-go { width: 66px; height: 66px; } }

/* 틀 카드: 위에 칸 그림(칸마다 한 점), 아래에 이름 · 칸 수 */
.tpls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.sec-title + .tpls { margin-top: 0; }
@media (min-width: 640px) { .tpls { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tcard { display: flex; flex-direction: column; align-items: flex-start; min-height: 128px; padding: 14px 14px 13px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); text-align: left; transition: transform .2s var(--ease); }
.tcard:active { transform: scale(.97); }
/* 미리보기: 앞의 여섯 칸 — 고른 것은 선명하게, 빈 칸은 그 칸의 후보를 흐리게 (js/home.js previewHTML) */
.tcard .pv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; }
.tcard .pv i { aspect-ratio: 1; border-radius: 9px; background: color-mix(in srgb, var(--c) 18%, var(--fill)) center/cover; opacity: .38; filter: grayscale(.55); }
.tcard .pv.idol i { border-radius: 50%; background-color: color-mix(in srgb, var(--c) 30%, var(--card)); }
.tcard .pv i.on, .tcard .pv.sample i { opacity: 1; filter: none; }
.tcard .pv i.plus { display: grid; place-items: center; opacity: 1; filter: none; background: var(--fill); font-style: normal; font-size: 12.5px; font-weight: 750; color: var(--label-2); }
/* 이어서: 내 표를 옆으로 */
.recent { display: flex; gap: 12px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
.recent::-webkit-scrollbar { display: none; }
.recent .rcard { flex: none; width: 152px; min-height: 0; scroll-snap-align: start; }
html.dragging .recent { scroll-snap-type: none; }
.tcard b { margin-top: auto; padding-top: 12px; font-size: 16px; font-weight: 800; letter-spacing: -.03em; line-height: 1.25; word-break: keep-all; }
.tcard small { margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--label-2); }
.tcard small em, .hero-text small em { font-style: normal; }
.tcard small em { font-weight: 750; color: var(--tint); }   /* 만들던 표: 찬 칸 수 */
/* 준비 중인 틀: 작은 알약 한 줄 */
.soon-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 2px 0; font-size: 12px; color: var(--label-3); }
.soon-row span { margin-right: 2px; font-weight: 700; }
.soon-row i { padding: 4px 10px; border-radius: 99px; background: var(--fill); font-style: normal; font-weight: 600; color: var(--label-2); }

/* 묶음 카드 + 그 안의 줄 */
.group { border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); overflow: hidden; }
.group > * + * { border-top: .5px solid var(--sep); }
.rowbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 66px; padding: 12px 14px; text-align: left; }
button.rowbtn:active { background: var(--fill); }
.rowbtn .ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--tint) 13%, transparent); color: var(--tint); }
.rowbtn .ic svg { width: 21px; height: 21px; }
.rowbtn .tx { flex: 1; min-width: 0; }
.rowbtn .tx b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.rowbtn .tx small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--label-2); }
.rowbtn .chev { flex: none; color: var(--label-3); }
.rowbtn .chev svg { display: block; width: 18px; height: 18px; }
.rowbtn .pill { flex: none; padding: 4px 10px; border-radius: 99px; background: var(--fill); font-size: 12px; font-weight: 600; color: var(--label-2); }
/* 줄 하나에 단추 둘 (내 틀: 줄 = 표 열기, 연필 = 틀 고치기) */
.rowbtn.split { gap: 2px; min-height: 0; padding: 0 12px 0 0; }
.rowmain { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 66px; padding: 12px 6px 12px 14px; text-align: left; }
.rowmain:active { background: var(--fill); }
.rowmain .tx b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowbtn .tx small em { font-style: normal; font-weight: 750; color: var(--tint); }
.rowbtn.off .ic { background: var(--fill); color: var(--label-2); }
.rowbtn.off .tx b { color: var(--label-2); }

.foot { margin-top: 44px; padding-top: 18px; border-top: .5px solid var(--sep); text-align: center; }
.foot .hub { display: inline-block; padding: 4px 10px; border-radius: 99px; background: var(--fill); color: var(--label-2); font-size: 12px; text-decoration: none; }

/* 아래 탭 줄: 떠 있는 유리 캡슐 — 고른 탭은 서비스 색 글리프 + 옅은 색 알약 */
.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: calc(12px + var(--bottom)); display: flex; justify-content: center; pointer-events: none; }
body:not(.at-root) .tabbar { display: none; }
.side-brand, .side-list, .side-foot { display: none; }
.tabbar .tabs { position: relative; pointer-events: auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  width: min(300px, calc(100% - 28px)); padding: 5px; border-radius: 99px; background: color-mix(in srgb, var(--card) 76%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 0 0 .5px var(--sep), 0 2px 6px rgba(10, 10, 30, .06), 0 20px 40px -18px rgba(20, 20, 60, .5); }
[data-theme="dark"] .tabbar .tabs { background: rgba(44, 44, 48, .72); box-shadow: inset 0 .5px 0 rgba(255, 255, 255, .12), 0 0 0 .5px rgba(255, 255, 255, .08), 0 20px 40px -18px rgba(0, 0, 0, .9); }
.tabbar .tabs button { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 50px; min-width: 0; border-radius: 99px;
  color: var(--label-2); font-size: 10.5px; font-weight: 700; letter-spacing: 0; transition: color .2s, transform .2s var(--ease); }
.tabbar .tabs button svg { width: 22px; height: 22px; }
.tabbar .tabs button[aria-current] { color: var(--tint); }
.tabbar .tabs button:active { transform: scale(.94); }
.tab-thumb { position: absolute; z-index: 0; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px - (var(--n) - 1) * 2px) / var(--n)); border-radius: 99px;
  background: color-mix(in srgb, var(--tint) 13%, transparent); transform: translateX(calc(var(--i) * (100% + 2px))); transition: transform .34s var(--ease); pointer-events: none; }

/* 넓은 화면(960px 이상): 탭 캡슐 대신 왼쪽 옆 줄 — 이름 · 탭 · 내 표 · 설정 · 허브 (노래 폴더의 옆 줄과 같은 꼴). 화면을 오가지 않고 내 표로 바로 */
@media (min-width: 960px) {
  :root { --side: 252px; --tabbar: 0px; }
  body { padding-left: var(--side); }
  body:not(.at-root) .tabbar, .tabbar { display: flex; top: 0; bottom: 0; right: auto; width: var(--side); flex-direction: column; justify-content: flex-start; padding: calc(18px + var(--top)) 12px 14px;
    pointer-events: auto; background: var(--bg); box-shadow: .5px 0 0 var(--sep); overflow: hidden; }   /* 이름 · 탭 · 아래 줄은 그대로, 내 표 목록만 구름 */
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; text-decoration: none; }
  .side-brand img { flex: none; border-radius: 10px; box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--tint-fill) 80%, #000); }
  .side-brand span { font-size: 17px; font-weight: 850; letter-spacing: -.03em; line-height: 1.15; white-space: nowrap; }
  .side-brand small { display: block; margin-bottom: 1px; font-size: 11px; font-weight: 700; letter-spacing: 0; color: var(--label-2); }
  .tabbar .tabs, [data-theme="dark"] .tabbar .tabs { display: flex; flex-direction: column; gap: 2px; width: auto; padding: 0; border-radius: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
  .tab-thumb { display: none; }
  .tabbar .tabs button { flex-direction: row; justify-content: flex-start; gap: 11px; height: 40px; padding: 0 10px; border-radius: 10px; font-size: 14.5px; font-weight: 650; letter-spacing: -.012em; color: var(--label); }
  .tabbar .tabs button svg { width: 20px; height: 20px; color: var(--label-2); }
  .tabbar .tabs button[aria-current] { background: color-mix(in srgb, var(--tint) 13%, transparent); color: var(--tint); }
  .tabbar .tabs button[aria-current] svg { color: var(--tint); }
  .side-list { display: flex; flex-direction: column; flex: 1; gap: 2px; min-height: 0; margin-top: 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .side-label { margin: 0 10px 6px; font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--label-2); }
  .side-row { display: flex; align-items: center; gap: 10px; flex: none; width: 100%; height: 42px; padding: 0 10px; border-radius: 10px; font-size: 14px; font-weight: 600; text-align: left; transition: background-color .2s; }
  .side-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-row small { flex: none; color: var(--label-3); font-size: 12px; font-variant-numeric: tabular-nums; }
  .side-row.on, .side-row:active { background: var(--fill); }
  .side-ic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--fill); color: var(--label-2); }
  .side-ic svg { width: 16px; height: 16px; }
  .side-new { color: var(--tint); }
  .side-new .side-ic { background: color-mix(in srgb, var(--tint) 13%, transparent); color: var(--tint); }
  .side-foot { display: flex; align-items: center; gap: 2px; margin: 8px 0 0; padding: 8px 4px 0; box-shadow: 0 -.5px 0 var(--sep); }
  .side-foot > * { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; color: var(--label-2); font-size: 12.5px; font-weight: 600; text-decoration: none; }
  .side-foot svg { width: 16px; height: 16px; }
  .tabhead [data-settings], .tabhead .tb-group .tb[data-settings], .home .foot { display: none; }   /* 설정 · 허브는 옆 줄 맨 아래에 */
  .tabhead.brand .logo, .tabhead.brand h1 { display: none; }   /* 이름은 옆 줄에 — 본문 머리에 한 번 더 두지 않음 */
  .tabhead.brand { justify-content: flex-end; min-height: 40px; }
  .tabhead:not(.brand) .tb-group { display: none; }   /* 설정만 든 빈 캡슐 (설정은 옆 줄에) */
}
@media (min-width: 960px) and (hover: hover) { .side-row:hover, .side-foot > :hover { background: var(--fill); } .tabbar .tabs button:not([aria-current]):hover { background: var(--fill); } }


/* ───── 표 화면 (js/chart.js) — 처음부터 완성된 꼴의 격자. 칸이 곧 단추: 누르면 그 칸의 후보 시트 */
.poster-wrap { margin-top: 10px; }
/* 표: 저장할 그림과 같은 모양 — 제목 · 칸들 · 아래에 서비스 이름 */
.poster { padding: 20px 16px 14px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow-s); }
.poster h2 { margin: 0 4px 16px; font-size: 24px; font-weight: 850; letter-spacing: -.035em; line-height: 1.15; word-break: keep-all; }
.poster footer { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; font-size: 11.5px; font-weight: 650; color: var(--label-3); }
.poster footer img { width: 16px; height: 16px; border-radius: 4.5px; }
.poster .cells { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; }

/* 칸: 아이돌은 제 이미지 컬러가 옅게 깔린 카드 — 빈 칸은 테두리 + 더하기 */
.cell { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 10px 6px 12px; border-radius: 16px; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 24%, var(--card)), color-mix(in srgb, var(--c) 9%, var(--card))); transition: transform .2s var(--ease); }
.cell:active { transform: scale(.96); }
.cell.none { background: none; box-shadow: inset 0 0 0 1.5px var(--fill); }
.cell .lb { display: flex; align-items: center; justify-content: center; gap: 5px; max-width: 100%; min-width: 0; font-size: 11.5px; font-weight: 750; color: var(--label-2); white-space: nowrap; }
.cell .lb em { font-style: normal; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cell .lb .logo { flex: none; width: 18px; height: 13px; background: var(--sc); }
.cell .lb .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--sc); }
.pk-title .dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.cell .face { display: grid; place-items: center; width: min(100%, 76px); height: auto; aspect-ratio: 1; margin-top: 8px; background: color-mix(in srgb, var(--c) 42%, var(--card)); }
.cell.none .face { background: var(--fill); color: var(--label-3); }
.cell .plus { display: grid; }
.cell .plus svg { width: 24px; height: 24px; }
.cell .tx { margin-top: 8px; max-width: 100%; min-width: 0; }
.cell .tx b { display: block; font-size: 13.5px; font-weight: 750; line-height: 1.25; letter-spacing: -.025em; word-break: keep-all; overflow-wrap: anywhere; }
.cell .tx small { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; font-size: 11px; line-height: 1.3; color: var(--label-2); }
.cell.pop .face, .cell.pop .cv { animation: pop .42s var(--spring); }
@keyframes pop { from { transform: scale(.72); } }
/* 1위를 한 줄 전체로 (10선처럼 칸 수가 3의 배수 + 1 — 마지막 줄에 하나만 남지 않게): 커버 왼쪽 · 글자 오른쪽 */
.poster.lead .cells > .cell:first-child { grid-column: 1 / -1; }
.poster.song.lead .cells > .cell:first-child { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 14px; align-items: start; }
.poster.song.lead .cells > .cell:first-child .lb { grid-column: 1 / -1; }
.poster.song.lead .cells > .cell:first-child .tx { align-self: center; margin: 0; }
.poster.song.lead .cells > .cell:first-child .tx b { font-size: 18px; -webkit-line-clamp: 3; }
.poster.song.lead .cells > .cell:first-child .tx small { font-size: 13px; -webkit-line-clamp: 2; }
.poster.idol.lead .cells > .cell:first-child .face { width: min(100%, 112px); }
/* 곡: 커버가 칸을 채우고 글자는 아래 */
.poster.song .cells { gap: 12px 8px; }
.poster.song .cell { align-items: stretch; padding: 0; border-radius: 0; background: none; box-shadow: none; text-align: left; }
.poster.song .lb { justify-content: flex-start; margin: 0 2px 5px; }
.poster.song .cv { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 12px; background: var(--fill); }
.poster.song .cv .art { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
/* 빈 칸: 그 칸의 앨범 커버를 흐리게 + 더하기 (어느 앨범의 칸인지 보이게) */
.poster.song .cv.ghost .art { opacity: .3; filter: grayscale(.7); }
.poster.song .cv .plus { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; place-items: center; background: var(--card); color: var(--label-2); box-shadow: var(--shadow-s); }
.poster.song .cv .plus svg { width: 18px; height: 18px; }
/* 부른 아이돌 (한 앨범 안에서 고르는 틀의 솔로 곡): 커버 오른쪽 아래에 얼굴 */
.cv .who { position: absolute; right: -4px; bottom: -4px; width: 36%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--c) 45%, var(--card)); box-shadow: 0 0 0 2.5px var(--card); }
.cv .who img { width: 100%; height: 100%; object-fit: cover; }
.poster.song .tx { margin: 6px 2px 4px; }
.poster.song .tx b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; }

/* 동작: 주 동작 하나는 크게, 나머지는 그 아래 한 줄의 작은 칸 (아이콘 위 · 이름 아래) */
.res-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.res-actions .cta { flex: 1 0 100%; }
.res-actions .btn2 { flex: 1 1 0; min-width: 0; height: auto; min-height: 64px; padding: 10px 6px 9px; flex-direction: column; gap: 5px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow-s); font-size: 13px; font-weight: 650; }
.res-actions .btn2 svg { flex: none; width: 21px; height: 21px; color: var(--tint); }
.res-actions .btn2 span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───── 칸 후보 시트: 회색 바탕 + 흰 카드. 머리(칸 이름 · 검색 · 알약)는 붙어 있고 후보만 구름 */
.sheet.picker { display: flex; flex-direction: column; max-height: min(88dvh, 780px); padding-bottom: 0; overflow: hidden; background: var(--bg); }
.sheet.picker.tall { height: min(88dvh, 780px); }   /* 후보가 많은 칸: 검색하는 동안 시트 높이가 출렁이지 않게 */
.sheet.picker .grab { flex: none; }
.sheet.picker .sheet-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pk-top { flex: none; padding-bottom: 12px; }
.pk-title { display: flex; align-items: center; gap: 9px; min-height: 40px; }
.pk-title h2 { flex: 1; min-width: 0; font-size: 21px; font-weight: 850; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-title .logo { flex: none; width: 28px; height: 21px; }
.pk-step { flex: none; padding: 3px 9px; border-radius: 99px; background: var(--fill); font-size: 12.5px; font-weight: 750; color: var(--label-2); }
.pk-title.in h2, .pk-title.in .pk-step { animation: pkIn .28s var(--ease) both; }
@keyframes pkIn { from { opacity: 0; transform: translateX(14px); } }
@media (prefers-reduced-motion: reduce) { .pk-title.in h2, .pk-title.in .pk-step { animation: none; } }
.pk-n { flex: none; min-width: 12px; font-size: 14px; font-weight: 750; color: var(--tint); text-align: right; }
.pk-title .g-cover { flex: none; width: 34px; height: 34px; border-radius: 8px; box-shadow: 0 0 0 .5px var(--sep); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm svg { width: 15px; height: 15px; }
.pill-btn { flex: none; height: 32px; padding: 0 13px; border-radius: 99px; background: var(--fill); font-size: 13.5px; font-weight: 650; color: var(--label-2); }
.pill-btn:active { background: var(--fill-2); }
.pk-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) calc(26px + var(--bottom)); }

.search { position: relative; display: block; margin-top: 10px; }
.search input { width: 100%; height: 44px; padding: 0 14px 0 40px; border: 0; border-radius: 12px; background: var(--fill); color: var(--label); font: inherit; font-size: 16px; }
.search input::placeholder { color: var(--label-3); }
.search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.search > svg { position: absolute; left: 12px; top: 12px; width: 20px; height: 20px; color: var(--label-3); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 10px calc(-1 * var(--gutter)) 0; padding: 2px var(--gutter); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 99px; background: var(--fill); font-size: 14px; font-weight: 600; color: var(--label-2); transition: background .2s, color .2s; }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip[aria-pressed="true"] { background: var(--label); color: var(--bg); }
.more { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 42px; margin-top: 12px; border-radius: 12px; background: var(--fill); font-size: 14px; font-weight: 650; color: var(--label-2); }
.more .num { font-weight: 600; color: var(--label-3); }
/* 후보 묶음 제목 (속성 · 유닛) */
.pk-part { display: flex; align-items: baseline; gap: 6px; margin: 22px 2px 10px; font-size: 13px; font-weight: 800; letter-spacing: .02em; color: var(--label-2); }
.pk-part .num { font-weight: 600; color: var(--label-3); }
.pk-scroll > .pk-part:first-child { margin-top: 2px; }
.more:active { background: var(--fill-2); }

/* 아이돌 후보: 얼굴 넷씩 */
.idols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; }
@media (min-width: 520px) { .idols { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.itile { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 4px 0 2px; text-align: center; }
.face { position: relative; display: block; width: 68px; height: 68px; border-radius: 50%; background: color-mix(in srgb, var(--c) 30%, var(--card)); transition: transform .2s var(--ease), box-shadow .2s; }
.face img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.itile:active .face { transform: scale(.93); }
.itile .nm { max-width: 100%; font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--label); word-break: keep-all; overflow-wrap: anywhere; }
.itile .ck { position: absolute; right: -3px; bottom: -3px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--label); color: var(--bg);
  box-shadow: 0 0 0 2.5px var(--bg); transform: scale(0); transition: transform .28s var(--spring); }
.itile .ck svg { width: 14px; height: 14px; }
.itile[aria-pressed="true"] .face { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 5px var(--label); }
.itile[aria-pressed="true"] .ck { transform: none; }

/* 곡 후보: 묶음 카드 안의 줄 — 오른쪽 동그라미가 고른 표시 */
.srow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 9px 14px; text-align: left; }
.srow:active { background: var(--fill); }
.srow .cv { flex: none; width: 42px; height: 42px; border-radius: 8px; background: var(--fill); object-fit: cover; }
.srow .face.sm { flex: none; width: 42px; height: 42px; }
.srow .tx { flex: 1; min-width: 0; }
.srow .tx b { display: block; font-size: 15.5px; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .tx small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .tx small:empty { display: none; }
.srow .radio { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.8px var(--fill-2); color: transparent; transition: background .2s, box-shadow .2s; }
.srow .radio svg { width: 15px; height: 15px; }
.srow[aria-pressed="true"] .radio { background: var(--tint-fill); box-shadow: none; color: #fff; }

/* ───── 틀 만들기 (js/maker.js) — 제목 · 대상, 칸마다 이름 · 범위. 주 동작은 아래에 붙음 */
.maker { padding-bottom: calc(112px + var(--bottom)); }
.maker .topbar { margin-bottom: 10px; }
.rows.card { border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); }
.rows.card .row .seg { background: var(--fill); }
.sec-title .num { margin-left: -2px; font-weight: 700; letter-spacing: 0; color: var(--label-3); }
.mk-slot { display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 6px 6px 6px 14px; }
.mk-n { flex: none; min-width: 18px; font-size: 13px; font-weight: 700; text-align: center; color: var(--label-3); }
.mk-slot .inp { flex: 1; min-width: 0; height: 40px; padding: 0 8px; background: none; font-weight: 600; }
.mk-slot .inp::placeholder { font-weight: 500; }
/* 범위 알약: 표식(로고 · 얼굴) + 이름 + 아래 화살 */
.mk-range { flex: none; display: inline-flex; align-items: center; gap: 5px; max-width: 44%; height: 34px; padding: 0 8px 0 10px; border-radius: 99px; background: var(--fill); font-size: 13.5px; font-weight: 650; color: var(--label-2); }
.mk-range > span:not(.face) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-range .logo { flex: none; width: 18px; height: 13px; }
.mk-range svg { flex: none; width: 12px; height: 12px; color: var(--label-3); }
.mk-range:active { background: var(--fill-2); }
.mk-x { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--label-3); }
.mk-x svg { width: 13px; height: 13px; }
.mk-x:disabled { opacity: .3; }
.mk-add { display: flex; gap: 8px; margin-top: 10px; }
.mk-add .btn2 { flex: 1 1 0; min-width: 0; height: 46px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow-s); font-size: 14.5px; }
.mk-add .btn2 svg { flex: none; width: 18px; height: 18px; color: var(--tint); }
.mk-add .btn2 span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-del { display: block; margin: 26px auto 0; padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--bad-text); }
.mk-foot { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; padding: 22px var(--gutter) calc(14px + var(--bottom)); background: linear-gradient(180deg, transparent, var(--bg) 46%); pointer-events: none; }
.mk-foot .cta { max-width: 520px; margin: 0 auto; pointer-events: auto; }
/* 범위 시트 · 아이돌마다 한 칸 시트 */
.rows .row.rg-row { width: 100%; text-align: left; }
.rg-row .lb { display: flex; align-items: center; gap: 9px; }
.rg-row .lb .logo { flex: none; width: 24px; height: 18px; }
.rg-row .val { display: inline-flex; align-items: center; gap: 4px; padding-right: 6px; font-size: 15px; color: var(--label-2); }
.rg-row .val svg { width: 16px; height: 16px; color: var(--label-3); }
.rg-row .radio { flex: none; width: 24px; height: 24px; margin-right: 8px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.8px var(--fill-2); color: transparent; }
.rg-row .radio svg { width: 15px; height: 15px; }
.rg-row[aria-pressed="true"] .radio { background: var(--tint-fill); box-shadow: none; color: #fff; }
.rg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rows .chip { background: rgba(0, 0, 0, .06); }
[data-theme="dark"] .rows .chip { background: rgba(0, 0, 0, .28); }
.rows .chip[aria-pressed="true"] { background: var(--label); }
/* 작은 얼굴 표식 (칸 이름 앞 · 범위 알약 · 시트 제목) */
.face.xs { flex: none; display: inline-block; width: 18px; height: 18px; }
.cell .lb .face.xs { width: 18px; height: 18px; margin: 0; aspect-ratio: auto; background: color-mix(in srgb, var(--sc) 36%, var(--card)); }
.pk-title .face.xs { width: 32px; height: 32px; }

/* ───── 오른쪽 패널 (넓은 화면 — js/ui.js sheet side): 뒤의 화면이 그대로 보이고 눌림. 본문은 패널만큼 왼쪽으로 */
@media (min-width: 960px) {
  :root { --panel: 420px; }
  html.panel-on #app { padding-right: var(--panel); transition: padding .3s var(--ease); }
  .sheet-wrap.side { left: auto; width: var(--panel); align-items: stretch; pointer-events: none; }
  .sheet-wrap.side .backdrop { display: none; }
  .sheet-wrap.side .sheet { max-width: none; height: auto; max-height: none; margin: 12px 12px 12px 0; border-radius: 24px; opacity: 1; transform: translateX(105%); transition: transform .32s var(--ease); pointer-events: auto; }
  .sheet-wrap.side.open .sheet { transform: none; }
  .sheet-wrap.side .grab { visibility: hidden; height: 0; margin-bottom: 6px; }
  .sheet-wrap.side .sheet.picker, .sheet-wrap.side .sheet.picker.tall { height: auto; max-height: none; }
  html.panel-on .chart .cell[aria-current="true"] { box-shadow: inset 0 0 0 2.5px var(--label); }
}

/* ───── 아래 시트 */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.sheet-wrap .backdrop { position: absolute; inset: 0; background-color: rgba(0, 0, 0, 0); transition: background-color .3s var(--ease); }
.sheet { position: relative; width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; overscroll-behavior: none; padding: 8px var(--gutter) calc(20px + var(--bottom)); border-radius: 26px 26px 0 0; background: var(--card);
  box-shadow: var(--shadow-l); transform: translateY(105%); transition: transform .34s var(--ease); }
.sheet-wrap.open { pointer-events: auto; }
.sheet-wrap.open .backdrop { background-color: rgba(0, 0, 0, .4); }
.sheet-wrap.open .sheet { transform: none; }
@media (min-width: 640px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 26px; padding-bottom: 22px; transform: translateY(24px) scale(.96); opacity: 0; transition: transform .32s var(--ease), opacity .25s; }
  .sheet-wrap.open .sheet { opacity: 1; }
}
.sheet .grab { width: 36px; height: 5px; margin: 0 auto 10px; border-radius: 99px; background: var(--fill-2); }
.sheet-title { margin: 4px 2px 14px; font-size: 22px; font-weight: 850; letter-spacing: -.03em; }
.rows { border-radius: 16px; background: var(--fill); }
.rows .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; min-height: 52px; padding: 6px 8px 6px 14px; }
.rows .row + .row { border-top: .5px solid var(--sep); }
.rows .row .lb { font-size: 15px; font-weight: 600; word-break: keep-all; }
.rows .row .seg { background: rgba(0, 0, 0, .06); }
[data-theme="dark"] .rows .row .seg { background: rgba(0, 0, 0, .28); }
.rows .row.full { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 10px 10px 10px; }
.rows .row.full .lb { margin-left: 4px; }
.rows .row .inp { flex: 1; min-width: 0; height: 40px; padding: 0 6px; background: none; text-align: right; }
.inp { border: 0; border-radius: 12px; background: var(--fill); color: var(--label); font: inherit; font-size: 16px; }
.inp::placeholder { color: var(--label-3); }
.sheet .cta { margin-top: 18px; }

/* ───── 토스트 */
#toast { position: fixed; left: 50%; bottom: calc(26px + var(--bottom)); z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: calc(100% - 40px);
  padding: 11px 18px; border-radius: 99px; background: rgba(30, 30, 36, .92); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; transition: opacity .25s, transform .3s var(--ease);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
/* 단추가 붙은 알림 (되돌리기) */
body:has(.mk-foot):not(:has(.sheet-wrap)) #toast { bottom: calc(96px + var(--bottom)); }
#toast.act { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 18px; }
#toast span { min-width: 0; white-space: normal; overflow-wrap: anywhere; word-break: keep-all; }
#toast button { flex: none; }
#toast.act.show { pointer-events: auto; }
#toast button { height: 32px; padding: 0 13px; border-radius: 99px; background: rgba(255, 255, 255, .2); color: #fff; font-size: 13.5px; font-weight: 700; }
body.at-root:not(:has(.sheet-wrap)) #toast { bottom: calc(var(--tabbar) + 16px + var(--bottom)); }

@media (hover: hover) {
  .cta:hover { filter: brightness(1.06); }
  .tcard:hover, .more:hover { filter: brightness(.98); }
  .seg button:not([aria-checked="true"]):hover { color: var(--label); }
  .tabbar .tabs button:not([aria-current]):hover { color: var(--label); }
}
@media (prefers-reduced-motion: reduce) { .seg .thumb, .sheet, .itile .ck { transition: none; } }

/* ───── 마우스로 끌기 (js/drag.js) · 시트 끌어 닫기 (js/ui.js pull) */
html.dragging, html.dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
.sheet .grab, .sheet-title, .pk-title { touch-action: none; }
@media (hover: hover) { .chips, .sheet .grab { cursor: grab; } }

/* ───── 묶음 줄의 값 · 표식 (소트 후보 · 들어 본 곡 · 프로필 탭) */
.rowbtn .val { flex: none; font-size: 14px; font-weight: 600; color: var(--label-3); }
.rowbtn .val.on { color: var(--label); }
.rowbtn .ic .logo { width: 24px; height: 18px; }
.rowbtn .ic em { font-style: normal; font-size: 14px; font-weight: 800; }
.rowbtn .ic .cv { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.rowbtn .ic .face { width: 40px; height: 40px; }
.rowbtn.plain { min-height: 46px; justify-content: center; text-align: center; }
.rowbtn.plain .tx b { font-size: 14px; font-weight: 650; color: var(--label-2); }
.tpl-more { margin-top: 12px; }
.bar { display: block; height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: 99px; background: var(--tint); transition: width .3s var(--ease); }
.sortset .topbar, .cmpin .topbar, .heard .topbar, .taste .topbar, .cmp .topbar, .duel .topbar { margin-bottom: 10px; }

/* ───── 소트 (js/sort.js) — 후보 고르기 */
.sortset, .cmpin { padding-bottom: calc(112px + var(--bottom)); }
.ss-resume { margin-bottom: 12px; }
.ss-resume .ic { background: var(--tint-fill); color: #fff; }
.ss-mode { margin: 4px 0 0; }
.sortset .topbar + .sec-title, .cmpin .topbar + .sec-title { margin-top: 8px; }
/* 브랜드 줄: 줄 = 하나씩 고르기, 오른쪽 동그라미 = 그 브랜드 전부 */
.ss-b .ic.brand { background: color-mix(in srgb, var(--c) 14%, var(--card)); }
.ss-b .ic.brand .logo { background: var(--c); }
.ss-b .tx small { color: var(--label-2); }
.tog { flex: none; width: 44px; height: 44px; margin-right: 2px; border-radius: 50%; display: grid; place-items: center; color: transparent; }
.tog::before { content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1.8px var(--fill-2); transition: background .2s, box-shadow .2s; }
.tog { position: relative; }
.tog svg { position: relative; width: 15px; height: 15px; }
.tog.on::before { background: var(--label); box-shadow: none; }
.tog.on { color: var(--bg); }
.tog.part::before { box-shadow: inset 0 0 0 1.8px var(--label); }
.tog.part { color: var(--label); }
/* 고른 후보 줄: 얼굴 · 커버 (누르면 뺌) */
.ss-line { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lineup { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.lineup::-webkit-scrollbar { display: none; }
.lu { flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--c) 30%, var(--card)); }
.lu.song { border-radius: 8px; }
.lu img { width: 100%; height: 100%; object-fit: cover; }
.lu.plus { display: grid; place-items: center; background: var(--fill); font-size: 12px; font-weight: 750; color: var(--label-2); }
.ss-empty { padding: 4px 4px 2px; font-size: 13.5px; color: var(--label-2); }
.ss-note { margin: 10px 4px 0; font-size: 13px; font-weight: 600; color: var(--label-2); }
/* 두 줄 세그먼트: 위는 이름, 아래는 비교 수 */
.seg.two button { height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.15; }
.seg.two button small { font-size: 11.5px; font-weight: 600; color: var(--label-3); }
.seg.two button[aria-checked="true"] small { color: var(--label-2); }
.mk-foot .cta small { margin-left: 8px; font-size: 13px; font-weight: 650; opacity: .82; }

/* ───── 둘 중 고르기: 화면 높이를 채우고, 둘 다 좋음 · 둘 다 모름은 엄지 자리에 붙임 */
.duel { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.duel .topbar h1 { display: flex; flex-direction: column; line-height: 1.15; }
.duel .topbar h1 small { margin-top: 2px; font-size: 12px; font-weight: 650; letter-spacing: 0; color: var(--label-2); }
.duel-prog { height: 4px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.duel-prog i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: 99px; background: var(--label); transition: width .3s var(--ease); }
.duel-settled { display: flex; align-items: center; gap: 6px; min-height: 0; margin-top: 10px; overflow: hidden; }
.duel-settled:empty { margin: 0; }
.duel-settled .lb { flex: none; margin-right: 2px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; color: var(--label-2); }
.duel-settled .st { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--c) 30%, var(--card)); }
.duel-settled .st.song { border-radius: 7px; }
.duel-settled .st img { width: 100%; height: 100%; object-fit: cover; }
.duel-settled .st i { position: absolute; right: 0; bottom: 0; min-width: 13px; height: 13px; padding: 0 2px; border-radius: 7px 0 0 0; background: var(--card); font-style: normal; font-size: 9.5px; font-weight: 800; line-height: 13px; text-align: center; color: var(--label); }
.duel-cards { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: center; gap: 12px; margin-top: 14px; }
.duel-cards.in > * { animation: duelIn .3s var(--ease) both; }
.duel-cards.in > :last-child { animation-delay: .04s; }
@keyframes duelIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.dcard { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: 24px; background: var(--card); box-shadow: var(--shadow-s); transition: transform .17s var(--ease), opacity .17s, box-shadow .17s; }
.dcard.idol { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 26%, var(--card)), color-mix(in srgb, var(--c) 8%, var(--card))); }
[data-theme="dark"] .dcard.idol { background: radial-gradient(110% 70% at 50% 34%, color-mix(in oklch, var(--c) 36%, transparent), transparent 72%), var(--card); }
.dcard.win { transform: scale(1.03); box-shadow: 0 0 0 3px var(--c), var(--shadow-l); }
.dcard.lose { opacity: .35; transform: scale(.97); }
.dpick { position: relative; display: flex; flex-direction: column; align-items: center; flex: 1; width: 100%; padding: 22px 10px 12px; border-radius: 24px; text-align: center; transition: transform .2s var(--ease); }
.dpick:active { transform: scale(.97); }
.dcard.idol .dpick { justify-content: center; min-height: min(46dvh, 360px); }
.dcard .face { width: min(100%, 42vw, 168px); height: auto; aspect-ratio: 1; background: color-mix(in srgb, var(--c) 42%, var(--card)); }
.dcard b { display: block; margin-top: 14px; font-size: 19px; font-weight: 800; letter-spacing: -.03em; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
.dcard small { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.35; color: var(--label-2); }
.dcard.song .dpick { align-items: stretch; text-align: left; padding: 10px 10px 8px; }
.dcard.song .cv { display: block; aspect-ratio: 1; border-radius: 16px; background: var(--fill); overflow: hidden; }
.dcard.song .cv img { width: 100%; height: 100%; object-fit: cover; }
.dcard.song b { margin: 12px 4px 0; font-size: 16.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dcard.song small { margin: 3px 4px 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.dcard.song small.ko { color: var(--label); opacity: .72; }
.dcard kbd { position: absolute; left: 10px; top: 10px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--fill); font: 700 12px/22px var(--font); color: var(--label-2); text-align: center; }
/* 한쪽만 모름 (다른 쪽이 이기고 이쪽은 뺌) */
.nope { align-self: center; margin: 0 0 10px; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 650; color: var(--label-2); }
.nope:active { background: var(--fill); }
/* 미리듣기: 커버 오른쪽 아래 — 고리는 들은 만큼 (시계 반대로 줄어듦, 노래 맞추기 speedRing 과 같은 결) */
.dplay { position: absolute; right: 18px; top: 10px; margin-top: calc(100% - 74px); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(rgba(255, 255, 255, .9) calc((1 - var(--t, 0)) * 360deg), transparent 0) border-box; color: #fff; transition: transform .2s var(--ease); }
.dplay::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: rgba(20, 20, 26, .78); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.dplay[aria-pressed="false"] { background: rgba(20, 20, 26, .6); }
.dplay svg { position: relative; width: 19px; height: 19px; }
.dplay:active { transform: scale(.9); }
.duel-more { position: sticky; bottom: calc(12px + var(--bottom)); display: flex; gap: 8px; margin-top: 14px; padding-top: 8px; }
.duel-more .btn2 { flex: 1 1 0; min-width: 0; height: 48px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow-s); font-size: 15px; }
.duel-more kbd { margin-left: 4px; padding: 0 5px; border-radius: 5px; background: var(--fill); font: 700 11px/18px var(--font); color: var(--label-3); }
@media (hover: hover) and (pointer: fine) {
  .duel-cards { max-width: 760px; width: 100%; margin-left: auto; margin-right: auto; }
  .dcard:not(.lose):not(.win):hover { transform: translateY(-2px); }
}
@media (min-width: 640px) { .dcard .face { width: min(100%, 200px); } .dcard b { font-size: 21px; } }

/* ───── 들어 본 곡 (js/heard.js) */
.hd-sum { margin-bottom: 14px; padding: 18px 18px 16px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); }
.hd-sum p { display: flex; align-items: baseline; gap: 6px; }
.hd-sum b { font-size: 34px; font-weight: 850; letter-spacing: -.03em; line-height: 1.1; }
.hd-sum span { font-size: 15px; font-weight: 600; color: var(--label-2); }
.hd-sum em { margin-left: auto; font-style: normal; font-size: 17px; font-weight: 800; color: var(--label); }
.hd-sum .bar { height: 8px; margin-top: 12px; }
.hd-chips { margin-top: 10px; }
.hd-list { margin-top: 12px; }
.hrow .tx .bar { margin-top: 7px; height: 5px; }
.hrow .bar i, .hd-list .bar i { background: var(--c, var(--label)); }
.hrow .val { min-width: 76px; text-align: right; color: var(--label-2); }
.hrow .chev { margin-left: -4px; }
.hd-search { display: flex; width: 100%; text-align: left; align-items: center; gap: 10px; height: 44px; margin: 0 0 14px; padding: 0 14px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow-s); color: var(--label-3); font-size: 15px; cursor: pointer; }
.hd-search > svg { position: static; flex: none; }
/* 취향 비교: 일치 숫자 · 같은 칸은 내용 색 · 입력 줄의 붙여넣기 · 내 표에서 · 상태 글 */
.cmp-sum p.big { flex: 1.3; }
.ccell.hit { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, var(--card)), color-mix(in srgb, var(--c) 6%, var(--card))); box-shadow: var(--shadow-s); }
.ccell.hit b { color: var(--label); }
.ccell .pair.same { display: flex; justify-content: center; }
.ccell .pair.same > * { width: 62%; }
.ccell .pair.same > * + * { margin-left: -28%; box-shadow: 0 0 0 2.5px var(--card); border-radius: 50%; }
.cmp-grid.song .ccell .pair.same > * + * { border-radius: 8px; }
.cmpin .row.cin { flex-wrap: wrap; }
.cmpin .row .acts { display: flex; gap: 6px; width: 100%; justify-content: flex-end; padding-bottom: 4px; }
.cmpin .row .st { width: 100%; margin: -2px 0 4px; font-size: 12.5px; color: var(--label-2); text-align: right; }
.cmpin .row .st.bad { color: var(--bad-text); }

.hrow .tx b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───── 취향 분석 (js/stats.js) */
.stats h3 { margin: 22px 2px 10px; font-size: 12.5px; font-weight: 800; letter-spacing: .04em; color: var(--label-2); }
.stats h3:first-child { margin-top: 0; }
.st-bar { display: flex; gap: 2px; height: 22px; border-radius: 99px; overflow: hidden; }
.st-bar i { min-width: 6px; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13.5px; font-weight: 600; }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-legend i { width: 9px; height: 9px; border-radius: 50%; }
.st-legend em { font-style: normal; color: var(--label-2); }
.st-pal { display: flex; gap: 6px; }
.st-pal i { flex: 1; max-width: 48px; aspect-ratio: 1; border-radius: 12px; box-shadow: inset 0 0 0 .5px var(--sep); }
.st-years { display: flex; align-items: flex-end; gap: 3px; height: 84px; }
.st-years i { flex: 1; max-width: 28px; height: max(4px, calc(var(--p) * 100%)); border-radius: 4px; background: var(--label); }
.st-years i.zero { background: var(--fill); }
.st-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--label-3); }
.st-idols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.st-idols > span { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; text-align: center; }
.st-idols .face { width: min(100%, 56px); height: auto; aspect-ratio: 1; }
.st-idols b { font-size: 12px; font-weight: 650; line-height: 1.2; word-break: keep-all; overflow-wrap: anywhere; }
.st-idols em { font-style: normal; font-size: 12px; color: var(--label-2); }

/* ───── 그림 시트 (js/image.js show) */
.img-box { display: grid; place-items: center; min-height: 220px; max-height: 54dvh; border-radius: 16px; background: var(--fill); overflow: auto; overscroll-behavior: contain; }
.img-box img { width: 100%; height: auto; align-self: start; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--fill-2); border-top-color: var(--tint); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.img-box.busy img { opacity: .4; transition: opacity .2s; }
.img-opts { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.img-opts .seg button { padding: 0 6px; font-size: 13.5px; }
.img-acts .off { opacity: .45; pointer-events: none; }
.img-acts { display: flex; gap: 8px; margin-top: 12px; }
.img-acts .cta { flex: 1; margin-top: 0; text-decoration: none; }
.img-acts .btn2 { flex: none; width: auto; height: 56px; padding: 0 18px; border-radius: 16px; }

.inp.sel { flex: 0 1 auto; width: auto; padding-right: 10px; -webkit-appearance: none; appearance: none; text-align-last: right; cursor: pointer; }

/* ───── 취향 비교 (js/compare.js) */
.cmp-sum { display: flex; gap: 10px; }
.cmp-sum p { flex: 1; min-width: 0; padding: 16px 18px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); }
.cmp-sum b { display: block; font-size: 34px; font-weight: 850; letter-spacing: -.03em; line-height: 1.1; }
.cmp-sum b i { font-style: normal; font-size: 17px; font-weight: 700; color: var(--label-3); }
.cmp-sum span { display: block; margin-top: 2px; font-size: 13px; font-weight: 650; color: var(--label-2); }
.cmp-both { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 12px 8px; margin-top: 12px; padding: 16px 12px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); }
.ctile { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; }
.ctile .face { width: min(100%, 64px); height: auto; aspect-ratio: 1; }
.ctile .cv { width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; background: var(--fill); }
.ctile b { max-width: 100%; font-size: 12px; font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; overflow-wrap: anywhere; }
.cmp-legend { display: flex; gap: 6px; margin: 0 2px 10px; font-size: 12px; font-weight: 650; color: var(--label-2); }
.cmp-legend span + span::before { content: '·'; margin: 0 6px 0 0; }
.cmp-grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; }
.ccell { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 10px 6px 8px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow-s); text-align: center; }

.ccell .lb { max-width: 100%; font-size: 11.5px; font-weight: 750; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccell .lb em { font-style: normal; }
.ccell .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; margin-top: 8px; }
.ccell .pair > * { width: 100%; height: auto; aspect-ratio: 1; }
.ccell .pair .cv { border-radius: 8px; object-fit: cover; background: var(--fill); }
.ccell .pair .none { border-radius: 50%; background: var(--fill); }
.cmp-grid.song .pair .none { border-radius: 8px; }
.ccell b { max-width: 100%; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { .duel-cards.in > * { animation: none; } .spin { animation-duration: 2s; } }

/* ───── 머리의 단추 묶음 (design.md .tb-group — 회색 원 여럿 대신 흰 캡슐 하나) */
.tb-group { flex: none; display: flex; align-items: center; gap: 0; padding: 3px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow-s); }
.tb-group .tb { width: 38px; height: 34px; border-radius: 99px; display: grid; place-items: center; color: var(--label-2); transition: background .2s, transform .2s var(--ease); }
.tb-group .tb svg { width: 19px; height: 19px; }
.tb-group .tb:active { transform: scale(.92); background: var(--fill); }
@media (hover: hover) { .tb-group .tb:hover { background: var(--fill); color: var(--label); } }
.topbar .sp { flex: 1; }
.theirs-pill { flex: none; padding: 5px 11px; border-radius: 99px; background: var(--fill); font-size: 12.5px; font-weight: 700; color: var(--label-2); }

/* ───── 첫 화면: 구역마다 옆으로 넘기는 카드 줄 (폰) · 넓은 화면은 격자 */
.tpls.row { display: flex; gap: 12px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 8px; scroll-snap-type: x proximity; scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.tpls.row::-webkit-scrollbar { display: none; }
.tpls.row .tcard { flex: none; width: 156px; min-height: 0; scroll-snap-align: start; }
.hero + .tpls.row { margin-top: 12px; }
html.dragging .tpls.row { scroll-snap-type: none; }
@media (min-width: 640px) {
  .tpls.row { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); overflow: visible; margin: 0; padding: 0; }
  .tpls.row .tcard { width: auto; }
  .hero + .tpls.row { margin-top: 12px; }
}
@media (min-width: 960px) { .home { max-width: 1120px; padding-left: 40px; padding-right: 40px; } }
.tcard { position: relative; }
/* '다른 해 · 다른 달': 카드 단추 옆의 따로 된 단추 (단추 안에 단추를 두지 않음) */
.tcard-x { position: relative; display: flex; min-width: 0; }
.tcard-x > .tcard { flex: 1; min-width: 0; }
.tpls.row .tcard-x { flex: none; width: 156px; scroll-snap-align: start; }
.tpls.row .tcard-x > .tcard { width: auto; flex: 1; }
.tcard-x .more-y { position: absolute; right: 10px; bottom: 10px; z-index: 1; padding: 5px 9px; border-radius: 99px; background: var(--fill); font-size: 11px; font-weight: 700; color: var(--label-2); transition: transform .2s var(--ease); }
.tcard-x .more-y::after { content: ''; position: absolute; inset: -8px -6px; }
.tcard-x .tcard small { padding-right: 60px; }
@media (hover: hover) { .tcard-x:hover .more-y { transform: translateY(-2px); } }
@media (min-width: 640px) { .tpls.row .tcard-x { width: auto; } }
@media (hover: hover) { .tcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-s), 0 18px 36px -22px rgba(20, 20, 60, .35); } .tcard { transition: transform .2s var(--ease), box-shadow .2s; } }
/* 오늘 생일 */
.bday { margin-top: 14px; }
.bday .faces { flex: none; display: flex; }
.bday .faces .face { width: 40px; height: 40px; box-shadow: 0 0 0 2.5px var(--card); background: color-mix(in srgb, var(--c) 30%, var(--card)); }
.bday .faces .face + .face { margin-left: -12px; }
.bday .tx small { margin: 0 0 1px; font-weight: 700; color: var(--label-2); }
.bday .tx b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 소트 탭: 큰 카드 둘 */
.sort-cards { display: grid; gap: 12px; }
@media (min-width: 640px) { .sort-cards { grid-template-columns: 1fr 1fr; } }
.sort-card { position: relative; }
.hero.sm { min-height: 150px; }
.hero.sm .hero-text b { font-size: 26px; }
.hero.sm .hero-go { width: 52px; height: 52px; }
.hero.sm .hero-go svg { width: 22px; height: 22px; }
.hero-grid i.sq { border-radius: 14px; }
.sort-card .pill-btn.new { position: absolute; right: 16px; top: 14px; background: rgba(255, 255, 255, .22); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hero-text small em { font-style: normal; font-weight: 800; color: #fff; }
.rowbtn.hist .tops { flex: none; display: flex; }
.rowbtn.hist .tops > * { width: 32px; height: 32px; overflow: hidden; box-shadow: 0 0 0 2px var(--card); background: color-mix(in srgb, var(--c) 30%, var(--card)); }
.rowbtn.hist .tops > * + * { margin-left: -8px; }
.rowbtn.hist .tops .cv { border-radius: 7px; }
.rowbtn.hist .tops img { width: 100%; height: 100%; object-fit: cover; }
/* 찾기 · 해/달 고르기 */
.srow .pv.mini { flex: none; display: block; width: 42px; height: 42px; }
.srow .pv.mini i { display: block; width: 42px; height: 42px; border-radius: 9px; background: color-mix(in srgb, var(--c) 18%, var(--fill)) center/cover; opacity: 1; filter: none; }
.srow .pv.mini.idol i { border-radius: 50%; }
.srow .pv.mini i.plus { display: none; }
.srow .chev, .srow > .chev { flex: none; color: var(--label-3); }
.srow .chev svg { width: 18px; height: 18px; display: block; }
.when { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.when .chip { justify-content: center; padding: 0 8px; background: var(--fill); font-variant-numeric: tabular-nums; }
.when .chip em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--label); }
.when .chip.has { background: color-mix(in srgb, var(--label) 10%, var(--fill)); color: var(--label); }
.empty.sm { padding: 18px 0 6px; font-size: 14px; }
.sheet.picker .btn2 { margin-top: 12px; }
/* 아이돌 정보 시트 */
.idinfo { display: flex; flex-direction: column; align-items: center; padding: 6px 0 14px; text-align: center; }
.face.big { width: 120px; height: 120px; background: color-mix(in srgb, var(--c) 34%, var(--card)); box-shadow: 0 16px 34px -18px var(--c); }
.idinfo h2 { margin-top: 14px; font-size: 26px; font-weight: 850; letter-spacing: -.035em; }
.idinfo .alt { margin-top: 3px; font-size: 13px; color: var(--label-2); }
.idinfo .tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.idinfo .tags .pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: var(--fill); font-size: 13px; font-weight: 650; }
.idinfo .tags .logo { width: 18px; height: 14px; }
.info-rows .row .val { display: inline-flex; align-items: center; gap: 7px; padding-right: 6px; font-size: 15px; color: var(--label-2); text-align: right; }
.info-rows .sw { width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15); }
.sheet.info .cta { margin-top: 16px; }
.sheet.info .btn2 { margin-top: 8px; }
.about p { margin: 0 2px 12px; font-size: 14.5px; line-height: 1.55; color: var(--label-2); }
.about h3 { margin: 18px 2px 6px; font-size: 12.5px; font-weight: 800; letter-spacing: .04em; color: var(--label-2); }
.foot { display: flex; justify-content: center; gap: 6px; }
.foot .hub { border: 0; font: inherit; font-size: 12px; cursor: pointer; }

/* ───── 표 화면: 빈 칸 · 안내 · 아래에 붙는 줄 · 공유 시트 */
.poster .hint { margin: -6px 4px 14px; font-size: 13.5px; font-weight: 600; color: var(--label-2); }
.cell.none { background: var(--card-2); box-shadow: none; }
[data-theme="dark"] .cell.none { background: #242426; }
.cell.none .face { position: relative; background: color-mix(in srgb, var(--sc) 12%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--label) 12%, transparent); }
.cell .face .gh { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; opacity: .3; filter: grayscale(.6); }
.cell .face .logo.gh { inset: 26%; width: auto; height: auto; border-radius: 0; background: var(--sc); opacity: .42; filter: none; }
.cell.none .face .plus { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; place-items: center; background: var(--card); color: var(--label-2); box-shadow: var(--shadow-s); }
.cell.none .face .plus svg { width: 14px; height: 14px; }
.cell .lb em { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; line-height: 1.22; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.cell .lb { white-space: normal; align-items: flex-start; }
.poster.song .cell .lb em { text-align: left; }
.poster.ranked .cell .lb em { font-size: 14px; font-weight: 850; color: var(--label); font-variant-numeric: tabular-nums; }
.poster.ranked.lead .cells > .cell:first-child .lb em { font-size: 22px; }
[data-theme="dark"] .poster.idol .cell:not(.none) { background: radial-gradient(110% 75% at 50% 40%, color-mix(in oklch, var(--c) 38%, transparent) 0, transparent 70%), linear-gradient(180deg, color-mix(in oklch, var(--c) 14%, #1c1c1e), #1c1c1e); }
[data-theme="dark"] .poster.idol .cell:not(.none) .face { background: color-mix(in oklch, var(--c) 50%, #1c1c1e); }
.chart-foot { position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 14px; margin: 14px calc(-1 * var(--gutter)) calc(-28px - var(--bottom)); padding: 18px var(--gutter) calc(14px + var(--bottom)); background: linear-gradient(180deg, transparent, var(--bg) 34%); }
.chart-foot .prog { flex: none; min-width: 48px; font-size: 14px; font-weight: 650; color: var(--label-2); }
.chart-foot .prog b { font-size: 20px; font-weight: 850; letter-spacing: -.03em; color: var(--label); }
.chart-foot .cta { flex: 1; }
.chart .res-actions .btn2 span, .tier .res-actions .btn2 span { white-space: normal; word-break: keep-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.18; font-size: 12.5px; text-align: center; }
.chart .res-actions .btn2, .tier .res-actions .btn2 { min-height: 68px; }
body.at-root:not(:has(.sheet-wrap)) #toast, body:has(.chart-foot):not(:has(.sheet-wrap)) #toast { bottom: calc(96px + var(--bottom)); }
body:has(.duel-more):not(:has(.sheet-wrap)) #toast { bottom: calc(104px + var(--bottom)); }
@media (min-width: 960px) {
  html.panel-on #toast { left: calc(50% + var(--side) / 2 - var(--panel) / 2); }
  html.panel-on body:has(.chart-foot) #toast, html.panel-on body:has(.tier) #toast { bottom: calc(96px + var(--bottom)); }
}
.share-rows .sh-row { flex-wrap: nowrap; padding: 4px 8px 4px 4px; }
.sh-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 56px; padding: 6px 8px; border-radius: 12px; text-align: left; }
.sh-main:active { background: var(--fill); }
.sh-main .ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--card); color: var(--label); box-shadow: var(--shadow-s); }
.sh-main .ic svg { width: 20px; height: 20px; }
.sh-main .tx { min-width: 0; }
.sh-main .tx b { display: block; font-size: 15.5px; font-weight: 700; }
.sh-main .tx small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───── 후보 시트 더하기: 다른 칸에 있는 것 · 정보 줄 · 최근 줄 · 여러 개 고르기 */
.pill-btn.done { background: var(--label); color: var(--bg); font-weight: 750; }
.itile .face .used { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); max-width: 110%; padding: 1px 6px; border-radius: 99px; background: var(--label); font-style: normal; font-size: 10px; font-weight: 750; line-height: 16px; color: var(--bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow .used { flex: none; max-width: 30%; padding: 2px 8px; border-radius: 99px; background: var(--fill); font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itile .inf { margin-top: -4px; font-size: 11px; color: var(--label-2); }
.rrow { display: flex; gap: 10px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; scrollbar-width: none; }
.rrow::-webkit-scrollbar { display: none; }
.rtile { flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 64px; text-align: center; }
.rtile .face { width: 54px; height: 54px; }
.rtile .cv { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: var(--fill); }
.rtile .nm { max-width: 100%; font-size: 11px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-n { color: var(--label-2); }
/* 여러 개 고르기: 빠진 것이 흐리게 (고른 것은 체크 배지만) */
.sheet-wrap.multi .itile[aria-pressed="false"] .face img { filter: grayscale(1); opacity: .42; }
.sheet-wrap.multi .itile[aria-pressed="false"] .nm { color: var(--label-2); }
.sheet-wrap.multi .itile[aria-pressed="true"] .face { box-shadow: none; }

/* ───── 티어표 (js/tier.js): 줄 이름 칸은 무채색 + 굵은 글자 (색은 얼굴 · 커버가 냄 — design.md) */
.tierboard { padding: 20px 16px 14px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow-s); }
.tierboard h2 { margin: 0 4px 14px; font-size: 24px; font-weight: 850; letter-spacing: -.035em; }
.tierboard footer { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; font-size: 11.5px; font-weight: 650; color: var(--label-3); }
.tierboard footer img { width: 16px; height: 16px; border-radius: 4.5px; }
.trow { display: flex; gap: 8px; min-height: 64px; padding: 6px; border-radius: 16px; background: var(--card-2); transition: box-shadow .15s, background .15s; }
.trow + .trow { margin-top: 6px; }
.trow .tl { flex: none; width: 48px; border-radius: 11px; display: grid; place-items: center; background: var(--card); font-size: 22px; font-weight: 850; color: var(--label); box-shadow: var(--shadow-s); }
[data-theme="dark"] .trow { background: #242426; }
.titems { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; flex: 1; min-width: 0; min-height: 52px; }
.trow.can, .titems.pool.can { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--label) 22%, transparent); cursor: pointer; }
.trow.over, .titems.pool.over { box-shadow: inset 0 0 0 2px var(--label); }
.ti { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--c) 34%, var(--card)); transition: transform .15s var(--ease), box-shadow .15s; touch-action: manipulation; }
.ti.song { border-radius: 10px; }
.ti img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ti.lift { transform: scale(1.08); box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 5px var(--label), 0 10px 18px -8px rgba(0, 0, 0, .4); }
.ti.dragging-src { opacity: .3; }
.ti.ghost-drag { position: fixed; z-index: 90; left: 0; top: 0; width: 56px; height: 56px; pointer-events: none; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .5); }
.tpool { margin-top: 6px; }
.tpool .titems.pool { min-height: 64px; padding: 8px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow-s); }
.tpool .hint { margin: 8px 4px 0; font-size: 13px; font-weight: 600; color: var(--label-2); }
@media (min-width: 640px) { .ti { width: 60px; height: 60px; } }

/* ───── 그림 시트 더하기 */
.img-more { margin-top: 10px; }
.img-more .row .seg { min-width: 120px; }
.img-note { min-height: 0; margin: 8px 4px 0; font-size: 12.5px; line-height: 1.45; color: var(--label-2); }
.img-note:empty { display: none; }
.img-acts .btn2.sm { flex: none; width: auto; height: 56px; padding: 0 16px; border-radius: 16px; text-decoration: none; color: var(--label); }
.img-acts .btn2.sm span { white-space: nowrap; }
.img-box img { width: auto; max-width: 100%; max-height: calc(54dvh - 24px); margin: 12px auto; object-fit: contain; border-radius: 10px; box-shadow: var(--shadow-s); }
.img-box { overflow: auto; }

/* ───── 다듬기: 덩어리가 차례로 떠오름 (design.md 0.03초 · 8px) · 대비 · 누르는 자리 */
.home > *, .screen > * { animation: fadeIn .35s var(--ease) both; }
.home > :nth-child(2), .screen > :nth-child(2) { animation-delay: 30ms; }
.home > :nth-child(3), .screen > :nth-child(3) { animation-delay: 60ms; }
.home > :nth-child(4), .screen > :nth-child(4) { animation-delay: 90ms; }
.home > :nth-child(5), .screen > :nth-child(5) { animation-delay: 120ms; }
.home > :nth-child(6), .screen > :nth-child(6) { animation-delay: 150ms; }
.home > :nth-child(n+7), .screen > :nth-child(n+7) { animation-delay: 180ms; }
.fade-in { animation: none; }
.chart-foot, .duel-more { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .home > *, .screen > * { animation: none; } }
.icon-btn.sm, .mk-x, .pill-btn { position: relative; }
.icon-btn.sm::after, .mk-x::after { content: ""; position: absolute; inset: -6px; }
select:focus-visible { outline: 2.5px solid var(--tint); outline-offset: 2px; }
.rowbtn .val, .sec-title .num, .pk-part .num, .more .num, .st-axis, .tierboard footer, .poster footer { color: var(--label-2); }
.tcard small em, .rowbtn .tx small em { color: var(--label); }
.bar i { background: var(--label); }
:root[data-theme="dark"] { --tint-fill: #0b7f74; }

/* ───── 첫 로딩 뼈대 (index.html — 데이터를 받는 동안 빈 화면 대신) */
.boot { max-width: 880px; margin: 0 auto; padding: calc(16px + var(--top)) var(--gutter); }
.boot i { display: block; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); animation: bootPulse 1.2s ease-in-out infinite alternate; }
.boot .b1 { width: 52%; height: 44px; margin-bottom: 22px; border-radius: 14px; }
.boot .b2 { height: 190px; border-radius: 24px; }
.boot .b3 { height: 150px; margin-top: 12px; }
@keyframes bootPulse { to { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .boot i { animation: none; } }
/* 그림을 못 받았을 때: 그 자리에 색만 (빈 흰 칸 대신 — js/ui.js) */
img.broken { visibility: hidden; }
.sheet:focus { outline: none; }


.copybox { width: 100%; margin-top: 4px; padding: 12px 14px; resize: none; font-size: 14px; line-height: 1.45; }

/* ───── 접는 묶음 (js/home.js block): 머리 줄을 누르면 접고 폄 — 줄표가 '+' 로 */
.sec-title:has(.fold)::before { content: none; }
.sec-title .fold { position: relative; display: inline-flex; align-items: center; gap: 8px; margin: -6px -8px; padding: 6px 8px; border-radius: 8px; font: inherit; letter-spacing: inherit; color: inherit; }
.sec-title .fold::before { content: ""; flex: none; width: 14px; height: 2.5px; border-radius: 2px; background: var(--tint); }
.sec-title .fold::after { content: ""; position: absolute; left: 13.75px; top: 50%; width: 2.5px; height: 14px; margin-top: -7px; border-radius: 2px; background: var(--tint); transform: scaleY(0); transition: transform .2s var(--ease); }
.sec.folded .sec-title .fold::after { transform: scaleY(1); }
.sec.folded .sec-body { display: none; }
.sec.folded .sec-title { margin-bottom: 0; }
@media (hover: hover) { .sec-title .fold:hover { background: var(--fill); color: var(--label); } }
.sec-body > .tpls:first-child { margin-top: 0; }
.tabhead + .sec .sec-title { margin-top: 4px; }

/* ───── 소트 방식: 카드 둘 (순위 · 월드컵) */
.ss-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 0; }
.mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px 14px 13px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); text-align: left; transition: box-shadow .2s, transform .2s var(--ease); }
.mode-card .mc-ic { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 6px; border-radius: 11px; background: var(--fill); color: var(--label-2); transition: background .2s, color .2s; }
.mode-card .mc-ic svg { width: 21px; height: 21px; }
.mode-card b { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.mode-card small { font-size: 12.5px; font-weight: 600; color: var(--label-2); word-break: keep-all; }
.mode-card[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--label), var(--shadow-s); }
.mode-card[aria-checked="true"] .mc-ic { background: var(--label); color: var(--bg); }
.mode-card:active { transform: scale(.98); }

/* 커버곡 제외: 줄 끝의 스위치 */
.rowbtn .sw { flex: none; position: relative; width: 46px; height: 28px; margin-left: auto; border-radius: 99px; background: var(--fill-2); transition: background .2s; }
.rowbtn .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.rowbtn[aria-checked="true"] .sw { background: var(--tint-fill, var(--tint)); }
.rowbtn[aria-checked="true"] .sw::after { transform: translateX(18px); }

/* 순위 수 직접 */
.ss-custom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 8px 8px 8px 16px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); }
.ss-custom .lb { font-size: 15px; font-weight: 650; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper .icon-btn { font-size: 18px; font-weight: 700; color: var(--label); }
.stepper input { width: 64px; height: 36px; border: 0; border-radius: 10px; background: var(--fill); color: var(--label); font: inherit; font-size: 17px; font-weight: 750; text-align: center; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ───── 소트 테마 (소트 탭) */
.th-kind { margin-bottom: 12px; }
.th-kind .seg { max-width: 260px; }
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 359px) { .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 640px) { .themes { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; } .tcard.theme { padding: 12px 12px 11px; } .tcard.theme b { font-size: 14.5px; } }
@media (min-width: 1200px) { .themes { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tcard.theme { min-height: 0; padding: 10px 10px 9px; }
.tcard.theme .pv { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin-bottom: 2px; }
.tcard.theme b { margin-top: 7px; font-size: 13.5px; line-height: 1.25; word-break: keep-all; }
.tcard.theme small { font-size: 12px; }

/* ───── 내 취향 (#/stats, js/taste.js) */
.taste { padding-bottom: 40px; }
.ttiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ttile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 12px 11px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); min-width: 0; }
.ttile b { font-size: 22px; font-weight: 850; letter-spacing: -.03em; line-height: 1.1; }
.ttile span { font-size: 12px; font-weight: 650; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tempty { display: flex; gap: 10px; }
.tsec .sec-title { margin-top: 26px; }
.tsec .st-bar, .tsec .st-pal, .tsec .st-years, .tsec .st-idols { margin-top: 2px; }
.trank { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 8px; padding: 14px 12px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); }
.tr-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; text-align: center; }
.tr-item .face { width: min(100%, 60px); height: auto; aspect-ratio: 1; }
.tr-item .cv { display: block; width: min(100%, 60px); aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--fill); }
.tr-item .cv img { width: 100%; height: 100%; object-fit: cover; }
.tr-item i { position: absolute; top: -4px; left: calc(50% - 34px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--label); color: var(--bg); font-style: normal; font-size: 11px; font-weight: 800; line-height: 20px; }
.tr-item b { max-width: 100%; margin-top: 3px; font-size: 12px; font-weight: 700; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tr-item em { font-style: normal; font-size: 11.5px; font-weight: 650; color: var(--label-2); }
.twin { display: flex; gap: 10px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; scrollbar-width: none; }
.twin::-webkit-scrollbar { display: none; }
.tw { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 92px; padding: 12px 8px 10px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow-s); text-align: center; }
.tw .face { width: 60px; height: 60px; }
.tw .cv { display: block; width: 60px; height: 60px; border-radius: 10px; overflow: hidden; }
.tw .cv img { width: 100%; height: 100%; object-fit: cover; }
.tw b { max-width: 100%; margin-top: 4px; font-size: 12.5px; font-weight: 750; line-height: 1.25; word-break: keep-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tw small { font-size: 11px; font-weight: 600; color: var(--label-2); }
@media (max-width: 380px) { .trank { grid-template-columns: repeat(4, minmax(0, 1fr)); } .ttile b { font-size: 19px; } }
/* 프로필 탭의 내 취향 카드 */
.tcard-me { display: flex; align-items: center; gap: 12px; padding: 14px; color: inherit; text-decoration: none; }
.tm-pics { display: flex; flex: none; }
.tm-pics > span { width: 40px; height: 40px; margin-right: -8px; border-radius: 50%; box-shadow: 0 0 0 2.5px var(--card); overflow: hidden; background: color-mix(in srgb, var(--c) 30%, var(--card)); }
.tm-pics > .cv { border-radius: 10px; }
.tm-pics img { width: 100%; height: 100%; object-fit: cover; }
.tcard-me .tx { flex: 1; min-width: 0; margin-left: 8px; }
.tcard-me .tx b { display: block; font-size: 16px; font-weight: 750; }
.tcard-me .tx small { font-size: 13px; color: var(--label-2); }
.tcard-me .chev { color: var(--label-3); }


/* ───── 넓은 화면: 아래 단추 · 토스트를 본문 가운데에 (앞쪽 규칙은 뒤의 기본값에 덮였음) */
@media (min-width: 960px) {
  body .mk-foot { left: var(--side); }
  html.panel-on body .mk-foot { right: var(--panel); }
  html #toast { left: calc(50% + var(--side) / 2); }
  html.panel-on #toast { left: calc(50% + var(--side) / 2 - var(--panel) / 2); }
}


/* ═════ 검토 반영 2026-11-14: 디자인 · 넓은 화면 ═════ */
a.tcard, a.rowbtn, a.side-row { color: inherit; text-decoration: none; -webkit-user-drag: none; }
/* 표 격자: 칸 하나 = 두 줄 (마지막 줄에 남은 칸을 가운데로 — js/chart.js lastStart) */
.poster .cells { grid-template-columns: repeat(calc(var(--cols) * 2), minmax(0, 1fr)); }
.poster .cells > .cell { grid-column: span 2; }
.poster.lead .cells > .cell:first-child { grid-column: 1 / -1; }
/* 곡 칸: 같은 줄의 커버가 같은 높이에서 시작 (칸 이름 줄 수가 달라도) */
.poster:not(.lead) .cells > .cell, .poster.lead .cells > .cell:not(:first-child) { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }   /* 아이돌 칸도 같게 */
.poster .cells > .cell > .lb { align-self: end; }
/* 칸 이름 앞 표식: 첫 줄 가운데 */
.cell .lb .dot { margin-top: 2.5px; }
.cell .lb .face.xs { margin-top: -2px; }
.cell .lb .logo { margin-top: .5px; }
/* 곡 제목 줄 바꿈: 일본어 제목이 글자 중간에서 끊기지 않게 */
.poster.song .tx b, .dcard.song b, .ctile b { word-break: normal; overflow-wrap: break-word; line-break: strict; }
/* 하얀 이미지 컬러 · 흰 바탕 커버의 가장자리 */
.face img { outline: 1px solid color-mix(in srgb, var(--label) 8%, transparent); outline-offset: -1px; }
.poster.idol .cell:not(.none), .dcard.idol { box-shadow: inset 0 0 0 .5px var(--sep), var(--shadow-s); }
.poster.song .cv .art, .srow .cv, .rtile .cv, .dcard.song .cv img, .lu.song img { outline: 1px solid color-mix(in srgb, var(--label) 7%, transparent); outline-offset: -1px; }
/* 확정 줄의 순위 번호: 동그라미 밖의 알약 */
.duel-settled { gap: 9px; padding: 2px 0 5px; }
.duel-settled .st { overflow: visible; }
.duel-settled .st img { border-radius: inherit; }
.duel-settled .st i { right: -5px; bottom: -4px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px; line-height: 15px; background: var(--label); color: var(--bg); box-shadow: 0 0 0 2px var(--bg); }
/* 소트 후보 줄의 +N: 숫자만큼 넓게, 곡이면 둥근 네모 */
.lineup { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 22px), transparent); }
/* 분석의 색 칸: 늘 같은 모양 · 아이돌 줄의 숫자 한 줄로 */
.st-pal { flex-wrap: wrap; }
.st-pal i { flex: none; width: 34px; height: 34px; max-width: none; border-radius: 30%; }
.st-idols em { margin-top: auto; }
/* 지난 결과 · 오늘 생일: 1위가 맨 위 */
.rowbtn.hist .tops > *, .bday .faces > * { position: relative; }
.rowbtn.hist .tops > :nth-child(1), .bday .faces > :nth-child(1) { z-index: 3; }
.rowbtn.hist .tops > :nth-child(2), .bday .faces > :nth-child(2) { z-index: 2; }
/* 두 줄 칸의 숫자 · 검색 칸 초점 · 지우기 단추 */
.seg.two button small { color: var(--label-2); }
.search input:focus-visible, .inp:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tint) 55%, transparent); }
/* 이미지 시트 (폰): 저장 단추가 늘 보이게 */
/* 닫기 단추 (넓은 화면의 가운데 창) — 폰은 끌어 닫기라 숨김 */
.sheet-x { display: none; }
@media (min-width: 640px) {
  .sheet-wrap:not(.side) .sheet .grab { visibility: hidden; height: 0; margin-bottom: 14px; }   /* 끌어 닫기는 폰만 — 자리만 둠 */
  .sheet-wrap:not(.side) .sheet-x { display: grid; position: absolute; top: 14px; right: 14px; z-index: 2; }
  .sheet-wrap:not(.side) .sheet-title { padding-right: 44px; }
}
html.sheet-on { background-color: color-mix(in srgb, var(--bg) 60%, #000); transition: background-color .3s var(--ease); }   /* 창이 떴을 때 오른쪽 스크롤 자리도 어둡게 */

/* 고르는 칸 표시: 둥근 테두리 (선택한 후보 표시와 같은 꼴) */
html.panel-on .chart .cell[aria-current="true"] { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 5px var(--label); }
html.panel-on .poster.song .cell[aria-current="true"] { box-shadow: none; }
html.panel-on .poster.song .cell[aria-current="true"] .cv { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 5px var(--label); }

/* 마우스: 누를 수 있는 것은 올리면 바뀜 */
@media (hover: hover) and (pointer: fine) {
  .rowbtn:hover, .rowmain:hover, .srow:hover, .sh-main:hover, .rows .rg-row:hover { background: var(--fill); }
  .icon-btn:hover, .pill-btn:hover, .chip:not([aria-pressed="true"]):hover { background: var(--fill-2); }
  .itile:hover .face, .rtile:hover .face, .tier .ti:hover { transform: scale(1.05); }
  .poster.idol .cell:hover { filter: brightness(.97); }
  .poster.song .cell:hover .cv { box-shadow: 0 0 0 2px var(--fill-2); }
  .res-actions .btn2:hover, .mode-card:hover, .tcard.theme:hover, .tw:hover, .tr-item:hover .face { filter: brightness(.98); }
  .tier .ti { cursor: grab; }
  html.dragging, html.dragging * { cursor: grabbing !important; }
}

/* ── 넓은 화면 */
@media (min-width: 960px) {
  /* 찾기 창: 결과만큼 · 위쪽에 */
  .sheet-wrap:has(.sheet.finder) { align-items: flex-start; padding-top: 10vh; }
  .sheet.finder, .sheet.finder.tall { height: auto; max-height: min(80dvh, 720px); }
}
@media (min-width: 960px) and (hover: hover) {
  /* 둘 중 고르기: 카드를 크게, 아래 단추는 카드 바로 밑 */
  .screen.duel { max-width: 920px; }
  .duel-cards { flex: none; max-width: 860px; width: 100%; margin: auto auto 0; }
  .dcard .face { width: min(100%, 280px); }
  .dcard.idol .dpick { min-height: min(58dvh, 520px); }
  .duel-more { position: static; max-width: 560px; width: 100%; margin: 20px auto auto; }
}
@media (min-width: 1200px) {
  /* 티어표: 표 왼쪽 · 남은 후보 오른쪽 (끌어 놓기 거리가 짧게) */
  .screen.tier { max-width: 1120px; display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .screen.tier > .topbar { grid-column: 1 / -1; }
  .screen.tier > .tierboard, .screen.tier > .res-actions, .screen.tier > .chart-foot { grid-column: 1; }
  .screen.tier > .tpool { grid-column: 2; grid-row: 2 / span 3; position: sticky; top: 16px; max-height: calc(100dvh - 120px); overflow-y: auto; margin-top: 0; }
}

/* 320px: 브랜드 이름은 두 줄까지 (꺾쇠는 그대로) */
@media (max-width: 359px) { .ss-b .rowmain .tx b { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; } }
/* 곡 카드의 ← → 표시: 커버 위에서도 읽히게 */
.dcard.song kbd { left: 16px; top: 16px; background: var(--card); box-shadow: var(--shadow-s); color: var(--label-2); }
/* 이미지 시트 (폰): 그림이 줄고 단추 줄은 늘 보임 */
.sheet.imgsheet { display: flex; flex-direction: column; overflow: hidden; }
.sheet.imgsheet .sheet-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sheet.imgsheet .img-box { flex: 1 1 auto; min-height: 160px; }
.sheet.imgsheet .img-acts { flex: none; }
.poster.idol .cells > .cell { justify-items: center; }
.sheet:has([data-close]) .sheet-x { display: none !important; }
.sheet:has([data-close]) .sheet-title { padding-right: 0; }

/* 아이돌 소트 테마의 시리즈 시트: 전체 · 속성 · 유닛 줄 */
.th-title { display: flex; align-items: center; gap: 10px; }
.th-title .logo { flex: none; width: 26px; height: 20px; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.th-row .faces { flex: none; display: flex; width: 88px; }   /* 얼굴이 둘뿐인 유닛도 글자 줄이 같은 자리에서 */
.th-row .faces .face { width: 36px; height: 36px; box-shadow: 0 0 0 2.5px var(--card); background: color-mix(in srgb, var(--c) 30%, var(--card)); }
.th-row .faces .face + .face { margin-left: -10px; }
.th-row .faces > * { position: relative; }
.th-row .faces > :nth-child(1) { z-index: 3; } .th-row .faces > :nth-child(2) { z-index: 2; }
.th-row .tx small { color: var(--label-2); }
.pk-part .part-all { margin-left: auto; height: 26px; padding: 0 10px; font-size: 12px; align-self: center; }

/* 소트 후보 줄의 +N: 이웃 얼굴 · 커버와 같은 36px (99+ 까지) · 끝까지 구르면 흐림에 가리지 않게 */
.lu.plus { font-size: 11px; letter-spacing: -.03em; }
.lineup::after { content: ''; flex: none; width: 16px; }
/* 다섯 칸 세그먼트(순위 수)도 320px 안에 — 칸은 똑같은 폭 */
.seg { grid-auto-columns: minmax(0, 1fr); }
.seg.two button { padding: 0 2px; min-width: 0; }
@media (max-width: 359px) { .seg.two button { font-size: 13px; } .seg.two button small { font-size: 10.5px; } }

/* 일본어: 띄어쓰기 없는 칸 이름 · 단추 글자는 낱말째 붙이지 않고 금칙만 지켜 줄 바꿈 */
:lang(ja) .res-actions .btn2 span { word-break: normal; }
/* 영어 · 좁은 화면: 옆 줄 아래 글자 한 줄, 들어 본 곡 브랜드 줄은 두 줄까지 */
.side-foot { flex-wrap: wrap; row-gap: 2px; }
.side-foot > * { white-space: nowrap; }
@media (max-width: 359px) { .hrow .tx b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; } }

/* 좁은 폰: 아이돌 · 로고 표식이 있는 칸 이름은 표식 위 · 이름 아래 (이름이 칸 폭을 다 씀) */
@media (max-width: 459px) { .poster.song .cell .lb:has(.face.xs, .logo) { flex-direction: column; align-items: flex-start; gap: 2px; } }
@media (max-width: 359px) { .tabhead.brand h1 { font-size: 16px; } }

/* 월드컵 결과: 승률 · 우승률 표 */
.cupstat .sec-title { margin-top: 26px; }
.cs-list { padding: 4px 0; }
.cs-head, .cs-row { display: grid; grid-template-columns: 26px 36px minmax(0, 1fr) 62px 62px; align-items: center; column-gap: 10px; padding: 0 14px; }
.cs-head { height: 30px; font-size: 11.5px; font-weight: 750; color: var(--label-2); }
.cs-head span:nth-child(2), .cs-head span:nth-child(3) { grid-column: auto; text-align: right; }
.cs-head span:first-child { grid-column: 1 / span 3; }
.cs-row { min-height: 52px; }
.cs-row + .cs-row { box-shadow: 0 -.5px 0 var(--sep); }
.cs-row > i { font-style: normal; font-size: 13px; font-weight: 750; color: var(--label-2); text-align: center; }
.cs-row .face { width: 36px; height: 36px; }
.cs-row .cv { display: block; width: 36px; height: 36px; border-radius: 8px; overflow: hidden; background: var(--fill); }
.cs-row .cv img { width: 100%; height: 100%; object-fit: cover; }
.cs-row b { min-width: 0; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-v { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.cs-v em { font-style: normal; font-size: 15px; font-weight: 800; }
.cs-v small { font-size: 11px; color: var(--label-2); }

/* 내 표 편집: 묶음 머리 오른쪽의 작은 단추 · 옆 줄 머리 · 시트의 지우기 */
.sec-title .sec-act { margin-left: auto; height: 26px; padding: 0 11px; font-size: 12px; letter-spacing: 0; }
.side-label { display: flex; align-items: center; }
.side-edit { margin-left: auto; padding: 2px 6px; border-radius: 6px; font-size: 11.5px; font-weight: 700; color: var(--label-2); }
@media (hover: hover) { .side-edit:hover { background: var(--fill); color: var(--label); } }
.mycharts .rowbtn.split .del { margin-right: 10px; }
a.rowmain { color: inherit; text-decoration: none; }
