/* 더 보기 · 네이버 광고 지난주 성과 (scenes/ads.html). 틀은 ta.css, 여기서는 .s-ads 아래만.
   넓은 화면: 왼쪽 티파이브 대화 창 + 오른쪽 평소 열어 둔 크롬(광고 관리). 정리할 때 티파이브 창이 넓어지며 엑셀이 열린다.
   휴대폰: 대화 창을 꽉 채우고, 크롬과 엑셀은 차례로 아래에서 올라온다. 광고 서비스 상징 그림은 그리지 않는다. */

/* ───────── 자리 ───────── */
/* 대화 칸 폭은 무대 폭에 따라 272~304px. 크롬은 그 오른쪽을 채우고, 엑셀을 열 때 티파이브 창이 끝까지 넓어진다. */
.s-ads .ta-desk { --tw: clamp(272px, 39cqw, 304px); }
@container tadesk (min-width: 701px) {
  .s-ads .ta-app, .s-ads .ta-app.show { right: auto; z-index: 3; width: var(--tw); grid-template-columns: var(--tw) minmax(0, 1fr); transition: width .75s var(--ta-glide); }
  .s-ads .ta-app.show { width: calc(100% - 32px); }
  .s-ads .ad-cr { left: calc(var(--tw) + 26px); top: 30px; right: 16px; bottom: 30px; }
}
.s-ads .ta-swap { display: none; }

