.bi-detail {
  --dt-border: rgba(94, 234, 212, 0.16);
  --dt-wash: rgba(14, 28, 48, 0.9);
  --dt-hover: rgba(34, 211, 238, 0.08);
  --dt-dialog: #0e1c30;
  --dt-ink: #e8f4ff;
  --dt-muted: #8aa0b8;
  --dt-primary: #22d3ee;
  --dt-secondary: #818cf8;
  --dt-secondary-bg: rgba(129, 140, 248, 0.12);
  --dt-pad: clamp(16px, 2vw, 26px);
  display: grid;
  gap: 18px;
  min-width: 0;
  color: var(--dt-ink);
  font-variant-numeric: tabular-nums;
}
.bi-detail .dt-panel, .bi-detail .dt-stat {
  min-width: 0;
  background:
    linear-gradient(160deg, rgba(16, 28, 48, 0.94), rgba(8, 16, 32, 0.92));
  border: 1px solid var(--dt-border);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.bi-detail .dt-panel { overflow: hidden; }
.bi-detail .dt-panel > header {
  position: static;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 18px;
  padding: 19px var(--dt-pad);
  background: rgba(10, 20, 38, 0.72);
  border-bottom: 1px solid var(--dt-border);
}
.bi-detail h2 { margin: 0; color: var(--dt-ink); font-size: 17px; line-height: 1.5; }
.bi-detail small, .bi-detail .dt-count { color: var(--dt-muted); font-size: 12px; line-height: 1.6; }
.bi-detail header div > small { display: block; margin-top: 4px; }
.bi-detail .dt-sale { display: inline-flex; align-items: center; gap: 8px; color: var(--dt-muted); font-size: 13px; }
.bi-detail .dt-sale select { color: var(--dt-ink); background: var(--dt-wash); border: 1px solid var(--dt-border); border-radius: 8px; padding: 8px; font: inherit; }
.bi-detail .dt-search { position: relative; width: 240px; max-width: 100%; }
.bi-detail .dt-search > span { position: absolute; top: 50%; left: 14px; width: 12px; height: 12px; transform: translateY(-60%); border: 1.6px solid var(--dt-muted); border-radius: 50%; pointer-events: none; }
.bi-detail .dt-search > span::after { content: ''; position: absolute; top: 9px; left: 8px; width: 6px; height: 1.6px; transform: rotate(45deg); background: var(--dt-muted); }
.bi-detail .dt-search input {
  width: 100%;
  padding: 10px 12px 10px 37px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 10px;
  background: rgba(8, 16, 32, 0.9);
  color: var(--dt-ink);
  font: inherit;
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.04);
}
.bi-detail .dt-search input::placeholder { color: var(--dt-muted); }
.bi-detail .dt-count { padding: 8px var(--dt-pad); }
.bi-detail .dt-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.bi-detail .dt-stat { display: grid; align-content: start; gap: 7px; padding: 21px var(--dt-pad); position: relative; overflow: hidden; }
.bi-detail .dt-stat:first-child {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(129, 140, 248, 0.22), transparent 50%),
    linear-gradient(126deg, #0b3a4a 0%, #0e5f73 55%, #1d4ed8 130%);
  border-color: rgba(34, 211, 238, 0.42);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.14), 0 10px 28px rgba(14, 165, 233, 0.22);
}
.bi-detail .dt-stat span { display: flex; align-items: center; gap: 7px; color: var(--dt-muted); font-size: 13px; font-weight: 600; }
.bi-detail .dt-stat span::before { content: ''; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--dt-secondary); box-shadow: 0 0 8px rgba(129, 140, 248, 0.55); }
.bi-detail .dt-stat:nth-child(-n+2) span::before { background: var(--dt-primary); box-shadow: 0 0 8px rgba(34, 211, 238, 0.55); }
.bi-detail .dt-stat strong {
  color: #f0f9ff;
  line-height: 1.15;
  font-size: clamp(22px, 2.35vw, 38px);
  font-weight: 650;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
  text-shadow: 0 0 18px rgba(125, 211, 252, 0.16);
}
.bi-detail .dt-stat:first-child span { color: #bae6fd; }
.bi-detail .dt-stat:first-child strong { color: #ecfeff; text-shadow: 0 0 24px rgba(165, 243, 252, 0.28); }
.bi-detail .dt-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.bi-detail .dt-ad-tables { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 560px),1fr)); align-items: start; gap: 18px; min-width: 0; }
.bi-detail .dt-ad-tables th, .bi-detail .dt-ad-tables td { padding-inline: clamp(10px,1vw,16px); }
.bi-detail .dt-ad-tables td:first-child { background: rgba(8, 16, 32, 0.96); }
.bi-detail .dt-ad-tables :is(th,td):first-child { position: sticky; left: 0; z-index: 1; }
.bi-detail table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.55; }
.bi-detail th, .bi-detail td { padding: 12px 16px; text-align: right; white-space: nowrap; border: 0; border-bottom: 1px solid var(--dt-border); }
.bi-detail th:first-child, .bi-detail td:first-child { text-align: left; padding-left: var(--dt-pad); }
.bi-detail th:last-child, .bi-detail td:last-child { padding-right: var(--dt-pad); }
.bi-detail th { color: #93c5fd; background: rgba(34, 211, 238, 0.07); font-size: 12px; font-weight: 600; }
.bi-detail tbody tr:last-child > td { border-bottom: 0; }
.bi-detail td:first-child { font-weight: 600; color: #f1f5f9; }
.bi-detail tbody tr:hover > td, .bi-detail tbody tr:focus-within > td { background: var(--dt-hover); }
.bi-detail th button, .bi-detail .dt-item { border: 0; border-radius: 3px; padding: 0; color: inherit; background: transparent; font: inherit; text-align: inherit; cursor: pointer; }
.bi-detail th[aria-sort='ascending'], .bi-detail th[aria-sort='descending'], .bi-detail button:hover { color: var(--dt-primary); }
.bi-detail .dt-item { display: flex; align-items: baseline; gap: 8px; width: 100%; min-width: 170px; max-width: 360px; white-space: normal; font-weight: 600; }
.bi-detail .dt-item i { flex: none; color: var(--dt-secondary); font-style: normal; }
.bi-detail .dt-item[aria-expanded='true'] { color: var(--dt-primary); text-shadow: 0 0 12px rgba(34, 211, 238, 0.28); }
.bi-detail .dt-item small, .bi-detail .dt-files small { display: block; margin-top: 3px; overflow-wrap: anywhere; font-weight: 400; }
.bi-detail .dt-spend { display: grid; grid-template-columns: auto 4.5em; justify-content: end; justify-items: end; align-items: baseline; gap: 4px; font-weight: 600; }
.bi-detail .dt-spend small { font-weight: 400; }
.bi-detail .dt-meter { display: block; grid-column: 1 / -1; width: 98px; height: 4px; overflow: hidden; background: rgba(148, 163, 184, 0.18); border-radius: 4px; }
.bi-detail .dt-meter i { display: block; height: 100%; background: linear-gradient(90deg, #0e7490, var(--dt-primary)); border-radius: inherit; box-shadow: 0 0 10px rgba(34, 211, 238, 0.45); }
.bi-detail td.dt-inset { padding: 0; }
.bi-detail .dt-drill {
  padding: 16px var(--dt-pad);
  border-left: 3px solid var(--dt-secondary);
  background: linear-gradient(90deg, rgba(129, 140, 248, 0.14), rgba(14, 28, 48, 0.35));
  white-space: normal;
  font-weight: 400;
}
.bi-detail .dt-drill > strong { color: #c7d2fe; }
.bi-detail .dt-drill > small { display: inline-block; margin-left: 12px; }
.bi-detail .dt-drill .dt-scroll {
  margin-top: 11px;
  background: rgba(8, 16, 32, 0.9);
  border: 1px solid var(--dt-border);
  border-radius: 8px;
}
.bi-detail .dt-empty { padding: 22px var(--dt-pad); margin: 0; color: var(--dt-muted); font-size: 13px; }
.bi-detail .dt-files { list-style: none; padding: 0; margin: 0; }
.bi-detail .dt-files li, .bi-detail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px var(--dt-pad);
  border-bottom: 1px solid var(--dt-border);
  font-size: 14px;
}
.bi-detail .dt-files li:last-child, .bi-detail details:last-child > summary, .bi-detail dl div:last-child { border-bottom: 0; }
.bi-detail .dt-files li > div { min-width: 0; }
.bi-detail .dt-download {
  flex: none;
  padding: 7px 11px;
  border-radius: 8px;
  color: #c7d2fe;
  background: var(--dt-secondary-bg);
  border: 1px solid rgba(129, 140, 248, 0.28);
  font-size: 13px;
  font-weight: 600;
}
.bi-detail .dt-download:hover { text-decoration: underline; text-underline-offset: 3px; color: #e0e7ff; }
.bi-detail summary { cursor: pointer; list-style: none; }
.bi-detail summary:hover, .bi-detail details[open] > summary { background: var(--dt-hover); }
.bi-detail summary::-webkit-details-marker { display: none; }
.bi-detail summary > span:first-child { font-weight: 600; }
.bi-detail summary > span:first-child::before { content: '▸'; margin-right: 8px; color: var(--dt-secondary); }
.bi-detail details[open] > summary > span:first-child::before { content: '▾'; }
.bi-detail summary small { display: block; padding-left: 16px; font-weight: 400; }
.bi-detail summary > span:last-child { color: var(--dt-muted); font-size: 12px; flex-shrink: 0; }
.bi-detail .dt-fields { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px var(--dt-pad); background: rgba(34, 211, 238, 0.05); }
.bi-detail .dt-fields span {
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 6px;
  padding: 3px 8px;
  color: #a5f3fc;
  background: rgba(8, 16, 32, 0.85);
  font-size: 12px;
}
.bi-detail dl { margin: 0; padding: 0 var(--dt-pad); }
.bi-detail dl div { display: grid; grid-template-columns: minmax(130px,30%) 1fr; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--dt-border); font-size: 13px; line-height: 1.55; }
.bi-detail dt { font-weight: 600; color: #e2e8f0; }
.bi-detail dd { margin: 0; color: var(--dt-muted); }
.bi-detail :is(input,summary,a,button):focus-visible { outline: 2px solid var(--dt-primary); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.16); }
.bi-detail summary:focus-visible { outline-offset: -3px; }

html[data-theme='light'] .bi-detail {
  --dt-border: rgba(37, 99, 235, 0.12);
  --dt-wash: rgba(241, 245, 249, 0.95);
  --dt-hover: rgba(14, 165, 233, 0.06);
  --dt-dialog: #fff;
  --dt-ink: #17324d;
  --dt-muted: #5d738c;
  --dt-primary: #0284c7;
  --dt-secondary: #6366f1;
  --dt-secondary-bg: rgba(99, 102, 241, 0.1);
}
html[data-theme='light'] .bi-detail .dt-panel,
html[data-theme='light'] .bi-detail .dt-stat {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.94));
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
html[data-theme='light'] .bi-detail .dt-panel > header {
  background: rgba(255, 255, 255, 0.86);
}
html[data-theme='light'] .bi-detail .dt-search input {
  background: #ffffff;
  border-color: rgba(14, 165, 233, 0.2);
  color: #17324d;
}
html[data-theme='light'] .bi-detail .dt-stat:first-child {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(165, 180, 252, 0.3), transparent 48%),
    linear-gradient(126deg, #e0f2fe 0%, #bae6fd 45%, #c7d2fe 100%);
  border-color: rgba(2, 132, 199, 0.28);
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.14);
}
html[data-theme='light'] .bi-detail .dt-stat span { color: #64748b; }
html[data-theme='light'] .bi-detail .dt-stat strong {
  color: #0f2740;
  text-shadow: none;
}
html[data-theme='light'] .bi-detail .dt-stat:first-child span { color: #0369a1; }
html[data-theme='light'] .bi-detail .dt-stat:first-child strong {
  color: #082f49;
  text-shadow: none;
}
html[data-theme='light'] .bi-detail th {
  color: #475569;
  background: rgba(14, 165, 233, 0.07);
}
html[data-theme='light'] .bi-detail td:first-child { color: #0f2740; }
html[data-theme='light'] .bi-detail .dt-ad-tables td:first-child { background: #ffffff; }
html[data-theme='light'] .bi-detail .dt-meter { background: rgba(148, 163, 184, 0.22); }
html[data-theme='light'] .bi-detail .dt-meter i {
  background: linear-gradient(90deg, #38bdf8, #0284c7);
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.28);
}
html[data-theme='light'] .bi-detail .dt-drill {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), rgba(248, 250, 252, 0.8));
}
html[data-theme='light'] .bi-detail .dt-drill > strong { color: #4f46e5; }
html[data-theme='light'] .bi-detail .dt-drill .dt-scroll {
  background: #ffffff;
}
html[data-theme='light'] .bi-detail .dt-download {
  color: #4338ca;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.22);
}
html[data-theme='light'] .bi-detail .dt-download:hover { color: #312e81; }
html[data-theme='light'] .bi-detail .dt-fields {
  background: rgba(14, 165, 233, 0.05);
}
html[data-theme='light'] .bi-detail .dt-fields span {
  color: #0369a1;
  background: #ffffff;
  border-color: rgba(14, 165, 233, 0.18);
}
html[data-theme='light'] .bi-detail dt { color: #0f2740; }
html[data-theme='light'] .bi-detail :is(input,summary,a,button):focus-visible {
  outline-color: #0284c7;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.bi-detail .dt-source-link, .bi-detail .dt-scope a, .bi-detail .dt-coverage a {
  color: var(--dt-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bi-detail .dt-source-link {
  display: block;
  width: fit-content;
  margin-top: 3px;
  padding: 3px 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.bi-detail .dt-scope, .bi-detail .dt-coverage, .bi-detail .dt-origin {
  margin: 0;
  color: var(--dt-muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.bi-detail > .dt-scope { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.bi-detail > .dt-scope .dt-source-link { display: inline; margin: 0; }
.bi-detail .dt-panel > .dt-scope, .bi-detail .dt-manifest > .dt-scope { padding: 10px var(--dt-pad); }
.bi-detail .dt-drill > .dt-scope { margin-top: 8px; }
.bi-detail .dt-coverage { display: grid; gap: 4px; }
.bi-detail .dt-coverage a { margin-left: 6px; }
.bi-detail .dt-groups h3 { margin: 0; padding: 15px var(--dt-pad) 8px; font-size: 14px; }
.bi-detail .dt-trace {
  width: min(1000px,calc(100% - 28px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  color: var(--dt-ink);
  background: var(--dt-dialog);
  border: 1px solid var(--dt-border);
  border-radius: 12px;
  overflow: auto;
  overscroll-behavior: contain;
}
.bi-detail .dt-trace::backdrop { background: rgba(0,0,0,.56); }
.bi-detail .dt-trace > header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 16px var(--dt-pad);
  background: inherit;
  border-bottom: 1px solid var(--dt-border);
}
.bi-detail .dt-trace header p { margin: 2px 0 0; color: var(--dt-muted); font-size: 13px; }
.bi-detail .dt-return { padding: 6px 11px; border: 1px solid var(--dt-border); border-radius: 6px; background: var(--dt-wash); color: var(--dt-ink); white-space: nowrap; }
.bi-detail .dt-trace .dt-origin { margin: 14px var(--dt-pad) 2px; color: var(--dt-ink); }
.bi-detail .dt-trace .dt-scope { margin: 0 var(--dt-pad) 14px; }
.bi-detail .dt-trace .dt-download { display: block; width: fit-content; padding: 2px 0; border: 0; background: none; color: var(--dt-primary); text-decoration: underline; text-underline-offset: 3px; }
.bi-detail .dt-source-name { min-width: 12em; max-width: 25em; white-space: normal; text-align: left; }
.bi-detail .dt-conflict { display: block; max-width: 18em; white-space: normal; }
.bi-detail .dt-trace th { white-space: normal; }
.bi-detail .dt-scroll:focus-visible { outline: 2px solid var(--dt-primary); outline-offset: -2px; }
@media (max-width: 600px) {
  .bi-detail .dt-trace { max-height: calc(100dvh - 20px); }
  .bi-detail summary { flex-wrap: wrap; }
}
@media (max-width: 980px) { .bi-detail .dt-stats { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 600px) {
  .bi-detail { gap: 14px; }
  .bi-detail .dt-search { width: 100%; margin-top: 6px; }
  .bi-detail .dt-search input { font-size: 16px; }
  .bi-detail .dt-stats { gap: 8px; }
  .bi-detail .dt-stat { padding: 14px 12px; }
  .bi-detail .dt-panel > header { padding-block: 14px; }
  .bi-detail .dt-panel > header > small { width: 100%; }
  .bi-detail th, .bi-detail td { padding: 10px; }
  .bi-detail .dt-item { width: clamp(142px,38vw,210px); min-width: 0; }
  .bi-detail .dt-drill > small { display: block; margin-left: 0; }
  .bi-detail .dt-files li, .bi-detail summary { padding-block: 12px; }
  .bi-detail dl div { grid-template-columns: 1fr; gap: 3px; }
}
