/* ============================================================
   시각 요소 모듈 12종 — inc/visuals.php 와 한 쌍
   ------------------------------------------------------------
   색은 레이아웃 팔레트를 따라간다.
     --point      포인트색 (L4 는 카드뉴스에서 뽑은 보조색, 없으면 --accent)
     --point-ink  흰 글자를 얹어도 4.5:1 이 나오는 진한 포인트색
     --point-soft 포인트색 아주 옅은 배경
   "등장 전" 상태는 .bbv-js(스크립트가 도는 브라우저)에서만 만든다.
   스크립트가 없거나 실패하면 처음부터 완성된 모양이 보인다.
   ============================================================ */
.bbv {
  --v-acc: var(--point, var(--accent, #2c62c9));
  --v-acc-ink: var(--point-ink, var(--accent-deep, var(--accent, #1e4895)));
  --v-soft: var(--point-soft, var(--sky, #eef3fb));
  --v-navy: var(--navy, var(--accent-deep, #10264f));
  --v-ink: var(--ink, #141a26);
  --v-mute: var(--ink-mute, #5b6478);
  --v-rule: var(--rule-soft, #e6ecf7);
  --v-track: #f1f4fa;
  margin: 22px 0 26px;
  padding: 20px 20px 18px;
  border: 1px solid var(--v-rule);
  border-radius: 14px;
  background: #fff;
  font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  color: var(--v-ink);
  overflow: hidden;
}
.bbv p { margin: 0; line-height: 1.6; }
.bbv p.bbv-cap { font-size: 14px; font-weight: 700; color: var(--v-navy); margin: 0 0 14px !important; line-height: 1.5; }
.bbv p.bbv-note { font-size: 12.5px; color: var(--v-mute); margin-top: 14px !important; line-height: 1.6; }

/* 등장 공통 */
.bbv-js .bbv:not(.is-on):not(.is-still) [style*="--i"] { opacity: 0; transform: translateY(8px); }
.bbv [style*="--i"] { transition: opacity .45s ease, transform .45s ease; transition-delay: calc(var(--i, 0) * .12s); }

/* ---------- 1 compare ---------- */
.bbv-bars { display: grid; gap: 10px; }
.bbv-bar { display: grid; grid-template-columns: minmax(56px, 22%) minmax(0, 1fr); align-items: center; gap: 10px; }
.bbv-bar-l { font-size: 13.5px; font-weight: 600; color: var(--v-ink); }
.bbv-track { height: 32px; background: var(--v-track); border-radius: 8px; overflow: hidden; display: block; }
.bbv-fill {
  display: flex; align-items: center; justify-content: flex-end; height: 100%;
  width: var(--w); min-width: max-content; padding: 0 10px; box-sizing: border-box;
  border-radius: 8px; background: #8e99b0; color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  transition: width 1.1s cubic-bezier(.22,.61,.36,1);
}
.bbv-fill.is-key { background: var(--v-acc-ink); }
.bbv-js .bbv:not(.is-on):not(.is-still) .bbv-fill { width: 0; min-width: 0; color: transparent; }
.bbv-tbl { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 13.5px; table-layout: fixed; }
.bbv-tbl th, .bbv-tbl td { padding: 10px 6px; border-top: 1px solid var(--v-rule); text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.bbv-tbl thead th { border-top: 0; color: var(--v-navy); font-weight: 700; }
.bbv-tbl thead th:first-child, .bbv-tbl tbody th { width: 44%; text-align: left; font-weight: 600; color: var(--v-ink); }
.bbv-tbl td { color: var(--v-mute); }
.bbv-tbl td.is-good { color: var(--v-acc-ink); font-weight: 700; }

/* ---------- 2 blocks ---------- */
.bbv-blocks { display: grid; grid-template-columns: var(--cols); gap: 6px; }
.bbv-block {
  padding: 13px 8px; border-radius: 10px; text-align: center; min-width: 0;
  background: color-mix(in srgb, var(--v-acc-ink) calc(var(--lv) * var(--lv) * 100%), var(--v-soft));  /* 가운데 칸은 옅게 — 진한 글자가 읽히게 */
  color: var(--v-acc-ink);
}
.bbv-block.is-dark { color: #fff; }
.bbv-block b { display: block; font-size: 14px; }
.bbv-block span { display: block; font-size: 11.5px; margin-top: 3px; line-height: 1.45; opacity: .92; }
@media (max-width: 480px) { .bbv-blocks { grid-template-columns: minmax(0, 1fr); } .bbv-block { text-align: left; padding: 12px 14px; } }

/* ---------- 3 ring ---------- */
.bbv-ringwrap { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 18px; align-items: center; }
.bbv-ring { position: relative; width: 104px; height: 104px; }
.bbv-ring svg { transform: rotate(-90deg); display: block; }
.bbv-ring circle { fill: none; stroke-width: 9; }
.bbv-ring .bg { stroke: var(--v-track); }
.bbv-ring .fg { stroke: var(--v-acc); stroke-linecap: round; stroke-dasharray: 264; stroke-dashoffset: var(--off, 0); transition: stroke-dashoffset 1.4s ease-out; }
.bbv-js .bbv:not(.is-on):not(.is-still) .bbv-ring .fg { stroke-dashoffset: 264; }
.bbv .bbv-ring p { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.15; }
.bbv-ring strong { font-size: 20px; font-weight: 800; color: var(--v-navy); }
.bbv-ring small { font-size: 10.5px; font-weight: 600; color: var(--v-mute); margin-top: 3px; }
.bbv-steps { list-style: none; margin: 0; padding: 0; counter-reset: bbvs; }
.bbv-steps li { counter-increment: bbvs; display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14px; line-height: 1.55; }
.bbv-steps li::before {
  content: counter(bbvs); flex: 0 0 24px; height: 24px; border-radius: 50%; margin-top: 1px;
  background: var(--v-navy); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
@media (max-width: 380px) { .bbv-ringwrap { grid-template-columns: minmax(0, 1fr); justify-items: center; } }

/* ---------- 4 timeline ---------- */
.bbv-flow { list-style: none; margin: 0; padding: 0; }
.bbv-flow li { position: relative; padding: 4px 0 18px 34px; }
.bbv-flow li:last-child { padding-bottom: 2px; }
.bbv-flow li::before {
  content: ""; position: absolute; left: 4px; top: 7px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 3px solid var(--v-acc);
}
.bbv-flow li:not(:last-child)::after {
  content: ""; position: absolute; left: 10px; top: 25px; bottom: 0; width: 2px;
  background: color-mix(in srgb, var(--v-acc) 30%, #fff);
}
.bbv-flow em { display: block; font-style: normal; font-size: 12px; font-weight: 700; color: var(--v-acc-ink); margin-bottom: 2px; }
.bbv-flow b { display: block; font-size: 15px; color: var(--v-navy); line-height: 1.45; }
.bbv-flow span { display: block; font-size: 13px; color: var(--v-mute); line-height: 1.6; margin-top: 2px; }

/* ---------- 5 counter ---------- */
.bbv-counts { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; }
.bbv-count { text-align: center; padding: 14px 6px; border-radius: 12px; background: var(--v-soft); min-width: 0; }
.bbv-count strong { display: block; font-size: 26px; font-weight: 800; color: var(--v-acc-ink); line-height: 1.2; font-variant-numeric: tabular-nums; }
.bbv-count strong small { font-size: 13px; font-weight: 700; margin-left: 2px; }
.bbv-count > span { display: block; font-size: 12.5px; color: var(--v-mute); margin-top: 4px; line-height: 1.45; word-break: keep-all; }
@media (max-width: 480px) { .bbv-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 6 chooser ---------- */
.bbv-qs { display: flex; flex-wrap: wrap; gap: 8px; }
.bbv-q {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--v-rule); background: #fff; color: var(--v-ink);
  transition: background-color .18s, color .18s, border-color .18s;
}
.bbv-q[aria-pressed="true"] { background: var(--v-navy); border-color: var(--v-navy); color: #fff; }
.bbv-as { display: grid; gap: 8px; margin-top: 14px; }
.bbv-a { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--v-rule); background: #fff; }
.bbv-a small { display: block; font-size: 12px; color: var(--v-mute); }
.bbv-a b { display: block; font-size: 16px; color: var(--v-navy); margin-top: 2px; }
.bbv-a span { display: block; font-size: 13px; color: var(--v-mute); margin-top: 4px; line-height: 1.6; }
.bbv-js .bbv-choose.is-ready .bbv-a:not(.is-sel) { display: none; }
.bbv-a.is-sel { border-color: var(--v-acc); background: var(--v-soft); }
.bbv-js .bbv-choose:not(.is-ready) .bbv-qs { display: none; }

/* ---------- 7 layers ---------- */
.bbv-layers { display: grid; gap: 4px; }
.bbv-layer {
  display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 12px 14px; border-radius: 8px;
  background: color-mix(in srgb, var(--v-navy) calc(var(--lv) * var(--lv) * 85% + 6%), #fff);  /* 포인트색과 섞으면 탁해진다 — 흰색과 섞는다 */
  color: var(--v-navy);
  margin-left: calc(var(--lv) * 18px);
}
.bbv-layer.is-dark { color: #fff; }
.bbv-layer b { font-size: 14px; }
.bbv-layer span { font-size: 12.5px; line-height: 1.5; opacity: .9; }
.bbv-layer.is-mark { box-shadow: inset 4px 0 0 var(--v-acc); }
@media (max-width: 480px) { .bbv-layer { grid-template-columns: minmax(0, 1fr); gap: 2px; margin-left: calc(var(--lv) * 10px); } }

/* ---------- 8 checklist ---------- */
.bbv-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bbv-checks li { position: relative; }
.bbv-checks input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bbv-checks label {
  display: block; cursor: pointer; padding: 12px 14px 12px 44px; border-radius: 10px;
  border: 1px solid var(--v-rule); background: #fff; font-size: 14px; line-height: 1.55; position: relative;
  transition: background-color .18s, border-color .18s, color .18s;
}
.bbv-checks label::before {
  content: ""; position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  border-radius: 5px; border: 2px solid #b8c2d6; background: #fff; box-sizing: border-box;
}
.bbv-checks input:checked + label { background: var(--v-soft); border-color: var(--v-acc); color: var(--v-mute); }
.bbv-checks input:checked + label::before {
  background: var(--v-acc-ink); border-color: var(--v-acc-ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 14px; background-position: center; background-repeat: no-repeat;
}
.bbv-checks input:focus-visible + label { outline: 2px solid var(--v-acc); outline-offset: 2px; }
.bbv p.bbv-prog { font-size: 12.5px; color: var(--v-mute); margin-top: 10px !important; text-align: right; }
.bbv-prog .bbv-done { font-weight: 700; color: var(--v-acc-ink); }

/* ---------- 9 location ---------- */
.bbv-map {
  position: relative; height: 230px; border-radius: 12px; overflow: hidden;
  background-color: var(--v-soft);
  background-image: linear-gradient(var(--v-rule) 1px, transparent 1px), linear-gradient(90deg, var(--v-rule) 1px, transparent 1px);
  background-size: 28px 28px;
}
.bbv-area { position: absolute; right: 12px; bottom: 8px; font-size: 12px; font-weight: 700; color: var(--v-mute); }
.bbv-pin {
  position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center;
  font-size: 12px; font-weight: 700; color: var(--v-navy); white-space: nowrap; text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.bbv-pin i { order: 2; width: 12px; height: 12px; border-radius: 50%; background: var(--v-navy); border: 3px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); margin-top: 3px; }
.bbv-pin.is-main { font-size: 13.5px; color: var(--v-acc-ink); }
.bbv-pin.is-main i { width: 16px; height: 16px; background: var(--v-acc); }
.bbv-js .bbv:not(.is-on):not(.is-still) .bbv-pin { opacity: 0; transform: translate(-50%, -80%); }
.bbv-pinlist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.bbv-pinlist b { color: var(--v-navy); }
.bbv-pinlist span { color: var(--v-mute); }
.bbv-pinlist li.is-main b { color: var(--v-acc-ink); }

/* ---------- 10 tabs ---------- */
.bbv-tablist { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--v-rule); }
.bbv-tablist [role="tab"] {
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; background: none; border: 0;
  padding: 10px 14px; margin-bottom: -2px; color: var(--v-mute); border-bottom: 2px solid transparent;
  transition: color .18s, border-color .18s;
}
.bbv-tablist [role="tab"][aria-selected="true"] { color: var(--v-acc-ink); border-bottom-color: var(--v-acc); }
.bbv-panel { padding-top: 14px; }
.bbv p.bbv-paneltitle { font-size: 15px; font-weight: 700; color: var(--v-navy); margin-bottom: 8px !important; }
.bbv-js .bbv-tabs.is-ready p.bbv-paneltitle { display: none; }
.bbv-js .bbv-tabs:not(.is-ready) .bbv-tablist { display: none; }
.bbv-js .bbv-tabs.is-ready .bbv-panel[data-hide] { display: none; }
.bbv-panel + .bbv-panel { border-top: 1px dashed var(--v-rule); margin-top: 14px; }
.bbv-js .bbv-tabs.is-ready .bbv-panel + .bbv-panel { border-top: 0; margin-top: 0; }
.bbv-panel dl { margin: 0; display: grid; gap: 0; }
.bbv-panel dl > div { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--v-rule); font-size: 14px; }
.bbv-panel dl > div:first-child { border-top: 0; }
.bbv-panel dt { color: var(--v-mute); font-weight: 600; }
.bbv-panel dd { margin: 0; color: var(--v-ink); font-weight: 600; }
.bbv .bbv-panel > p:not(.bbv-paneltitle) { font-size: 14px; line-height: 1.7; margin-top: 8px !important; }

/* ---------- 11 schedule ---------- */
.bbv-sched { display: grid; gap: 6px; }
.bbv-axis, .bbv-day { display: grid; grid-template-columns: 2.4em minmax(0, 1fr); gap: 8px; align-items: center; }
.bbv-axis-in { position: relative; height: 16px; }
.bbv-axis-in i { position: absolute; transform: translateX(-50%); font-style: normal; font-size: 11px; color: var(--v-mute); font-variant-numeric: tabular-nums; }
.bbv-dl { font-size: 13.5px; font-weight: 700; color: var(--v-navy); text-align: center; }
.bbv-dt { position: relative; height: 26px; background: var(--v-track); border-radius: 6px; overflow: hidden; }
.bbv-open { position: absolute; top: 0; bottom: 0; background: var(--v-navy); border-radius: 6px; transform-origin: left center; transition: transform .7s ease; transition-delay: calc(var(--i, 0) * .06s); }
.bbv-break { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, #fff 0 4px, color-mix(in srgb, var(--v-acc) 45%, #fff) 4px 8px); }
.bbv-off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--v-mute); }
.bbv-dtx { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bbv-day { position: relative; }
.bbv-js .bbv:not(.is-on):not(.is-still) .bbv-open { transform: scaleX(0); }
.bbv-js .bbv:not(.is-on):not(.is-still) .bbv-day { opacity: 1; transform: none; }
.bbv p.bbv-legend { font-size: 12px; color: var(--v-mute); margin-top: 6px !important; display: flex; gap: 6px 14px; align-items: center; justify-content: flex-end; }
.bbv-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.bbv-legend i.o { background: var(--v-navy); }
.bbv-legend i.b { background: repeating-linear-gradient(135deg, #fff 0 3px, color-mix(in srgb, var(--v-acc) 45%, #fff) 3px 6px); border: 1px solid var(--v-rule); }

/* ---------- 12 factors ---------- */
.bbv-fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.bbv-f { padding: 13px 14px; border-radius: 10px; background: var(--v-soft); border-top: 3px solid var(--v-acc); }
.bbv-f b { display: block; font-size: 14.5px; color: var(--v-navy); }
.bbv-f span { display: block; font-size: 12.5px; color: var(--v-mute); margin-top: 3px; line-height: 1.5; }
.bbv-fsum { display: flex; flex-direction: column; align-items: center; margin-top: 8px; }
.bbv-fsum span { color: var(--v-acc); font-size: 18px; line-height: 1; }
.bbv-fsum b { margin-top: 6px; padding: 10px 22px; border-radius: 999px; background: var(--v-navy); color: #fff; font-size: 14.5px; }

/* 움직임 줄이기 — 방문자 기기 설정을 따른다 */
@media (prefers-reduced-motion: reduce) {
  .bbv *, .bbv *::before, .bbv *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 480px) {
  .bbv { padding: 18px 16px 16px; }
}
