.devtools-panel {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 12px;
  overflow: hidden;
  border-top: 1px solid var(--border-visible);
}

/* Tab bar */
.devtools-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 8px;
  height: 32px;
  flex-shrink: 0;
  user-select: none;
}

.devtools-tab {
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: color var(--duration-fast) var(--ease-in-out),
              border-color var(--duration-fast) var(--ease-in-out);
  font-family: var(--font-ui);
  letter-spacing: 0.02em;
}

.devtools-tab:hover {
  color: var(--text-secondary);
}

.devtools-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.devtools-tab-spacer {
  flex: 1;
}

.devtools-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
}

.devtools-tab-badge.error {
  background: color-mix(in srgb, var(--status-error) 20%, transparent);
  color: var(--error);
}

.devtools-tab-badge.count {
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
  color: var(--accent-primary);
}

.devtools-close-btn {
  padding: 4px 8px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  line-height: 1;
  font-family: var(--font-ui);
}

.devtools-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* Content area */
.devtools-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.devtools-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

/* Console view */
.devtools-console {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
}

.console-entry {
  display: flex;
  padding: 2px 12px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 8px;
  align-items: flex-start;
}

.console-entry:hover {
  background: var(--bg-secondary);
}

.console-entry.level-error {
  background: color-mix(in srgb, var(--status-error) 6%, transparent);
  border-left: 2px solid var(--error);
}

.console-entry.level-warning {
  background: color-mix(in srgb, var(--accent-primary) 6%, transparent);
  border-left: 2px solid var(--accent-primary);
}

.console-entry.level-info {
  border-left: 2px solid var(--accent-secondary);
}

.console-level {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  width: 40px;
  flex-shrink: 0;
  padding-top: 1px;
}

.console-level.log { color: var(--text-secondary); }
.console-level.info { color: var(--accent-secondary); }
.console-level.warning { color: var(--accent-primary); }
.console-level.error { color: var(--error); }
.console-level.debug { color: var(--text-muted); }

.console-text {
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
}

.console-source {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-time {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 60px;
}

/* Network view */
.devtools-network {
  flex: 1;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11px;
}

.network-header {
  display: grid;
  grid-template-columns: 60px 1fr 80px 60px 80px;
  gap: 8px;
  padding: 4px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-visible);
  font-weight: 600;
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.network-entry {
  display: grid;
  grid-template-columns: 60px 1fr 80px 60px 80px;
  gap: 8px;
  padding: 3px 12px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
}

.network-entry:hover {
  background: var(--bg-secondary);
}

.network-entry.error {
  background: color-mix(in srgb, var(--status-error) 6%, transparent);
}

.network-method {
  font-weight: 600;
  color: var(--accent-warm);
  font-size: 10px;
}

.network-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.network-status {
  font-weight: 500;
}

.network-status.ok { color: var(--accent-secondary); }
.network-status.redirect { color: var(--accent-primary); }
.network-status.error { color: var(--error); }
.network-status.pending { color: var(--text-muted); }

.network-type {
  color: var(--text-muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.network-duration {
  color: var(--text-secondary);
  font-size: 10px;
  text-align: right;
}

/* Activity view */
.devtools-activity {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  font-size: 11px;
}

.activity-entry {
  display: flex;
  padding: 4px 12px;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: flex-start;
}

.activity-entry:hover {
  background: var(--bg-secondary);
}

.activity-tool {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-primary);
  font-size: 11px;
  flex-shrink: 0;
  min-width: 180px;
}

.activity-args {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 10px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-status {
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  width: 70px;
  text-align: right;
}

.activity-status.running { color: var(--accent-primary); }
.activity-status.completed { color: var(--accent-secondary); }
.activity-status.failed { color: var(--error); }

.activity-duration {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 50px;
  text-align: right;
}

.activity-time {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 60px;
}

/* Export dropdown */
.devtools-export-wrap {
  position: relative;
}

.devtools-close-btn.active {
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
}

.devtools-export-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-visible);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px var(--shadow-color-strong);
  padding: 10px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.export-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.export-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.export-checkbox {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 0;
}

.export-checkbox:hover {
  color: var(--text-primary);
}

.export-checkbox input[type="checkbox"] {
  accent-color: var(--accent-primary);
  width: 13px;
  height: 13px;
  cursor: pointer;
  flex-shrink: 0;
}

.export-date-btns {
  display: flex;
  gap: 4px;
}

.export-date-btn {
  flex: 1;
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--font-ui);
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.export-date-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.export-date-btn.active {
  color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

.export-date-inputs {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.export-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-date-label {
  font-size: 11px;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
}

.export-date-input {
  flex: 1;
  padding: 3px 6px;
  font-size: 11px;
  font-family: var(--font-ui);
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  outline: none;
}

.export-date-input:focus {
  border-color: color-mix(in srgb, var(--accent-primary) 40%, transparent);
}

.export-submit {
  width: 100%;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-ui);
  color: var(--button-primary-fg);
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity var(--duration-fast);
}

.export-submit:hover:not(:disabled) {
  opacity: 0.85;
}

.export-submit:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Scrollbar styling */
.devtools-console::-webkit-scrollbar,
.devtools-network::-webkit-scrollbar,
.devtools-activity::-webkit-scrollbar {
  width: 6px;
}

.devtools-console::-webkit-scrollbar-track,
.devtools-network::-webkit-scrollbar-track,
.devtools-activity::-webkit-scrollbar-track {
  background: transparent;
}

.devtools-console::-webkit-scrollbar-thumb,
.devtools-network::-webkit-scrollbar-thumb,
.devtools-activity::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 3px;
}

.devtools-console::-webkit-scrollbar-thumb:hover,
.devtools-network::-webkit-scrollbar-thumb:hover,
.devtools-activity::-webkit-scrollbar-thumb:hover {
  background: var(--border-visible);
}
