/* 컴퓨터 화면 기준 대시보드. 토스 원칙만 따름: 장식 없이 평평한 카드, 쉬운 문구, 숫자가 먼저 보이게.
   색은 사이트 토큰 그대로 (site/styles.css · 02-color-tokens.md). 라임은 화면당 한 곳. */
:root {
  --bg: #0A0A0A; --side: #111111; --card: #161616; --card-2: #1F1F1F; --line: #262626;
  --text: #F5F5F5; --sub: #8C8C8C;
  --primary: #E0FE02; --on-primary: #0A0A0A; --error: #FF6B6B;
  --st-amber: #F5B83D; --st-blue: #6EA8FE; --st-green: #4CC38A; --st-violet: #B18CFF;
  --font: Pretendard, "Apple SD Gothic Neo", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sub { color: var(--sub); font-size: .9375rem; }
.lime { color: var(--primary); }
.good { color: var(--st-green); }
.bad { color: var(--error); }

/* ── 버튼 ── */
.cta { width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 1rem; cursor: pointer; }
.cta:hover { background: var(--text); }
.cta:disabled { opacity: .5; }
.text-btn { min-height: 36px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: var(--sub); cursor: pointer; font-size: .9375rem; }
.text-btn:hover { color: var(--text); background: var(--card-2); }
.text-link { color: var(--sub); font-size: .9375rem; text-decoration: none; padding: 8px; }
.text-link:hover { color: var(--text); }

/* ── 로그인 ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-form { width: min(380px, 100%); display: grid; gap: 16px; padding: 40px 32px; border-radius: 24px; background: var(--card); }
.login-form h1 { margin-top: 12px; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.login-form .sub { margin-bottom: 12px; }
.login-form input { width: 100%; min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font-size: 1rem; }
.login-form input:focus { border-color: var(--primary); outline: none; }
.login-form input[aria-invalid="true"] { border-color: var(--error); }
.login-form .text-link { justify-self: center; }
.error { color: var(--error); font-size: .9375rem; }

/* ── 뼈대: 왼쪽 메뉴 + 본문 ── */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 24px 16px; background: var(--side); border-right: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; padding: 0 8px; font: 600 1rem Poppins, var(--font); letter-spacing: .04em; text-decoration: none; }
.menu { display: grid; gap: 4px; }
.menu button { min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--sub); text-align: left; cursor: pointer; font-weight: 500; }
.menu button:hover { color: var(--text); background: var(--card); }
.menu button[aria-current="page"] { background: var(--card-2); color: var(--text); font-weight: 600; }
.side-foot { margin-top: auto; display: grid; gap: 12px; }
.fresh { display: grid; gap: 8px; padding: 0 8px; font-size: .8125rem; color: var(--sub); }
.fresh span { display: flex; align-items: center; gap: 8px; }
.fresh b { color: var(--text); font-weight: 500; margin-left: auto; }
.side-foot .text-btn { justify-self: start; }

.page { min-width: 0; max-width: 1400px; padding: 32px 40px 64px; display: grid; gap: 16px; align-content: start; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 8px; }
.head h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; }
.head .sub { margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

/* 기간 · 팀 선택 */
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--card); }
.seg button { min-height: 32px; padding: 0 16px; border: 0; border-radius: 9px; background: none; color: var(--sub); cursor: pointer; font-size: .9375rem; font-weight: 500; }
.seg button[aria-pressed="true"] { background: #2C2C2C; color: var(--text); }
.range { color: var(--sub); font-size: .8125rem; }

/* ── 카드 · 배치 ── */
.row-2 { display: grid; gap: 16px; grid-template-columns: 2fr 1fr; align-items: start; }
.row-h { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; align-items: start; }
.row-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); align-items: start; }
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
.card { background: var(--card); border-radius: 20px; padding: 24px 24px; min-width: 0; }
.card > h2 { font-size: 1.0625rem; font-weight: 700; }
.card > h2 + .sub { margin-top: 2px; font-size: .8125rem; }

/* 숫자 카드 */
.kpi .label { color: var(--sub); font-size: .9375rem; }
.kpi .value { margin: 8px 0 8px; font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.kpi .value small { margin-left: 8px; font-size: 1.0625rem; font-weight: 500; letter-spacing: 0; color: var(--sub); }
.kpi .change, .kpi .hint { font-size: .8125rem; color: var(--sub); }
.kpi .change.good { color: var(--st-green); }
.kpi .change.bad { color: var(--error); }

/* 목록 행 */
/* 목록: 행 사이 8px, 위 16px, 좌우는 위 숫자 칸과 같은 선 */
.list { display: grid; gap: 8px; margin-top: 16px; }
.row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border: 1px solid transparent; border-radius: 12px; background: var(--card-2); text-align: left; cursor: pointer; }
.row:hover { background: #262626; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #2A2A2A; font-weight: 700; font-size: .8125rem; flex: none; }
.row-main, .row-end { display: grid; min-width: 0; }
.row-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9375rem; }
.row-sub { color: var(--sub); font-size: .8125rem; }
.row-end { text-align: right; }
.row-value { font-weight: 700; }
.badge { display: inline-flex; align-items: center; padding: 0 8px; border-radius: 6px; font-size: .8125rem; font-weight: 600; line-height: 20px; background: rgb(76 195 138 / .14); color: var(--st-green); white-space: nowrap; }
.empty { color: var(--sub); font-size: .9375rem; padding: 12px 0 4px; }