/* ───────── 크롬 창 ───────── */
.s-ads .ad-cr { z-index: 2; background: #dfe3e8; }
.s-ads .ad-top { flex: none; display: flex; align-items: flex-end; gap: 2px; height: 38px; padding: 0 8px; }
.s-ads .ad-top .ta-lights { align-self: center; padding: 0 8px 0 3px; }
.s-ads .ad-tab { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 210px; height: 30px; padding: 0 12px 0 11px; border-radius: 9px 9px 0 0; background: #fff; font-size: 11.5px; font-weight: 600; color: var(--ta-tx); white-space: nowrap; box-shadow: 0 -1px 2px rgba(0, 0, 0, .05); }
.s-ads .ad-fav { flex: none; width: 14px; height: 14px; }
.s-ads .ad-tn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.s-ads .ad-load { display: none; flex: none; width: 12px; height: 12px; border-radius: 50%; border: 1.6px solid #d2d5da; border-top-color: #03a94d; animation: ta-spin .7s linear infinite; }
.s-ads .ad-cr.busy .ad-load { display: block; }
.s-ads .ad-bar { flex: none; display: flex; align-items: center; padding: 6px 10px; background: #fff; border-bottom: 1px solid #ececef; }
.s-ads .ad-addr { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 999px; background: #f1f3f4; font-size: 12px; color: #5f6368; white-space: nowrap; overflow: hidden; }
.s-ads .ad-addr b { font-weight: 600; color: var(--ta-tx); }
.s-ads .ad-addr svg { width: 13px; height: 13px; flex: none; fill: none; stroke: #5b6066; stroke-width: 1.4; }

/* ───────── 광고 관리 화면(느낌만) ───────── */
.s-ads .ad-page { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #f6f7f9; }
.s-ads .ad-hd { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; background: #fff; border-bottom: 1px solid #eceef1; }
.s-ads .ad-hd b { font-size: 13px; font-weight: 800; letter-spacing: -.02em; color: #1e2a24; }
.s-ads .ad-hd b::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; background: #03c75a; vertical-align: 1px; }
.s-ads .ad-acc { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: #3c4a43; }
.s-ads .ad-acc svg, .s-ads .ad-dd svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.s-ads .ad-nav { display: flex; gap: 14px; height: 30px; align-items: stretch; padding: 0 12px; background: #fff; border-bottom: 1px solid #eceef1; font-size: 11.5px; font-weight: 600; color: #5d6a64; white-space: nowrap; }
.s-ads .ad-nav span { display: flex; align-items: center; }
.s-ads .ad-nav .on { color: #079b47; box-shadow: inset 0 -2px 0 #03c75a; font-weight: 800; }

.s-ads .ad-filter { position: relative; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 9px 12px 0; }
.s-ads .ad-dd { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1px #d5dbd8; font-size: 11.5px; font-weight: 600; color: #26332d; white-space: nowrap; transition: box-shadow .2s; }
.s-ads .ad-dd > span { grid-area: 1 / 1; }
.s-ads .ad-d1 { display: none; }
.s-ads .ad-cr.hit .ad-d0 { display: none; }
.s-ads .ad-cr.hit .ad-d1 { display: inline; color: #079b47; }
.s-ads .ad-cr.lit .ad-dd { box-shadow: inset 0 0 0 1.5px #03c75a; }
.s-ads .ad-flt2 { font-size: 11px; color: #6b7570; white-space: nowrap; }
.s-ads .ad-menu { position: absolute; left: 12px; top: 39px; width: 120px; padding: 5px; border-radius: 8px; background: #fff; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .3), 0 0 0 1px rgba(0, 0, 0, .06); opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .3s var(--ta-glide); pointer-events: none; }
.s-ads .ad-cr.lit .ad-menu { opacity: 1; transform: none; }
.s-ads .ad-menu li { padding: 4px 8px; border-radius: 5px; font-size: 11.5px; color: #26332d; }
.s-ads .ad-menu li.hit { background: #e6f8ee; color: #079b47; font-weight: 700; }

.s-ads .ad-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 9px 12px 0 !important; }
.s-ads .ad-sum li { display: grid; gap: 1px; padding: 7px 8px; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1px #e6e9ee; }
.s-ads .ad-sum li > span { font-size: 11px; color: #6b7570; white-space: nowrap; }
.s-ads .ad-sum b { display: grid; font-size: 13px; font-weight: 800; color: #1e2a24; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
/* 오늘 숫자(a) → 지난주 숫자(b) */
.s-ads .ad-page .a, .s-ads .ad-page .b { grid-area: 1 / 1; transition: opacity .3s; }
.s-ads .ad-page .b { opacity: 0; }
.s-ads .ad-cr.hit .ad-page .a { opacity: 0; }
.s-ads .ad-cr.hit .ad-page .b { opacity: 1; }

.s-ads .ad-tb { width: calc(100% - 24px); margin: 9px 12px 0; border-collapse: separate; border-spacing: 0; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px #e6e9ee; table-layout: fixed; font-size: 11px; font-variant-numeric: tabular-nums; }
.s-ads .ad-tb th { height: 25px; padding: 0 8px; background: #f2f5f3; border-bottom: 1px solid #e3e8e5; font-weight: 700; color: #4b5852; text-align: left; white-space: nowrap; }
.s-ads .ad-tb th:nth-child(2) { width: 62px; }
.s-ads .ad-tb th:nth-child(3) { width: 40px; }
.s-ads .ad-tb th:nth-child(4) { width: 72px; }
.s-ads .ad-tb td { height: 30px; padding: 0 8px; border-bottom: 1px solid #f0f2f1; color: #1e2a24; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .25s; }
.s-ads .ad-tb tr:last-child td { border-bottom: 0; }
.s-ads .ad-tb td.n { position: relative; text-align: right; }
.s-ads .ad-tb td.n .a { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.s-ads .ad-tb td i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #03c75a; vertical-align: 1px; }
.s-ads .ad-tb tr.lit td { background: #eaf9f0; }
.s-ads .ad-tb tr.lit td:first-child { box-shadow: inset 2px 0 0 #03c75a; }

/* ───────── 자료 칸의 엑셀 미리보기 ───────── */
.s-ads .ad-xl { padding: 10px 14px 0; background: #fff; }
.s-ads .ad-xt { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.s-ads .ad-xt span { font-size: 11px; font-weight: 500; color: var(--ta-faint); }
.s-ads .ad-kpi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 9px !important; }
.s-ads .ad-kpi li { display: grid; gap: 1px; padding: 7px 9px; border-radius: 9px; background: #f5f7f6; box-shadow: inset 0 0 0 1px #e9edeb; }
.s-ads .ad-kpi span { font-size: 11px; color: var(--ta-sub); }
.s-ads .ad-kpi b { font-size: 14px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.s-ads .ad-kpi i { font-style: normal; }
.s-ads .ad-chart { margin-top: 10px; padding: 10px 11px 8px; border-radius: 11px; box-shadow: inset 0 0 0 1px #e6e9ee; }
.s-ads .ad-ch { margin-bottom: 7px !important; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-ads .ad-ch span { font-size: 11px; font-weight: 500; color: var(--ta-faint); }
.s-ads .ad-bars { display: grid; gap: 5px; }
.s-ads .ad-bars li { position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr) 40px; gap: 8px; align-items: center; height: 22px; font-size: 11px; }
.s-ads .ad-bn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #3a3a3c; }
.s-ads .ad-bt { position: relative; height: 12px; border-radius: 4px; background: #f0f2f4; overflow: hidden; }
.s-ads .ad-bt i { position: absolute; inset: 0; border-radius: 4px; background: #2f5d73; transform-origin: left; transform: scaleX(0); }
.s-ads .ta-app.show .ad-bt i { transform: scaleX(var(--w)); transition: transform .8s var(--ta-glide); transition-delay: calc(var(--i) * 90ms + .45s); }
.s-ads .ad-bars li.best .ad-bt i { background: #1f9d55; }
.s-ads .ad-bars li.worst .ad-bt i { background: #e8590c; }
.s-ads .ad-bars b { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.s-ads .ad-bars li.best b { color: #1f7a45; }
.s-ads .ad-bars li.worst b { color: #c2410c; }
.s-ads .ad-bars em { position: absolute; top: 50%; right: 54px; font-style: normal; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; opacity: 0; transform: translateY(-50%); transition: opacity .3s; }
.s-ads .ad-bars li.best em { color: #1f7a45; }
.s-ads .ad-bars li.worst em { color: #fff; }
.s-ads .ta-app.show .ad-bars em { opacity: 1; transition-delay: 1.3s; }
.s-ads .ad-note { display: flex; gap: 8px; margin-top: 9px !important; padding: 8px 10px; border-radius: 9px; background: #fff6ef; box-shadow: inset 3px 0 0 #e8590c; font-size: 11.5px; line-height: 1.5; color: #4a2a15; opacity: 0; transition: opacity .4s; }
.s-ads .ad-note b { font-weight: 700; }
.s-ads .ta-app.show .ad-note { opacity: 1; transition-delay: 1.5s; }
.s-ads .ad-sheets { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 2px; padding: 0 8px; height: 26px; align-items: flex-start; background: #f3f4f6; border-top: 1px solid #e2e4e8; }
.s-ads .ad-sheets span { padding: 3px 10px; font-size: 11px; color: #6e6e73; white-space: nowrap; }
.s-ads .ad-sheets .on { background: #fff; color: #1f7a45; font-weight: 700; box-shadow: inset 0 -2px 0 #1f7a45; }

/* 받은 파일 — 한 번 반짝 */
.s-ads .ad-file.hit { animation: ad-flash 1.4s var(--ta-glide) both; }
@keyframes ad-flash { 40% { box-shadow: inset 0 0 0 1.5px var(--cobalt); background: #f3f7ff; } }

/* ───────── 휴대폰 ───────── */
@container tadesk (max-width: 700px) {
  .s-ads .ad-cr { left: 10px; right: 10px; top: 12%; bottom: 10px; z-index: 4; border-radius: 14px; box-shadow: 0 -12px 30px -14px rgba(0, 0, 0, .3), 0 0 0 .5px rgba(0, 0, 0, .2); transform: translateY(106%); transition: transform .6s var(--ta-glide); }
  .s-ads .ad-cr.show { transform: none; }
  .s-ads .ta-side { inset: 9% 0 0 0; }
  .s-ads .ta-side .ta-tool, .s-ads .ad-sheets { display: none; }
  .s-ads .ad-top .ta-lights i { width: 9px; height: 9px; }
  .s-ads .ad-tab { flex: 1; max-width: none; }
  .s-ads .ad-tab, .s-ads .ad-addr, .s-ads .ad-acc, .s-ads .ad-nav, .s-ads .ad-dd, .s-ads .ad-flt2, .s-ads .ad-menu li, .s-ads .ad-sum li > span, .s-ads .ad-tb, .s-ads .ad-xt span, .s-ads .ad-kpi span, .s-ads .ad-ch span, .s-ads .ad-bars li, .s-ads .ad-bars em, .s-ads .ad-sheets span, .s-ads .ta-ft { font-size: 12px; }
  .s-ads .ad-sum { gap: 5px; }
  .s-ads .ad-sum li { padding: 6px 7px; }
  .s-ads .ad-sum b { font-size: 12.5px; }
  .s-ads .ad-tb td { height: 28px; }
  .s-ads .ad-tb th:nth-child(2) { width: 62px; }
  .s-ads .ad-tb th:nth-child(3) { width: 42px; }
  .s-ads .ad-tb th:nth-child(4) { width: 72px; }
  .s-ads .ad-tb td, .s-ads .ad-tb th { padding: 0 6px; }
  .s-ads .ad-tb td.n .a { right: 6px; }
  .s-ads .ad-note { font-size: 12px; }
}
/* 휴대폰: 막대는 두 줄(이름·숫자 / 막대)로 — 이름이 잘리지 않게. 꼬리표는 막대 칸 오른쪽 끝 */
@container tadesk (max-width: 700px) {
  .s-ads .ad-bars { gap: 5px; }
  .s-ads .ad-ch { margin-bottom: 5px !important; }
  .s-ads .ad-bars li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n v" "b b"; gap: 3px 8px; height: auto; }
  .s-ads .ad-bn { grid-area: n; }
  .s-ads .ad-bars b { grid-area: v; }
  .s-ads .ad-bt { grid-area: b; height: 8px; }
  .s-ads .ad-bars em { top: auto; bottom: -2px; right: 4px; transform: none; font-size: 12px; }
  .s-ads .ad-bars li.best em { bottom: auto; top: 2px; right: 52px; }
  .s-ads .ad-bars li.worst em { bottom: auto; top: 2px; right: 52px; color: #c2410c; }
  .s-ads .ad-chart { padding: 9px 10px 8px; }
  .s-ads .ad-kpi li { padding: 6px 8px; }
}
/* 좁은 휴대폰: 크롬 표의 노출 열, 지표 칸의 클릭률을 빼서 이름과 숫자가 잘리지 않게 */
@container tadesk (max-width: 420px) {
  .s-ads .ad-tb th:nth-child(2), .s-ads .ad-tb td:nth-child(2) { display: none; }
  .s-ads .ad-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s-ads .ad-sum li:nth-child(3) { display: none; }
  .s-ads .ad-xt span { display: none; }
}
@media (max-width: 860px) {
  .s-ads .ta-desk { --ta-h: 496px; }
}
@media (prefers-reduced-motion: reduce) {
  .s-ads .ad-file.hit { animation: none; }
}
