.brand-block,
.dashboard-brand,
.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.console-logo {
  width: 154px;
  height: auto;
  max-height: 44px;
  flex: 0 0 auto;
  object-fit: contain;
  background: transparent;
}

.topbar-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.environment-switcher {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  white-space: nowrap;
}

.environment-switcher select {
  width: 104px;
  min-height: 36px;
  padding: 7px 30px 7px 10px;
  font-weight: 650;
  color: var(--text);
}

.dashboard-time-flow-panel {
  margin-bottom: 12px;
}

.dashboard-time-flow-panel .dashboard-chart-box {
  height: 440px;
}

.dashboard-time-flow-panel header {
  align-items: flex-start;
  gap: 16px;
}

.dashboard-chart-controls {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.dashboard-chart-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-chart-controls input {
  width: 116px;
  min-height: 34px;
  padding: 6px 9px;
}

.dashboard-record-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.dashboard-record-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.dashboard-record-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.dashboard-record-dialog h2 {
  margin: 0;
  font-size: 18px;
}

.dashboard-record-dialog p {
  margin: 4px 0 0;
  color: var(--muted);
  word-break: break-word;
}

.dashboard-record-popup-body {
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  padding: 16px 18px 18px;
}

.dashboard-record-popup-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dashboard-record-popup-meta div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dashboard-record-popup-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-record-popup-meta strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.dashboard-record-popup-json {
  max-height: 54dvh;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.5;
}

.login-brand {
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  text-align: center;
}

.login-logo {
  width: min(250px, 78vw);
  height: auto;
  max-height: 76px;
  object-fit: contain;
  background: transparent;
}

.login-brand h1 {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .console-logo {
    width: 128px;
    max-height: 38px;
  }

  .topbar-controls {
    width: 100%;
    justify-content: space-between;
  }

  .environment-switcher select {
    width: 96px;
  }

  .dashboard-time-flow-panel .dashboard-chart-box {
    height: 360px;
  }

  .dashboard-time-flow-panel header,
  .dashboard-chart-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-chart-controls input {
    width: 100%;
  }

  .dashboard-record-dialog header {
    align-items: stretch;
    flex-direction: column;
  }
}
