/* ---------- 타이틀 화면 — 흑백 ----------
   등급은 색 대신 --tc(흑백 램프: 높을수록 진함)와 메달 모양(테두리 → 이중 테두리 → 꽉 찬 면)으로 구분한다. */

/* 이모지 아이콘도 흑백으로(화면 전체 톤을 맞춘다) */
.tt, .modal, .tt-big, .tt-drop, .menu { filter: grayscale(1); }

/* ---------- 배지·메달 ---------- */
/* 이름 옆 대표 타이틀: 등급 칸 + 이름 */
.tbadge { display: inline-flex; align-items: center; gap: 6px; max-width: 180px; margin-left: 6px; padding: 2px 8px 2px 6px; border-radius: 0; font-size: 11px; font-weight: 600; line-height: 1.5; vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg); background: var(--bg); border: 1px solid var(--line); }
.tbadge i { flex: none; width: 7px; height: 7px; border-radius: 0; background: var(--tc); box-shadow: 0 0 0 1px var(--line); }
.tbadge.sm { font-size: 10px; padding: 0 6px 0 4px; max-width: 120px; margin-left: 3px; }
.tbadge.lg { font-size: 14px; font-weight: 700; padding: 6px 12px 6px 10px; max-width: none; margin-left: 0; background: var(--fg); color: var(--bg); letter-spacing: -0.01em; }
.tbadge.lg i { width: 9px; height: 9px; background: var(--bg); box-shadow: none; }
.side-member .tbadge { margin-left: 3px; }

/* 메달: 등급마다 모양이 다르다 */
.tmedal { position: relative; flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 19px; line-height: 1; background: var(--bg); box-shadow: inset 0 0 0 1px var(--tc); }
.tmedal[data-t="silver"] { box-shadow: inset 0 0 0 2px var(--tc); }
.tmedal[data-t="gold"] { box-shadow: inset 0 0 0 1.5px var(--tc), inset 0 0 0 4px var(--bg), inset 0 0 0 5.5px var(--tc); }
.tmedal[data-t="platinum"] { background: var(--active); box-shadow: inset 0 0 0 2px var(--tc), inset 0 0 0 5px var(--bg), inset 0 0 0 6px var(--tc); }
.tmedal[data-t="diamond"] { background: var(--fg); box-shadow: inset 0 0 0 2px var(--fg), inset 0 0 0 4px var(--bg); }
.tmedal[data-t="master"] { background: var(--fg); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--fg); }
.tmedal[data-t="master"]::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; background: var(--fg); border: 2px solid var(--bg); transform: rotate(45deg); }
.tmedal.sm { width: 30px; height: 30px; font-size: 14px; }
.tmedal.sm[data-t="master"]::after { width: 7px; height: 7px; top: -3px; right: -3px; }
.tmedal.lg { width: 60px; height: 60px; font-size: 27px; }
.tmedal.xl { width: 112px; height: 112px; font-size: 52px; }
.tmedal.xl:not([data-t="diamond"]):not([data-t="master"]) { box-shadow: inset 0 0 0 3px var(--fg), inset 0 0 0 9px var(--bg), inset 0 0 0 10px var(--fg); }
.tmedal.xl[data-t="master"]::after { width: 16px; height: 16px; top: 0; right: 0; border-width: 3px; }

