/* Scroll debug — scoped to site theme (#040407, #f5f2ff, rgb(68,68,68), rgb(172,172,255)) */

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.scroll-debug-app {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  height: calc(100vh - 10vh);
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.scroll-debug-app * {
  box-sizing: border-box;
}

.scroll-debug-main {
  flex: 1;
  display: flex;
  min-height: 0;
  border: 1px solid rgb(68, 68, 68);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(68, 68, 68, 0.15);
}

#scrollArea {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  scroll-behavior: auto;
  font-size: 14px;
  color: #aaa;
}

#scrollArea .row {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(68, 68, 68, 0.6);
}

#scrollArea .row span.idx {
  color: #666;
  margin-right: 1rem;
  display: inline-block;
  width: 4ch;
  text-align: right;
}

#scrollArea .row.marker {
  color: rgb(172, 172, 255);
  border-bottom-color: rgb(68, 68, 68);
}

#dashboard {
  width: min(460px, 42vw);
  min-width: min(280px, 42vw);
  flex-shrink: 0;
  background: rgba(68, 68, 68, 0.2);
  border-left: 1px solid rgb(68, 68, 68);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#dashboard h2 {
  padding: 0.75rem 1rem;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f5f2ff;
  border-bottom: 1px solid rgb(68, 68, 68);
}

#stats {
  padding: 0.75rem 1rem;
  font-size: 13px;
  line-height: 1.85;
  border-bottom: 1px solid rgb(68, 68, 68);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

.stat-group-title {
  grid-column: 1 / -1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 0.35rem;
  line-height: 2.2;
}

.stat-group-title.browser-title {
  color: #8ecf8e;
}

#stats .label {
  color: #888;
  display: inline-block;
  width: 11ch;
}

#stats .val {
  font-weight: 600;
}

#chartContainer {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgb(68, 68, 68);
}

#chartContainer canvas {
  width: 100%;
  height: 160px;
  display: block;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgb(68, 68, 68);
}

#log {
  flex: 1;
  min-height: 80px;
  overflow-y: auto;
  padding: 0.5rem 1rem;
  font-size: 11px;
  line-height: 1.55;
}

#log .entry {
  white-space: nowrap;
}

#log .entry.wheel {
  color: #8ecf8e;
}

#log .entry.sys {
  color: #888;
  font-style: italic;
}

#footer {
  padding: 0.6rem 1rem;
  border-top: 1px solid rgb(68, 68, 68);
  font-size: 12px;
  color: #888;
  text-align: center;
}

#footer kbd {
  background: rgba(68, 68, 68, 0.5);
  padding: 2px 6px;
  border-radius: 3px;
  color: #ccc;
  border: 1px solid rgb(68, 68, 68);
}

@media (max-aspect-ratio: 1/1) {
  .scroll-debug-main {
    flex-direction: column;
  }

  #dashboard {
    width: 100%;
    min-width: 0;
    max-height: 55vh;
    border-left: none;
    border-top: 1px solid rgb(68, 68, 68);
  }

  #scrollArea {
    min-height: 120px;
    max-height: 40vh;
  }
}
