#test-debug-panel {
  position: fixed;
  top: 74px;
  left: 18px;
  z-index: 99990;
  width: min(430px, calc(100vw - 36px));
  max-height: calc(100vh - 110px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f8fafc;
  background: rgba(10, 14, 22, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.42);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  font: 12px/1.45 Arial, Helvetica, sans-serif;
  backdrop-filter: blur(10px);
}

#test-debug-panel[hidden] {
  display: none;
}

.test-debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: linear-gradient(90deg, #16324f, #5b2437);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

#test-debug-panel.is-dragging .test-debug-header {
  cursor: grabbing;
}

#test-debug-panel.is-dragging {
  transition: none;
}

.test-debug-title {
  min-width: 0;
}

.test-debug-title strong {
  display: block;
  font-size: 13px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.test-debug-title span {
  color: #cbd5e1;
  font-size: 11px;
}

.test-debug-close {
  width: 28px;
  height: 28px;
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  cursor: pointer;
  font-size: 18px;
  line-height: 28px;
}

.test-debug-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.test-debug-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100vh - 164px);
  flex-direction: column;
  overflow: hidden;
}

.test-debug-summary {
  flex: 0 0 auto;
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.test-debug-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.test-debug-kpi {
  padding: 9px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.test-debug-kpi span {
  display: block;
  color: #94a3b8;
  font-size: 10px;
  text-transform: uppercase;
}

.test-debug-kpi strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  color: #ffffff;
}

.test-debug-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}

.test-debug-pill {
  padding: 7px 8px;
  background: rgba(30, 41, 59, 0.84);
  border-left: 3px solid #38bdf8;
}

.test-debug-pill[data-kind="image"] { border-color: #22c55e; }
.test-debug-pill[data-kind="js"] { border-color: #facc15; }
.test-debug-pill[data-kind="css"] { border-color: #38bdf8; }
.test-debug-pill[data-kind="other"] { border-color: #c084fc; }

.test-debug-pill span {
  display: block;
  color: #cbd5e1;
  font-size: 10px;
}

.test-debug-pill strong {
  color: #fff;
  font-size: 13px;
}

.test-debug-section-title {
  margin: 12px 0 7px;
  color: #e2e8f0;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.test-debug-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 7px;
}

.test-debug-toolbar .test-debug-section-title {
  margin: 0;
}

.test-debug-sort {
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #e0f2fe;
  background: rgba(14, 116, 144, 0.35);
  padding: 5px 8px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.test-debug-sort:hover,
.test-debug-sort[data-active="1"] {
  border-color: rgba(34, 197, 94, 0.7);
  color: #dcfce7;
  background: rgba(22, 101, 52, 0.45);
}

.test-debug-note {
  margin: 7px 0 10px;
  color: #a8b3c4;
  font-size: 11px;
}

.test-debug-list {
  display: grid;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 150px;
  overflow: auto;
  padding: 8px 12px 12px;
}

.test-debug-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 7px 8px;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.test-debug-path {
  min-width: 0;
  color: #e5e7eb;
  overflow-wrap: anywhere;
}

.test-debug-meta {
  text-align: right;
  color: #f8fafc;
  white-space: nowrap;
}

.test-debug-status {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 5px;
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.22);
  font-size: 10px;
}

.test-debug-status.loaded {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.22);
}

.test-debug-status.missing,
.test-debug-status.error {
  color: #fee2e2;
  background: rgba(239, 68, 68, 0.24);
}

.test-debug-empty {
  padding: 10px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.74);
  border: 1px dashed rgba(148, 163, 184, 0.35);
}

@media (max-width: 640px) {
  #test-debug-panel {
    top: 58px;
    left: 10px;
    width: calc(100vw - 20px);
  }

  .test-debug-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.site-debug-panel {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 100200;
	display: none;
	min-width: 13rem;
	padding: 0.65rem;
	color: rgba(248, 252, 255, 0.94);
	background: rgba(14, 20, 20, 0.92);
	border: 1px solid rgba(151, 255, 236, 0.32);
	border-radius: 4px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
	backdrop-filter: blur(10px);
}

.site-debug-panel.is-open {
	display: grid;
	gap: 0.45rem;
}

.site-debug-panel__title {
	color: rgba(244, 210, 93, 0.95);
	font-family: var(--font-page-banner);
	font-size: 0.92rem;
	text-transform: uppercase;
	text-shadow: 1px 1px #0891c5;
}

.site-debug-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
	width: 100%;
	padding: 0.45rem 0.55rem;
	color: rgba(248, 252, 255, 0.88);
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(151, 255, 236, 0.18);
	border-radius: 4px;
	font-family: var(--font-long-text);
	font-size: 0.78rem;
	text-transform: uppercase;
	cursor: pointer;
}

.site-debug-toggle:hover,
.site-debug-toggle[aria-pressed="true"] {
	color: rgba(14, 20, 20, 0.95);
	background: rgba(244, 210, 93, 0.78);
	border-color: rgba(244, 210, 93, 0.92);
}

.typography-debug-tooltip {
	position: fixed;
	z-index: 100201;
	display: none;
	max-width: 22rem;
	padding: 0.7rem 0.8rem;
	color: rgba(248, 252, 255, 0.94);
	background: rgba(10, 15, 16, 0.94);
	border: 1px solid rgba(244, 210, 93, 0.5);
	border-radius: 4px;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.44);
	font-family: var(--font-long-text);
	font-size: 0.78rem;
	line-height: 1.35;
	pointer-events: none;
}