/* ---------- 머리 ---------- */
.tt { max-width: 1040px; }
.tt-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 0 0 32px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.tt-head-title { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tt-head-title p { margin: 0; max-width: 46ch; font-size: 15px; }
.tt-me-title { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -0.04em; }
.tt-featured { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.tt-featured-k { font-size: 12px; font-weight: 600; color: var(--muted); }

/* 등급 띠: 칸이 이어진 표 */
.tt-tiers { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0 0 32px; border: 1px solid var(--line); }
.tt-tier { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px; min-height: 92px; padding: 12px 14px; border: 0; border-radius: 0; background: var(--bg); color: var(--muted); text-align: left; font: inherit; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.tt-tier + .tt-tier { border-left: 1px solid var(--line); }
.tt-tier-k { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; letter-spacing: -0.01em; }
.tt-tier i { width: 9px; height: 9px; border-radius: 0; background: var(--tc); flex: none; }
.tt-tier b { color: var(--fg); font: 600 30px/1 var(--mono); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.tt-tier b small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: -0.02em; margin-left: 2px; }
.tt-tier.zero b { color: var(--faint); }
.tt-tier:hover:not(.total) { background: var(--hover); color: var(--fg); }
.tt-tier.on, .tt-tier.on:hover:not(.total) { background: var(--fg); color: var(--bg); }
.tt-tier.on b, .tt-tier.on b small { color: var(--bg); }
.tt-tier.on i { background: var(--bg); }
.tt-tier.total { cursor: default; background: var(--side); }
.tt-tier.total b { font-weight: 700; }

/* 탭: 번호가 붙은 밑줄 메뉴 */
.tt-tabs { display: flex; gap: 0; margin: 0 0 28px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tt-tabs::-webkit-scrollbar { display: none; }
.tt-tabs button { position: relative; display: inline-flex; align-items: baseline; gap: 8px; padding: 12px 22px 14px 0; margin-right: 22px; font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: var(--faint); white-space: nowrap; transition: color 0.15s; }
.tt-tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--fg); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.tt-tabs button:hover { color: var(--fg); }
.tt-tabs button.on { color: var(--fg); }
.tt-tabs button.on::after { transform: none; }
.tt-tab-n { font: 500 10.5px/1 var(--mono); letter-spacing: 0.04em; }

/* 공통 섹션 머리 */
.tt-sec { margin-bottom: 36px; }
.tt-sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.tt-sec-head h3, .tt-sub { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.025em; }
.tt-sec-head h3 .muted { font: 500 12px var(--mono); margin-left: 4px; }
.tt-sec-head .btn { margin-left: auto; }
.tt-count-n { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; margin-left: 6px; background: var(--fg); color: var(--bg); font: 600 11px/1 var(--mono); vertical-align: 2px; }

/* ---------- 오늘 기록: 책상 — 기록함(위) + 카드 더미(아래) ---------- */
.tt-today-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.tt-today-date { font-size: 22px; font-weight: 800; letter-spacing: -0.04em; }
.tt-tabs + .tt-today-head .muted { font-family: var(--mono); font-size: 12px; }

.tt-tray { border: 1px dashed var(--line); border-radius: 0; padding: 14px 16px 16px; margin-bottom: 36px; background: repeating-linear-gradient(135deg, transparent 0 9px, var(--hover) 9px 10px), var(--bg); }
.tt-tray-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tt-tray-head b { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.tt-tray-n { font: 600 12px var(--mono); }
.tt-tray-body { display: flex; flex-wrap: wrap; gap: 12px; min-height: 78px; align-items: flex-start; }
.tt-tray-empty { align-self: center; padding: 20px 4px; }
.tt-slip { position: relative; width: 164px; display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 8px; text-align: left; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--fg); font: inherit; cursor: pointer; transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.tt-slip.n2 { box-shadow: 4px 4px 0 -1px var(--bg), 4px 4px 0 0 var(--line); }
.tt-slip.n3 { box-shadow: 4px 4px 0 -1px var(--bg), 4px 4px 0 0 var(--line), 8px 8px 0 -1px var(--bg), 8px 8px 0 0 var(--line); }
.tt-slip:hover { transform: translate(-2px, -2px); }
.tt-slip.met { background: var(--fg); color: var(--bg); }
.tt-slip.met .tt-slip-n, .tt-slip.met .tt-slip-val, .tt-slip.met .muted { color: color-mix(in srgb, var(--bg) 70%, var(--fg)); }
.tt-slip.met .tt-slip-sign { border-top-color: color-mix(in srgb, var(--bg) 35%, var(--fg)); }
.tt-slip.fresh { animation: tt-slip-in 0.6s var(--ease); }
@keyframes tt-slip-in { 0% { transform: scale(0.85); outline: 6px solid var(--active); } 100% { transform: none; outline: 0 solid transparent; } }
.tt-slip-top { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.tt-slip-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.tt-slip-n { margin-left: auto; font: 500 11px var(--mono); color: var(--muted); flex: none; }
.tt-slip-val { font: 500 12px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.tt-slip-sign { width: 100%; height: 36px; border-top: 1px dashed var(--border); padding-top: 2px; }
.tt-slip-sign.none { display: block; height: auto; padding: 6px 0 2px; font-size: 11px; }
.tt-slip-sign path, .tt-stack-sign path { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.tt-hand-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.tt-hand-head h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.025em; }
.tt-hand-head > .muted { margin-left: auto; }
.tt-hand { display: flex; flex-wrap: wrap; gap: 16px; padding: 8px 2px 12px; }
.tt-hand-empty { padding: 28px; border: 1px solid var(--line); background: var(--fg); color: var(--bg); text-align: center; font-weight: 600; }
/* 카드 한 장: 흰 카드, 검은 선. 집으면 어긋난 검은 면이 생긴다 */
.tt-pcard { position: relative; width: 148px; aspect-ratio: 5 / 7; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 10px 14px; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--fg); font: inherit; cursor: grab; transform: rotate(var(--tilt, 0deg)); transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease); }
.tt-pcard::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--border); pointer-events: none; }
.tt-pcard:hover, .tt-pcard:focus-visible { transform: translate(-3px, -10px) rotate(0); box-shadow: 6px 6px 0 0 var(--line); outline: none; }
.tt-pcard:disabled { opacity: 0.4; cursor: progress; }
.tt-pcard-top { position: relative; align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 20px; }
.tt-pcard-top .tt-streak { font-size: 11px; }
.tt-pcard-ic { font-size: 40px; line-height: 1; margin-top: 10px; }
.tt-pcard-name { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; text-align: center; overflow-wrap: anywhere; }
.tt-pcard-goal { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tt-pcard .tl-bar { flex: none; width: 76%; height: 3px; margin-top: auto; }
.tt-streak { font: 600 12px var(--mono); color: var(--fg); white-space: nowrap; letter-spacing: -0.02em; }

/* 집은 카드 */
.tt-pick-host { position: fixed; inset: 0; z-index: 58; }
.tt-pick-back { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(6px) grayscale(1); -webkit-backdrop-filter: blur(6px) grayscale(1); animation: bt-fade 0.18s ease; }
.tt-drop { position: fixed; display: grid; place-items: center; border: 2px dashed var(--line); border-radius: 0; background: var(--bg); color: var(--fg); font-weight: 700; pointer-events: none; transition: background 0.15s, transform 0.15s var(--ease); }
.tt-drop span { padding: 6px 14px; background: var(--fg); color: var(--bg); font-size: 13px; font-weight: 700; }
.tt-drop.over { background: var(--active); transform: scale(1.015); }
.tt-big { position: absolute; left: 50%; top: 50%; translate: -50% -42%; width: min(400px, calc(100vw - 32px)); max-height: calc(100dvh - 120px); overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 16px; border-radius: 0; background: var(--bg); color: var(--fg); border: 1px solid var(--line); box-shadow: 10px 10px 0 0 var(--line); cursor: grab; touch-action: none; }
.tt-big.dragging { cursor: grabbing; transition: none; }
.tt-big-grip { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.tt-big-ic { font-size: 34px; line-height: 1; }
.tt-big-name { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tt-big-name b { font-size: 20px; font-weight: 800; letter-spacing: -0.035em; }
.tt-big-rec { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); background: var(--side); cursor: auto; }
.tt-big-amt { display: flex; align-items: center; gap: 8px; }
.tt-big-amt input { flex: 1; min-width: 0; height: 52px; padding: 0 10px; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--fg); font: 600 26px var(--mono); letter-spacing: -0.04em; text-align: center; font-variant-numeric: tabular-nums; }
.tt-big-amt .btn { width: 52px; height: 52px; font-size: 20px; padding: 0; border-color: var(--line); }
.tt-big-amt .btn:hover { background: var(--fg); color: var(--bg); }
.tt-big-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-big-quick .btn { font-family: var(--mono); font-weight: 500; }
.tt-big-check { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; text-align: center; padding: 12px 0; }
[data-sum] { font-family: var(--mono); font-size: 11.5px; }
.tt-sign { position: relative; height: 116px; border-radius: 0; border: 1px solid var(--line); background: var(--bg); cursor: crosshair; }
.tt-sign canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.tt-sign-line { position: absolute; left: 14px; right: 14px; bottom: 26px; border-bottom: 1px solid var(--faint); font-size: 11px; color: var(--faint); padding-left: 20px; pointer-events: none; line-height: 1.8; }
.tt-sign-x { position: absolute; left: 14px; bottom: 28px; color: var(--faint); font-size: 12px; pointer-events: none; }
.tt-sign.signed .tt-sign-line { border-color: var(--line); color: var(--fg); }
.tt-sign-tools { display: flex; justify-content: flex-end; gap: 6px; margin-top: -8px; }
.tt-big-actions { display: flex; gap: 8px; }
.tt-big-actions .btn { flex: 1; height: 46px; }
.tt-big-hint { text-align: center; }

/* 기록함 묶음 자세히 */
.tt-stack-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.tt-stack-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tt-stack-val { display: flex; flex-direction: column; min-width: 76px; }
.tt-stack-val b { font-family: var(--mono); font-weight: 600; }
.tt-stack-sign { flex: 1; height: 40px; min-width: 0; }
.tt-stack-sign.none { flex: 1; }

/* ---------- 오래된 카드형(남겨 둠) ---------- */
.tt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tt-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
.tt-card.met { background: var(--fg); color: var(--bg); }
.tt-card-head { display: flex; align-items: center; gap: 8px; }
.tt-card-head b { flex: 1; font-weight: 700; }
.tt-ic { font-size: 18px; }
.tt-amount b { font-size: 24px; }
.tt-bar { max-width: none; }
.tt-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.tt-check { padding: 10px 12px; border: 1px dashed var(--line); background: transparent; font-weight: 600; color: var(--muted); }
.tt-check:hover:not(:disabled) { color: var(--fg); background: var(--hover); }
.tt-check.on { border-style: solid; background: var(--fg); color: var(--bg); }
.tt-check.sm { padding: 7px 8px; font-size: 13px; }
.tt-meals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* ---------- 칩·필터·도구줄 ---------- */
.tt-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tt-chip { height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; font-weight: 500; background: var(--bg); color: var(--muted); transition: border-color 0.15s, color 0.15s, background-color 0.15s; }
.tt-chip:hover { border-color: var(--line); color: var(--fg); }
.tt-chip.on { background: var(--fg); border-color: var(--fg); color: var(--bg); font-weight: 600; }
.tt-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tt-tools select { height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--border); border-radius: 0; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--fg); font: inherit; font-size: 13.5px; font-weight: 500; appearance: none; -webkit-appearance: none; cursor: pointer; }
.tt-tools select:hover { border-color: var(--line); }
.tt-search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--fg); font-size: 18px; }
.tt-search:focus-within { box-shadow: inset 0 0 0 1px var(--line); }
.tt-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--fg); font: inherit; font-size: 14.5px; box-shadow: none !important; }
.tt-search input::placeholder { color: var(--faint); }

