.dd-action-history-dialog {
  width: min(600px, calc(100vw - 32px));
  max-height: min(76vh, 680px);
  padding: 0;
  overflow: hidden;
  color: var(--text, #e6e6e6);
  background: var(--surface, #101315);
  border: 1px solid var(--accent, #7cff6b);
  border-radius: 4px;
}

.dd-action-history-dialog[data-presentation="inspector"] {
  position: fixed;
  inset: 12px 12px 12px auto;
  width: min(340px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  max-height: none;
  margin: 0;
}

.dd-action-history-dialog[data-presentation="inspector"]::backdrop {
  background: transparent;
  backdrop-filter: none;
}

.dd-action-history-dialog::backdrop {
  background: rgb(0 0 0 / 68%);
  backdrop-filter: blur(2px);
}

.dd-action-history-panel {
  display: grid;
  min-height: 240px;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.dd-action-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #2a3035);
}

.dd-action-history-header h2,
.dd-action-history-section h3 {
  margin: 0;
  color: var(--accent-strong, #b7ffb0);
  font: 700 12px/16px "JetBrains Mono", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dd-action-history-scroll {
  overflow: auto;
  outline: none;
}

.dd-action-history-activity {
  margin: 0;
  padding: 8px 12px;
  color: var(--interaction, #ffc857);
  background: rgb(255 200 87 / 8%);
  border-bottom: 1px solid var(--interaction, #ffc857);
}

.dd-action-history-scroll:focus-visible {
  box-shadow: inset 0 0 0 2px var(--focus-ring, #b7ffb0);
}

.dd-action-history-section + .dd-action-history-section {
  border-top: 1px solid var(--border, #2a3035);
}

.dd-action-history-section h3,
.dd-action-history-empty,
.dd-action-history-row,
.dd-action-history-help {
  padding: 8px 12px;
}

.dd-action-history-empty,
.dd-action-history-help {
  margin: 0;
  color: var(--text-muted, #8a9299);
}

.dd-action-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dd-action-history-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--border, #2a3035);
  color: var(--text-muted, #8a9299);
  overflow-wrap: anywhere;
}

.dd-action-history-row.is-next {
  color: var(--text, #e6e6e6);
  border-left: 3px solid var(--accent, #7cff6b);
  background: rgb(124 255 107 / 7%);
}

.dd-action-history-next {
  flex: 0 0 auto;
  color: var(--accent, #7cff6b);
  font-size: 11px;
}

.dd-action-history-help {
  border-top: 1px solid var(--border, #2a3035);
  font-size: 11px;
}

.dd-guided-change-incoming {
  outline: 2px solid var(--interaction, #ffc857);
  outline-offset: 2px;
}

.dd-guided-change-applied {
  outline: 2px solid var(--focus-ring, #b7ffb0);
  outline-offset: 2px;
}

.dd-guided-change-mobile-indicator {
  position: fixed;
  z-index: 1000;
  top: calc(8px + env(safe-area-inset-top));
  left: 50%;
  width: min(440px, calc(100vw - 16px));
  transform: translateX(-50%);
  padding: 10px 12px;
  color: var(--text, #e6e6e6);
  background: var(--surface, #101315);
  border: 1px solid var(--interaction, #ffc857);
  border-radius: 3px;
  pointer-events: none;
}

.dd-guided-change-mobile-indicator[hidden] { display: none; }

@media (max-width: 600px), (pointer: coarse) {
  .dd-action-history-dialog[data-presentation="sheet"] {
    width: 100%;
    max-width: none;
    max-height: 72vh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dd-action-history-dialog,
  .dd-guided-change-incoming,
  .dd-guided-change-applied {
    scroll-behavior: auto;
    transition: none;
  }
}