/* 확인해 보세요 */
.notes { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.notes li { display: grid; grid-template-columns: 8px 1fr; gap: 8px; align-items: baseline; font-size: .9375rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-green); transform: translateY(-1px); flex: none; }
.dot.warn { background: var(--st-amber); }
.dot.bad { background: var(--error); }

/* 차트 */
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.chart-box { position: relative; height: 280px; margin-top: 12px; }
.legend { display: flex; gap: 16px; font-size: .8125rem; color: var(--sub); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }

/* 소재 표 */
.table-card { padding: 4px 8px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th { padding: 0; color: var(--sub); font-weight: 500; font-size: .8125rem; text-align: right; white-space: nowrap; position: sticky; top: 0; background: var(--card); }
th button { width: 100%; padding: 12px 8px; border: 0; background: none; color: inherit; text-align: inherit; cursor: pointer; }
th button:hover, th[aria-sort] button { color: var(--text); }
th:first-child, td:first-child { text-align: left; }
td { padding: 8px 8px; text-align: right; white-space: nowrap; border-top: 1px solid var(--line); }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--card-2); }
tfoot td { color: var(--sub); font-weight: 600; }
.cell-ad { display: flex; align-items: center; gap: 8px; }
.cell-ad b { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.cell-ad small { display: block; color: var(--sub); font-size: .8125rem; }
.cmp { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 8px; vertical-align: 2px; }
.cmp.good { background: var(--st-green); }
.cmp.bad { background: var(--error); }

/* 팀 */
.hbars { display: grid; gap: 12px; margin-top: 16px; }
.hbar { display: grid; grid-template-columns: 44px 1fr 60px; align-items: center; gap: 12px; font-size: .9375rem; }
.hbar .fill { display: block; height: 100%; border-radius: 5px; background: var(--text); }
.hbar .v { text-align: right; font-weight: 700; }
.team-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
/* 숫자 칸 하나로: 팀 카드 칸 = 상세 패널 칸 (라벨 13 회색 · 숫자 17 굵게 · 보조 13 회색) */
.team-nums div, .mini div { padding: 12px 16px; border-radius: 12px; background: var(--card-2); }
.team-nums small, .mini small { display: block; margin-bottom: 2px; color: var(--sub); font-size: .8125rem; }
.team-nums b, .mini b { font-size: 1.0625rem; font-weight: 700; }

/* 상세 패널 (오른쪽) */
.scrim { position: fixed; inset: 0; z-index: 7; background: rgb(0 0 0 / .55); }
.sheet { --sheet-inline-gap: 33.6px; position: fixed; z-index: 8; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); overflow-y: auto; padding: 24px var(--sheet-inline-gap) 32px; background: var(--card); border-left: 1px solid var(--line); display: grid; align-content: start; gap: 24px; animation: in-right .2s var(--ease); }
@keyframes in-right { from { transform: translateX(24px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet h2 { font-size: 1.5rem; font-weight: 700; }
.sheet h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: 8px; }
.sheet .big { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.mini { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.mini div > span:not(.tag) { display: block; margin-top: 2px; color: var(--sub); font-size: .8125rem; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 40px 1fr 52px; align-items: center; gap: 12px; font-size: .8125rem; }
.bar .track { position: relative; height: 8px; border-radius: 4px; background: var(--card-2); }
.bar .fill { display: block; height: 100%; border-radius: 4px; background: var(--text); }
.bar .avg { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--st-blue); }
.bar .v { text-align: right; font-weight: 600; }
.step { display: grid; grid-template-columns: 1fr auto 120px; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.step:last-child { border-bottom: 0; }
.step b { font-weight: 600; }
.step small { color: var(--text); text-align: right; font-size: .8125rem; align-self: center; white-space: nowrap; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; }
.stack span { display: block; }
.plat-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: .8125rem; color: var(--sub); }
.plat-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.note { font-size: .8125rem; color: var(--sub); margin-top: 8px; }

/* 모든 소재 표시에서 같은 썸네일과 영상 플레이어를 사용합니다. */
.creative-thumb { position: relative; display: inline-flex; width: 44px; aspect-ratio: 9 / 14; flex: none; overflow: hidden; border-radius: 8px; background: #262626; color: var(--sub); vertical-align: middle; }
.thumb-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 9px; }
.creative-thumb.is-connected { color: var(--primary); background: #25291b; }
.creative-thumb img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.thumb-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgb(0 0 0 / .2); }
.creative-thumb.image-missing img, .creative-thumb.image-missing .thumb-play { display: none; }
.row { grid-template-columns: 44px minmax(0, 1fr) auto; }
.row-title { flex-wrap: wrap; gap: 5px; }
.row-sub { margin-top: 3px; }
.cell-ad { min-width: 220px; gap: 12px; }
.sc-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sc-identity .sc-title { flex-wrap: wrap; gap: 5px; }
.sheet { width: min(1800px, 100vw); padding-top: 0; } /* 위 여백은 제목 줄이 가짐. 창에 여백이 있으면 고정된 제목 위로 내용이 비침 */
.sheet-content { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: var(--sheet-inline-gap); align-items: start; }
.sheet-head { position: sticky; top: 0; z-index: 4; margin-inline: calc(var(--sheet-inline-gap) * -1); padding: 24px var(--sheet-inline-gap) 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.sheet-head > div { min-width: 0; }
.sheet-head .sub { overflow-wrap: anywhere; }
.sheet-head .text-btn { flex: none; white-space: nowrap; }
.creative-watch { min-width: 0; }
.creative-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sheet-inline-gap); align-items: start; }
.creative-video-column, .creative-bridge-column { min-width: 0; }
.media-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-bottom: 12px; }
.media-panel-head h3 { margin: 0; font-size: .8125rem; font-weight: 500; }
.creative-metrics { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; min-width: 0; }
.creative-metrics > * { min-width: 0; }
.creative-metrics .mini { margin-top: 0; }
.creative-player { position: relative; display: grid; place-items: center; aspect-ratio: var(--video-ratio, 9 / 16); width: 100%; overflow: hidden; border: 0; border-radius: 14px; background: #000; }
.bridge-player { aspect-ratio: 1; border-radius: 0; background: transparent; }
.creative-player video, .creative-player iframe, .creative-player > img { position: absolute; width: 100%; height: 100%; border: 0; object-fit: contain; }
.creative-player.is-empty { align-content: center; gap: 14px; padding: 20px; background: var(--card-2); color: var(--sub); text-align: center; }
.creative-player.is-empty p { color: var(--text); font-size: .9375rem; }
.creative-player.is-empty span, .media-error { font-size: .8125rem; }
.media-sources { margin-top: 16px; }
.media-caption { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 10px; color: var(--sub); font-size: .8125rem; }
.media-original { color: var(--text); text-decoration: none; white-space: nowrap; }
.media-original:hover { text-decoration: underline; }
.media-usp { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .875rem; }
.media-usp b, .media-sources b { color: var(--sub); font-size: .8125rem; }
.media-usp p { margin-top: 6px; }
.media-usp ul { padding-left: 18px; margin: 10px 0; }
.media-usp li { padding-left: 2px; margin: 8px 0; line-height: 1.6; overflow-wrap: anywhere; }
.media-usp-note { color: var(--sub); font-size: .75rem; }
.media-error { color: var(--error); margin-top: 10px; }
.media-link-only { display: grid; justify-items: center; gap: 16px; padding: 24px; text-align: center; }
.media-link-only .media-original { border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; }
.media-gallery { min-width: 0; touch-action: pan-y; }
.gallery-status { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 8px; font-size: .8125rem; color: var(--sub); }
.gallery-status b { color: var(--text); font-weight: 500; }
.gallery-viewport { position: relative; overflow: hidden; }
.gallery-enter-next { animation: gallery-next .18s var(--ease); }
.gallery-enter-prev { animation: gallery-prev .18s var(--ease); }
@keyframes gallery-next { from { opacity: .5; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes gallery-prev { from { opacity: .5; transform: translateX(-18px); } to { opacity: 1; transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .gallery-enter-next, .gallery-enter-prev { animation: none; } }
.gallery-arrow { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 32px; height: 40px; padding: 0 0 4px; border: 1px solid rgb(255 255 255 / .2); border-radius: 999px; background: rgb(10 10 10 / .8); color: white; font-size: 30px; line-height: 1; cursor: pointer; }
.gallery-arrow.prev { left: 8px; }
.gallery-arrow.next { right: 8px; }
.gallery-arrow:hover { background: #343434; }
.gallery-arrow:disabled { opacity: 0; pointer-events: none; }
[data-gallery-kind="bridge"] iframe { pointer-events: none; }
.gallery-footer { display: flex; flex-direction: column; align-items: center; min-height: 40px; padding-top: 4px; touch-action: pan-y; }
.gallery-dots { display: flex; align-items: center; justify-content: center; }
.gallery-dot { display: grid; place-items: center; width: 28px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.gallery-dot span { display: block; width: 6px; height: 6px; border-radius: 999px; background: #666; transition: width .15s, background-color .15s; }
.gallery-dot[aria-pressed="true"] span { width: 18px; background: var(--primary); }
.gallery-hint { color: var(--sub); font-size: .75rem; }
.gallery-variants { display: flex; flex: none; gap: 4px; width: max-content; padding: 3px; background: var(--card-2); border-radius: 9px; }
.gallery-variants button { min-height: 26px; min-width: 38px; padding: 2px 8px; border: 0; border-radius: 6px; background: none; color: var(--sub); font: inherit; font-size: .75rem; cursor: pointer; }
.gallery-variants button[aria-pressed="true"] { background: #383838; color: var(--text); }
@media (max-width: 899px) {
  .sheet-content { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .sheet-content { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .sheet { --sheet-inline-gap: 16px; }
  .creative-media { gap: var(--sheet-inline-gap); }
  .media-panel-head { flex-wrap: wrap; gap: 4px; }
  .gallery-status { flex-basis: 100%; }
  .media-panel-head { min-height: 62px; align-content: start; }
  .media-caption { gap: 10px; }
  .media-original { white-space: normal; }
  .sheet .sheet-head h2 { font-size: 1.2rem; }
  .step { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .step small { grid-column: 2; }
  .sheet .verdict, .sheet .mini { min-width: 0; }
  .sheet .verdict .fix { white-space: normal; }
}

/* 단계 보드 */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.col { display: grid; align-content: start; gap: 8px; padding: 12px; border-radius: 16px; background: var(--bg); min-width: 0; }
.col-head { display: flex; align-items: center; justify-content: space-between; font-size: .9375rem; }
.count { min-width: 24px; padding: 0 8px; border-radius: 999px; background: var(--card-2); color: var(--sub); font-size: .8125rem; line-height: 22px; text-align: center; }
.col-rule { color: var(--sub); font-size: .8125rem; margin-bottom: 4px; }
.col .text-btn { justify-self: start; padding: 0 8px; }
.col .empty { padding: 4px 0; font-size: .8125rem; }
.stage-card { display: grid; gap: 8px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; cursor: pointer; font-size: .8125rem; }
.stage-card:hover { background: var(--card-2); }
.sc-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9375rem; }
.sc-title small { margin-left: auto; color: var(--sub); font-weight: 400; font-size: .8125rem; }
.sc-text { color: var(--sub); }
.sc-foot { display: flex; justify-content: space-between; gap: 8px; color: var(--sub); }
.sc-foot b { color: var(--text); }
.fix { color: var(--st-amber); font-size: .8125rem; }
.fixline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: .8125rem; }
.fixline .fix-label { color: var(--sub); }
.fixline .fix { font-weight: 600; font-size: inherit; }
.fixline .fix-why { color: var(--error); }
.verdict .fixline, .lead .fixline { font-size: .9375rem; }
.avatar.sm { width: 24px; height: 24px; font-size: .8125rem; }

/* 잘된 소재 하이라이트: 2단계(구매 나옴) = 라임 테두리, 3단계 = 라임 배경 */
.stage-card.hl, .row.hl, .verdict.hl { border: 1px solid rgb(224 254 2 / .55); }
.stage-card.hl-strong, .row.hl-strong, .verdict.hl-strong { border: 1px solid var(--primary); background: rgb(224 254 2 / .1); }
tr.hl td:first-child { box-shadow: inset 3px 0 0 rgb(224 254 2 / .7); }
tr.hl td { background: rgb(224 254 2 / .04); }
tr.hl-strong td { background: rgb(224 254 2 / .1); }
tr.hl-strong td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.stage { display: inline-flex; align-items: center; padding: 0 8px; border-radius: 6px; font-size: .8125rem; font-weight: 600; line-height: 20px; white-space: nowrap; background: var(--card-2); color: var(--sub); }
.stage.s2 { background: rgb(224 254 2 / .14); color: var(--primary); }
.stage.s3 { background: var(--primary); color: var(--on-primary); }
.tag.grace { background: none; color: var(--text); box-shadow: inset 0 0 0 1px #6A6A6A; }
.stage + .tag { margin-left: 4px; }
.stage.off { color: #6A6A6A; }

/* 누적 지출 / 상한 */
.cap { display: grid; gap: 4px; }
.cap-track { height: 6px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.cap-fill { display: block; height: 100%; border-radius: 3px; background: var(--text); }
.cap-text { color: var(--sub); font-size: .8125rem; }

/* 어디서 빠지나요 */
.lead { margin-top: 8px; font-size: .9375rem; }
.fn { display: grid; gap: 16px; margin-top: 16px; }
.fn-row { display: grid; grid-template-columns: 180px 1fr 60px 56px; align-items: center; gap: 12px; font-size: .9375rem; }
.fn-row.weak .fn-label { color: var(--st-amber); font-weight: 600; }
.fn-row .track, .hbar .track { position: relative; height: 10px; border-radius: 5px; background: var(--card-2); }
.fn-row .fill { display: block; height: 100%; border-radius: 5px; background: var(--text); }
.fn-row .fill.bad { background: var(--error); }
.fn-row .avg, .hbar .avg { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--st-blue); }
.fn-v { text-align: right; font-weight: 600; }
.fn-avg { color: var(--sub); font-size: .8125rem; }
.stack-col { display: grid; gap: 16px; align-content: start; }
.verdict { display: grid; gap: 8px; padding: 16px; border-radius: 14px; background: var(--card-2); border: 1px solid transparent; }
.loaded { color: #6A6A6A; font-size: .8125rem; }
td small { color: var(--sub); }

/* ── 좁은 화면 (노트북 작은 창 · 태블릿) ── */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .row-2, .row-3 { grid-template-columns: 1fr 1fr; }
  .row-2 > :first-child { grid-column: 1 / -1; }
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row-h { grid-template-columns: 1fr; }
}
/* ── 휴대폰: 메뉴를 위로 ── */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 5; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand span, .fresh { display: none; }
  .menu { display: flex; }
  .side-foot { margin: 0 0 0 auto; }
  .page { padding: 24px 16px 48px; }
  .kpis, .row-2, .row-h, .row-3, .board { grid-template-columns: 1fr; }
  .fn-row { grid-template-columns: 110px 1fr 52px; }
  .fn-avg { display: none; }
  .team-nums { grid-template-columns: 1fr 1fr; }
  .sheet { top: auto; max-height: 88vh; width: 100%; border-radius: 20px 20px 0 0; border-left: 0; }
}


/* 카드 제목 줄 (제목 왼쪽 · 범례 오른쪽) */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h2 { font-size: 1.0625rem; font-weight: 700; }
.sheet .card-head { margin-bottom: 8px; }
.sheet .card-head h3 { margin: 0; }
.lime-sq { background: rgb(224 254 2 / .55); }
.col-head { cursor: help; }
/* 주차 표시: 신규 = 파랑, n주차 = 회색 */
.tag { display: inline-flex; align-items: center; padding: 0 8px; border-radius: 5px; font-size: .8125rem; font-weight: 600; line-height: 18px; white-space: nowrap; background: var(--card-2); color: var(--sub); }

/* 단계 카드: 제목 줄에 업로드 날짜 · 버전 · 지출/상한 */
.sc-title b { font-size: 1.0625rem; }
.sc-title .ver { color: var(--sub); font-weight: 600; }
.cap-num { margin-left: auto; color: #6A6A6A; font-size: .8125rem; font-weight: 400; white-space: nowrap; }
.stage-card .cap-track { display: block; }
.sc-foot { justify-content: flex-start; }
.fix-chip { justify-self: start; display: inline-flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; padding: 2px 8px; border-radius: 6px; background: rgb(255 255 255 / .05); color: var(--st-amber); font-size: .8125rem; font-weight: 600; }
.fix-chip em { font-style: normal; color: var(--error); white-space: nowrap; }

/* 기간 선택 */
.range-pick { display: flex; align-items: center; gap: 8px; }
.select { min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 500 .9375rem var(--font); color-scheme: dark; cursor: pointer; }
select.select { appearance: none; padding-right: 32px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23F5F5F5' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") right 12px center no-repeat; }
.select:hover { border-color: #3A3A3A; }

/* 단계 요약 한 줄 + 소재가 있는 칸만 */
.stage-sum { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: .9375rem; color: var(--sub); }
.stage-sum span { cursor: help; }
.stage-sum b { color: var(--text); margin-left: 2px; }
.stage-sum .zero, .stage-sum .zero b { color: #5A5A5A; }
.board { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(240px, 280px); justify-content: start; overflow-x: auto; }

/* 날짜 선택 팝업 (왼쪽 빠른 선택 · 오른쪽 달력 두 달) */
.dp { position: relative; }
.dp-btn { display: inline-flex; align-items: center; gap: 8px; }
.dp-btn b { font-weight: 600; }
.dp-btn span { color: var(--sub); }
.dp-pop { position: absolute; z-index: 9; top: calc(100% + 8px); right: 0; display: flex; border-radius: 16px; background: #1A1A1A; border: 1px solid var(--line); box-shadow: 0 16px 48px rgb(0 0 0 / .6); overflow: hidden; }
.dp-presets { display: grid; align-content: start; gap: 2px; padding: 12px; border-right: 1px solid var(--line); min-width: 150px; }
.dp-presets button { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: var(--text); font-size: .9375rem; text-align: left; cursor: pointer; }
.dp-presets button:hover { background: var(--card-2); }
.dp-presets i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #5A5A5A; flex: none; }
.dp-presets [aria-pressed="true"] i { border: 5px solid var(--primary); }
.dp-main { display: grid; padding: 16px 24px; gap: 12px; }
.dp-cal { display: flex; align-items: flex-start; gap: 24px; }
.dp-nav { width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 1.25rem; cursor: pointer; }
.dp-nav:hover { background: var(--card-2); }
.dp-nav:disabled { color: #3A3A3A; cursor: default; background: none; }
.month-name { text-align: center; font-weight: 600; margin: 4px 0 8px; }
.days { display: grid; grid-template-columns: repeat(7, 36px); row-gap: 4px; }
.wd { text-align: center; color: var(--sub); font-size: .8125rem; line-height: 28px; }
.day { height: 34px; border: 0; background: none; color: var(--text); font-size: .9375rem; cursor: pointer; border-radius: 8px; }
.day:hover { background: var(--card-2); }
.day.in { background: rgb(224 254 2 / .14); border-radius: 0; }
.day.edge { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.day:disabled { color: #3A3A3A; cursor: default; background: none; }
.dp-foot { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.dp-foot span { margin-right: auto; font-weight: 600; }
.btn-ghost, .btn-apply { min-height: 38px; padding: 0 16px; border-radius: 10px; font-weight: 600; cursor: pointer; }
.btn-ghost { background: none; border: 1px solid #4A4A4A; color: var(--text); }
.btn-apply { background: var(--primary); border: 0; color: var(--on-primary); }
.btn-apply:disabled { opacity: .4; cursor: default; }

/* 카드: 제목 줄은 날짜·버전만, 상태 줄 오른쪽에 지출/상한 */
.stage-card { min-width: 0; }
.sc-line { display: flex; align-items: baseline; gap: 8px; }
.sc-line .sc-text b { color: var(--text); font-weight: 600; }
.sc-line .cap-num { margin-left: auto; }

/* 소재 표: 업로드 묶음 = 열에 맞춘 소계 줄 (옅은 바탕) */
tr.grp td { background: #1C1C1C !important; border-top: 1px solid var(--line); font-weight: 600; cursor: default; }
tr.grp td:first-child b { font-weight: 700; margin-right: 8px; }
tr.grp td:first-child span { color: var(--sub); font-weight: 400; font-size: .8125rem; }
tbody tr.grp { cursor: default; }
.dim { color: #5E5E5E; }
/* 열 제목을 스크롤해도 위에 고정 (넓은 화면에서는 표가 넘치지 않아서 카드 스크롤 없이) */
@media (min-width: 1200px) { .table-card { overflow: visible; } }
th { z-index: 2; background: rgb(22 22 22 / .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 10px 12px -12px rgb(0 0 0 / .9); }

/* 3. 같은 길로 들어오고 나가기: 패널은 오른쪽, 날짜 팝업은 버튼에서 펼쳐짐 */
.sheet.closing { animation: out-right .18s cubic-bezier(.4, 0, 1, 1) forwards; }
@keyframes out-right { to { transform: translateX(24px); opacity: 0; } }
.dp-pop { transform-origin: top right; }
.dp-pop.enter { animation: pop-in .16s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } }

/* 4. 누르는 순간 반응 (손을 떼기 전에) */
.stage-card, .row, .seg button, .menu button, .select, .text-btn, .cta, .btn-apply, .btn-ghost, .dp-presets button, .day, .dp-nav { transition: transform .1s ease-out, background-color .15s; }
:is(.stage-card, .row, .seg button, .menu button, .select, .text-btn, .cta, .btn-apply, .btn-ghost, .dp-presets button, .day, .dp-nav):active:not(:disabled) { transform: scale(.97); }
tbody tr:not(.grp):active td { background: #2A2A2A; }

/* 5. 크기별 자간·행간: 큰 글자는 좁고 촘촘하게, 작은 글자는 살짝 넓게 */
.kpi .value { letter-spacing: -.03em; line-height: 1.1; }
.head h1 { letter-spacing: -.02em; line-height: 1.25; }
.card h2, .card-head h2, .sheet h2, .sheet h3, .grp-row > b { letter-spacing: -.01em; line-height: 1.3; }
.sub, .row-sub, .cap-text, .cap-num, .note, small, .tag, .badge, .stage, th, .wd, .legend, .fn-avg, .fresh, .count, .fix-chip, .stage-sum { letter-spacing: .01em; }
table { line-height: 1.35; }

/* 8. 접근성: 동작 줄이기 = 움직임 없이, 투명도 줄이기 = 흐림 없이 */
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet.closing, .dp-pop.enter { animation: none; }
  :is(.stage-card, .row, .seg button, .menu button, .select, .text-btn, .cta, .btn-apply, .btn-ghost, .dp-presets button, .day, .dp-nav):active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) { th { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* 마지막 열(약한 단계)은 두 줄까지 허용해서 표가 카드를 넘지 않게 */
td:last-child { white-space: normal; }
td:last-child .fix-chip { justify-content: flex-end; }
td:first-child, th:first-child button { padding-left: 4px; }
td:last-child, th:last-child button { padding-right: 4px; }

/* ── 왼쪽 아이콘 바 (홈 · 소재 · 팀). 이름은 마우스를 올리면 오른쪽에 ── */
.app { grid-template-columns: 88px 1fr; }
.side { align-items: center; gap: 16px; padding: 24px 0; background: none; border-right: 0; }
.side .brand { padding: 0; }
.menu { display: grid; gap: 8px; padding: 8px; border-radius: 999px; background: #1C1C1C; border: 1px solid var(--line); }
.menu button, .menu-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--sub); cursor: pointer; }
.menu button:hover, .menu-btn:hover { color: var(--text); background: #2A2A2A; }
.menu button[aria-current="page"] { background: var(--text); color: var(--on-primary); }
.menu-btn.logout { margin-top: auto; border: 1px solid var(--line); }
.menu button::after, .menu-btn::after { content: attr(data-label); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); padding: 4px 8px; border-radius: 8px; background: #2A2A2A; color: var(--text); font-size: .8125rem; font-weight: 500; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 10; }
.menu button:hover::after, .menu button:focus-visible::after, .menu-btn:hover::after, .menu-btn:focus-visible::after { opacity: 1; }
:is(.menu-btn):active { transform: scale(.97); }
/* 제목 아래 데이터 신선도 한 줄 */
.head .fresh { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; padding: 0; font-size: .8125rem; color: var(--sub); }
.head .fresh span { display: inline-flex; align-items: center; gap: 6px; }
.head .fresh b { margin-left: 0; color: var(--text); font-weight: 500; }
@media (max-width: 760px) {
  /* 본문이 화면보다 짧을 때 남는 높이는 본문 칸만 가짐. 안 정하면 메뉴 바도 나눠 받아서 길게 늘어남 */
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { flex-direction: row; justify-content: space-between; padding: 8px 16px; }
  .menu { display: flex; }
  .menu-btn.logout { margin: 0; }
  .menu button::after, .menu-btn::after { display: none; }
}

/* 아이콘 바를 왼쪽 세로 가운데로 (로고는 위, 로그아웃은 아래에 고정) */
@media (min-width: 761px) {
  .side { justify-content: center; }
  .side .brand { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); }
  .menu-btn.logout { position: absolute; bottom: 24px; left: 50%; margin: 0; transform: translateX(-50%); }
  .menu-btn.logout:active { transform: translateX(-50%) scale(.97); }
}
/* 본문은 화면 폭을 다 씀 (넓은 모니터에서 오른쪽이 비지 않게) */
.page { max-width: none; }

/* 광고 단계: 단계마다 가로 한 줄, 카드는 화면 폭에 맞춰 여러 줄로 */
.lanes { display: grid; margin-top: 16px; }
.lane { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line); }
.lane:first-child { border-top: 0; padding-top: 0; }
.lane:last-child { padding-bottom: 0; }
.lane-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 36px; cursor: help; }
.lane-head .text-btn { padding: 0 8px; }
.lane-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
@media (max-width: 760px) { .lane { grid-template-columns: 1fr; } }

/* 물어보기 (AI) */
.ask-fab { position: fixed; z-index: 6; right: 24px; bottom: 24px; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: .9375rem; cursor: pointer; box-shadow: 0 8px 24px rgb(0 0 0 / .4); }
.ask-fab:hover { background: var(--text); }
.ask { position: fixed; z-index: 9; right: 24px; bottom: 24px; width: min(420px, calc(100vw - 32px)); height: min(600px, calc(100vh - 48px)); display: grid; grid-template-rows: auto 1fr auto; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 16px 48px rgb(0 0 0 / .5); animation: pop-in .2s var(--ease); transform-origin: bottom right; }
.ask-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 24px; }
.ask-head h2 { font-size: 1.0625rem; font-weight: 700; }
.ask-log { overflow-y: auto; display: grid; align-content: start; gap: 12px; padding: 8px 24px 16px; }
.msg { max-width: 92%; font-size: .9375rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { justify-self: end; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: var(--card-2); }
.msg.ai b { color: var(--primary); font-weight: 600; }
.msg.busy { color: var(--sub); }
.msg.err { color: var(--error); }
.ask-ex { display: grid; gap: 8px; margin-top: 12px; }
.ask-ex button { justify-self: start; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: none; color: var(--text); font-size: .875rem; text-align: left; cursor: pointer; }
.ask-ex button:hover { background: var(--card-2); }
.ask-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 16px 16px; padding: 8px 8px 8px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.ask-form:focus-within { border-color: var(--sub); }
.ask-form textarea { flex: 1; min-height: 24px; max-height: 120px; padding: 6px 0; border: 0; background: none; color: var(--text); font: inherit; resize: none; field-sizing: content; outline: none; }
.ask-form button { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: var(--primary); color: var(--on-primary); cursor: pointer; }
.ask-form button:disabled { opacity: .4; cursor: default; }

/* ── 제작 ── */
#make { display: grid; gap: 16px; }
/* 제목 아래 신선도 줄이 없어서, 가운데로 맞추면 제목이 다른 탭보다 5px 내려감 */
#make .head { align-items: flex-start; }
#make-body { display: grid; gap: 12px; }
.jobs { display: grid; gap: 8px; }
.job { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 16px; width: 100%; padding: 12px 16px; border: 0; border-radius: 16px; background: var(--card); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.job:hover { background: var(--card-2); }
.job img, .job-blank { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--card-2); display: block; }
.job-main { display: grid; gap: 2px; min-width: 0; }
.job-main b { font-weight: 600; }
.job-main .sub { font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-tag.run { color: var(--st-blue); }
.job-tag.ok { color: var(--st-green); }
.job-tag.bad { color: var(--error); }
.job-tag.warn { color: var(--st-amber); }
.make-note { padding: 12px 16px; border-radius: 12px; background: var(--card-2); color: var(--st-amber); font-size: .9375rem; }
.make-usage { font-size: .8125rem; }
dialog.sheet { margin: 0 0 0 auto; height: 100vh; max-height: none; max-width: none; border: 0; border-left: 1px solid var(--line); color: var(--text); }
dialog.sheet:not([open]) { display: none; }
#new-sheet, #skill-sheet { width: min(480px, 100vw); } /* 폼은 좁게. 넓은 창은 결과 보기만 */
dialog::backdrop { background: rgba(0, 0, 0, .6); }
#job-body { display: grid; gap: 16px; }
#job-body section { display: grid; gap: 8px; }
.job-open { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.job-problems, .job-runs { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.job-problems { color: var(--st-amber); font-size: .9375rem; }
.job-runs .sub { font-size: .8125rem; }
.job-runs p { white-space: pre-wrap; overflow-wrap: anywhere; }
.make-form { display: grid; gap: 16px; }
.make-form label { display: grid; gap: 8px; font-size: .9375rem; font-weight: 500; }
.make-form label .sub { display: inline; font-weight: 400; font-size: .8125rem; }
.make-form input, .make-form textarea, .make-form select { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit; font-weight: 400; }
.make-form textarea { resize: vertical; }
.make-form select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23F5F5F5' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-position: right 14px center; background-repeat: no-repeat; color-scheme: dark; cursor: pointer; }
.make-form input:focus, .make-form textarea:focus, .make-form select:focus { border-color: var(--primary); outline: none; }
.make-who-dlg { width: min(360px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 20px; background: var(--card); color: var(--text); }
.make-who-dlg h2 { font-size: 1.0625rem; font-weight: 700; }
.menu button { position: relative; }
.menu button.has-dot::after { content: ""; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.job-diff { margin: 0; padding: 12px 14px; max-height: 360px; overflow: auto; border-radius: 12px; background: var(--bg); font: 12px/1.6 ui-monospace, Menlo, monospace; white-space: pre; }
.job-diff .add { color: var(--st-green); }
.job-diff .del { color: var(--error); }
.job-diff .meta { color: var(--sub); }
.sources-box { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
.sources-box legend { padding: 0; margin-bottom: 8px; font-size: .9375rem; font-weight: 500; }
#skill-sources { display: grid; gap: 8px; max-height: 340px; overflow-y: auto; }
.make-form label.source { display: grid; grid-template-columns: 20px 44px 1fr; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: var(--card-2); cursor: pointer; font-weight: 400; }
.make-form label.source input { width: 18px; height: 18px; padding: 0; accent-color: var(--primary); }
.source img, .source .job-blank { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.source .job-main .sub { font-size: .8125rem; }
/* TF 대화 */
body:has(#tf:not([hidden])) .ask-fab { display: none; } /* 보내기 버튼을 가림 */
.tf { display: grid; grid-template-columns: 260px 1fr; gap: 16px; height: calc(100vh - 190px); min-height: 480px; }
.tf-list { display: grid; align-content: start; gap: 6px; overflow-y: auto; }
.tf-item { display: grid; gap: 4px; justify-items: start; width: 100%; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--card); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.tf-item:hover, .tf-item[aria-current] { background: var(--card-2); }
.tf-item b { font-weight: 600; font-size: .9375rem; overflow-wrap: anywhere; }
.tf-meta { color: var(--sub); font-size: .8125rem; }
.tf-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; overflow-y: auto; padding: 16px; border-radius: 20px; background: var(--card); }
.tf-log { flex: 1 0 160px; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-right: 4px; }
.tf-empty { margin: auto; max-width: 420px; display: grid; gap: 8px; text-align: center; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; display: grid; gap: 4px; }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: #2C2C2C; }
.msg.ai { align-self: flex-start; background: var(--card-2); }
.tf-actions { flex: none; display: grid; gap: 8px; }
.tf-actions:empty { display: none; }
.tf-apply { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.tf-apply p { flex: 1; }
.tf-apply button { flex: none; }
.tf-change summary { cursor: pointer; font-size: .9375rem; font-weight: 600; }
.tf-change .job-diff { margin-top: 8px; max-height: 220px; }
.tf-form { flex: none; gap: 8px; }
.tf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tf-chips:empty { display: none; }
.tf-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--card-2); font-size: .8125rem; }
.tf-chip button { border: 0; background: none; color: var(--sub); cursor: pointer; padding: 2px 6px; }
.tf-tools { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 900px) {
  .tf { grid-template-columns: 1fr; height: auto; }
  .tf-list { max-height: 180px; }
  .tf-log { max-height: 50vh; }
}
.job-previews, .job-generated { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
.job-shot { display: block; min-width: 0; cursor: zoom-in; }
.job-shot.wide { grid-column: 1 / -1; }
.job-shot img { display: block; width: 100%; border-radius: 10px; background: var(--card-2); }
.job-request-wrap, .job-log-list { display: grid; gap: 12px; }
#job-log { display: grid; gap: 24px; }
.job-request { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 16px; align-items: start; padding: 16px; border-radius: 12px; background: var(--card-2); }
.job-request.many { grid-template-columns: minmax(0, 1fr); }
.job-request dl { display: grid; gap: 10px; margin: 0; }
.job-request dl div { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; }
.job-request dt { color: var(--sub); font-size: .8125rem; }
.job-request dd { margin: 0; font-size: .875rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.job-inputs { display: flex; flex-wrap: wrap; gap: 8px; }
.job-inputs .job-shot { width: 88px; text-decoration: none; }
.job-inputs img { aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; }
.job-inputs small { display: block; margin-top: 2px; text-align: center; }
.zoom { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 16px; border: 0; background: none; cursor: zoom-out; }
.zoom:not([open]) { display: none; }
.zoom img { display: block; width: 100%; height: 100%; object-fit: contain; }
.zoom::backdrop { background: rgba(0, 0, 0, .88); }
.make-limits { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: .8125rem; color: var(--sub); }
.limit { display: flex; align-items: center; gap: 8px; }
.limit-bar { width: 96px; height: 6px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.limit-bar i { display: block; height: 100%; background: var(--st-green); }
.limit.warn .limit-bar i { background: var(--st-amber); }
.limit.bad .limit-bar i { background: var(--error); }
.limit b { color: var(--text); font-weight: 600; }
.make-status { font-size: .9375rem; font-weight: 600; }
.make-status.ok { color: var(--st-green); }
.make-status.run { color: var(--st-blue); }
.make-status.warn { color: var(--st-amber); }
.make-status.bad { color: var(--error); }
/* 새 작업: 자동 제작 토글 · 모델 보관함 */
.make-form label.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 12px; background: var(--card-2); cursor: pointer; }
.make-form label.switch-row small.sub { display: block; margin-top: 2px; font-size: .8125rem; font-weight: 400; }
.make-form input.switch { appearance: none; flex: none; width: 44px; height: 26px; padding: 0; border: 0; border-radius: 13px; background: #4A4A4A; position: relative; cursor: pointer; transition: background .15s var(--ease); }
.make-form input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform .15s var(--ease); }
.make-form input.switch:checked { background: var(--primary); }
.make-form input.switch:checked::after { transform: translateX(18px); background: var(--on-primary); }
.make-group { display: grid; gap: 12px; }
.group-title { font-size: .9375rem; font-weight: 500; }
.group-title .sub { margin-left: 4px; font-size: .8125rem; font-weight: 400; }
.tiles { display: grid; grid-template-columns: 72px 1fr; gap: 8px; }
.tiles-list { display: grid; grid-template-columns: repeat(auto-fill, 72px); gap: 8px; max-height: 240px; overflow-y: auto; }
.tile-wrap { position: relative; width: 72px; height: 72px; }
.tile { display: block; width: 72px; height: 72px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--card-2); cursor: pointer; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile[aria-pressed="true"] { outline: 3px solid var(--primary); outline-offset: -3px; }
.tile[aria-pressed="true"] img { opacity: .85; }
.make-form label.tile-add { display: flex; align-items: center; justify-content: center; border: 1px dashed #4A4A4A; background: none; color: var(--sub); font-size: 1.5rem; font-weight: 400; }
.tile-add:hover { color: var(--text); border-color: var(--sub); }
.tile-add:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.tile-hide { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .7); color: var(--text); font-size: .6875rem; line-height: 20px; cursor: pointer; opacity: 0; }
.tile-wrap:hover .tile-hide, .tile-hide:focus-visible { opacity: 1; }
.tile-note { font-size: .8125rem; }

/* 스켈레톤: 첫 데이터가 오기 전 화면 모양 */
.sk { display: block; height: 16px; border-radius: 8px; background: linear-gradient(90deg, var(--card-2) 25%, #2A2A2A 50%, var(--card-2) 75%); background-size: 200% 100%; animation: sk-move 1.4s linear infinite; }
@keyframes sk-move { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; }
.sk-title { width: 160px; height: 28px; }
.sk-range { width: 200px; height: 36px; border-radius: 12px; }
.sk-board, .sk-list { display: grid; gap: 16px; align-content: start; }
.sk-h { width: 96px; height: 20px; }
.kpi .sk-label { width: 64px; height: 14px; }
.kpi .sk-value { width: 112px; height: 30px; margin: 16px 0; }
.sk-chart { height: 152px; }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.job-sk { pointer-events: none; }
.job-sk .sk-thumb { width: 56px; height: 56px; border-radius: 10px; }
.job-sk .job-main { display: grid; gap: 8px; }
.job-sk .job-main .sk:first-child { width: 40%; }
.job-sk .job-main .sk:last-child { width: 24%; height: 12px; }