/* ---------- 타이틀 모음 ---------- */
.tt-group { margin-bottom: 18px; }
.tt-group h3 { margin: 0 0 8px; font-size: 15px; }
/* 타일: 칸이 붙은 격자 */
.tt-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.tt-tile { display: flex; align-items: flex-start; gap: 14px; padding: 16px; text-align: left; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 0; background: var(--bg); color: var(--fg); font: inherit; cursor: pointer; transition: background-color 0.15s; }
.tt-tile:hover { background: var(--hover); }
.tt-tile.got:hover { background: var(--hover); }
.tt-tile:not(.got) .tmedal { opacity: 0.35; box-shadow: inset 0 0 0 1px var(--faint); background: transparent; }
.tt-tile:not(.got) .tmedal::after { display: none; }
.tt-tile:not(.got) .tt-tile-main b { color: var(--muted); }
.tt-tile-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tt-tile-main b { font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.tt-tile-tier { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; line-height: 1.4; color: var(--fg); }
.tt-tile-tier::before { content: ""; width: 7px; height: 7px; background: var(--tc); flex: none; }
.tt-tile:not(.got) .tt-tile-tier { color: var(--faint); }
.tt-tile-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tt-got { color: var(--muted); margin-top: 3px; font-family: var(--mono); font-size: 11.5px; }
.tt-got::before { content: "● "; color: var(--fg); }
.tt-prog { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.tt-prog .tl-bar { max-width: 110px; height: 3px; }
.tt-prog .muted { font-family: var(--mono); font-size: 11.5px; }
/* 홈의 작은 타일 */
.tt-tiles.mini { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tt-tiles.mini .tt-tile { padding: 12px 14px; gap: 12px; align-items: center; }
.tt-tiles.mini .tmedal { width: 36px; height: 36px; font-size: 17px; }
.tt-tiles.mini .tt-tile-desc { display: none; }
.tt-tiles.mini .tt-tile-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-tiles.mini .tt-prog { margin-top: 2px; }

/* 분류 목록 */
.tt-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.tt-cat { display: flex; align-items: center; gap: 16px; padding: 16px 4px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: var(--bg); color: var(--fg); text-align: left; font: inherit; cursor: pointer; transition: padding 0.25s var(--ease), background-color 0.15s; }
.tt-cats .tt-cat:nth-child(odd) { padding-right: 20px; }
.tt-cats .tt-cat:nth-child(even) { padding-left: 20px; border-left: 1px solid var(--border); }
.tt-cat:hover { background: var(--hover); }
.tt-cat:hover .tt-cat-go { transform: translateX(4px); color: var(--fg); }
.tt-cat-ic { font-size: 24px; width: 36px; text-align: center; flex: none; }
.tt-cat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.tt-cat-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tt-cat-top b { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.tt-cat-top > .muted { font-family: var(--mono); font-size: 11.5px; }
.tt-cat-top .tt-rating.inline { margin-left: auto; }
.tt-cat-next { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-cat-go { color: var(--faint); font-size: 22px; flex: none; transition: transform 0.2s var(--ease), color 0.15s; }
.tt-segs { display: flex; gap: 3px; height: 5px; }
.tt-seg { position: relative; min-width: 4px; border-radius: 0; background: var(--active); overflow: hidden; }
.tt-seg i { position: absolute; inset: 0 auto 0 0; background: var(--tc); }
.tt-crumb { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tt-crumb-name { font-size: 20px; letter-spacing: -0.03em; }
.tt-crumb-name b { font-weight: 800; }
.tt-count { margin-bottom: 14px; font-family: var(--mono); font-size: 12px; }
.tt-count .linkish { border: 0; background: none; padding: 0; color: var(--fg); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tt-more { display: flex; justify-content: center; margin: 20px 0 4px; }
.tt-more .btn { min-width: 220px; height: 44px; border-color: var(--line); }

/* ---------- 지표 추이 ---------- */
.tt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 20px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tt-stats > div { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
.tt-stats > div > .muted.small:first-child { font-size: 12px; font-weight: 600; }
.tt-stats b { font-size: 24px; font-weight: 600; line-height: 1.05; }
.tt-stat-rating { background: var(--fg) !important; color: var(--bg); }
.tt-stat-rating .muted { color: color-mix(in srgb, var(--bg) 65%, var(--fg)); }
.tt-stat-rating b { color: var(--bg); }
.tt-stat-rating .small:not(.muted) { color: var(--bg); font-weight: 600; }
.tt-chart { position: relative; margin: 0 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: 0; }
.tt-chart figcaption { margin-bottom: 10px; line-height: 1.5; }
.tt-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.tt-chart .hit { fill: transparent; }
.tt-chart .v { fill: var(--rk-0); }
.tt-chart .v.met { fill: var(--fg); }
.tt-chart .tt-bar-g:hover .v { fill: var(--muted); }
.tt-chart .tt-bar-g:hover .v.met { fill: var(--fg); opacity: 0.8; }
.tt-chart .tt-bar-g:hover .hit { fill: var(--hover); }
.tt-chart .axis { stroke: var(--line); }
.tt-chart .goal { stroke: var(--fg); stroke-dasharray: 2 4; stroke-width: 1; }
.tt-chart text { font: 10px var(--mono); fill: var(--faint); }
.tt-chart .goal-t { fill: var(--fg); font-weight: 600; }
.tt-tip { position: absolute; pointer-events: none; padding: 5px 9px; border-radius: 0; font: 500 11.5px var(--mono); background: var(--fg); color: var(--bg); white-space: nowrap; transform: translateY(-100%); }
.tt-rchart { margin-top: 0; }
.tt-rchart .band { opacity: 0.07; }
.tt-rchart .band:nth-of-type(even) { opacity: 0.13; }
.tt-rchart .band-t { font-size: 9px; fill: var(--faint); }
.tt-rchart .rline { fill: none; stroke: var(--fg); stroke-width: 2; stroke-linejoin: miter; stroke-linecap: square; }
.tt-rchart .rdot { fill: var(--fg); stroke: var(--bg); stroke-width: 3; }
.tt-rchart .rnow { font: 700 11px var(--mono); fill: var(--fg); }
.tt-table { margin-top: 10px; }
.tt-table summary { cursor: pointer; font-family: var(--mono); font-size: 12px; }
.tt-table table { border-collapse: collapse; margin-top: 8px; font: 12.5px var(--mono); min-width: 220px; }
.tt-table td, .tt-table th { padding: 6px 18px 6px 0; text-align: left; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--border); }
.tt-table th { font-weight: 600; border-bottom-color: var(--line); }

/* ---------- 레이팅 ---------- */
.tt-rating { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tt-rating b { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.tt-rating.inline { display: inline-flex; margin-left: 8px; font-weight: 400; vertical-align: middle; }
.tt-rank { display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px 1px 5px; border-radius: 0; font-size: 10.5px; font-weight: 700; line-height: 1.6; color: var(--fg); background: transparent; border: 1px solid var(--line); }
.tt-rank i { width: 6px; height: 6px; border-radius: 0; background: var(--tc); }
.tt-delta { font: 700 11px var(--mono); font-variant-numeric: tabular-nums; }
.tt-delta.up { color: var(--fg); }
.tt-delta.down { color: var(--muted); }

/* 카드: 다음 타이틀까지 */
.tt-next { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.tt-next .tl-bar { flex: 0 0 64px; height: 3px; }
.tt-next b { color: var(--fg); }

/* ---------- 진열장 ---------- */
.tt-case { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; min-height: 168px; padding: 0; border: 1px solid var(--line); margin: 14px 0 36px; background: var(--fg); }
.tt-case-empty { grid-column: 1 / -1; align-self: center; text-align: center; padding: 40px 16px; color: color-mix(in srgb, var(--bg) 70%, var(--fg)) !important; }
.tt-case-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 22px 10px 18px; text-align: center; background: var(--bg); box-shadow: 0 0 0 0.5px var(--line); }
.tt-case-tile b { font-size: 13.5px; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.tt-case-tile .muted { font-size: 11px; font-weight: 600; }
.tt-case-x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 0; font-size: 11px; color: var(--muted); }
.tt-case-x:hover { background: var(--fg); color: var(--bg); }
.tt-pick { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.tt-pick-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.tt-pick-row:hover { background: var(--hover); }
.tt-pick-name { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tt-pick-name b { font-weight: 700; letter-spacing: -0.02em; }
.tt-pick-name .muted { font-family: var(--mono); font-size: 11px; }
.tt-pick-wrap { margin-top: 4px; }

/* ---------- 지표 관리 ---------- */
.tt-manage { width: min(540px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 6px; }
.tt-manage h3, .tt-manage p { margin: 0; }
.tt-manage > p { margin-bottom: 8px; }
.tt-mlist { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.tt-mrow { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.tt-mrow:hover { background: var(--hover); }
.tt-mrow > span:first-of-type { flex: 1; font-weight: 500; }
.tt-mrow .muted { font-family: var(--mono); font-size: 11.5px; }
.tt-new { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.tt-new-row { display: flex; gap: 8px; }
.tt-new-row input, .tt-new-row select { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 0; background: var(--bg); color: var(--fg); font: inherit; }
.tt-new-row input:hover, .tt-new-row select:hover { border-color: var(--muted); }
.tt-new-icon { flex: 0 0 60px !important; text-align: center; font-size: 18px !important; }
.tt-set { padding: 8px; }
.tt-set input { width: 110px; }

/* ---------- 타이틀 자세히 ---------- */
.tt-detail { width: min(480px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 16px; max-height: min(86vh, 760px); overflow: auto; }
.tt-detail-top { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.tt-detail-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tt-detail-name h3 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.035em; }
.tt-detail-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); }
.tt-detail-meta b { color: var(--fg); font-family: var(--mono); font-weight: 600; }
.tt-detail.locked .tmedal { opacity: 0.4; background: transparent; box-shadow: inset 0 0 0 1px var(--faint); }
.tt-detail.locked .tmedal::after { display: none; }
.tt-detail-prog { display: flex; align-items: center; gap: 12px; }
.tt-detail-prog .tl-bar { flex: 1; height: 6px; max-width: none; }
.tt-detail-prog .small { font-family: var(--mono); }
.tt-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 4px; }
.tt-days { border-top: 1px solid var(--border); padding-top: 14px; }
.tt-days-head { margin-bottom: 10px; }
.tt-cals { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.tt-cal h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.tt-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font: 11px var(--mono); font-variant-numeric: tabular-nums; }
.tt-cal-w { color: var(--faint); padding-bottom: 4px; }
.tt-cal-d { display: grid; place-items: center; aspect-ratio: 1; border-radius: 0; color: var(--faint); }
.tt-cal-d.on { background: var(--fg); color: var(--bg); font-weight: 700; }
.tt-cal-d.today { outline: 1px solid var(--line); outline-offset: -1px; color: var(--fg); }

/* ---------- 축하 화면 ---------- */
.tt-cele { position: relative; overflow: hidden; width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 32px; }
.tt-cele > .muted.small:first-of-type { font-size: 12px; font-weight: 600; color: var(--fg); padding: 4px 10px; border: 1px solid var(--line); margin-bottom: 12px; }
.tt-cele h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.045em; }
.tt-cele .tmedal { margin: 4px 0 6px; animation: tt-pop 0.7s cubic-bezier(0.22, 1.4, 0.36, 1); }
.tt-cele-tier { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--fg); }
.tt-cele-tier::before { content: ""; width: 8px; height: 8px; background: var(--tc); box-shadow: 0 0 0 1px var(--line); }
.tt-cele-more { display: flex; flex-direction: column; width: 100%; margin-top: 8px; border-top: 1px solid var(--line); }
.tt-cele-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); text-align: left; }
.tt-cele-row b { flex: 1; font-size: 13.5px; }
.tt-cele-row .muted { font-family: var(--mono); font-size: 11px; }
.tt-cele-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; width: 100%; }
.tt-cele-actions .btn.primary { flex: 1 1 100%; height: 46px; order: -1; }
.tt-confetti { position: absolute; inset: 0; pointer-events: none; }
.tt-confetti i { position: absolute; top: -10px; left: calc(50% + var(--x) * 1%); width: 7px; height: 7px; border-radius: 0; background: var(--fg); animation: tt-fall 1.6s ease-in calc(var(--i) * 40ms) forwards; opacity: 0; }
.tt-confetti i:nth-child(3n) { background: transparent; box-shadow: inset 0 0 0 1.5px var(--fg); }
.tt-confetti i:nth-child(3n + 1) { width: 3px; height: 12px; }
@keyframes tt-pop { from { transform: scale(0.3) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tt-fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(280px) rotate(540deg); } }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 860px) {
  .tt-tiers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tt-tier:nth-child(4n + 1) { border-left: 0; }
  .tt-tier:nth-child(n + 5) { border-top: 1px solid var(--line); }
  .tt-tier { min-height: 80px; }
  .tt-tier b { font-size: 24px; }
  .tt-cats { grid-template-columns: 1fr; }
  .tt-cats .tt-cat:nth-child(n) { padding: 16px 4px; border-left: 0; }
  .tt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tt-head { margin-bottom: 24px; padding-bottom: 22px; }
  .tt-tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; }
  .tt-tier:nth-child(n) { border-left: 1px solid var(--line); border-top: 0; }
  .tt-tier:nth-child(3n + 1) { border-left: 0; }
  .tt-tier:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .tt-tier.total { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; }
  .tt-tier { min-height: 70px; padding: 10px 12px; gap: 10px; }
  .tt-tier b { font-size: 22px; }
  .tt-tabs button { padding-right: 0; margin-right: 22px; font-size: 14px; }
  .tt-cards, .tt-tiles { grid-template-columns: 1fr; }
  .tt-cats { grid-template-columns: 1fr; }
  .tt-tools select { flex: 1 1 40%; }
  .tt-case { grid-template-columns: repeat(2, 1fr); }
  .tt-tiles.mini { display: grid; grid-auto-flow: column; grid-auto-columns: 74%; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .tt-tiles.mini .tt-tile { scroll-snap-align: start; }
  .tt-hand { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; padding: 14px 4px 18px; margin: 0 -4px; }
  .tt-pcard { flex: none; width: 128px; scroll-snap-align: start; }
  .tt-slip { width: calc(50% - 6px); }
  .tt-big { top: auto; bottom: 12px; translate: -50% 0; box-shadow: 0 0 0 1px var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .tt-pcard, .tt-drop, .tt-slip, .tt-cat, .tt-cat-go, .tt-tabs button::after { transition: none; }
  .tt-slip.fresh, .tt-pick-back { animation: none; }
  .tt-cele .tmedal, .tt-confetti i { animation: none; }
  .tt-confetti { display: none; }
}
.tt-big-amt input::-webkit-outer-spin-button, .tt-big-amt input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tt-big-amt input { -moz-appearance: textfield; appearance: textfield; }