.typography-debug-tooltip.is-visible {
	display: block;
}

.typography-debug-tooltip__head {
	margin-bottom: 0.35rem;
	color: rgba(244, 210, 93, 0.95);
	font-family: var(--font-page-banner);
	font-size: 0.86rem;
	text-transform: uppercase;
	text-shadow: 1px 1px #0891c5;
}

.typography-debug-tooltip__vars {
	display: grid;
	gap: 0.22rem;
	margin-top: 0.45rem;
}

.typography-debug-tooltip code {
	color: rgba(151, 255, 236, 0.92);
	font-family: Consolas, "Courier New", monospace;
	font-size: 0.78rem;
}

.typography-debug-tooltip small {
	display: block;
	margin: 0.06rem 0 0.18rem;
	color: rgba(248, 252, 255, 0.48);
	font-size: 0.68rem;
}

.typography-debug-tooltip span,
.typography-debug-tooltip__empty {
	color: rgba(248, 252, 255, 0.72);
}

.typography-debug-enabled *:hover {
	outline: 1px solid rgba(244, 210, 93, 0.45);
	outline-offset: 2px;
}

.site-fluidity-meter {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 100190;
	display: none;
	min-width: 11rem;
	padding: 0.55rem 0.65rem;
	color: rgba(248, 252, 255, 0.92);
	background: rgba(14, 20, 20, 0.84);
	border: 1px solid rgba(151, 255, 236, 0.28);
	border-radius: 4px;
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
	backdrop-filter: blur(8px);
	pointer-events: none;
}

.site-fluidity-meter.is-visible {
	display: block;
}

.site-debug-panel.is-open ~ .site-fluidity-meter {
	top: 12.8rem;
}

.site-fluidity-meter__head {
	margin-bottom: 0.35rem;
	color: rgba(244, 210, 93, 0.95);
	font-family: var(--font-page-banner);
	font-size: 0.78rem;
	text-transform: uppercase;
	text-shadow: 1px 1px #0891c5;
}

.site-fluidity-meter__grid {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.22rem 0.6rem;
	align-items: baseline;
	font-family: var(--font-long-text);
	font-size: 0.72rem;
	line-height: 1.2;
}

.site-fluidity-meter__grid span {
	color: rgba(151, 255, 236, 0.72);
	text-transform: uppercase;
}

.site-fluidity-meter__grid strong {
	justify-self: end;
	color: rgba(248, 252, 255, 0.94);
	font-weight: 600;
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.65);
}
