.clean-app {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% 44%, rgba(139, 125, 255, 0.09), transparent 32rem),
    #0a0b10;
}

.clean-app #app {
  grid-template-rows: auto 1fr;
}

.clean-app .topbar {
  align-items: center;
  padding: 22px 28px;
}

.clean-app .ident-head {
  align-items: center;
  gap: 10px;
}

.clean-app .ident-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.local-badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 4px 7px;
  text-transform: uppercase;
}

.clean-app #about-btn,
.clean-app #about-btn-m,
.clean-app #tools-btn,
.clean-app #account,
.clean-app #about-modal,
.clean-app #tools-modal,
.clean-app #limit-modal,
.clean-app #queue-actions,
.clean-app #conn-field,
.clean-app #transport-field,
.clean-app #instructions-field {
  display: none !important;
}

.clean-app .modal small {
  display: none;
}

.clean-app .modal-content {
  max-width: 430px;
}

.clean-app .tab-panel {
  gap: 18px;
}

.clean-app .stage {
  min-height: 0;
}

.debug-hud {
  --debug-accent: #9b8cff;
  background: rgba(12, 13, 19, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  bottom: auto;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  color: #d9dae2;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  left: auto;
  max-height: calc(100dvh - 112px);
  overflow: hidden;
  position: fixed;
  right: 18px;
  top: 88px;
  width: min(360px, calc(100vw - 36px));
  z-index: 28;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.debug-hud-toggle {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: #f3f3f7;
  cursor: pointer;
  display: grid;
  font: 600 11px/1 "Geist Mono", ui-monospace, monospace;
  grid-template-columns: auto 1fr auto auto;
  gap: 9px;
  padding: 12px 13px;
  text-align: left;
  width: 100%;
}

.debug-live-dot {
  background: #737681;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(115, 118, 129, 0.12);
  height: 6px;
  transition: background 160ms ease, box-shadow 160ms ease;
  width: 6px;
}

.debug-hud[data-live="true"] .debug-live-dot {
  background: #56d68b;
  box-shadow: 0 0 0 3px rgba(86, 214, 139, 0.14), 0 0 10px rgba(86, 214, 139, 0.32);
}

.debug-head-time {
  color: var(--debug-accent);
  font-variant-numeric: tabular-nums;
}

.debug-chevron {
  fill: none;
  height: 14px;
  stroke: #7f818b;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  transition: transform 160ms ease;
  width: 14px;
}

.debug-hud.collapsed .debug-chevron {
  transform: rotate(180deg);
}

.debug-hud-body {
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  max-height: calc(100dvh - 160px);
  overflow: auto;
  padding: 11px 13px 13px;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  scrollbar-width: thin;
}

.debug-hud.collapsed .debug-hud-body {
  display: none;
}

.debug-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.debug-context span {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  color: #a9abb5;
  padding: 4px 6px;
}

.debug-identifiers {
  color: #686b76;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 8px;
  overflow: hidden;
}

.debug-identifiers span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debug-identifiers b {
  color: #9799a3;
  font-weight: 500;
}

.debug-section {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 12px;
  padding-top: 11px;
}

.debug-section h3 {
  color: #686b76;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.11em;
  margin: 0 0 9px;
  text-transform: uppercase;
}

.debug-primary-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 9px;
}

.debug-primary-grid div {
  background: rgba(155, 140, 255, 0.065);
  border: 1px solid rgba(155, 140, 255, 0.11);
  border-radius: 7px;
  min-width: 0;
  padding: 7px 6px;
}

.debug-primary-grid span,
.debug-primary-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debug-primary-grid span {
  color: #747782;
  font-size: 8px;
  margin-bottom: 5px;
}

.debug-primary-grid strong {
  color: #dcd7ff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.debug-rows {
  margin: 0;
}

.debug-rows > div {
  align-items: baseline;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 3px 0;
}

.debug-rows dt {
  color: #757883;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.debug-rows dd {
  color: #c7c8d0;
  font-variant-numeric: tabular-nums;
  margin: 0;
  max-width: 205px;
  overflow-wrap: anywhere;
  text-align: right;
}

.debug-raw-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: #757883;
  margin-top: 11px;
  padding-top: 10px;
}

.debug-raw-wrap summary {
  cursor: pointer;
  user-select: none;
}

#debug-raw {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 7px;
  color: #9da0ac;
  font: 9px/1.55 "Geist Mono", ui-monospace, monospace;
  margin: 8px 0 0;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 600px) {
  .clean-app .topbar {
    padding: 16px;
  }

  .clean-app .ident-title {
    font-size: 15px;
  }

  .local-badge {
    display: none;
  }

  .debug-hud {
    bottom: auto;
    left: auto;
    max-height: 48dvh;
    right: 12px;
    top: 68px;
    width: min(350px, calc(100vw - 24px));
  }

  .debug-hud-body {
    max-height: calc(48dvh - 42px);
  }

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